diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-01-17 23:35:32 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-01-26 00:14:46 +0300 |
commit | b64d5809e7e3b832e2a011869db68e70b4b4e6fc (patch) | |
tree | aa4f6714da9f546eeee7dffed9236f9c8309524b /extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp | |
parent | 3c72e302e1eb25de43dd9d077f0c730cc02b5674 (diff) |
Upgrade Bullet to version 2.83.
I tried to carefully preserve all patches since the last upgrade.
Improves T47195, cloth collision detection bug.
Differential Revision: https://developer.blender.org/D1739
Diffstat (limited to 'extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp')
-rw-r--r-- | extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp b/extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp index 8d940e63cd3..31faf1df5e3 100644 --- a/extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp +++ b/extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp @@ -29,13 +29,11 @@ subject to the following restrictions: static btVector3 getNormalizedVector(const btVector3& v) { - btScalar l = v.length(); - btVector3 n = v; - if (l < SIMD_EPSILON) { - n.setValue(0,0,0); - } else { - n /= l; - } + btVector3 n(0, 0, 0); + + if (v.length() > SIMD_EPSILON) { + n = v.normalized(); + } return n; } @@ -383,8 +381,8 @@ void btKinematicCharacterController::stepForwardAndStrafe ( btCollisionWorld* co if (callback.hasHit()) { // we moved only a fraction - btScalar hitDistance; - hitDistance = (callback.m_hitPointWorld - m_currentPosition).length(); + //btScalar hitDistance; + //hitDistance = (callback.m_hitPointWorld - m_currentPosition).length(); // m_currentPosition.setInterpolate3 (m_currentPosition, m_targetPosition, callback.m_closestHitFraction); @@ -638,7 +636,7 @@ void btKinematicCharacterController::playerStep ( btCollisionWorld* collisionWo // printf(" dt = %f", dt); // quick check... - if (!m_useWalkDirection && m_velocityTimeInterval <= 0.0) { + if (!m_useWalkDirection && (m_velocityTimeInterval <= 0.0 || m_walkDirection.fuzzyZero())) { // printf("\n"); return; // no motion } |