Again I've a problem, now it's with NewtonHingeCallBack.
I have decalaired a NewtonJoint like this:
- Code: Select all
NewtonJoint* joint = NewtonConstraintCreateHinge(nWorld, &pivot[0], &dir[0], cube2Body, cubeBody);
NewtonJointSetStiffness(joint, 1);
NewtonJointSetCollisionState(joint, 1);
NewtonHingeSetUserCallback(joint, NewtonHingeCallBack1);
Problem comes with last line, I need to add NewtonHingeCallBack function like this:
- Code: Select all
void NewtonHingeCallBack1(const NewtonJoint* joint)
{
dVector pivot(5.0f,10.0f,1.0f);
NewtonUserJointAddLinearRow(joint, &pivot[0],&pivot[0],&pivot[0]);
NewtonJointSetCollisionState(joint,1);
NewtonUserJointSetRowStiffness(joint, 1);
NewtonUserJointSetRowAcceleration(joint, 0.5);
}
During compilation I get error:
Error 1 error C2664: 'NewtonHingeSetUserCallback' : cannot convert parameter 2 from 'void (__cdecl *)(const NewtonJoint *)' to 'NewtonHingeCallBack' e:\ryj3k's documents\visual studio 2008\projects\ogrenewtapp\ogrenewtapp\main.cpp 186
What's wrong? I've no idea, I tried to change type of NewtonHingecallBack1 from void to NewtonHingeCallBack, but it generates same error. Anybody knows how to handle it?
Thanks in advance.