Add movement speed modifier
This commit is contained in:
@@ -66,7 +66,7 @@ namespace OpenVulkano
|
||||
//vec = Math::Utils::normalize(vec);
|
||||
}
|
||||
const float timeScale = CURRENT_FRAME.frameTime; //TODO
|
||||
vec = vec * timeScale * 3.0f; // scale vector
|
||||
vec = vec * timeScale * m_movementSpeedModifier; // scale vector
|
||||
vec = GetCamera()->GetRotationMatrix() * Math::Vector3f(vec);
|
||||
const Math::Vector4f_SIMD movement(vec, 0);
|
||||
m_framePosition += movement;
|
||||
|
||||
@@ -35,6 +35,8 @@ namespace OpenVulkano
|
||||
bool m_frameUpdated = false, m_distUpated = true;
|
||||
bool m_lockYaw = false, m_lockPitch = false;
|
||||
|
||||
float m_movementSpeedModifier = 3;
|
||||
|
||||
void SetupInputActions();
|
||||
|
||||
void HandleRotation();
|
||||
@@ -66,9 +68,11 @@ namespace OpenVulkano
|
||||
[[nodiscard]] float GetYaw() const { return m_yaw; }
|
||||
[[nodiscard]] float GetPitch() const { return m_pitch; }
|
||||
[[nodiscard]] float GetDistance() const { return m_distance; }
|
||||
[[nodiscard]] float GetMovementSpeedModifier() const { return m_movementSpeedModifier; }
|
||||
|
||||
void SetYaw(float y) { m_yaw = y; }
|
||||
void SetPitch(float p) { m_pitch = p; }
|
||||
void SetDistance(float dist) { m_distance = dist; m_distUpated = true; }
|
||||
void SetMovementSpeedModifier(float speed = 3) { m_movementSpeedModifier = speed; }
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user