2021-05-11 18:30:36 -07:00

3.3 KiB
Raw Permalink Blame History

Planck.js API Doc › Globals › Manifold

Class: Manifold

A manifold for two touching convex shapes. Manifolds are created in evaluate method of Contact subclasses.

Supported manifold types are e_faceA or e_faceB for clip point versus plane with radius and e_circles point versus point with radius.

We store contacts in this way so that position correction can account for movement, which is critical for continuous physics. All contact scenarios must be expressed in one of these types. This structure is stored across time steps, so we keep it small.

prop type e_circle, e_faceA, e_faceB

prop localPoint Usage depends on manifold type:
e_circles: the local center of circleA
e_faceA: the center of faceA
e_faceB: the center of faceB

prop localNormal Usage depends on manifold type:
e_circles: not used
e_faceA: the normal on polygonA
e_faceB: the normal on polygonB

prop points The points of contact {ManifoldPoint[]}

prop pointCount The number of manifold points

Hierarchy

  • Manifold

Index

Properties

Methods

Properties

localNormal

• localNormal: Vec2 = Vec2.zero()

Defined in src/collision/Manifold.ts:67


localPoint

• localPoint: Vec2 = Vec2.zero()

Defined in src/collision/Manifold.ts:68


pointCount

• pointCount: number = 0

Defined in src/collision/Manifold.ts:70


points

• points: ManifoldPoint[] = [ new ManifoldPoint(), new ManifoldPoint() ]

Defined in src/collision/Manifold.ts:69


type

• type: ManifoldType

Defined in src/collision/Manifold.ts:66

Methods

getWorldManifold

▸ getWorldManifold(wm: WorldManifold | undefined, xfA: Transform, radiusA: number, xfB: Transform, radiusB: number): WorldManifold

Defined in src/collision/Manifold.ts:77

Evaluate the manifold with supplied transforms. This assumes modest motion from the original state. This does not change the point count, impulses, etc. The radii must come from the shapes that generated the manifold.

Parameters:

Name Type
wm WorldManifold | undefined
xfA Transform
radiusA number
xfB Transform
radiusB number

Returns: WorldManifold