diff --git a/Projects/Android/jni/d3es-multithread-master/neo/game/Game_local.cpp b/Projects/Android/jni/d3es-multithread-master/neo/game/Game_local.cpp index 037b3b7..65661e5 100644 --- a/Projects/Android/jni/d3es-multithread-master/neo/game/Game_local.cpp +++ b/Projects/Android/jni/d3es-multithread-master/neo/game/Game_local.cpp @@ -1063,6 +1063,11 @@ void idGameLocal::EvaluateVRMoveMode(idVec3 &viewangles, usercmd_t &cmd, int but //GB - Include Dr. Beefs SnapTurn if ( snapTurn != 0.0 && (commonVr->Sys_Milliseconds() - commonVr->lastComfortTime >= vr_comfortRepeat.GetInteger() || vr_turnmode.GetInteger() == 1) ) { + idPlayer *player = GetLocalPlayer(); + if (player != nullptr) { + player->resetHUDYaw = true; + } + viewangles[YAW] += snapTurn; commonVr->lastComfortTime = commonVr->Sys_Milliseconds(); } diff --git a/Projects/Android/jni/d3es-multithread-master/neo/game/Player.cpp b/Projects/Android/jni/d3es-multithread-master/neo/game/Player.cpp index aef57e0..4514a6c 100644 --- a/Projects/Android/jni/d3es-multithread-master/neo/game/Player.cpp +++ b/Projects/Android/jni/d3es-multithread-master/neo/game/Player.cpp @@ -3909,13 +3909,20 @@ void idPlayer::UpdateVrHud() hudPitch = vr_hudType.GetInteger() == VR_HUD_LOOK_DOWN ? vr_hudPosAngle.GetFloat() : 10.0f; //Fixed HUD, but make it take a short time to catch up with the player's yaw - static float yaw_x = 0.0f; - static float yaw_y = 1.0f; - yaw_x = 0.97f * yaw_x + 0.03f * cosf(DEG2RAD(viewAngles.yaw)); - yaw_y = 0.97f * yaw_y + 0.03f * sinf(DEG2RAD(viewAngles.yaw)); + if (resetHUDYaw) + { + hud_yaw_x = cosf(DEG2RAD(viewAngles.yaw)); + hud_yaw_y = sinf(DEG2RAD(viewAngles.yaw)); + resetHUDYaw = false; + } + else + { + hud_yaw_x = 0.97f * hud_yaw_x + 0.03f * cosf(DEG2RAD(viewAngles.yaw)); + hud_yaw_y = 0.97f * hud_yaw_y + 0.03f * sinf(DEG2RAD(viewAngles.yaw)); + } GetViewPos( hudOrigin, hudAxis ); - hudAxis = idAngles( 10.0f, RAD2DEG(atan2(yaw_y, yaw_x)), 0.0f ).ToMat3(); + hudAxis = idAngles( 10.0f, RAD2DEG(atan2(hud_yaw_y, hud_yaw_x)), 0.0f ).ToMat3(); hudOrigin += hudAxis[0] * 24.0f; hudOrigin.z += 4.0f; hudOrigin += hudAxis[1] * -8.5f; diff --git a/Projects/Android/jni/d3es-multithread-master/neo/game/Player.h b/Projects/Android/jni/d3es-multithread-master/neo/game/Player.h index daf6682..fd10d35 100644 --- a/Projects/Android/jni/d3es-multithread-master/neo/game/Player.h +++ b/Projects/Android/jni/d3es-multithread-master/neo/game/Player.h @@ -467,6 +467,11 @@ public: qhandle_t hudHandle; bool hudActive; + bool resetHUDYaw; + float hud_yaw_x = 0.0f; + float hud_yaw_y = 0.0f; + + const idDeclSkin* skinCrosshairDot; const idDeclSkin* skinCrosshairCircleDot; const idDeclSkin* skinCrosshairCross;