Hymn to Beauty
C++ 3D Engine
RayIntersection Class Reference

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...
 

Detailed Description

The class handling intersection checks.

Constructor & Destructor Documentation

◆ RayIntersection()

RayIntersection::RayIntersection ( )

Constructor.

◆ ~RayIntersection()

RayIntersection::~RayIntersection ( )

Destructor.

Member Function Documentation

◆ RayOBBIntersect()

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.

Parameters
rayOriginThe position the ray originates from.
rayDirectionThe direction the ray is shooting towards.
meshDataThe bounding box belonging to the mesh that is tested against.
modelMatrixThe model matrix belonging to the mesh that is tested against.
outputDistanceThe distance to the entity that is tested to be used as a return value check.
Returns
Whether or not the ray intersects with the entity that is tested against.

◆ TriangleIntersect()

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.

Parameters
rayOriginThe position the ray originates from.
rayDirectionThe direction the ray is shooting towards.
p0The first vertex of the triangle being tested.
p1The second vertex of the triangle being tested.
p2The third vertex of the triangle being tested.
distanceThe distance to the entity that is tested to be used as a return value check.
Returns
Whether or not the ray intersects with the triangle that is tested against.

The documentation for this class was generated from the following files: