16 #ifndef SURGSIM_MATH_TRIANGLETRIANGLECONTACTCALCULATION_INL_H
17 #define SURGSIM_MATH_TRIANGLETRIANGLECONTACTCALCULATION_INL_H
33 template <
class T,
int MOpt>
37 typedef Eigen::Matrix<T, 3, 1, MOpt>
Vector3;
38 typedef boost::container::static_vector<Vector3, CAPACITY>
Vertices;
69 for (
size_t i = 0; i < 3; ++i)
78 <<
"The distance from triangle is calculated as " << *penetrationDepth <<
". At this point in the"
79 <<
" algorithm, the depth is expected to be negative.";
81 *penetrationPoint1 = *penetrationPoint0 - (triangle.
m_normal * (*penetrationDepth));
82 *penetrationDepth = -(*penetrationDepth);
94 *planeNormal = planeNormal->cross(
m_normal);
95 planeNormal->normalize();
96 *planeD = -
m_vertices[index]->dot(*planeNormal);