36 #include <gtest/gtest.h> 43 #include "fcl_resources/config.h" 70 return std::abs(x - y) < epsilon<S>();
73 template<
typename S, std::
size_t N>
77 for(std::size_t i = 0; i < N; ++i)
78 d += (a[i] - b[i]) * (a[i] - b[i]);
88 for(
auto i = 0; i < a.size(); ++i)
90 for(
auto i = 0; i < b.size(); ++i)
93 std::cout << a.transpose() << std::endl;
94 std::cout << b.transpose() << std::endl;
95 std::cout << (a + b).transpose() << std::endl;
96 std::cout << (a - b).transpose() << std::endl;
97 std::cout << (a -= b).transpose() << std::endl;
98 std::cout << (a += b).transpose() << std::endl;
99 std::cout << (a * 2).transpose() << std::endl;
100 std::cout << (a / 2).transpose() << std::endl;
101 std::cout << (a *= 2).transpose() << std::endl;
102 std::cout << (a /= 2).transpose() << std::endl;
103 std::cout << a.dot(b) << std::endl;
106 std::cout << c.transpose() << std::endl;
109 for(
int i = 0; i < 4; ++i)
113 std::cout << aa.transpose() << std::endl;
116 for(std::size_t i = 0; i < 10; ++i)
117 std::cout << sampler.
sample().transpose() << std::endl;
125 for(std::size_t i = 0; i < 10; ++i)
126 std::cout << sampler3.
sample().transpose() << std::endl;
133 test_Vec_nf_test<double>();
136 template <
typename S>
168 test_projection_test_line<double>();
171 template <
typename S>
238 test_projection_test_triangle<double>();
241 template <
typename S>
389 test_projection_test_tetrahedron<double>();
393 int main(
int argc,
char* argv[])
395 ::testing::InitGoogleTest(&argc, argv);
396 return RUN_ALL_TESTS();
VectorN< S, N > sample() const
Eigen::Matrix< S, N, 1 > VectorN
Vector6< S > sample() const
static ProjectResult projectTetrahedra(const Vector3< S > &a, const Vector3< S > &b, const Vector3< S > &c, const Vector3< S > &d, const Vector3< S > &p)
Project point p onto tetrahedra a-b-c-d.
S distance_Vecnf(const VectorN< S, N > &a, const VectorN< S, N > &b)
Eigen::Matrix< S, 3, 1 > Vector3
FCL_EXPORT VectorN< S, M+N > combine(const VectorN< S, M > &v1, const VectorN< S, N > &v2)
static ProjectResult projectTriangle(const Vector3< S > &a, const Vector3< S > &b, const Vector3< S > &c, const Vector3< S > &p)
Project point p onto triangle a-b-c.
void test_projection_test_tetrahedron()
int main(int argc, char *argv[])
void test_projection_test_line()
static ProjectResult projectLine(const Vector3< S > &a, const Vector3< S > &b, const Vector3< S > &p)
Project point p onto line a-b.
void test_projection_test_triangle()
#define EXPECT_TRUE(args)
GTEST_TEST(FCL_SIMPLE, Vec_nf_test)