Physics · interface

SkinnedClothParameters

What the solver runs at. Every field has a default; the defaults are a garment's, not a sheet's.

Explained in Your first game, Rigid bodies.

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

Properties

NameTypeDescription
stepreadonlyoptionalnumberThe fixed step, in seconds. The solver runs whole steps whatever the frame. Default 1/60.
maxStepsreadonlyoptionalnumberThe most whole steps one advance runs; the time past them is dropped, not owed to the next frame. Default none, so advance(1) is a second of cloth. A caller handing it each frame's time wants two to four: unbounded, a slow frame's steps make the next frame slower, which hands it more time again. What it gives up: past the cap the cloth runs slower than the clock.
substepsreadonlyoptionalnumberSubsteps a step. Default 1.
iterationsreadonlyoptionalnumberConstraint passes a substep. Default 4.
gravityreadonlyoptionalreadonly [number, number, number]Metres a second squared, world space. Default [0, −9.81, 0].
dampingreadonlyoptionalnumberThe log of the velocity kept after a second: ln 0.25 keeps a quarter. Zero is none; it is applied as exp(damping · h) a substep, so it means one thing at every step length.
dragreadonlyoptionalnumberThe same, of the velocity relative to the wind: how fast the air takes the cloth with it.
windreadonlyoptionalreadonly [number, number, number]Metres a second, world space: the air the cloth starts in. Default still air. A garment in a scene follows the scene's wind a frame at a time, through setWind.
linearInertiareadonlyoptionalnumberHow much of the character's own movement and turning the cloth keeps as its own, 0 to 1: 1 is simulated wholly in the world, so a dash leaves the hem behind; 0 moves it with the character. Default 1.
angularInertiareadonlyoptionalnumber
maxDistanceScalereadonlyoptionalnumberScales every max distance, for a garment worn looser or tighter than cooked. Default 1.
marginreadonlyoptionalnumberMetres added to every collider's radius, beyond a particle's own thickness. Default 0.
teleportDistancereadonlyoptionalnumberA move of the character's origin past this, between two poses, resets the cloth. Default none.
teleportAnglereadonlyoptionalnumberA turn past this many radians between two poses resets it too. Default none.
settleStepsreadonlyoptionalnumberSteps run at once when the cloth is reset, so it starts hanging rather than falling.
blendStepsreadonlyoptionalnumberSteps over which a reset cloth blends from its skinned pose into its simulation.