From 87aafe7dc86c3cd91abd813d038d2dd7964df371 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Tue, 24 Mar 2015 19:51:00 +0100 Subject: [PATCH] Make the face normal calculation clearer by using less variables. --- qcsrc/warpzonelib/server.qc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/qcsrc/warpzonelib/server.qc b/qcsrc/warpzonelib/server.qc index d5a3f4e92..c4dc7287f 100644 --- a/qcsrc/warpzonelib/server.qc +++ b/qcsrc/warpzonelib/server.qc @@ -537,7 +537,7 @@ void WarpZone_InitStep_UpdateTransform() { vector org, ang, norm, point; float area; - vector tri, a, b, c, p, q, n; + vector tri, a, b, c, n; float i_s, i_t, n_t; string tex; @@ -561,9 +561,7 @@ void WarpZone_InitStep_UpdateTransform() a = getsurfacepoint(self, i_s, tri.x); b = getsurfacepoint(self, i_s, tri.y); c = getsurfacepoint(self, i_s, tri.z); - p = b - a; - q = c - a; - n = cross(q, p); + n = cross(c - a, b - a); area = area + vlen(n); norm = norm + n; point = point + vlen(n) * (a + b + c); -- 2.39.2