API reference

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

I

interfaceWheelJointOptions

@codexo/exojs-physics / physics / stable

Construction options for a WheelJoint.

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

Construction options for a WheelJoint.

Properties13
Shared world-space anchor at creation (the wheel hub).
Suspension axis in world space at creation (normalised internally).
collideConnected?: boolean
Whether 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?: number
Suspension spring damping ratio. Default 1.
enableLimit?: boolean
Enable the suspension-travel limit (keeps the axis translation in [lowerTranslation, upperTranslation]). Default false.
enableMotor?: boolean
Enable the rotation motor (drives the wheel's spin). Default false.
hertz?: number
Suspension spring frequency in Hz (0 makes the axis rigid). Default 0.
lowerTranslation?: number
Lower suspension-travel limit along the axis (relative to the creation position). Default 0.
maxMotorTorque?: number
Maximum motor torque. Default 0.
motorSpeed?: number
Target relative angular velocity (rad/s) for the motor. Default 0.
upperTranslation?: number
Upper suspension-travel limit along the axis. Default 0.
Source