Page 1 of 1

[SOLVED]ContactTest with btCollisionObjects

Posted: Mon Dec 07, 2015 4:15 pm
by trying
Hello,

I have tried using contactTest with collision objects and it didn't work as expected, it crashed my application on the second call whereas contactTest worked well with rigid bodies.

Object Creation:

Code: Select all

	btCollisionObject* col = new btCollisionObject();
	col->setCollisionShape(shape);
	col->setCollisionFlags(btCollisionObject::CF_STATIC_OBJECT);
	col->setWorldTransform(btTransform(rot, position));
	dynamicsWorld->addCollisionObject(col);
contactTest:

Code: Select all

                CollisionSensor callback;
		dynamicsWorld->contactTest(col, callback);

Re: ContactTest with btCollisionObjects

Posted: Mon Dec 07, 2015 8:20 pm
by xexuxjy
Can you post some more of your setup code, and ideally your stacktrace on crashing?

Re: ContactTest with btCollisionObjects

Posted: Tue Dec 08, 2015 12:52 pm
by trying
xexuxjy wrote:Can you post some more of your setup code, and ideally your stacktrace on crashing?
No exception occurs, it just say that "The application has stopped working".

Re: [SOLVED]ContactTest with btCollisionObjects

Posted: Tue Dec 08, 2015 2:30 pm
by trying
Solved, after the contact test I was deleting the object incorrectly which caused an unexpected situation.