Fix issue with un-initialized broadphase proxy during broadphase insert. It was an chicken-egg problem:

1) creating a broadphase proxy -> adding pairs during insertion. But during this pair insertion, the btGhostObject broadphase handle isn't set yet (it is done in step 2)
2) assign the broadphase proxy to btGhostObject
Thanks to ihar3d for the report http://bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2864
This commit is contained in:
erwin.coumans
2008-11-17 18:40:21 +00:00
parent bc131321a8
commit fe461296c6
3 changed files with 31 additions and 21 deletions

View File

@@ -90,12 +90,6 @@ void CharacterDemo::initPhysics()
m_character = new btKinematicCharacterController (m_ghostObject,capsule,stepHeight);
#endif
///only collide with static for now (no interaction with dynamic objects)
m_dynamicsWorld->addCollisionObject(m_ghostObject,btBroadphaseProxy::CharacterFilter, btBroadphaseProxy::StaticFilter|btBroadphaseProxy::DefaultFilter);
m_dynamicsWorld->addCharacter(m_character);
////////////////
/// Create some basic environment from a Quake level
@@ -142,6 +136,12 @@ void CharacterDemo::initPhysics()
fclose(file);
}
///only collide with static for now (no interaction with dynamic objects)
m_dynamicsWorld->addCollisionObject(m_ghostObject,btBroadphaseProxy::CharacterFilter, btBroadphaseProxy::StaticFilter|btBroadphaseProxy::DefaultFilter);
m_dynamicsWorld->addCharacter(m_character);
///////////////
clientResetScene();