diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletEngine.cpp b/SimDynamics/DynamicsEngine/BulletEngine/BulletEngine.cpp index af6436277760bf80b071d0b8c09f2aca93ef49dd..edc4c785e9cd4075a444645b82b6ea502e9f6df5 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletEngine.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletEngine.cpp @@ -1,3 +1,5 @@ +#include <Bullet3Common/b3Scalar.h> + #include "BulletEngine.h" #include "BulletObject.h" #include "SimoxCollisionDispatcher.h" @@ -24,7 +26,11 @@ namespace SimDynamics bulletSolverIterations = 250; bulletSolverGlobalContactForceMixing = 0.0; bulletSolverGlobalErrorReductionParameter = btScalar(0.6); +#if (B3_BULLET_VERSION < 300) bulletSolverSuccessiveOverRelaxation = btScalar(0.0); +#else + bulletSolverSuccessiveOverRelaxation = btScalar(1.0); +#endif //bulletSolverContactSurfaceLayer = btScalar(0.001); bulletSolverSplitImpulsePenetrationThreshold = btScalar(-0.01); } @@ -576,7 +582,11 @@ namespace SimDynamics cout << " hinge motor enabled:" << hinge->getEnableAngularMotor() << endl; cout << " hinge angle :" << hinge->getHingeAngle() << endl; cout << " hinge max motor impulse :" << hinge->getMaxMotorImpulse() << endl; +#if (B3_BULLET_VERSION < 300) cout << " hinge motor target vel :" << hinge->getMotorTargetVelosity() << endl; +#else + cout << " hinge motor target vel :" << hinge->getMotorTargetVelocity() << endl; +#endif } boost::shared_ptr<btGeneric6DofConstraint> dof = boost::dynamic_pointer_cast<btGeneric6DofConstraint>(links[j].joint); diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/DemoApplication.cpp b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/DemoApplication.cpp index cc9f63da38f6fb92316df07fed97d7b399eeacfd..4b86800400eba4d23b842f4d6dd99b3e00192f23 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/DemoApplication.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGL/DemoApplication.cpp @@ -12,7 +12,7 @@ subject to the following restrictions: 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ - +#include <Bullet3Common/b3Scalar.h> #include "DemoApplication.h" #include "LinearMath/btIDebugDraw.h" @@ -44,10 +44,13 @@ btCollisionShape* gShapePtr[maxNumObjects];//1 rigidbody has 1 shape (no re-use extern int gNumClampedCcdMotions; #ifdef SHOW_NUM_DEEP_PENETRATIONS +#if (B3_BULLET_VERSION < 300) extern int gNumDeepPenetrationChecks; - +#endif extern int gNumSplitImpulseRecoveries; +#if (B3_BULLET_VERSION < 300) extern int gNumGjkChecks; +#endif extern int gNumAlignedAllocs; extern int gNumAlignedFree; extern int gTotalBytesAlignedAllocs; @@ -1572,8 +1575,10 @@ void DemoApplication::clientResetScene() removePickingConstraint(); #ifdef SHOW_NUM_DEEP_PENETRATIONS +#if (B3_BULLET_VERSION < 300) gNumDeepPenetrationChecks = 0; gNumGjkChecks = 0; +#endif #endif //SHOW_NUM_DEEP_PENETRATIONS gNumClampedCcdMotions = 0; diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletRobot.cpp b/SimDynamics/DynamicsEngine/BulletEngine/BulletRobot.cpp index 0fd1f45ad362bc457a9a430406dc0035343374f7..c84dfcbd32a9f770e85312a6a8933929576b9aca 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletRobot.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletRobot.cpp @@ -1,3 +1,5 @@ +#include <Bullet3Common/b3Scalar.h> + #include "BulletRobot.h" #include "BulletEngine.h" #include "BulletEngineFactory.h" @@ -1095,8 +1097,11 @@ namespace SimDynamics if (rn->isRotationalJoint()) { boost::shared_ptr<btHingeConstraint> hinge = boost::dynamic_pointer_cast<btHingeConstraint>(link.joint); - +#if (B3_BULLET_VERSION < 300) return hinge->getMotorTargetVelosity(); +#else + return hinge->getMotorTargetVelocity(); +#endif } else if (rn->isTranslationalJoint()) {