From 6117962437d662f898424b2f7359a6affd7e4a12 Mon Sep 17 00:00:00 2001 From: revility <32818302+revility@users.noreply.github.com> Date: Tue, 30 Oct 2018 18:55:54 -0400 Subject: [PATCH] offset view position adds a new cvar pm_crossHairSideScale to move the view position origin sideways. Useful if pm_crosshairorigin is set to 0 and aiming around corners. weapon projectiles use this as their spawn position. cross hairs use it as the origin of the trace line. default is 0. player should adjust to their liking and current camera settings. If set too far over, the player can shoot around walls. --- game/Player.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/game/Player.cpp b/game/Player.cpp index eb4febc..6e00791 100644 --- a/game/Player.cpp +++ b/game/Player.cpp @@ -8903,6 +8903,8 @@ void idPlayer::GetViewPos( idVec3 &origin, idMat3 &axis ) const { // adjust the origin based on the camera nodal distance (eye distance from neck) origin += physicsObj.GetGravityNormal() * g_viewNodalZ.GetFloat(); origin += axis[0] * g_viewNodalX.GetFloat() + axis[2] * g_viewNodalZ.GetFloat(); + origin += (pm_crossHairSideScale.GetFloat()) * axis[ 1 ]; //rev 2018 allow offsetting the x position which influences the origin of the crosshair + } }