svn r377 by Rambetter:
Continuing work on BaseWindingForPlane() in polylib.c. In fact I'm pursuing the approach that was committed in r375 (but was then backed out). I can't believe my eyes, but I seem to be getting 0.000000% error in some of my regression tests. The trick is to scale by a power of 2 and never do a VectorNormalize().
This commit is contained in:
@@ -135,21 +135,6 @@ 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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user