Author: rambetter

Date: Tue Dec 28 04:02:11 2010
New Revision: 371

Rewriting BaseWindingForPlane() in polylib.c from the ground up.  The behavior is totally unchanged, and I verified this by running extensive tests.  The only difference is that the math precision is much much better now.  Performance should be better as well (but that is not tested).  This is a major milestone because it fixes two regression tests: disappearing_sliver2 and sparkly_seam.
Improvements to math precision is ongoing and more improvements can probably be made even after this patch.
I will update the README.txt files in the regression tests in a separate commit.  This commit only includes the actual fixed code.
This commit is contained in:
Rudolf Polzer
2010-12-28 11:24:25 +01:00
parent bbcc70e072
commit ec64df5697
3 changed files with 93 additions and 0 deletions

View File

@@ -135,6 +135,21 @@ vec_t VectorNormalize( const vec3_t in, vec3_t out ) {
return length;
}
vec_t VectorSetLength(const vec3_t in, vec_t length, vec3_t out) {
vec_t origLength;
origLength = (vec_t) sqrt((in[0] * in[0]) + (in[1] * in[1]) + (in[2] * in[2]));
if (origLength == 0)
{
VectorClear(out);
return 0;
}
VectorScale(in, length / origLength, out);
return origLength;
}
vec_t ColorNormalize( const vec3_t in, vec3_t out ) {
float max, scale;