fix hull mass data calculation and make it more robust, bugfixes

This commit is contained in:
Irlan
2017-02-27 02:06:33 -03:00
parent 56ac6d1ad5
commit 091c99b5cf
15 changed files with 359 additions and 167 deletions

View File

@@ -118,15 +118,12 @@ struct b3Quat
*axis = s * v;
}
*angle = 0.0f;
// cosine check
if (w >= -1.0f && w <= 1.0f)
{
// half angle
float32 theta = acos(w);
// full angle
*angle = 2.0f * theta;
}
float32 cosine = b3Clamp(w, -1.0f, 1.0f);
// half angle
float32 theta = acos(cosine);
// full angle
*angle = 2.0f * theta;
}
float32 x, y, z, w;