private void ResetScene(bool loadContent) { switch (currentScene) { case SceneType.Cube: this.scene = new SingleCubeScene(this.graphics.GraphicsDevice, rotationOrigin, 20); break; case SceneType.ArrowField: this.scene = new ArrowFieldScene(this.graphics.GraphicsDevice, rotationOrigin); break; default: throw new Exception(string.Format("Unsupported scene type {0}", currentScene)); } //Create camera var cameraPosition = scene.RecommandedSettings.CameraPosition; var cameraUp = Vector3.Normalize((rotationOrigin - cameraPosition).SafeCross(Vector3.Right, Vector3.Up)); camera = new Camera(graphics.GraphicsDevice, "MainCamera", cameraPosition, rotationOrigin, cameraUp, graphics.GraphicsDevice.Viewport.AspectRatio, 0.05f, 1E+5f); //Create help/debug text var screenText = new ScreenText(graphics.GraphicsDevice, "MainScreenText", new Vector3(1.0f, 1.0f, 0), camera); screenText.AdditionalHelpText = "D -> Next Debug Level\nS -> Cycle through scenes"; //Create controls cameraControls = new ArcBallControls(camera, rotationOrigin, scene.RecommandedSettings.ArcBallOriginLocked, graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height); this.scene.AddObject(camera); this.scene.AddObject(screenText); if (loadContent) { this.scene.LoadContent(this.Content); } }
private void ResetScene(bool loadContent) { switch (currentScene) { case SceneType.Cube: this.scene = new SingleCubeScene(this.graphics.GraphicsDevice, rotationOrigin, 20); break; case SceneType.ArrowField: this.scene = new ArrowFieldScene(this.graphics.GraphicsDevice, rotationOrigin); break; default: throw new Exception(string.Format("Unsupported scene type {0}", currentScene)); } //Create camera var cameraPosition = scene.RecommandedSettings.CameraPosition; var cameraUp = Vector3.Normalize((rotationOrigin - cameraPosition).SafeCross(Vector3.Right, Vector3.Up)); camera = new Camera(graphics.GraphicsDevice, "MainCamera", cameraPosition, rotationOrigin, cameraUp, graphics.GraphicsDevice.Viewport.AspectRatio, 0.05f, 1E+5f); //Create help/debug text var screenText = new ScreenText(graphics.GraphicsDevice, "MainScreenText", new Vector3(1.0f, 1.0f, 0), camera); screenText.AdditionalHelpText = "D -> Next Debug Level\nS -> Cycle through scenes"; //Create controls cameraControls = new ArcBallControls(camera, rotationOrigin, scene.RecommandedSettings.ArcBallOriginLocked, graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height); this.scene.AddObject(camera); this.scene.AddObject(screenText); if (loadContent) this.scene.LoadContent(this.Content); }