mangoo
23-05-2006 19:17:39
Hi,
i am relatively new to OgreNewt, but i have some experience with other physics engines. Until now everything worked well, but now i wanted to use the setCustomForceAndTorqueCallback function, but somehow i cant figure out how to declare it. I read through the tutorials and there it works fine, with this syntax:
info.mBody->setCustomForceAndTorqueCallback<OgreNewtonFrameListener>( &OgreNewtonFrameListener::dragCallback, this );
so i also tried something like this...
obj->mNewtonBody->setCustomForceAndTorqueCallback<World>( &World::standardForceCallback, PlayState::getInstance()->mWorld );
But somehow the compiler doesnt like it ,-)
My World has this function
void standardForceCallback( OgreNewt::Body* me );
and the compiler always says:
c:\....\src\InGame\ObjectFactory.cpp(53): error C2275: 'World' : illegal use of this type as an expression
It has something to do with the template brackets, its because of <World> and i dont know what i am doing wrong.
Does anybody have an idea what it could be?
i am relatively new to OgreNewt, but i have some experience with other physics engines. Until now everything worked well, but now i wanted to use the setCustomForceAndTorqueCallback function, but somehow i cant figure out how to declare it. I read through the tutorials and there it works fine, with this syntax:
info.mBody->setCustomForceAndTorqueCallback<OgreNewtonFrameListener>( &OgreNewtonFrameListener::dragCallback, this );
so i also tried something like this...
obj->mNewtonBody->setCustomForceAndTorqueCallback<World>( &World::standardForceCallback, PlayState::getInstance()->mWorld );
But somehow the compiler doesnt like it ,-)
My World has this function
void standardForceCallback( OgreNewt::Body* me );
and the compiler always says:
c:\....\src\InGame\ObjectFactory.cpp(53): error C2275: 'World' : illegal use of this type as an expression
It has something to do with the template brackets, its because of <World> and i dont know what i am doing wrong.
Does anybody have an idea what it could be?