Watch + Height

+ Other bits and pieces
This commit is contained in:
Grant Bagwell 2020-12-28 18:15:19 +01:00
parent 057408009a
commit 2c8c5198d5
5 changed files with 27 additions and 34 deletions

View file

@ -2702,7 +2702,8 @@ idGameLocal::RunFrame
*/
void idGameLocal::EndFrame()
{
CheckRenderCvars();
//Gb Is this causing weird movement (if so add back in height offset)
//CheckRenderCvars();
}
/*

View file

@ -13899,7 +13899,7 @@ idVec3 idPlayer::GetEyePosition( void ) const {
} else {
org = GetPhysics()->GetOrigin();
}
return org + (GetPhysics()->GetGravityNormal() * -eyeOffset.z) + idVec3(0, 0, commonVr->headHeightDiff);
return org + (GetPhysics()->GetGravityNormal() * -eyeOffset.z) + idVec3(0, 0, commonVr->headHeightDiff + vr_heightoffset.GetFloat());
/*
if (pVRClientInfo)

View file

@ -28,11 +28,9 @@
// *** Oculus HMD Variables
idCVar vr_scale( "vr_scale", "1.0", CVAR_FLOAT | CVAR_ARCHIVE | CVAR_GAME, "World scale. Everything virtual is this times as big." );
//In Menu - added virtual function - needs testing
idCVar vr_useFloorHeight( "vr_useFloorHeight", "0", CVAR_INTEGER | CVAR_ARCHIVE | CVAR_GAME, "0 = Custom eye height. 1 = Marine Eye Height. 2 = Normal View Height. 3 = make floor line up by Doomguy crouching. 4 = make everything line up by scaling world to your height.", 0, 4 );
idCVar vr_useFloorHeight( "vr_useFloorHeight", "1", CVAR_INTEGER | CVAR_ARCHIVE | CVAR_GAME, "0 = Custom eye height. 1 = Marine Eye Height. 2 = Normal View Height. 3 = make floor line up by Doomguy crouching. 4 = make everything line up by scaling world to your height.", 0, 4 );
idCVar vr_normalViewHeight( "vr_normalViewHeight", "73", CVAR_FLOAT | CVAR_ARCHIVE | CVAR_GAME, "Height of player's view while standing, in real world inches." );
//In Menu - don't think gun is working - investigate
idCVar vr_flashlightMode( "vr_flashlightMode", "3", CVAR_INTEGER | CVAR_ARCHIVE | CVAR_GAME, "Flashlight mount.\n0 = Body\n1 = Head\n2 = Gun\n3= Hand ( if motion controls available.)" );
idCVar vr_flashlightStrict( "vr_flashlightStrict", "0", CVAR_BOOL | CVAR_ARCHIVE | CVAR_GAME, "Flashlight location should be strictly enforced." ); // Carl
@ -551,7 +549,7 @@ void iVr::HMDGetOrientation( idAngles &hmdAngles, idVec3 &headPositionDelta, idV
trackingOriginOffset = lastHmdPosition;
trackingOriginHeight = trackingOriginOffset.z;
if (vr_useFloorHeight.GetInteger() == 0)
/*if (vr_useFloorHeight.GetInteger() == 0)
trackingOriginOffset.z += pm_normalviewheight.GetFloat() + 5 + CM_CLIP_EPSILON - vr_normalViewHeight.GetFloat() / vr_scale.GetFloat();
else if (vr_useFloorHeight.GetInteger() == 2)
trackingOriginOffset.z += 5;
@ -565,7 +563,7 @@ void iVr::HMDGetOrientation( idAngles &hmdAngles, idVec3 &headPositionDelta, idV
trackingOriginHeight *= oldScale / newScale;
trackingOriginOffset *= oldScale / newScale;
vr_scale.SetFloat( newScale );
}
}*/
common->Printf( "Resetting tracking yaw offset.\n Yaw = %f old offset = %f ", hmdAngles.yaw, trackingOriginYawOffset );
trackingOriginYawOffset = hmdAngles.yaw;
common->Printf( "New Tracking yaw offset %f\n", hmdAngles.yaw, trackingOriginYawOffset );
@ -675,7 +673,7 @@ void iVr::HMDGetOrientation( idAngles &hmdAngles, idVec3 &headPositionDelta, idV
trackingOriginOffset = lastHmdPosition;
trackingOriginHeight = trackingOriginOffset.z;
if (vr_useFloorHeight.GetInteger() == 0)
/*if (vr_useFloorHeight.GetInteger() == 0)
trackingOriginOffset.z += pm_normalviewheight.GetFloat() + 5 + CM_CLIP_EPSILON - vr_normalViewHeight.GetFloat() / vr_scale.GetFloat();
else if (vr_useFloorHeight.GetInteger() == 2)
trackingOriginOffset.z += 5;
@ -689,7 +687,7 @@ void iVr::HMDGetOrientation( idAngles &hmdAngles, idVec3 &headPositionDelta, idV
trackingOriginHeight *= oldScale / newScale;
trackingOriginOffset *= oldScale / newScale;
vr_scale.SetFloat(newScale);
}
}*/
common->Printf("Resetting tracking yaw offset.\n Yaw = %f old offset = %f ", hmdAngles.yaw, trackingOriginYawOffset);
trackingOriginYawOffset = hmdAngles.yaw;
common->Printf( "New Tracking yaw offset %f\n", hmdAngles.yaw, trackingOriginYawOffset );

View file

@ -1414,10 +1414,11 @@ void idWeapon::UpdateVRGUI()
if ( !player ) return;
if ( rvrStatGui == NULL )
{
return;
}
if (lvrStatGui == NULL)
{
common->Printf("Left Hand stat gui not found.\n");
return;
}
if ( status == WP_HOLSTERED )
{
@ -1458,7 +1459,8 @@ void idWeapon::UpdateVRGUI()
// update the right hand statwatch
if ( ammoamount[HAND_RIGHT] < 0 )
/*if ( ammoamount[HAND_RIGHT] < 0 )
{
// show infinite ammo
rvrStatGui->SetStateString( "player_ammo", "" );
@ -1489,7 +1491,7 @@ void idWeapon::UpdateVRGUI()
rvrStatGui->SetStateString( "grabber_state", va( "%i", grabberState ) );
//health and armor
*/
if ( player )
{
healthv = (float)player->health;
@ -1511,21 +1513,13 @@ void idWeapon::UpdateVRGUI()
armorb = idMath::ClampFloat( 0.0, 100.0, armorb );
}
/*
rvrStatGui->SetStateString( "player_health", va( "%f", healthv ) );
//vrStatGui->SetStateString( "player_armor", va( "%i%%", armorv ) );
rvrStatGui->SetStateString( "player_armor", va( "%f", armorv ) );
rvrStatGui->SetStateString( "player_healthb", va( "%f", healthb ) );
rvrStatGui->SetStateString( "player_armorb", va( "%f", armorb ) );
// update the left hand stat watch gui.
if (lvrStatGui == NULL)
{
common->Printf("Left Hand stat gui not found.\n");
return;
}
*/
lvrStatGui->SetStateString("player_health", va("%f", healthv));
//vrStatGui->SetStateString( "player_armor", va( "%i%%", armorv ) );
@ -1533,7 +1527,7 @@ void idWeapon::UpdateVRGUI()
lvrStatGui->SetStateString("player_healthb", va("%f", healthb));
lvrStatGui->SetStateString("player_armorb", va("%f", armorb));
if (ammoamount[HAND_LEFT] < 0)
if (ammoamount[vr_weaponHand.GetInteger()] < 0)
{
// show infinite ammo
lvrStatGui->SetStateString("player_ammo", "");
@ -1541,14 +1535,14 @@ void idWeapon::UpdateVRGUI()
else
{
// show remaining ammo
lvrStatGui->SetStateString("player_totalammo", va("%i", ammoamount[HAND_LEFT]));
lvrStatGui->SetStateString("player_ammo", clipsize[HAND_LEFT] ? va("%i", inclip[HAND_LEFT]) : "--");
lvrStatGui->SetStateString("player_clips", clipsize[HAND_LEFT] ? va("%i", ammoamount[HAND_LEFT] / clipsize[HAND_LEFT]) : "--");
lvrStatGui->SetStateString("player_allammo", va("%i/%i", inclip[HAND_LEFT], ammoamount[HAND_LEFT]));
lvrStatGui->SetStateString("player_totalammo", va("%i", ammoamount[vr_weaponHand.GetInteger()]));
lvrStatGui->SetStateString("player_ammo", clipsize[vr_weaponHand.GetInteger()] ? va("%i", inclip[vr_weaponHand.GetInteger()]) : "--");
lvrStatGui->SetStateString("player_clips", clipsize[vr_weaponHand.GetInteger()] ? va("%i", ammoamount[vr_weaponHand.GetInteger()] / clipsize[vr_weaponHand.GetInteger()]) : "--");
lvrStatGui->SetStateString("player_allammo", va("%i/%i", inclip[vr_weaponHand.GetInteger()], ammoamount[vr_weaponHand.GetInteger()]));
}
lvrStatGui->SetStateBool("player_ammo_empty", (ammoEmpty[HAND_LEFT]));
lvrStatGui->SetStateBool("player_clip_empty", (clipEmpty[HAND_LEFT]));
lvrStatGui->SetStateBool("player_clip_low", (clipLow[HAND_LEFT]));
lvrStatGui->SetStateBool("player_ammo_empty", (ammoEmpty[vr_weaponHand.GetInteger()]));
lvrStatGui->SetStateBool("player_clip_empty", (clipEmpty[vr_weaponHand.GetInteger()]));
lvrStatGui->SetStateBool("player_clip_low", (clipLow[vr_weaponHand.GetInteger()]));
// koz todo
@ -1556,7 +1550,7 @@ void idWeapon::UpdateVRGUI()
//Let the GUI know the total amount of ammo regardless of the ammo required value
//rvrStatGui->SetStateString( "player_ammo_count", va( "%i", AmmoCount() ) );
lvrStatGui->SetStateString("player_ammo_count", va("%i", ammoamount[HAND_LEFT]));
lvrStatGui->SetStateString("player_ammo_count", va("%i", ammoamount[vr_weaponHand.GetInteger()]));
// koz end
// koz todo also need to figure this out for dual guis

Binary file not shown.