C# (CSharp) Box2D.Collision Namespace

Nested Namespaces

Box2D.Collision.Broadphase
Box2D.Collision.Shapes

Classes

Name Description
AABB An axis-aligned bounding box.
B2AABB
Collision Functions used for computing contact points, distance queries, and TOI queries. Collision methods are non-static for pooling speed, retrieve a collision object from the {@link SingletonPool}. Should not be constructed.
Collision.ClipVertex Used for computing contact manifolds.
Collision.EPAxis This structure is used to keep track of the best separating axis.
Collision.EPCollider This class collides and edge and a polygon, taking into account edge adjacency.
Collision.EdgeResults Java-specific class for returning edge results
Collision.ReferenceFace Reference face used for clipping
Collision.TempPolygon This holds polygon B expressed in frame A.
Distance This is non-static for faster pooling. To get an instance, use the {@link SingletonPool}, don't construct a distance object.
Distance.DistanceProxy A distance proxy is used by the GJK algorithm. It encapsulates any shape. TODO: see if we can just do assignments with m_vertices, instead of copying stuff over
Distance.Simplex
Distance.SimplexCache Used to warm start Distance. Set count to zero on first call.
Distance.SimplexVertex GJK using Voronoi regions (Christer Ericson) and Barycentric coordinates.
DistanceInput Input for Distance. You have to option to use the shape radii in the computation.
DistanceOutput Output for Distance.
Manifold A manifold for two touching convex shapes. Box2D supports multiple types of contact:
  • clip point versus plane with radius
  • point versus point with radius (circles)
The local point usage depends on the manifold type:
  • e_circles: the local center of circleA
  • e_faceA: the center of faceA
  • e_faceB: the center of faceB
Similarly the local normal usage:
  • e_circles: not used
  • e_faceA: the normal on polygonA
  • e_faceB: the normal on polygonB
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.
ManifoldPoint 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. The local point usage depends on the manifold type:
  • e_circles: the local center of circleB
  • e_faceA: the local center of cirlceB or the clip point of polygonB
  • e_faceB: the clip point of polygonA
This structure is stored across time steps, so we keep it small.
Note: the impulses are used for internal caching and may not provide reliable contact forces, especially for high speed collisions.
RayCastInput Ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1).
RayCastOutput Ray-cast output data. The ray hits at p1 + fraction * (p2 - p1), where p1 and p2 come from b2RayCastInput.
SeparationFunction
TimeOfImpact Class used for computing the time of impact. This class should not be constructed usually, just retrieve from the {@link SingletonPool#getTOI()}.
TimeOfImpact.TOIInput Input parameters for TOI
TimeOfImpact.TOIOutput Output parameters for TimeOfImpact
WorldManifold This is used to compute the current state of a contact manifold.