40const uint8 b2_nullFeature = UCHAR_MAX;
171 bool IsValid()
const;
176 return 0.5f * (lowerBound + upperBound);
182 return 0.5f * (upperBound - lowerBound);
188 float wx = upperBound.x - lowerBound.x;
189 float wy = upperBound.y - lowerBound.y;
190 return 2.0f * (wx + wy);
196 lowerBound = b2Min(lowerBound, aabb.
lowerBound);
197 upperBound = b2Max(upperBound, aabb.
upperBound);
211 result = result && lowerBound.x <= aabb.
lowerBound.x;
212 result = result && lowerBound.y <= aabb.
lowerBound.y;
213 result = result && aabb.
upperBound.x <= upperBound.x;
214 result = result && aabb.
upperBound.y <= upperBound.y;
251 const b2Vec2& normal,
float offset, int32 vertexIndexA);
255 const b2Shape* shapeB, int32 indexB,
286 bool valid = d.x >= 0.0f && d.y >= 0.0f;
297 if (d1.x > 0.0f || d1.y > 0.0f)
300 if (d2.x > 0.0f || d2.y > 0.0f)
B2_API void b2GetPointStates(b2PointState state1[b2_maxManifoldPoints], b2PointState state2[b2_maxManifoldPoints], const b2Manifold *manifold1, const b2Manifold *manifold2)
B2_API void b2CollideCircles(b2Manifold *manifold, const b2CircleShape *circleA, const b2Transform &xfA, const b2CircleShape *circleB, const b2Transform &xfB)
Compute the collision manifold between two circles.
b2PointState
This is used for determining the state of contact points.
Definition b2_collision.h:133
@ b2_removeState
point was removed in the update
Definition b2_collision.h:137
@ b2_nullState
point does not exist
Definition b2_collision.h:134
@ b2_addState
point was added in the update
Definition b2_collision.h:135
@ b2_persistState
point persisted across the update
Definition b2_collision.h:136
B2_API 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.
B2_API 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.
b2Hull b2ComputeHull(const b2Vec2 *points, int32 count)
bool b2ValidateHull(const b2Hull &hull)
B2_API bool b2TestOverlap(const b2Shape *shapeA, int32 indexA, const b2Shape *shapeB, int32 indexB, const b2Transform &xfA, const b2Transform &xfB)
Determine if two generic shapes overlap.
B2_API void b2CollideEdgeAndPolygon(b2Manifold *manifold, const b2EdgeShape *edgeA, const b2Transform &xfA, const b2PolygonShape *polygonB, const b2Transform &xfB)
Compute the collision manifold between an edge and a polygon.
B2_API void b2CollidePolygons(b2Manifold *manifold, const b2PolygonShape *polygonA, const b2Transform &xfA, const b2PolygonShape *polygonB, const b2Transform &xfB)
Compute the collision manifold between two polygons.
B2_API int32 b2ClipSegmentToLine(b2ClipVertex vOut[2], const b2ClipVertex vIn[2], const b2Vec2 &normal, float offset, int32 vertexIndexA)
Clipping for contact manifolds.
#define b2_maxManifoldPoints
Definition b2_common.h:51
#define b2_maxPolygonVertices
Definition b2_settings.h:53
A solid circle shape.
Definition b2_circle_shape.h:31
Definition b2_edge_shape.h:33
Definition b2_polygon_shape.h:35
An axis aligned bounding box.
Definition b2_collision.h:169
float GetPerimeter() const
Get the perimeter length.
Definition b2_collision.h:186
b2Vec2 GetExtents() const
Get the extents of the AABB (half-widths).
Definition b2_collision.h:180
b2Vec2 GetCenter() const
Get the center of the AABB.
Definition b2_collision.h:174
void Combine(const b2AABB &aabb1, const b2AABB &aabb2)
Combine two AABBs into this one.
Definition b2_collision.h:201
bool IsValid() const
Verify that the bounds are sorted.
Definition b2_collision.h:283
b2Vec2 lowerBound
the lower vertex
Definition b2_collision.h:220
bool Contains(const b2AABB &aabb) const
Does this aabb contain the provided AABB.
Definition b2_collision.h:208
b2Vec2 upperBound
the upper vertex
Definition b2_collision.h:221
void Combine(const b2AABB &aabb)
Combine an AABB into this one.
Definition b2_collision.h:194
Used for computing contact manifolds.
Definition b2_collision.h:147
Convex hull used for polygon collision.
Definition b2_collision.h:260
Definition b2_collision.h:100
b2Vec2 localNormal
not use for Type::e_points
Definition b2_collision.h:109
b2Vec2 localPoint
usage depends on manifold type
Definition b2_collision.h:110
int32 pointCount
the number of manifold points
Definition b2_collision.h:112
Definition b2_collision.h:76
float normalImpulse
the non-penetration impulse
Definition b2_collision.h:78
float tangentImpulse
the friction impulse
Definition b2_collision.h:79
b2Vec2 localPoint
usage depends on manifold type
Definition b2_collision.h:77
b2ContactID id
uniquely identifies a contact point between two shapes
Definition b2_collision.h:80
Definition b2_collision.h:162
A 2D column vector.
Definition b2_math.h:42
bool IsValid() const
Does this vector contain finite coordinates?
Definition b2_math.h:117
This is used to compute the current state of a contact manifold.
Definition b2_collision.h:117
void Initialize(const b2Manifold *manifold, const b2Transform &xfA, float radiusA, const b2Transform &xfB, float radiusB)
b2Vec2 normal
world vector pointing from A to B
Definition b2_collision.h:126