Renderer · interface

SkinnedClothSet

Garments a renderer solves together, from createSkinnedClothSet, each named by its index.

Explained in Hello world.

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

Properties

NameTypeDescription
particlesreadonlyreadonly ClothParticlesHandle[]Each garment's particles, in the order its set-up was given: what setCloth draws it by.
runsOnreadonly'device' | 'cpu'Where the set runs: on the device, or on the CPU beneath a backend without compute.

Methods

setPose

setPose(g: number, globals: Float32Array, model: Float32Array): void

Garment g's rig for the next step: each joint's global matrix, model space, sixteen floats a joint, and the model matrix. A garment not posed in a frame steps toward its last pose.

ParameterTypeDescription
gnumber
globalsFloat32Array
modelFloat32Array

setWind

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

The air garment g drags toward from its next step: the frame's sample of the one wind.

ParameterTypeDescription
gnumber
xnumber
ynumber
znumber

reset

reset(g: number): void

Garment g back to its skinned pose, settled, as a teleport resets it.

ParameterTypeDescription
gnumber

step

step(dt: number): void

dt seconds for every garment, run as whole fixed steps; each garment's particles at its alpha are then what the frame draws. Once a frame, before the draws, as a solver's step.

ParameterTypeDescription
dtnumber

dispose

dispose(): void