hustzion
12-06-2010 06:56:51
Hi,all great workman
I got a problem when using OgreNewt.
I load a mesh file which is included in OgreSDK1.7.0(ninja.mesh).
Then I create a box ,I control the box using the keyboard.
However,when the box rush to the man,sometimes it go through the man's body,sometimes the collision detection works.
How can I solve it?
here is the code:
I think there must be more work .But I really don't know what to do.....
Hope someone can help me.
I got a problem when using OgreNewt.
I load a mesh file which is included in OgreSDK1.7.0(ninja.mesh).
Then I create a box ,I control the box using the keyboard.
However,when the box rush to the man,sometimes it go through the man's body,sometimes the collision detection works.
How can I solve it?
here is the code:
void newApplication::createScene(void)
{
/*---------ogreEntity,skel headNode are members of newApplication------------*/
ogreEntity = mSceneMgr->createEntity("Head", "ninja.mesh");
skel=ogreEntity->getSkeleton();
headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
headNode->attachObject(ogreEntity);
/*---------------------------------rigid body-----------------------------*/
OgreNewt::CollisionPtr col ;
OgreNewt::CollisionPrimitives::TreeCollision *playercol=new OgreNewt::CollisionPrimitives::TreeCollision(mWorld,ogreEntity,true,0);
col=OgreNewt::CollisionPtr(playercol);
}
I think there must be more work .But I really don't know what to do.....
Hope someone can help me.