diff --git a/source/common/rendering/hwrenderer/data/hw_vrmodes.cpp b/source/common/rendering/hwrenderer/data/hw_vrmodes.cpp index cd3a0d9b7..d84c589e0 100644 --- a/source/common/rendering/hwrenderer/data/hw_vrmodes.cpp +++ b/source/common/rendering/hwrenderer/data/hw_vrmodes.cpp @@ -75,14 +75,14 @@ CVAR(Float, vr_height_adjust, 0.0f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) // METERS CVAR(Int, vr_control_scheme, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) CVAR(Bool, vr_move_use_offhand, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Float, vr_weaponPitchAdjust, 20.0f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) -CVAR(Float, vr_weaponYawAdjust, 5.0f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CVAR(Float, vr_weaponYawAdjust, 6.0f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Bool, vr_allowPitchOverride, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Float, vr_snapTurn, 45.0f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Int, vr_move_speed, 19, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Float, vr_run_multiplier, 1.5, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Bool, vr_switch_sticks, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Bool, vr_secondary_button_mappings, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) -CVAR(Bool, vr_two_handed_weapons, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CVAR(Bool, vr_two_handed_weapons, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Bool, vr_positional_tracking, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Bool, vr_crouch_use_button, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Bool, vr_6dof_weapons, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) @@ -98,7 +98,8 @@ CVAR(Float, vr_hud_rotate, 0.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Bool, vr_hud_fixed_pitch, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Bool, vr_hud_fixed_roll, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) -int playerHeight = 0; +float playerHeight = 0; +float heightScaler = 1.0f; extern int g_gameType; @@ -168,7 +169,7 @@ float getHmdAdjustedHeightInMapUnit() if (playerHeight != 0) { return ((hmdPosition[1] + vr_height_adjust) * vr_hunits_per_meter()) - - playerHeight; + (playerHeight * (heightScaler != 1.0f ? (1.0f - heightScaler) : 1.0f)); } //Just use offset from origin @@ -404,7 +405,7 @@ bool VR_GetVRProjection(int eye, float zNear, float zFar, float* projection); VSMatrix VREyeInfo::GetStereoProjection(float fov, float aspectRatio, float fovRatio) const { VSMatrix projection = GetCenterProjection(fov, aspectRatio, fovRatio); - projection.translate(getStereoSeparation(1.0f), 0, 0); + projection.translate(getStereoSeparation(1.0f) * heightScaler, 0, 0); return projection; } diff --git a/source/games/blood/src/blood.cpp b/source/games/blood/src/blood.cpp index 1fbb9bb44..3aca39a04 100644 --- a/source/games/blood/src/blood.cpp +++ b/source/games/blood/src/blood.cpp @@ -51,7 +51,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "tilesetbuilder.h" #include "nnexts.h" -extern int playerHeight; //Used to define player height for VR +extern float playerHeight; //Used to define player height for VR BEGIN_BLD_NS diff --git a/source/games/duke/src/flags_r.cpp b/source/games/duke/src/flags_r.cpp index c5fcecad2..76581df4c 100644 --- a/source/games/duke/src/flags_r.cpp +++ b/source/games/duke/src/flags_r.cpp @@ -30,7 +30,7 @@ Prepared for public release, 03/21/2003 - Charlie Wiederhold, 3D Realms #include "global.h" #include "names_r.h" -extern int playerHeight; +extern float playerHeight; BEGIN_DUKE_NS diff --git a/source/games/duke/src/gamedef.cpp b/source/games/duke/src/gamedef.cpp index 4c932c0f6..4864599cf 100644 --- a/source/games/duke/src/gamedef.cpp +++ b/source/games/duke/src/gamedef.cpp @@ -50,7 +50,7 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au) extern TArray> mapList; -extern int playerHeight; +extern float playerHeight; BEGIN_DUKE_NS diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index a9bf28a77..325abd53f 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -41,6 +41,8 @@ source as it is released. void get_weapon_pos_and_angle(float &x, float &y, float &z, float &pitch, float &yaw); float vr_hunits_per_meter(); +extern float playerHeight; +extern float heightScaler; EXTERN_CVAR(Bool, vr_6dof_weapons); EXTERN_CVAR(Bool, vr_6dof_crosshair); @@ -2732,6 +2734,15 @@ void processinput_d(int snum) shrunk = (pact->spr.scale.Y < 0.5); getzrange(p->GetActor()->getPosWithOffsetZ(), psectp, &ceilingz, chz, &floorz, clz, 10.1875, CLIPMASK0); + if (pact && pact->isPlayer() && shrunk) + { + heightScaler = (pact->spr.scale.Y / 0.5625) / 1.5f; // some arbitrary numbers yuck! + } + else + { + heightScaler = 1.0f; + } + setPlayerActorViewZOffset(pact); p->truefz = getflorzofslopeptr(psectp, p->GetActor()->getPosWithOffsetZ()); diff --git a/source/games/exhumed/src/exhumed.cpp b/source/games/exhumed/src/exhumed.cpp index d9bae5a35..c58d2202f 100644 --- a/source/games/exhumed/src/exhumed.cpp +++ b/source/games/exhumed/src/exhumed.cpp @@ -53,7 +53,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "tilesetbuilder.h" #include "psky.h" -extern int playerHeight; //Used to define player height for VR +extern float playerHeight; //Used to define player height for VR BEGIN_PS_NS diff --git a/source/games/sw/src/game.cpp b/source/games/sw/src/game.cpp index b499c2cfe..cea1ee407 100644 --- a/source/games/sw/src/game.cpp +++ b/source/games/sw/src/game.cpp @@ -86,7 +86,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms #include "interpolate.h" //#include "crc32.h" -extern int playerHeight; //Used to define player height for VR +extern float playerHeight; //Used to define player height for VR CVAR(Bool, sw_ninjahack, false, CVAR_ARCHIVE /*| CVAR_SERVERINFO*/); CVAR(Bool, sw_darts, false, CVAR_ARCHIVE);