From 49944d208275c403e48847b232b42bb1c4a90af3 Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 23 Nov 2005 03:28:28 +0000 Subject: [PATCH] removing uses of entity_render_t->origin in the client git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5819 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_collision.c | 6 ++++-- cl_main.c | 10 ++++++---- cl_particles.c | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/cl_collision.c b/cl_collision.c index 8f381860..6a138a8e 100644 --- a/cl_collision.c +++ b/cl_collision.c @@ -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; diff --git a/cl_main.c b/cl_main.c index dd1effc6..3bb141b4 100644 --- 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); } diff --git a/cl_particles.c b/cl_particles.c index 3780eb7f..2af16696 100644 --- a/cl_particles.c +++ b/cl_particles.c @@ -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]) -- 2.39.2