fixed issue with de-normalized quaternion, causing acosf to fail

See http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1440
Thanks Proctoid for reporting.
This commit is contained in:
ejcoumans
2007-09-11 02:49:39 +00:00
parent 15df0a7d7a
commit a71e9c3e5a
2 changed files with 8 additions and 1 deletions

View File

@@ -121,6 +121,10 @@ public:
dmat.getRotation(dorn);
#endif//USE_QUATERNION_DIFF
///floating point inaccuracy can lead to w component > 1..., which breaks
dorn.normalize();
angle = dorn.getAngle();
axis = btVector3(dorn.x(),dorn.y(),dorn.z());
axis[3] = btScalar(0.);