CLASS v1.8.0

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

Reference

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

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

angle

property
angle: float

The current joint angle in radians.

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 angle 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 angle limit in radians.

max_motor_torque: float

The maximum motor torque.

motor_enabled: bool

Whether the motor is enabled.

motor_speed

property
motor_speed: float

The target motor speed in radians per second.

motor_torque

property
motor_torque: float

The current motor torque.

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_angle

property
target_angle: float

The target angle for the motor in radians.

upper_limit

property
upper_limit: float

The upper angle limit in radians.

destroy

method
destroy(self) -> None

Destroy the joint manually.

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

Set the angle limits.

Args

  • lower (float) — The lower angle limit in radians.
  • upper (float) — The upper angle limit in radians.

Find your next step

Start typing to search the manual.