physics.MouseJoint
pykraken.physics.MouseJoint A joint that pulls a body toward a world-space target point using a spring.
More about physics.MouseJoint
The mouse joint is typically used for click-and-drag interactions, where a user drags a body around the world. It applies a spring force to pull the body toward the target position.
Inherits Joint
At a glance
12 membersReference
PYTHON APIConstructor
methodphysics.MouseJoint(/, *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.
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.
max_force
propertymax_force: floatThe maximum constraint force.
spring_damping_ratio
propertyspring_damping_ratio: floatThe spring damping ratio.
spring_hz
propertyspring_hz: floatThe spring frequency in Hertz.
target
propertytarget: Vec2The target point in world coordinates.
destroy
methoddestroy(self) -> NoneDestroy the joint manually.