Ejemplo n.º 1
0
        void CreateTerrianModel(VoxelTerrain terrian, string meshName, string tempfilePath)
        {
            Cursor = Cursors.WaitCursor;

            //Save the voxel terrian to a tempory file.
            terrian.SaveTo(tempfilePath);

            //Pull the file through the pipeline.
            contentBuilder.Clear();
            contentBuilder.Add(tempfilePath, meshName, "VoxelTerrianImporter", "ModelProcessor");

            string buildError = contentBuilder.Build();

            //Now we can treat the terrian as a normal model.
            if (string.IsNullOrEmpty(buildError))
            {
                Model terrianModel = contentManager.Load <Model>(meshName);

                editorViewerControl.UnpauseForm();
                editorViewerControl.TerrianModel = terrianModel;

                gameManifest.TerrianModels["Terrain\\" + meshName] = terrianModel;
            }
            else
            {
                MessageBox.Show("An error occured while generating the mesh:\n" + buildError, "Error");
            }

            Cursor = Cursors.Default;
        }
Ejemplo n.º 2
0
        private void LoadVoxelTerrain(string fileName)
        {
            Cursor = Cursors.WaitCursor;

            List <BlockData> blocks = VoxelTerrainImporter.ImportBlockData(fileName);

            if (blocks != null)
            {
                VoxelTerrain vt = new VoxelTerrain(blocks);
                gameManifest.VoxelTerrains[fileName] = vt;
                editorViewerControl.VoxelTerrain     = vt;
            }

            Cursor = Cursors.Arrow;
        }
Ejemplo n.º 3
0
        private void LoadVoxelTerrain(string fileName)
        {
            Cursor = Cursors.WaitCursor;

            List<BlockData> blocks = VoxelTerrainImporter.ImportBlockData(fileName);

            if (blocks != null)
            {
                VoxelTerrain vt = new VoxelTerrain(blocks);
                gameManifest.VoxelTerrains[fileName] = vt;
                editorViewerControl.VoxelTerrain = vt;
            }

            Cursor = Cursors.Arrow;
        }
Ejemplo n.º 4
0
        void CreateTerrianModel(VoxelTerrain terrian, string meshName, string tempfilePath)
        {
            Cursor = Cursors.WaitCursor;

            //Save the voxel terrian to a tempory file.
            terrian.SaveTo(tempfilePath);

            //Pull the file through the pipeline.
            contentBuilder.Clear();
            contentBuilder.Add(tempfilePath, meshName, "VoxelTerrianImporter", "ModelProcessor");

            string buildError = contentBuilder.Build();

            //Now we can treat the terrian as a normal model.
            if(string.IsNullOrEmpty(buildError))
            {
                Model terrianModel = contentManager.Load<Model>(meshName);

                editorViewerControl.UnpauseForm();
                editorViewerControl.TerrianModel = terrianModel;

                gameManifest.TerrianModels["Terrain\\" + meshName] = terrianModel;
            }
            else
            {
                MessageBox.Show("An error occured while generating the mesh:\n" + buildError, "Error");
            }

            Cursor = Cursors.Default;
        }