Example #1
0
        private Vector3 GetTopBottomIntersectionPoint(Vector3 A, FPlane cbPlane, FPlane incidentPlane)
        {
            Vector3 result;
            Vector3 acNormal       = new Vector3(incidentPlane.X, incidentPlane.Y, incidentPlane.Z);
            Vector3 acRayDirection = Vector3.Cross(acNormal, RightVector);

            Vector3 cbNormal = new Vector3(cbPlane.X, cbPlane.Y, cbPlane.Z);

            // if ac ray is opposite directed - invert it's direction
            acRayDirection *= Vector3.Dot(cbNormal, acRayDirection) > 0.0 ? 1 : -1;
            FRay acRay = new FRay(A, acRayDirection);

            result = GeometryMath.GetIntersectionRayPlane(cbPlane, acRay);
            return(result);
        }