Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Thu Aug 10, 2017 9:36 am 
Offline

Joined: Thu Aug 10, 2017 9:19 am
Posts: 1
Hello, I am using the bullet library from the Debian distribution.
now that I upgraded from 2.83.7 -> 2.86.1
th eunit test of my library does not work any more.

the principe is quite simple I have a static work where I put objects, move them and check for collision wit the next core.

Code:
   gettimeofday(&debut, NULL);
   if(self->_btWorld){
      self->_btWorld->performDiscreteCollisionDetection();
      self->_btWorld->updateAabbs();
   }
   gettimeofday(&fin, NULL);
   timersub(&fin, &debut, &self->stats.collision);
        numManifolds = self->_btWorld->getDispatcher()->getNumManifolds();

   /* reset all the collisions */
   for(size_t i=0; i<self->config->len; i++)
      for(size_t j=0; j<self->config->models[i]->len; j++)
         self->config->models[i]->objects[j]->is_colliding = FALSE;

   /* check all the collisions */
   for(size_t i=0; i<self->config->len; i++)
      for(size_t j=0; j<self->config->models[i]->len; j++){
         Hkl3DObject *object = self->config->models[i]->objects[j];
         ContactSensorCallback callback(object);
         self->_btWorld->contactTest(object->btObject, callback);
      }


at the end, I update my internal objects using this callback
Code:
/* use for the transparency of colliding objects */
struct ContactSensorCallback : public btCollisionWorld::ContactResultCallback
{
   ContactSensorCallback(Hkl3DObject *object)
      : btCollisionWorld::ContactResultCallback(),
        collisionObject(object->btObject),
        object(object)
      { }

   btCollisionObject *collisionObject;
   Hkl3DObject *object;

   virtual btScalar addSingleResult(btManifoldPoint & cp,
                const btCollisionObjectWrapper *colObj0, int partId0, int index0,
                const btCollisionObjectWrapper *colObj1, int partId1, int index1)
      {
         if(colObj0->m_collisionObject == collisionObject
            || colObj1->m_collisionObject == collisionObject)
            object->is_colliding = TRUE;
         return 0;
      }
};


quite simple and it works right until I migrate to 2.86.1.

When I instrumented my callback with a simple

Code:
fprintf(stdout, "toto\n);"


I saw that the callback was executed with 2.83.7 and previous versions -> 2.82-r2704
but not with 2.86.1.

So my question is.
Is it because I do not use Bullet the right way or is is a bug in the latest bullet ?

thanks for your help


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group