Skip to content

Commit

Permalink
Clamp delta time for motion controls/head aim
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Nov 1, 2023
1 parent 3c27f3d commit b9b3d98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mods/vr/IXRTrackingSystemHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,7 @@ void IXRTrackingSystemHook::pre_update_view_rotation(Rotator<float>* rot) {
void IXRTrackingSystemHook::update_view_rotation(Rotator<float>* rot) {
const auto now = std::chrono::high_resolution_clock::now();
const auto delta_time = now - m_process_view_rotation_data.last_update;
const auto delta_float = std::chrono::duration_cast<std::chrono::duration<float>>(delta_time).count();
const auto delta_float = glm::min(std::chrono::duration_cast<std::chrono::duration<float>>(delta_time).count(), 0.1f);
m_process_view_rotation_data.last_update = now;
m_process_view_rotation_data.was_called = true;

Expand Down

0 comments on commit b9b3d98

Please sign in to comment.