Renderer · interface
SkinnedClothSet
Garments a renderer solves together, from createSkinnedClothSet, each named by its index.
Explained in Hello world.
interface SkinnedClothSetimport type { SkinnedClothSet } from '@driftengine/core';Properties
| Name | Type | Description |
|---|---|---|
particlesreadonly | readonly 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): voidGarment 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.
| Parameter | Type | Description |
|---|---|---|
g | number | |
globals | Float32Array | |
model | Float32Array |
setWind
setWind(g: number, x: number, y: number, z: number): voidThe air garment g drags toward from its next step: the frame's sample of the one wind.
| Parameter | Type | Description |
|---|---|---|
g | number | |
x | number | |
y | number | |
z | number |
reset
reset(g: number): voidGarment g back to its skinned pose, settled, as a teleport resets it.
| Parameter | Type | Description |
|---|---|---|
g | number |
step
step(dt: number): voiddt 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.
| Parameter | Type | Description |
|---|---|---|
dt | number |
dispose
dispose(): void