Skip to content

Commit

Permalink
Bug Fix & New Features:
Browse files Browse the repository at this point in the history
BugFixes:
Fixed issue with flashlight and weaponsight state save and persistance
Fixed issue with Fixed PDA location
Fixed issue where audio was forced to Rift headset
Fixed game pause issues
Fixed issue where left strafe didn't work without moving forward.
Removed hands from weapon models, all body/hands are now part of the player model.
Cleaned up script and skin files to reflect removing hands from weapon models.
Potential fix for memory issue with texture packs.
Fixed missing bone errors when loading expansion pack

New Features:
Added full motion crouch mode
Added haptic feedback to weapon controller
Added body IK to crouch ( player character knees bend if you duck )
Added VR configuration options to in game menus, can now configure most options without cvars.
Added option to force audio to rift or use default audio device
  • Loading branch information
KozGit committed Dec 20, 2016
1 parent bec73f0 commit 9dbdc28
Show file tree
Hide file tree
Showing 169 changed files with 219,576 additions and 73,315 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@ GTAGS
HTML/
neo/.kdev4
neo/neo.kdev4
/neo/d3xp/menus/MenuScreen_Shell_VR_PDA_Options - Copy.cpp
4 changes: 3 additions & 1 deletion neo/d3xp/IK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,11 +744,12 @@ void idIK_Walk::Evaluate()
idMat3 hipAxis[MAX_LEGS], kneeAxis[MAX_LEGS], ankleAxis[MAX_LEGS];
trace_t results;


// koz begin
bool isPlayer = false;
idPlayer *player;
player = gameLocal.GetLocalPlayer();
if ( player )
if ( player != NULL )
{
if ( player->entityNumber == self->entityNumber )
{
Expand All @@ -757,6 +758,7 @@ void idIK_Walk::Evaluate()
}
// koz end


if( !self || !gameLocal.isNewFrame )
{
return;
Expand Down
27 changes: 16 additions & 11 deletions neo/d3xp/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2233,8 +2233,8 @@ void idPlayer::Init()
crosshairEntity.hModel = renderModelManager->FindModel( "/models/mapobjects/weaponsight.lwo" );
crosshairEntity.weaponDepthHack = true;
skinCrosshairDot = declManager->FindSkin( "skins/vr/crosshairDot" );
skinCrosshairCircleDot = declManager->FindSkin( "skins/vr/crosshairCircleDot" );;
skinCrosshairCross = declManager->FindSkin( "skins/vr/crosshairCross" );;
skinCrosshairCircleDot = declManager->FindSkin( "skins/vr/crosshairCircleDot" );
skinCrosshairCross = declManager->FindSkin( "skins/vr/crosshairCross" );

// heading indicator for VR - point the direction the body is facing.
memset( &headingBeamEntity, 0, sizeof( headingBeamEntity ) );
Expand Down Expand Up @@ -3383,17 +3383,18 @@ void idPlayer::Restore( idRestoreGame* savefile )
skinHeadingArrows = declManager->FindSkin( "skins/models/headingbeamarrows" );
skinHeadingArrowsScroll = declManager->FindSkin( "skins/models/headingbeamarrowsscroll" );
skinCrosshairDot = declManager->FindSkin( "skins/vr/crosshairDot" );
skinCrosshairCircleDot = declManager->FindSkin( "skins/vr/crosshairCircleDot" );;
skinCrosshairCross = declManager->FindSkin( "skins/vr/crosshairCross" );;
skinCrosshairCircleDot = declManager->FindSkin( "skins/vr/crosshairCircleDot" );
skinCrosshairCross = declManager->FindSkin( "skins/vr/crosshairCross" );


const idDeclSkin* blag;
//koz begin
savefile->ReadBool( laserSightActive );
savefile->ReadBool( headingBeamActive );
savefile->ReadBool( hudActive );

savefile->ReadInt( commonVr->currentFlashMode );
savefile->ReadSkin( crosshairEntity.customSkin );
// savefile->ReadSkin( crosshairEntity.customSkin );
savefile->ReadSkin( blag );

savefile->ReadBool( PDAfixed );
savefile->ReadVec3( PDAorigin );
Expand Down Expand Up @@ -11143,7 +11144,6 @@ void idPlayer::Think()



static int lastCVarFlashMode = vr_flashlightMode.GetInteger();
static int lastFlashMode = commonVr->GetCurrentFlashMode();
static bool lastViewArms = vr_viewModelArms.GetBool();
static bool lastFists = false;
Expand Down Expand Up @@ -11184,9 +11184,15 @@ void idPlayer::Think()

}

if ( vr_flashlightMode.GetInteger() != lastCVarFlashMode || lastFlashMode != commonVr->GetCurrentFlashMode() )
if ( vr_flashlightMode.IsModified() || lastFlashMode != commonVr->GetCurrentFlashMode() )
{
lastCVarFlashMode = vr_flashlightMode.GetInteger();

if ( vr_flashlightMode.IsModified() )
{
commonVr->currentFlashMode = vr_flashlightMode.GetInteger();
vr_flashlightMode.ClearModified();
}

lastFlashMode = commonVr->GetCurrentFlashMode();
UpdatePlayerSkinsPoses();
}
Expand Down Expand Up @@ -12670,8 +12676,7 @@ void idPlayer::CalculateViewWeaponPosVR( idVec3 &origin, idMat3 &axis )

origin = PDAorigin;
axis = PDAaxis;
commonVr->fixedPDAMoveDelta;



//if the player has moved ( or been moved, if on an elevator or lift )
//move the PDA to maintain a constant relative position
Expand Down
44 changes: 4 additions & 40 deletions neo/d3xp/Weapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5564,8 +5564,8 @@ void idWeapon::Event_GetWeaponSkin()
// Koz fixme - need to go through all the weapon models and delete the meshes for the hands and statwatch. Also need to delete all the skin definitions, no longer necessary.

// this has all changed. Originally, hands were part of the weapon models, and hands and statwatch were turned on and off
// by changing the skin for model. Now the hands are always drawn as part of the player body, so we no longer
// need all the skins. The only skin we are using now is for the mini flashlight when mounted to the weapon.
// by changing the skin for model. Now the hands are always drawn as part of the player body, so all the skins
// are no longer needed. The only skin used now is for the mini flashlight when mounted to the weapon.


if ( isPlayerFlashlight )
Expand All @@ -5574,49 +5574,13 @@ void idWeapon::Event_GetWeaponSkin()
}
else
{
vrSkinName = "vr/weaponhands/0h";
//vrSkinName = "vr/weaponhands/0h";
vrSkinName = "";
}


