From ba89997b27f58220d4612b49e6840121e703a141 Mon Sep 17 00:00:00 2001 From: radwan92 Date: Fri, 7 Jan 2022 22:32:28 +0100 Subject: [PATCH 1/7] fix: libs unpacking --- Projects/Android/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Android/AndroidManifest.xml b/Projects/Android/AndroidManifest.xml index 42196b3..0216a66 100644 --- a/Projects/Android/AndroidManifest.xml +++ b/Projects/Android/AndroidManifest.xml @@ -17,7 +17,7 @@ - + From 2296e36b011e7d1ff056a45f0996517bd5349995 Mon Sep 17 00:00:00 2001 From: radwan92 Date: Fri, 7 Jan 2022 22:34:08 +0100 Subject: [PATCH 2/7] fix: specify required NDK version --- Projects/Android/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/Projects/Android/build.gradle b/Projects/Android/build.gradle index cdd6c61..3516884 100644 --- a/Projects/Android/build.gradle +++ b/Projects/Android/build.gradle @@ -42,6 +42,7 @@ android { } compileSdkVersion = 26 buildToolsVersion = '29.0.1' + ndkVersion '21.4.7075529' } dependencies { From b856fd2ce62854c5cfdc31231d4ef6d70814fd0e Mon Sep 17 00:00:00 2001 From: radwan92 Date: Fri, 7 Jan 2022 23:29:12 +0100 Subject: [PATCH 3/7] fix: silent stepping --- Projects/Android/jni/rtcw/src/client/cl_input.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Projects/Android/jni/rtcw/src/client/cl_input.c b/Projects/Android/jni/rtcw/src/client/cl_input.c index 9a16b3f..3278381 100644 --- a/Projects/Android/jni/rtcw/src/client/cl_input.c +++ b/Projects/Android/jni/rtcw/src/client/cl_input.c @@ -595,6 +595,13 @@ void CL_JoystickMove( usercmd_t *cmd ) { cmd->forwardmove = ClampChar( cmd->forwardmove + (new_move.forward * 127) + (new_move.pos_forward * 127)); cmd->rightmove = ClampChar( cmd->rightmove + (new_move.side * 127) + (new_move.pos_side * 127)); + + float moveMagnitude = sqrt(new_move.forward * new_move.forward + new_move.side * new_move.side); + if(moveMagnitude < 0.35) + { + // Triggers silent-stepping + cmd->buttons |= BUTTON_WALKING; + } } /* From d1bfb6e9a2c9f6e2a993896ec48e09d2dfa513de Mon Sep 17 00:00:00 2001 From: radwan92 Date: Fri, 7 Jan 2022 23:34:14 +0100 Subject: [PATCH 4/7] fix: backpack reach detection --- Projects/Android/jni/RTCWVR/VrInputDefault.c | 99 ++++++++++++++------ 1 file changed, 70 insertions(+), 29 deletions(-) diff --git a/Projects/Android/jni/RTCWVR/VrInputDefault.c b/Projects/Android/jni/RTCWVR/VrInputDefault.c index 9eabd48..fd1a21f 100644 --- a/Projects/Android/jni/RTCWVR/VrInputDefault.c +++ b/Projects/Android/jni/RTCWVR/VrInputDefault.c @@ -27,6 +27,11 @@ void SV_Trace( trace_t *results, const vec3_t start, const vec3_t mins, const ve void RTCWVR_HapticEvent(const char* event, int position, int flags, int intensity, float angle, float yHeight ); +static inline float AngleBetweenVectors(const vec3_t a, const vec3_t b) +{ + return degrees(acosf(DotProduct(a, b)/(VectorLength(a) * VectorLength(b)))); +} + void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateGamepad *pFootTrackingOld, ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, ovrInputStateTrackedRemote *pDominantTrackedRemoteOld, ovrTracking* pDominantTracking, ovrInputStateTrackedRemote *pOffTrackedRemoteNew, ovrInputStateTrackedRemote *pOffTrackedRemoteOld, ovrTracking* pOffTracking, @@ -42,7 +47,7 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG static qboolean dominantGripPushed = false; static float dominantGripPushTime = 0.0f; static bool canUseBackpack = false; - + static bool canUseQuickSave = false; //Need this for the touch screen ovrTracking * pWeapon = pDominantTracking; @@ -134,33 +139,6 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG { resetCursor = qtrue; - static bool canUseQuickSave = false; - if (pOffTracking->Status & (VRAPI_TRACKING_STATUS_POSITION_TRACKED | VRAPI_TRACKING_STATUS_POSITION_VALID)) { - canUseQuickSave = false; - } - else if (!canUseQuickSave) { - int channel = (vr_control_scheme->integer >= 10) ? 1 : 0; - RTCWVR_Vibrate(40, channel, 0.5); // vibrate to let user know they can switch - canUseQuickSave = true; - } - - if (canUseQuickSave) - { - if (((pOffTrackedRemoteNew->Buttons & offButton1) != - (pOffTrackedRemoteOld->Buttons & offButton1)) && - (pOffTrackedRemoteNew->Buttons & offButton1)) { - sendButtonActionSimple("savegame quicksave"); - } - - if (((pOffTrackedRemoteNew->Buttons & offButton2) != - (pOffTrackedRemoteOld->Buttons & offButton2)) && - (pOffTrackedRemoteNew->Buttons & offButton2)) { - sendButtonActionSimple("loadgame quicksave"); - } - } - - - float distance = sqrtf(powf(pOff->HeadPose.Pose.Position.x - pWeapon->HeadPose.Pose.Position.x, 2) + powf(pOff->HeadPose.Pose.Position.y - pWeapon->HeadPose.Pose.Position.y, 2) + powf(pOff->HeadPose.Pose.Position.z - pWeapon->HeadPose.Pose.Position.z, 2)); @@ -311,7 +289,70 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG finishReloadNextFrame = false; } - if (pDominantTracking->Status & (VRAPI_TRACKING_STATUS_POSITION_TRACKED | VRAPI_TRACKING_STATUS_POSITION_VALID)) { + // Calculate if player tries to reach backpack + bool handInBackpack = false; + bool bpDistToHMDOk = false, bpWeaponHeightOk = false, bpWeaponAngleOk = false, bpHmdToWeaponAngleOk = false; + vec3_t hmdForwardXY = {}, weaponForwardXY = {}; + float weaponToDownAngle = 0, hmdToWeaponDotProduct = 0; + static vec3_t downVector = {0.0, 0.0, -1.0}; + + bool bpTrackOk = pOffTracking->Status & VRAPI_TRACKING_STATUS_POSITION_TRACKED; // 1) Position must be tracked + if (bpTrackOk && (bpDistToHMDOk = distanceToHMD >= 0.2 && distanceToHMD <= 0.35) // 2) Weapon-to-HMD distance must be within <0.2-0.35> range + && (bpWeaponHeightOk = vr.current_weaponoffset[1] >= -0.10 && vr.current_weaponoffset[1] <= 0.10)) // 3) Weapon height in relation to HMD must be within <-0.10, 0.10> range + { + AngleVectors(&vr.hmdorientation, &hmdForwardXY, NULL, NULL); + AngleVectors(&vr.weaponangles, &weaponForwardXY, NULL, NULL); + + float weaponToDownAngle = AngleBetweenVectors(downVector, weaponForwardXY); + // 4) Angle between weapon forward vector and a down vector must be within 80-140 degrees + if(bpWeaponAngleOk = weaponToDownAngle >= 80.0 && weaponToDownAngle <= 140.0) + { + hmdForwardXY[2] = 0; + VectorNormalize(&hmdForwardXY); + + weaponForwardXY[2] = 0; + VectorNormalize(&weaponForwardXY); + + hmdToWeaponDotProduct = DotProduct(hmdForwardXY, weaponForwardXY); + // 5) HMD and weapon forward on XY plane must go in opposite directions (i.e. dot product < 0) + handInBackpack = bpHmdToWeaponAngleOk = hmdToWeaponDotProduct < 0; + } + } + + // Uncomment to debug backpack reaching + /* + ALOGV("Backpack> Dist: %f | WpnToDownAngle: %f | WpnOffs: %f %f %f\nHmdWpnDot: %f | HmdFwdXY: %f %f | WpnFwdXY: %f %f\nTrackOk: %i, DistOk: %i, HeightOk: %i, WpnAngleOk: %i, HmdWpnDotOk: %i", + distanceToHMD, weaponToDownAngle, vr.current_weaponoffset[0], vr.current_weaponoffset[1], vr.current_weaponoffset[2], + hmdToWeaponDotProduct, hmdForwardXY[0], hmdForwardXY[1], weaponForwardXY[0], weaponForwardXY[1], + bpTrackOk, bpDistToHMDOk, bpWeaponHeightOk, bpWeaponAngleOk, bpHmdToWeaponAngleOk); + */ + + // Check quicksave + if (!handInBackpack) { + canUseQuickSave = false; + } + else if (!canUseQuickSave) { + int channel = (vr_control_scheme->integer >= 10) ? 1 : 0; + RTCWVR_Vibrate(40, channel, 0.5); // vibrate to let user know they can switch + canUseQuickSave = true; + } + + if (canUseQuickSave) + { + if (((pOffTrackedRemoteNew->Buttons & offButton1) != + (pOffTrackedRemoteOld->Buttons & offButton1)) && + (pOffTrackedRemoteNew->Buttons & offButton1)) { + sendButtonActionSimple("savegame quicksave"); + } + + if (((pOffTrackedRemoteNew->Buttons & offButton2) != + (pOffTrackedRemoteOld->Buttons & offButton2)) && + (pOffTrackedRemoteNew->Buttons & offButton2)) { + sendButtonActionSimple("loadgame quicksave"); + } + } + + if (!handInBackpack) { canUseBackpack = false; } else if (!canUseBackpack && vr.backpackitemactive == 0) { From dc4eea689544f6d6373dec718d45fef3dfa70a75 Mon Sep 17 00:00:00 2001 From: mietszczyslaw Date: Sat, 8 Jan 2022 00:18:43 +0100 Subject: [PATCH 5/7] fix: cleaned up backpack detection code --- Projects/Android/jni/RTCWVR/VrInputDefault.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Projects/Android/jni/RTCWVR/VrInputDefault.c b/Projects/Android/jni/RTCWVR/VrInputDefault.c index fd1a21f..9589633 100644 --- a/Projects/Android/jni/RTCWVR/VrInputDefault.c +++ b/Projects/Android/jni/RTCWVR/VrInputDefault.c @@ -300,18 +300,18 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG if (bpTrackOk && (bpDistToHMDOk = distanceToHMD >= 0.2 && distanceToHMD <= 0.35) // 2) Weapon-to-HMD distance must be within <0.2-0.35> range && (bpWeaponHeightOk = vr.current_weaponoffset[1] >= -0.10 && vr.current_weaponoffset[1] <= 0.10)) // 3) Weapon height in relation to HMD must be within <-0.10, 0.10> range { - AngleVectors(&vr.hmdorientation, &hmdForwardXY, NULL, NULL); - AngleVectors(&vr.weaponangles, &weaponForwardXY, NULL, NULL); + AngleVectors(vr.hmdorientation, hmdForwardXY, NULL, NULL); + AngleVectors(vr.weaponangles, weaponForwardXY, NULL, NULL); float weaponToDownAngle = AngleBetweenVectors(downVector, weaponForwardXY); // 4) Angle between weapon forward vector and a down vector must be within 80-140 degrees if(bpWeaponAngleOk = weaponToDownAngle >= 80.0 && weaponToDownAngle <= 140.0) { hmdForwardXY[2] = 0; - VectorNormalize(&hmdForwardXY); + VectorNormalize(hmdForwardXY); weaponForwardXY[2] = 0; - VectorNormalize(&weaponForwardXY); + VectorNormalize(weaponForwardXY); hmdToWeaponDotProduct = DotProduct(hmdForwardXY, weaponForwardXY); // 5) HMD and weapon forward on XY plane must go in opposite directions (i.e. dot product < 0) @@ -749,4 +749,4 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG //Save state rightTrackedRemoteState_old = rightTrackedRemoteState_new; leftTrackedRemoteState_old = leftTrackedRemoteState_new; -} \ No newline at end of file +} From de64e051f1e64656636eb3f5941f5f1832158c40 Mon Sep 17 00:00:00 2001 From: Grant Bagwell Date: Wed, 23 Feb 2022 16:27:13 +0100 Subject: [PATCH 6/7] Extra Latency Mode Helped with judders in some parts of the game. Also removed the reliance on a particular NDK as that shouldn't be needed --- Projects/Android/build.gradle | 1 - Projects/Android/jni/RTCWVR/RTCWVR_SurfaceView.c | 10 +++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Projects/Android/build.gradle b/Projects/Android/build.gradle index 3516884..cdd6c61 100644 --- a/Projects/Android/build.gradle +++ b/Projects/Android/build.gradle @@ -42,7 +42,6 @@ android { } compileSdkVersion = 26 buildToolsVersion = '29.0.1' - ndkVersion '21.4.7075529' } dependencies { diff --git a/Projects/Android/jni/RTCWVR/RTCWVR_SurfaceView.c b/Projects/Android/jni/RTCWVR/RTCWVR_SurfaceView.c index 04118b4..9248320 100644 --- a/Projects/Android/jni/RTCWVR/RTCWVR_SurfaceView.c +++ b/Projects/Android/jni/RTCWVR/RTCWVR_SurfaceView.c @@ -1193,9 +1193,11 @@ static void ovrApp_HandleVrModeChanges( ovrApp * app ) { ALOGV("Failed to change refresh rate to 90Hz Result=%d",result); } vrapi_SetClockLevels( app->Ovr, app->CpuLevel, app->GpuLevel ); - ALOGV( " vrapi_SetClockLevels( %d, %d )", app->CpuLevel, app->GpuLevel ); + vrapi_SetExtraLatencyMode(app->Ovr, VRAPI_EXTRA_LATENCY_MODE_ON); + ALOGV( " vrapi_SetExtraLatencyMode( %d )", VRAPI_EXTRA_LATENCY_MODE_ON ); + vrapi_SetPerfThread( app->Ovr, VRAPI_PERF_THREAD_TYPE_MAIN, app->MainThreadTid ); ALOGV( " vrapi_SetPerfThread( MAIN, %d )", app->MainThreadTid ); @@ -1762,6 +1764,8 @@ void RTCWVR_FrameSetup() //Set framerate so VrApi doesn't change it on us.. vrapi_SetDisplayRefreshRate(gAppState.Ovr, REFRESH); + + vrapi_SetExtraLatencyMode(gAppState.Ovr, VRAPI_EXTRA_LATENCY_MODE_ON); } void RTCWVR_processHaptics() { @@ -2122,11 +2126,11 @@ JNIEXPORT jlong JNICALL Java_com_drbeef_rtcwquest_GLES3JNILib_onCreate( JNIEnv * /* the global arg_xxx structs are initialised within the argtable */ void *argtable[] = { - ss = arg_dbl0("s", "supersampling", "", "super sampling value (e.g. 1.0)"), + ss = arg_dbl0("s", "supersampling", "", "super sampling value (default: Q1: 1.2, Q2: 1.35)"), cpu = arg_int0("c", "cpu", "", "CPU perf index 1-4 (default: 2)"), gpu = arg_int0("g", "gpu", "", "GPU perf index 1-4 (default: 3)"), msaa = arg_int0("m", "msaa", "", "MSAA (default: 1)"), - refresh = arg_int0("r", "refresh", "", "Refresh Rate (default: Q1: 72, Q2: 90)"), + refresh = arg_int0("r", "refresh", "", "Refresh Rate (default: Q1: 72, Q2: 72)"), end = arg_end(20) }; From 893463afad86f0982483cc48c12e6551fd4192df Mon Sep 17 00:00:00 2001 From: Grant Bagwell Date: Fri, 25 Feb 2022 17:13:07 +0100 Subject: [PATCH 7/7] Quick Save and Scope Mode Fix Reinstated Quick Save and Load to be an offhand backpack reach. Added a fallback check so people don't get stuck in scoped mode. --- Projects/Android/jni/RTCWVR/VrClientInfo.h | 3 + Projects/Android/jni/RTCWVR/VrInputDefault.c | 105 ++++++++++++++----- 2 files changed, 82 insertions(+), 26 deletions(-) diff --git a/Projects/Android/jni/RTCWVR/VrClientInfo.h b/Projects/Android/jni/RTCWVR/VrClientInfo.h index 497e62d..00e9750 100644 --- a/Projects/Android/jni/RTCWVR/VrClientInfo.h +++ b/Projects/Android/jni/RTCWVR/VrClientInfo.h @@ -51,6 +51,9 @@ typedef struct { qboolean velocitytriggered; // Weapon attack triggered by velocity (knife) vec3_t offhandangles; + vec3_t offhandangles_last; // Don't use this, it is just for calculating delta! + vec3_t offhandangles_delta; + vec3_t offhandoffset; // diff --git a/Projects/Android/jni/RTCWVR/VrInputDefault.c b/Projects/Android/jni/RTCWVR/VrInputDefault.c index 9589633..c30b4f2 100644 --- a/Projects/Android/jni/RTCWVR/VrInputDefault.c +++ b/Projects/Android/jni/RTCWVR/VrInputDefault.c @@ -120,6 +120,13 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG ALOGV(" weaponangles_last: %f, %f, %f", vr.weaponangles_last[0], vr.weaponangles_last[1], vr.weaponangles_last[2]); + //GB Also set offhand angles just in case we want to use those. + vec3_t rotation_off = {0}; + rotation_off[PITCH] = vr_weapon_pitchadjust->value; + QuatToYawPitchRoll(pOff->HeadPose.Pose.Orientation, rotation_off, vr.offhandangles); + + VectorSubtract(vr.offhandangles_last, vr.offhandangles, vr.offhandangles_delta); + VectorCopy(vr.offhandangles, vr.offhandangles_last); } //Menu button @@ -147,6 +154,11 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG powf(vr.hmdposition[1] - pWeapon->HeadPose.Pose.Position.y, 2) + powf(vr.hmdposition[2] - pWeapon->HeadPose.Pose.Position.z, 2)); + float distanceToHMDOff = sqrtf(powf(vr.hmdposition[0] - pOff->HeadPose.Pose.Position.x, 2) + + powf(vr.hmdposition[1] - pOff->HeadPose.Pose.Position.y, 2) + + powf(vr.hmdposition[2] - pOff->HeadPose.Pose.Position.z, 2)); + + float controllerYawHeading = 0.0f; //Turn on weapon stabilisation? qboolean stabilised = qfalse; if (!vr.pistol && // Don't stabilise pistols @@ -174,6 +186,14 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG } } + //ALOGV("**GB WEAPON ACTIVE** %i",vr.weaponid); + if(!scopeready && vr.weaponid >= 15 && vr.weaponid <= 17) + { + lastScopeReady = false; + ALOGV("**WEAPON EVENT** disable scope mode forced"); + sendButtonActionSimple("weapalt"); + } + //Engage scope / virtual stock (iron sight lock) if conditions are right static qboolean scopeEngaged = qfalse; if (scopeEngaged != vr.scopeengaged) @@ -327,18 +347,68 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG bpTrackOk, bpDistToHMDOk, bpWeaponHeightOk, bpWeaponAngleOk, bpHmdToWeaponAngleOk); */ - // Check quicksave - if (!handInBackpack) { - canUseQuickSave = false; - } - else if (!canUseQuickSave) { - int channel = (vr_control_scheme->integer >= 10) ? 1 : 0; - RTCWVR_Vibrate(40, channel, 0.5); // vibrate to let user know they can switch - canUseQuickSave = true; + + //off-hand stuff (done here as I reference it in the save state thing + { + vr.offhandoffset[0] = pOff->HeadPose.Pose.Position.x - vr.hmdposition[0]; + vr.offhandoffset[1] = pOff->HeadPose.Pose.Position.y - vr.hmdposition[1]; + vr.offhandoffset[2] = pOff->HeadPose.Pose.Position.z - vr.hmdposition[2]; + + vec3_t rotation = {0}; + QuatToYawPitchRoll(pOff->HeadPose.Pose.Orientation, rotation, vr.offhandangles); + + if (vr_walkdirection->value == 0) { + controllerYawHeading = vr.offhandangles[YAW] - vr.hmdorientation[YAW]; + } + else + { + controllerYawHeading = 0.0f; + } } - if (canUseQuickSave) + // Use off hand as well to trigger save condition + canUseQuickSave = false; + bool bpOffhandDistToHMDOk = false, bpOffhandHeightOk = false, bpOffhandAngleOk = false, bpHmdToOffhandAngleOk = false; + vec3_t offhandForwardXY = {}; + float hmdToOffhandDotProduct = 0; + float offhandToDownAngle = 0; + if (bpTrackOk && (bpOffhandDistToHMDOk = distanceToHMDOff >= 0.2 && distanceToHMDOff <= 0.35) // 2) Off-to-HMD distance must be within <0.2-0.35> range + && (bpOffhandHeightOk = vr.offhandoffset[1] >= -0.10 && vr.offhandoffset[1] <= 0.10)) // 3) Offhand height in relation to HMD must be within <-0.10, 0.10> range { + //Need to do this again as might not have done it above and cant be bothered to refactor + AngleVectors(vr.hmdorientation, hmdForwardXY, NULL, NULL); + AngleVectors(vr.offhandangles, offhandForwardXY, NULL, NULL); + + offhandToDownAngle = AngleBetweenVectors(downVector, offhandForwardXY); + + // 4) Angle between weapon forward vector and a down vector must be within 80-140 degrees + if(bpOffhandAngleOk = offhandToDownAngle >= 80.0 && offhandToDownAngle <= 140.0) + { + hmdForwardXY[2] = 0; + VectorNormalize(hmdForwardXY); + + offhandForwardXY[2] = 0; + VectorNormalize(offhandForwardXY); + + hmdToOffhandDotProduct = DotProduct(hmdForwardXY, offhandForwardXY); + // 5) HMD and weapon forward on XY plane must go in opposite directions (i.e. dot product < 0) + canUseQuickSave = bpHmdToOffhandAngleOk = hmdToOffhandDotProduct < 0; + } + } + + // Uncomment to debug offhand reaching + + ALOGV("Quick Save> Dist: %f | OffHandToDownAngle: %f | HandOffs: %f %f %f\nHmdHandDot: %f | HmdFwdXY: %f %f | WpnFwdXY: %f %f\nTrackOk: %i, DistOk: %i, HeightOk: %i, HnadAngleOk: %i, HmdHandDotOk: %i", + distanceToHMDOff, offhandToDownAngle, vr.offhandoffset[0], vr.offhandoffset[1], vr.offhandoffset[2], + hmdToOffhandDotProduct, hmdForwardXY[0], hmdForwardXY[1], offhandForwardXY[0], offhandForwardXY[1], + bpTrackOk, bpOffhandDistToHMDOk, bpOffhandHeightOk, bpOffhandAngleOk, bpHmdToOffhandAngleOk); + + + // Check quicksave + if (canUseQuickSave) { + int channel = (vr_control_scheme->integer >= 10) ? 1 : 0; + RTCWVR_Vibrate(40, channel, 0.5); // vibrate to let user know they can switch + if (((pOffTrackedRemoteNew->Buttons & offButton1) != (pOffTrackedRemoteOld->Buttons & offButton1)) && (pOffTrackedRemoteNew->Buttons & offButton1)) { @@ -434,24 +504,7 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG } } - float controllerYawHeading = 0.0f; - //off-hand stuff - { - vr.offhandoffset[0] = pOff->HeadPose.Pose.Position.x - vr.hmdposition[0]; - vr.offhandoffset[1] = pOff->HeadPose.Pose.Position.y - vr.hmdposition[1]; - vr.offhandoffset[2] = pOff->HeadPose.Pose.Position.z - vr.hmdposition[2]; - vec3_t rotation = {0}; - QuatToYawPitchRoll(pOff->HeadPose.Pose.Orientation, rotation, vr.offhandangles); - - if (vr_walkdirection->value == 0) { - controllerYawHeading = vr.offhandangles[YAW] - vr.hmdorientation[YAW]; - } - else - { - controllerYawHeading = 0.0f; - } - } //Right-hand specific stuff {