BulletHingeConstraint
from panda3d.bullet import BulletHingeConstraint
- class BulletHingeConstraint
Bases:
Bases:
BulletConstraint
The hinge constraint lets two bodies rotate around a given axis while adhering to specified limits. It’s motor can apply angular force to them.
Inheritance diagram
- __init__(node_a: BulletRigidBodyNode, node_b: BulletRigidBodyNode, pivot_a: panda3d.core.LPoint3, pivot_b: panda3d.core.LPoint3, axis_a: panda3d.core.LVector3, axis_b: panda3d.core.LVector3, use_frame_a: bool)
Creates a hinge connecting node_a to node_b. The pivot point is the point at which the body is fixed to the constraint. In other words: It specifies where on each body the rotation axis should be. This axis is specified using axis_a and axis_b. Remember, everything is specified in the bodies own coordinate system!
- __init__(node_a: BulletRigidBodyNode, node_b: BulletRigidBodyNode, ts_a: panda3d.core.TransformState, ts_b: panda3d.core.TransformState, use_frame_a: bool)
Constructs a hinge constraint which connects two rigid bodies.
- __init__(node_a: BulletRigidBodyNode, pivot_a: panda3d.core.LPoint3, axis_a: panda3d.core.LVector3, use_frame_a: bool)
Creates a hinge constraint in the same way as the other constructor, but uses the world as second body so that node_a is fixed to some point in mid- air for example.
- __init__(node_a: BulletRigidBodyNode, ts_a: panda3d.core.TransformState, use_frame_a: bool)
Creates a hinge constraint which connects one rigid body with some fixe dpoint in the world.
- enableAngularMotor(enable: bool, target_velocity: float, max_impulse: float)
Applies an impulse to the constraint so that the angle changes at target_velocity where max_impulse is the maximum impulse that is used for achieving the specified velocity.
Note that the target_velocity is in radians/second, not degrees.
- property frame_a ConstPointerTo_TransformState
- property frame_b ConstPointerTo_TransformState
- static getClassType() panda3d.core.TypeHandle
- getFrameA() panda3d.core.TransformState
- getFrameB() panda3d.core.TransformState
- setAxis(axis: panda3d.core.LVector3)
Sets the hinge’s rotation axis in world coordinates.
- setFrames(ts_a: panda3d.core.TransformState, ts_b: panda3d.core.TransformState)
- setLimit(low: float, high: float, softness: float, bias: float, relaxation: float)
Sets the lower and upper rotational limits in degrees.
- setMaxMotorImpulse(max_impulse: float)
Sets the maximum impulse used to achieve the velocity set in
enableAngularMotor()
.
- setMotorTarget(quat: panda3d.core.LQuaternion, dt: float)