-------------------------------------------------------------------------------------- Description: A helper function to test separating plane at a cross product between triangle edge and one of sides of a unit AABB. Return Value: false if separating plane was found true otherwise --------------------------------------------------------------------------------------
| 662 | // true otherwise |
| 663 | // -------------------------------------------------------------------------------------- |
| 664 | inline bool AxisTest( float a, float b, float fa, float fb, const Vector3& v0, const Vector3& v1, int axis0, int axis1 ) |
| 665 | { |
| 666 | float p0 = a * v0[axis0] + b * v0[axis1]; |
| 667 | float p2 = a * v1[axis0] + b * v1[axis1]; |
| 668 | if( p2 < p0 ) |
| 669 | { |
| 670 | std::swap( p0, p2 ); |
| 671 | } |
| 672 | float rad = fa + fb; |
| 673 | return !( p0 > rad || p2 < -rad ); |
| 674 | } |
| 675 | |
| 676 | } |
| 677 |
no test coverage detected