public void Execute()
 {
     if (!cancelled)
     {
         float   scale    = app.Config.MarkerPointScale;
         Vector3 scaleVec = new Vector3(scale, scale, scale);
         Vector3 rotVec   = new Vector3(0, rotation, 0);
         if (placing)
         {
             // we need to place the object (which is handled asynchronously) before we can create it
             dragObject = new DisplayObject(name, app, "Drag", app.Scene, meshName, location, scaleVec, rotVec, null);
             dragObject.MaterialName            = "directional_marker.orange";
             dragObject.ScaleWithCameraDistance = true;
             // set up mouse capture and callbacks for placing the object
             new DragHelper(app, new DragComplete(DragCallback), dragObject);
         }
         else
         {
             if (waypoint == null)
             {
                 // object has already been placed, so create it now
                 waypoint = new Waypoint(name, parent, app, location, rotVec);
             }
             parent.Add(waypoint);
             for (int i = app.SelectedObject.Count - 1; i >= 0; i--)
             {
                 app.SelectedObject[i].Node.UnSelect();
             }
             if (waypoint.Node != null)
             {
                 waypoint.Node.Select();
             }
         }
     }
 }
        public void Execute()
        {
            if (!cancelled)
            {
                if (placing)
                {
                    // we need to place the object (which is handled asynchronously) before we can create it
                    dragObject = new DisplayObject(name, app, "Drag", app.Scene, app.Assets.assetFromName(app.Config.PointLightMeshName).AssetName, location, new Vector3(1, 1, 1), new Vector3(0, 0, 0), null);
                    dragObject.TerrainOffset = app.Config.DefaultPointLightHeight;

                    new DragHelper(app, new DragComplete(DragCallback), dragObject);
                }
                else
                {
                    // object has already been placed, so create it now
                    // only create it if it doesn't exist already
                    if (pointLight == null)
                    {
                        pointLight = new PointLight(app, parent, scene, name, specular, diffuse, location);
                    }
                    parent.Add(pointLight);
                    for (int i = app.SelectedObject.Count - 1; i >= 0; i--)
                    {
                        app.SelectedObject[i].Node.UnSelect();
                    }
                    if (pointLight.Node != null)
                    {
                        pointLight.Node.Select();
                    }
                }
            }
        }
Beispiel #3
0
        public void Clone(IWorldContainer copyParent)
        {
            TerrainDecal clone = new TerrainDecal(app, copyParent, name, position, size, imageName, priority);

            clone.Rotation = rotation;
            copyParent.Add(clone);
        }
        public void Clone(IWorldContainer copyParent)
        {
            ParticleEffect clone = new ParticleEffect(copyParent as IWorldObject, app, particleEffectName, particleScale,
                                                      velocityScale, attachmentPointName, orientation);

            copyParent.Add(clone);
        }
        public void Execute()
        {
            if (roadObject == null)
            {
                roadObject = new RoadObject(name, parent, app, halfWidth);
            }
            parent.Add(roadObject);
            for (int i = app.SelectedObject.Count - 1; i >= 0; i--)
            {
                app.SelectedObject[i].Node.UnSelect();
            }
            if (roadObject.Node != null)
            {
                roadObject.Node.Select();
            }

            if (placing)
            {
                dragMarker = new DisplayObject("RoadDrag", app, "Dragging", app.Scene, app.Config.RoadPointMeshName, Vector3.Zero, Vector3.UnitScale, Vector3.Zero, null);
                dragMarker.MaterialName            = app.Config.RoadPointMaterial;
                dragMarker.ScaleWithCameraDistance = true;

                new MultiPointPlacementHelper(app, dragMarker, new MultiPointValidate(PointValidate), new MultiPointComplete(PointPlacementComplete));

                placing = false;
            }
        }
        public void Clone(IWorldContainer copyParent)
        {
            SpawnGen clone = new SpawnGen(app, copyParent, respawnTime, numSpawn, templateName, spawnRadius);

            clone.NameValue = new NameValueObject(this.NameValue);
            copyParent.Add(clone);
        }
        public void Clone(IWorldContainer copyParent)
        {
            PlantType clone = new PlantType(app, copyParent as Grass, instances, name,
                                            imageName, scaleWidthLow, scaleWidthHi, scaleHeightLow, ScaleHeightHi, color, colorMultLow,
                                            colorMultHi, windMagnitude);

            copyParent.Add(clone);
        }
        public void Clone(IWorldContainer copyParent)
        {
            DirectionalLight clone = new DirectionalLight(app, copyParent as Boundary, lightDirection, diffuse, specular);

            clone.Azimuth = azimuth;
            clone.Zenith  = zenith;
            copyParent.Add(clone);
        }
 public void Execute()
 {
     if (placing)
     {
         new DragHelper(app, parent, name, filename, size, new DragComplete(DragCallback));
     }
     else
     {
         decal = new TerrainDecal(app, parent, name, new Vector2(location.x, location.z), size, filename, priority);
         parent.Add(decal);
         for (int i = app.SelectedObject.Count - 1; i >= 0; i--)
         {
             app.SelectedObject[i].Node.UnSelect();
         }
         decal.Node.Select();
     }
 }
