API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
interfaceRevoluteJointOptions
@codexo/exojs-physics / physics / stable
Construction options for a RevoluteJoint.
12
props
0
methods
0
events
Import
import { RevoluteJointOptions } from '@codexo/exojs-physics'Construction options for a RevoluteJoint.
Properties12
anchor: Readonly<PointLikeStructural type for any object with a 2D `x`/`y` position.>Shared world-space pivot point at creation. The two bodies are pinned here and may rotate freely about it.
First body (often a static anchor).
Second body.
collideConnected?: booleanWhether the two bodies this joint connects also collide with each other. Default true. false is what a chain, a ragdoll, a pendulum or a vehicle assembly usually wants, and what Box2D defaults to: a joint already decides how its two bodies may move relative to one another, so letting their touching colliders push each other apart at the same time gives the pair two constraint systems with different opinions, plus a contact per link that nothing needs. The default is nevertheless true, which is the behaviour every joint has had so far: an existing scene built against it would change shape under an update that flipped it. Nothing else argues for true any more - a chain of seven links and up used to gain energy without these contacts, and that defect is fixed in the joint solver rather than damped by them - so the default is a compatibility choice and is free to be revisited. Nothing about a contact is weakened under true: the narrow phase produces it, the contact graph holds it, collision events fire, a ContactModifier sees it and the solver resolves it, exactly as for any unjointed pair. It is fixed at construction, and it follows the joint's presence in the world rather than Joint.enabled: disabling a joint suspends its constraint, and a ragdoll whose joints are momentarily disabled must not start pushing its own limbs apart. Removing the joint from the world does let the pair collide again, and both bodies are woken so they respond to it.
dampingRatio?: numberSoft-spring damping ratio (used when hertz > 0). Default 1.
enableLimit?: booleanEnable the angle limit (keeps the relative angle in [lowerAngle, upperAngle]). Default false.
enableMotor?: booleanEnable the angular motor (drives ωB − ωA toward motorSpeed). Default false.
hertz?: numberSoft-spring frequency in Hz; 0 (default) makes it a rigid pin.
lowerAngle?: numberLower relative-angle limit in radians (relative to the angle at creation). Default 0.
maxMotorTorque?: numberMaximum motor torque - clamps the per-step motor impulse. Default 0.
motorSpeed?: numberTarget relative angular velocity in rad/s when the motor is enabled. Default 0.
upperAngle?: numberUpper relative-angle limit in radians. Default 0.
Source