Exemplo n.º 1
0
        public GuiCamera(GraphicsDevice graphicsDevice, IntPtr windowHandle, int windowWidth, int windowHeight)
            : base(graphicsDevice)
        {
            Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, windowWidth / (float)windowHeight, 0.1f, 1000.0f);

            Position = new Vector3(0, 5, 20);

            Target = Position + Vector3.Forward;
            View   = Matrix.CreateLookAt(Position, Target, Vector3.Up);

            _updateHandlers      = new UpdateHandler[2];
            _updateHandlers[0]   = new PanUpdateHandler(this);
            _updateHandlers[1]   = new ArcBallUpdateHandler(this);
            _activeUpdateHandler = 0;

            Mouse.WindowHandle  = windowHandle;
            _previousMouseState = Mouse.GetState();
        }
Exemplo n.º 2
0
        public GuiCamera(GraphicsDevice graphicsDevice, IntPtr windowHandle, int windowWidth, int windowHeight)
            : base(graphicsDevice)
        {
            Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, windowWidth / (float) windowHeight, 0.1f, 1000.0f);

            Position = new Vector3(0, 5, 20);

            Target = Position + Vector3.Forward;
            View = Matrix.CreateLookAt(Position, Target, Vector3.Up);

            _updateHandlers = new UpdateHandler[2];
            _updateHandlers[0] = new PanUpdateHandler(this);
            _updateHandlers[1] = new ArcBallUpdateHandler(this);
            _activeUpdateHandler = 0;

            Mouse.WindowHandle = windowHandle;
            _previousMouseState = Mouse.GetState();
        }