Remove an assert in Bullet for the Character physics.

This assert happens all the time for character physics in debug mode.
In release mode, the assert is skipped but the code is still incorrect
although it does not cause any crash strangely.
This commit is contained in:
Benoit Bolsee
2014-08-10 00:36:32 +02:00
parent 64c7b2a122
commit 3a53ed8d1b

View File

@@ -29,10 +29,13 @@ subject to the following restrictions:
static btVector3
getNormalizedVector(const btVector3& v)
{
btVector3 n = v.normalized();
if (n.length() < SIMD_EPSILON) {
n.setValue(0, 0, 0);
}
btScalar l = v.length();
btVector3 n = v;
if (l < SIMD_EPSILON) {
n.setValue(0,0,0);
} else {
n /= l;
}
return n;
}