protected virtual bool validate(SSSphere newBodyInfo)
        {
            // override to handle collision tests efficiently for a specific shape of a field
            // or add other clipping tests..
            newBodyInfo.radius += m_safetyDistance;
            if (m_bodyRadius == 0.0f) return true;

            List<ssBVHNode<SSSphere>> intersectList
                = m_bodiesSoFar.traverse (newBodyInfo.ToAABB ());
            foreach (ssBVHNode<SSSphere> node in intersectList) {
                if (node.gobjects != null) {
                    foreach (SSSphere sphere in node.gobjects) {
                        if (newBodyInfo.IntersectsSphere (sphere)) {
                            return false; // invalid
                        }
                    }
                }
            }
            m_bodiesSoFar.addObject (newBodyInfo);
            return true; // valid
        }
Example #2
0
 public bool isSphereInsideFrustum(SSSphere sphere)
 {
     return isSphereInsideFrustum (sphere.center, sphere.radius);
 }
Example #3
0
 public bool isSphereInsideFrustum(SSSphere sphere)
 {
     return(isSphereInsideFrustum(sphere.center, sphere.radius));
 }