DriftTexture · interface

SimulationHandle

What prediction needs from a simulation.

Explained in DriftTexture.

interface SimulationHandle
import type { SimulationHandle } from '@driftengine/texture';

In depth

Save and restore rather than a snapshot value, matching Snapshotter in the network package: the buffer is the handle's own and is reused, so predicting allocates nothing.

Methods

save

save(): void

Capture the current state into the handle's own storage.

restore

restore(): void

Put back what save captured.

advance

advance(dt: number): void

Advance one fixed step. Deterministic, and the same step the simulation really runs.

ParameterTypeDescription
dtnumber

viewAt

viewAt(out: Float32Array): void

Write the current view matrix into out, sixteen floats.

ParameterTypeDescription
outFloat32Array