From: Rudolf Polzer Date: Fri, 27 May 2011 20:23:04 +0000 (+0200) Subject: do the nearclip hack in the chasecam too X-Git-Tag: xonotic-v0.5.0~215^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2e5b35f90664d0dd15e371d81895216589362e3c;p=xonotic%2Fxonotic-data.pk3dir.git do the nearclip hack in the chasecam too --- diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 20bebc764..5868c56b0 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -455,6 +455,16 @@ void CSQC_UpdateView(float w, float h) R_SetView(VF_ORIGIN, trace_endpos); R_SetView(VF_ANGLES, WarpZone_TransformVAngles(WarpZone_trace_transform, view_angles)); + + vector o, corner0, corner1, corner2, corner3, nearclip; + nearclip = '0 0 1' * (cvar("r_nearclip") * 1.125); + corner0 = cs_unproject('0 0 0' + nearclip); + corner1 = cs_unproject('1 0 0' * cvar("vid_conwidth") + nearclip); + corner2 = cs_unproject('0 1 0' * cvar("vid_conheight") + nearclip); + corner3 = cs_unproject('1 0 0' * cvar("vid_conwidth") + '0 1 0' * cvar("vid_conheight") + nearclip); + o = trace_endpos; + o = o + WarpZone_FixNearClip(trace_endpos, corner0, corner1, corner2, corner3); + R_SetView(VF_ORIGIN, o); } else if(autocvar_chase_active < 0) // time to disable chase_active if it was set by this code { diff --git a/qcsrc/warpzonelib/client.qh b/qcsrc/warpzonelib/client.qh index d5b3ac2fc..46296bb34 100644 --- a/qcsrc/warpzonelib/client.qh +++ b/qcsrc/warpzonelib/client.qh @@ -7,6 +7,7 @@ vector warpzone_fixview_angles; vector warpzone_fixview_cl_viewangles; void WarpZone_FixView(); // this saves the previous values void WarpZone_UnFixView(); // and restores them +vector WarpZone_FixNearClip(vector o, vector c0, vector c1, vector c2, vector c3); void WarpZone_Init(); void WarpZone_Shutdown();