Various changes in prep for 1.1.0

removed "ironsight lock" as that was pretty rubbish
default r_gamma to 1.1
Tweak offset of virtual stock to line up with dominant hand/eye
force copy of weapon pak for now
This commit is contained in:
Simon 2020-09-01 19:27:10 +01:00
parent 00e55cca84
commit 9229db9fe2
14 changed files with 32 additions and 174 deletions

View file

@ -1340,8 +1340,6 @@ void RTCWVR_Init()
vr.backpackitemactive = 0;
vr.visible_hud = qtrue;
vr.dualwield = qfalse;
vr.ironsight_lock_weapon = qfalse;
vr.ironsight_lock_engaged = qfalse;
//Clear teleport stuff
vr.teleportexecute = qfalse;
@ -1613,7 +1611,7 @@ void RTCWVR_getHMDOrientation() {//Get 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};
vec3_t rotation = {0, 0, 0};
QuatToYawPitchRoll(quatHmd, rotation, vr.hmdorientation);
setHMDPosition(positionHmd.x, positionHmd.y, positionHmd.z);

View file

@ -43,12 +43,6 @@ typedef struct {
qboolean scopedetached; // Scope has been detached from weapon
qboolean detachablescope; // Scope can be detached from weapon
//Virtual Stock stuff
qboolean ironsight_lock_weapon; // Weapon can be used with ironsight lock mode
qboolean ironsight_lock_engaged; // Ironsight Lock is engaged
vec3_t ironsight_lock_offset; // The weapon offset location when iron sight lock is engaged (set by cgame Weapon code)
vec3_t vstock_shoulder; // The pivot point (shoulder) when classic virtual stock is used (instead of the dominant controller)
qboolean hasbinoculars;
qboolean velocitytriggered; // Weapon attack triggered by velocity (knife)

View file

@ -122,18 +122,6 @@ void acquireTrackedRemotesData(const ovrMobile *Ovr, double displayTime) {//The
}
}
void CalculateShoulderPosition()
{
VectorCopy(vr.hmdposition, vr.vstock_shoulder);
//Adjust to shoulder location for when vstock was engaged
vr.vstock_shoulder[1] -= 0.12f;
//offset to the appropriate shoulder a little bit
vec2_t xy;
rotateAboutOrigin(0.07f, 0.0f, -vr.hmdorientation[YAW], xy);
vr.vstock_shoulder[0] += xy[0];
vr.vstock_shoulder[2] += xy[1];
}
//YAW: Left increase, Right decrease
void updateScopeAngles()
@ -141,20 +129,10 @@ 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 (vr.scopeengaged || vr.ironsight_lock_engaged)
if (vr.scopeengaged)
{
if (vr.ironsight_lock_engaged)
{
//Copy weapon offset X
vr.calculated_weaponoffset[0] = vr.ironsight_lock_offset[1];
vr.calculated_weaponoffset[1] = vr.ironsight_lock_offset[2];
vr.calculated_weaponoffset[2] = vr.ironsight_lock_offset[0];
}
else
{
//Clear weapon offset
VectorSet(vr.calculated_weaponoffset, 0, 0, 0);
}
//Clear weapon offset
VectorSet(vr.calculated_weaponoffset, 0, 0, 0);
VectorSet(currentScopeAngles, vr.weaponangles[PITCH], vr.weaponangles[YAW], vr.hmdorientation[ROLL]);

View file

@ -21,7 +21,6 @@ Authors : Simon Brown
#include <src/client/client.h>
#define WP_AKIMBO 20
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 );
@ -167,27 +166,12 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
//Turn on weapon stabilisation?
qboolean stabilised = qfalse;
if (vr.pistol)
{
//For pistols, it is simply a case of holding the two controllers close together
if (distance < (STABILISATION_DISTANCE / 3.0f))
{
stabilised = qtrue;
}
if (vr.weapon_stabilised != stabilised) {
// blip to let user know they are stabilised
RTCWVR_Vibrate(100, 0, 0.4);
RTCWVR_Vibrate(100, 1, 0.4);
}
}
else if ((pOffTrackedRemoteNew->Buttons & ovrButton_GripTrigger) && (distance < STABILISATION_DISTANCE))
if (!vr.pistol && // Don't stabilise pistols
(pOffTrackedRemoteNew->Buttons & ovrButton_GripTrigger) && (distance < STABILISATION_DISTANCE))
{
stabilised = qtrue;
}
CalculateShoulderPosition();
vr.weapon_stabilised = stabilised;
//Engage scope / virtual stock if conditions are right
@ -208,16 +192,6 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
}
//Engage scope / virtual stock (iron sight lock) if conditions are right
qboolean vstockReady = vr.weapon_stabilised && (distanceToHMD < VSTOCK_ENGAGE_DISTANCE) &&
(vr.ironsight_lock_weapon && vr_virtual_stock->integer >= 2);
if (vstockReady != vr.ironsight_lock_engaged) {
vr.ironsight_lock_engaged = vstockReady;
//Resync on either transition
RTCWVR_ResyncClientYawWithGameYaw();
}
static qboolean scopeEngaged = qfalse;
if (scopeEngaged != vr.scopeengaged)
{
@ -256,18 +230,8 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
vr.current_weaponoffset[2] = pWeapon->HeadPose.Pose.Position.z - vr.hmdposition[2];
vr.current_weaponoffset_timestamp = Sys_Milliseconds( );
//Lerp (stabilises pistol)
if (vr.pistol && vr.weapon_stabilised)
{
//First update current weapon offset with average of the two controller positions
VectorLerp(vr.offhandoffset, 0.5f, vr.current_weaponoffset, vr.current_weaponoffset);
//Now lerp with previous position to smooth it out
VectorLerp(vr.weaponoffset_history[0], 0.5f, vr.current_weaponoffset, vr.calculated_weaponoffset);
}
else
{
VectorCopy(vr.current_weaponoffset, vr.calculated_weaponoffset);
}
//Just copy to calculated offset, used to use this in case we wanted to apply any modifiers, but don't any more
VectorCopy(vr.current_weaponoffset, vr.calculated_weaponoffset);
//Does weapon velocity trigger attack (knife) and is it fast enough
static qboolean velocityTriggeredAttack = false;
@ -294,14 +258,17 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
sendButtonAction("+attack", velocityTriggeredAttack);
}
//Don't do this for pistols
if (!vr.pistol && (vr.weapon_stabilised || vr.dualwield))
if (vr.weapon_stabilised || vr.dualwield)
{
if (vr.scopeengaged || vr.ironsight_lock_engaged)
if (vr.scopeengaged || (vr_virtual_stock->integer == 1 && // Classic Virtual Stock
!vr.dualwield))
{
float x = pOff->HeadPose.Pose.Position.x - vr.hmdposition[0];
//offset to the appropriate eye a little bit
vec2_t xy;
rotateAboutOrigin(Cvar_VariableValue("cg_stereoSeparation") / 2.0f, 0.0f, -vr.hmdorientation[YAW], xy);
float x = pOff->HeadPose.Pose.Position.x - (vr.hmdposition[0] + xy[0]);
float y = pOff->HeadPose.Pose.Position.y - (vr.hmdposition[1] - 0.1f); // Use a point lower
float z = pOff->HeadPose.Pose.Position.z - vr.hmdposition[2];
float z = pOff->HeadPose.Pose.Position.z - (vr.hmdposition[2] + xy[1]);
float zxDist = length(x, z);
if (zxDist != 0.0f && z != 0.0f) {
@ -309,18 +276,6 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
-degrees(atan2f(x, -z)), 0);
}
}
else if (vr_virtual_stock->integer == 1) // Classic Virtual Stock
{
float x = pOff->HeadPose.Pose.Position.x - vr.vstock_shoulder[0];
float y = pOff->HeadPose.Pose.Position.y - vr.vstock_shoulder[1];
float z = pOff->HeadPose.Pose.Position.z - vr.vstock_shoulder[2];
float zxDist = length(x, z);
if (zxDist != 0.0f && z != 0.0f) {
VectorSet(vr.weaponangles, -degrees(atanf(y / zxDist)),
-degrees(atan2f(x, -z)), 0); // No roll on virtual stock
}
}
else
{
float x = pOff->HeadPose.Pose.Position.x - pWeapon->HeadPose.Pose.Position.x;
@ -342,11 +297,6 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
}
}
}
else if (vr.pistol && vr.weapon_stabilised)
{
//No roll if pistol is being stabilised with off-hand
vr.weaponangles[ROLL] = 0;
}
static bool finishReloadNextFrame = false;
if (finishReloadNextFrame)

