Skip to content

Commit

Permalink
Fix weapon laser dot positioning when motion controllers are enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
fholger committed May 7, 2023
1 parent a89b6b0 commit bd1b0ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Code/Lam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,13 @@ void CLam::AdjustLaserFPDirection(CItem* parent, Vec3 &dir, Vec3 &pos)
const CCamera& camera = gVRRenderer->GetCurrentViewCamera();
pos = camera.GetPosition();
dir = camera.GetMatrix().GetColumn1();

if (g_pGameCVars->vr_enable_motion_controllers)
{
pos = info.weaponPosition;
dir = info.fireDirection;
}

dir.Normalize();
}
}
Expand Down
3 changes: 2 additions & 1 deletion Code/RocketLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Description: Class for specific rocket launcher functionality
#include "RocketLauncher.h"

#include "Actor.h"
#include "GameCVars.h"
#include "HUD/HUD.h"
#include "HUD/HUDCrosshair.h"
#include "GameRules.h"
Expand Down Expand Up @@ -368,7 +369,7 @@ void CRocketLauncher::UpdateDotEffect(float frameTime)

CActor *pActor = GetOwnerActor();
IMovementController * pMC = pActor ? pActor->GetMovementController() : NULL;
if (pMC)
if (pMC && !g_pGameCVars->vr_enable_motion_controllers)
{
SMovementState info;
pMC->GetMovementState(info);
Expand Down

0 comments on commit bd1b0ff

Please sign in to comment.