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
path: root/extern
diff options
context:
space:
mode:
Diffstat (limited to 'extern')
-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;
}