diff --git a/Projects/Android/AndroidManifest.xml b/Projects/Android/AndroidManifest.xml index 239cfe9..621ee72 100644 --- a/Projects/Android/AndroidManifest.xml +++ b/Projects/Android/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="32" + android:versionName="0.5.1" android:installLocation="auto" > diff --git a/Projects/Android/jni/JKVR/JKVR_SurfaceView.cpp b/Projects/Android/jni/JKVR/JKVR_SurfaceView.cpp index b8bdda2..9a6c6b5 100644 --- a/Projects/Android/jni/JKVR/JKVR_SurfaceView.cpp +++ b/Projects/Android/jni/JKVR/JKVR_SurfaceView.cpp @@ -2109,7 +2109,7 @@ void VR_ClearFrameBuffer( int width, int height) glViewport( 0, 0, width, height ); //Black - glClearColor( 1.0f, 0.0f, 0.0f, 1.0f ); + glClearColor( 0.0f, 0.0f, 0.0f, 1.0f ); glScissor( 0, 0, width, height ); glClear( GL_COLOR_BUFFER_BIT ); @@ -2134,13 +2134,30 @@ bool JKVR_GetVRProjection(int eye, float zNear, float zFar, float* projection) { if (!vr.cgzoommode) { +#ifdef PICO_XR XrMatrix4x4f_CreateProjectionFov( &(gAppState.ProjectionMatrices[eye]), GRAPHICS_OPENGL_ES, gAppState.Projections[eye].fov, zNear, zFar); +#endif + +#ifdef META_QUEST + XrFovf fov = {}; + for (int eye = 0; eye < ovrMaxNumEyes; eye++) { + fov.angleLeft += gAppState.Projections[eye].fov.angleLeft / 2.0f; + fov.angleRight += gAppState.Projections[eye].fov.angleRight / 2.0f; + fov.angleUp += gAppState.Projections[eye].fov.angleUp / 2.0f; + fov.angleDown += gAppState.Projections[eye].fov.angleDown / 2.0f; + } + XrMatrix4x4f_CreateProjectionFov( + &(gAppState.ProjectionMatrices[eye]), GRAPHICS_OPENGL_ES, + fov, zNear, zFar); +#endif + memcpy(projection, gAppState.ProjectionMatrices[eye].m, 16 * sizeof(float)); return true; } + return false; } diff --git a/Projects/Android/jni/JKVR/VrClientInfo.h b/Projects/Android/jni/JKVR/VrClientInfo.h index fc4d42a..9ded82d 100644 --- a/Projects/Android/jni/JKVR/VrClientInfo.h +++ b/Projects/Android/jni/JKVR/VrClientInfo.h @@ -8,6 +8,7 @@ typedef struct { bool misc_camera; // looking through a misc camera view entity bool remote_turret; // controlling a remote turret + bool emplaced_gun; // controlling an emplaced gun bool remote_droid; // controlling a remote droid bool remote_npc; // controlling a remote NPC (will also be true when controlling a droid) diff --git a/Projects/Android/jni/JKVR/VrInputDefault.cpp b/Projects/Android/jni/JKVR/VrInputDefault.cpp index 626f960..cc9a71d 100644 --- a/Projects/Android/jni/JKVR/VrInputDefault.cpp +++ b/Projects/Android/jni/JKVR/VrInputDefault.cpp @@ -836,19 +836,16 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, // Process "use" gesture if (vr_gesture_triggered_use->integer) { float distanceToBody; - bool controllerTracked; if (vr_gesture_triggered_use->integer == 1) { // Gesture with off-hand distanceToBody = sqrt(vr.offhandoffset[0]*vr.offhandoffset[0] + vr.offhandoffset[2]*vr.offhandoffset[2]); - controllerTracked = pOffTracking->Status & VRAPI_TRACKING_STATUS_POSITION_TRACKED; } else { // Gesture with dominant-hand distanceToBody = sqrt(vr.weaponoffset[0]*vr.weaponoffset[0] + vr.weaponoffset[2]*vr.weaponoffset[2]); - controllerTracked = pDominantTracking->Status & VRAPI_TRACKING_STATUS_POSITION_TRACKED; } - float boundary = vr_use_gesture_boundary->value; - bool gestureUseAllowed = !vr.weapon_stabilised && !vr.cin_camera && !vr.misc_camera && !vr.remote_turret; - if (gestureUseAllowed && controllerTracked && distanceToBody > boundary) { + + bool gestureUseAllowed = !vr.weapon_stabilised && !vr.cin_camera && !vr.misc_camera && !vr.remote_turret && !vr.emplaced_gun; + if (gestureUseAllowed && distanceToBody > vr_use_gesture_boundary->value) { if (!vr.useGestureActive) { vr.useGestureActive = true; sendButtonAction("+use", true); diff --git a/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_draw.cpp b/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_draw.cpp index e0211e5..2db7cca 100644 --- a/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_draw.cpp +++ b/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_draw.cpp @@ -2936,6 +2936,7 @@ void CG_DrawActive( stereoFrame_t stereoView ) { vr->remote_npc = !Q_stricmp( "NPC", g_entities[cg.snap->ps.viewEntity].classname ); vr->remote_droid = false; vr->remote_turret = false; + vr->emplaced_gun = ( cg_entities[cg.snap->ps.clientNum].currentState.eFlags & EF_LOCKED_TO_WEAPON ); in_misccamera = false; if (cg.snap->ps.viewEntity) { @@ -2957,7 +2958,6 @@ void CG_DrawActive( stereoFrame_t stereoView ) { || vr->remote_droid || vr->remote_turret; } - bool emplaced_gun = ( cg_entities[cg.snap->ps.clientNum].currentState.eFlags & EF_LOCKED_TO_WEAPON ); cg.refdef.worldscale = cg_worldScale.value; @@ -3008,7 +3008,7 @@ void CG_DrawActive( stereoFrame_t stereoView ) { } //Immersive cinematic sequence 6DoF - if ((in_camera && vr->immersive_cinematics) || emplaced_gun || cg.renderingThirdPerson) + if ((in_camera && vr->immersive_cinematics) || vr->emplaced_gun || cg.renderingThirdPerson) { BG_ConvertFromVR(vr->hmdposition_offset, cg.refdef.vieworg, cg.refdef.vieworg); } @@ -3027,7 +3027,7 @@ void CG_DrawActive( stereoFrame_t stereoView ) { cgi_R_LAGoggles(); } - if (!emplaced_gun && !in_misccamera && !in_camera) { + if (!vr->emplaced_gun && !in_misccamera && !in_camera) { //Vertical Positional Movement cg.refdef.vieworg[2] -= DEFAULT_PLAYER_HEIGHT; cg.refdef.vieworg[2] += (vr->hmdposition[1] + cg_heightAdjust.value) * cg_worldScale.value; diff --git a/assets/z_vr_assets.pk3 b/assets/z_vr_assets.pk3 index 25922bf..3190a60 100644 Binary files a/assets/z_vr_assets.pk3 and b/assets/z_vr_assets.pk3 differ diff --git a/z_vr_assets/menu/video/beef_crawl.tga b/z_vr_assets/menu/video/beef_crawl.tga index be62b1a..ba3fad0 100644 Binary files a/z_vr_assets/menu/video/beef_crawl.tga and b/z_vr_assets/menu/video/beef_crawl.tga differ