//common->Printf( "idWeapon::Event_GetWeaponSkin() returning %s\n", vrSkinName.c_str() );
idThread::ReturnString( vrSkinName.c_str() );



/* old skin code
if ( isPlayerFlashlight )
{
//vrSkinName = vr_flashlightMode.GetInteger() == 2 ? "minivr/flashhands/" : "vr/flashhands/"; // mini flashlight skin for gun mount
vrSkinName = commonVr->GetCurrentFlashMode() == 2 ? "minivr/flashhands/" : "vr/flashhands/"; // mini flashlight skin for gun mount
//if ( vr_viewModelArms.GetBool() && commonVr->VR_USE_MOTION_CONTROLS && vr_flashlightMode.GetInteger() == 3 && !vr_showBody.GetInteger() && vr_weaponHand.GetInteger() == 0 )
if ( vr_viewModelArms.GetBool() && commonVr->VR_USE_MOTION_CONTROLS && commonVr->GetCurrentFlashMode() == 3 && !vr_showBody.GetInteger() && vr_weaponHand.GetInteger() == 0 )
{
vrSkinName += "1h";
if ( vr_wristStatMon.GetInteger() == 2 ) vrSkinName += "sw";
}
else
{
vrSkinName += "0h";
}
}
else
{
vrSkinName = "vr/weaponhands/";
if ( vr_viewModelArms.GetBool() && !vr_showBody.GetInteger() && vr_weaponHand.GetInteger() == 0 )
{
vrSkinName += commonVr->VR_USE_MOTION_CONTROLS ? "1h" : "2h";
vrSkinName += vr_wristStatMon.GetInteger() == 1 ? "sw" : "";
}
else vrSkinName += "0h";
}
*/




}

/*
Expand Down
8 changes: 5 additions & 3 deletions neo/d3xp/physics/Physics_Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1521,7 +1521,7 @@ void idPhysics_Player::CheckDuck()
else
{

if ( game->isVR && vr_crouchMode.GetInteger() == 0 )
if ( current.movementType == PM_NORMAL && game->isVR && vr_crouchMode.GetInteger() == 0 )
// game is in full motion crouch mode, dont do anything except change the bounding box to match the height
// and change the player speed to crouch speed if player has ducked enough.
// thought I was going to have to do a bunch of bullshit to toggle the crouch anim
Expand All @@ -1530,8 +1530,10 @@ void idPhysics_Player::CheckDuck()

{
maxZ = pm_normalviewheight.GetFloat() + commonVr->poseHmdBodyPositionDelta.z;
//common->Printf( "Maxz = %f\n", maxZ );
if ( maxZ < (pm_crouchheight.GetFloat() + 2) )
maxZ = (int)maxZ; // if this is not cast as an int, it crashes the savegame file!!!!!!! WTF?
idMath::ClampFloat( pm_crouchheight.GetFloat(), pm_normalheight.GetFloat(), maxZ );

if ( maxZ <= ( pm_crouchheight.GetFloat() + 2 ) )
{
playerSpeed = crouchSpeed;
}
Expand Down
5 changes: 5 additions & 0 deletions neo/framework/Common_load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,11 @@ bool idCommonLocal::SaveGame( const char* saveName )
ClearWipe();

commonVr->vrIsBackgroundSaving = false;

commonVr->lastSaveTime = Sys_Milliseconds();
commonVr->wasSaved = true;


return true;
}

Expand Down
26 changes: 23 additions & 3 deletions neo/framework/common_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,10 +694,30 @@ void idCommonLocal::Frame()
if ( game )
{
ingame = game->IsInGame();
isVR = game->isVR;

if ( game->isVR )
{
if ( commonVr->wasSaved )
{
if ( ( Sys_Milliseconds() - commonVr->lastSaveTime ) > 2000 )
{
commonVr->wasSaved = false;
isVR = true;
}
else
{
isVR = false;
}
}
else
{
isVR = true;
}
}

}

if ( isVR )
if ( isVR )
{

/*
Expand Down Expand Up @@ -741,7 +761,7 @@ void idCommonLocal::Frame()
}
else // game is not paused, see if we need to pause it
{
if ( pauseGame && ingame && !commonVr->gameSaving ) // we need to pause
if ( pauseGame && ingame && !commonVr->gameSaving )
{
if ( game->IsPDAOpen() && !PDAopenedByPause ) // the PDA was already opened, dont toggle it
{
Expand Down
Loading

0 comments on commit 9dbdc28

Please sign in to comment.