From: terencehill Date: Wed, 13 Jan 2016 20:38:41 +0000 (+0100) Subject: Make cl_followmodel effect more realistic by taking into account pitch X-Git-Tag: xonotic-v0.8.2~1190^2~7 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=13b3069ae3ae1e8d7dce41eb10db5052a74dc80d;p=xonotic%2Fxonotic-data.pk3dir.git Make cl_followmodel effect more realistic by taking into account pitch --- diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index f74fbfdab..b792d386f 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -176,8 +176,12 @@ void viewmodel_animate(entity this) frac = avg_factor(autocvar_cl_followmodel_lowpass); lowpass3(gunorg, frac, gunorg_adjustment_lowpass, gunorg); - vector v = rotate(gunorg, YAW(view_angles) * DEG2RAD); // rotate world coordinates to relative ones - v.z = gunorg.z; + vector v; + vector forward, right = '0 0 0', up = '0 0 0'; + MAKEVECTORS(makevectors, view_angles, forward, right, up); + v.x = gunorg * forward; + v.y = gunorg * right * -1; + v.z = gunorg * up; this.origin += v; }