NxOgre
17-10-2008 08:18:07
//
i want see two boxes collision,but it not work.
this is my code:
class myCallback : public GroupCallback::InheritedCallback {
public:
void onStartTouch(NxOgre::Actor*, NxOgre::Actor*) {}
void onEndTouch(NxOgre::Actor*, NxOgre::Actor*) {}
void onTouch(NxOgre::Actor*, NxOgre::Actor*) {}
};
NxOgre::ActorGroup* actorGroup=mNxScene->createActorGroup("head_one_group");
NxOgre::ActorGroup* actorGroup_two=mNxScene->createActorGroup("head_two_group");
actor=mNxScene->createActor("box", new NxOgre::Cube(1), Vector3(707,500,528), "mass:10,Group:head_one_group");
//first box
NodeRenderableParams nrp;
nrp.setToDefault();
nrp.mIdentifier=headNode->getName();
nrp.mIdentifierUsage=NxOgre::NodeRenderableParams::IU_Use;
body = mPhysiX->mNxScene->createBody("box",new NxOgre::Cube(1),Vector3(707,100,528),nrp,"mass:10");
////////////////////////////////////////////////////////
actor_two=mNxScene->createActor("box_two", new NxOgre::Cube(10), Vector3(707,200,528),"mass:10,Group:head_two_group");
//second box
NodeRenderableParams nr;
nr.setToDefault();
nr.mIdentifier=headNodeTwo->getName();
nr.mIdentifierUsage=NxOgre::NodeRenderableParams::IU_Use;
body_one =mNxScene->createBody("box_two",new NxOgre::Cube(1),Vector3(707,200,528),nr,"mass:10");
myCallback* mCallback=new myCallback();
actorGroup->setCallback(mCallback);
actorGroup->setCollisionCallback(actorGroup_two, NX_NOTIFY_ALL, true);
///////////////////////////////////
i run this program but it not execute the callback method
can any person help me,i come from china,my english is not good
i want see two boxes collision,but it not work.
this is my code:
class myCallback : public GroupCallback::InheritedCallback {
public:
void onStartTouch(NxOgre::Actor*, NxOgre::Actor*) {}
void onEndTouch(NxOgre::Actor*, NxOgre::Actor*) {}
void onTouch(NxOgre::Actor*, NxOgre::Actor*) {}
};
NxOgre::ActorGroup* actorGroup=mNxScene->createActorGroup("head_one_group");
NxOgre::ActorGroup* actorGroup_two=mNxScene->createActorGroup("head_two_group");
actor=mNxScene->createActor("box", new NxOgre::Cube(1), Vector3(707,500,528), "mass:10,Group:head_one_group");
//first box
NodeRenderableParams nrp;
nrp.setToDefault();
nrp.mIdentifier=headNode->getName();
nrp.mIdentifierUsage=NxOgre::NodeRenderableParams::IU_Use;
body = mPhysiX->mNxScene->createBody("box",new NxOgre::Cube(1),Vector3(707,100,528),nrp,"mass:10");
////////////////////////////////////////////////////////
actor_two=mNxScene->createActor("box_two", new NxOgre::Cube(10), Vector3(707,200,528),"mass:10,Group:head_two_group");
//second box
NodeRenderableParams nr;
nr.setToDefault();
nr.mIdentifier=headNodeTwo->getName();
nr.mIdentifierUsage=NxOgre::NodeRenderableParams::IU_Use;
body_one =mNxScene->createBody("box_two",new NxOgre::Cube(1),Vector3(707,200,528),nr,"mass:10");
myCallback* mCallback=new myCallback();
actorGroup->setCallback(mCallback);
actorGroup->setCollisionCallback(actorGroup_two, NX_NOTIFY_ALL, true);
///////////////////////////////////
i run this program but it not execute the callback method
can any person help me,i come from china,my english is not good