16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 11:19:19 +02:00

Merge pull request #99 from docentYT/utilities-simplification

Utilities simplification
This commit is contained in:
2026-05-06 18:35:29 +02:00
committed by GitHub
70 changed files with 703 additions and 935 deletions

View File

@@ -128,7 +128,7 @@ TCamera::OnCommand( command_data const &Command ) {
static void UpdateVelocityAxis(double& velocity, double moverate, double deltatime)
{
velocity = clamp(velocity + moverate * 10.0 * deltatime, -std::abs(moverate), std::abs(moverate));
velocity = std::clamp(velocity + moverate * 10.0 * deltatime, -std::abs(moverate), std::abs(moverate));
}
@@ -155,7 +155,7 @@ void TCamera::Update()
Angle.y = std::remainder(Angle.y, 2.0 * M_PI);
// Limit the camera pitch to +/- 90°.
Angle.x = clamp(Angle.x - (m_rotationoffsets.x * rotationfactor), -M_PI_2, M_PI_2);
Angle.x = std::clamp(Angle.x - (m_rotationoffsets.x * rotationfactor), -M_PI_2, M_PI_2);
m_rotationoffsets.x *= ( 1.0 - rotationfactor );
// update position