Renderer · interface
SkinnedClothSolver
A garment a renderer solves, from createSkinnedCloth.
Explained in Hello world.
interface SkinnedClothSolverimport type { SkinnedClothSolver } from '@driftengine/core';Properties
| Name | Type | Description |
|---|---|---|
particlesreadonly | ClothParticlesHandle | What 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): voidOne 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.
| Parameter | Type | Description |
|---|---|---|
globals | Float32Array | |
model | Float32Array | |
dt | number |
setWind
setWind(x: number, y: number, z: number): voidThe 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.
| Parameter | Type | Description |
|---|---|---|
x | number | |
y | number | |
z | number |
reset
reset(): voidBack to the skinned pose, settled, as a teleport resets it.
dispose
dispose(): void