setCustomForceAndTorqueCallback?

r1cky17

22-11-2007 15:10:33

how to use setCustomForceAndTorqueCallback?
thx

trilobite

27-11-2007 06:06:16

Yes, this is a mysterious one. This is how I got it to work...

Within a function in my class, pbSimpleAircraft, I called it like this...

bod->setCustomForceAndTorqueCallback<pbSimpleAircraft>(&pbSimpleAircraft::userAircraftCallback, (pbSimpleAircraft*)this);
where
"bod" was created beforehand as... OgreNewt::Body* bod.

"userAircraftCallback" is the callback function implemented in the pbSimpleAircraft class, as in...
void pbSimpleAircraft::userAircraftCallback(OgreNewt::Body *body)

Don't ask me how or why it works this way. All I know is that it compiles, builds and works without error.

I hope this helps.

kain

18-12-2007 21:18:00

You can watch here how i have done it:
http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=6036

even if i have some problem with the render after ^^