Multiple Fixes..

- Improved scaling using correct scaling value
- Better placed PDA for use
- Slightly bigger enemy / human heads
- Two Handed Weapons!!
- Don't auto switch weapon on pickup
This commit is contained in:
Simon 2021-04-06 23:24:09 +01:00
parent 0a0847fd80
commit f1400afcd6
5 changed files with 38 additions and 19 deletions

View file

@ -227,7 +227,7 @@ void HandleInput_Default( int controlscheme, int switchsticks, ovrInputStateGame
//Turn on weapon stabilisation?
bool stabilised = false;
if (!pVRClientInfo->pistol && // Don't stabilise pistols
if (!pVRClientInfo->oneHandOnly && // Don't stabilise pistols
(pOffTrackedRemoteNew->Buttons & ovrButton_GripTrigger) && (distance < STABILISATION_DISTANCE))
{
stabilised = true;
@ -482,8 +482,9 @@ void HandleInput_Default( int controlscheme, int switchsticks, ovrInputStateGame
(offhandButtonsOld & ovrButton_Joystick)) &&
(offhandButtonsNew & ovrButton_Joystick)) {
Android_SetCommand("give all");
#ifdef DEBUG
Android_SetCommand("give all");
if(give_weapon_count == 1){
Android_SetCommand("give weapon_pistol");
give_weapon_count = give_weapon_count + 1;

View file

@ -3878,7 +3878,7 @@ void idPlayer::UpdateVrHud()
idAngles a(0, viewAngles.yaw - pVRClientInfo->hmdorientation[YAW], 0);
offpos *= a.ToMat3();
offpos *= vr_worldscale.GetFloat();
offpos *= ((100.0f / 2.54f) * vr_scale.GetFloat());
{
hudOrigin = viewOrigin + offpos;
@ -11588,7 +11588,7 @@ void idPlayer::UpdateFlashlightHolster()
idAngles a(0, viewAngles.yaw - pVRClientInfo->hmdorientation[YAW], 0);
holsterOffset *= a.ToMat3();
holsterOffset *= vr_worldscale.GetFloat();
holsterOffset *= ((100.0f / 2.54f) * vr_scale.GetFloat());
flashlightRenderEntity.origin = firstPersonViewOrigin + holsterOffset;
flashlightRenderEntity.entityNum = ENTITYNUM_NONE;
@ -11653,14 +11653,16 @@ void idPlayer::Think( void ) {
else {
pVRClientInfo->weaponid = -1;
}
cvarSystem->SetCVarBool("vr_weapon_stabilised", pVRClientInfo->weapon_stabilised);
int _currentWeapon = GetCurrentWeaponId();
if(_currentWeapon == WEAPON_FLASHLIGHT || _currentWeapon == WEAPON_FISTS)
pVRClientInfo->velocitytriggered = true;
else
pVRClientInfo->velocitytriggered = false;
pVRClientInfo->velocitytriggeredoffhand = true;
pVRClientInfo->pistol = GetCurrentWeaponId() == WEAPON_PISTOL;
pVRClientInfo->oneHandOnly = (_currentWeapon == WEAPON_FISTS) ||
(_currentWeapon == weapon_handgrenade);
}
// clear the ik before we do anything else so the skeleton doesn't get updated twice
@ -13264,7 +13266,7 @@ void idPlayer::CalculateViewWeaponPos( int hand, idVec3& origin, idMat3& axis )
idAngles a(0, viewAngles.yaw - pVRClientInfo->hmdorientation[YAW], 0);
gunpos *= a.ToMat3();
gunpos *= cvarSystem->GetCVarFloat( "vr_worldscale" );
gunpos *= ((100.0f / 2.54f) * vr_scale.GetFloat());
if (GetCurrentWeaponId( == WEAPON_FLASHLIGHT) // Flashlight adjustment
{
@ -13485,8 +13487,11 @@ void idPlayer::CalculateViewWeaponPosVR( int hand, idVec3 &origin, idMat3 &axis
commonVr->MotionControlGetHand( hand, hands[ hand ].motionPosition, hands[ hand ].motionRotation );
weaponPitch = idAngles( vr_motionWeaponPitchAdj.GetFloat(), 0.0f, 0.0f ).ToQuat();
hands[ hand ].motionRotation = weaponPitch * hands[ hand ].motionRotation;
if (!pVRClientInfo->weapon_stabilised)
{
weaponPitch = idAngles( vr_motionWeaponPitchAdj.GetFloat(), 0.0f, 0.0f ).ToQuat();
hands[hand].motionRotation = weaponPitch * hands[hand].motionRotation;
}
GetViewPos( weapOrigin, weapAxis );
@ -13758,6 +13763,10 @@ void idPlayer::CalculateViewFlashlightPos( idVec3 &origin, idMat3 &axis, idVec3
axis = idAngles( 0.0, viewAngles.yaw - commonVr->bodyYawOffset, 0.0f ).ToMat3();
int flashlightMode = commonVr->GetCurrentFlashlightMode();
if (pVRClientInfo->weapon_stabilised && flashlightMode == FLASHLIGHT_HAND )
{
flashlightMode = FLASHLIGHT_GUN;
}
setLeftHand = false;
//move the flashlight to alternate location for items with no mount
@ -14041,7 +14050,7 @@ idVec3 idPlayer::GetEyePosition( void ) const {
if (pVRClientInfo)
{
float eyeHeight = 0;
float vrEyeHeight = (-(pVRClientInfo->hmdposition[1] + vr_heightoffset.GetFloat()) * vr_worldscale.GetFloat());
float vrEyeHeight = (-(pVRClientInfo->hmdposition[1] + vr_heightoffset.GetFloat()) * ((100.0f / 2.54f) * vr_scale.GetFloat()));
//Add special handling for physical crouching at some point
if (physicsObj.IsCrouching() && PHYSICAL_CROUCH) {

View file

@ -2082,6 +2082,8 @@ void idWeapon::BeginAttack( void ) {
int position = vr_weaponHand.GetInteger() ? 1 : 2;
vrClientInfo *pVRClientInfo = owner->GetVRClientInfo();
weapon_t currentWeapon = WEAPON_NONE;
currentWeapon = IdentifyWeapon();
if (currentWeapon == WEAPON_HANDGRENADE)
@ -2090,16 +2092,13 @@ void idWeapon::BeginAttack( void ) {
}
if (currentWeapon == WEAPON_CHAINGUN)
{
common->HapticEvent("chaingun_init", position, 0, 100, 0, 0);
position = pVRClientInfo->weapon_stabilised ? 4 : position;
common->HapticEvent("chaingun_init", position, 0, 100, 0, 0);
}
if (currentWeapon == WEAPON_BFG)
{
common->HapticEvent("bfg_init", position, 0, 100, 0, 0);
}
if (currentWeapon == WEAPON_HANDGRENADE)
{
common->HapticEvent("grenade_init", position, 0, 100, 0, 0);
}
}
/*
@ -4050,16 +4049,21 @@ void idWeapon::Event_LaunchProjectiles( int num_projectiles, float spread, float
int position = vr_weaponHand.GetInteger() ? 1 : 2;
vrClientInfo *pVRClientInfo = owner->GetVRClientInfo();
if (currentWeap == WEAPON_PISTOL)
{
position = pVRClientInfo->weapon_stabilised ? 4 : position;
common->HapticEvent("pistol_fire", position, 0, 100, 0, 0);
}
if (currentWeap == WEAPON_SHOTGUN)
{
position = pVRClientInfo->weapon_stabilised ? 4 : position;
common->HapticEvent("shotgun_fire", position, 0, 100, 0, 0);
}
if (currentWeap == WEAPON_PLASMAGUN)
{
position = pVRClientInfo->weapon_stabilised ? 4 : position;
common->HapticEvent("plasmagun_fire", position, 0, 100, 0, 0);
}
if (currentWeap == WEAPON_HANDGRENADE)
@ -4068,10 +4072,12 @@ void idWeapon::Event_LaunchProjectiles( int num_projectiles, float spread, float
}
if (currentWeap == WEAPON_MACHINEGUN)
{
position = pVRClientInfo->weapon_stabilised ? 4 : position;
common->HapticEvent("machinegun_fire", position, 0, 100, 0, 0);
}
if (currentWeap == WEAPON_CHAINGUN)
{
position = pVRClientInfo->weapon_stabilised ? 4 : position;
common->HapticEvent("chaingun_fire", position, 0, 100, 0, 0);
}
if (currentWeap == WEAPON_BFG)
@ -4080,6 +4086,7 @@ void idWeapon::Event_LaunchProjectiles( int num_projectiles, float spread, float
}
if (currentWeap == WEAPON_ROCKETLAUNCHER)
{
position = pVRClientInfo->weapon_stabilised ? 4 : position;
common->HapticEvent("rocket_fire", position, 0, 100, 0, 0);
}
@ -4136,7 +4143,7 @@ void idWeapon::Event_LaunchProjectiles( int num_projectiles, float spread, float
pVRClientInfo->throw_origin[1]);
idAngles a(0, owner->viewAngles.yaw - pVRClientInfo->hmdorientation[YAW], 0);
releaseOffset *= a.ToMat3();
releaseOffset *= cvarSystem->GetCVarFloat( "vr_worldscale" );
releaseOffset *= ((100.0f / 2.54f) * vr_scale.GetFloat());
muzzle_pos = owner->firstPersonViewOrigin + releaseOffset;
idVec3 throw_direction( -pVRClientInfo->throw_trajectory[2],
@ -4240,6 +4247,8 @@ void idWeapon::Event_Melee( void ) {
gameLocal.Error( "No meleeDef on '%s'", weaponDef->dict.GetString( "classname" ) );
}
vrClientInfo *pVRClientInfo = owner->GetVRClientInfo();
weapon_t currentWeapon = IdentifyWeapon();
if (currentWeapon == WEAPON_FISTS)
{

View file

@ -239,7 +239,7 @@ seta vr_pdaPosZ "5.0"
seta vr_pdaPosY "4.0"
seta vr_pdaPosX "6.0"
seta vr_headbbox "10.0"
seta vr_walkSpeedAdjust "20.0"
seta vr_walkSpeedAdjust "0.0"
seta vr_stepSmooth "1"
seta vr_jumpBounce "0"
seta vr_3dgui "1"

View file

@ -106,7 +106,7 @@ seta com_product_lang_ext "1"
seta com_showFPS "0"
seta com_purgeAll "1"
seta vr_msaa "2"
seta vr_supersampling "1.1"
seta vr_supersampling "1.2"
seta vr_refresh "60"
seta r_scaleMenusTo43 "1"
seta r_debugArrowStep "120"
@ -239,7 +239,7 @@ seta vr_pdaPosZ "5.0"
seta vr_pdaPosY "4.0"
seta vr_pdaPosX "6.0"
seta vr_headbbox "10.0"
seta vr_walkSpeedAdjust "20.0"
seta vr_walkSpeedAdjust "0.0"
seta vr_stepSmooth "1"
seta vr_jumpBounce "0"
seta vr_3dgui "1"