コード例 #1
0
ファイル: Plane.cs プロジェクト: unitycoder/Runegear
        // 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
ファイル: Plane.cs プロジェクト: Redhacker1/sledge-formats
        /// <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);
        }