diff --git a/Projects/Android/jni/Doom3Quest/Doom3Quest_SurfaceView.c b/Projects/Android/jni/Doom3Quest/Doom3Quest_SurfaceView.c index e187335..fb6a041 100644 --- a/Projects/Android/jni/Doom3Quest/Doom3Quest_SurfaceView.c +++ b/Projects/Android/jni/Doom3Quest/Doom3Quest_SurfaceView.c @@ -115,13 +115,9 @@ struct arg_end *end; char **argv; int argc=0; -//extern cvar_t *r_lefthand; -//extern cvar_t *cl_paused; - enum control_scheme { RIGHT_HANDED_DEFAULT = 0, - LEFT_HANDED_DEFAULT = 10, - GAMEPAD = 20 //Not implemented, someone else can do this! + LEFT_HANDED_DEFAULT = 10 }; /* @@ -1260,7 +1256,6 @@ void VR_Init() positional_movementForward = 0.0f; snapTurn = 0.0f; vr.visible_hud = true; - vr.laserSightActive = false; // replace with a cvar? //init randomiser srand(time(NULL)); @@ -1496,7 +1491,7 @@ void * AppThreadFunction(void * parm ) { } //All the stuff we want to do each frame -void Doom3Quest_FrameSetup() +void Doom3Quest_FrameSetup(int controlscheme) { //Use floor based tracking space vrapi_SetTrackingSpace(gAppState.Ovr, VRAPI_TRACKING_SPACE_LOCAL_FLOOR); @@ -1508,7 +1503,7 @@ void Doom3Quest_FrameSetup() Doom3Quest_processHaptics(); Doom3Quest_getHMDOrientation(); - Doom3Quest_getTrackedRemotesOrientation(0); + Doom3Quest_getTrackedRemotesOrientation(controlscheme); } void Doom3Quest_processHaptics() {//Handle haptics @@ -1590,33 +1585,34 @@ void Doom3Quest_getHMDOrientation() { ovrTracking2 *tracking = &gAppState.Tracking[gAppState.MainThreadFrameIndex % MAX_TRACKING_SAMPLES]; *tracking = vrapi_GetPredictedTracking2(gAppState.Ovr, gAppState.DisplayTime[gAppState.MainThreadFrameIndex % MAX_TRACKING_SAMPLES]); - // We extract Yaw, Pitch, Roll instead of directly using the orientation - // to allow "additional" yaw manipulation with mouse/controller. - const ovrQuatf quatHmd = tracking->HeadPose.Pose.Orientation; - const ovrVector3f positionHmd = tracking->HeadPose.Pose.Position; - vec3_t rotation = {0}; - QuatToYawPitchRoll(quatHmd, rotation, vr.hmdorientation); - setHMDPosition(positionHmd.x, positionHmd.y, positionHmd.z, vr.hmdorientation[YAW]); + //Don't update game with tracking if we are in big screen mode + if (!Doom3Quest_useScreenLayer()) { - //TODO: fix - set to use HMD position for world position - updateHMDOrientation(); + const ovrQuatf quatHmd = tracking->HeadPose.Pose.Orientation; + const ovrVector3f positionHmd = tracking->HeadPose.Pose.Position; + + vec3_t rotation = {0}; + QuatToYawPitchRoll(quatHmd, rotation, vr.hmdorientation); + setHMDPosition(positionHmd.x, positionHmd.y, positionHmd.z, vr.hmdorientation[YAW]); + updateHMDOrientation(); + } } -void Doom3Quest_getTrackedRemotesOrientation(int vr_controlscheme) { +void Doom3Quest_getTrackedRemotesOrientation(int controlscheme) { //Get info for tracked remotes acquireTrackedRemotesData(gAppState.Ovr, gAppState.DisplayTime[gAppState.MainThreadFrameIndex % MAX_TRACKING_SAMPLES]); //Call additional control schemes here - switch ((int)vr_controlscheme) + switch (controlscheme) { case RIGHT_HANDED_DEFAULT: - HandleInput_Default(&rightTrackedRemoteState_new, &rightTrackedRemoteState_old, &rightRemoteTracking_new, + HandleInput_Default(controlscheme, &rightTrackedRemoteState_new, &rightTrackedRemoteState_old, &rightRemoteTracking_new, &leftTrackedRemoteState_new, &leftTrackedRemoteState_old, &leftRemoteTracking_new, ovrButton_A, ovrButton_B, ovrButton_X, ovrButton_Y); break; case LEFT_HANDED_DEFAULT: - HandleInput_Default(&leftTrackedRemoteState_new, &leftTrackedRemoteState_old, &leftRemoteTracking_new, + HandleInput_Default(controlscheme, &leftTrackedRemoteState_new, &leftTrackedRemoteState_old, &leftRemoteTracking_new, &rightTrackedRemoteState_new, &rightTrackedRemoteState_old, &rightRemoteTracking_new, ovrButton_X, ovrButton_Y, ovrButton_A, ovrButton_B); break; diff --git a/Projects/Android/jni/Doom3Quest/VrClientInfo.h b/Projects/Android/jni/Doom3Quest/VrClientInfo.h index 8dbd04a..789d131 100644 --- a/Projects/Android/jni/Doom3Quest/VrClientInfo.h +++ b/Projects/Android/jni/Doom3Quest/VrClientInfo.h @@ -22,7 +22,6 @@ typedef struct { int weaponid; int lastweaponid; int holsteritemactive; //0 - nothing, 1 - flashlight - bool laserSightActive; vec3_t hmdposition; vec3_t hmdposition_last; // Don't use this, it is just for calculating delta! @@ -32,7 +31,6 @@ typedef struct { vec3_t hmdorientation_last; // Don't use this, it is just for calculating delta! vec3_t hmdorientation_delta; - vec3_t weaponangles_unadjusted; vec3_t weaponangles; vec3_t weaponangles_last; // Don't use this, it is just for calculating delta! vec3_t weaponangles_delta; @@ -41,7 +39,6 @@ typedef struct { vec3_t current_weaponoffset; - vec3_t calculated_weaponoffset; float current_weaponoffset_timestamp; vec3_t weaponoffset_history[NUM_WEAPON_SAMPLES]; float weaponoffset_history_timestamp[NUM_WEAPON_SAMPLES]; diff --git a/Projects/Android/jni/Doom3Quest/VrCommon.h b/Projects/Android/jni/Doom3Quest/VrCommon.h index 7fe2ed0..54f17dc 100644 --- a/Projects/Android/jni/Doom3Quest/VrCommon.h +++ b/Projects/Android/jni/Doom3Quest/VrCommon.h @@ -30,8 +30,6 @@ extern "C" { float screenYaw; -bool showingScreenLayer; - float radians(float deg); float degrees(float rad); @@ -86,9 +84,7 @@ void Doom3Quest_processHaptics(); void Doom3Quest_getHMDOrientation(); -void Doom3Quest_getTrackedRemotesOrientation(int vr_controlscheme); - -void Doom3Quest_ResyncClientYawWithGameYaw(); +void Doom3Quest_getTrackedRemotesOrientation(int controlscheme); void Doom3Quest_prepareEyeBuffer(int eye); @@ -96,10 +92,6 @@ void Doom3Quest_finishEyeBuffer(int eye); void Doom3Quest_submitFrame(); -void GPUDropSync(); - -void GPUWaitSync(); - #ifdef __cplusplus } #endif diff --git a/Projects/Android/jni/Doom3Quest/VrCvars.h b/Projects/Android/jni/Doom3Quest/VrCvars.h index a9e8ce2..6a9f333 100644 --- a/Projects/Android/jni/Doom3Quest/VrCvars.h +++ b/Projects/Android/jni/Doom3Quest/VrCvars.h @@ -9,12 +9,8 @@ extern float vr_reloadtimeoutms; extern float vr_walkdirection; extern float vr_movement_multiplier; extern float vr_weapon_pitchadjust; -extern float vr_controlscheme; extern float vr_teleport; -extern float vr_virtual_stock; extern float vr_switch_sticks; -extern float vr_cinematic_stereo; -extern float vr_screen_dist; #ifdef __cplusplus } diff --git a/Projects/Android/jni/Doom3Quest/VrInput.h b/Projects/Android/jni/Doom3Quest/VrInput.h index 501f947..2023123 100644 --- a/Projects/Android/jni/Doom3Quest/VrInput.h +++ b/Projects/Android/jni/Doom3Quest/VrInput.h @@ -33,7 +33,7 @@ void sendButtonActionSimple(const char* action); void acquireTrackedRemotesData(ovrMobile *Ovr, double displayTime); -void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, ovrInputStateTrackedRemote *pDominantTrackedRemoteOld, ovrTracking* pDominantTracking, +void HandleInput_Default( int controlscheme, ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, ovrInputStateTrackedRemote *pDominantTrackedRemoteOld, ovrTracking* pDominantTracking, ovrInputStateTrackedRemote *pOffTrackedRemoteNew, ovrInputStateTrackedRemote *pOffTrackedRemoteOld, ovrTracking* pOffTracking, int domButton1, int domButton2, int offButton1, int offButton2 ); diff --git a/Projects/Android/jni/Doom3Quest/VrInputCommon.c b/Projects/Android/jni/Doom3Quest/VrInputCommon.c index 06d5ac0..27a6c90 100644 --- a/Projects/Android/jni/Doom3Quest/VrInputCommon.c +++ b/Projects/Android/jni/Doom3Quest/VrInputCommon.c @@ -133,34 +133,6 @@ void acquireTrackedRemotesData(ovrMobile *Ovr, double displayTime) {//The amount } -//YAW: Left increase, Right decrease -void updateScopeAngles() -{ - //Bit of a hack, but use weapon orientation / position for view when scope is engaged - static vec3_t currentScopeAngles; - static vec3_t lastScopeAngles; - if (false)//pVRClientInfo->scopeengaged) - { - //Clear weapon offset - VectorSet(pVRClientInfo->calculated_weaponoffset, 0, 0, 0); - - VectorSet(currentScopeAngles, pVRClientInfo->weaponangles[PITCH], pVRClientInfo->weaponangles[YAW], pVRClientInfo->hmdorientation[ROLL]); - - //Set "view" Angles - VectorCopy(currentScopeAngles, pVRClientInfo->hmdorientation); - - //Orientation - VectorSubtract(lastScopeAngles, currentScopeAngles, pVRClientInfo->hmdorientation_delta); - - //Keep this for our records - VectorCopy(currentScopeAngles, lastScopeAngles); - } else { - VectorSet(currentScopeAngles, pVRClientInfo->weaponangles[PITCH], pVRClientInfo->weaponangles[YAW], pVRClientInfo->hmdorientation[ROLL]); - VectorCopy(currentScopeAngles, lastScopeAngles); - } -} - - #ifndef max #define max( x, y ) ( ( ( x ) > ( y ) ) ? ( x ) : ( y ) ) #define min( x, y ) ( ( ( x ) < ( y ) ) ? ( x ) : ( y ) ) diff --git a/Projects/Android/jni/Doom3Quest/VrInputDefault.c b/Projects/Android/jni/Doom3Quest/VrInputDefault.c index cd34a33..d22b443 100644 --- a/Projects/Android/jni/Doom3Quest/VrInputDefault.c +++ b/Projects/Android/jni/Doom3Quest/VrInputDefault.c @@ -19,18 +19,11 @@ Authors : Simon Brown #include "doomkeys.h" -float vr_turn_mode = 0.0f; -float vr_turn_angle = 45.0f; float vr_reloadtimeoutms = 200.0f; float vr_walkdirection = 0; -float vr_movement_multiplier; float vr_weapon_pitchadjust = -30.0f; -float vr_controlscheme; float vr_teleport; -float vr_virtual_stock; float vr_switch_sticks = 0; -float vr_cinematic_stereo; -float vr_screen_dist; extern bool forceVirtualScreen; @@ -60,20 +53,21 @@ int Sys_Milliseconds( void ) { void Android_SetImpuse(int impulse); void Android_SetCommand(const char * cmd); void Android_ButtonChange(int key, int state); +int Android_GetCVarInteger(const char* cvar); extern bool inMenu; extern bool inGameGuiActive; extern bool objectiveSystemActive; extern bool inCinematic; -void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, ovrInputStateTrackedRemote *pDominantTrackedRemoteOld, ovrTracking* pDominantTracking, +void HandleInput_Default( int controlscheme, ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, ovrInputStateTrackedRemote *pDominantTrackedRemoteOld, ovrTracking* pDominantTracking, ovrInputStateTrackedRemote *pOffTrackedRemoteNew, ovrInputStateTrackedRemote *pOffTrackedRemoteOld, ovrTracking* pOffTracking, int domButton1, int domButton2, int offButton1, int offButton2 ) { //Ensure handedness is set correctly - pVRClientInfo->right_handed = vr_controlscheme < 10 || - vr_controlscheme == 99; // Always right-handed for weapon calibration + pVRClientInfo->right_handed = controlscheme < 10 || + controlscheme == 99; // Always right-handed for weapon calibration pVRClientInfo->teleportenabled = vr_teleport != 0; @@ -133,9 +127,6 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, { //Set gun angles - We need to calculate all those we might need (including adjustments) for the client to then take its pick vec3_t rotation = {0}; - rotation[PITCH] = 30; - QuatToYawPitchRoll(pWeapon->HeadPose.Pose.Orientation, rotation, pVRClientInfo->weaponangles_unadjusted); - rotation[PITCH] = vr_weapon_pitchadjust; QuatToYawPitchRoll(pWeapon->HeadPose.Pose.Orientation, rotation, pVRClientInfo->weaponangles); @@ -169,7 +160,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, canUseQuickSave = false; } else if (!canUseQuickSave) { - int channel = (vr_controlscheme >= 10) ? 1 : 0; + int channel = (controlscheme >= 10) ? 1 : 0; Doom3Quest_Vibrate(40, channel, 0.5); // vibrate to let user know they can switch canUseQuickSave = true; } @@ -248,9 +239,6 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, VectorCopy(pVRClientInfo->weaponoffset_history[NEWER_READING], pVRClientInfo->throw_origin); } - //Just copy to calculated offset, used to use this in case we wanted to apply any modifiers, but don't any more - VectorCopy(pVRClientInfo->current_weaponoffset, pVRClientInfo->calculated_weaponoffset); - //Does weapon velocity trigger attack (knife) and is it fast enough static bool velocityTriggeredAttack = false; if (pVRClientInfo->velocitytriggered) @@ -312,7 +300,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, canGrabFlashlight = false; } else if (!canGrabFlashlight && pVRClientInfo->holsteritemactive == 0) { - int channel = (vr_controlscheme >= 10) ? 0 : 1; + int channel = (controlscheme >= 10) ? 0 : 1; Doom3Quest_Vibrate(40, channel, 0.4); // vibrate to let user know they can switch canGrabFlashlight = true; @@ -335,7 +323,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, //Initiate flashlight from backpack mode Android_SetImpuse(UB_IMPULSE11); - int channel = (vr_controlscheme >= 10) ? 0 : 1; + int channel = (controlscheme >= 10) ? 0 : 1; Doom3Quest_Vibrate(80, channel, 0.8); // vibrate to let user know they switched pVRClientInfo->holsteritemactive = 1; @@ -452,14 +440,6 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, } { - //"Use" - if (((pDominantTrackedRemoteNew->Buttons & ovrButton_Joystick) != - (pDominantTrackedRemoteOld->Buttons & ovrButton_Joystick)) && - (pDominantTrackedRemoteOld->Buttons & ovrButton_Joystick)){ - - pVRClientInfo->laserSightActive = !pVRClientInfo->laserSightActive; - } - //Apply a filter and quadratic scaler so small movements are easier to make float dist = length(pSecondaryJoystick->x, pSecondaryJoystick->y); float nlf = nonLinearFilter(dist); @@ -473,7 +453,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, rotateAboutOrigin(x, y, controllerYawHeading, v); //Move a lot slower if scope is engaged - vr_movement_multiplier = 127; + float vr_movement_multiplier = 127; remote_movementSideways = v[0] * vr_movement_multiplier; remote_movementForward = v[1] * vr_movement_multiplier; @@ -516,6 +496,9 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, } } + int vr_turn_mode = Android_GetCVarInteger("vr_turnmode"); + float vr_turn_angle = Android_GetCVarInteger("vr_turnangle"); + //No snap turn when using mounted gun static int increaseSnap = true; { @@ -558,8 +541,6 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, } } } - - //updateScopeAngles(); } //Save state diff --git a/Projects/Android/jni/d3es-multithread-master/neo/framework/Common.cpp b/Projects/Android/jni/d3es-multithread-master/neo/framework/Common.cpp index 4e8223a..5743fa5 100644 --- a/Projects/Android/jni/d3es-multithread-master/neo/framework/Common.cpp +++ b/Projects/Android/jni/d3es-multithread-master/neo/framework/Common.cpp @@ -2383,7 +2383,7 @@ void idCommonLocal::InitSIMD( void ) { extern "C" void Doom3Quest_setUseScreenLayer(int use); -extern "C" void Doom3Quest_FrameSetup(); +extern "C" void Doom3Quest_FrameSetup(int controlscheme); extern "C" void Doom3Quest_Vibrate(int duration, int channel, float intensity ); void idCommonLocal::Vibrate(int duration, int channel, float intensity ) @@ -2409,7 +2409,7 @@ void idCommonLocal::Frame( void ) { int cinematic = ( game && game->InCinematic()); Doom3Quest_setUseScreenLayer(inMenu?1:0 + inGameGui?2:0 + objectiveActive?4:0 + cinematic?8:0); - Doom3Quest_FrameSetup(); + Doom3Quest_FrameSetup(cvarSystem->GetCVarInteger("vr_controlscheme")); if (game) { game->SetVRClientInfo(pVRClientInfo); diff --git a/Projects/Android/jni/d3es-multithread-master/neo/framework/UsercmdGen.h b/Projects/Android/jni/d3es-multithread-master/neo/framework/UsercmdGen.h index 17e88fe..ef650a2 100644 --- a/Projects/Android/jni/d3es-multithread-master/neo/framework/UsercmdGen.h +++ b/Projects/Android/jni/d3es-multithread-master/neo/framework/UsercmdGen.h @@ -37,7 +37,7 @@ If you have questions concerning this license or the applicable additional terms =============================================================================== */ -const int USERCMD_HZ = 60; // 60 frames per second +const int USERCMD_HZ = 60; const int USERCMD_MSEC = 1000 / USERCMD_HZ; // usercmd_t->button bits 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 c9b0cbf..528f535 100644 --- a/Projects/Android/jni/d3es-multithread-master/neo/game/Player.cpp +++ b/Projects/Android/jni/d3es-multithread-master/neo/game/Player.cpp @@ -4449,7 +4449,7 @@ void idPlayer::UpdateFocus( void ) { //Use unadjusted weapon angles to control GUIs idMat3 weaponViewAxis; idAngles weaponViewAngles; - CalculateViewWeaponPos(false, start, weaponViewAxis, weaponViewAngles); + CalculateViewWeaponPos(start, weaponViewAxis, weaponViewAngles); end = start + (weaponViewAngles.ToForward() * 80.0f); // player identification -> names to the hud @@ -7276,7 +7276,7 @@ void idPlayer::UpdateLaserSight( ) idVec3 muzzleOrigin; idMat3 muzzleAxis; idAngles muzzleAngles; - CalculateViewWeaponPos(true, muzzleOrigin, muzzleAxis, muzzleAngles ); + CalculateViewWeaponPos( muzzleOrigin, muzzleAxis, muzzleAngles ); idVec3 end, start; trace_t traceResults; @@ -7293,7 +7293,6 @@ void idPlayer::UpdateLaserSight( ) !(currentWeapon == WEAPON_PISTOL || currentWeapon == WEAPON_SHOTGUN || currentWeapon == WEAPON_MACHINEGUN || currentWeapon == WEAPON_PLASMARIFLE || currentWeapon == WEAPON_ROCKETLAUNCHER) || - !pVRClientInfo->laserSightActive || AI_DEAD || weapon.GetEntity()->IsHidden() || gameLocal.inCinematic) @@ -7362,7 +7361,7 @@ Calculate the bobbing position of the view weapon ============== */ -void idPlayer::CalculateViewWeaponPos( bool adjusted, idVec3 &origin, idMat3 &axis, idAngles &angles ) { +void idPlayer::CalculateViewWeaponPos( idVec3 &origin, idMat3 &axis, idAngles &angles ) { float scale; float fracsin; int delta; @@ -7374,23 +7373,16 @@ void idPlayer::CalculateViewWeaponPos( bool adjusted, idVec3 &origin, idMat3 &ax if (pVRClientInfo && currentWeapon != weapon_pda) { - if (adjusted) { - angles.pitch = pVRClientInfo->weaponangles[PITCH]; - angles.yaw = viewAngles.yaw + - (pVRClientInfo->weaponangles[YAW] - pVRClientInfo->hmdorientation[YAW]); - angles.roll = pVRClientInfo->weaponangles[ROLL]; - } else { - angles.pitch = pVRClientInfo->weaponangles_unadjusted[PITCH]; - angles.yaw = viewAngles.yaw + - (pVRClientInfo->weaponangles_unadjusted[YAW] - pVRClientInfo->hmdorientation[YAW]); - angles.roll = pVRClientInfo->weaponangles_unadjusted[ROLL]; - } + angles.pitch = pVRClientInfo->weaponangles[PITCH]; + angles.yaw = viewAngles.yaw + + (pVRClientInfo->weaponangles[YAW] - pVRClientInfo->hmdorientation[YAW]); + angles.roll = pVRClientInfo->weaponangles[ROLL]; axis = angles.ToMat3(); - idVec3 gunpos( -pVRClientInfo->calculated_weaponoffset[2], - -pVRClientInfo->calculated_weaponoffset[0], - pVRClientInfo->calculated_weaponoffset[1]); + idVec3 gunpos( -pVRClientInfo->current_weaponoffset[2], + -pVRClientInfo->current_weaponoffset[0], + pVRClientInfo->current_weaponoffset[1]); idAngles a(0, viewAngles.yaw - pVRClientInfo->hmdorientation[YAW], 0); gunpos *= a.ToMat3(); 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 e927a39..9b3a718 100644 --- a/Projects/Android/jni/d3es-multithread-master/neo/game/Player.h +++ b/Projects/Android/jni/d3es-multithread-master/neo/game/Player.h @@ -432,7 +432,7 @@ public: float DefaultFov( void ) const; float CalcFov( bool honorZoom ); - void CalculateViewWeaponPos( bool adjusted, idVec3 &origin, idMat3 &axis, idAngles &angles ); + void CalculateViewWeaponPos( idVec3 &origin, idMat3 &axis, idAngles &angles ); idVec3 GetEyePosition( void ) const; void GetViewPos( idVec3 &origin, idMat3 &axis ) const; void OffsetThirdPersonView( float angle, float range, float height, bool clip ); diff --git a/Projects/Android/jni/d3es-multithread-master/neo/game/Weapon.cpp b/Projects/Android/jni/d3es-multithread-master/neo/game/Weapon.cpp index 4acb5a0..1cbfaae 100644 --- a/Projects/Android/jni/d3es-multithread-master/neo/game/Weapon.cpp +++ b/Projects/Android/jni/d3es-multithread-master/neo/game/Weapon.cpp @@ -1884,7 +1884,7 @@ void idWeapon::PresentWeapon( bool showViewModel ) { int currentWeaponId = owner->GetCurrentWeapon(); // calculate weapon position based on player movement bobbing - owner->CalculateViewWeaponPos( currentWeaponId != WEAPON_CHAINSAW, viewWeaponOrigin, viewWeaponAxis, viewWeaponAngles ); + owner->CalculateViewWeaponPos( viewWeaponOrigin, viewWeaponAxis, viewWeaponAngles ); //This isn't really the right place to do this, but works for now if (currentWeaponId == WEAPON_CHAINGUN) { diff --git a/Projects/Android/jni/d3es-multithread-master/neo/game/gamesys/SysCvar.cpp b/Projects/Android/jni/d3es-multithread-master/neo/game/gamesys/SysCvar.cpp index e4169de..50d7832 100644 --- a/Projects/Android/jni/d3es-multithread-master/neo/game/gamesys/SysCvar.cpp +++ b/Projects/Android/jni/d3es-multithread-master/neo/game/gamesys/SysCvar.cpp @@ -339,12 +339,14 @@ idCVar net_serverDlTable( "net_serverDlTable", "", CVAR_GAME | CVAR_ARCHIV idCVar vr_ipd( "vr_ipd", "0.065", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE, "VR IPD" ); -idCVar vr_worldscale( "vr_worldscale", "42.0", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE, "VR World Scale" ); +idCVar vr_worldscale( "vr_worldscale", "43.0", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE, "VR World Scale" ); idCVar vr_heightoffset( "vr_heightoffset", "0.0", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE, "VR Height Offset" ); idCVar vr_eye( "vr_eye", "0", CVAR_GAME | CVAR_INTEGER, "VR Eye currently being drawn" ); idCVar vr_controlscheme( "vr_controlscheme", "0", CVAR_GAME | CVAR_INTEGER, "VR Control Scheme: 0 = right handed, 10 = left handed" ); idCVar vr_shakeamplitude( "vr_shakeamplitude", "0.8", CVAR_FLOAT | CVAR_ARCHIVE, "Screen shake amplitude 0.0 = disabled to 1.0 = full\n", 0.0f, 1.0f ); idCVar vr_knockback( "vr_knockback", "0", CVAR_BOOL | CVAR_ARCHIVE | CVAR_GAME, "Enable damage knockback in VR. 0 = Disabled, 1 = Enabled" ); -idCVar vr_weaponsight( "vr_weaponsight", "1", CVAR_INTEGER | CVAR_ARCHIVE, "Weapon Sight.\n 0 = Disable\n 1 = Lasersight" ); -idCVar vr_throwables( "vr_throwables", "1", CVAR_INTEGER | CVAR_ARCHIVE, "Throwable Grenades.\n 0 = Disable\n 1 = Throw and release with trigger" ); +idCVar vr_weaponsight( "vr_weaponsight", "0", CVAR_BOOL | CVAR_ARCHIVE, "Weapon Sight.\n 0 = Disable\n 1 = Lasersight" ); +idCVar vr_throwables( "vr_throwables", "1", CVAR_BOOL | CVAR_ARCHIVE, "Throwable Grenades.\n 0 = Disable\n 1 = Throw and release with trigger" ); +idCVar vr_turnmode( "vr_turnmode", "0", CVAR_BOOL | CVAR_ARCHIVE, "Turn Mode.\n 0 = Snap Turn\n 1 = Smooth Turn" ); +idCVar vr_turnangle( "vr_turnangle", "45", CVAR_INTEGER | CVAR_ARCHIVE, "Turn Angle. angle for snap, or velocity for smooth" ); diff --git a/Projects/Android/jni/d3es-multithread-master/neo/game/gamesys/SysCvar.h b/Projects/Android/jni/d3es-multithread-master/neo/game/gamesys/SysCvar.h index 45e8d52..02d9e53 100644 --- a/Projects/Android/jni/d3es-multithread-master/neo/game/gamesys/SysCvar.h +++ b/Projects/Android/jni/d3es-multithread-master/neo/game/gamesys/SysCvar.h @@ -261,6 +261,8 @@ extern idCVar vr_shakeamplitude; extern idCVar vr_knockback; extern idCVar vr_weaponsight; extern idCVar vr_throwables; +extern idCVar vr_turnmode; +extern idCVar vr_turnangle; extern const char *si_gameTypeArgs[]; diff --git a/Projects/Android/jni/d3es-multithread-master/neo/mobile/game_interface.cpp b/Projects/Android/jni/d3es-multithread-master/neo/mobile/game_interface.cpp index bd7125f..17a584b 100644 --- a/Projects/Android/jni/d3es-multithread-master/neo/mobile/game_interface.cpp +++ b/Projects/Android/jni/d3es-multithread-master/neo/mobile/game_interface.cpp @@ -5,6 +5,15 @@ extern "C" { +int Android_GetCVarInteger(const char* cvar) +{ + if (cvarSystem != nullptr) { + return cvarSystem->GetCVarInteger(cvar); + } + + return 0; +} + static const char *cmd_to_run = NULL; void Android_SetCommand(const char * cmd) {