Physics · interface
DistanceConstraints
Distance constraints: two particles, a rest length, a compliance (metres per newton).
Explained in Your first game, Rigid bodies.
interface DistanceConstraintsimport type { DistanceConstraints } from '@driftengine/physics';Properties
| Name | Type | Description |
|---|---|---|
pairsreadonly | Uint32Array | Two particle indices a constraint. |
restreadonly | Float32Array | |
compliancereadonly | Float32Array | |
batchesreadonlyoptional | Uint32Array | Graph-colour batches, as offsets into the constraints: batch b is constraints
batches[b] to batches[b + 1], none of which moves a particle another in the batch moves.
Absent, the solver colours them itself. Given, they are checked and refused if they overlap. |