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; }
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; }
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; }
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; }