示例#1
0
        // get world axis from face normal
        public Vector3 GetClosestAxisForPlaneNormal()
        {
            Vector3 norm = Normal.Absolute();

            return(norm.X >= norm.Y && norm.X >= norm.Z
                ? Vector3.UnitX
                : (norm.Y >= norm.Z)
                    ? Vector3.UnitY
                    : Vector3.UnitZ);
        }
示例#2
0
        /// <summary>
        /// Gets the axis closest to the normal of this plane
        /// </summary>
        /// <returns>Coordinate.UnitX, Coordinate.UnitY, or Coordinate.UnitZ depending on the plane's normal</returns>
        public Coordinate GetClosestAxisToNormal()
        {
            // VHE prioritises the axes in order of X, Y, Z.
            var norm = Normal.Absolute();

            if (norm.X >= norm.Y && norm.X >= norm.Z)
            {
                return(Coordinate.UnitX);
            }
            if (norm.Y >= norm.Z)
            {
                return(Coordinate.UnitY);
            }
            return(Coordinate.UnitZ);
        }
示例#3
0
        /// <summary>
        /// Gets the axis closest to the normal of this plane
        /// </summary>
        /// <returns>Vector3.UnitX, Vector3.UnitY, or Vector3.UnitZ depending on the plane's normal</returns>
        public Vector3 GetClosestAxisToNormal()
        {
            // VHE prioritises the axes in order of X, Y, Z.
            Vector3 norm = Normal.Absolute();

            if (norm.X >= norm.Y && norm.X >= norm.Z)
            {
                return(Vector3.UnitX);
            }
            if (norm.Y >= norm.Z)
            {
                return(Vector3.UnitY);
            }
            return(Vector3.UnitZ);
        }