From 8ab34e35efc54ec4a79788d969d40bf0f16e408f Mon Sep 17 00:00:00 2001 From: havoc Date: Tue, 21 Dec 2004 16:51:43 +0000 Subject: [PATCH] fixed up a number of nudging bugs in Collision_TraceLineTriangleFloat git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4876 d7cf8633-e32d-0410-b094-e92efae38249 --- collision.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/collision.c b/collision.c index af051b98..c0b93067 100644 --- a/collision.c +++ b/collision.c @@ -1478,13 +1478,13 @@ void Collision_TraceLineTriangleFloat(trace_t *trace, const vec3_t linestart, co // store the new trace plane (because collisions only happen from // the front this is always simply the triangle normal, never flipped) + VectorNormalize(faceplanenormal); VectorCopy(faceplanenormal, trace->plane.normal); - VectorNormalize(trace->plane.normal); trace->plane.dist = DotProduct(point0, faceplanenormal); // calculate the normalized start and end distances - d1 = DotProduct(faceplanenormal, linestart) - faceplanedist; - d2 = DotProduct(faceplanenormal, lineend) - faceplanedist; + d1 = DotProduct(trace->plane.normal, linestart) - trace->plane.dist; + d2 = DotProduct(trace->plane.normal, lineend) - trace->plane.dist; // calculate a nudged fraction to keep it out of the surface // (the main fraction remains perfect) -- 2.39.2