private void InitializeTerrain(TerrainType type) { terrain = TerrainFactory.GetTerrain(type, this); terrain.LoadHeightmap(Settings.Default.Heightmap); terrain.LoadTexture(Settings.Default.Texture); terrain.Bumpiness = Settings.Default.Bumpiness; terrain.FrustumCullingEnabled = Settings.Default.FrustumCullingEnabled; terrain.BruteForceEnabled = Settings.Default.BruteForceEnabled; terrain.TextureEnabled = Settings.Default.TextureEnabled; terrain.TextureResolution = Settings.Default.TextureResolution; terrain.HeightmapEnabled = Settings.Default.HeightmapEnabled; terrain.GeomorphEnabled = Settings.Default.GeomorphEnabled; terrain.LightEnabled = Settings.Default.LightEnabled; terrain.LightDiffuse = Settings.Default.LightDiffuse; terrain.LightDirection = Settings.Default.LightDirection; terrain.LightAmbient = Settings.Default.LightAmbient; terrain.LightSpecular = Settings.Default.LightSpecular; terrain.LightShininess = Settings.Default.LightShininess; terrain.Quality = Settings.Default.Quality; terrain.TerrainColor = Settings.Default.TerrainColor; terrain.BlockSize = Settings.Default.BlockSize; terrain.MinQuality = Settings.Default.MinQuality; terrain.Initialize(); }
private void ChangeTerrain(TerrainType type) { ITerrain previousTerrain = terrain; terrain = TerrainFactory.GetTerrain(type, this); terrain.Heightmap = previousTerrain.Heightmap; terrain.Texture = previousTerrain.Texture; terrain.Bumpiness = previousTerrain.Bumpiness; terrain.FrustumCullingEnabled = previousTerrain.FrustumCullingEnabled; terrain.BruteForceEnabled = previousTerrain.BruteForceEnabled; terrain.TextureEnabled = previousTerrain.TextureEnabled; terrain.TextureResolution = previousTerrain.TextureResolution; terrain.HeightmapEnabled = previousTerrain.HeightmapEnabled; terrain.GeomorphEnabled = previousTerrain.GeomorphEnabled; terrain.LightEnabled = previousTerrain.LightEnabled; terrain.LightDiffuse = previousTerrain.LightDiffuse; terrain.LightDirection = previousTerrain.LightDirection; terrain.LightAmbient = previousTerrain.LightAmbient; terrain.LightSpecular = previousTerrain.LightSpecular; terrain.LightShininess = previousTerrain.LightShininess; terrain.Quality = previousTerrain.Quality; terrain.TerrainColor = previousTerrain.TerrainColor; terrain.BlockSize = previousTerrain.BlockSize; terrain.MinQuality = previousTerrain.MinQuality; terrain.Initialize(); }