Fix IQM quat normalize fail case

Should only happen with invalid models though.
This commit is contained in:
Zack Middleton 2019-05-28 21:00:02 -05:00
parent 95b9cab4d6
commit 2a2646fe43
2 changed files with 4 additions and 2 deletions

View File

@ -154,7 +154,8 @@ static vec_t QuatNormalize2( const quat_t v, quat_t out) {
out[2] = v[2]*ilength; out[2] = v[2]*ilength;
out[3] = v[3]*ilength; out[3] = v[3]*ilength;
} else { } else {
out[0] = out[1] = out[2] = out[3] = 0; out[0] = out[1] = out[2] = 0;
out[3] = -1;
} }
return length; return length;

View File

@ -154,7 +154,8 @@ static vec_t QuatNormalize2( const quat_t v, quat_t out) {
out[2] = v[2]*ilength; out[2] = v[2]*ilength;
out[3] = v[3]*ilength; out[3] = v[3]*ilength;
} else { } else {
out[0] = out[1] = out[2] = out[3] = 0; out[0] = out[1] = out[2] = 0;
out[3] = -1;
} }
return length; return length;