3#include <glm/gtx/quaternion.hpp>
9 BoxCollider(
const glm::vec3& center,
const glm::vec3& halfExtents,
const glm::quat& rotation);
11 std::unique_ptr<ICollider>
getTransformed(
const glm::mat4 &modelMatrix)
const override;
13 bool contains(
const glm::vec3 &p)
const override;
23 glm::vec3 halfExtents{};
24 glm::quat rotation{1, 0, 0, 0};
Abstract interface for collision detection shapes.
std::optional< float > intersectRay(const Math::Ray &ray) const override
Tests ray-collider intersection.
std::unique_ptr< ICollider > getTransformed(const glm::mat4 &modelMatrix) const override
Creates a transformed copy of this collider in world space.
glm::vec3 getAABBMax() const override
bool contains(const glm::vec3 &p) const override
Tests if a point is inside the collider volume.
ContactInfo closestPoint(const glm::vec3 &p) const override
Finds the closest point on the collider surface to a given point.
glm::vec3 getAABBMin() const override
Gets the minimum, maximum corner of the axis-aligned bounding box (AABB) that contains this collider.
Abstract base class for collision volumes in the physics engine.
Represents a ray in 3D space.
Bounding volume and collision shape definitions.