Don't normalize the portal edge vectors.

This simplifies the collision handling code.
This commit is contained in:
Bill Currie 2011-11-27 17:41:32 +09:00
parent 174f381125
commit 5ee552ea5b
3 changed files with 7 additions and 5 deletions

View file

@ -90,10 +90,11 @@ winding_t *CopyWindingReverse (const winding_t *w);
given winding.
\param w The winding to convert.
\return The "winding" holding the unit vectors.
\param unit If true, normalize the vectors.
\return The "winding" holding the (unit) vectors.
\note It is the caller's responsibiltiy to free the new winding.
*/
winding_t *WindingVectors (const winding_t *w);
winding_t *WindingVectors (const winding_t *w, int unit);
/** Clip the winding to the plain.

View file

@ -189,7 +189,7 @@ MOD_BuildBrushes (hull_t *hull)
side = p->leafs[1] == leaf;
if (p->edges)
continue;
p->edges = WindingVectors (p->winding);
p->edges = WindingVectors (p->winding, 0);
}
}
}

View file

@ -141,7 +141,7 @@ CopyWindingReverse (const winding_t *w)
}
winding_t *
WindingVectors (const winding_t *w)
WindingVectors (const winding_t *w, int unit)
{
int i;
size_t size;
@ -153,7 +153,8 @@ WindingVectors (const winding_t *w)
for (i = 0; i < w->numpoints; i++) {
VectorSubtract (w->points[(i + 1) % w->numpoints], w->points[i],
c->points[i]);
VectorNormalize (c->points[i]);
if (unit)
VectorNormalize (c->points[i]);
}
return c;
}