API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
interfacePrismaticJointOptions
@codexo/exojs-physics / physics / stable
Construction options for a PrismaticJoint.
11
props
0
methods
0
events
Import
import { PrismaticJointOptions } from '@codexo/exojs-physics'Construction options for a PrismaticJoint.
Properties11
anchor: Readonly<PointLikeStructural type for any object with a 2D `x`/`y` position.>Shared world-space anchor at creation.
Slide axis in world space at creation (normalised internally). The body may only translate along this axis.
First body (often a static rail anchor).
Second body (the slider).
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.
enableLimit?: booleanEnable the translation limit (keeps the axis translation in [lowerTranslation, upperTranslation]). Default false.
enableMotor?: booleanEnable the linear motor (drives translation along the axis toward motorSpeed). Default false.
lowerTranslation?: numberLower translation limit along the axis (relative to the creation position). Default 0.
maxMotorForce?: numberMaximum motor force - clamps the per-step motor impulse. Default 0.
motorSpeed?: numberTarget translation speed along the axis (px/s). Default 0.
upperTranslation?: numberUpper translation limit along the axis. Default 0.
Source