MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / isOverlapped

Method isOverlapped

Engine/source/math/mBox.cpp:34–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32//-----------------------------------------------------------------------------
33
34bool Box3F::isOverlapped( const SphereF& sphere ) const
35{
36 // Algorithm: Real-Time Rendering, Ed. 1, p323, 10.10.1 Sphere/Box Intersection
37
38 F32 d = 0;
39 for( U32 i = 0; i < 3; ++ i )
40 if( sphere.center[ i ] < minExtents[ i ] )
41 d = d + mSquared( sphere.center[ i ] - minExtents[ i ] );
42 else if( sphere.center[ i ] > maxExtents[ i ] )
43 d = d + mSquared( sphere.center[ i ] - maxExtents[ i ] );
44
45 return !( d > mSquared( sphere.radius ) );
46}
47
48//-----------------------------------------------------------------------------
49

Callers

nothing calls this directly

Calls 1

mSquaredFunction · 0.85

Tested by

no test coverage detected