[SOLVED]ContactTest with btCollisionObjects

Post Reply
trying
Posts: 15
Joined: Sat May 16, 2015 4:32 pm

[SOLVED]ContactTest with btCollisionObjects

Post by trying » Mon Dec 07, 2015 4:15 pm

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);
Last edited by trying on Tue Dec 08, 2015 2:29 pm, edited 1 time in total.

xexuxjy
Posts: 225
Joined: Wed Jan 07, 2009 11:43 am
Location: London

Re: ContactTest with btCollisionObjects

Post by xexuxjy » Mon Dec 07, 2015 8:20 pm

Can you post some more of your setup code, and ideally your stacktrace on crashing?

trying
Posts: 15
Joined: Sat May 16, 2015 4:32 pm

Re: ContactTest with btCollisionObjects

Post by trying » Tue Dec 08, 2015 12:52 pm

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".

trying
Posts: 15
Joined: Sat May 16, 2015 4:32 pm

Re: [SOLVED]ContactTest with btCollisionObjects

Post by trying » Tue Dec 08, 2015 2:30 pm

Solved, after the contact test I was deleting the object incorrectly which caused an unexpected situation.

Post Reply