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[3] = v[3]*ilength;
} else {
out[0] = out[1] = out[2] = out[3] = 0;
out[0] = out[1] = out[2] = 0;
out[3] = -1;
}
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[3] = v[3]*ilength;
} else {
out[0] = out[1] = out[2] = out[3] = 0;
out[0] = out[1] = out[2] = 0;
out[3] = -1;
}
return length;