added a cvar for development weapon alignment toggle

This commit is contained in:
Simon 2023-03-22 21:43:59 +00:00
parent a0473a29e8
commit 31184c1f4a
5 changed files with 12 additions and 27 deletions

View file

@ -272,6 +272,8 @@ void VR_Init()
vr.snapTurn = 0.0f;
vr.immersive_cinematics = true;
vr.test_scale = 1.0f;
//init randomiser
srand(time(NULL));
@ -303,6 +305,7 @@ void VR_Init()
vr_saber_3rdperson_mode = Cvar_Get ("vr_saber_3rdperson_mode", "1", CVAR_ARCHIVE);
vr_gesture_triggered_use = Cvar_Get ("vr_gesture_triggered_use", "1", CVAR_ARCHIVE);
vr_use_gesture_boundary = Cvar_Get ("vr_use_gesture_boundary", "0.35", CVAR_ARCHIVE);
vr_align_weapons = Cvar_Get ("vr_align_weapons", "0", CVAR_ARCHIVE);
cvar_t *expanded_menu_enabled = Cvar_Get ("expanded_menu_enabled", "0", CVAR_ARCHIVE);
if (FS_FileExists("expanded_menu.pk3") || FS_BaseFileExists("expanded_menu.pk3")) {

View file

@ -22,4 +22,5 @@ extern cvar_t *vr_comfort_vignette;
extern cvar_t *vr_saber_3rdperson_mode;
extern cvar_t *vr_gesture_triggered_use;
extern cvar_t *vr_use_gesture_boundary;
extern cvar_t *vr_align_weapons; // Only used for development

View file

@ -35,6 +35,7 @@ cvar_t *vr_comfort_vignette;
cvar_t *vr_saber_3rdperson_mode;
cvar_t *vr_gesture_triggered_use;
cvar_t *vr_use_gesture_boundary;
cvar_t *vr_align_weapons;
ovrInputStateTrackedRemote leftTrackedRemoteState_old;
ovrInputStateTrackedRemote leftTrackedRemoteState_new;

View file

@ -17,9 +17,9 @@ Authors : Simon Brown
#include <client/client.h>
#include <statindex.h>
#include "android/sys_local.h"
#include "weapons.h"
#ifdef JK2_MODE
#include "../OpenJK/codeJK2//game/weapons.h"
#include "../OpenJK/codeJK2/game/weapons.h"
#else
#include "../OpenJK/code/game/weapons.h"
#endif
@ -91,18 +91,13 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
secondaryButton2 = offButton2;
}
//Allow weapon alignment mode toggle on x
if (vr_align_weapons->value)
{
bool offhandX = (pOffTrackedRemoteNew->Buttons & xrButton_X);
if ((offhandX != (pOffTrackedRemoteOld->Buttons & xrButton_X)) &&
offhandX)
#ifndef DEBUG
{
}
#else
{
//Cvar_Set("vr_control_scheme", "99");
}
#endif
Cvar_Set("vr_control_scheme", "99");
}
//Set controller angles - We need to calculate all those we might need (including adjustments) for the client to then take its pick

View file

@ -168,14 +168,7 @@ void HandleInput_WeaponAlign( ovrInputStateTrackedRemote *pDominantTrackedRemote
bool offhandX = (pOffTrackedRemoteNew->Buttons & xrButton_X);
if ((offhandX != (pOffTrackedRemoteOld->Buttons & xrButton_X)) &&
offhandX)
#ifndef DEBUG
{
}
#else
{
Cvar_Set("vr_control_scheme", "0");
}
#endif
Cvar_Set("vr_control_scheme", "0");
}
@ -197,7 +190,7 @@ void HandleInput_WeaponAlign( ovrInputStateTrackedRemote *pDominantTrackedRemote
float* items[7] = {&vr.test_scale, &(vr.test_offset[0]), &(vr.test_offset[1]), &(vr.test_offset[2]),
&(vr.test_angles[PITCH]), &(vr.test_angles[YAW]), &(vr.test_angles[ROLL])};
char* item_names[7] = {"scale", "right", "up", "forward", "pitch", "yaw", "roll"};
float item_inc[7] = {0.002, 0.02, 0.02, 0.02, 0.1, 0.1, 0.1};
float item_inc[7] = {0.005, 0.02, 0.02, 0.02, 0.1, 0.1, 0.1};
#define JOYX_SAMPLE_COUNT 4
static float joyx[JOYX_SAMPLE_COUNT] = {0};
@ -244,14 +237,6 @@ void HandleInput_WeaponAlign( ovrInputStateTrackedRemote *pDominantTrackedRemote
//Left-hand specific stuff
{
if (((pOffTrackedRemoteNew->Buttons & offButton1) !=
(pOffTrackedRemoteOld->Buttons & offButton1)) &&
(pOffTrackedRemoteOld->Buttons & offButton1)){
//If cheats enabled, give all weapons/pickups to player
Cbuf_AddText("give all\n");
}
if (between(-0.2f, primaryJoystickX, 0.2f))
{
if (pDominantTrackedRemoteNew->Joystick.y > 0.6f) {