physics.PrismaticJoint
pykraken.physics.PrismaticJoint A joint that constrains two bodies to move only along a specified axis.
More about physics.PrismaticJoint
Also known as a slider joint. Supports optional translation limits, a spring, and a motor. Useful for pistons, elevators, or sliding doors.
Inherits Joint
At a glance
22 membersConstructormethodbody_apropertybody_bpropertycollide_connectedpropertyis_validpropertylimit_enabledpropertylocal_anchor_apropertylocal_anchor_bpropertylower_limitpropertymax_motor_forcepropertymotor_enabledpropertymotor_forcepropertymotor_speedpropertyspeedpropertyspring_damping_ratiopropertyspring_enabledpropertyspring_hzpropertytarget_translationpropertytranslationpropertyupper_limitpropertydestroymethodset_limitsmethodReference
PYTHON APIConstructor
methodphysics.PrismaticJoint(/, *args, **kwargs)Initialize self. See help(type(self)) for accurate signature.
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 translation 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 translation limit.
max_motor_force
propertymax_motor_force: floatThe maximum motor force.
motor_enabled
propertymotor_enabled: boolWhether the motor is enabled.
motor_force
propertymotor_force: floatThe current motor force.
motor_speed
propertymotor_speed: floatThe target motor speed.
speed
propertyspeed: floatThe current joint translation speed.
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_translation
propertytarget_translation: floatThe target translation for the motor.
translation
propertytranslation: floatThe current joint translation.
upper_limit
propertyupper_limit: floatThe upper translation limit.
destroy
methoddestroy(self) -> NoneDestroy the joint manually.
set_limits
methodset_limits(self, lower: float, upper: float) -> NoneSet the translation limits.
Args
- lower (
float) — The lower translation limit. - upper (
float) — The upper translation limit.