public Face(FaceSide side)
 {
     this.side     = side;
     this.scale    = Vector2.one;
     this.uvs      = new List <UV>();
     this.rotation = 0;
 }
Beispiel #2
0
 public Face(FaceSide side)
 {
     this.side = side;
     this.scale = Vector2.one;
     this.uvs = new List<UV>();
     this.rotation = 0;
 }
Beispiel #3
0
        public static Vector3Int CoUnitVector3Int(this FaceSide face)
        {
            switch (face)
            {
            case FaceSide.Left:
                return(Vector3Int.left);

            case FaceSide.Right:
                return(Vector3Int.right);

            case FaceSide.Top:
                return(Vector3Int.up);

            case FaceSide.Bottom:
                return(Vector3Int.down);

            case FaceSide.Back:
                return(new Vector3Int(0, 0, -1));

            case FaceSide.Front:
                return(new Vector3Int(0, 0, 1));

            default:
                throw new InvalidOperationException();
            }
        }
Beispiel #4
0
        //============================================================

        public static Vector3 CoUnitVector3(this FaceSide face)
        {
            switch (face)
            {
            case FaceSide.Left:
                return(Vector3.left);

            case FaceSide.Right:
                return(Vector3.right);

            case FaceSide.Top:
                return(Vector3.up);

            case FaceSide.Bottom:
                return(Vector3.down);

            case FaceSide.Back:
                return(Vector3.back);

            case FaceSide.Front:
                return(Vector3.forward);

            default:
                throw new InvalidOperationException();
            }
        }
Beispiel #5
0
 // Returns the face vertices of the given side
 public static Vector3[] FaceVertices(FaceSide side, Vector3 offset, float scale)
 {
     Vector3[] vertices = new Vector3[4];
     for (int i = 0; i < 4; i++)
     {
         Vector3 originVertex = originVertices[faceVertexIndex[(int)side][i]];
         vertices[i] = originVertex * scale + offset;
     }
     return(vertices);
 }
Beispiel #6
0
        public static FaceSide ExposingFaces(this Bounds extreme, Bounds @base)
        {
            FaceSide faces = FaceSide.None;

            foreach ((Axis3D axis, NegOrPos dir) in extreme.Exposure(@base))
            {
                if (axis == Axis3D.X)
                {
                    faces |= dir == NegOrPos.Neg ? FaceSide.Left : FaceSide.Right;
                }
                else if (axis == Axis3D.Y)
                {
                    faces |= dir == NegOrPos.Neg ? FaceSide.Bottom : FaceSide.Top;
                }
                else
                {
                    faces |= dir == NegOrPos.Neg ? FaceSide.Back : FaceSide.Front;
                }
            }
            return(faces);
        }
Beispiel #7
0
        /// <summary>
        /// Get the Boundary points in whole mesh of the faces.
        /// </summary>
        /// <param name="level">The level of points that we want to retrieve.</param>
        /// <param name="faceSide">The side that we want to retrieve the points.</param>
        /// <returns></returns>
        public List<IVertex<float>> GetSidePoints( int level, FaceSide faceSide )
        {
            List<IVertex<float>> result = new List<IVertex<float>>();

            switch ( faceSide ) {
                case FaceSide.Right:

                    break;

                case FaceSide.Left:

                    break;
            }

            return result;
        }
Beispiel #8
0
        /// <summary>
        /// Get the Boundary points in whole mesh of the faces.
        /// </summary>
        /// <param name="level">The level of points that we want to retrieve.</param>
        /// <param name="faceSide">The side that we want to retrieve the points.</param>
        /// <returns></returns>
        public List<IVertex<float>> GetSidePoints( int level, FaceSide faceSide )
        {
            List<IVertex<float>> result = new List<IVertex<float>>();

            return result;
        }
 public static void StartExpressionCalibration(ExpressionType expressionType, FaceSide faceSide = FaceSide.Left)
 {
     EmteqVRPlugin.Instance.StartExpressionCalibration(expressionType);
 }
