DriftTexture · function

predictViews

Fill out with one view matrix per predicted frame, and leave the simulation exactly as found.

Explained in DriftTexture.

function predictViews(sim: SimulationHandle, frames: number, dt: number, out: Float32Array): number
import { predictViews } from '@driftengine/texture';

Parameters

ParameterTypeDescription
simSimulationHandle
framesnumber
dtnumber
outFloat32Array

In depth

Returns how many views were written — fewer than frames when out cannot hold them all.

Saved once and restored once, however many frames are predicted: the intermediate states are not wanted, only the views they imply.