Physics · class
ContactConstraints
Explained in Your first game, Rigid bodies.
class ContactConstraintsimport { ContactConstraints } from '@driftengine/physics';Constructor
new
constructor(capacity?: number)| Parameter | Type | Description |
|---|---|---|
capacity? | number |
Properties
| Name | Type | Description |
|---|---|---|
count | number | One entry per manifold. |
bodyA | Int32Array | |
bodyB | Int32Array | |
nx | Float32Array | |
ny | Float32Array | |
nz | Float32Array | |
t1x | Float32Array | |
t1y | Float32Array | |
t1z | Float32Array | |
t2x | Float32Array | |
t2y | Float32Array | |
t2z | Float32Array | |
friction | Float32Array | |
restitution | Float32Array | |
pointStart | Int32Array | |
pointCount | Int32Array | |
points | number | One entry per contact point. |
localA | Float32Array | |
localB | Float32Array | |
sBase | Float32Array | |
normalMass | Float32Array | |
tangent1Mass | Float32Array | |
tangent2Mass | Float32Array | |
normalImpulse | Float32Array | |
tangent1Impulse | Float32Array | |
tangent2Impulse | Float32Array | |
approach | Float32Array | Approach speed when the constraint was prepared, which is what restitution answers to. |
featureId | Int32Array | |
curvedA | Uint8Array | Whether each side's anchor sits on a curved surface, one byte per point.MoreA curved anchor is held in world frame rather than in the body's, for the reason |
curvedB | Uint8Array |
Methods
clear
clear(): voidreserve
reserve(pointsNeeded: number): void| Parameter | Type | Description |
|---|---|---|
pointsNeeded | number |