mirror of
https://github.com/DrBeef/JKXR.git
synced 2025-02-21 19:31:08 +00:00
A number of fixes...
- Fixed issue where sounds when using scope came from the wrong location - Now walk direction when scoped is correct - Walking when scoped won't cause horrible display jitering between scoped and unscoped views - Fixed situation when NPC saber battles caused haptics to fire
This commit is contained in:
parent
959ee3b485
commit
a21b683cc2
9 changed files with 48 additions and 32 deletions
|
@ -56,7 +56,7 @@ void VR_SetHMDOrientation(float pitch, float yaw, float roll)
|
||||||
//Keep this for our records
|
//Keep this for our records
|
||||||
VectorCopy(vr.hmdorientation, vr.hmdorientation_last);
|
VectorCopy(vr.hmdorientation, vr.hmdorientation_last);
|
||||||
|
|
||||||
if (!vr.third_person && !vr.remote_npc && !vr.remote_turret
|
if (!vr.third_person && !vr.remote_npc && !vr.remote_turret && !vr.cgzoommode
|
||||||
#ifndef JK2_MODE
|
#ifndef JK2_MODE
|
||||||
&& !vr.in_vehicle
|
&& !vr.in_vehicle
|
||||||
#endif
|
#endif
|
||||||
|
@ -65,7 +65,7 @@ void VR_SetHMDOrientation(float pitch, float yaw, float roll)
|
||||||
VectorCopy(vr.hmdorientation, vr.hmdorientation_first);
|
VectorCopy(vr.hmdorientation, vr.hmdorientation_first);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!vr.remote_turret)
|
if (!vr.remote_turret && !vr.cgzoommode)
|
||||||
{
|
{
|
||||||
VectorCopy(vr.weaponangles[ANGLES_ADJUSTED], vr.weaponangles_first[ANGLES_ADJUSTED]);
|
VectorCopy(vr.weaponangles[ANGLES_ADJUSTED], vr.weaponangles_first[ANGLES_ADJUSTED]);
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,8 @@ void VR_GetMove(float *forward, float *side, float *pos_forward, float *pos_side
|
||||||
*up = 0.0f;
|
*up = 0.0f;
|
||||||
*side = remote_movementSideways / 3.0f;
|
*side = remote_movementSideways / 3.0f;
|
||||||
*pos_side = 0.0f;
|
*pos_side = 0.0f;
|
||||||
*yaw = vr.snapTurn;
|
*yaw = vr.snapTurn + vr.hmdorientation_first[YAW] +
|
||||||
|
vr.weaponangles[ANGLES_ADJUSTED][YAW] - vr.weaponangles_first[ANGLES_ADJUSTED][YAW];
|
||||||
*pitch = vr.weaponangles[ANGLES_ADJUSTED][PITCH];
|
*pitch = vr.weaponangles[ANGLES_ADJUSTED][PITCH];
|
||||||
*roll = 0.0f;//vr.hmdorientation[ROLL];
|
*roll = 0.0f;//vr.hmdorientation[ROLL];
|
||||||
}
|
}
|
||||||
|
@ -241,7 +242,7 @@ void VR_Init()
|
||||||
vr_positional_factor = Cvar_Get( "vr_positional_factor", "12", CVAR_ARCHIVE);
|
vr_positional_factor = Cvar_Get( "vr_positional_factor", "12", CVAR_ARCHIVE);
|
||||||
vr_walkdirection = Cvar_Get( "vr_walkdirection", "1", CVAR_ARCHIVE);
|
vr_walkdirection = Cvar_Get( "vr_walkdirection", "1", CVAR_ARCHIVE);
|
||||||
vr_weapon_pitchadjust = Cvar_Get( "vr_weapon_pitchadjust", "-20.0", CVAR_ARCHIVE);
|
vr_weapon_pitchadjust = Cvar_Get( "vr_weapon_pitchadjust", "-20.0", CVAR_ARCHIVE);
|
||||||
vr_saber_pitchadjust = Cvar_Get( "vr_saber_pitchadjust", "-20.0", CVAR_ARCHIVE);
|
vr_saber_pitchadjust = Cvar_Get( "vr_saber_pitchadjust", "-13.36", CVAR_ARCHIVE);
|
||||||
vr_virtual_stock = Cvar_Get( "vr_virtual_stock", "0", CVAR_ARCHIVE);
|
vr_virtual_stock = Cvar_Get( "vr_virtual_stock", "0", CVAR_ARCHIVE);
|
||||||
|
|
||||||
//Defaults
|
//Defaults
|
||||||
|
|
|
@ -368,6 +368,7 @@ static void CG_RegisterCustomSounds(clientInfo_t *ci, int iSoundEntryBase,
|
||||||
//SB: Never render any player model if 1st person and using the saber
|
//SB: Never render any player model if 1st person and using the saber
|
||||||
bool CG_getPlayer1stPersonSaber(const centity_t *cent) {
|
bool CG_getPlayer1stPersonSaber(const centity_t *cent) {
|
||||||
return (!cent->gent->NPC && !cg.renderingThirdPerson &&
|
return (!cent->gent->NPC && !cg.renderingThirdPerson &&
|
||||||
|
cent->gent->client->ps.clientNum == 0 &&
|
||||||
cent->gent->client->ps.weapon == WP_SABER);
|
cent->gent->client->ps.weapon == WP_SABER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6507,12 +6508,15 @@ Ghoul2 Insert End
|
||||||
{
|
{
|
||||||
if ( !noMarks )
|
if ( !noMarks )
|
||||||
{
|
{
|
||||||
if (saberNum == 1 || !cent->gent->client->ps.saberInFlight)
|
if (CG_getPlayer1stPersonSaber(cent))
|
||||||
{
|
{
|
||||||
int position = (vr->right_handed ?
|
if (saberNum == 1 || !cent->gent->client->ps.saberInFlight)
|
||||||
((saberNum == 0) ? 2 : 1) :
|
{
|
||||||
((saberNum == 0) ? 1 : 2));
|
int position = (vr->right_handed ?
|
||||||
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
|
((saberNum == 0) ? 2 : 1) :
|
||||||
|
((saberNum == 0) ? 1 : 2));
|
||||||
|
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -6540,12 +6544,15 @@ Ghoul2 Insert End
|
||||||
{
|
{
|
||||||
if ( !noMarks )
|
if ( !noMarks )
|
||||||
{
|
{
|
||||||
if (saberNum == 1 || !cent->gent->client->ps.saberInFlight)
|
if (CG_getPlayer1stPersonSaber(cent))
|
||||||
{
|
{
|
||||||
int position = (vr->right_handed ?
|
if (saberNum == 1 || !cent->gent->client->ps.saberInFlight)
|
||||||
((saberNum == 0) ? 2 : 1) :
|
{
|
||||||
((saberNum == 0) ? 1 : 2));
|
int position = (vr->right_handed ?
|
||||||
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
|
((saberNum == 0) ? 2 : 1) :
|
||||||
|
((saberNum == 0) ? 1 : 2));
|
||||||
|
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ( !WP_SaberBladeUseSecondBladeStyle( &client->ps.saber[saberNum], bladeNum ) && !(client->ps.saber[saberNum].saberFlags2&SFL2_NO_WALL_MARKS) )
|
if ( ( !WP_SaberBladeUseSecondBladeStyle( &client->ps.saber[saberNum], bladeNum ) && !(client->ps.saber[saberNum].saberFlags2&SFL2_NO_WALL_MARKS) )
|
||||||
|
|
|
@ -2261,8 +2261,7 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView ) {
|
||||||
{
|
{
|
||||||
cg.refdef.viewangles[ROLL] = vr->hmdorientation[ROLL];
|
cg.refdef.viewangles[ROLL] = vr->hmdorientation[ROLL];
|
||||||
cg.refdef.viewangles[PITCH] = vr->weaponangles[ANGLES_ADJUSTED][PITCH];
|
cg.refdef.viewangles[PITCH] = vr->weaponangles[ANGLES_ADJUSTED][PITCH];
|
||||||
cg.refdef.viewangles[YAW] = vr->clientviewangles[YAW]
|
cg.refdef.viewangles[YAW] = vr->clientviewangles[YAW] + SHORT2ANGLE(cg.snap->ps.delta_angles[YAW]);
|
||||||
+ vr->weaponangles[ANGLES_ADJUSTED][YAW] + SHORT2ANGLE(cg.snap->ps.delta_angles[YAW]);
|
|
||||||
AnglesToAxis(cg.refdef.viewangles, cg.refdef.viewaxis);
|
AnglesToAxis(cg.refdef.viewangles, cg.refdef.viewaxis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -725,7 +725,7 @@ float getHMDYawForCalc()
|
||||||
return vr->hmdorientation[YAW];
|
return vr->hmdorientation[YAW];
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0.0f;
|
return vr->weaponangles[ANGLES_ADJUSTED][YAW];
|
||||||
}
|
}
|
||||||
|
|
||||||
void BG_ConvertFromVR(vec3_t in, vec3_t offset, vec3_t out)
|
void BG_ConvertFromVR(vec3_t in, vec3_t offset, vec3_t out)
|
||||||
|
|
|
@ -4970,12 +4970,13 @@ extern cvar_t *g_skippingcin;
|
||||||
// ucmd->angles[PITCH] = 0;
|
// ucmd->angles[PITCH] = 0;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if ( cg.zoomMode == 2 )
|
//Allow movement when zoomed
|
||||||
|
/* if (cg.zoomMode == 2)
|
||||||
{
|
{
|
||||||
// Any kind of movement when the player is NOT ducked when the disruptor gun is zoomed will cause us to auto-magically un-zoom
|
// Any kind of movement when the player is NOT ducked when the disruptor gun is zoomed will cause us to auto-magically un-zoom
|
||||||
if ( ( (ucmd->forwardmove||ucmd->rightmove)
|
if ( ( (ucmd->forwardmove||ucmd->rightmove)
|
||||||
&& ucmd->upmove >= 0 //crouching-moving is ok
|
&& ucmd->upmove >= 0 //crouching-moving is ok
|
||||||
&& !(ucmd->buttons&BUTTON_USE)/*leaning is ok*/
|
&& !(ucmd->buttons&BUTTON_USE)//leaning is ok
|
||||||
)
|
)
|
||||||
|| ucmd->upmove > 0 //jumping not allowed
|
|| ucmd->upmove > 0 //jumping not allowed
|
||||||
)
|
)
|
||||||
|
@ -4986,7 +4987,8 @@ extern cvar_t *g_skippingcin;
|
||||||
cg.zoomTime = cg.time;
|
cg.zoomTime = cg.time;
|
||||||
cg.zoomLocked = qfalse;
|
cg.zoomLocked = qfalse;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
if ( (player_locked
|
if ( (player_locked
|
||||||
|| (ent->client->ps.eFlags&EF_FORCE_GRIPPED)
|
|| (ent->client->ps.eFlags&EF_FORCE_GRIPPED)
|
||||||
|
|
|
@ -3074,8 +3074,7 @@ void CG_DrawActive( stereoFrame_t stereoView ) {
|
||||||
{
|
{
|
||||||
cg.refdef.viewangles[ROLL] = vr->hmdorientation[ROLL];
|
cg.refdef.viewangles[ROLL] = vr->hmdorientation[ROLL];
|
||||||
cg.refdef.viewangles[PITCH] = vr->weaponangles[ANGLES_ADJUSTED][PITCH];
|
cg.refdef.viewangles[PITCH] = vr->weaponangles[ANGLES_ADJUSTED][PITCH];
|
||||||
cg.refdef.viewangles[YAW] = vr->clientviewangles[YAW]
|
cg.refdef.viewangles[YAW] = vr->clientviewangles[YAW] + SHORT2ANGLE(cg.snap->ps.delta_angles[YAW]);
|
||||||
+ vr->weaponangles[ANGLES_ADJUSTED][YAW] + SHORT2ANGLE(cg.snap->ps.delta_angles[YAW]);
|
|
||||||
AnglesToAxis(cg.refdef.viewangles, cg.refdef.viewaxis);
|
AnglesToAxis(cg.refdef.viewangles, cg.refdef.viewaxis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4588,10 +4588,13 @@ Ghoul2 Insert End
|
||||||
{
|
{
|
||||||
if ( (trace.contents&CONTENTS_WATER) || (trace.contents&CONTENTS_SLIME) )
|
if ( (trace.contents&CONTENTS_WATER) || (trace.contents&CONTENTS_SLIME) )
|
||||||
{
|
{
|
||||||
if (!cent->gent->client->ps.saberInFlight)
|
if (cent->gent->client->ps.clientNum == 0)
|
||||||
{
|
{
|
||||||
int position = (vr->right_handed ? 2 : 1);
|
if (!cent->gent->client->ps.saberInFlight)
|
||||||
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
|
{
|
||||||
|
int position = (vr->right_handed ? 2 : 1);
|
||||||
|
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -4613,10 +4616,13 @@ Ghoul2 Insert End
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!cent->gent->client->ps.saberInFlight)
|
if (cent->gent->client->ps.clientNum == 0)
|
||||||
{
|
{
|
||||||
int position = (vr->right_handed ? 2 : 1);
|
if (!cent->gent->client->ps.saberInFlight)
|
||||||
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
|
{
|
||||||
|
int position = (vr->right_handed ? 2 : 1);
|
||||||
|
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
theFxScheduler.PlayEffect( "spark", trace.endpos, trace.plane.normal );
|
theFxScheduler.PlayEffect( "spark", trace.endpos, trace.plane.normal );
|
||||||
|
|
|
@ -658,7 +658,8 @@ float getHMDYawForCalc()
|
||||||
if (!vr->third_person && vr->cgzoommode != 2 && vr->cgzoommode != 4 ) {
|
if (!vr->third_person && vr->cgzoommode != 2 && vr->cgzoommode != 4 ) {
|
||||||
return vr->hmdorientation[YAW];
|
return vr->hmdorientation[YAW];
|
||||||
}
|
}
|
||||||
return 0.0f;
|
|
||||||
|
return vr->weaponangles[ANGLES_ADJUSTED][YAW];
|
||||||
}
|
}
|
||||||
|
|
||||||
void BG_ConvertFromVR(vec3_t in, vec3_t offset, vec3_t out)
|
void BG_ConvertFromVR(vec3_t in, vec3_t offset, vec3_t out)
|
||||||
|
|
|
@ -2248,12 +2248,13 @@ extern cvar_t *g_skippingcin;
|
||||||
// ucmd->angles[PITCH] = 0;
|
// ucmd->angles[PITCH] = 0;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if ( cg.zoomMode == 2 )
|
//Allow movement when zoomed
|
||||||
|
/* if ( cg.zoomMode == 2 )
|
||||||
{
|
{
|
||||||
// Any kind of movement when the player is NOT ducked when the disruptor gun is zoomed will cause us to auto-magically un-zoom
|
// Any kind of movement when the player is NOT ducked when the disruptor gun is zoomed will cause us to auto-magically un-zoom
|
||||||
if ( ( (ucmd->forwardmove||ucmd->rightmove)
|
if ( ( (ucmd->forwardmove||ucmd->rightmove)
|
||||||
&& ucmd->upmove >= 0 //crouching-moving is ok
|
&& ucmd->upmove >= 0 //crouching-moving is ok
|
||||||
&& !(ucmd->buttons&BUTTON_USE)/*leaning is ok*/
|
&& !(ucmd->buttons&BUTTON_USE)//leaning is ok
|
||||||
)
|
)
|
||||||
|| ucmd->upmove > 0 //jumping not allowed
|
|| ucmd->upmove > 0 //jumping not allowed
|
||||||
)
|
)
|
||||||
|
@ -2265,7 +2266,7 @@ extern cvar_t *g_skippingcin;
|
||||||
cg.zoomLocked = qfalse;
|
cg.zoomLocked = qfalse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
if ( (player_locked || (ent->client->ps.eFlags&EF_FORCE_GRIPPED)) && ent->client->ps.pm_type < PM_DEAD ) // unless dead
|
if ( (player_locked || (ent->client->ps.eFlags&EF_FORCE_GRIPPED)) && ent->client->ps.pm_type < PM_DEAD ) // unless dead
|
||||||
{//lock out player control
|
{//lock out player control
|
||||||
if ( !player_locked )
|
if ( !player_locked )
|
||||||
|
|
Loading…
Reference in a new issue