View file

@ -3684,8 +3684,7 @@ void CG_DrawActive( int stereoView ) {
int vStock = trap_Cvar_VariableIntegerValue("vr_virtual_stock");
int vr_cinematic_stereo = trap_Cvar_VariableIntegerValue( "vr_cinematic_stereo");
if ( !cgVR->scopeengaged &&
(!cg.cameraMode || (cg.cameraMode && vr_cinematic_stereo)) &&
!(cgVR->ironsight_lock_engaged && vStock == 2))
(!cg.cameraMode || (cg.cameraMode && vr_cinematic_stereo)))
{
VectorMA( cg.refdef.vieworg, -separation, cg.refdef.viewaxis[1], cg.refdef.vieworg );
}

View file

@ -274,29 +274,6 @@ int weapBanksMultiPlayer[MAX_WEAP_BANKS_MP][MAX_WEAPS_IN_BANK_MP] = {
//----(SA) end
//These are in real world units (metres)
float virtualStockOffsets[WP_SILENCER][3] = {
//Yaw Adjust Up Forward
{0, 0, 0} ,//WP_NONE,
{0, 0, 0} ,//WP_KNIFE,
{0, 0, 0} ,//WP_LUGER,
{0, -0.108f, -0.3f} ,//WP_MP40,
{0, -0.08f, -0.35f} ,//WP_MAUSER,
{0.4f, -0.12f, -0.25f} ,//WP_FG42, - needs a slight yaw tweak
{0, 0, 0} ,//WP_GRENADE_LAUNCHER,
{0, 0, 0} ,//WP_PANZERFAUST,
{0, 0, 0} ,//WP_VENOM,
{0, 0, 0} ,//WP_FLAMETHROWER,
{0, 0, 0} ,//WP_TESLA,
{0, 0, 0} ,//WP_COLT,
{0, -0.108f, -0.3f} ,//WP_THOMPSON,
{0, 0, 0} ,//WP_GARAND,
{0, 0, 0} ,//WP_GRENADE_PINEAPPLE,
{0, 0, 0} ,//WP_SNIPERRIFLE,
{0, 0, 0} ,//WP_SNOOPERSCOPE,
{0, 0, 0} ,//WP_FG42SCOPE,
{0, -0.06f, -0.24f}//WP_STEN,
};
/*
==============
@ -2091,10 +2068,6 @@ static float CG_CalculateWeaponPositionAndScale( playerState_t *ps, vec3_t origi
&(adjust[PITCH]), &(adjust[YAW]), &(adjust[ROLL]));
VectorScale(temp_offset, scale, offset);
if (cgVR->ironsight_lock_engaged) {
adjust[YAW] += virtualStockOffsets[ps->weapon][0];
}
if (!cgVR->right_handed)
{
//yaw needs to go in the other direction as left handed model is reversed
@ -3666,14 +3639,13 @@ void CG_AddViewWeapon( playerState_t *ps ) {
case WP_KNIFE:
cgVR->velocitytriggered = qtrue;
cgVR->scopedweapon = qfalse;
cgVR->ironsight_lock_weapon = qfalse;
break;
case WP_LUGER:
case WP_SILENCER:
case WP_COLT:
case WP_AKIMBO:
cgVR->velocitytriggered = qfalse;
cgVR->scopedweapon = qfalse;
cgVR->ironsight_lock_weapon = qfalse;
cgVR->pistol = qtrue;
break;
case WP_FG42:
@ -3681,14 +3653,6 @@ void CG_AddViewWeapon( playerState_t *ps ) {
cgVR->velocitytriggered = qfalse;
cgVR->scopedweapon = qtrue;
cgVR->detachablescope = qtrue;
cgVR->ironsight_lock_weapon = cgVR->scopedetached; // only available when not scoped
break;
case WP_THOMPSON:
case WP_STEN:
case WP_MP40:
cgVR->velocitytriggered = qfalse;
cgVR->scopedweapon = qfalse;
cgVR->ironsight_lock_weapon = qtrue; // only available when not scoped
break;
case WP_GARAND:
case WP_SNOOPERSCOPE:
@ -3698,38 +3662,13 @@ void CG_AddViewWeapon( playerState_t *ps ) {
cgVR->scopedweapon = qtrue;
cgVR->scopedetached = qfalse;
cgVR->detachablescope = qfalse;
cgVR->ironsight_lock_weapon = qfalse;
break;
default:
cgVR->velocitytriggered = qfalse;
cgVR->scopedweapon = qfalse;
cgVR->ironsight_lock_weapon = qfalse;
break;
}
int controlScheme = trap_Cvar_VariableIntegerValue("vr_control_scheme");
int vStock = trap_Cvar_VariableIntegerValue("vr_virtual_stock");
if (vStock >= 2) {
float multiplier = (controlScheme == 0 ? -1.0f : 1.0f);
vec3_t offset;
VectorClear(offset);
vec3_t orientation;
VectorCopy(cgVR->hmdorientation, orientation);
orientation[PITCH] *= -1.0f;
orientation[ROLL] = 0;
vec3_t forward, right, up;
AngleVectors(orientation, forward, right, up);
if (vStock == 3)
VectorMA(offset, (cg_stereoSeparation.value / 2.0f) * multiplier, right, offset);
VectorMA(offset, virtualStockOffsets[ps->weapon][1], up, offset);
VectorMA(offset, virtualStockOffsets[ps->weapon][2], forward, offset);
VectorCopy(offset, cgVR->ironsight_lock_offset);
}
// add everything onto the hand
CG_AddPlayerWeapon(&hand, ps, &cg.predictedPlayerEntity);
// Ridah

View file

@ -623,9 +623,9 @@ int G_GetWeaponDamage( int weapon ) {
if ( g_gametype.integer == GT_SINGLE_PLAYER ) {
switch ( weapon ) {
case WP_LUGER:
case WP_SILENCER: return 6;
case WP_COLT: return 8;
case WP_AKIMBO: return 8; //----(SA) added
case WP_SILENCER:
case WP_COLT:
case WP_AKIMBO: return 10; //---- Make pistols a little more powerful for VR
case WP_VENOM: return 12; // 15 ----(SA) slight modify for DM
case WP_MP40: return 6;
case WP_THOMPSON: return 8;
@ -637,7 +637,7 @@ int G_GetWeaponDamage( int weapon ) {
case WP_SNIPERRIFLE: return 55;
case WP_SNOOPERSCOPE: return 25;
case WP_NONE: return 0;
case WP_KNIFE: return 5;
case WP_KNIFE: return 8; // Increase knife as it is harder to stab in VR
case WP_GRENADE_LAUNCHER: return 100;
case WP_GRENADE_PINEAPPLE: return 80;
case WP_DYNAMITE: return 400;
@ -695,10 +695,10 @@ float G_GetWeaponSpread( int weapon ) {
if ( g_userAim.integer ) {
// these should be higher since they become erratic if aiming is out
switch ( weapon ) {
case WP_LUGER: return 200;
case WP_SILENCER: return 200;//900; // make silencer as accurate as luger
case WP_COLT: return 200;//600; // make colt as accurate as luger for VR
case WP_AKIMBO: return 700; //----(SA) added
case WP_LUGER: return 10; // Make pistols aim-accuracy up to user
case WP_SILENCER: return 10;
case WP_COLT: return 10;
case WP_AKIMBO: return 10;
case WP_VENOM: return 1000;
case WP_MP40: return 800;
case WP_FG42SCOPE: return 100;

View file

@ -1109,7 +1109,7 @@ void R_Register( void ) {
r_finish = ri.Cvar_Get( "r_finish", "0", CVAR_ARCHIVE );
r_textureMode = ri.Cvar_Get( "r_textureMode", "GL_LINEAR_MIPMAP_LINEAR", CVAR_ARCHIVE );
r_swapInterval = ri.Cvar_Get( "r_swapInterval", "0", CVAR_ARCHIVE );
r_gamma = ri.Cvar_Get( "r_gamma", "1.0", CVAR_ARCHIVE );
r_gamma = ri.Cvar_Get( "r_gamma", "1.1", CVAR_ARCHIVE );
r_facePlaneCull = ri.Cvar_Get( "r_facePlaneCull", "1", CVAR_ARCHIVE );
r_railWidth = ri.Cvar_Get( "r_railWidth", "16", CVAR_ARCHIVE );

View file

@ -280,7 +280,7 @@ itemDef
text "Virtual Stock:"
type ITEM_TYPE_MULTI
cvar "vr_virtual_stock"
cvarFloatList {"Off" 0 "Classic" 1 "Ironsight Lock (Mono)" 2 "Ironsight Lock (Stereo)" 3 }
cvarFloatList {"Off" 0 "Classic" 1 }
rect 82 165 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142

View file

@ -253,7 +253,7 @@ itemDef
text "Virtual Stock:"
type ITEM_TYPE_MULTI
cvar "vr_virtual_stock"
cvarFloatList {"Off" 0 "Classic" 1 "Ironsight Lock (Mono)" 2 "Ironsight Lock (Stereo)" 3 }
cvarFloatList {"Off" 0 "Classic" 1 }
rect 82 165 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142

View file

@ -330,7 +330,7 @@ itemDef {
group grpOptions
type ITEM_TYPE_SLIDER
text "Brightness:"
cvarfloat "r_gamma" 1.3 .5 3
cvarfloat "r_gamma" 1 0.5 3
rect 82 125 290 12
// rect 72 220 290 12
textalign ITEM_ALIGN_RIGHT

View file

@ -342,7 +342,7 @@ open in_rec_restart_popmenu ; hide graphics ; hide graphicsapply}
group grpSystem
type ITEM_TYPE_SLIDER
text "Brightness:"
cvarfloat "r_gamma" 1.3 .5 3
cvarfloat "r_gamma" 1 0.5 3
rect 82 235 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142

Binary file not shown.

View file

@ -168,7 +168,7 @@ import static android.system.Os.setenv;
copy_asset("/sdcard/RTCWQuest/Main", "pak0.pk3", false);
//and the vr weapons
copy_asset("/sdcard/RTCWQuest/Main", "z_zvr_weapons.pk3", false);
copy_asset("/sdcard/RTCWQuest/Main", "z_zvr_weapons.pk3", true);
//and the vr menu pk3
copy_asset("/sdcard/RTCWQuest/Main", "z_rtcwquest_vrmenu.pk3", true);