Exemplo n.º 1
0
        public void rotate(CameraTransformations rot, float angle)
        {
            switch (rot)
            {
            case CameraTransformations.YawLeft:
                rotateY(angle);
                break;

            case CameraTransformations.YawRight:
                rotateY(-angle);
                break;

            case CameraTransformations.PitchUp:
                rotateX(angle);
                break;

            case CameraTransformations.PitchDown:
                rotateX(-angle);
                break;

            case CameraTransformations.RollClockwise:
                rotateZ(angle);
                break;

            case CameraTransformations.RollAnticlockwise:
                rotateZ(-angle);
                break;
            }
            updateViewMatrix();
        }
Exemplo n.º 2
0
        public void transform(CameraTransformations t, float dt)
        {
            //  Console.WriteLine("Camera.transform()");
            float val = 0.02f;//MathHelper.ToRadians(1) * 0.001f;// MathHelper.ToRadians(0.2 * dt);

            switch (t)
            {
            case CameraTransformations.YawLeft:
                this.rotate(CameraTransformations.YawLeft, val);    // rotateY(val);
                break;

            case CameraTransformations.YawRight:
                this.rotate(CameraTransformations.YawRight, val);
                break;

            case CameraTransformations.PitchUp:
                this.rotate(CameraTransformations.PitchUp, val);    // rotateY(val);
                break;

            case CameraTransformations.PitchDown:
                this.rotate(CameraTransformations.PitchDown, val);    // rotateY(val);
                break;

            case CameraTransformations.RollClockwise:
                this.rotate(CameraTransformations.RollClockwise, val);    // rotateY(val);
                break;

            case CameraTransformations.RollAnticlockwise:
                this.rotate(CameraTransformations.RollAnticlockwise, val);    // rotateY(val);
                break;

            case CameraTransformations.MoveForward:
                this.moveForward(val);
                break;

            case CameraTransformations.MoveBackward:
                this.moveBack(val);
                break;

            case CameraTransformations.MoveLeft:
                this.moveLeft(val);
                break;

            case CameraTransformations.MoveRight:
                this.moveRight(val);
                break;

            case CameraTransformations.MoveUp:
                this.moveUp(val);
                break;

            case CameraTransformations.MoveDown:
                this.moveDown(val);
                break;
            }
            updateViewMatrix();
        }