bullet doesn't show objects even they are active

Post Reply
babak6
Posts: 2
Joined: Thu Jan 31, 2013 4:16 pm

bullet doesn't show objects even they are active

Post by babak6 » Sat Mar 30, 2013 11:39 am

I created a two leg robot in blender and imported it to bullet. Now when I run my program, after few seconds the left leg will be disappeared. I fought that bullet deactivate objects
if they have not move. (I don't have any gravity in my scene).
So I write this code

Code: Select all

 for(int i=0; i<debugger->getDynamicsWorld()->getNumCollisionObjects();i++) {
            if( !debugger->getDynamicsWorld()->getCollisionObjectArray()[i]->isActive() )
                std::cout << "obj " << i << " is inactive" << std::endl;
I see this ouput
obj 1 is inactive
obj 2 is inactive
obj 3 is inactive
obj 4 is inactive
objects 1-4 are for left foot and 5-9 for right foot. So I activate them with this code in initphysics() function:

Code: Select all

  for(int i=0;i<m_dynamicsWorld->getNumCollisionObjects();i++)
        m_dynamicsWorld->getCollisionObjectArray()[i]->setActivationState(DISABLE_DEACTIVATION);
Now they are all active. But after few seconds, they disappeared. Any Idea about this?

Post Reply