]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
removing uses of entity_render_t->origin in the client
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 23 Nov 2005 03:28:28 +0000 (03:28 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 23 Nov 2005 03:28:28 +0000 (03:28 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5819 d7cf8633-e32d-0410-b094-e92efae38249

cl_collision.c
cl_main.c
cl_particles.c

index 8f38186079b12b8b94d74a75af540f36ee64e723..6a138a8e89e873d46510a7c365bf8eeba91a5006 100644 (file)
@@ -35,6 +35,7 @@ trace_t CL_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, co
        entity_render_t *ent;
        vec3_t tracemins, tracemaxs;
        trace_t cliptrace, trace;
+       vec3_t origin;
        vec3_t starttransformed, endtransformed, starttransformedmins, endtransformedmins, starttransformedmaxs, endtransformedmaxs;
        vec3_t startmins, startmaxs, endmins, endmaxs, entmins, entmaxs;
        vec_t *playermins, *playermaxs;
@@ -130,8 +131,9 @@ trace_t CL_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, co
                                // FIXME: crouch
                                playermins = cl_playerstandmins;
                                playermaxs = cl_playerstandmaxs;
-                               VectorAdd(ent->origin, playermins, entmins);
-                               VectorAdd(ent->origin, playermaxs, entmaxs);
+                               Matrix4x4_OriginFromMatrix(&ent->matrix, origin);
+                               VectorAdd(origin, playermins, entmins);
+                               VectorAdd(origin, playermaxs, entmaxs);
                                if (!BoxesOverlap(tracemins, tracemaxs, entmins, entmaxs))
                                        continue;
 
index dd1effc6ee2b9d385cdd7b99ec5c22b65c79fcf1..3bb141b4386146ec07a3cc1d057999eb0c7fbe49 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -345,7 +345,7 @@ static void CL_PrintEntities_f(void)
                        strcpy(name, "--no model--");
                for (j = (int)strlen(name);j < 25;j++)
                        name[j] = ' ';
-               Con_Printf("%3i: %s:%4i (%5i %5i %5i) [%3i %3i %3i] %4.2f %5.3f\n", i, name, ent->render.frame, (int) ent->render.origin[0], (int) ent->render.origin[1], (int) ent->render.origin[2], (int) ent->render.angles[0] % 360, (int) ent->render.angles[1] % 360, (int) ent->render.angles[2] % 360, ent->render.scale, ent->render.alpha);
+               Con_Printf("%3i: %s:%4i (%5i %5i %5i) [%3i %3i %3i] %4.2f %5.3f\n", i, name, ent->render.frame, (int) ent->render.matrix.m[0][3], (int) ent->render.matrix.m[1][3], (int) ent->render.matrix.m[2][3], (int) ent->render.angles[0] % 360, (int) ent->render.angles[1] % 360, (int) ent->render.angles[2] % 360, ent->render.scale, ent->render.alpha);
        }
 }
 
@@ -1219,7 +1219,7 @@ void CL_RelinkBeams(void)
 
                // if coming from the player, update the start position
                //if (b->entity == cl.viewentity)
-               //      VectorCopy (cl_entities[cl.viewentity].render.origin, b->start);
+               //      Matrix4x4_OriginFromMatrix(&cl_entities[cl.viewentity].render.matrix, b->start);
                if (cl_beams_relative.integer && b->entity == cl.viewentity && b->entity && cl_entities[b->entity].state_current.active && b->relativestartvalid)
                {
                        entity_state_t *p = &cl_entities[b->entity].state_previous;
@@ -1246,10 +1246,12 @@ void CL_RelinkBeams(void)
                        }
                        else
                        {
+                               vec3_t origin;
+                               Matrix4x4_OriginFromMatrix(&r->matrix, origin);
                                if (b->entity == cl.viewentity)
-                                       Matrix4x4_CreateFromQuakeEntity(&matrix, r->origin[0], r->origin[1], r->origin[2] + 16, cl.viewangles[0], cl.viewangles[1], cl.viewangles[2], 1);
+                                       Matrix4x4_CreateFromQuakeEntity(&matrix, origin[0], origin[1], origin[2] + 16, cl.viewangles[0], cl.viewangles[1], cl.viewangles[2], 1);
                                else
-                                       Matrix4x4_CreateFromQuakeEntity(&matrix, r->origin[0], r->origin[1], r->origin[2] + 16, r->angles[0], r->angles[1], r->angles[2], 1);
+                                       Matrix4x4_CreateFromQuakeEntity(&matrix, origin[0], origin[1], origin[2] + 16, r->angles[0], r->angles[1], r->angles[2], 1);
                                Matrix4x4_Transform(&matrix, b->relativestart, b->start);
                                Matrix4x4_Transform(&matrix, b->relativeend, b->end);
                        }
index 3780eb7f7c4a12fe20cef7ddfcb9c0b30370cbae..2af1669679fa3d3b5d4641b74e90089c584e7f69 100644 (file)
@@ -513,7 +513,7 @@ void CL_EntityParticles (entity_t *ent)
 #ifdef WORKINGLQUAKE
        VectorCopy(ent->origin, org);
 #else
-       VectorCopy(ent->render.origin, org);
+       Matrix4x4_OriginFromMatrix(&ent->render.matrix, org);
 #endif
 
        if (!avelocities[0][0])