CLASS v1.8.0

physics.MotorJoint

pykraken.physics.MotorJoint

A joint that drives two bodies toward a target relative linear and angular offset.

More about physics.MotorJoint

The motor joint applies forces and torques to maintain the specified offsets. Useful for animating bodies to follow paths or track positions while still interacting with the physics simulation.

Inherits Joint

Reference

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

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

angular_offset: float

The target angular offset 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.

correction_factor: float

The position correction factor in [0, 1].

is_valid

property
is_valid: bool

Indicates whether the joint is not destroyed.

linear_offset: Vec2

The target linear offset from body A to body B.

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.

max_force

property
max_force: float

The maximum motor force.

max_torque

property
max_torque: float

The maximum motor torque.

destroy

method
destroy(self) -> None

Destroy the joint manually.

Find your next step

Start typing to search the manual.