API reference

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

I

interfacePhysicsWorldOptions

@codexo/exojs-physics / physics / stable

Construction options for a PhysicsWorld.

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

Construction options for a PhysicsWorld.

Properties13
contactHertz?: number
Soft-contact stiffness in Hz (the contact behaves as a damped spring at this frequency). Default 30.
Adjust each solid contact for the coming step (one-way platforms, conditional friction, per-pair material overrides). At most one per world; see PhysicsWorld.contactModifier. Default none.
dampingRatio?: number
Soft-contact damping ratio (≥ 1 keeps contacts from oscillating). Default 10.
enableSleeping?: boolean
Put resting bodies to sleep so they skip integration and solving. Default true.
fixedDelta?: number
Fixed timestep in seconds. Default 1 / 60.
frameAlphaSource?: () => number
Where interpolated bindings read their blend factor, in [0, 1). Defaults to this world's own accumulator - correct when the world is driven with PhysicsWorld.step, which is what advances it. A world driven as a System goes through PhysicsWorld.fixedUpdate and bypasses that accumulator entirely, so the host owns the fraction: pass () => app.frameAlpha.
Gravity in px/s² (+Y down). Integrated each sub-step. Default (0, 0).
interpolation?: boolean
Place bound nodes between the last two fixed states instead of snapping them to the latest one, which smooths motion when the fixed rate is below the frame rate. Default false. The blend factor comes from frameAlphaSource; a world driven as a System has to supply one.
maxSubSteps?: number
Maximum fixed steps per step call (spiral-of-death guard). Default 8.
sleepAngularVelocity?: number
Angular speed at or below which a body is a sleep candidate, rad/s. Default 0.06.
sleepLinearVelocity?: number
Linear speed at or below which a body is a sleep candidate, px/s. Default 5.
subStepCount?: number
TGS-Soft sub-steps per fixed step (the solver's stiffness scales with this, not iteration count). Default 4. Must be ≥ 1. Values below 2 visibly degrade tall-stack stability (a 10-box tower jitters at 1), so the default is load-bearing - do not lower it for performance.
timeToSleep?: number
Seconds a body must stay below the sleep thresholds before it sleeps. Default 0.5.
Source