SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
CollisionDetection.cpp File Reference
#include <Physics/CollisionDetection.hpp>
#include <cmath>
#include <algorithm>
#include <limits>

Go to the source code of this file.

Namespaces

namespace  Sleak
 Root namespace for everything the engine exposes.
namespace  Sleak::Physics
 Collision shapes, the broadphase tree, and the world that steps them.

Functions

static Vector3D Sleak::Physics::ClosestPointOnAABB (const AABB &aabb, const Vector3D &point)
 Clamps point into the box, giving the nearest surface or interior point.
Vector3D Sleak::Physics::ClosestPointOnSegment (const Vector3D &point, const Vector3D &a, const Vector3D &b)
 Nearest point on segment [a, b] to the given point.
void Sleak::Physics::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 Sleak::Physics::TestAABBvsAABB (const AABB &a, const AABB &b)
 Narrow-phase collision tests; the resulting normal always points from A to B.
CollisionManifold Sleak::Physics::TestAABBvsCapsule (const AABB &a, const BoundingCapsule &b)
CollisionManifold Sleak::Physics::TestAABBvsMesh (const AABB &a, const TriangleMesh &b)
CollisionManifold Sleak::Physics::TestAABBvsSphere (const AABB &a, const BoundingSphere &b)
CollisionManifold Sleak::Physics::TestCapsuleVsCapsule (const BoundingCapsule &a, const BoundingCapsule &b)
CollisionManifold Sleak::Physics::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 Sleak::Physics::TestSphereVsCapsule (const BoundingSphere &a, const BoundingCapsule &b)
CollisionManifold Sleak::Physics::TestSphereVsMesh (const BoundingSphere &a, const TriangleMesh &b)
CollisionManifold Sleak::Physics::TestSphereVsSphere (const BoundingSphere &a, const BoundingSphere &b)
CollisionManifold Sleak::Physics::TestSphereVsTriangle (const BoundingSphere &sphere, const Vector3D &v0, const Vector3D &v1, const Vector3D &v2)
static AABB Sleak::Physics::TransformAABB (const AABB &aabb, const Vector3D &pos, const Vector3D &scale)
static BoundingCapsule Sleak::Physics::TransformCapsule (const BoundingCapsule &c, const Vector3D &pos, const Vector3D &scale)
static TriangleMesh Sleak::Physics::TransformMesh (const TriangleMesh &m, const Vector3D &pos, const Vector3D &scale)
static BoundingSphere Sleak::Physics::TransformSphere (const BoundingSphere &s, const Vector3D &pos, const Vector3D &scale)