MCPcopy Create free account
hub / github.com/carbonengine/trinity / AxisTest

Function AxisTest

trinity/Utilities/BoundingBox.cpp:664–674  ·  view source on GitHub ↗

-------------------------------------------------------------------------------------- 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 --------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

662// true otherwise
663// --------------------------------------------------------------------------------------
664inline 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

Callers 1

Calls 1

swapFunction · 0.85

Tested by

no test coverage detected