physics.RevoluteJoint
pykraken.physics.RevoluteJoint A joint that allows two bodies to rotate around a shared anchor point.
More about physics.RevoluteJoint
Also known as a hinge or pin joint. Supports optional angle limits, a spring, and a motor. Useful for doors, wheels, pendulums, and rotating platforms.
Inherits Joint
At a glance
21 membersConstructormethodanglepropertybody_apropertybody_bpropertycollide_connectedpropertyis_validpropertylimit_enabledpropertylocal_anchor_apropertylocal_anchor_bpropertylower_limitpropertymax_motor_torquepropertymotor_enabledpropertymotor_speedpropertymotor_torquepropertyspring_damping_ratiopropertyspring_enabledpropertyspring_hzpropertytarget_anglepropertyupper_limitpropertydestroymethodset_limitsmethodReference
PYTHON APIConstructor
methodphysics.RevoluteJoint(/, *args, **kwargs)Initialize self. See help(type(self)) for accurate signature.
angle
propertyangle: floatThe current joint angle in radians.
body_a
propertybody_a: physics.BodyThe first body attached to the joint.
body_b
propertybody_b: physics.BodyThe second body attached to the joint.
collide_connected
propertycollide_connected: boolWhether the connected bodies should collide with each other.
is_valid
propertyis_valid: boolIndicates whether the joint is not destroyed.
limit_enabled
propertylimit_enabled: boolWhether the angle limits are enabled.
local_anchor_a
propertylocal_anchor_a: Vec2The local anchor point relative to body A's origin.
local_anchor_b
propertylocal_anchor_b: Vec2The local anchor point relative to body B's origin.
lower_limit
propertylower_limit: floatThe lower angle limit in radians.
max_motor_torque
propertymax_motor_torque: floatThe maximum motor torque.
motor_enabled
propertymotor_enabled: boolWhether the motor is enabled.
motor_speed
propertymotor_speed: floatThe target motor speed in radians per second.
motor_torque
propertymotor_torque: floatThe current motor torque.
spring_damping_ratio
propertyspring_damping_ratio: floatThe spring damping ratio.
spring_enabled
propertyspring_enabled: boolWhether the spring is enabled.
spring_hz
propertyspring_hz: floatThe spring frequency in Hertz.
target_angle
propertytarget_angle: floatThe target angle for the motor in radians.
upper_limit
propertyupper_limit: floatThe upper angle limit in radians.
destroy
methoddestroy(self) -> NoneDestroy the joint manually.
set_limits
methodset_limits(self, lower: float, upper: float) -> NoneSet the angle limits.
Args
- lower (
float) — The lower angle limit in radians. - upper (
float) — The upper angle limit in radians.