10 AABB(
const glm::vec3& center,
const glm::vec3& halfExtents);
11 std::unique_ptr<ICollider>
getTransformed(
const glm::mat4 &modelMatrix)
const override;
15 bool contains(
const glm::vec3& p)
const override;
18 void expand(
const glm::vec3& point);
21 glm::vec3
getAABBMin()
const override {
return minCorner; }
22 glm::vec3
getAABBMax()
const override {
return maxCorner; }
29 glm::vec3 halfExtents;
Abstract interface for collision detection shapes.
std::optional< float > intersectRay(const Math::Ray &ray) const override
Tests ray-collider intersection.
bool contains(const glm::vec3 &p) const override
Tests if a point is inside the collider volume.
bool intersectsAABB(const AABB &other) const
std::unique_ptr< ICollider > getTransformed(const glm::mat4 &modelMatrix) const override
Creates a transformed copy of this collider in world space.
void expand(const glm::vec3 &point)
glm::vec3 getAABBMin() const override
Gets the minimum, maximum corner of the axis-aligned bounding box (AABB) that contains this collider.
glm::vec3 getCenter() const
ContactInfo closestPoint(const glm::vec3 &p) const override
Finds the closest point on the collider surface to a given point.
glm::vec3 getAABBMax() const override
Abstract base class for collision volumes in the physics engine.
Represents a ray in 3D space.
Bounding volume and collision shape definitions.