mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-29 23:32:23 +00:00
Changed wepaon wheel to use orientation
just feels a lot smoother to use
This commit is contained in:
parent
8bc72f8716
commit
27b1037c03
2 changed files with 29 additions and 24 deletions
|
@ -2,8 +2,8 @@
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.drbeef.ioq3quest"
|
package="com.drbeef.ioq3quest"
|
||||||
android:installLocation="preferExternal"
|
android:installLocation="preferExternal"
|
||||||
android:versionCode="28"
|
android:versionCode="29"
|
||||||
android:versionName="0.20.0">
|
android:versionName="0.21.0">
|
||||||
<uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" />
|
<uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" />
|
||||||
<uses-feature android:glEsVersion="0x00030001" />
|
<uses-feature android:glEsVersion="0x00030001" />
|
||||||
<!-- <uses-feature android:name="oculus.software.overlay_keyboard" android:required="false"/>-->
|
<!-- <uses-feature android:name="oculus.software.overlay_keyboard" android:required="false"/>-->
|
||||||
|
|
|
@ -2043,32 +2043,42 @@ void CG_DrawHolsteredWeapons( void )
|
||||||
VectorCopy(vr->weaponoffset, cg.weaponHolsterOffset);
|
VectorCopy(vr->weaponoffset, cg.weaponHolsterOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float worldscale = trap_Cvar_VariableValue("vr_worldscale");
|
||||||
|
|
||||||
float SCALE = 0.04f;
|
float SCALE = 0.04f;
|
||||||
const float DIST = 4.2f;
|
const float DIST = 5.0f;
|
||||||
const float SEP = 360.0f / (WP_NUM_WEAPONS - 1); // Exclude grappling hook
|
const float SEP = 360.0f / (WP_NUM_WEAPONS - 1); // Exclude grappling hook
|
||||||
|
float frac = (cg.time - cg.weaponHolsterTime) / (50 * DIST);
|
||||||
|
if (frac > 1.0f) frac = 1.0f;
|
||||||
|
|
||||||
vec3_t controllerOrigin, controllerAngles;
|
vec3_t controllerOrigin, controllerAngles, controllerOffset, selectorOrigin;
|
||||||
CG_CalculateVRWeaponPosition(controllerOrigin, controllerAngles);
|
CG_CalculateVRWeaponPosition(controllerOrigin, controllerAngles);
|
||||||
|
VectorSubtract(vr->weaponposition, cg.weaponHolsterOrigin, controllerOffset);
|
||||||
{
|
|
||||||
refEntity_t blob;
|
|
||||||
memset( &blob, 0, sizeof( blob ) );
|
|
||||||
VectorCopy( controllerOrigin, blob.origin );
|
|
||||||
AnglesToAxis(vec3_origin, blob.axis);
|
|
||||||
VectorScale( blob.axis[0], SCALE - 0.01f, blob.axis[0] );
|
|
||||||
VectorScale( blob.axis[1], SCALE - 0.01f, blob.axis[1] );
|
|
||||||
VectorScale( blob.axis[2], SCALE - 0.01f, blob.axis[2] );
|
|
||||||
blob.nonNormalizedAxes = qtrue;
|
|
||||||
blob.hModel = cgs.media.smallSphereModel;
|
|
||||||
trap_R_AddRefEntityToScene( &blob );
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3_t holsterAngles, holsterOrigin, holsterForward, holsterRight, holsterUp, dummy;
|
vec3_t holsterAngles, holsterOrigin, holsterForward, holsterRight, holsterUp, dummy;
|
||||||
CG_CalculateVRPositionInWorld(cg.weaponHolsterOrigin, cg.weaponHolsterOffset, cg.weaponHolsterAngles, holsterOrigin, holsterAngles);
|
CG_CalculateVRPositionInWorld(cg.weaponHolsterOrigin, cg.weaponHolsterOffset, cg.weaponHolsterAngles, holsterOrigin, holsterAngles);
|
||||||
|
|
||||||
AngleVectors(holsterAngles, holsterForward, holsterRight, holsterUp);
|
AngleVectors(holsterAngles, holsterForward, holsterRight, holsterUp);
|
||||||
|
|
||||||
//VectorMA(holsterOrigin, -2.0f, holsterForward, holsterOrigin);
|
VectorMA(holsterOrigin, (DIST*frac), holsterForward, holsterOrigin);
|
||||||
|
VectorCopy(holsterOrigin, selectorOrigin);
|
||||||
|
|
||||||
|
VectorMA(selectorOrigin, DIST * ((holsterAngles[YAW] - controllerAngles[YAW]) / 22.5f), holsterRight, selectorOrigin);
|
||||||
|
VectorMA(selectorOrigin, DIST * ((holsterAngles[PITCH] - controllerAngles[PITCH]) / 22.5f), holsterUp, selectorOrigin);
|
||||||
|
|
||||||
|
{
|
||||||
|
refEntity_t blob;
|
||||||
|
memset( &blob, 0, sizeof( blob ) );
|
||||||
|
VectorCopy( selectorOrigin, blob.origin );
|
||||||
|
AnglesToAxis(vec3_origin, blob.axis);
|
||||||
|
VectorScale( blob.axis[0], SCALE - 0.01f, blob.axis[0] );
|
||||||
|
VectorScale( blob.axis[1], SCALE - 0.01f, blob.axis[1] );
|
||||||
|
VectorScale( blob.axis[2], SCALE - 0.01f, blob.axis[2] );
|
||||||
|
blob.nonNormalizedAxes = qtrue;
|
||||||
|
blob.hModel = cgs.media.smallSphereModel;
|
||||||
|
trap_R_AddRefEntityToScene( &blob );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//float startingPositionYaw = AngleNormalize360(holsterAngles[YAW] + (((WP_NUM_WEAPONS-2)/2.0f) * SEP));
|
//float startingPositionYaw = AngleNormalize360(holsterAngles[YAW] + (((WP_NUM_WEAPONS-2)/2.0f) * SEP));
|
||||||
qboolean selected = qfalse;
|
qboolean selected = qfalse;
|
||||||
|
@ -2091,17 +2101,12 @@ void CG_DrawHolsteredWeapons( void )
|
||||||
vec3_t forward, up;
|
vec3_t forward, up;
|
||||||
AngleVectors(angles, forward, NULL, up);
|
AngleVectors(angles, forward, NULL, up);
|
||||||
|
|
||||||
float frac = (cg.time - cg.weaponHolsterTime) / (60 * DIST);
|
|
||||||
if (frac > 1.0f) frac = 1.0f;
|
|
||||||
|
|
||||||
VectorMA(holsterOrigin, (DIST*frac), up, iconOrigin);
|
VectorMA(holsterOrigin, (DIST*frac), up, iconOrigin);
|
||||||
VectorMA(iconOrigin, 0.01f, forward, iconBackground);
|
VectorMA(iconOrigin, 0.01f, forward, iconBackground);
|
||||||
|
|
||||||
float worldscale = trap_Cvar_VariableValue("vr_worldscale");
|
|
||||||
|
|
||||||
//Float sprite above selected weapon
|
//Float sprite above selected weapon
|
||||||
vec3_t diff;
|
vec3_t diff;
|
||||||
VectorSubtract(controllerOrigin, iconOrigin, diff);
|
VectorSubtract(selectorOrigin, iconOrigin, diff);
|
||||||
float length = VectorLength(diff);
|
float length = VectorLength(diff);
|
||||||
if (length <= 1.5f &&
|
if (length <= 1.5f &&
|
||||||
frac == 1.0f &&
|
frac == 1.0f &&
|
||||||
|
|
Loading…
Reference in a new issue