[setCustomForceAndTorqueCallback]Stop after a moment(SOLVED)

kain

14-12-2007 00:12:04

Hello,

I am using a setCustomForceAndTorqueCallback function to make my ship move. It is working like this:

i have declare this :
mNewtShip->setCustomForceAndTorqueCallback( boost::bind( &Object3d::forceBodyCallback, this, _1 ) );
mNewtShip->setAutoFreeze(0);


and a custom forceCallback function with this code:
me->addForce(spd);

I change spd when i want with a keyboard letter.

My problem is that at a certain time the callback function is not called anymore .. I have made some tests and it appears that there is a small cube where my ship can move and as soon as he reach the side the callback doesnt work any more ..
I didn't declare any floor or things like that so what can cause a callback function to stop ??

I hope i am clear enough ..

Regards,
Jérémy

walaber

14-12-2007 07:39:22

you need to set the size of the World (world->setSize) to something bigger it seems...

it defaults to (-100,-100,-100) to (100,100,100).

kain

14-12-2007 09:40:15

Tks that was the problem!
I don"t see exactly what size i have to set, so i put -/+10000.

Thanks again for the quick answer!

walaber

15-12-2007 04:45:13

you should set it to the size of your game world, whatever that is.

kain

17-12-2007 15:21:38

Yes, in my case it is for a shootemup game so the spaceship will fly until it has finished killling every ship ;)