Go to the documentation of this file.
23 #ifndef B2_COLLISION_H
24 #define B2_COLLISION_H
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);
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);
263 bool valid =
d.x >= 0.0f &&
d.y >= 0.0f;
274 if (d1.
x > 0.0f || d1.
y > 0.0f)
277 if (d2.
x > 0.0f || d2.
y > 0.0f)
@ b2_addState
point was added in the update
@ b2_persistState
point persisted across the update
b2Vec2 localNormal
not use for Type::e_points
bool IsValid() const
Verify that the bounds are sorted.
b2Vec2 GetCenter() const
Get the center of the AABB.
const uint8 b2_nullFeature
b2ContactID id
uniquely identifies a contact point between two shapes
b2Vec2 upperBound
the upper vertex
void Combine(const b2AABB &aabb1, const b2AABB &aabb2)
Combine two AABBs into this one.
b2PointState
This is used for determining the state of contact points.
b2Vec2 normal
world vector pointing from A to B
int32 pointCount
the number of manifold points
float tangentImpulse
the friction impulse
B2_API int32 b2ClipSegmentToLine(b2ClipVertex vOut[2], const b2ClipVertex vIn[2], const b2Vec2 &normal, float offset, int32 vertexIndexA)
Clipping for contact manifolds.
b2Vec2 GetExtents() const
Get the extents of the AABB (half-widths).
#define b2_maxManifoldPoints
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.
float normalImpulse
the non-penetration impulse
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 b2GetPointStates(b2PointState state1[b2_maxManifoldPoints], b2PointState state2[b2_maxManifoldPoints], const b2Manifold *manifold1, const b2Manifold *manifold2)
B2_API 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 polygon.
b2Vec2 localPoint
usage depends on manifold type
This is used to compute the current state of a contact manifold.
bool IsValid() const
Does this vector contain finite coordinates?
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.
b2Vec2 localPoint
usage depends on manifold type
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.
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.
An axis aligned bounding box.
void Combine(const b2AABB &aabb)
Combine an AABB into this one.
Used for computing contact manifolds.
IMGUI_API void Initialize(ImGuiContext *context)
bool Contains(const b2AABB &aabb) const
Does this aabb contain the provided AABB.
float GetPerimeter() const
Get the perimeter length.
@ b2_nullState
point does not exist
@ b2_removeState
point was removed in the update
b2Vec2 lowerBound
the lower vertex
mvsim
Author(s):
autogenerated on Wed May 28 2025 02:13:06