mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
VideoCommon: update FreeLook camera to add quaternion based rotation, fix orbital and fps implementations
This commit is contained in:
parent
8055919905
commit
80cf87158e
@ -102,15 +102,20 @@ public:
|
||||
|
||||
void Rotate(const Common::Vec3& amt) override
|
||||
{
|
||||
if (amt.Length() == 0)
|
||||
return;
|
||||
|
||||
m_rotation += amt;
|
||||
|
||||
using Common::Quaternion;
|
||||
const auto quat =
|
||||
m_rotate_quat =
|
||||
(Quaternion::RotateX(m_rotation.x) * Quaternion::RotateY(m_rotation.y)).Normalized();
|
||||
Rotate(quat);
|
||||
}
|
||||
|
||||
void Rotate(const Common::Quaternion& quat) override { m_rotate_quat = quat; }
|
||||
void Rotate(const Common::Quaternion& quat) override
|
||||
{
|
||||
Rotate(Common::FromQuaternionToEuler(quat));
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
@ -153,15 +158,20 @@ public:
|
||||
|
||||
void Rotate(const Common::Vec3& amt) override
|
||||
{
|
||||
if (amt.Length() == 0)
|
||||
return;
|
||||
|
||||
m_rotation += amt;
|
||||
|
||||
using Common::Quaternion;
|
||||
const auto quat =
|
||||
m_rotate_quat =
|
||||
(Quaternion::RotateX(m_rotation.x) * Quaternion::RotateY(m_rotation.y)).Normalized();
|
||||
Rotate(quat);
|
||||
}
|
||||
|
||||
void Rotate(const Common::Quaternion& quat) override { m_rotate_quat = quat; }
|
||||
void Rotate(const Common::Quaternion& quat) override
|
||||
{
|
||||
Rotate(Common::FromQuaternionToEuler(quat));
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
@ -246,6 +256,12 @@ void FreeLookCamera::Rotate(const Common::Vec3& amt)
|
||||
m_dirty = true;
|
||||
}
|
||||
|
||||
void FreeLookCamera::Rotate(const Common::Quaternion& amt)
|
||||
{
|
||||
m_camera_controller->Rotate(amt);
|
||||
m_dirty = true;
|
||||
}
|
||||
|
||||
void FreeLookCamera::IncreaseFovX(float fov)
|
||||
{
|
||||
m_fov_x += fov;
|
||||
|
@ -52,6 +52,7 @@ public:
|
||||
void MoveForward(float amt);
|
||||
|
||||
void Rotate(const Common::Vec3& amt);
|
||||
void Rotate(const Common::Quaternion& amt);
|
||||
|
||||
void IncreaseFovX(float fov);
|
||||
void IncreaseFovY(float fov);
|
||||
|
Loading…
Reference in New Issue
Block a user