panda3d.bullet.BulletHingeConstraint

from panda3d.bullet import BulletHingeConstraint
class BulletHingeConstraint

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

Inheritance diagram of BulletHingeConstraint

__init__(node_a: BulletRigidBodyNode, node_b: BulletRigidBodyNode, pivot_a: LPoint3, pivot_b: LPoint3, axis_a: LVector3, axis_b: LVector3, use_frame_a: bool) → None

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: TransformState, ts_b: TransformState, use_frame_a: bool) → None

Constructs a hinge constraint which connects two rigid bodies.

__init__(node_a: BulletRigidBodyNode, pivot_a: LPoint3, axis_a: LVector3, use_frame_a: bool) → None

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: TransformState, use_frame_a: bool) → None

Creates a hinge constraint which connects one rigid body with some fixe dpoint in the world.

getHingeAngle() → float

Returns the angle between node_a and node_b in degrees.

getLowerLimit() → float

Returns the lower angular limit in degrees.

getUpperLimit() → float

Returns the upper angular limit in degrees.

getAngularOnly() → bool
setAngularOnly(value: bool) → None
setLimit(low: float, high: float, softness: float, bias: float, relaxation: float) → None

Sets the lower and upper rotational limits in degrees.

setAxis(axis: LVector3) → None

Sets the hinge’s rotation axis in world coordinates.

enableAngularMotor(enable: bool, target_velocity: float, max_impulse: float) → None

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.

enableMotor(enable: bool) → None
setMaxMotorImpulse(max_impulse: float) → None

Sets the maximum impulse used to achieve the velocity set in enable_angular_motor.

setMotorTarget(quat: LQuaternion, dt: float) → None
setMotorTarget(target_angle: float, dt: float) → None
setFrames(ts_a: TransformState, ts_b: TransformState) → None
getFrameA() → TransformState
Return type

TransformState

getFrameB() → TransformState
Return type

TransformState

static getClassType() → TypeHandle
Return type

TypeHandle

property hinge_angle

Returns the angle between node_a and node_b in degrees.

Return type

float

property lower_limit

Returns the lower angular limit in degrees.

Return type

float

property upper_limit

Returns the upper angular limit in degrees.

Return type

float

property angular_only

Getter Setter

Return type

bool

property frame_a
Return type

ConstPointerTo_TransformState

property frame_b
Return type

ConstPointerTo_TransformState