From f7117466a2f8203fba12140bd267909f46206d0e Mon Sep 17 00:00:00 2001 From: ejcoumans Date: Tue, 18 Sep 2007 04:51:26 +0000 Subject: [PATCH] add support for the , which disables collisions between two bodies linked by a constraint. --- Demos/ColladaDemo/ColladaConverter.cpp | 9 ++++++--- Demos/ColladaDemo/ColladaConverter.h | 3 ++- Demos/ColladaDemo/ColladaDemo.cpp | 5 +++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Demos/ColladaDemo/ColladaConverter.cpp b/Demos/ColladaDemo/ColladaConverter.cpp index 7b72d6adc..a5c625358 100644 --- a/Demos/ColladaDemo/ColladaConverter.cpp +++ b/Demos/ColladaDemo/ColladaConverter.cpp @@ -624,7 +624,8 @@ void ColladaConverter::prepareConstraints(ConstraintInput& input) ); } - + domBool interpenetrate = commonRef->getInterpenetrate()->getValue(); + bool disableCollisionsBetweenLinkedBodies = interpenetrate; //convert INF / -INF into lower > upper //currently there is a hack in the DOM to detect INF / -INF @@ -681,7 +682,8 @@ void ColladaConverter::prepareConstraints(ConstraintInput& input) linearLowerLimits, linearUpperLimits, angularLowerLimits, - angularUpperLimits + angularUpperLimits, + disableCollisionsBetweenLinkedBodies ); } else { @@ -693,7 +695,8 @@ void ColladaConverter::prepareConstraints(ConstraintInput& input) linearLowerLimits, linearUpperLimits, angularLowerLimits, - angularUpperLimits + angularUpperLimits, + disableCollisionsBetweenLinkedBodies ); } } else diff --git a/Demos/ColladaDemo/ColladaConverter.h b/Demos/ColladaDemo/ColladaConverter.h index cfec57bff..984bd7481 100644 --- a/Demos/ColladaDemo/ColladaConverter.h +++ b/Demos/ColladaDemo/ColladaConverter.h @@ -75,7 +75,8 @@ public: const btVector3& linearMinLimits, const btVector3& linearMaxLimits, const btVector3& angularMinLimits, - const btVector3& angularMaxLimits + const btVector3& angularMaxLimits, + bool disableCollisionsBetweenLinkedBodies ) = 0; virtual btRigidBody* createRigidBody(bool isDynamic, diff --git a/Demos/ColladaDemo/ColladaDemo.cpp b/Demos/ColladaDemo/ColladaDemo.cpp index 863e82b68..8251445fa 100644 --- a/Demos/ColladaDemo/ColladaDemo.cpp +++ b/Demos/ColladaDemo/ColladaDemo.cpp @@ -54,7 +54,8 @@ class MyColladaConverter : public ColladaConverter const btVector3& linearMinLimits, const btVector3& linearMaxLimits, const btVector3& angularMinLimits, - const btVector3& angularMaxLimits + const btVector3& angularMaxLimits, + bool disableCollisionsBetweenLinkedBodies ) { if (bodyRef) @@ -78,7 +79,7 @@ class MyColladaConverter : public ColladaConverter genericConstraint->setAngularLowerLimit(angularMinLimits); genericConstraint->setAngularUpperLimit(angularMaxLimits); - m_demoApp->getDynamicsWorld()->addConstraint( genericConstraint ); + m_demoApp->getDynamicsWorld()->addConstraint( genericConstraint,disableCollisionsBetweenLinkedBodies ); return genericConstraint; }