add support for the <interpenetrate>, which disables collisions between two bodies linked by a constraint.

This commit is contained in:
ejcoumans 2007-09-18 04:51:26 +00:00
parent 323eed2885
commit f7117466a2
3 changed files with 11 additions and 6 deletions

View File

@ -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

View File

@ -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,

View File

@ -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;
}