setStandardForceCallback dont work,help

sct

02-10-2007 00:12:47

i check all my code ,but i cant find what is wrong in my code.

Actually,my code run strangely.After i call

body->setStandardForceCallback();

// set the initial orientation and velocity!
body->setPositionOrientation( pos, camorient );
body->setVelocity( (dir * 500.0) );
//body->setAutoFreeze(0);


the body still stand there. The world->update function run normally,but all callback functions aren't called.

Game_Ender

02-10-2007 02:06:26

You need to post more code. From that sample everything looks fine. Have you made sure to carefully compare to the samples/demos?

walaber

02-10-2007 02:42:34

the body is probably outside the limits of the World. it defaults to (-100,-100,-100) to (100,100,100), so if you start your body at (0,500,0), it will not update.

make your world bigger, or move the object inside those limits, and you should be OK.

sct

02-10-2007 05:00:08

Sorry for no posting in time,YES, is exact what you say,walaber.
i miss setworldsize.The terrain which i play with is 4000*4000, so it oversteps
the default.now it is ok,thx very much. The body speed is restive,sometimes the body
go through the terrain.