1#ifndef _COLLISION_DETECTION_HPP_
2#define _COLLISION_DETECTION_HPP_
Collision shapes, the broadphase tree, and the world that steps them.
void ClosestPointsSegmentSegment(const Vector3D &a1, const Vector3D &a2, const Vector3D &b1, const Vector3D &b2, Vector3D &closestA, Vector3D &closestB)
Nearest points between two line segments, used for capsule-vs-capsule tests.
CollisionManifold TestSphereVsTriangle(const BoundingSphere &sphere, const Vector3D &v0, const Vector3D &v1, const Vector3D &v2)
std::variant< AABB, BoundingSphere, BoundingCapsule, TriangleMesh > ColliderShape
Tagged union of the shapes a ColliderComponent can hold.
CollisionManifold TestCapsuleVsCapsule(const BoundingCapsule &a, const BoundingCapsule &b)
Vector3D ClosestPointOnSegment(const Vector3D &point, const Vector3D &a, const Vector3D &b)
Nearest point on segment [a, b] to the given point.
CollisionManifold TestAABBvsCapsule(const AABB &a, const BoundingCapsule &b)
CollisionManifold TestSphereVsMesh(const BoundingSphere &a, const TriangleMesh &b)
CollisionManifold TestAABBvsAABB(const AABB &a, const AABB &b)
Narrow-phase collision tests; the resulting normal always points from A to B.
CollisionManifold TestAABBvsSphere(const AABB &a, const BoundingSphere &b)
CollisionManifold TestSphereVsCapsule(const BoundingSphere &a, const BoundingCapsule &b)
CollisionManifold TestSphereVsSphere(const BoundingSphere &a, const BoundingSphere &b)
CollisionManifold TestCollision(const ColliderShape &shapeA, const Vector3D &posA, const Vector3D &scaleA, const ColliderShape &shapeB, const Vector3D &posB, const Vector3D &scaleB)
Dispatches to the right narrow-phase test based on the runtime shape held by each variant.
CollisionManifold TestAABBvsMesh(const AABB &a, const TriangleMesh &b)
Root namespace for everything the engine exposes.