physics.WheelJoint
pykraken.physics.WheelJoint A joint that simulates a wheel attached to a vehicle body.
More about physics.WheelJoint
Provides a suspension spring along a specified axis and an optional motor for driving rotation. Supports translation limits along the suspension axis. Ideal for vehicle wheels and similar mechanisms.
Inherits Joint
At a glance
19 membersConstructormethodbody_apropertybody_bpropertycollide_connectedpropertyis_validpropertylimit_enabledpropertylocal_anchor_apropertylocal_anchor_bpropertylower_limitpropertymax_motor_torquepropertymotor_enabledpropertymotor_speedpropertymotor_torquepropertyspring_damping_ratiopropertyspring_enabledpropertyspring_hzpropertyupper_limitpropertydestroymethodset_limitsmethodReference
PYTHON APIConstructor
methodphysics.WheelJoint(/, *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_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.
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.