API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
interfaceWeldJointOptions
@codexo/exojs-physics / physics / stable
Construction options for a WeldJoint.
8
props
0
methods
0
events
Import
import { WeldJointOptions } from '@codexo/exojs-physics'Construction options for a WeldJoint.
Properties8
anchor?: Readonly<PointLikeStructural type for any object with a 2D `x`/`y` position.>World-space anchor the linear constraint acts at. Default: the midpoint of the two bodies.
angularHertz?: numberSoft frequency (Hz) for the angle lock; 0 (default) is rigid.
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 damping ratio (used when a hertz is > 0). Default 1.
linearHertz?: numberSoft frequency (Hz) for the position lock; 0 (default) is rigid.
referenceAngle?: numberLocked relative angle angleB − angleA. Default: the current relative angle at creation.
Source