示例#1
0
        public FrustumState BoxInFrustum(Mesh.BoundingBox b, Vector3 Offset)
        {
            FrustumState result = FrustumState.INSIDE;

            for (int i = 0; i < 6; i++)
            {
                if (pl[i].Distance(b.GetVertexP(pl[i].Normal) + Offset) < 0)
                    return FrustumState.OUTSIDE;
                else if (pl[i].Distance(b.GetVertexN(pl[i].Normal) + Offset) < 0)
                    result = FrustumState.INTERSECT;
            }
            return (result);
        }