2
// ---------------------------------------------------------
7
// Forward error analysis implementation of collision and intersection queries.
9
// ---------------------------------------------------------
11
#include <ccd_wrapper.h>
13
#ifdef USE_FORWARD_ERROR_CCD
15
#include <predicates.h>
18
// --------------------------------------------------------------------------------------------------------------
21
bool point_triangle_collision(const Vec3d& x0, const Vec3d& xnew0, unsigned int index0,
22
const Vec3d& x1, const Vec3d& xnew1, unsigned int index1,
23
const Vec3d& x2, const Vec3d& xnew2, unsigned int index2,
24
const Vec3d& x3, const Vec3d& xnew3, unsigned int index3 )
26
assert( index1 < index2 && index2 < index3 );
27
return fe_point_triangle_collision( x0, xnew0, x1, xnew1, x2, xnew2, x3, xnew3 );
31
// --------------------------------------------------------------------------------------------------------------
34
bool point_triangle_collision(const Vec3d& x0, const Vec3d& xnew0, unsigned int index0,
35
const Vec3d& x1, const Vec3d& xnew1, unsigned int index1,
36
const Vec3d& x2, const Vec3d& xnew2, unsigned int index2,
37
const Vec3d& x3, const Vec3d& xnew3, unsigned int index3,
38
double& bary1, double& bary2, double& bary3,
41
double& relative_normal_displacement,
44
assert( index1 < index2 && index2 < index3 );
45
return fe_point_triangle_collision( x0, xnew0, x1, xnew1, x2, xnew2, x3, xnew3, bary1, bary2, bary3, normal, t, relative_normal_displacement, verbose );
49
// --------------------------------------------------------------------------------------------------------------
52
bool segment_segment_collision(const Vec3d& x0, const Vec3d& xnew0, unsigned int index0,
53
const Vec3d& x1, const Vec3d& xnew1, unsigned int index1,
54
const Vec3d& x2, const Vec3d& xnew2, unsigned int index2,
55
const Vec3d& x3, const Vec3d& xnew3, unsigned int index3)
57
assert( index0 < index1 && index2 < index3 );
58
return fe_segment_segment_collision( x0, xnew0, x1, xnew1, x2, xnew2, x3, xnew3 );
62
// --------------------------------------------------------------------------------------------------------------
66
bool segment_segment_collision(const Vec3d& x0, const Vec3d& xnew0, unsigned int index0,
67
const Vec3d& x1, const Vec3d& xnew1, unsigned int index1,
68
const Vec3d& x2, const Vec3d& xnew2, unsigned int index2,
69
const Vec3d& x3, const Vec3d& xnew3, unsigned int index3,
70
double& bary0, double& bary2,
73
double& relative_normal_displacement,
76
assert( index0 < index1 && index2 < index3 );
77
return fe_segment_segment_collision( x0, xnew0, x1, xnew1, x2, xnew2, x3, xnew3, bary0, bary2, normal, t, relative_normal_displacement, verbose );