Author: rambetter

New Revision: 379
Undoing revision 377 (reverting just those files modified by that
commit).  I have disovered the fundamental problem to the math error problems,
and although this commit (r377) is "correct", it fails to address the
fundamental problem.  Therefore, I'd rather leave the code in a state that
has the exact same behavior as before until I get a chance to address the
fundamental issue.
This commit is contained in:
Rudolf Polzer
2010-12-29 17:41:57 +01:00
parent bbd9067353
commit 469cba24be
3 changed files with 24 additions and 33 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;