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
enable_angular_motor(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.

enable_motor(enable: bool)
property frame_a ConstPointerTo_TransformState
property frame_b ConstPointerTo_TransformState
get_angular_only() bool
static get_class_type() panda3d.core.TypeHandle
get_frame_a() panda3d.core.TransformState
get_frame_b() panda3d.core.TransformState
get_hinge_angle() float

Returns the angle between node_a and node_b in degrees.

get_lower_limit() float

Returns the lower angular limit in degrees.

get_upper_limit() 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.

set_angular_only(value: bool)
set_axis(axis: panda3d.core.LVector3)

Sets the hinge’s rotation axis in world coordinates.

set_frames(ts_a: panda3d.core.TransformState, ts_b: panda3d.core.TransformState)
set_limit(low: float, high: float, softness: float, bias: float, relaxation: float)

Sets the lower and upper rotational limits in degrees.

set_max_motor_impulse(max_impulse: float)

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

set_motor_target(quat: panda3d.core.LQuaternion, dt: float)
set_motor_target(target_angle: float, dt: float)
property upper_limit float

Returns the upper angular limit in degrees.