Beispiel #10
0
        public void Execute()
        {
            if (!cancelled)
            {
                Vector3 scaleVec = new Vector3(scale, scale, scale);
                Vector3 rotVec   = new Vector3(0, rotation, 0);
                if (placing)
                {
                    // we need to place the object (which is handled asynchronously) before we can create it
                    dragObject = new DisplayObject(name, app, "Drag", app.Scene, meshName, location, scaleVec, rotVec, null);

                    if (placeMultiple)
                    {
                        new MultiPointPlacementHelper(app, ObjectValidate, dragObject, ObjectPlacementComplete);
                        cancelled = true;
                    }
                    else
                    {
                        new DragHelper(app, new DragComplete(DragCallback), dragObject, false);
                    }
                }
                else
                {
                    // object has already been placed, so create it now
                    // only create it if it doesn't exist already
                    if (staticObject == null)
                    {
                        staticObject = new StaticObject(name, parent, app, meshName, location, scaleVec, rotVec);
                    }
                    parent.Add(staticObject);
                    for (int i = app.SelectedObject.Count - 1; i >= 0; i--)
                    {
                        if (app.SelectedObject[i] != null && app.SelectedObject[i].Node != null)
                        {
                            app.SelectedObject[i].Node.UnSelect();
                        }
                    }
                    if (staticObject.Node != null)
                    {
                        staticObject.Node.Select();
                    }
                }
            }
        }
        public void Clone(IWorldContainer copyParent)
        {
            Boundary clone = new Boundary(app, copyParent, name, priority);

            foreach (IWorldObject child in children)
            {
                child.Clone(clone);
            }
            copyParent.Add(clone);
        }
Beispiel #12
0
        public void Clone(IWorldContainer copyParent)
        {
            WorldObjectCollection clone = new WorldObjectCollection(name, copyParent, app);

            foreach (IWorldObject child in objectList)
            {
                child.Clone(clone);
            }
            copyParent.Add(clone);
        }
        public void Clone(IWorldContainer copyParent)
        {
            Forest clone = new Forest(filename, windSpeed, windDirection, seed, copyParent as Boundary, app);

            foreach (IWorldObject child in treeTypes)
            {
                child.Clone(clone);
            }
            copyParent.Add(clone);
        }
Beispiel #14
0
        public void Clone(IWorldContainer copyParent)
        {
            Sound clone = new Sound(filename, copyParent, app);

            clone.Gain = gain;
            clone.MaxAttenuationDistance = maxAttenuationDistance;
            clone.MinAttenuationDistance = minAttenuationDistance;
            clone.Loop = loop;
            copyParent.Add(clone);
        }
        public void Clone(IWorldContainer copyParent)
        {
            PointCollection clone = new PointCollection(parent, app, noIntersect, false, markerMeshName, markerMaterialName, type);

            foreach (IWorldObject child in Children)
            {
                child.Clone(clone);
            }
            copyParent.Add(clone);
        }
Beispiel #16
0
        public void Clone(IWorldContainer copyParent)
        {
            Grass clone = new Grass(copyParent as Boundary, app, name);

            foreach (IWorldObject child in plantList)
            {
                child.Clone(clone);
            }
            copyParent.Add(clone);
        }
Beispiel #17
0
        public void Clone(IWorldContainer copyParent)
        {
            RoadObject clone = new RoadObject(app, name, copyParent, halfWidth);

            clone.NameValue = new NameValueObject(nameValuePairs);
            foreach (IWorldObject child in children)
            {
                child.Clone(clone);
            }
            copyParent.Add(clone);
        }
