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

Inheritance diagram of BulletHingeConstraint

__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.

property angular_only bool
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.

enableMotor(enable: bool)
property frame_a ConstPointerTo_TransformState
property frame_b ConstPointerTo_TransformState
getAngularOnly() bool
static getClassType() panda3d.core.TypeHandle
getFrameA() panda3d.core.TransformState
getFrameB() panda3d.core.TransformState
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.

property hinge_angle float

Returns the angle between node_a and node_b in degrees.

property lower_limit float

Returns the lower angular limit in degrees.

setAngularOnly(value: bool)
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)
setMotorTarget(target_angle: float, dt: float)
property upper_limit float

Returns the upper angular limit in degrees.