42#include <gtest/gtest.h>
44#include <ACG/Math/VectorT.hh>
45#include <ACG/Geometry/Algorithms.hh>
52 virtual void SetUp() {
57 virtual void TearDown() {
99 EXPECT_TRUE( result ) <<
"Intersection failed!";
101 EXPECT_EQ( 1.0f, distance ) <<
"Wrong distance!" << std::endl;
102 EXPECT_EQ( 0.1f, u ) <<
"Wrong u!" << std::endl;
103 EXPECT_EQ( 0.1f, v ) <<
"Wrong v!" << std::endl;
142 EXPECT_TRUE( result ) <<
"Intersection failed!";
144 EXPECT_EQ( 1.0f, distance ) <<
"Wrong distance!" << std::endl;
145 EXPECT_EQ( 0.1f, u ) <<
"Wrong u!" << std::endl;
146 EXPECT_EQ( 0.1f, v ) <<
"Wrong v!" << std::endl;
185 EXPECT_TRUE( result ) <<
"Intersection failed!";
187 EXPECT_EQ( -1.0f, distance ) <<
"Wrong distance!" << std::endl;
188 EXPECT_EQ( 0.1f, u ) <<
"Wrong u!" << std::endl;
189 EXPECT_EQ( 0.1f, v ) <<
"Wrong v!" << std::endl;
193TEST_F(
ALGORITHM_TEST_BASE, triangleIntersection_NegativeShootingDirection_FlippedTriangleOrientation ) {
228 EXPECT_TRUE( result ) <<
"Intersection failed!";
230 EXPECT_EQ( -1.0f, distance ) <<
"Wrong distance!" << std::endl;
231 EXPECT_EQ( 0.1f, u ) <<
"Wrong u!" << std::endl;
232 EXPECT_EQ( 0.1f, v ) <<
"Wrong v!" << std::endl;
bool triangleIntersection(const Vec &_o, const Vec &_dir, const Vec &_v0, const Vec &_v1, const Vec &_v2, typename Vec::value_type &_t, typename Vec::value_type &_u, typename Vec::value_type &_v)
Intersect a ray and a triangle.