|
Physics Simulation & Visualization Tool 0.1
A C++ physics simulation engine with real-time 3D visualization
|
Abstract base class for collision volumes in the physics engine. More...
#include <ICollider.h>
Public Member Functions | |
| virtual | ~ICollider ()=default |
| Virtual destructor for proper cleanup of derived classes. | |
| 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 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 glm::vec3 | getAABBMax () const |
Abstract base class for collision volumes in the physics engine.
Defines the interface for 3D collision primitives such as axis-aligned bounding boxes (AABB) and oriented bounding boxes (OBB). Colliders support both discrete intersection tests and continuous queries for closest points.
Definition at line 64 of file ICollider.h.
|
virtualdefault |
Virtual destructor for proper cleanup of derived classes.
|
pure virtual |
Finds the closest point on the collider surface to a given point.
| p | Query point in the same space as the collider |
Implemented in Physics::Bounding::AABB, and Physics::Bounding::BoxCollider.
|
pure virtual |
Tests if a point is inside the collider volume.
| p | Point to test, in the same coordinate space as this collider |
true if point is inside or on the surface, false otherwiseImplemented in Physics::Bounding::AABB, and Physics::Bounding::BoxCollider.
|
inlinevirtual |
Implemented in Physics::Bounding::AABB, and Physics::Bounding::BoxCollider.
Definition at line 145 of file ICollider.h.
|
inlinevirtual |
Gets the minimum, maximum corner of the axis-aligned bounding box (AABB) that contains this collider.
Implemented in Physics::Bounding::AABB, and Physics::Bounding::BoxCollider.
Definition at line 144 of file ICollider.h.
|
pure virtual |
Creates a transformed copy of this collider in world space.
Applies a 4x4 transformation matrix to create a new collider instance representing this shape in world coordinates. This is used to transform local-space colliders to world space for collision testing.
| modelMatrix | Transformation matrix (typically from SceneObject) Encodes translation, rotation, and scale |
Implemented in Physics::Bounding::AABB, and Physics::Bounding::BoxCollider.
|
pure virtual |
Tests ray-collider intersection.
| ray | The ray to test against this collider |
std::nullopt otherwiseImplemented in Physics::Bounding::AABB, and Physics::Bounding::BoxCollider.