Ejemplo n.º 1
0
 public void SetPosition(Vector3 newpos, bool editPivot)
 {
     if (MultipleSelection)
     {
         //don't do anything here for multiselection
     }
     else if (EntityDef != null)
     {
         if (editPivot)
         {
             EntityDef.SetPivotPositionFromWidget(newpos);
         }
         else
         {
             EntityDef.SetPositionFromWidget(newpos);
         }
     }
     else if (CarGenerator != null)
     {
         CarGenerator.SetPosition(newpos);
     }
     else if (PathNode != null)
     {
         PathNode.SetPosition(newpos);
     }
     else if (CollisionPoly != null)
     {
         CollisionPoly.Position = newpos;
     }
     else if (CollisionBounds != null)
     {
         CollisionBounds.Position = newpos;
     }
     else if (NavPoly != null)
     {
         NavPoly.SetPosition(newpos);
     }
     else if (NavPoint != null)
     {
         NavPoint.SetPosition(newpos);
     }
     else if (NavPortal != null)
     {
         NavPortal.SetPosition(newpos);
     }
     else if (TrainTrackNode != null)
     {
         TrainTrackNode.SetPosition(newpos);
     }
     else if (ScenarioNode != null)
     {
         ScenarioNode.SetPosition(newpos);
     }
     else if (Audio != null)
     {
         Audio.SetPosition(newpos);
     }
 }
Ejemplo n.º 2
0
        public void SetPosition(Vector3 newpos, bool editPivot)
        {
            if (MultipleSelection)
            {
                //don't do anything here for multiselection
            }
            else if (EntityDef != null)
            {
                if (editPivot)
                {
                    EntityDef.SetPivotPositionFromWidget(newpos);
                }
                else
                {
                    EntityDef.SetPositionFromWidget(newpos);
                }
            }
            else if (CarGenerator != null)
            {
                CarGenerator.SetPosition(newpos);
            }
            else if (PathNode != null)
            {
                PathNode.SetPosition(newpos);
            }
            else if (NavPoly != null)
            {
                NavPoly.SetPosition(newpos);

                //if (projectForm != null)
                //{
                //    projectForm.OnWorldNavPolyModified(NavPoly);
                //}
            }
            else if (NavPoint != null)
            {
                NavPoint.SetPosition(newpos);
            }
            else if (NavPortal != null)
            {
                NavPortal.SetPosition(newpos);
            }
            else if (TrainTrackNode != null)
            {
                TrainTrackNode.SetPosition(newpos);
            }
            else if (ScenarioNode != null)
            {
                ScenarioNode.SetPosition(newpos);
            }
            else if (Audio != null)
            {
                Audio.SetPosition(newpos);
            }
        }
Ejemplo n.º 3
0
 public void SetPosition(Vector3 newpos, bool editPivot)
 {
     if (MultipleSelectionItems != null)
     {
         if (editPivot)
         {
         }
         else
         {
             var dpos = newpos - MultipleSelectionCenter;// oldpos;
             if (dpos == Vector3.Zero)
             {
                 return;                       //nothing moved.. (probably due to snap)
             }
             for (int i = 0; i < MultipleSelectionItems.Length; i++)
             {
                 if (MultipleSelectionItems[i].CollisionPoly == null)//skip polys, they use gathered verts
                 {
                     var refpos = MultipleSelectionItems[i].WidgetPosition;
                     MultipleSelectionItems[i].SetPosition(refpos + dpos, false);
                 }
             }
             if (GatheredCollisionVerts != null)
             {
                 for (int i = 0; i < GatheredCollisionVerts.Length; i++)
                 {
                     var refpos = GatheredCollisionVerts[i].Position;
                     GatheredCollisionVerts[i].Position = refpos + dpos;
                 }
             }
             MultipleSelectionCenter = newpos;
         }
     }
     else if (EntityDef != null)
     {
         if (editPivot)
         {
             EntityDef.SetPivotPositionFromWidget(newpos);
         }
         else
         {
             EntityDef.SetPositionFromWidget(newpos);
         }
     }
     else if (CarGenerator != null)
     {
         CarGenerator.SetPosition(newpos);
     }
     else if (PathNode != null)
     {
         PathNode.SetPosition(newpos);
     }
     else if (CollisionVertex != null)
     {
         CollisionVertex.Position = newpos;
     }
     else if (CollisionPoly != null)
     {
         CollisionPoly.Position = newpos;
     }
     else if (CollisionBounds != null)
     {
         CollisionBounds.Position = newpos;
     }
     else if (NavPoly != null)
     {
         NavPoly.SetPosition(newpos);
     }
     else if (NavPoint != null)
     {
         NavPoint.SetPosition(newpos);
     }
     else if (NavPortal != null)
     {
         NavPortal.SetPosition(newpos);
     }
     else if (TrainTrackNode != null)
     {
         TrainTrackNode.SetPosition(newpos);
     }
     else if (ScenarioNode != null)
     {
         ScenarioNode.SetPosition(newpos);
     }
     else if (Audio != null)
     {
         Audio.SetPosition(newpos);
     }
 }