mirror of
https://github.com/DrBeef/RTCWQuest.git
synced 2025-04-23 15:33:23 +00:00
Couple of fixes
- When resyncing client yaw with engine on a snap-turn, use HMD pitch rather than engine pitch (which caused a weird jitter) - If FPS drops below 72, ensure that positional tracking is still consistent rather than suddenly moving the player a greater distance
This commit is contained in:
parent
ae448f8dd0
commit
6dcf3a589d
4 changed files with 29 additions and 12 deletions
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.drbeef.rtcwquest"
|
||||
android:versionCode="39"
|
||||
android:versionName="1.1.1" android:installLocation="auto" >
|
||||
android:versionCode="40"
|
||||
android:versionName="1.1.2" android:installLocation="auto" >
|
||||
|
||||
<!-- Tell the system this app requires OpenGL ES 3.1. -->
|
||||
<uses-feature android:glEsVersion="0x00030001" android:required="true"/>
|
||||
|
|
|
@ -413,9 +413,16 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
|||
{
|
||||
//This section corrects for the fact that the controller actually controls direction of movement, but we want to move relative to the direction the
|
||||
//player is facing for positional tracking
|
||||
|
||||
//Positional movement speed correction for when we are not hitting target framerate
|
||||
static double lastframetime = 0;
|
||||
double newframetime = GetTimeInMilliSeconds();
|
||||
float multiplier = (float)((1000.0 / 72.0) / (newframetime - lastframetime));
|
||||
lastframetime = newframetime;
|
||||
|
||||
vec2_t v;
|
||||
rotateAboutOrigin(-vr.hmdposition_delta[0] * vr_positional_factor->value,
|
||||
vr.hmdposition_delta[2] * vr_positional_factor->value, - vr.hmdorientation[YAW], v);
|
||||
rotateAboutOrigin(-vr.hmdposition_delta[0] * vr_positional_factor->value * multiplier,
|
||||
vr.hmdposition_delta[2] * vr_positional_factor->value * multiplier, - vr.hmdorientation[YAW], v);
|
||||
positional_movementSideways = v[0];
|
||||
positional_movementForward = v[1];
|
||||
|
||||
|
@ -628,6 +635,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
|||
}
|
||||
|
||||
//No snap turn when using mounted gun
|
||||
static int syncCount = 0;
|
||||
static int increaseSnap = true;
|
||||
if (!vr.mountedgun && !vr.scopeengaged) {
|
||||
if (pPrimaryJoystick->x > 0.7f) {
|
||||
|
|
|
@ -42,7 +42,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
// q_shared.h -- included first by ALL program modules.
|
||||
// A user mod should never modify this file
|
||||
|
||||
#define Q3_VERSION "RTCWQuest 1.1.1 (Wolf 1.41)"
|
||||
#define Q3_VERSION "RTCWQuest 1.1.2 (Wolf 1.41)"
|
||||
// ver 1.0.0 - release
|
||||
// ver 1.0.1 - post-release work
|
||||
// ver 1.1.0 - patch 1 (12/12/01)
|
||||
|
|
|
@ -561,15 +561,24 @@ void RE_RenderScene( const refdef_t *fd ) {
|
|||
static float yaw = 0;
|
||||
static long long lastFrameIndex = 0;
|
||||
long long frameIndex = RTCWVR_getFrameIndex();
|
||||
if ((RTCWVR_useScreenLayer() || resyncClientYawWithGameYaw > 0 || vr.scopeengaged))
|
||||
{
|
||||
//Resyncing with known game yaw
|
||||
if (RTCWVR_useScreenLayer())
|
||||
{
|
||||
//Resyncing with known game yaw, use game pitch/roll
|
||||
yaw = fd->viewangles[YAW];
|
||||
VectorCopy( fd->viewaxis[0], parms.or.axis[0] );
|
||||
VectorCopy( fd->viewaxis[1], parms.or.axis[1] );
|
||||
VectorCopy( fd->viewaxis[2], parms.or.axis[2] );
|
||||
VectorCopy( fd->viewaxis[0], parms.or.axis[0] );
|
||||
VectorCopy( fd->viewaxis[1], parms.or.axis[1] );
|
||||
VectorCopy( fd->viewaxis[2], parms.or.axis[2] );
|
||||
if (fd->stereoView == 1 && resyncClientYawWithGameYaw > 0) resyncClientYawWithGameYaw--;
|
||||
}
|
||||
}
|
||||
else if (resyncClientYawWithGameYaw > 0 || vr.scopeengaged)
|
||||
{
|
||||
//Resyncing with known game yaw, but use HMD pitch/roll
|
||||
vec3_t viewAngles;
|
||||
VectorCopy(vr.hmdorientation, viewAngles);
|
||||
viewAngles[YAW] = yaw = fd->viewangles[YAW];
|
||||
AnglesToAxis( viewAngles, parms.or.axis );
|
||||
if (fd->stereoView == 1 && resyncClientYawWithGameYaw > 0) resyncClientYawWithGameYaw--;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Normal "in-game" behaviour, use pitch and roll from HMD but use
|
||||
|
|
Loading…
Reference in a new issue