ReadonlydampingReadonlysegmentsReadonlysegmentsReadonlystiffnesshow many simulated points the mesh holds
the flat index of the point at (column, row); throws a RangeError outside the grid
whether a point is pinned (integration and relaxation both leave it alone)
how many points currently sit away from their rest positions
pin a point where it currently stands
index pairs joined by a structural constraint, row links then column links, for drawing the mesh
the current position of one point
put every point back at rest with no velocity; pins are kept
replace the gravity acceleration
replace the wind acceleration; validated, so a gust can never smuggle in a NaN
release a pinned point; it keeps its current position and moves from there
Advance the mesh by dt seconds: one Verlet integration pass, then two relaxation
passes over the structural links. Call with a fixed dt (a FixedStepper does that)
for a deterministic sequence; keep it small (60 Hz steps), since Verlet answers a
huge step with a huge swing rather than an error. A zero dt holds still; a negative
or non-finite one throws a RangeError.
Write every current position into into, which must hold exactly
pointCount * 2 floats. The mesh side calls this with its GPU position array.
A small pinned-point cloth mesh: Verlet integration over a grid of points joined by structural distance constraints, the top row pinned by default. Renderer-free arithmetic (roadmap 423): no physics engine, no allocations per step, deterministic for a fixed
update(dt)sequence, so a frame budget is exact rather than hoped for - one update costs O(points + links), two relaxation passes over structural links only, never shear or bend constraints and never a full cloth simulator. A skirt, tunic or scarf follows its character with a slight lag;ClothSpritedraws the mesh on the GPU path 414 ships.Example