Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Returns wheter the given sphere is in the frustum.
- *
- * @param center
- * The center of the sphere
- * @param radius
- * The radius of the sphere
- * @return Wheter the sphere is in the frustum
- */
- public boolean sphereInFrustum(Vector3 center, float radius) {
- for (int i = 0; i < 6; i++)
- if ((planes[i].normal.x * center.x + planes[i].normal.y * center.y + planes[i].normal.z
- * center.z) < (-radius - planes[i].d))
- return false;
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement