TreeCollision doesn't work well

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:
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. :roll:

kallaspriit

16-06-2010 18:15:08

Show the box-controlling code, you are not setting the position-orientation directly are you?

hustzion

17-06-2010 13:33:19

Thanks all,
now I "solved" the problem.actually there is no problem.
I use to hold that the treecollision can be moved.

SFCBias

22-06-2010 13:09:12

Technically, it can but it takes a little more work to do it.