Fix some crashes in FeatherstoneMultiBodyDemo, when using a fixed base

Create two btMultiBody, one fixed and one free base
Preparation towards btMultiBodyConstraint
This commit is contained in:
erwin.coumans
2013-10-02 03:07:52 +00:00
parent f02dd51597
commit d8b6a02a7a
8 changed files with 397 additions and 35 deletions

View File

@@ -33,13 +33,16 @@ public:
:m_multiBody(multiBody),
m_link(link)
{
if (link>=0 || (multiBody && !multiBody->hasFixedBase()))
//we need to remove the 'CF_STATIC_OBJECT' flag, otherwise links/base doesn't merge islands
//this means that some constraints might point to bodies that are not in the islands, causing crashes
//if (link>=0 || (multiBody && !multiBody->hasFixedBase()))
{
m_collisionFlags &= (~btCollisionObject::CF_STATIC_OBJECT);
} else
{
m_collisionFlags |= (btCollisionObject::CF_STATIC_OBJECT);
}
// else
//{
// m_collisionFlags |= (btCollisionObject::CF_STATIC_OBJECT);
//}
m_internalType = CO_FEATHERSTONE_LINK;
}