mirror of
https://github.com/DrBeef/RTCWQuest.git
synced 2024-11-15 00:51:32 +00:00
Hacky Dual Wield solution
Increased vertex count to 6000 too
This commit is contained in:
parent
cd929657ab
commit
e9ba317825
5 changed files with 16 additions and 3 deletions
|
@ -1319,6 +1319,7 @@ void RTCWVR_Init()
|
|||
//Set up vr client info
|
||||
vr.backpackitemactive = 0;
|
||||
vr.visible_hud = qtrue;
|
||||
vr.dualwield = qfalse;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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 )
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue