mirror of
https://github.com/dhewm/dhewm3-sdk.git
synced 2024-11-25 05:51:15 +00:00
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:
parent
83a1d2a83d
commit
6117962437
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue