示例#1
0
        public BoundingType sphere_intersects_cell_bsp(Sphere curSphere)
        {
            var dist     = Vector3.Dot(SplittingPlane.Normal, curSphere.Center) + SplittingPlane.D;
            var checkRad = curSphere.Radius + 0.01f;   // 0.0099999998;

            if (dist <= -checkRad)
            {
                return(BoundingType.Outside);
            }

            if (dist >= checkRad)
            {
                if (PosNode != null)
                {
                    return(PosNode.sphere_intersects_cell_bsp(curSphere));
                }
                else
                {
                    return(BoundingType.EntirelyInside);
                }
            }

            if (PosNode != null)
            {
                return(PosNode.sphere_intersects_cell_bsp(curSphere) != BoundingType.Outside ?
                       BoundingType.PartiallyInside : BoundingType.Outside);
            }

            return(BoundingType.PartiallyInside);
        }
示例#2
0
 public BoundingType sphere_intersects_cell_bsp(Sphere sphere)
 {
     return(RootNode.sphere_intersects_cell_bsp(sphere));
 }