]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
added support for model scaling in bounding box calculations for network culling...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 25 Nov 2005 03:24:59 +0000 (03:24 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 25 Nov 2005 03:24:59 +0000 (03:24 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5829 d7cf8633-e32d-0410-b094-e92efae38249

sv_main.c

index 9fc9dd2203ca3fc22a98564dccc65172b809f813..388c0748165343e6622397843a0e722ba13806f6 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -660,20 +660,21 @@ void SV_PrepareEntitiesForSending(void)
                // specialvisibilityradius)
                if ((model = sv.models[modelindex]))
                {
+                       float scale = cs.scale * (1.0f / 16.0f);
                        if (cs.angles[0] || cs.angles[2]) // pitch and roll
                        {
-                               VectorAdd(cs.origin, model->rotatedmins, cullmins);
-                               VectorAdd(cs.origin, model->rotatedmaxs, cullmaxs);
+                               VectorMA(cs.origin, scale, model->rotatedmins, cullmins);
+                               VectorMA(cs.origin, scale, model->rotatedmaxs, cullmaxs);
                        }
                        else if (cs.angles[1])
                        {
-                               VectorAdd(cs.origin, model->yawmins, cullmins);
-                               VectorAdd(cs.origin, model->yawmaxs, cullmaxs);
+                               VectorMA(cs.origin, scale, model->yawmins, cullmins);
+                               VectorMA(cs.origin, scale, model->yawmaxs, cullmaxs);
                        }
                        else
                        {
-                               VectorAdd(cs.origin, model->normalmins, cullmins);
-                               VectorAdd(cs.origin, model->normalmaxs, cullmaxs);
+                               VectorMA(cs.origin, scale, model->normalmins, cullmins);
+                               VectorMA(cs.origin, scale, model->normalmaxs, cullmaxs);
                        }
                }
                else