error with setCustomForceAndTorqueCallback

Alexisfire

15-11-2010 16:08:41

Hi,
Trying to do a setCustomForceAndTorqueCallback() on my object which is a floating car.

Here's my code

void Auto::listener()
{
carBody->setCustomForceAndTorqueCallback<Auto>(&Auto::forceCallback,this);
}

void Auto::forceCallback()
{
//carBody->
}


When i compile i get this error
Error 1 error C2064: term does not evaluate to a function taking 4 arguments c: \ boost_1_42_0 \ boost \ function \ function_template.hpp 225 1

Really don't know what to do, tried all the solution founded on this forum but nothing work :/

Thnx!

SFCBias

25-11-2010 03:59:47

It says you're missing arguments

Chookaa

15-12-2010 00:28:21

your callback function needs to take (OgreNewt::Body*, float timeStep, int threadIndex) parameters and returns a void, so in your case it should be:

void Auto::forceCallback(OgreNewt::Body*, float timeStep, int threadIndex)
{
// do something
}