Hacky Dual Wield solution

Increased vertex count to 6000 too
This commit is contained in:
Simon 2020-07-16 23:52:04 +01:00
parent cd929657ab
commit e9ba317825
5 changed files with 16 additions and 3 deletions

View file

@ -1319,6 +1319,7 @@ void RTCWVR_Init()
//Set up vr client info
vr.backpackitemactive = 0;
vr.visible_hud = qtrue;
vr.dualwield = qfalse;
}

View file

@ -9,6 +9,7 @@ typedef struct {
qboolean right_handed;
qboolean player_moving;
qboolean visible_hud;
qboolean dualwield;
int weaponid;
int lastweaponid;
int backpackitemactive; //0 - nothing, 1 - grenades, 2 - knife, 3 - Binoculars

View file

@ -191,7 +191,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
}
}
if (vr.weapon_stabilised)
if (vr.weapon_stabilised || vr.dualwield)
{
float z = pOffTracking->HeadPose.Pose.Position.z - pDominantTracking->HeadPose.Pose.Position.z;
float x = pOffTracking->HeadPose.Pose.Position.x - pDominantTracking->HeadPose.Pose.Position.x;
@ -199,7 +199,16 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
float zxDist = length(x, z);
if (zxDist != 0.0f && z != 0.0f) {
VectorSet(vr.weaponangles, -degrees(atanf(y / zxDist)), -degrees(atan2f(x, -z)), vr.weaponangles[ROLL]);
if (vr.dualwield) {
//SUPER FUDGE
VectorSet(vr.weaponangles, vr.weaponangles[PITCH],
-90.0f-degrees(atan2f(x, -z)), degrees(atanf(y / zxDist)));
}
else
{
VectorSet(vr.weaponangles, -degrees(atanf(y / zxDist)),
-degrees(atan2f(x, -z)), vr.weaponangles[ROLL]);
}
}
}

View file

@ -4326,6 +4326,8 @@ void CG_FinishWeaponChange( int lastweap, int newweap ) {
}
}
cgVR->dualwield = (newweap == WP_AKIMBO);
cg.weaponSelect = newweap;
cgVR->weaponid = newweap; //Store in case we use backpack
}

View file

@ -35,7 +35,7 @@ If you have questions concerning this license or the applicable additional terms
//
// surface geometry should not exceed these limits
#define SHADER_MAX_VERTEXES 4000
#define SHADER_MAX_VERTEXES 6000
#define SHADER_MAX_INDEXES ( 6 * SHADER_MAX_VERTEXES )