CLASS v1.8.0

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

Reference

PYTHON API
physics.PrismaticJoint(/, *args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

body_a

property
body_a: physics.Body

The first body attached to the joint.

body_b

property
body_b: physics.Body

The second body attached to the joint.

collide_connected: bool

Whether the connected bodies should collide with each other.

is_valid

property
is_valid: bool

Indicates whether the joint is not destroyed.

limit_enabled: bool

Whether the translation limits are enabled.

local_anchor_a: Vec2

The local anchor point relative to body A's origin.

local_anchor_b: Vec2

The local anchor point relative to body B's origin.

lower_limit

property
lower_limit: float

The lower translation limit.

max_motor_force: float

The maximum motor force.

motor_enabled: bool

Whether the motor is enabled.

motor_force

property
motor_force: float

The current motor force.

motor_speed

property
motor_speed: float

The target motor speed.

speed

property
speed: float

The current joint translation speed.

spring_damping_ratio: float

The spring damping ratio.

spring_enabled: bool

Whether the spring is enabled.

spring_hz

property
spring_hz: float

The spring frequency in Hertz.

target_translation: float

The target translation for the motor.

translation

property
translation: float

The current joint translation.

upper_limit

property
upper_limit: float

The upper translation limit.

destroy

method
destroy(self) -> None

Destroy the joint manually.

set_limits(self, lower: float, upper: float) -> None

Set the translation limits.

Args

  • lower (float) — The lower translation limit.
  • upper (float) — The upper translation limit.

Find your next step

Start typing to search the manual.