Beispiel #1
0
        public override void ManageDragging()
        {
            if (PointedTris != null && SelectedUV != null)
            {
                Vector2 uv        = SelectedUV.SharedEditedUV;
                Vector2 posUV     = PointedTris.LocalPosToEditedUV(MeshMGMT.collisionPosLocal);
                Vector2 newUV     = uv * 2 - posUV;
                bool    isChanged = newUV != lastCalculatedUV;
                lastCalculatedUV = newUV;

                if (isChanged && !EditorInputManager.GetMouseButtonUp(0))
                {
                    var prMesh = FreshPreviewMesh;
                    if (prMesh.selectedUV != null)
                    {
                        prMesh.selectedUV.SharedEditedUV      = lastCalculatedUV;
                        MeshMGMT.target.meshFilter.sharedMesh = new MeshConstructor(prMesh, MeshMGMT.target.MeshProfile, MeshMGMT.target.meshFilter.sharedMesh).Construct();
                    }
                }
            }

            if (EditorInputManager.GetMouseButtonUp(0))
            {
                MeshMGMT.SelectedUV.SharedEditedUV = lastCalculatedUV;
                EditedMesh.Dirty  = true;
                MeshMGMT.Dragging = false;
            }


            if (!EditorInputManager.GetMouseButton(0))
            {
                MeshMGMT.Dragging = false;
            }
        }
Beispiel #2
0
        public override bool MouseEventPointedTriangle()
        {
            if (EditorInputManager.GetMouseButton(0))
            {
                EditedMesh.Dirty |= PointedTris.SetSharpCorners(SetTo);
            }

            return(false);
        }
Beispiel #3
0
        public override void KeysEventPointedTriangle()
        {
            if (KeyCode.Backspace.IsDown() || KeyCode.Delete.IsDown())
            {
                MeshMGMT.edMesh.triangles.Remove(PointedTris);
                foreach (var uv in PointedTris.vertexes)
                {
                    if (uv.meshPoint.uvpoints.Count == 1 && uv.tris.Count == 1)
                    {
                        EditedMesh.meshPoints.Remove(uv.meshPoint);
                    }
                }

                MeshMGMT.edMesh.Dirty = true;
                return;
            }

            if (KeyCode.U.IsDown())
            {
                PointedTris.MakeTriangleVertUnique(PointedUV);
            }

            /*  if (KeyCode.N.isDown())
             * {
             *
             *    if (!EditorInputManager.getAltKey())
             *    {
             *        int no = pointedTris.NumberOf(pointedTris.GetClosestTo(meshMGMT.collisionPosLocal));
             *        pointedTris.SharpCorner[no] = !pointedTris.SharpCorner[no];
             *
             *        (pointedTris.SharpCorner[no] ? "Triangle edge's Normal is now dominant" : "Triangle edge Normal is NO longer dominant").TeachingNotification();
             *    }
             *    else
             *    {
             *        pointedTris.InvertNormal();
             *        "Inverting Normals".TeachingNotification();
             *    }
             *
             *    meshMGMT.edMesh.dirty = true;
             *
             * }*/
        }
Beispiel #4
0
        public override bool MouseEventPointedTriangle()
        {
            if (EditorInputManager.GetMouseButton(0))
            {
                if (MergeUnmerge)
                {
                    if (EditorInputManager.getShiftKey())
                    {
                        EditedMesh.Dirty |= PointedTris.SetAllVerticesShared();
                    }
                    else
                    {
                        EditedMesh.Dirty |= EditedMesh.GiveTriangleUniqueVerticles(PointedTris);
                    }
                }
                else
                {
                    EditedMesh.Dirty |= PointedTris.SetSmoothVertices(!EditorInputManager.getShiftKey());
                }
            }

            return(false);
        }
Beispiel #5
0
        public override void KeysEventPointedTriangle()
        {
            if (KeyCode.N.IsDown())
            {
                if (!EditorInputManager.getAltKey())
                {
                    int no = PointedTris.NumberOf(PointedTris.GetClosestTo(MeshMGMT.collisionPosLocal));
                    PointedTris.DominantCourner[no] = !PointedTris.DominantCourner[no];
                    #if !NO_PEGI
                    (PointedTris.DominantCourner[no] ? "Triangle edge's Normal is now dominant" : "Triangle edge Normal is NO longer dominant").TeachingNotification();
#endif
                }
                else
                {
                    PointedTris.InvertNormal();
#if !NO_PEGI
                    "Inverting Normals".TeachingNotification();
#endif
                }

                MeshMGMT.edMesh.Dirty = true;
            }
        }