diff --git a/Demos/CcdPhysicsDemo/CcdPhysicsDemo.cpp b/Demos/CcdPhysicsDemo/CcdPhysicsDemo.cpp index 22fc58bc0..b1cae4b72 100644 --- a/Demos/CcdPhysicsDemo/CcdPhysicsDemo.cpp +++ b/Demos/CcdPhysicsDemo/CcdPhysicsDemo.cpp @@ -356,7 +356,7 @@ void CcdPhysicsDemo::initPhysics() // Only do CCD if motion in one timestep (1.f/60.f) exceeds CUBE_HALF_EXTENTS - body->m_ccdSquareMotionTreshold = CUBE_HALF_EXTENTS; + body->m_ccdSquareMotionThreshold = CUBE_HALF_EXTENTS; //Experimental: better estimation of CCD Time of Impact: body->m_ccdSweptSphereRadius = 0.2*CUBE_HALF_EXTENTS; diff --git a/Demos/ColladaDemo/ColladaConverter.cpp b/Demos/ColladaDemo/ColladaConverter.cpp index d914f996e..aa62311e7 100644 --- a/Demos/ColladaDemo/ColladaConverter.cpp +++ b/Demos/ColladaDemo/ColladaConverter.cpp @@ -602,8 +602,8 @@ void ColladaConverter::prepareConstraints(ConstraintInput& input) //see daeMetaAttribute.cpp //INF -> 999999.9 //-INF -> -999999.9 - float linearCheckTreshold = 999999.0; - float angularCheckTreshold = 180.0;//check this + float linearCheckThreshold = 999999.0; + float angularCheckThreshold = 180.0;//check this @@ -620,16 +620,16 @@ void ColladaConverter::prepareConstraints(ConstraintInput& input) { for (int i=0;i<3;i++) { - if ((linearLowerLimits[i] < -linearCheckTreshold) || - (linearUpperLimits[i] > linearCheckTreshold)) + if ((linearLowerLimits[i] < -linearCheckThreshold) || + (linearUpperLimits[i] > linearCheckThreshold)) { //disable limits linearLowerLimits[i] = 1; linearUpperLimits[i] = 0; } - if ((angularLowerLimits[i] < -angularCheckTreshold) || - (angularUpperLimits[i] > angularCheckTreshold)) + if ((angularLowerLimits[i] < -angularCheckThreshold) || + (angularUpperLimits[i] > angularCheckThreshold)) { //disable limits angularLowerLimits[i] = 1; diff --git a/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp b/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp index ec90f80d4..06bf99bf8 100644 --- a/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp +++ b/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp @@ -102,10 +102,10 @@ bool SphereTriangleDetector::collide(const btVector3& sphereCenter,btVector3 &po normal *= -1.f; } - ///todo: move this gContactBreakingTreshold into a proper structure - extern float gContactBreakingTreshold; + ///todo: move this gContactBreakingThreshold into a proper structure + extern float gContactBreakingThreshold; - float contactMargin = gContactBreakingTreshold; + float contactMargin = gContactBreakingThreshold; bool isInsideContactPlane = distanceFromPlane < r + contactMargin; bool isInsideShellPlane = distanceFromPlane < r; diff --git a/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp b/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp index 881a8c004..4179bc47e 100644 --- a/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp +++ b/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp @@ -24,7 +24,7 @@ btCollisionObject::btCollisionObject() m_userObjectPointer(0), m_hitFraction(1.f), m_ccdSweptSphereRadius(0.f), - m_ccdSquareMotionTreshold(0.f) + m_ccdSquareMotionThreshold(0.f) { } diff --git a/src/BulletCollision/CollisionDispatch/btCollisionObject.h b/src/BulletCollision/CollisionDispatch/btCollisionObject.h index 9b90d50e3..f2ab42946 100644 --- a/src/BulletCollision/CollisionDispatch/btCollisionObject.h +++ b/src/BulletCollision/CollisionDispatch/btCollisionObject.h @@ -73,8 +73,8 @@ struct btCollisionObject ///Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm:: float m_ccdSweptSphereRadius; - /// Don't do continuous collision detection if square motion (in one step) is less then m_ccdSquareMotionTreshold - float m_ccdSquareMotionTreshold; + /// Don't do continuous collision detection if square motion (in one step) is less then m_ccdSquareMotionThreshold + float m_ccdSquareMotionThreshold; inline bool mergesSimulationIslands() const { diff --git a/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp index ed76d135d..7cb0bba62 100644 --- a/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp @@ -205,10 +205,10 @@ float btConvexConcaveCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject //quick approximation using raycast, todo: hook up to the continuous collision detection (one of the btConvexCast) - //only perform CCD above a certain treshold, this prevents blocking on the long run + //only perform CCD above a certain threshold, this prevents blocking on the long run //because object in a blocked ccd state (hitfraction<1) get their linear velocity halved each frame... float squareMot0 = (convexbody->m_interpolationWorldTransform.getOrigin() - convexbody->m_worldTransform.getOrigin()).length2(); - if (squareMot0 < convexbody->m_ccdSquareMotionTreshold) + if (squareMot0 < convexbody->m_ccdSquareMotionThreshold) { return 1.f; } diff --git a/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp index b6400d093..5347ef05b 100644 --- a/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp @@ -165,7 +165,7 @@ void btConvexConvexAlgorithm ::processCollision (btCollisionObject* body0,btColl //TODO: if (dispatchInfo.m_useContinuous) m_gjkPairDetector.setMinkowskiA(min0); m_gjkPairDetector.setMinkowskiB(min1); - input.m_maximumDistanceSquared = min0->getMargin() + min1->getMargin() + m_manifoldPtr->getContactBreakingTreshold(); + input.m_maximumDistanceSquared = min0->getMargin() + min1->getMargin() + m_manifoldPtr->getContactBreakingThreshold(); input.m_maximumDistanceSquared*= input.m_maximumDistanceSquared; // input.m_maximumDistanceSquared = 1e30f; @@ -183,17 +183,17 @@ void btConvexConvexAlgorithm ::processCollision (btCollisionObject* body0,btColl bool disableCcd = false; float btConvexConvexAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) { - ///Rather then checking ALL pairs, only calculate TOI when motion exceeds treshold + ///Rather then checking ALL pairs, only calculate TOI when motion exceeds threshold - ///Linear motion for one of objects needs to exceed m_ccdSquareMotionTreshold + ///Linear motion for one of objects needs to exceed m_ccdSquareMotionThreshold ///col0->m_worldTransform, float resultFraction = 1.f; float squareMot0 = (col0->m_interpolationWorldTransform.getOrigin() - col0->m_worldTransform.getOrigin()).length2(); - if (squareMot0 < col0->m_ccdSquareMotionTreshold && - squareMot0 < col0->m_ccdSquareMotionTreshold) + if (squareMot0 < col0->m_ccdSquareMotionThreshold && + squareMot0 < col0->m_ccdSquareMotionThreshold) return resultFraction; diff --git a/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp b/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp index b0f9b96a2..1d3941101 100644 --- a/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp +++ b/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp @@ -58,7 +58,7 @@ void btManifoldResult::addContactPoint(const btVector3& normalOnBInWorld,const b assert(m_manifoldPtr); //order in manifold needs to match - if (depth > m_manifoldPtr->getContactBreakingTreshold()) + if (depth > m_manifoldPtr->getContactBreakingThreshold()) return; bool isSwapped = m_manifoldPtr->getBody0() != m_body0; diff --git a/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp b/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp index fafceafa5..ee2be1630 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp +++ b/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp @@ -18,7 +18,7 @@ subject to the following restrictions: #include "LinearMath/btTransform.h" #include -float gContactBreakingTreshold = 0.02f; +float gContactBreakingThreshold = 0.02f; ContactDestroyedCallback gContactDestroyedCallback = 0; @@ -151,7 +151,7 @@ int btPersistentManifold::sortCachedPoints(const btManifoldPoint& pt) int btPersistentManifold::getCacheEntry(const btManifoldPoint& newPoint) const { - btScalar shortestDist = getContactBreakingTreshold() * getContactBreakingTreshold(); + btScalar shortestDist = getContactBreakingThreshold() * getContactBreakingThreshold(); int size = getNumContacts(); int nearestPoint = -1; for( int i = 0; i < size; i++ ) @@ -193,9 +193,9 @@ void btPersistentManifold::AddManifoldPoint(const btManifoldPoint& newPoint) replaceContactPoint(newPoint,insertIndex); } -float btPersistentManifold::getContactBreakingTreshold() const +float btPersistentManifold::getContactBreakingThreshold() const { - return gContactBreakingTreshold; + return gContactBreakingThreshold; } void btPersistentManifold::refreshContactPoints(const btTransform& trA,const btTransform& trB) @@ -229,7 +229,7 @@ void btPersistentManifold::refreshContactPoints(const btTransform& trA,const btT projectedPoint = manifoldPoint.m_positionWorldOnA - manifoldPoint.m_normalWorldOnB * manifoldPoint.m_distance1; projectedDifference = manifoldPoint.m_positionWorldOnB - projectedPoint; distance2d = projectedDifference.dot(projectedDifference); - if (distance2d > getContactBreakingTreshold()*getContactBreakingTreshold() ) + if (distance2d > getContactBreakingThreshold()*getContactBreakingThreshold() ) { removeContactPoint(i); } diff --git a/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h b/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h index d0cc2577f..ab0e8767e 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h +++ b/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h @@ -23,8 +23,8 @@ subject to the following restrictions: struct btCollisionResult; -///contact breaking and merging treshold -extern float gContactBreakingTreshold; +///contact breaking and merging threshold +extern float gContactBreakingThreshold; typedef bool (*ContactDestroyedCallback)(void* userPersistentData); extern ContactDestroyedCallback gContactDestroyedCallback; @@ -97,7 +97,7 @@ public: } /// todo: get this margin from the current physics / collision environment - float getContactBreakingTreshold() const; + float getContactBreakingThreshold() const; int getCacheEntry(const btManifoldPoint& newPoint) const; @@ -124,7 +124,7 @@ public: bool validContactDistance(const btManifoldPoint& pt) const { - return pt.m_distance1 <= getContactBreakingTreshold(); + return pt.m_distance1 <= getContactBreakingThreshold(); } /// calculated new worldspace coordinates and depth, and reject points that exceed the collision margin void refreshContactPoints( const btTransform& trA,const btTransform& trB); diff --git a/src/BulletDynamics/Dynamics/btRigidBody.cpp b/src/BulletDynamics/Dynamics/btRigidBody.cpp index 9e7c4978c..baa176f96 100644 --- a/src/BulletDynamics/Dynamics/btRigidBody.cpp +++ b/src/BulletDynamics/Dynamics/btRigidBody.cpp @@ -24,8 +24,8 @@ float gLinearAirDamping = 1.f; float gDeactivationTime = 2.f; bool gDisableDeactivation = false; -float gLinearSleepingTreshold = 0.8f; -float gAngularSleepingTreshold = 1.0f; +float gLinearSleepingThreshold = 0.8f; +float gAngularSleepingThreshold = 1.0f; static int uniqueId = 0; btRigidBody::btRigidBody(float mass, btMotionState* motionState, btCollisionShape* collisionShape, const btVector3& localInertia,btScalar linearDamping,btScalar angularDamping,btScalar friction,btScalar restitution) diff --git a/src/BulletDynamics/Dynamics/btRigidBody.h b/src/BulletDynamics/Dynamics/btRigidBody.h index 43c27edea..ffb2af2d2 100644 --- a/src/BulletDynamics/Dynamics/btRigidBody.h +++ b/src/BulletDynamics/Dynamics/btRigidBody.h @@ -34,8 +34,8 @@ extern bool gUseEpa; extern float gDeactivationTime; extern bool gDisableDeactivation; -extern float gLinearSleepingTreshold; -extern float gAngularSleepingTreshold; +extern float gLinearSleepingThreshold; +extern float gAngularSleepingThreshold; /// btRigidBody class for btRigidBody Dynamics @@ -250,8 +250,8 @@ public: if ( (GetActivationState() == ISLAND_SLEEPING) || (GetActivationState() == DISABLE_DEACTIVATION)) return; - if ((getLinearVelocity().length2() < gLinearSleepingTreshold*gLinearSleepingTreshold) && - (getAngularVelocity().length2() < gAngularSleepingTreshold*gAngularSleepingTreshold)) + if ((getLinearVelocity().length2() < gLinearSleepingThreshold*gLinearSleepingThreshold) && + (getAngularVelocity().length2() < gAngularSleepingThreshold*gAngularSleepingThreshold)) { m_deactivationTime += timeStep; } else diff --git a/src/LinearMath/btDefaultMotionState.h b/src/LinearMath/btDefaultMotionState.h index 5e5fd0c25..d92ea03fa 100644 --- a/src/LinearMath/btDefaultMotionState.h +++ b/src/LinearMath/btDefaultMotionState.h @@ -31,4 +31,4 @@ struct btDefaultMotionState : public btMotionState } }; -#endif //DEFAULT_MOTION_STATE_H \ No newline at end of file +#endif //DEFAULT_MOTION_STATE_H diff --git a/src/LinearMath/btTransformUtil.h b/src/LinearMath/btTransformUtil.h index da8e4aa72..12ca634c2 100644 --- a/src/LinearMath/btTransformUtil.h +++ b/src/LinearMath/btTransformUtil.h @@ -17,7 +17,7 @@ subject to the following restrictions: #define SIMD_TRANSFORM_UTIL_H #include "LinearMath/btTransform.h" -#define ANGULAR_MOTION_TRESHOLD 0.5f*SIMD_HALF_PI +#define ANGULAR_MOTION_THRESHOLD 0.5f*SIMD_HALF_PI @@ -82,9 +82,9 @@ public: btVector3 axis; btScalar fAngle = angvel.length(); //limit the angular motion - if (fAngle*timeStep > ANGULAR_MOTION_TRESHOLD) + if (fAngle*timeStep > ANGULAR_MOTION_THRESHOLD) { - fAngle = ANGULAR_MOTION_TRESHOLD / timeStep; + fAngle = ANGULAR_MOTION_THRESHOLD / timeStep; } if ( fAngle < 0.001f )