Skip to content

Commit

Permalink
Make HUD work better for modal HUD
Browse files Browse the repository at this point in the history
  • Loading branch information
fholger committed Feb 6, 2024
1 parent aa8c204 commit 599108d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Code/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,8 @@ void CPlayer::Update(SEntityUpdateContext& ctx, int updateSlot)

void CPlayer::ProcessRoomscaleMovement()
{
if (!m_linkStats.CanRotate() || !g_pGameCVars->vr_enable_motion_controllers)
bool modalHudActive = g_pGame->GetHUD() && g_pGame->GetHUD()->GetModalHUD();
if (modalHudActive || !m_linkStats.CanRotate() || !g_pGameCVars->vr_enable_motion_controllers)
return;
if (GetLinkedVehicle() || m_stats.isOnLadder || !GetEntity()->GetPhysics())
return;
Expand Down Expand Up @@ -1074,11 +1075,13 @@ void CPlayer::ProcessRoomscaleMovement()

void CPlayer::ProcessRoomscaleRotation()
{
if (!m_linkStats.CanRotate() || !g_pGameCVars->vr_enable_motion_controllers)
bool modalHudActive = g_pGame->GetHUD() && g_pGame->GetHUD()->GetModalHUD();
if (modalHudActive || !m_linkStats.CanRotate() || !g_pGameCVars->vr_enable_motion_controllers)
return;
if (GetLinkedVehicle() || m_stats.isOnLadder || !GetEntity()->GetPhysics())
return;


if (m_stats.onGround <= 0) // fixme: roomscale rotation feels off during the initial parachute jump
return;

Expand Down
3 changes: 2 additions & 1 deletion Code/VR/VRManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ void VRManager::Update()
RecalibrateView();
}

if (gVRRenderer->ShouldRenderVR())
bool modalHudActive = g_pGame->GetHUD() && g_pGame->GetHUD()->GetModalHUD();
if (gVRRenderer->ShouldRenderVR() && !modalHudActive)
SetHudAttachedToHead();
else
SetHudInFrontOfPlayer();
Expand Down

0 comments on commit 599108d

Please sign in to comment.