API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classMouseJoint

@codexo/exojs-physics / physics / stable

Softly pulls a single body's grab point toward a movable **target** point (typically the mouse cursor). The grab point is fixed on the body at creation; update target each frame to drag. A soft constraint bounded by maxForce - solved in the sub-step loop, warm-started. Internally the "other" body is a private static ground sentinel, so this is a single-body constraint that touches only the dragged body.

8
props
0
methods
0
events
Import
import { MouseJoint } from '@codexo/exojs-physics'

Softly pulls a single body's grab point toward a movable **target** point (typically the mouse cursor). The grab point is fixed on the body at creation; update target each frame to drag. A soft constraint bounded by maxForce - solved in the sub-step loop, warm-started. Internally the "other" body is a private static ground sentinel, so this is a single-body constraint that touches only the dragged body.

Constructors1
Properties8
collideConnected: boolean
Whether bodyA and bodyB also collide with each other; see JointOptions.collideConnected.
dampingRatio: number
Soft-spring damping ratio.
enabled: boolean
When false, the joint is skipped by the solver (but still tracked by the world).
hertz: number
Soft-spring frequency in Hz.
maxForce: number
Maximum pulling force.
The world point the body is pulled toward. Reassigning wakes the body so a drag tracks live.
Source