mirror of
https://github.com/DrBeef/RTCWQuest.git
synced 2025-04-23 15:33:23 +00:00
Better pistol recoil
This commit is contained in:
parent
9229db9fe2
commit
8d9f218c97
5 changed files with 9 additions and 2 deletions
|
@ -1340,6 +1340,7 @@ void RTCWVR_Init()
|
|||
vr.backpackitemactive = 0;
|
||||
vr.visible_hud = qtrue;
|
||||
vr.dualwield = qfalse;
|
||||
vr.pistol_recoil = 0.0f;
|
||||
|
||||
//Clear teleport stuff
|
||||
vr.teleportexecute = qfalse;
|
||||
|
|
|
@ -36,6 +36,7 @@ typedef struct {
|
|||
float weaponoffset_history_timestamp[NUM_WEAPON_SAMPLES];
|
||||
|
||||
qboolean pistol; // True if the weapon is a pistol
|
||||
float pistol_recoil; // hacky recoil effect to improve the default
|
||||
|
||||
//Lots of scope weapon stuff
|
||||
qboolean scopeengaged; // Scope has been engaged on a scoped weapon
|
||||
|
|
|
@ -101,7 +101,9 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
|||
vec3_t rotation = {0};
|
||||
rotation[PITCH] = 30;
|
||||
QuatToYawPitchRoll(pWeapon->HeadPose.Pose.Orientation, rotation, vr.weaponangles_knife);
|
||||
rotation[PITCH] = vr_weapon_pitchadjust->value;
|
||||
rotation[PITCH] = vr_weapon_pitchadjust->value +
|
||||
(vr.pistol ? vr.pistol_recoil : 0.0f); // Our hacked recoil effect
|
||||
vr.pistol_recoil *= 0.8f; // quick reduction on synthetic recoil
|
||||
QuatToYawPitchRoll(pWeapon->HeadPose.Pose.Orientation, rotation, vr.weaponangles);
|
||||
|
||||
VectorSubtract(vr.weaponangles_last, vr.weaponangles, vr.weaponangles_delta);
|
||||
|
|
|
@ -3681,7 +3681,6 @@ void CG_DrawActive( int stereoView ) {
|
|||
// offset vieworg appropriately if we're doing stereo separation
|
||||
VectorCopy( cg.refdef.vieworg, baseOrg );
|
||||
|
||||
int vStock = trap_Cvar_VariableIntegerValue("vr_virtual_stock");
|
||||
int vr_cinematic_stereo = trap_Cvar_VariableIntegerValue( "vr_cinematic_stereo");
|
||||
if ( !cgVR->scopeengaged &&
|
||||
(!cg.cameraMode || (cg.cameraMode && vr_cinematic_stereo)))
|
||||
|
|
|
@ -1955,6 +1955,8 @@ void FireWeapon( gentity_t *ent ) {
|
|||
break;
|
||||
case WP_LUGER:
|
||||
Bullet_Fire( ent, LUGER_SPREAD * aimSpreadScale, LUGER_DAMAGE );
|
||||
if (gVR)
|
||||
gVR->pistol_recoil = 15.0f;
|
||||
break;
|
||||
case WP_SILENCER:
|
||||
Bullet_Fire( ent, SILENCER_SPREAD * aimSpreadScale, LUGER_DAMAGE );
|
||||
|
@ -1962,6 +1964,8 @@ void FireWeapon( gentity_t *ent ) {
|
|||
case WP_AKIMBO: //----(SA) added
|
||||
case WP_COLT:
|
||||
Bullet_Fire( ent, COLT_SPREAD * aimSpreadScale, COLT_DAMAGE );
|
||||
if (gVR)
|
||||
gVR->pistol_recoil = 15.0f;
|
||||
break;
|
||||
case WP_VENOM:
|
||||
weapon_venom_fire( ent, qfalse, aimSpreadScale );
|
||||
|
|
Loading…
Reference in a new issue