From 3a53ed8d1babd43df62a29d5a46836350a795091 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 10 Aug 2014 00:36:32 +0200 Subject: 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. --- .../Character/btKinematicCharacterController.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'extern/bullet2') diff --git a/extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp b/extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp index 8f1cd20bf45..8d940e63cd3 100644 --- a/extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp +++ b/extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp @@ -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; } -- cgit v1.2.3