Physics · class

ContactConstraints

Explained in Your first game, Rigid bodies.

class ContactConstraints
import { ContactConstraints } from '@driftengine/physics';

Constructor

new

constructor(capacity?: number)
ParameterTypeDescription
capacity?number

Properties

NameTypeDescription
countnumberOne entry per manifold.
bodyAInt32Array
bodyBInt32Array
nxFloat32Array
nyFloat32Array
nzFloat32Array
t1xFloat32Array
t1yFloat32Array
t1zFloat32Array
t2xFloat32Array
t2yFloat32Array
t2zFloat32Array
frictionFloat32Array
restitutionFloat32Array
pointStartInt32Array
pointCountInt32Array
pointsnumberOne entry per contact point.
localAFloat32Array
localBFloat32Array
sBaseFloat32Array
normalMassFloat32Array
tangent1MassFloat32Array
tangent2MassFloat32Array
normalImpulseFloat32Array
tangent1ImpulseFloat32Array
tangent2ImpulseFloat32Array
approachFloat32ArrayApproach speed when the constraint was prepared, which is what restitution answers to.
featureIdInt32Array
curvedAUint8ArrayWhether each side's anchor sits on a curved surface, one byte per point.
More

A curved anchor is held in world frame rather than in the body's, for the reason Manifold states at length: the point where a ball touches the floor does not turn with the ball, and an anchor that turns anyway climbs its side and reports a gap that is not there. Per point rather than per manifold so worldAnchors needs only the point index, which is all its callers have.

curvedBUint8Array

Methods

clear

clear(): void

reserve

reserve(pointsNeeded: number): void
ParameterTypeDescription
pointsNeedednumber