Beispiel #18
0
        public void Clone(IWorldContainer copyParent)
        {
            PointLight clone = new PointLight(app, copyParent, scene, name, specular, diffuse, position);

            clone.AttenuationConstant         = attenuationConstant;
            clone.AttenuationLinear           = attenuationLinear;
            clone.AttenuationQuadratic        = attenuationQuadratic;
            clone.AttenuationRange            = attenuationRange;
            clone.TerrainOffset               = terrainOffset;
            clone.AllowAdjustHeightOffTerrain = allowAdjustHeightOffTerrain;
            copyParent.Add(clone);
        }
        public void Clone(IWorldContainer copyParent)
        {
            Waypoint clone = new Waypoint(name, copyParent, app, position, rotation);

            clone.Azimuth       = azimuth;
            clone.Zenith        = zenith;
            clone.TerrainOffset = terrainOffset;
            clone.AllowAdjustHeightOffTerrain = allowAdjustHeightOffTerrain;
            clone.NameValue = new NameValueObject(this.NameValue);
            foreach (IWorldObject child in children)
            {
                child.Clone(clone);
            }
            copyParent.Add(clone);
        }
        public void Execute()
        {
            if (path == null)
            {
                path           = new InteriorPath(parent, app, meshName);
                path.Highlight = true;
            }
            parent.Add(path);

            if (placing)
            {
                new MultiPointPlacementHelper(app, null, new MultiPointValidate(PointValidate),
                                              new MultiPointComplete(PointPlacementComplete), DragPickMode.PickEntityTriangle);
                placing = false;
            }
        }
Beispiel #21
0
 public void Execute()
 {
     if (sound == null)
     {
         sound = new Sound(filename, parent, app);
     }
     parent.Add(sound);
     for (int i = app.SelectedObject.Count - 1; i >= 0; i--)
     {
         app.SelectedObject[i].Node.UnSelect();
     }
     if (sound.Node != null)
     {
         sound.Node.Select();
     }
 }
        public void Clone(IWorldContainer copyParent)
        {
            StaticObject clone = new StaticObject(name, copyParent, app, meshName, Position, scale, rotation);

            clone.ReceiveShadows = receiveShadows;
            clone.CastShadows    = castShadows;
            clone.AllowAdjustHeightOffTerrain = allowAdjustHeightOffTerrain;
            clone.SubMeshes     = new SubMeshCollection(this.SubMeshes);
            clone.NameValue     = new NameValueObject(this.NameValue);
            clone.TerrainOffset = terrainOffset;
            foreach (IWorldObject child in children)
            {
                child.Clone(clone);
            }
            copyParent.Add(clone);
        }
        public void Execute()
        {
            if (worldCollection == null)
            {
                worldCollection = new WorldObjectCollection(name, parent, app);
            }
            parent.Add(worldCollection);
            //for (int i = app.SelectedNodes.Count; i = app.SelectedNodes.Count; i++)
            //{
            //    app.SelectedNodes[0].UnSelect();
            //}
            //app.SelectedObject = new List<IWorldObject>();
            //worldCollection.Node.Select();
            List <IWorldObject> list = new List <IWorldObject>();

            list.Add(worldCollection as IWorldObject);
            app.SelectedObject = list;
        }
Beispiel #24
0
 public void Clone(IWorldContainer copyParent)
 {
     SpawnGen clone = new SpawnGen(app, copyParent, respawnTime, numSpawn, templateName, spawnRadius);
     clone.NameValue = new NameValueObject(this.NameValue);
     copyParent.Add(clone);
 }
 public void Clone(IWorldContainer copyParent)
 {
     WorldObjectCollection clone = new WorldObjectCollection(name, copyParent, app);
     foreach (IWorldObject child in objectList)
     {
         child.Clone(clone);
     }
     copyParent.Add(clone);
 }
Beispiel #26
0
        public void Clone(IWorldContainer copyParent)
        {
            Fog clone = new Fog(app, copyParent as Boundary, cx, near, far);

            copyParent.Add(clone);
        }
 public void Clone(IWorldContainer copyParent)
 {
     Forest clone = new Forest(filename, windSpeed, windDirection, seed, copyParent as Boundary, app);
     foreach(IWorldObject child in treeTypes)
     {
         child.Clone(clone);
     }
     copyParent.Add(clone);
 }
 public void Clone(IWorldContainer copyParent)
 {
     DirectionalLight clone = new DirectionalLight(app, copyParent as Boundary, lightDirection, diffuse, specular);
     clone.Azimuth = azimuth;
     clone.Zenith = zenith;
     copyParent.Add(clone);
 }
 public void Clone(IWorldContainer copyParent)
 {
     Tree clone = new Tree(name, descriptionFilename, scale, scaleVariance, instances, copyParent as Forest, app);
     copyParent.Add(clone);
 }
Beispiel #30
0
 public void Clone(IWorldContainer copyParent)
 {
     Fog clone = new Fog(app, copyParent as Boundary, cx, near, far);
     copyParent.Add(clone);
 }
 public void Clone(IWorldContainer copyParent)
 {
     TerrainDecal clone = new TerrainDecal(app, copyParent, name, position, size, imageName, priority);
     clone.Rotation = rotation;
     copyParent.Add(clone);
 }
 public void Execute()
 {
     mark = new Waypoint(name, parent, app, pos, orient);
     parent.Add(mark);
 }
 public void Clone(IWorldContainer copyParent)
 {
     Sound clone = new Sound(filename, copyParent, app);
     clone.Gain = gain;
     clone.MaxAttenuationDistance = maxAttenuationDistance;
     clone.MinAttenuationDistance = minAttenuationDistance;
     clone.Loop = loop;
     copyParent.Add(clone);
 }
        public void Clone(IWorldContainer copyParent)
        {
            MPPoint clone = new MPPoint(pointNum, copyParent as PointCollection, app, meshName, meshMaterial, position, type, focusOffset);

            copyParent.Add(clone);
        }
