From 9ccd42428d001ec4e2c1edbd5b652cc0dca4581e Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 28 Nov 2001 00:19:27 +0000 Subject: [PATCH] this seems to give a 0.48% boost to bigass (220.45 to 221.52, null-renderer) --- nq/source/cl_main.c | 38 +++++++++++++++++++------------------- nq/source/cl_parse.c | 2 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/nq/source/cl_main.c b/nq/source/cl_main.c index 5f76b9f52..3351cb43d 100644 --- a/nq/source/cl_main.c +++ b/nq/source/cl_main.c @@ -546,30 +546,30 @@ CL_RelinkEntities (void) if (state->forcelink) { // the entity was not updated in the // last message so move to the final spot - VectorCopy (state->msg_origins[0], ent->origin); - VectorCopy (state->msg_angles[0], ent->angles); ent->pose1 = ent->pose2 = -1; } else { // if the delta is large, assume a // teleport and don't lerp f = frac; - for (j = 0; j < 3; j++) { - delta[j] = state->msg_origins[0][j] - state->msg_origins[1][j]; - if (delta[j] > 100 || delta[j] < -100) - f = 1; // assume a teleportation, not a motion + VectorSubtract (state->msg_origins[0], + state->msg_origins[1], delta); + if (fabs (delta[0]) > 100 || fabs (delta[1] > 100) + || fabs (delta[2]) > 100) { + // assume a teleportation, not a motion + VectorCopy (state->msg_origins[0], ent->origin); + VectorCopy (state->msg_angles[0], ent->angles); + ent->pose1 = ent->pose2 = -1; + } else { + VectorMA (state->msg_origins[1], f, delta, ent->origin); + // interpolate the origin and angles + for (j = 0; j < 3; j++) { + d = state->msg_angles[0][j] - state->msg_angles[1][j]; + if (d > 180) + d -= 360; + else if (d < -180) + d += 360; + ent->angles[j] = state->msg_angles[1][j] + f * d; + } } - - // interpolate the origin and angles - for (j = 0; j < 3; j++) { - ent->origin[j] = state->msg_origins[1][j] + f * delta[j]; - - d = state->msg_angles[0][j] - state->msg_angles[1][j]; - if (d > 180) - d -= 360; - else if (d < -180) - d += 360; - ent->angles[j] = state->msg_angles[1][j] + f * d; - } - } // rotate binary objects locally diff --git a/nq/source/cl_parse.c b/nq/source/cl_parse.c index 292c998ab..731b03dbe 100644 --- a/nq/source/cl_parse.c +++ b/nq/source/cl_parse.c @@ -471,7 +471,7 @@ CL_ParseUpdate (int bits) state->msg_angles[0][2] = state->baseline.angles[2]; if (bits & U_NOLERP) - state->forcelink = true; + forcelink = true; if (forcelink) { // didn't have an update last message VectorCopy (state->msg_origins[0], state->msg_origins[1]);