Allow player to override the push/pull motion gesture

This commit is contained in:
Simon 2023-05-29 08:03:45 +01:00
parent 3116c5296c
commit b54dd726df
4 changed files with 8 additions and 2 deletions

View file

@ -343,6 +343,8 @@ void VR_Init()
vr_force_distance_trigger = Cvar_Get( "vr_force_distance_trigger", "0.15", CVAR_ARCHIVE); vr_force_distance_trigger = Cvar_Get( "vr_force_distance_trigger", "0.15", CVAR_ARCHIVE);
vr_two_handed_weapons = Cvar_Get ("vr_two_handed_weapons", "1", CVAR_ARCHIVE); vr_two_handed_weapons = Cvar_Get ("vr_two_handed_weapons", "1", CVAR_ARCHIVE);
vr_force_motion_controlled = Cvar_Get ("vr_force_motion_controlled", "1", CVAR_ARCHIVE); vr_force_motion_controlled = Cvar_Get ("vr_force_motion_controlled", "1", CVAR_ARCHIVE);
vr_force_motion_push = Cvar_Get ("vr_force_motion_push", "3", CVAR_ARCHIVE);
vr_force_motion_pull = Cvar_Get ("vr_force_motion_pull", "4", CVAR_ARCHIVE);
vr_motion_enable_saber = Cvar_Get ("vr_motion_enable_saber", "0", CVAR_ARCHIVE); vr_motion_enable_saber = Cvar_Get ("vr_motion_enable_saber", "0", CVAR_ARCHIVE);
vr_crouch_toggle = Cvar_Get ("vr_crouch_toggle", "0", CVAR_ARCHIVE); vr_crouch_toggle = Cvar_Get ("vr_crouch_toggle", "0", CVAR_ARCHIVE);
vr_irl_crouch_enabled = Cvar_Get ("vr_irl_crouch_enabled", "0", CVAR_ARCHIVE); vr_irl_crouch_enabled = Cvar_Get ("vr_irl_crouch_enabled", "0", CVAR_ARCHIVE);

View file

@ -13,6 +13,8 @@ extern cvar_t *vr_force_velocity_trigger;
extern cvar_t *vr_force_distance_trigger; extern cvar_t *vr_force_distance_trigger;
extern cvar_t *vr_two_handed_weapons; extern cvar_t *vr_two_handed_weapons;
extern cvar_t *vr_force_motion_controlled; extern cvar_t *vr_force_motion_controlled;
extern cvar_t *vr_force_motion_push;
extern cvar_t *vr_force_motion_pull;
extern cvar_t *vr_motion_enable_saber; extern cvar_t *vr_motion_enable_saber;
extern cvar_t *vr_crouch_toggle; extern cvar_t *vr_crouch_toggle;
extern cvar_t *vr_irl_crouch_enabled; extern cvar_t *vr_irl_crouch_enabled;

View file

@ -26,6 +26,8 @@ cvar_t *vr_force_velocity_trigger;
cvar_t *vr_force_distance_trigger; cvar_t *vr_force_distance_trigger;
cvar_t *vr_two_handed_weapons; cvar_t *vr_two_handed_weapons;
cvar_t *vr_force_motion_controlled; cvar_t *vr_force_motion_controlled;
cvar_t *vr_force_motion_push;
cvar_t *vr_force_motion_pull;
cvar_t *vr_motion_enable_saber; cvar_t *vr_motion_enable_saber;
cvar_t *vr_crouch_toggle; cvar_t *vr_crouch_toggle;
cvar_t *vr_irl_crouch_enabled; cvar_t *vr_irl_crouch_enabled;

View file

@ -1004,11 +1004,11 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
if (fabs(deltaLength) > vr_force_distance_trigger->value) { if (fabs(deltaLength) > vr_force_distance_trigger->value) {
if (deltaLength < 0 && !palmAway) if (deltaLength < 0 && !palmAway)
{ {
sendButtonActionSimple(va("useGivenForce %i", FP_PULL)); sendButtonActionSimple(va("useGivenForce %i", vr_force_motion_pull->integer));
} }
else if (deltaLength > 0 && palmAway) else if (deltaLength > 0 && palmAway)
{ {
sendButtonActionSimple(va("useGivenForce %i", FP_PUSH)); sendButtonActionSimple(va("useGivenForce %i", vr_force_motion_push->integer));
} }
vr.secondaryVelocityTriggeredAttack = false; vr.secondaryVelocityTriggeredAttack = false;