(Hopefully) fix vehicle wheels not turning after some time

This commit is contained in:
tovjemam 2026-06-20 20:50:50 +02:00
parent b74417debd
commit 90912c0b90

View File

@ -416,6 +416,7 @@ void game::Vehicle::UpdateWheels()
{
auto& bt_wheel = vehicle.getWheelInfo(i);
wheels_[i].speed = -(bt_wheel.m_rotation - wheels_[i].rotation) * 25.0f;
bt_wheel.m_rotation = glm::mod(bt_wheel.m_rotation, glm::two_pi<float>()); // prevent going too crazy
wheels_[i].rotation = bt_wheel.m_rotation;
wheels_[i].z_offset = tuning_ctx_.wheels[i].z_offset - bt_wheel.m_raycastInfo.m_suspensionLength;