diff --git a/Projects/Android/jni/JKXR/VrInputDefault.cpp b/Projects/Android/jni/JKXR/VrInputDefault.cpp index 9b984d4..228ec27 100644 --- a/Projects/Android/jni/JKXR/VrInputDefault.cpp +++ b/Projects/Android/jni/JKXR/VrInputDefault.cpp @@ -30,13 +30,6 @@ Authors : Simon Brown #include "../OpenJK/code/game/g_vehicles.h" #endif -void SV_Trace( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask, int capsule ); - -static inline float AngleBetweenVectors(const vec3_t a, const vec3_t b) -{ - return RAD2DEG(acosf(DotProduct(a, b)/(VectorLength(a) * VectorLength(b)))); -} - void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, ovrInputStateTrackedRemote *pDominantTrackedRemoteOld, ovrTrackedController* pDominantTracking, ovrInputStateTrackedRemote *pOffTrackedRemoteNew, ovrInputStateTrackedRemote *pOffTrackedRemoteOld, ovrTrackedController* pOffTracking, int domButton1, int domButton2, int offButton1, int offButton2 ) @@ -559,7 +552,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, } else if (cl.frame.ps.weapon == WP_SABER || cl.frame.ps.weapon == WP_STUN_BATON) { //Does weapon velocity trigger attack - if (vr.velocitytriggered) { + if (vr.velocitytriggered && !vr.remote_turret) { if (vr.velocitytriggeractive) { static bool fired = false; @@ -762,7 +755,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, int thirdPerson = Cvar_VariableIntegerValue("cg_thirdPerson"); - if (cl.frame.ps.weapon == WP_SABER && !thirdPerson && + if (cl.frame.ps.weapon == WP_SABER && !thirdPerson && !vr.remote_turret && vr.cgzoommode == 0 && cl.frame.ps.stats[STAT_HEALTH] > 0) { static bool previous_throwing = false; @@ -782,7 +775,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, sendButtonAction("+altattack", throwing); } } - else if (!vr.velocitytriggered) // Don't fire velocity triggered weapons + else if (!vr.velocitytriggered || vr.remote_turret) // Don't fire velocity triggered weapons { //Fire Primary - Doesn't trigger the saber if ((pDominantTrackedRemoteNew->Buttons & xrButton_Trigger) != diff --git a/Projects/Android/jni/OpenJK/code/cgame/cg_draw.cpp b/Projects/Android/jni/OpenJK/code/cgame/cg_draw.cpp index 34136ec..5f491a2 100644 --- a/Projects/Android/jni/OpenJK/code/cgame/cg_draw.cpp +++ b/Projects/Android/jni/OpenJK/code/cgame/cg_draw.cpp @@ -3281,7 +3281,10 @@ static void CG_ScanForCrosshairEntity( qboolean scanAll ) } */ //draw crosshair at endpoint - //CG_DrawCrosshair( trace.endpos ); + if (vr->remote_turret) + { + CG_DrawCrosshair(trace.endpos); + } g_crosshairEntNum = trace.entityNum; g_crosshairEntDist = 4096*trace.fraction; diff --git a/Projects/Android/jni/OpenJK/code/cgame/cg_players.cpp b/Projects/Android/jni/OpenJK/code/cgame/cg_players.cpp index c3ff81f..d859feb 100644 --- a/Projects/Android/jni/OpenJK/code/cgame/cg_players.cpp +++ b/Projects/Android/jni/OpenJK/code/cgame/cg_players.cpp @@ -6939,7 +6939,7 @@ extern qboolean G_GetRootSurfNameWithVariant( gentity_t *ent, const char *rootSu extern qboolean G_ControlledByPlayer( gentity_t *self ); extern qboolean G_RagDoll(gentity_t *ent, vec3_t forcedAngles); int cg_saberOnSoundTime[MAX_GENTITIES] = {0}; - +extern void CG_ChangeWeapon( int num ); void CG_Player( centity_t *cent ) { clientInfo_t *ci; qboolean shadow, staticScale = qfalse; @@ -7004,6 +7004,15 @@ void CG_Player( centity_t *cent ) { { wData = &weaponData[cent->currentState.weapon]; } + + //If viewing a remote turret, ensure we have switched to no weapons + if (vr->remote_turret && + cg.weaponSelect != WP_NONE) + { + cg.weaponSelect = WP_NONE; + SetWeaponSelectTime(); + } + /* Ghoul2 Insert Start */ diff --git a/Projects/Android/jni/OpenJK/code/cgame/cg_view.cpp b/Projects/Android/jni/OpenJK/code/cgame/cg_view.cpp index 41d33ec..f0b48d1 100644 --- a/Projects/Android/jni/OpenJK/code/cgame/cg_view.cpp +++ b/Projects/Android/jni/OpenJK/code/cgame/cg_view.cpp @@ -2046,8 +2046,12 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView ) { CG_BuildSolidList(); - // set up cg.snap and possibly cg.nextSnap - CG_ProcessSnapshots(); + if ( stereoView == STEREO_LEFT ) + { + // set up cg.snap and possibly cg.nextSnap + CG_ProcessSnapshots(); + } + // if we haven't received any snapshots yet, all // we can draw is the information screen if ( !cg.snap ) { diff --git a/Projects/Android/jni/OpenJK/code/game/bg_pmove.cpp b/Projects/Android/jni/OpenJK/code/game/bg_pmove.cpp index 1ae998b..2dd49a7 100644 --- a/Projects/Android/jni/OpenJK/code/game/bg_pmove.cpp +++ b/Projects/Android/jni/OpenJK/code/game/bg_pmove.cpp @@ -8964,7 +8964,7 @@ static void PM_BeginWeaponChange( int weapon ) { return; } - if ( !( pm->ps->stats[STAT_WEAPONS] & ( 1 << weapon ) ) ) { + if ( weapon != WP_NONE && !( pm->ps->stats[STAT_WEAPONS] & ( 1 << weapon ) ) ) { return; }