public AddDetailTextureAction(TerrainShape terrain, DetailTextureResource texture)
 {
     _texture = texture;
       _terrain = terrain;
 }
 protected AddDetailTextureAction(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _terrain = (TerrainShape)info.GetValue("_terrain", typeof(TerrainShape));
       _texture = (DetailTextureResource)info.GetValue("_texture", typeof(DetailTextureResource));
 }
        public NewDetailTextureCollectionAction(TerrainShape terrain, ArrayList oldList, ArrayList newList)
        {
            _terrain = terrain;
              _oldList = oldList;
              _newList = newList;

              // re-enum new objects:
              foreach (DetailTextureResource tex in _newList)
            if (tex.ID == 0)
            {
              tex._ownerTerrain = _terrain;
              tex.ID = _terrain.GetNewDetailTextureID();
            }
        }
 protected NewDetailTextureCollectionAction(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _terrain = (TerrainShape)info.GetValue("_terrain", typeof(TerrainShape));
       _oldList = (ArrayList)info.GetValue("_oldList", typeof(ArrayList));
       _newList = (ArrayList)info.GetValue("_newList", typeof(ArrayList));
 }
 public TerrainVisibilityZoneShape(TerrainShape owner, int iSectorX, int iSectorY)
     : base(string.Format("TerrainZone_{0}_{1}", iSectorX, iSectorX))
 {
     _iSectorX = iSectorX;
       _iSectorY = iSectorY;
       _ownerTerrain = owner;
       _createHotSpots = false;
 }
 public AddDecorationModelAction(TerrainShape terrain, DecorationModelResource model)
 {
     _model = model;
       _terrain = terrain;
 }
Ejemplo n.º 7
0
 public TerrainMeshExport(TerrainShape owner)
 {
     Owner = owner;
 }
Ejemplo n.º 8
0
        public override ShapeBase CreateShapeInstance()
        {
            if (EditorManager.Scene.FindFirstShapeOfType(typeof(TerrainShape), true) != null)
              {
            EditorManager.ShowMessageBox("There is already a terrain shape in this scene.\nThe current version of the SDK only supports one terrain per scene.", "Cannot create more than one terrain", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            return null;
              }

            string name = EditorManager.Scene.CreateNewShapeName("Terrain");
              TerrainShape shape = new TerrainShape(name);

              if (!TestManager.IsRunning)
              {
            TerrainCreationDlg dlg = new TerrainCreationDlg();
            dlg.TerrainShape = shape;

            if (dlg.ShowDialog() != DialogResult.OK)
              return null;
            shape = dlg.TerrainShape; // should be the same though
              }
              else
              {
            shape.TerrainConfig._sectorCount.Width = 4;
            shape.TerrainConfig._sectorCount.Height = 4;
            shape.TerrainConfig.TerrainFolder = "TestTerrain";
              }
              return shape;
        }
Ejemplo n.º 9
0
 public PaintHeightmapAction(TerrainShape terrain)
     : base(terrain.EngineTerrain,"Edit heightmap")
 {
 }
Ejemplo n.º 10
0
 public TerrainMeshExport()
 {
     Owner = null;
 }
 public ImportWeightmapFilter(TerrainShape owner)
 {
     _owner = owner;
 }
 public PaintDetailTextureAction(TerrainShape terrain, DetailTextureResource texture)
     : base(terrain.EngineTerrain, "Edit detail texture")
 {
     _texture = texture;
 }
 protected AddDecorationModelAction(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _terrain = (TerrainShape)info.GetValue("_terrain", typeof(TerrainShape));
       _model = (DecorationModelResource)info.GetValue("_model", typeof(DecorationModelResource));
 }
Ejemplo n.º 14
0
 public TerrainPickHandler(TerrainShape terrain, HeightmapCursorProperties dest)
 {
     _terrain = terrain;
       _destHeight = dest;
 }
Ejemplo n.º 15
0
 public MoveDetailTextureAction(TerrainShape terrain, DetailTextureResource texture, int iMoveDelta)
 {
     _texture = texture;
       _terrain = terrain;
       _iMoveDelta = iMoveDelta;
       iOldIndex = _terrain.DetailTextures.IndexOf(_texture);
       iNewIndex = iOldIndex + iMoveDelta;
 }
Ejemplo n.º 16
0
 public HeightmapValueProvider(TerrainShape terrain)
 {
     _terrain = terrain;
     _heightSampleCount = terrain.TerrainConfig.OverallHeightSampleCount;
 }
Ejemplo n.º 17
0
 protected MoveDetailTextureAction(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _terrain = (TerrainShape)info.GetValue("_terrain", typeof(TerrainShape));
       _texture = (DetailTextureResource)info.GetValue("_texture", typeof(DetailTextureResource));
       iOldIndex = info.GetInt32("iOldIndex");
       iNewIndex = info.GetInt32("iNewIndex");
 }
Ejemplo n.º 18
0
 public TerrainShaderProperties(TerrainShape owner)
 {
     _owner = owner;
 }
Ejemplo n.º 19
0
        /// <summary>
        /// Helper function
        /// </summary>
        /// <param name="_terrain"></param>
        /// <param name="_texture"></param>
        /// <param name="iMoveDelta"></param>
        /// <returns></returns>
        public static bool CanMove(TerrainShape _terrain, DetailTextureResource _texture, int iMoveDelta)
        {
            if (_terrain == null || !_terrain.Modifiable || _terrain.EngineTerrain == null || _texture == null)
            return false;

              int iOldIndex = _terrain.DetailTextures.IndexOf(_texture);
              int iNewIndex = iOldIndex + iMoveDelta;

              if (_texture._bIsBaseTexture)
            return false;

              if (iOldIndex < 0 || iOldIndex >= _terrain.DetailTextures.Count)
            return false;
              if (iNewIndex < 1 || iNewIndex >= _terrain.DetailTextures.Count)
            return false;
              return true;
        }
 public PaintDecorationAction(TerrainShape terrain, DecorationModelResource model)
     : base(terrain.EngineTerrain, "Edit decoration")
 {
     _model = model;
 }
 public SlopeDetailTexturesFilter(TerrainShape owner)
 {
     _owner = owner;
 }