Пример #1
0
        public void MultipleDragMove(WorldEditor app, int x, int y)
        {
            int i = 0;

            location = app.PickTerrain(x, y);
            Vector3 position;

            foreach (IObjectDrag disObject in dragObjects)
            {
                switch (disObject.ObjectType)
                {
                case "PointLight":
                case "Marker":
                case "Object":
                    position = location + dragOffset[i];
                    if (i == 0)
                    {
                        if (disObject.AllowAdjustHeightOffTerrain)
                        {
                            position = app.ObjectPlacementLocation(x, y) + new Vector3(0, terrainOffset[i], 0);
                        }
                        else
                        {
                            position = app.ObjectPlacementLocation(x, y);
                        }
                        disObject.Position = position;
                        break;
                    }
                    else
                    {
                        if (disObject.AllowAdjustHeightOffTerrain)
                        {
                            position = app.ObjectPlacementLocation(location + dragOffset[i]) + new Vector3(0, terrainOffset[i], 0);
                        }
                        else
                        {
                            position = app.ObjectPlacementLocation(location + dragOffset[i]);
                        }
                        disObject.Position = position;
                        break;
                    }

                default:
                    position           = location + dragOffset[i];
                    position.y         = app.GetTerrainHeight(location.x, location.z);
                    disObject.Position = position;
                    if (String.Equals(disObject.ObjectType, "Points") && (disObject as PointCollection).DisplayMarkers != true)
                    {
                        (disObject as PointCollection).DisplayMarkers = true;
                    }
                    break;
                }
                if (!disObject.InScene)
                {
                    (disObject as IWorldObject).AddToScene();
                }
                i++;
            }
        }
Пример #2
0
 public void DecalDragMove(WorldEditor app, int x, int y)
 {
     if (dragging)
     {
         location       = app.PickTerrain(x, y);
         decal.Position = location;
     }
 }
Пример #3
0
 public void DragMove(WorldEditor app, int x, int y)
 {
     if (dragging)
     {
         location            = app.PickTerrain(x, y);
         location.y          = app.GetTerrainHeight(location.x, location.z) + dragObject.TerrainOffset;
         dragObject.Position = location;
     }
 }