Beispiel #35
0
        public void Clone(IWorldContainer copyParent)
        {
            Water clone = new Water(height, copyParent as Boundary, app);

            copyParent.Add(clone);
        }
 public void Clone(IWorldContainer copyParent)
 {
     PlantType clone = new PlantType(app, copyParent as Grass, instances, name,
         imageName, scaleWidthLow, scaleWidthHi, scaleHeightLow, ScaleHeightHi, color, colorMultLow,
         colorMultHi, windMagnitude);
     copyParent.Add(clone);
 }
        public void Clone(IWorldContainer copyParent)
        {
            Tree clone = new Tree(name, descriptionFilename, scale, scaleVariance, instances, copyParent as Forest, app);

            copyParent.Add(clone);
        }
 public void Clone(IWorldContainer copyParent)
 {
     ParticleEffect clone = new ParticleEffect(copyParent as IWorldObject, app, particleEffectName, particleScale,
         velocityScale, attachmentPointName, orientation);
     copyParent.Add(clone);
 }
 public void Clone(IWorldContainer copyParent)
 {
     Waypoint clone = new Waypoint(name, copyParent, app, position, rotation);
     clone.Azimuth = azimuth;
     clone.Zenith = zenith;
     clone.TerrainOffset = terrainOffset;
     clone.AllowAdjustHeightOffTerrain = allowAdjustHeightOffTerrain;
     clone.NameValue = new NameValueObject(this.NameValue);
     foreach (IWorldObject child in children)
     {
         child.Clone(clone);
     }
     copyParent.Add(clone);
 }
 public void Clone(IWorldContainer copyParent)
 {
     Boundary clone = new Boundary(app, copyParent, name, priority);
     foreach (IWorldObject child in children)
     {
         child.Clone(clone);
     }
     copyParent.Add(clone);
 }
        public void Clone(IWorldContainer copyParent)
        {
            AmbientLight clone = new AmbientLight(app, parent, color);

            copyParent.Add(clone);
        }
 public void UnExecute()
 {
     parent.Add(path);
     ((StaticObject)parent).PathsPerInstance = true;
 }
 public void Clone(IWorldContainer copyParent)
 {
     Grass clone = new Grass(copyParent as Boundary, app, name);
     foreach (IWorldObject child in plantList)
     {
         child.Clone(clone);
     }
     copyParent.Add(clone);
 }
 public void Clone(IWorldContainer copyParent)
 {
     RoadObject clone = new RoadObject(app, name, copyParent, halfWidth);
     clone.NameValue = new NameValueObject(nameValuePairs);
     foreach (IWorldObject child in children)
     {
         child.Clone(clone);
     }
     copyParent.Add(clone);
 }
 public void Clone(IWorldContainer copyParent)
 {
     StaticObject clone = new StaticObject(name, copyParent, app, meshName, Position, scale, rotation);
     clone.ReceiveShadows = receiveShadows;
     clone.CastShadows = castShadows;
     clone.AllowAdjustHeightOffTerrain = allowAdjustHeightOffTerrain;
     clone.SubMeshes = new SubMeshCollection(this.SubMeshes);
     clone.NameValue = new NameValueObject(this.NameValue);
     clone.TerrainOffset = terrainOffset;
     foreach (IWorldObject child in children)
     {
         child.Clone(clone);
     }
     copyParent.Add(clone);
 }
 public void Clone(IWorldContainer copyParent)
 {
     MPPoint clone = new MPPoint(pointNum, copyParent as PointCollection, app, meshName, meshMaterial, position, type, focusOffset);
     copyParent.Add(clone);
 }
 public void Clone(IWorldContainer copyParent)
 {
     PointLight clone = new PointLight(app, copyParent, scene, name, specular, diffuse, position);
     clone.AttenuationConstant = attenuationConstant;
     clone.AttenuationLinear = attenuationLinear;
     clone.AttenuationQuadratic = attenuationQuadratic;
     clone.AttenuationRange = attenuationRange;
     clone.TerrainOffset = terrainOffset;
     clone.AllowAdjustHeightOffTerrain = allowAdjustHeightOffTerrain;
     copyParent.Add(clone);
 }