Removed Magic Numbers

This commit is contained in:
Grant Bagwell 2021-01-10 19:43:16 +01:00
parent 073d29d746
commit 39465c09c4
4 changed files with 24 additions and 15 deletions

View file

@ -3909,24 +3909,33 @@ void idPlayer::UpdateVrHud()
hudPitch = vr_hudType.GetInteger() == VR_HUD_LOOK_DOWN ? vr_hudPosAngle.GetFloat() : 10.0f;
//Fixed HUD, but make it take a short time to catch up with the player's yaw
if (resetHUDYaw)
if( gameLocal.inCinematic )
{
hud_yaw_x = cosf(DEG2RAD(commonVr->lastHMDViewAxis.ToAngles().yaw));
hud_yaw_y = sinf(DEG2RAD(commonVr->lastHMDViewAxis.ToAngles().yaw));
hudOrigin = commonVr->lastHMDViewOrigin;
}
else if (resetHUDYaw)
{
hud_yaw_x = cosf(DEG2RAD(viewAngles.yaw));
hud_yaw_y = sinf(DEG2RAD(viewAngles.yaw));
resetHUDYaw = false;
GetViewPos( hudOrigin, hudAxis );
}
else
{
hud_yaw_x = 0.97f * hud_yaw_x + 0.03f * cosf(DEG2RAD(viewAngles.yaw));
hud_yaw_y = 0.97f * hud_yaw_y + 0.03f * sinf(DEG2RAD(viewAngles.yaw));
GetViewPos( hudOrigin, hudAxis );
}
GetViewPos( hudOrigin, hudAxis );
hudAxis = idAngles( 10.0f, RAD2DEG(atan2(hud_yaw_y, hud_yaw_x)), 0.0f ).ToMat3();
hudOrigin += hudAxis[0] * 24.0f;
hudOrigin.z += 4.0f;
hudOrigin += hudAxis[1] * -8.5f;
hudOrigin += hudAxis[0] * vr_hudPosDis.GetFloat();
hudOrigin += hudAxis[1] * vr_hudPosHor.GetFloat();
hudOrigin.z += vr_hudPosVer.GetFloat();
/*hudOrigin += hudAxis[0] * vr_hudPosDis.GetFloat();
hudOrigin += hudAxis[1] * vr_hudPosHor.GetFloat();
hudOrigin.z += vr_hudPosVer.GetFloat();*/
/*float yaw;
if( gameLocal.inCinematic )

View file

@ -64,9 +64,9 @@ idCVar vr_guiMode( "vr_guiMode", "2", CVAR_INTEGER | CVAR_GAME | CVAR_ARCHIVE, "
//In menu - test
idCVar vr_hudScale( "vr_hudScale", "1.3", CVAR_FLOAT | CVAR_GAME | CVAR_ARCHIVE, "Hud scale", 0.1f, 2.0f );
idCVar vr_hudPosHor( "vr_hudPosHor", "-8", CVAR_FLOAT | CVAR_GAME | CVAR_ARCHIVE, "Hud Horizontal offset in inches" );
idCVar vr_hudPosVer( "vr_hudPosVer", "7", CVAR_FLOAT | CVAR_GAME | CVAR_ARCHIVE, "Hud Vertical offset in inches" );
idCVar vr_hudPosDis( "vr_hudPosDis", "32", CVAR_FLOAT | CVAR_GAME | CVAR_ARCHIVE, "Hud Distance from view in inches" );
idCVar vr_hudPosHor( "vr_hudPosHor", "-8.5", CVAR_FLOAT | CVAR_GAME | CVAR_ARCHIVE, "Hud Horizontal offset in inches" );
idCVar vr_hudPosVer( "vr_hudPosVer", "4", CVAR_FLOAT | CVAR_GAME | CVAR_ARCHIVE, "Hud Vertical offset in inches" );
idCVar vr_hudPosDis( "vr_hudPosDis", "24", CVAR_FLOAT | CVAR_GAME | CVAR_ARCHIVE, "Hud Distance from view in inches" );
idCVar vr_hudPosAngle( "vr_hudPosAngle", "30", CVAR_FLOAT | CVAR_GAME | CVAR_ARCHIVE, "Hud View Angle" );
//In Menu - working

View file

@ -266,9 +266,9 @@ seta vr_hudRevealAngle "40"
seta vr_hudType "1"
seta vr_hudPosLock "1"
seta vr_hudPosAngle "30"
seta vr_hudPosDis "32"
seta vr_hudPosVer "7"
seta vr_hudPosHor "-8"
seta vr_hudPosDis "24"
seta vr_hudPosVer "4"
seta vr_hudPosHor "-8.5"
seta vr_hudScale "1.033065"
seta vr_guiMode "2"
seta vr_guiSeparation ".01"

View file

@ -266,9 +266,9 @@ seta vr_hudRevealAngle "40"
seta vr_hudType "1"
seta vr_hudPosLock "1"
seta vr_hudPosAngle "30"
seta vr_hudPosDis "32"
seta vr_hudPosVer "7"
seta vr_hudPosHor "-8"
seta vr_hudPosDis "24"
seta vr_hudPosVer "4"
seta vr_hudPosHor "-8.5"
seta vr_hudScale "1.069837"
seta vr_guiMode "2"
seta vr_guiSeparation ".01"