contactTest issue with 2.86.1 ?

Post Reply
picca
Posts: 1
Joined: Thu Aug 10, 2017 9:19 am

contactTest issue with 2.86.1 ?

Post by picca »

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: Select all

	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: Select all

/* 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: Select all

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
Post Reply