17 #ifndef AGX_HIERARCHICALGRIDSPHEREBOXOVERLAPTEST_H 18 #define AGX_HIERARCHICALGRIDSPHEREBOXOVERLAPTEST_H 26 #define AXIS_TEST(axis) \ 28 Real diff = std::abs( localSpherePosition[axis] ) - boxHalfExtents[axis]; \ 30 if (diff > sphereRadius) \ 33 pointOnBox[axis] = (localSpherePosition[axis] > 0) ? boxHalfExtents[axis] : -boxHalfExtents[axis]; \ 40 Real sphereRadius,
const Vec3& spherePosition,
52 Vec3 localSpherePosition = spherePosition * boxInvTransform;
53 Vec3 pointOnBox = localSpherePosition;
55 bool isOutside =
false;
62 Vec3 normal = localSpherePosition - pointOnBox;
64 if (distance2 > sphereRadius * sphereRadius)
Real length2() const
Length squared of the vector = vec .
bool sphereBoxOverlapTest(Real sphereRadius, const Vec3 &spherePosition, const Vec3 &boxHalfExtents, const AffineMatrix4x4 &boxInvTransform)
The agx namespace contains the dynamics/math part of the AGX Dynamics API.