stack overflow when compound object collides

binofet
Posts: 20
Joined: Fri Jun 15, 2007 5:03 pm

stack overflow when compound object collides

Post by binofet »

Hello everyone, please excuse my noobishness.

I've recently been hired on as an intern for a game developement company and was put to the task of implementing bullet into their engine. Things have been going rather well so far until I added compound objects into the picture.

The compound obj is successfully created but as soon as it comes into contact with anything, something goes wrong.

the stack looks like this:
btCompoundCollisionAlgorithm::btCompoundCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo & ci={...}, btCollisionObject * body0=0x0146f368, btCollisionObject * body1=0x0141be90, bool isSwapped=false)

btCompoundCollisionAlgorithm::CreateFunc::CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo & ci={...}, btCollisionObject * body0=0x0146f368, btCollisionObject * body1=0x0141be90) Line 50 + 0x39 bytes

btCollisionDispatcher::findAlgorithm(btCollisionObject * body0=0x0146f368, btCollisionObject * body1=0x0141be90, btPersistentManifold * sharedManifold=0x00000000) Line 162 + 0x8d bytes
...
ad infinum


i've gone through the CcdPhysicsDemo quite thoroughly.

thank you very much for any help,

bino
DevO
Posts: 95
Joined: Fri Mar 31, 2006 7:13 pm

Post by DevO »

Hello,

can this be reproduced in the Bullet demos?

I am also using compound objects in my system too without any problems until now.
binofet
Posts: 20
Joined: Fri Jun 15, 2007 5:03 pm

Post by binofet »

I've been trying to find what the difference is. I had overloaded the internalStepSimulation (amound other things) but disabled my overloads and it still happens.

so, no, i can't reproduce it in the demos yet.

also, you say that you have been using compound objects and had no problems until now . . . did you mean to imply you were having problems too?

thanks again, i'll try to get some more info shortly,

bino
binofet
Posts: 20
Joined: Fri Jun 15, 2007 5:03 pm

Post by binofet »

i found the problem.

i was effectively doing this:
btCompoundShape* compShape = new btCompoundShape();
btCollisionShape* parentShapePtr = MyRigidBody->getCollisionShape();
parentShapePtr = compShape;

as opposed to the correct way:
btCompoundShape* compShape = new btCompoundShape();
btCollisionShape* parentShapePtr = MyRigidBody->getCollisionShape();
MyRigidBody->setCollisionShape(compShape);

i just missed this because in the CcdPhysicsDemo it is using global pointers to shapes, not passed in pointers to rigidbodies.

thanks a lot for taking a look DevO,

bino
DevO
Posts: 95
Joined: Fri Mar 31, 2006 7:13 pm

Post by DevO »

Well then the problem is solved?

Also may be you can look at new GIMPACT 0.2 compound shape.

Code: Select all

btGImpactCompoundShape * mycompound = new btGImpactCompoundShape();

btTransform localtransform;
 .... Setting transformation

//add shapes with transformation
btCollisionShape * subshape = creatingShape(0);
mycompound->addChildShape(localtransform,subshape);
.... Setting transformation
btCollisionShape * subshape2 = creatingShape(1);
mycompound->addChildShape(localtransform,subshape);
.... add more shapes
If you have another problems then ask.
May be I can help, because I am working now with Bullet and GIMPACT too.