]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
do the nearclip hack in the chasecam too
authorRudolf Polzer <divverent@xonotic.org>
Fri, 27 May 2011 20:23:04 +0000 (22:23 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 27 May 2011 20:23:04 +0000 (22:23 +0200)
qcsrc/client/View.qc
qcsrc/warpzonelib/client.qh

index 20bebc76480f40f5108a04df0703f98d8928b9a6..5868c56b0640dcadec702cf9f4de690d038ccc1c 100644 (file)
@@ -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
                {
index d5b3ac2fc097887b0a6181b059033fc214b3e2b8..46296bb34808aed3d79b9491a757afd941928f76 100644 (file)
@@ -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();