Box2D 3.1.0
A 2D physics engine for games
|
Functions for colliding pairs of shapes More...
Data Structures | |
struct | b2ManifoldPoint |
A manifold point is a contact point belonging to a contact manifold. More... | |
struct | b2Manifold |
A contact manifold describes the contact points between colliding shapes. More... | |
Functions | |
b2Manifold | b2CollideCircles (const b2Circle *circleA, b2Transform xfA, const b2Circle *circleB, b2Transform xfB) |
Compute the contact manifold between two circles. | |
b2Manifold | b2CollideCapsuleAndCircle (const b2Capsule *capsuleA, b2Transform xfA, const b2Circle *circleB, b2Transform xfB) |
Compute the contact manifold between a capsule and circle. | |
b2Manifold | b2CollideSegmentAndCircle (const b2Segment *segmentA, b2Transform xfA, const b2Circle *circleB, b2Transform xfB) |
Compute the contact manifold between an segment and a circle. | |
b2Manifold | b2CollidePolygonAndCircle (const b2Polygon *polygonA, b2Transform xfA, const b2Circle *circleB, b2Transform xfB) |
Compute the contact manifold between a polygon and a circle. | |
b2Manifold | b2CollideCapsules (const b2Capsule *capsuleA, b2Transform xfA, const b2Capsule *capsuleB, b2Transform xfB) |
Compute the contact manifold between a capsule and circle. | |
b2Manifold | b2CollideSegmentAndCapsule (const b2Segment *segmentA, b2Transform xfA, const b2Capsule *capsuleB, b2Transform xfB) |
Compute the contact manifold between an segment and a capsule. | |
b2Manifold | b2CollidePolygonAndCapsule (const b2Polygon *polygonA, b2Transform xfA, const b2Capsule *capsuleB, b2Transform xfB) |
Compute the contact manifold between a polygon and capsule. | |
b2Manifold | b2CollidePolygons (const b2Polygon *polygonA, b2Transform xfA, const b2Polygon *polygonB, b2Transform xfB) |
Compute the contact manifold between two polygons. | |
b2Manifold | b2CollideSegmentAndPolygon (const b2Segment *segmentA, b2Transform xfA, const b2Polygon *polygonB, b2Transform xfB) |
Compute the contact manifold between an segment and a polygon. | |
b2Manifold | b2CollideChainSegmentAndCircle (const b2ChainSegment *segmentA, b2Transform xfA, const b2Circle *circleB, b2Transform xfB) |
Compute the contact manifold between a chain segment and a circle. | |
b2Manifold | b2CollideChainSegmentAndCapsule (const b2ChainSegment *segmentA, b2Transform xfA, const b2Capsule *capsuleB, b2Transform xfB, b2DistanceCache *cache) |
Compute the contact manifold between a chain segment and a capsule. | |
b2Manifold | b2CollideChainSegmentAndPolygon (const b2ChainSegment *segmentA, b2Transform xfA, const b2Polygon *polygonB, b2Transform xfB, b2DistanceCache *cache) |
Compute the contact manifold between a chain segment and a rounded polygon. | |
Functions for colliding pairs of shapes
struct b2ManifoldPoint |
A manifold point is a contact point belonging to a contact manifold.
It holds details related to the geometry and dynamics of the contact points.
Data Fields | ||
---|---|---|
b2Vec2 | anchorA |
Location of the contact point relative to bodyA's origin in world space.
|
b2Vec2 | anchorB | Location of the contact point relative to bodyB's origin in world space. |
uint16_t | id | Uniquely identifies a contact point between two shapes. |
float | maxNormalImpulse | The maximum normal impulse applied during sub-stepping todo not sure this is needed. |
float | normalImpulse | The impulse along the manifold normal vector. |
float | normalVelocity |
Relative normal velocity pre-solve. Used for hit events. If the normal impulse is zero then there was no hit. Negative means shapes are approaching. |
bool | persisted | Did this contact point exist the previous step? |
b2Vec2 | point |
Location of the contact point in world space. Subject to precision loss at large coordinates.
|
float | separation | The separation of the contact point, negative if penetrating. |
float | tangentImpulse | The friction impulse. |
struct b2Manifold |
A contact manifold describes the contact points between colliding shapes.
Data Fields | ||
---|---|---|
b2Vec2 | normal | The unit normal vector in world space, points from shape A to bodyB. |
int32_t | pointCount | The number of contacts points, will be 0, 1, or 2. |
b2ManifoldPoint | points[2] | The manifold points, up to two are possible in 2D. |