Example #1
0
// Assumes frustum plane normals face *outward*
S2FResult SphereToFrustum(const Sphere& sphere, const Frustum& frustum)
{
	S2FResult result = S2FResult_Inside;
	
	for (int i = 0; i < Frustum::Plane_Count; i++)
	{
		Result spherePlane = SphereToPlane(sphere, frustum.planes[i]);
		switch (spherePlane)
		{
		case Result_InFront:
			return S2FResult_Outside;
		case Result_Intersecting:
			result = S2FResult_Intersecting;
		default:
			break;
		}
	}
	
	return result;
}
CollisionManifold CustomPhysicsEngine::PlaneToSphere(Collider* _plane, Collider* _sphere) {
	return SphereToPlane(_sphere, _plane);
}