diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 2d43f577..02742f2e 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="16" + android:versionName="0.11.0"> diff --git a/code/cgame/cg_consolecmds.c b/code/cgame/cg_consolecmds.c index 4c8b075e..b869944b 100644 --- a/code/cgame/cg_consolecmds.c +++ b/code/cgame/cg_consolecmds.c @@ -157,8 +157,8 @@ static void CG_scrollScoresUp_f( void) { static void CG_spWin_f( void) { - trap_Cvar_Set("cg_cameraOrbit", "2"); - trap_Cvar_Set("cg_cameraOrbitDelay", "35"); +// trap_Cvar_Set("cg_cameraOrbit", "2"); +// trap_Cvar_Set("cg_cameraOrbitDelay", "35"); trap_Cvar_Set("cg_thirdPerson", "1"); trap_Cvar_Set("cg_thirdPersonAngle", "0"); trap_Cvar_Set("cg_thirdPersonRange", "100"); @@ -168,8 +168,8 @@ static void CG_spWin_f( void) { } static void CG_spLose_f( void) { - trap_Cvar_Set("cg_cameraOrbit", "2"); - trap_Cvar_Set("cg_cameraOrbitDelay", "35"); +// trap_Cvar_Set("cg_cameraOrbit", "2"); +// trap_Cvar_Set("cg_cameraOrbitDelay", "35"); trap_Cvar_Set("cg_thirdPerson", "1"); trap_Cvar_Set("cg_thirdPersonAngle", "0"); trap_Cvar_Set("cg_thirdPersonRange", "100"); diff --git a/code/cgame/cg_draw.c b/code/cgame/cg_draw.c index 9dbe0ce3..c5596a4c 100644 --- a/code/cgame/cg_draw.c +++ b/code/cgame/cg_draw.c @@ -2692,9 +2692,10 @@ void CG_DrawActive( stereoFrame_t stereoView ) { cg.refdef.vieworg[2] += vr->hmdposition[1] * worldscale; if (cg.snap->ps.stats[STAT_HEALTH] > 0) { - vec3_t pos; + vec3_t pos, hmdposition; VectorClear(pos); - rotateAboutOrigin(vr->hmdposition[2], vr->hmdposition[0], + VectorSubtract(vr->hmdposition, vr->hmdorigin, hmdposition); + rotateAboutOrigin(hmdposition[2], hmdposition[0], cg.refdefViewAngles[YAW] - vr->weaponangles[YAW], pos); VectorScale(pos, worldscale, pos); VectorSubtract(cg.refdef.vieworg, pos, cg.refdef.vieworg); diff --git a/code/cgame/cg_event.c b/code/cgame/cg_event.c index 0cc69913..3e16e477 100644 --- a/code/cgame/cg_event.c +++ b/code/cgame/cg_event.c @@ -23,6 +23,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // cg_event.c -- handle entity events at snapshot or playerstate transitions #include "cg_local.h" +#include "../vr/vr_clientinfo.h" + + +extern vr_clientinfo_t* vr; // for the voice chats #ifdef MISSIONPACK @@ -887,6 +891,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) { DEBUGNAME("EV_PLAYER_TELEPORT_IN"); trap_S_StartSound (NULL, es->number, CHAN_AUTO, cgs.media.teleInSound ); CG_SpawnEffect( position); + vr->realign_weapon = qtrue; // auto trigger weapon re-align break; case EV_PLAYER_TELEPORT_OUT: diff --git a/code/cgame/cg_weapons.c b/code/cgame/cg_weapons.c index 80661a92..2d02344f 100644 --- a/code/cgame/cg_weapons.c +++ b/code/cgame/cg_weapons.c @@ -263,8 +263,9 @@ void CG_CalculateVRWeaponPosition( vec3_t origin, vec3_t angles, qboolean crossh !crosshair) { //Use absolute position for the faked 6DoF for multiplayer - vec3_t offset; - VectorCopy(vr->weaponposition, offset); + vec3_t offset, weaponposition; + VectorSubtract(vr->weaponposition, vr->hmdorigin, weaponposition); + VectorCopy(weaponposition, offset); offset[1] = vr->weaponoffset[1]; // up/down is index 1 in this case CG_ConvertFromVR(offset, cg.refdef.vieworg, origin); origin[2] -= PLAYER_HEIGHT; diff --git a/code/client/cl_input.c b/code/client/cl_input.c index a9d7da93..749e9deb 100644 --- a/code/client/cl_input.c +++ b/code/client/cl_input.c @@ -604,6 +604,7 @@ void CL_FinishMove( usercmd_t *cmd ) { if (vr.realign_weapon) { + VectorCopy(vr.hmdposition, vr.hmdorigin); vr.realign_weapon_pitch -= (cl.snap.ps.viewangles[PITCH]-vr.weaponangles[PITCH]) ; vr.realign_weapon = qfalse; } diff --git a/code/game/bg_pmove.c b/code/game/bg_pmove.c index a362a872..f1392385 100644 --- a/code/game/bg_pmove.c +++ b/code/game/bg_pmove.c @@ -1345,18 +1345,19 @@ static void PM_Footsteps( void ) { } // if not trying to move - if ( !pm->cmd.forwardmove && !pm->cmd.rightmove ) { - if ( pm->xyspeed < 5 ) { - pm->ps->bobCycle = 0; // start at beginning of cycle again - if ( pm->ps->pm_flags & PMF_DUCKED ) { - PM_ContinueLegsAnim( LEGS_IDLECR ); - } else { - PM_ContinueLegsAnim( LEGS_IDLE ); - } + if (( !pm->cmd.forwardmove && !pm->cmd.rightmove ) || + ( pm->xyspeed < 10 )) + { + pm->ps->bobCycle = 0; // start at beginning of cycle again + if ( pm->ps->pm_flags & PMF_DUCKED ) { + PM_ContinueLegsAnim( LEGS_IDLECR ); + } else { + PM_ContinueLegsAnim( LEGS_IDLE ); } + return; } - + footstep = qfalse; diff --git a/code/q3_ui/ui_main.c b/code/q3_ui/ui_main.c index f2e50ea1..fc2a4c42 100644 --- a/code/q3_ui/ui_main.c +++ b/code/q3_ui/ui_main.c @@ -219,7 +219,7 @@ static cvarTable_t cvarTable[] = { { &ui_server15, "server15", "", CVAR_ARCHIVE }, { &ui_server16, "server16", "", CVAR_ARCHIVE }, - { &ui_cdkeychecked, "ui_cdkeychecked", "0", CVAR_ROM }, + { &ui_cdkeychecked, "ui_cdkeychecked", "1", CVAR_ROM }, { &ui_ioq3, "ui_ioq3", "1", CVAR_ROM }, { NULL, "g_localTeamPref", "", 0 } }; diff --git a/code/ui/ui_main.c b/code/ui/ui_main.c index 0c401a0d..2974c079 100644 --- a/code/ui/ui_main.c +++ b/code/ui/ui_main.c @@ -5815,7 +5815,7 @@ static cvarTable_t cvarTable[] = { { &ui_server14, "server14", "", CVAR_ARCHIVE }, { &ui_server15, "server15", "", CVAR_ARCHIVE }, { &ui_server16, "server16", "", CVAR_ARCHIVE }, - { &ui_cdkeychecked, "ui_cdkeychecked", "0", CVAR_ROM }, + { &ui_cdkeychecked, "ui_cdkeychecked", "1", CVAR_ROM }, { &ui_new, "ui_new", "0", CVAR_TEMP }, { &ui_debug, "ui_debug", "0", CVAR_TEMP }, { &ui_initialized, "ui_initialized", "0", CVAR_TEMP }, diff --git a/code/vr/vr_clientinfo.h b/code/vr/vr_clientinfo.h index 4d555fc0..719d7e0c 100644 --- a/code/vr/vr_clientinfo.h +++ b/code/vr/vr_clientinfo.h @@ -17,6 +17,7 @@ typedef struct { int clientNum; vec3_t hmdposition; + vec3_t hmdorigin; //used to recenter the mp fake 6DoF playspace vec3_t hmdposition_last; // Don't use this, it is just for calculating delta! vec3_t hmdposition_delta; diff --git a/code/vr/vr_input.c b/code/vr/vr_input.c index 9acb506a..6b7b9051 100644 --- a/code/vr/vr_input.c +++ b/code/vr/vr_input.c @@ -413,18 +413,9 @@ static void IN_VRButtonsChanged( qboolean isRightController, uint32_t buttons ) } if ((buttons & ovrButton_B) && !(controller->buttons & ovrButton_B)) { - if ( !com_sv_running || !com_sv_running->integer ) - { - vr.realign_weapon = qtrue; - } else { - Com_QueueEvent(in_vrEventTime, SE_KEY, 'c', qtrue, 0, NULL); - } + Com_QueueEvent(in_vrEventTime, SE_KEY, 'c', qtrue, 0, NULL); } else if (!(buttons & ovrButton_B) && (controller->buttons & ovrButton_B)) { - if ( !com_sv_running || !com_sv_running->integer ) - { - } else { - Com_QueueEvent(in_vrEventTime, SE_KEY, 'c', qfalse, 0, NULL); - } + Com_QueueEvent(in_vrEventTime, SE_KEY, 'c', qfalse, 0, NULL); } if (isRightController) { @@ -462,17 +453,21 @@ static void IN_VRButtonsChanged( qboolean isRightController, uint32_t buttons ) } } + //Taunt / Gesture if ((buttons & ovrButton_X) && !(controller->buttons & ovrButton_X)) { - //sendButtonActionSimple("fraglimit 1"); - Com_QueueEvent(in_vrEventTime, SE_KEY, K_PAD0_X, qtrue, 0, NULL); + sendButtonActionSimple("+button3"); + //Com_QueueEvent(in_vrEventTime, SE_KEY, K_PAD0_X, qtrue, 0, NULL); } else if (!(buttons & ovrButton_X) && (controller->buttons & ovrButton_X)) { - Com_QueueEvent(in_vrEventTime, SE_KEY, K_PAD0_X, qfalse, 0, NULL); + sendButtonActionSimple("-button3"); + //Com_QueueEvent(in_vrEventTime, SE_KEY, K_PAD0_X, qfalse, 0, NULL); } if ((buttons & ovrButton_Y) && !(controller->buttons & ovrButton_Y)) { - Com_QueueEvent(in_vrEventTime, SE_KEY, K_PAD0_Y, qtrue, 0, NULL); + int thirdPerson = Cvar_VariableIntegerValue("cg_thirdPerson"); + Cvar_SetValue("cg_thirdPerson", 1-thirdPerson); + //Com_QueueEvent(in_vrEventTime, SE_KEY, K_PAD0_Y, qtrue, 0, NULL); } else if (!(buttons & ovrButton_Y) && (controller->buttons & ovrButton_Y)) { - Com_QueueEvent(in_vrEventTime, SE_KEY, K_PAD0_Y, qfalse, 0, NULL); + //Com_QueueEvent(in_vrEventTime, SE_KEY, K_PAD0_Y, qfalse, 0, NULL); } controller->buttons = buttons;