VideoCommon: Change 'Zoom' to 'MoveForward' since it really isn't a zoom

This commit is contained in:
iwubcode 2020-06-12 00:21:50 -05:00
parent cb6ae6a4b1
commit d5bc209eb6
2 changed files with 7 additions and 8 deletions

View File

@ -54,7 +54,7 @@ public:
m_mat = Common::Matrix44::Translate(Common::Vec3{amt, 0, 0}) * m_mat; m_mat = Common::Matrix44::Translate(Common::Vec3{amt, 0, 0}) * m_mat;
} }
void Zoom(float amt) override void MoveForward(float amt) override
{ {
m_mat = Common::Matrix44::Translate(Common::Vec3{0, 0, amt}) * m_mat; m_mat = Common::Matrix44::Translate(Common::Vec3{0, 0, amt}) * m_mat;
} }
@ -97,7 +97,7 @@ public:
m_position += right * amt; m_position += right * amt;
} }
void Zoom(float amt) override void MoveForward(float amt) override
{ {
Common::Vec3 forward{m_rotate_mat.data[8], m_rotate_mat.data[9], m_rotate_mat.data[10]}; Common::Vec3 forward{m_rotate_mat.data[8], m_rotate_mat.data[9], m_rotate_mat.data[10]};
m_position += forward * amt; m_position += forward * amt;
@ -150,7 +150,7 @@ public:
void MoveHorizontal(float) override {} void MoveHorizontal(float) override {}
void Zoom(float amt) override void MoveForward(float amt) override
{ {
m_distance += -1 * amt; m_distance += -1 * amt;
m_distance = std::clamp(m_distance, 0.0f, m_distance); m_distance = std::clamp(m_distance, 0.0f, m_distance);
@ -221,9 +221,9 @@ void FreeLookCamera::MoveHorizontal(float amt)
m_dirty = true; m_dirty = true;
} }
void FreeLookCamera::Zoom(float amt) void FreeLookCamera::MoveForward(float amt)
{ {
m_camera_controller->Zoom(amt); m_camera_controller->MoveForward(amt);
m_dirty = true; m_dirty = true;
} }

View File

@ -29,7 +29,7 @@ public:
virtual void MoveVertical(float amt) = 0; virtual void MoveVertical(float amt) = 0;
virtual void MoveHorizontal(float amt) = 0; virtual void MoveHorizontal(float amt) = 0;
virtual void Zoom(float amt) = 0; virtual void MoveForward(float amt) = 0;
virtual void Rotate(const Common::Vec3& amt) = 0; virtual void Rotate(const Common::Vec3& amt) = 0;
@ -47,8 +47,7 @@ public:
void MoveVertical(float amt); void MoveVertical(float amt);
void MoveHorizontal(float amt); void MoveHorizontal(float amt);
void MoveForward(float amt);
void Zoom(float amt);
void Rotate(const Common::Vec3& amt); void Rotate(const Common::Vec3& amt);