Assign bodies to nodes

majc

06-07-2008 02:03:47

Im creating newton world in the class physicsInterface and this class is a base class of NPCCollisionHandler and playerCollisionHandler.
When i pass the world variable trough:

//create Newton Frame Listener
Ogre::FrameListener* mNewtonListener;
mNewtonListener = new OgreNewt::BasicFrameListener( mGraphInterface->getWindow(),mGraphInterface->getSceneManager(),physInterface->getNewtWorld() , 60 );
mGraphInterface->getRoot()->addFrameListener(mNewtonListener);


NPC and Player dont have any physical bodies, but if i create the world variable inside of playerCollisionHandler:

//create Newton Frame Listener
Ogre::FrameListener* mNewtonListener;
mNewtonListener = new OgreNewt::BasicFrameListener( mGraphInterface->getWindow(),mGraphInterface->getSceneManager(),playerCollision->getNewtWorld() , 60 );

Only the player gets a body.
Why is this happening?