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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user