Little annoying compilation problem.

Kendrix

13-10-2008 12:22:10

Hello all.

I'm using NxOgre since a few weeks without any particular problem.
However I'm unable to compile the following line (and I have already searched the forum for answers) :

mBulletsGroup->setCallback<PhysicsManager>( this, &PhysicsManager::onBulletToUnit, NULL, NULL);

PhysicsManager is a singleton class that inherits NxOgre::GroupCallback::InheritedCallback.

onBulletToUnit has the following prototype :
void onBulletToUnit(NxOgre::Actor* _a, NxOgre::Actor* _b);

I got the following compilation error :

>c:\projets\scip1_pac14\dependencies\nxogre\include\nxogregroup.h(173) : error C2661: 'NxOgre::GroupCallback::GroupCallback' : aucune fonction surchargée ne nécessite 5 arguments
3> c:\projets\scip1_pac14\source\sdk3d\physicsmanager.cpp(100) : voir la référence à l'instanciation de la fonction modèle 'void NxOgre::ActorGroup::setCallback<SDK3D::PhysicsManager>(T *,void (__thiscall SDK3D::PhysicsManager::* )(NxOgre::Actor *,NxOgre::Actor *),void (__thiscall SDK3D::PhysicsManager::* )(NxOgre::Actor *,NxOgre::Actor *),void (__thiscall SDK3D::PhysicsManager::* )(NxOgre::Actor *,NxOgre::Actor *),bool)' en cours de compilation
3> with
3> [
3> T=SDK3D::PhysicsManager
3> ]

The fun part is that if I remove one arguments the compiler tells me that I need 5 arguments ^^.

What am I missing ?

EDIT : Forgot to tell you version numbers : NxOgre 1.021

Prophet

13-10-2008 13:08:50

I guess it would help if you translate the error message into English. At least for me. :)

Kendrix

13-10-2008 13:25:51

Shame on me I forgot to translate the cut/paste ^^.

The compiler tells me that the SetCallback(...) does not need 5 arguments.

I solve my problem using the other SetCallback (with the NxOgre::GroupCallback::InheritedCallback parameter only), but I'd like to know why I can't use the other method so I can declare my own callback functions.

Kendrix

13-10-2008 14:04:15

Ok I solved my problem. It seems that some of the NxOgreGroup.h functions were not maintained since the add of the ContactStream system.

I have corrected the prototypes and now it compile & links fine. And my callbacks are called at the right time so everything is ok ^^.

Thanks anyway :)