 |
Box2D
2.3.0
A 2D Physics Engine for Games
|
Go to the documentation of this file.
19 #ifndef B2_COLLISION_H
20 #define B2_COLLISION_H
22 #include <Box2D/Common/b2Math.h>
34 const uint8 b2_nullFeature = UCHAR_MAX;
184 return 2.0f * (wx + wy);
245 const b2Vec2& normal, float32 offset, int32 vertexIndexA);
249 const b2Shape* shapeB, int32 indexB,
257 bool valid = d.x >= 0.0f && d.y >= 0.0f;
268 if (d1.x > 0.0f || d1.y > 0.0f)
271 if (d2.x > 0.0f || d2.y > 0.0f)
A 2D column vector.
Definition: b2Math.h:53
int32 b2ClipSegmentToLine(b2ClipVertex vOut[2], const b2ClipVertex vIn[2], const b2Vec2 &normal, float32 offset, int32 vertexIndexA)
Clipping for contact manifolds.
Definition: b2Collision.cpp:201
b2Vec2 GetExtents() const
Get the extents of the AABB (half-widths).
Definition: b2Collision.h:174
void b2CollideEdgeAndCircle(b2Manifold *manifold, const b2EdgeShape *polygonA, const b2Transform &xfA, const b2CircleShape *circleB, const b2Transform &xfB)
Compute the collision manifold between an edge and a circle.
Definition: b2CollideEdge.cpp:27
@ b2_persistState
point persisted across the update
Definition: b2Collision.h:130
Definition: b2EdgeShape.h:27
bool b2TestOverlap(const b2Shape *shapeA, int32 indexA, const b2Shape *shapeB, int32 indexB, const b2Transform &xfA, const b2Transform &xfB)
Determine if two generic shapes overlap.
Definition: b2Collision.cpp:233
void b2CollidePolygons(b2Manifold *manifold, const b2PolygonShape *polygonA, const b2Transform &xfA, const b2PolygonShape *polygonB, const b2Transform &xfB)
Compute the collision manifold between two polygons.
Definition: b2CollidePolygon.cpp:116
b2Vec2 lowerBound
the lower vertex
Definition: b2Collision.h:214
void b2CollidePolygonAndCircle(b2Manifold *manifold, const b2PolygonShape *polygonA, const b2Transform &xfA, const b2CircleShape *circleB, const b2Transform &xfB)
Compute the collision manifold between a polygon and a circle.
Definition: b2CollideCircle.cpp:51
b2ManifoldPoint points[b2_maxManifoldPoints]
the points of contact
Definition: b2Collision.h:102
b2Vec2 GetCenter() const
Get the center of the AABB.
Definition: b2Collision.h:168
void Initialize(const b2Manifold *manifold, const b2Transform &xfA, float32 radiusA, const b2Transform &xfB, float32 radiusB)
Definition: b2Collision.cpp:22
Definition: b2Collision.h:93
int32 pointCount
the number of manifold points
Definition: b2Collision.h:106
b2PointState
This is used for determining the state of contact points.
Definition: b2Collision.h:126
bool Contains(const b2AABB &aabb) const
Does this aabb contain the provided AABB.
Definition: b2Collision.h:202
void b2GetPointStates(b2PointState state1[b2_maxManifoldPoints], b2PointState state2[b2_maxManifoldPoints], const b2Manifold *manifold1, const b2Manifold *manifold2)
Definition: b2Collision.cpp:88
Definition: b2Collision.h:69
This is used to compute the current state of a contact manifold.
Definition: b2Collision.h:110
Used for computing contact manifolds.
Definition: b2Collision.h:140
An axis aligned bounding box.
Definition: b2Collision.h:162
b2Vec2 localNormal
not use for Type::e_points
Definition: b2Collision.h:103
float32 GetPerimeter() const
Get the perimeter length.
Definition: b2Collision.h:180
float32 tangentImpulse
the friction impulse
Definition: b2Collision.h:73
@ b2_removeState
point was removed in the update
Definition: b2Collision.h:131
b2ContactID id
uniquely identifies a contact point between two shapes
Definition: b2Collision.h:74
b2Vec2 localPoint
usage depends on manifold type
Definition: b2Collision.h:71
b2Vec2 upperBound
the upper vertex
Definition: b2Collision.h:215
Definition: b2PolygonShape.h:28
void Combine(const b2AABB &aabb)
Combine an AABB into this one.
Definition: b2Collision.h:188
b2Vec2 normal
world vector pointing from A to B
Definition: b2Collision.h:120
float32 separations[b2_maxManifoldPoints]
a negative value indicates overlap, in meters
Definition: b2Collision.h:122
float32 normalImpulse
the non-penetration impulse
Definition: b2Collision.h:72
bool IsValid() const
Verify that the bounds are sorted.
Definition: b2Collision.h:254
@ b2_addState
point was added in the update
Definition: b2Collision.h:129
b2Vec2 localPoint
usage depends on manifold type
Definition: b2Collision.h:104
void Combine(const b2AABB &aabb1, const b2AABB &aabb2)
Combine two AABBs into this one.
Definition: b2Collision.h:195
#define b2_maxManifoldPoints
Definition: b2Settings.h:50
@ b2_nullState
point does not exist
Definition: b2Collision.h:128
void b2CollideEdgeAndPolygon(b2Manifold *manifold, const b2EdgeShape *edgeA, const b2Transform &xfA, const b2PolygonShape *circleB, const b2Transform &xfB)
Compute the collision manifold between an edge and a circle.
Definition: b2CollideEdge.cpp:692
Definition: b2Collision.h:155
void b2CollideCircles(b2Manifold *manifold, const b2CircleShape *circleA, const b2Transform &xfA, const b2CircleShape *circleB, const b2Transform &xfB)
Compute the collision manifold between two circles.
Definition: b2CollideCircle.cpp:23
b2Vec2 points[b2_maxManifoldPoints]
world contact point (point of intersection)
Definition: b2Collision.h:121
A circle shape.
Definition: b2CircleShape.h:25
bool IsValid() const
Does this vector contain finite coordinates?
Definition: b2Math.h:129