Skip to content

ecsia-monorepo / three/src / ThreeDriverOptions

Interface: ThreeDriverOptions

Defined in: three/src/driver.ts:17

Properties

update

ts
readonly update: (dt) => void;

Defined in: three/src/driver.ts:19

Advance the simulation by dt seconds. Typically scheduler.update.

Parameters

ParameterType
dtnumber

Returns

void


render

ts
readonly render: () => void;

Defined in: three/src/driver.ts:21

Draw the current state. Called once per frame after the sim step(s).

Returns

void


fixedTimestep?

ts
readonly optional fixedTimestep?: number;

Defined in: three/src/driver.ts:27

Fixed simulation step in seconds (e.g. 1/60). When set, the driver runs whole update(fixedTimestep) steps to consume accumulated real time (deterministic step count). When omitted, the driver is variable-step (one update(realDelta) per frame).


maxSubSteps?

ts
readonly optional maxSubSteps?: number;

Defined in: three/src/driver.ts:29

Max fixed steps per frame before the backlog is discarded (anti spiral-of-death). Default 8.


requestAnimationFrame?

ts
readonly optional requestAnimationFrame?: (cb) => number;

Defined in: three/src/driver.ts:35

The requestAnimationFrame to schedule on. Defaults to the global requestAnimationFrame when it exists (browser). Pass one explicitly to drive a custom loop; leave undefined in Node and call tick(dt) manually.

Parameters

ParameterType
cb(timeMs) => void

Returns

number


cancelAnimationFrame?

ts
readonly optional cancelAnimationFrame?: (id) => void;

Defined in: three/src/driver.ts:37

The cancelAnimationFrame paired with the rAF above.

Parameters

ParameterType
idnumber

Returns

void

MIT licensed · 0.x, unpublished, experimental.