DriftTexture · interface
SimulationHandle
What prediction needs from a simulation.
Explained in DriftTexture.
interface SimulationHandleimport 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(): voidCapture the current state into the handle's own storage.
restore
restore(): voidPut back what save captured.
advance
advance(dt: number): voidAdvance one fixed step. Deterministic, and the same step the simulation really runs.
| Parameter | Type | Description |
|---|---|---|
dt | number |
viewAt
viewAt(out: Float32Array): voidWrite the current view matrix into out, sixteen floats.
| Parameter | Type | Description |
|---|---|---|
out | Float32Array |