]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
added MOVE_WORLDONLY movement type
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 3 Aug 2003 13:20:27 +0000 (13:20 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 3 Aug 2003 13:20:27 +0000 (13:20 +0000)
now does vis traces using MOVE_WORLDONLY to get a significant speed boost (back to the way it was before) and hopefully prevent any problems with transparent solid bmodels blocking visibility of
entities

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3363 d7cf8633-e32d-0410-b094-e92efae38249

sv_main.c
world.c
world.h

index 048f4f497be156422e90526ff2552059be896d4d..4421ae8d2984630cee035980c003c13fd5af046f 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -606,7 +606,7 @@ void SV_WriteEntitiesToClient (client_t *client, edict_t *clent, sizebuf_t *msg)
                                testorigin[1] = lhrandom(entmins[1], entmaxs[1]);
                                testorigin[2] = lhrandom(entmins[2], entmaxs[2]);
 
-                               if (SV_Move(testeye, vec3_origin, vec3_origin, testorigin, MOVE_NOMONSTERS, NULL).fraction == 1)
+                               if (SV_Move(testeye, vec3_origin, vec3_origin, testorigin, MOVE_WORLDONLY, NULL).fraction == 1)
                                        client->visibletime[e] = realtime + 1;
                                else
                                {
@@ -615,7 +615,7 @@ void SV_WriteEntitiesToClient (client_t *client, edict_t *clent, sizebuf_t *msg)
                                        testorigin[1] = bound(entmins[1], testeye[1], entmaxs[1]);
                                        testorigin[2] = bound(entmins[2], testeye[2], entmaxs[2]);
 
-                                       if (SV_Move(testeye, vec3_origin, vec3_origin, testorigin, MOVE_NOMONSTERS, NULL).fraction == 1)
+                                       if (SV_Move(testeye, vec3_origin, vec3_origin, testorigin, MOVE_WORLDONLY, NULL).fraction == 1)
                                                client->visibletime[e] = realtime + 1;
                                        else if (realtime > client->visibletime[e])
                                        {
@@ -1020,7 +1020,7 @@ void SV_MarkWriteEntityStateToClient(entity_state_t *s)
                                testorigin[0] = (entmins[0] + entmaxs[0]) * 0.5f;
                                testorigin[1] = (entmins[1] + entmaxs[1]) * 0.5f;
                                testorigin[2] = (entmins[2] + entmaxs[2]) * 0.5f;
-                               trace = SV_Move(sv_writeentitiestoclient_testeye, vec3_origin, vec3_origin, testorigin, MOVE_NOMONSTERS, NULL);
+                               trace = SV_Move(sv_writeentitiestoclient_testeye, vec3_origin, vec3_origin, testorigin, MOVE_WORLDONLY, NULL);
                                if (trace.fraction == 1 || BoxesOverlap(trace.endpos, trace.endpos, entmins, entmaxs))
                                        sv_writeentitiestoclient_client->visibletime[s->number] = realtime + 1;
                                else
@@ -1029,7 +1029,7 @@ void SV_MarkWriteEntityStateToClient(entity_state_t *s)
                                        testorigin[0] = lhrandom(entmins[0], entmaxs[0]);
                                        testorigin[1] = lhrandom(entmins[1], entmaxs[1]);
                                        testorigin[2] = lhrandom(entmins[2], entmaxs[2]);
-                                       trace = SV_Move(sv_writeentitiestoclient_testeye, vec3_origin, vec3_origin, testorigin, MOVE_NOMONSTERS, NULL);
+                                       trace = SV_Move(sv_writeentitiestoclient_testeye, vec3_origin, vec3_origin, testorigin, MOVE_WORLDONLY, NULL);
                                        if (trace.fraction == 1 || BoxesOverlap(trace.endpos, trace.endpos, entmins, entmaxs))
                                                sv_writeentitiestoclient_client->visibletime[s->number] = realtime + 1;
                                        else
@@ -1040,7 +1040,7 @@ void SV_MarkWriteEntityStateToClient(entity_state_t *s)
                                                        testorigin[0] = lhrandom(lightmins[0], lightmaxs[0]);
                                                        testorigin[1] = lhrandom(lightmins[1], lightmaxs[1]);
                                                        testorigin[2] = lhrandom(lightmins[2], lightmaxs[2]);
-                                                       trace = SV_Move(sv_writeentitiestoclient_testeye, vec3_origin, vec3_origin, testorigin, MOVE_NOMONSTERS, NULL);
+                                                       trace = SV_Move(sv_writeentitiestoclient_testeye, vec3_origin, vec3_origin, testorigin, MOVE_WORLDONLY, NULL);
                                                        if (trace.fraction == 1 || BoxesOverlap(trace.endpos, trace.endpos, entmins, entmaxs))
                                                                sv_writeentitiestoclient_client->visibletime[s->number] = realtime + 1;
                                                }
diff --git a/world.c b/world.c
index 8e3d3a4fe4b06a42d548955e32cb361acfbf7e7d..fe825057e68c2d7f6bcda0dc81c00d7717748f84 100644 (file)
--- a/world.c
+++ b/world.c
@@ -630,8 +630,9 @@ trace_t SV_Move(const vec3_t start, const vec3_t mins, const vec3_t maxs, const
 
        // clip to world
        clip.trace = SV_ClipMoveToEntity(sv.edicts, clip.start, clip.hullmins, clip.hullmaxs, clip.end);
+       if (clip.type == MOVE_WORLDONLY)
        //if (clip.trace.allsolid)
-       //      return clip.trace;
+               return clip.trace;
 
        if (clip.type == MOVE_MISSILE)
        {
diff --git a/world.h b/world.h
index f41cd2ef823d4a36a2e00a27d55acd66c17832f4..4bbcb28254647be34bcd67a3af6f6eb769d051a8 100644 (file)
--- a/world.h
+++ b/world.h
@@ -24,9 +24,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include "collision.h"
 
-#define        MOVE_NORMAL             0
-#define        MOVE_NOMONSTERS 1
-#define        MOVE_MISSILE    2
+#define MOVE_NORMAL     0
+#define MOVE_NOMONSTERS 1
+#define MOVE_MISSILE    2
+#define MOVE_WORLDONLY  3
 
 
 // called after the world model has been loaded, before linking any entities