diff --git a/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp b/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp index 6a0338631..4a058c3d3 100644 --- a/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp +++ b/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp @@ -778,8 +778,10 @@ void btConeTwistConstraint::calcAngleInfo2(const btTransform& transA, const btTr target[2] = x * ivA[2] + y * jvA[2] + z * kvA[2]; target.normalize(); m_swingAxis = -ivB.cross(target); - m_swingCorrection = m_swingAxis.length(); - m_swingAxis.normalize(); + m_swingCorrection = m_swingAxis.length(); + + if (!btFuzzyZero(m_swingCorrection)) + m_swingAxis.normalize(); } } diff --git a/src/LinearMath/btQuadWord.h b/src/LinearMath/btQuadWord.h index 11067ef47..fcfb3be44 100644 --- a/src/LinearMath/btQuadWord.h +++ b/src/LinearMath/btQuadWord.h @@ -73,7 +73,7 @@ public: public: -#if defined(BT_USE_SSE) || defined(BT_USE_NEON) +#if (defined(BT_USE_SSE_IN_API) && defined(BT_USE_SSE)) || defined(BT_USE_NEON) // Set Vector SIMD_FORCE_INLINE btQuadWord(const btSimdFloat4 vec)