Renderer · interface

SkinnedClothSolver

A garment a renderer solves, from createSkinnedCloth.

Explained in Hello world.

interface SkinnedClothSolver
import type { SkinnedClothSolver } from '@driftengine/core';

Properties

NameTypeDescription
particlesreadonlyClothParticlesHandleWhat setCloth(binding, particles) draws the garment's bound meshes by.
runsOnreadonly'device' | 'cpu'Where the solver runs: on the device, or on the CPU beneath a backend without compute.

Methods

step

step(globals: Float32Array, model: Float32Array, dt: number): void

One frame: the rig's pose — each joint's global matrix, model space, sixteen floats a joint, and the model matrix — and dt seconds, run as whole fixed steps; the particles at the frame's alpha are then what the frame draws. Once a frame, before the draws, as updateClothParticles is: a second in one frame would reach every draw of it on WebGPU.

ParameterTypeDescription
globalsFloat32Array
modelFloat32Array
dtnumber

setWind

setWind(x: number, y: number, z: number): void

The air the cloth drags toward from the next step, world space, metres a second: the frame's sample of the scene's one WindField, so a garment moves with everything else in the air.

ParameterTypeDescription
xnumber
ynumber
znumber

reset

reset(): void

Back to the skinned pose, settled, as a teleport resets it.

dispose

dispose(): void