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.