Exemplo n.º 1
0
        public BoxFace GetBoxFaceWhichFacesNormal(Vector3 normal)
        {
            List <Plane> facePlanes = GetBoxFacePlanes();
            int          planeIndex;

            PlaneExtensions.GetPlaneWhichFacesNormal(facePlanes, normal, out planeIndex);

            return((BoxFace)planeIndex);
        }
Exemplo n.º 2
0
        public BoxFace GetBoxFaceMostAlignedWithNormal(Vector3 normal)
        {
            List <Plane> facePlanes = GetBoxFacePlanes();
            int          planeIndex;

            PlaneExtensions.GetPlaneMostAlignedWithNormal(facePlanes, normal, out planeIndex);

            return((BoxFace)planeIndex);
        }
Exemplo n.º 3
0
        public bool AreAllBoxPointsOnOrInFrontOfAnyFacePlane(OrientedBox otherBox)
        {
            List <Vector3> otherBoxPoints = otherBox.GetCenterAndCornerPoints();
            List <Plane>   allFacePlanes  = GetBoxFacePlanes();

            foreach (Plane plane in allFacePlanes)
            {
                if (PlaneExtensions.AreAllPointsInFrontOrOnPlane(plane, otherBoxPoints))
                {
                    return(true);
                }
            }

            return(false);
        }