//--------------------------------------- // Sphere v Frustum //--------------------------------------- int Intersection::Test( const Spheref& sphere, const Frustum& frustum ) { // 1, 0, -1 : inside, intersect, outside int res = 1; for ( int i = 0; i < 6; ++i ) { float dist = frustum.GetPlane( i ).DistanceTo( sphere.Center ); if ( dist < -sphere.Radius ) { return -1; } if ( dist < sphere.Radius ) { res = 0; } } return res; }