[Bleeding]ActorsGroups callback

gugus

08-12-2007 14:39:37

Hello.I am trying ActorsGroups callbacks with the new version of NxOgre,and it doesn't work.

Here is my code(it was working fine with NxOgre 0.9)
mWorld = new NxOgre::World("FrameListener: Yes, log: html");
NxOgre::Scene* mScene;// = mWorld->createScene("Paris", pSceneManager, "gravity: yes, floor: yes");
mScene = mWorld->createScene("Main", "gravity: yes, floor: yes, controller: accumulator, renderer: ogre, rendererUserData: pSceneManager");

NxOgre::ActorGroup* mGroup = mScene->createActorGroup("1");
NxOgre::ActorGroup* mGroup2 = mScene->createActorGroup("2");
//creation d’une entitée PHYSIQUE

Ogre::Entity* entity = pSceneManager->createEntity("Hello", "OgreHead.mesh");
mScene->createBody("Rien1", new NxOgre::CubeShape(10,10,10), Ogre::Vector3(0,15, 0), "model: Hello, model-type: reference", "mass: 20 ,Group: 1");

Ogre::Entity* entity2 = pSceneManager->createEntity("Hello2", "OgreHead.mesh");
mScene->createBody("Rien2", new NxOgre::CubeShape(10,10,10), Ogre::Vector3(0,30, 0), "model: Hello2, model-type: reference", "mass: 20 ,Group: 2");

myContactReporter* mReporter = new myContactReporter();
mReporter->mScene = mScene;
mReporter->app = this;
mGroup->setCallback(mReporter,false);
mGroup->setCollisionCallback(mGroup2, NX_NOTIFY_ALL, true);


and
class myContactReporter : public NxOgre::GroupCallback::InheritedCallback
{
public:

void onTouch(NxOgre::Actor* a, NxOgre::Actor* b);
void onStartTouch(NxOgre::Actor* a, NxOgre::Actor* b);
void onEndTouch(NxOgre::Actor* a, NxOgre::Actor* b);
NxOgre::Scene* mScene;
Application* app;
};


onTouch,etc are not called and i am sure of it since it exit the application when it's call.

Ps:mGroup->setCallback<myContactReporter>(mReporter,&myContactReporter::onEndTouch,&myContactReporter::onEndTouch,&myContactReporter::onEndTouch,true);
This doesn't seems to be implemented and this NxOgre::Body* mBody2 = mScene->createBody("OgreHead.mesh", new NxOgre::CubeShape(10.5), Ogre::Vector3(0,20,0), "Mass: 50,Group: 1"); is not working for me.

gugus

10-12-2007 15:14:55

nobody knows? :(
Does anyone tried actors Groups callback with NxOgre 1.0'18?If yes ,did it worked?

luis

10-12-2007 16:50:22

i was using method delegation in 0.9:
mGroup->setCallback<myContactReporter>(mReporter,&myContactReporter::onEndTouch,&myContactReporter::onEndTouch,&myContactReporter::onEndTouch,true);


But it isn't working anymore.... ContactCallback has a new parameter in the method (StreamContact or something like that, i don have the code here...) so it is not going to work.

Now I'm using NxOgre 1.0'18 and i had to change to the inherited version, but again, add the last parameter in the method callback ;)

betajaen

10-12-2007 17:01:42

I'll investigate what the problem is, when I have some spare time away from cloth and fluids.

gugus

11-12-2007 15:22:47

ok.
Thanks!