eulerjs API / @eulerjs/core / WorldOptions
WorldOptions
Defined in: packages/core/src/World.ts:16
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
backend? | PhysicsBackend | What simulates the world. Defaults to a new JavaScriptBackend. | packages/core/src/World.ts:44 |
gravity? | Vector3 | Defaults to (0, -9.81, 0). | packages/core/src/World.ts:18 |
maxStepsPerFrame? | number | Most 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? | number | Bodies 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? | number | In rad/s. Defaults to 0.035 (2° per second). | packages/core/src/World.ts:40 |
substeps? | number | The 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? | number | Length 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? | number | In seconds. Defaults to 0.5. | packages/core/src/World.ts:42 |
