|
Hymn to Beauty
C++ 3D Engine
|
The class handling intersection checks. More...
#include <RayIntersection.hpp>
Public Member Functions | |
| RayIntersection () | |
| Constructor. More... | |
| ~RayIntersection () | |
| Destructor. More... | |
| bool | RayOBBIntersect (const glm::vec3 &rayOrigin, const glm::vec3 &rayDirection, const Video::AxisAlignedBoundingBox &meshData, const glm::mat4 &modelMatrix, float &outputDistance) const |
| Checks whether a ray intersects with an OBB. More... | |
| bool | TriangleIntersect (glm::vec3 rayOrigin, glm::vec3 rayDirection, glm::vec3 p0, glm::vec3 p1, glm::vec3 p2, float &distance) |
| Checks whether a ray intersects with a triangle. More... | |
The class handling intersection checks.
| RayIntersection::RayIntersection | ( | ) |
Constructor.
| RayIntersection::~RayIntersection | ( | ) |
Destructor.
| bool RayIntersection::RayOBBIntersect | ( | const glm::vec3 & | rayOrigin, |
| const glm::vec3 & | rayDirection, | ||
| const Video::AxisAlignedBoundingBox & | meshData, | ||
| const glm::mat4 & | modelMatrix, | ||
| float & | outputDistance | ||
| ) | const |
Checks whether a ray intersects with an OBB.
| rayOrigin | The position the ray originates from. |
| rayDirection | The direction the ray is shooting towards. |
| meshData | The bounding box belonging to the mesh that is tested against. |
| modelMatrix | The model matrix belonging to the mesh that is tested against. |
| outputDistance | The distance to the entity that is tested to be used as a return value check. |
| bool RayIntersection::TriangleIntersect | ( | glm::vec3 | rayOrigin, |
| glm::vec3 | rayDirection, | ||
| glm::vec3 | p0, | ||
| glm::vec3 | p1, | ||
| glm::vec3 | p2, | ||
| float & | distance | ||
| ) |
Checks whether a ray intersects with a triangle.
| rayOrigin | The position the ray originates from. |
| rayDirection | The direction the ray is shooting towards. |
| p0 | The first vertex of the triangle being tested. |
| p1 | The second vertex of the triangle being tested. |
| p2 | The third vertex of the triangle being tested. |
| distance | The distance to the entity that is tested to be used as a return value check. |