| 270 | /// please consider using \ref findTriTriDistance function instead that is more tolerant to floating-point errors but slower |
| 271 | template <typename T> |
| 272 | bool doTrianglesIntersectExt( |
| 273 | const Vector3<T> & a, const Vector3<T> & b, const Vector3<T> & c, |
| 274 | const Vector3<T> & d, const Vector3<T> & e, const Vector3<T> & f |
| 275 | ) |
| 276 | { |
| 277 | if ( !doTrianglesIntersect( a, b, c, d, e, f ) ) |
| 278 | return false; |
| 279 | |
| 280 | // direction from center to center |
| 281 | const auto dir = a + b + c - d - e - f; |
| 282 | |
| 283 | return |
| 284 | !doesEdgeXySeparate( a, b, c, d, e, f, dir ) && |
| 285 | !doesEdgeXySeparate( b, c, a, d, e, f, dir ) && |
| 286 | !doesEdgeXySeparate( c, a, b, d, e, f, dir ) && |
| 287 | !doesEdgeXySeparate( d, e, f, a, b, c, dir ) && |
| 288 | !doesEdgeXySeparate( e, f, d, a, b, c, dir ) && |
| 289 | !doesEdgeXySeparate( f, d, e, a, b, c, dir ); |
| 290 | } |
| 291 | |
| 292 | /// checks whether triangle ABC and infinite line DE intersect |
| 293 | template <typename T> |