8#define GLM_ENABLE_EXPERIMENTAL
81 virtual bool contains(
const glm::vec3& p)
const = 0;
121 virtual std::unique_ptr<ICollider>
getTransformed(
const glm::mat4& modelMatrix)
const = 0;
144 virtual glm::vec3
getAABBMin()
const {
return glm::vec3(0.0f); }
145 virtual glm::vec3
getAABBMax()
const {
return glm::vec3(0.0f); }
Abstract base class for collision volumes in the physics engine.
virtual ~ICollider()=default
Virtual destructor for proper cleanup of derived classes.
virtual std::unique_ptr< ICollider > getTransformed(const glm::mat4 &modelMatrix) const =0
Creates a transformed copy of this collider in world space.
virtual std::optional< float > intersectRay(const Math::Ray &ray) const =0
Tests ray-collider intersection.
virtual glm::vec3 getAABBMin() const
Gets the minimum, maximum corner of the axis-aligned bounding box (AABB) that contains this collider.
virtual bool contains(const glm::vec3 &p) const =0
Tests if a point is inside the collider volume.
virtual ContactInfo closestPoint(const glm::vec3 &p) const =0
Finds the closest point on the collider surface to a given point.
virtual glm::vec3 getAABBMax() const
Represents a ray in 3D space.
Bounding volume and collision shape definitions.
float penetration
Penetration depth (positive = overlapping, negative = separated)
glm::vec3 normal
Surface normal at contact point (points outward from surface)
glm::vec3 point
Contact point in world space (closest point on surface)