Skip to content

eulerjs API / @eulerjs/core / WorldOptions

WorldOptions ​

Defined in: packages/core/src/World.ts:16

Properties ​

PropertyTypeDescriptionDefined in
backend?PhysicsBackendWhat simulates the world. Defaults to a new JavaScriptBackend.packages/core/src/World.ts:44
gravity?Vector3Defaults to (0, -9.81, 0).packages/core/src/World.ts:18
maxStepsPerFrame?numberMost fixed steps one step(frameDelta) call may run. When rendering falls further behind, the extra time is dropped and the simulation runs slower instead of freezing the page.packages/core/src/World.ts:28
sleepSpeed?numberBodies slower than this (m/s) and sleepSpin for timeToSleep seconds fall asleep. Defaults to 0.05, as in Box2D v3.packages/core/src/World.ts:38
sleepSpin?numberIn rad/s. Defaults to 0.035 (2° per second).packages/core/src/World.ts:40
substeps?numberThe backend's accuracy setting. For the JavaScript backend, how many substeps each step is split into when there are joints or contacts to solve. Defaults to 4, which suits games in the browser; 8 makes joints and contacts stiffer and more accurate, for when that matters more than speed, and halves the small energy loss every position-based solver has, as each doubling does. A world with nothing to solve integrates each step in one go.packages/core/src/World.ts:36
timestep?numberLength of one fixed step in seconds. Defaults to 1/60; substeps (see substeps) give joints and contacts their stiffness, and behaviours such as buoyancy run once per step.packages/core/src/World.ts:23
timeToSleep?numberIn seconds. Defaults to 0.5.packages/core/src/World.ts:42

Released under the MIT License.