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.
This commit is contained in:
revility 2018-10-30 18:55:54 -04:00 committed by GitHub
parent 83a1d2a83d
commit 6117962437
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) // adjust the origin based on the camera nodal distance (eye distance from neck)
origin += physicsObj.GetGravityNormal() * g_viewNodalZ.GetFloat(); origin += physicsObj.GetGravityNormal() * g_viewNodalZ.GetFloat();
origin += axis[0] * g_viewNodalX.GetFloat() + axis[2] * 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
} }
} }