Beispiel #10
0
        /// <summary>
        /// Get the Boundary points in whole mesh of the faces.
        /// </summary>
        /// <param name="level">The level of points that we want to retrieve.</param>
        /// <param name="faceSide">The side that we want to retrieve the points.</param>
        /// <returns></returns>
        public List<IVertex<float>> GetSidePoints(int level, FaceSide faceSide)
        {
            List<IVertex<float>> result = new List<IVertex<float>>();

            // check the side
            BoundaryNode StartNode = null;
            BoundaryNode tmpNode = null;
            Boolean Up = false;
            switch (faceSide)
            {
                case FaceSide.Right:
                    // select the start node
                    StartNode = BoundaryMinMax.X_Max;

                    Up = true;
                    break;

                case FaceSide.Left:
                    // select the start node
                    StartNode = BoundaryMinMax.X_Min;

                    Up = false;
                    break;
            }

            // add the min/max nodes
            result.Add(StartNode.currentEdge.StartVertex);

            #region Forward search
            // forward search
            tmpNode = StartNode.NextNode;
            float Y_limit = StartNode.currentEdge.StartVertex.Y;
            Boolean accept = false;
            while (true)
            {
                Half_Edge he = tmpNode.currentEdge;

                accept = (Up) ? (he.StartVertex.Y > Y_limit) : (he.StartVertex.Y < Y_limit);

                if (accept)
                {
                    Y_limit = he.StartVertex.Y;
                    // add the edge
                    result.Add(he.StartVertex);
                }
                else // if we fail the angle then break the search
                    break;

                // move to the next one
                tmpNode = tmpNode.NextNode;

                // check of we are in the start
                if (tmpNode == StartNode)
                    break;
            }

            #endregion

            #region Backward search
            // forward search
            tmpNode = StartNode.PrevNode;
            Y_limit = StartNode.currentEdge.StartVertex.Y;
            while (true)
            {
                Half_Edge he = tmpNode.currentEdge;

                accept = (Up) ? (he.StartVertex.Y < Y_limit) : (he.StartVertex.Y > Y_limit);

                if (accept)
                {
                    Y_limit = he.StartVertex.Y;
                    // add the edge
                    result.Add(he.StartVertex);
                }
                else // if we fail the angle then break the search
                    break;

                // move to the next one
                tmpNode = tmpNode.PrevNode;

                // check of we are in the start
                if (tmpNode == StartNode)
                    break;
            }

            #endregion

            return result;
        }
Beispiel #11
0
        /// <summary>
        /// Get the Boundary points in whole mesh of the faces.
        /// </summary>
        /// <param name="level">The level of points that we want to retrieve.</param>
        /// <param name="faceSide">The side that we want to retrieve the points.</param>
        public void GetSideBoundaryNode( int level, FaceSide faceSide, out BoundaryNode startNode, out BoundaryNode endNode )
        {
            // check the side
            BoundaryNode _StartNode = null;
            BoundaryNode tmpNode = null;
            Boolean Up = false;

            #region Set the startNode and the direction

            switch ( faceSide ) {
                case FaceSide.Right:
                    // select the start node
                    _StartNode = BoundaryMinMax.X_Max;

                    Up = true;
                    break;

                case FaceSide.Left:
                    // select the start node
                    _StartNode = BoundaryMinMax.X_Min;

                    Up = false;
                    break;
            }

            #endregion

            #region Forward search
            // forward search
            tmpNode = _StartNode.NextNode;
            float Y_limit = _StartNode.currentEdge.StartVertex.Y;
            Boolean accept = false;
            while ( true ) {
                Half_Edge he = tmpNode.currentEdge;

                accept = ( Up ) ? ( he.StartVertex.Y > Y_limit ) : ( he.StartVertex.Y < Y_limit );

                if ( accept ) {
                    Y_limit = he.StartVertex.Y;
                } else // if we fail the angle then break the search
                    break;

                // move to the next one
                tmpNode = tmpNode.NextNode;

                // check of we are in the start
                if ( tmpNode == _StartNode )
                    break;
            }

            #endregion

            // set the end node ( go one backward to get the correct node )
            endNode = tmpNode.PrevNode;

            #region Backward search
            // Backward search
            tmpNode = _StartNode.PrevNode;
            Y_limit = _StartNode.currentEdge.StartVertex.Y;
            while ( true ) {
                Half_Edge he = tmpNode.currentEdge;

                accept = ( Up ) ? ( he.StartVertex.Y < Y_limit ) : ( he.StartVertex.Y > Y_limit );

                if ( accept ) {
                    Y_limit = he.StartVertex.Y;
                } else // if we fail the angle then break the search
                    break;

                // move to the next one
                tmpNode = tmpNode.PrevNode;

                // check of we are in the start
                if ( tmpNode == _StartNode )
                    break;
            }

            #endregion

            // set the start node ( go one forward to get the correct node )
            startNode = tmpNode.NextNode;
        }