Skip to content

Commit

Permalink
Fix "SceneView compatibility Fix" doubling view matrix changes
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Jan 14, 2024
1 parent 35e89ed commit 23e6347
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mods/vr/FFakeStereoRenderingHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3827,6 +3827,10 @@ __forceinline void FFakeStereoRenderingHook::calculate_stereo_view_offset(
GameThreadWorker::get().execute();
}

if (vr->is_sceneview_compatibility_enabled() && !g_hook->m_inside_manual_view_offset) {
return;
}

const auto& mods = g_framework->get_mods()->get_mods();

if (!is_full_pass) {
Expand Down
4 changes: 4 additions & 0 deletions src/mods/vr/FFakeStereoRenderingHook.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,12 @@ class FFakeStereoRenderingHook : public ModComponent {
return m_embedded_rtm;
}

bool m_inside_manual_view_offset{false};

void calculate_stereo_view_offset_(const int32_t view_index, Rotator<float>* view_rotation, const float world_to_meters, Vector3f* view_location) {
m_inside_manual_view_offset = true;
calculate_stereo_view_offset(nullptr, view_index, view_rotation, world_to_meters, view_location);
m_inside_manual_view_offset = false;
}

bool is_in_viewport_client_draw() const;
Expand Down

0 comments on commit 23e6347

Please sign in to comment.