Rope
06-04-2008 16:52:37
Well back in my FPS game,...
I've implemented a NxOgre::Character which we are controlling.
I also implemented the enemies as Character's ,too. I don't know if it is true or not. However , I'm stuck on somewhere while implementing like this.
Our character throws "man.mesh" when mouse_right_clicked.
Then, I want to do something when the "man.mesh"(NxOgre::Body) hits to the enemies(NxOgre::Character) .
I have set the groups of these two and implemented a Callback.
here, the program enters the onStartTouch function. Because I see that
the body, i mean the "man.mesh" dissapears from the screen and moves to the position I gave.
But, when I add the commented line which I hoped to move the enemy character; the program throws an exception.
I think it's because Character has NxActor, not Actor? ... Maybe not.
Somehow, b is null.
What should I do? Can I implement CharacterHitReport to many Characters? I mean all of the enemies...
Or, how should I implement the enemies to handle them like Character class, with a capsule and vectorMovements... Maybe making them body,too but with different params?
Thanks a lot!
I've implemented a NxOgre::Character which we are controlling.
I also implemented the enemies as Character's ,too. I don't know if it is true or not. However , I'm stuck on somewhere while implementing like this.
Our character throws "man.mesh" when mouse_right_clicked.
Then, I want to do something when the "man.mesh"(NxOgre::Body) hits to the enemies(NxOgre::Character) .
I have set the groups of these two and implemented a Callback.
class myCallback : public GroupCallback::InheritedCallback {
public:
void onStartTouch(Actor* a, Actor* b) {
a->setGlobalPosition(Vector3(1500,200,100));
//b->setGlobalPosition(Vector3(1500,200,100));
}
};
here, the program enters the onStartTouch function. Because I see that
the body, i mean the "man.mesh" dissapears from the screen and moves to the position I gave.
But, when I add the commented line which I hoped to move the enemy character; the program throws an exception.
I think it's because Character has NxActor, not Actor? ... Maybe not.
Somehow, b is null.
What should I do? Can I implement CharacterHitReport to many Characters? I mean all of the enemies...
Or, how should I implement the enemies to handle them like Character class, with a capsule and vectorMovements... Maybe making them body,too but with different params?
Thanks a lot!