devilatmay
29-06-2011 03:39:31
hello everyone, i have spent days to solve this problem,but i still get no ideas about it.So, can anyone help me?
I built my program with octreeSceneManager,and added terrain, just like tutorial 3 did.Then, I found original OgreNewt can not support terrain collision directly,I serached this page http://www.ogre3d.org/addonforums/viewtopic.php?f=4&t=11696
I was encouraged by that totally! But,when I modified my lib and code,it run without a correct behaviour.A rigidbody can collide terrain just once!!!,And then it was falling through my terrain!!
how can I do next ? Thanks for your help!
code Like this
I built my program with octreeSceneManager,and added terrain, just like tutorial 3 did.Then, I found original OgreNewt can not support terrain collision directly,I serached this page http://www.ogre3d.org/addonforums/viewtopic.php?f=4&t=11696
I was encouraged by that totally! But,when I modified my lib and code,it run without a correct behaviour.A rigidbody can collide terrain just once!!!,And then it was falling through my terrain!!
how can I do next ? Thanks for your help!
code Like this
………
………
if (mTerrainsImported)
{
Ogre::TerrainGroup::TerrainIterator ti = mTerrainGroup->getTerrainIterator();
while(ti.hasMoreElements())
{
Ogre::Terrain* t = ti.getNext()->instance;
initBlendMaps(t);
//code about OgreNewt
OgreNewt::CollisionPtr mapcol = OgreNewt::CollisionPtr(new OgreNewt::CollisionPrimitives::HeightField(_world, t, 200));
OgreNewt::Body* bod = new OgreNewt::Body(_world, mapcol );
}
}
……
……