MobileRT  1.0
A multi platform C++ CPU progressive Ray Tracer.
TestTriangle.cpp File Reference
#include "MobileRT/Intersection.hpp"
#include "MobileRT/Ray.hpp"
#include "MobileRT/Shapes/Triangle.hpp"
#include "MobileRT/Utils/Utils.hpp"
#include <gtest/gtest.h>
Include dependency graph for TestTriangle.cpp:

Classes

class  TestTriangle
 

Namespaces

 anonymous_namespace{TestTriangle.cpp}
 

Functions

void assertBoxIntersectsTriangle (const ::glm::vec3 &min, const ::glm::vec3 &max, const Triangle &triangle)
 
void assertRayTriangle (const ::glm::vec3 &orig, const ::glm::vec3 &dir, const Triangle &triangle, const bool expectedInt, const void *const primitive=nullptr)
 
 TEST_F (TestTriangle, TestInvalidConstructor)
 
 TEST_F (TestTriangle, TestInvalidConstructor2)
 
 TEST_F (TestTriangle, TestConstructor)
 
 TEST_F (TestTriangle, ConstructorVALUES)
 
 TEST_F (TestTriangle, AABB)
 
 TEST_F (TestTriangle, intersectBoxInside01)
 
 TEST_F (TestTriangle, intersectBoxInside02)
 
 TEST_F (TestTriangle, intersectBoxInside03)
 
 TEST_F (TestTriangle, intersectBoxInside04)
 
 TEST_F (TestTriangle, intersectBoxInside05)
 
 TEST_F (TestTriangle, intersectBoxInside06)
 
 TEST_F (TestTriangle, intersectBoxInside07)
 
 TEST_F (TestTriangle, intersectBoxInside08)
 
 TEST_F (TestTriangle, intersectBoxInside09)
 
 TEST_F (TestTriangle, intersectBoxInside10)
 
 TEST_F (TestTriangle, ConstructorCOPY)
 
 TEST_F (TestTriangle, OperatorLESS)
 
 TEST_F (TestTriangle, OperatorMORE)
 
 TEST_F (TestTriangle, intersectRayInside01)
 
 TEST_F (TestTriangle, intersectRayInside02)
 
 TEST_F (TestTriangle, intersectRayInside03)
 
 TEST_F (TestTriangle, intersectRayOutside01)
 
 TEST_F (TestTriangle, intersectRayOutside02)
 
 TEST_F (TestTriangle, intersectRayOutside03)
 
 TEST_F (TestTriangle, intersectRayOutside04)
 
 TEST_F (TestTriangle, intersectRayOutside05)
 
 TEST_F (TestTriangle, intersectRayOutside06)
 
 TEST_F (TestTriangle, intersectRayFromPrimitive)
 

Variables

const Triangle anonymous_namespace{TestTriangle.cpp}::triangle2
 
const Triangle anonymous_namespace{TestTriangle.cpp}::triangle3
 

Function Documentation

◆ assertBoxIntersectsTriangle()

void assertBoxIntersectsTriangle ( const ::glm::vec3 &  min,
const ::glm::vec3 &  max,
const Triangle &  triangle 
)
inline

Helper method that checks if an AABB intersects a Triangle.

Parameters
minThe minimum point of the AABB.
maxThe maximum point of the AABB.
triangleThe triangle to check the intersection.
Here is the caller graph for this function:

◆ assertRayTriangle()

void assertRayTriangle ( const ::glm::vec3 &  orig,
const ::glm::vec3 &  dir,
const Triangle &  triangle,
const bool  expectedInt,
const void *const  primitive = nullptr 
)
inline

Helper method that checks if a Ray intersects a Triangle.

Parameters
origThe origin of the ray.
dirThe direction of the ray.
triangleThe triangle to check the intersection.
expectedIntWhether its expected to intersect or not.
primitiveThe primitive where the ray was casted from (default is null).
Here is the caller graph for this function:

◆ TEST_F() [1/28]

TEST_F ( TestTriangle  ,
TestInvalidConstructor   
)

Tests the Triangle constructor with invalid parameters.

◆ TEST_F() [2/28]

TEST_F ( TestTriangle  ,
TestInvalidConstructor2   
)

Tests the Triangle constructor with invalid parameters.

◆ TEST_F() [3/28]

TEST_F ( TestTriangle  ,
TestConstructor   
)

Tests the Triangle constructor.

Here is the call graph for this function:

◆ TEST_F() [4/28]

TEST_F ( TestTriangle  ,
ConstructorVALUES   
)

Tests the Triangle constructor.

◆ TEST_F() [5/28]

TEST_F ( TestTriangle  ,
AABB   
)

Tests the calculation of an AABB of a triangle.

◆ TEST_F() [6/28]

TEST_F ( TestTriangle  ,
intersectBoxInside01   
)

Tests intersecting an AABB with a Triangle.

Here is the call graph for this function:

◆ TEST_F() [7/28]

TEST_F ( TestTriangle  ,
intersectBoxInside02   
)

Tests intersecting an AABB with a Triangle.

Here is the call graph for this function:

◆ TEST_F() [8/28]

TEST_F ( TestTriangle  ,
intersectBoxInside03   
)

Tests intersecting an AABB with a Triangle.

Here is the call graph for this function:

◆ TEST_F() [9/28]

TEST_F ( TestTriangle  ,
intersectBoxInside04   
)

Tests intersecting an AABB with a Triangle.

Here is the call graph for this function:

◆ TEST_F() [10/28]

TEST_F ( TestTriangle  ,
intersectBoxInside05   
)

Tests intersecting an AABB with a Triangle.

Here is the call graph for this function:

◆ TEST_F() [11/28]

TEST_F ( TestTriangle  ,
intersectBoxInside06   
)
Here is the call graph for this function:

◆ TEST_F() [12/28]

TEST_F ( TestTriangle  ,
intersectBoxInside07   
)

Tests intersecting an AABB with a Triangle.

◆ TEST_F() [13/28]

TEST_F ( TestTriangle  ,
intersectBoxInside08   
)

Tests intersecting an AABB with a Triangle.

Here is the call graph for this function:

◆ TEST_F() [14/28]

TEST_F ( TestTriangle  ,
intersectBoxInside09   
)

Tests intersecting an AABB with a Triangle.

Here is the call graph for this function:

◆ TEST_F() [15/28]

TEST_F ( TestTriangle  ,
intersectBoxInside10   
)

Tests intersecting an AABB with a Triangle.

Here is the call graph for this function:

◆ TEST_F() [16/28]

TEST_F ( TestTriangle  ,
ConstructorCOPY   
)

Tests the copy constructor of a ::glm::vector.

◆ TEST_F() [17/28]

TEST_F ( TestTriangle  ,
OperatorLESS   
TestTriangle  ,
intersectRayOutside06   
)

Tests the intersection of a Ray with a Triangle.

Here is the call graph for this function:

◆ TEST_F() [28/28]

TEST_F ( TestTriangle  ,
intersectRayFromPrimitive   
)

Tests intersecting a Ray with a Triangle and that Ray has the origin from the same Triangle, so it shouldn't intersect.

Here is the call graph for this function: