Physics · interface

SkinnedClothSetup

Everything a skinned cloth is made from.

Explained in Your first game, Rigid bodies.

interface SkinnedClothSetup
import type { SkinnedClothSetup } from '@driftengine/physics';

Properties

NameTypeDescription
positionsreadonlyFloat32ArrayRest positions, three floats a particle, in the space the skinning starts from.
inverseMassreadonlyFloat32ArrayOne a particle: zero is kinematic, following its skinned position exactly.
distancereadonlyDistanceConstraints
bendingreadonlyoptionalBendingConstraints
tethersreadonlyoptionalTetherConstraints
parametersreadonlySkinnedClothParameters
normalsreadonlyoptionalFloat32ArrayRest normals, three floats a particle: what a backstop and a frontstop are measured along.
jointsreadonlyoptionalFloat32ArrayUp to eight joint influences a particle, as MeshData carries them. Absent: not skinned.
weightsreadonlyoptionalFloat32Array
joints2readonlyoptionalFloat32Array
weights2readonlyoptionalFloat32Array
inverseBindreadonlyoptionalFloat32ArraySixteen floats a joint: each joint's inverse bind matrix, column-major.
limitsreadonlyoptionalClothLimits
collidersreadonlyoptionalreadonly ClothCollider[]
pullWeightsreadonlyoptionalFloat32ArrayOne a particle, 0 to 1: how much of the garment's pull draws it toward its skinned place, each substep keeping 1 / (1 + w · pull · h²) of its offset. Absent, every particle takes the whole pull. For a garment held unevenly: a strap held at its root and free at its tip, a styled fringe held nearly whole while the body of a coat swings free. A weight of 0 is no pull at all, which is a free particle, not a kinematic one: inverseMass is what pins.