Пример #1
0
        public override Vector3 GetCameraPos(Vector3 eyePos)
        {
            Vector3 dir = Utils.GetDirVector(player.YawRadians, player.PitchRadians);

            Picking.ClipCameraPos(game, eyePos, dir, distance, game.CameraClipPos);
            return(game.CameraClipPos.IntersectPoint);
        }
Пример #2
0
        public override Vector3 GetCameraPos(Vector3 eyePos)
        {
            Vector3 dir = Utils.GetDirVector(player.HeadYawRadians,
                                             AdjustPitch(player.PitchDegrees));

            Picking.ClipCameraPos(game, eyePos, dir, dist, game.CameraClipPos);
            return(game.CameraClipPos.IntersectPoint);
        }
Пример #3
0
        public override Matrix4 GetView(double delta)
        {
            CalcViewBobbing(delta);
            Vector3 eyePos = player.EyePosition;

            eyePos.Y += bobYOffset;

            Vector3 dir = Utils.GetDirVector(player.YawRadians, player.PitchRadians);

            Picking.ClipCameraPos(game, eyePos, dir, distance, game.CameraClipPos);
            Vector3 cameraPos = game.CameraClipPos.IntersectPoint;

            return(Matrix4.LookAt(cameraPos, eyePos, Vector3.UnitY) * tiltMatrix);
        }
Пример #4
0
        public override Vector3 GetPosition(float t)
        {
            CalcViewBobbing(t, dist);
            Vector3 target = player.EyePosition;

            target.Y += bobbingVer;

            // cast ray from player position to camera position
            // this way we can stop if we hit a block in the way
            Vector2 rot = GetOrientation();
            Vector3 dir = -Utils.GetDirVector(rot.X, rot.Y);

            Picking.ClipCameraPos(game, target, dir, dist, game.CameraClipPos);
            return(game.CameraClipPos.Intersect);
        }
Пример #5
0
        public override Vector3 GetCameraPos(float t)
        {
            CalcViewBobbing(t, dist);
            Vector3 eyePos = player.EyePosition;

            eyePos.Y += bobbingVer;

            Vector3 dir = GetDirVector();

            if (!forward)
            {
                dir = -dir;
            }
            Picking.ClipCameraPos(game, eyePos, dir, dist, game.CameraClipPos);
            return(game.CameraClipPos.Intersect);
        }