private void SetUpGameWorld() { //AtmosphericScatteringGround float radius = 6000; earth = new Planet("earth", new Vector3(0, 0, 0), NoiseGenerator.FastPlanet(radius), EffectLoader.LoadSM5Effect("flatshaded").Clone(), radius, Color.DarkSeaGreen.ChangeTone(-100), Color.SaddleBrown, Color.SaddleBrown.ChangeTone(-10), 0); //earth.AddAtmosphere(); SystemCore.GameObjectManager.AddAndInitialiseGameObject(earth); mouseCamera.SetPositionAndLook(new Vector3(0, radius + 200, 0), (float)Math.PI, (float)-Math.PI / 5); duneBuggyOne = new DuneBuggy(PlayerIndex.One, Color.Red, new Vector3(0, radius + 100, 0)); spaceShipOne = new SpaceShip(PlayerIndex.One, Color.Red, new Vector3(0, radius + 200, 0)); field = new GravitationalField(new InfiniteForceFieldShape(), Vector3.Zero.ToBepuVector(), 100000 * radius, 100); SystemCore.PhysicsSimulation.Add(field); spaceShipOne.Activate(); duneBuggyCamera = new DuneBuggyPlanetCamera(duneBuggyOne); spaceShipCamera = new SpaceShipCamera(spaceShipOne); }
private void SetUpGameWorld() { SystemCore.PhysicsSimulation.ForceUpdater.Gravity = new BEPUutilities.Vector3(0, -9.81f, 0); Heightmap heightMap = NoiseGenerator.CreateHeightMap(NoiseGenerator.RidgedMultiFractal(0.03f), 100, 5, 20, 1, 1, 1); var terrainObject = heightMap.CreateTranslatedRenderableHeightMap(Color.OrangeRed, EffectLoader.LoadSM5Effect("flatshaded"), new Vector3(-250, 0, -250)); SystemCore.GameObjectManager.AddAndInitialiseGameObject(terrainObject); mouseCamera.SetPositionAndLook(new Vector3(0,50,0), (float)Math.PI, (float)-Math.PI / 5); duneBuggyOne = new DuneBuggy(PlayerIndex.One, Color.Red, new Vector3(0, 20, 0)); duneBuggyOne.Activate(); }