Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2014-08-10 02:36:32 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2014-08-10 02:39:22 +0400
commit3a53ed8d1babd43df62a29d5a46836350a795091 (patch)
tree486d8cae10a12f53fa0509e619ce404372937874 /extern/bullet2/src
parent64c7b2a122d6099efa8f298866b37239a18bb9bf (diff)
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.
Diffstat (limited to 'extern/bullet2/src')
-rw-r--r--extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp11
1 files changed, 7 insertions, 4 deletions
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;
}