majc
24-09-2006 21:23:26
How can i add more than one mesh to collisiontree?
I have this code:
Thanks in advance!
I have this code:
// Collision game map
Entity* map;
SceneNode* mapnode;
map = mSceneMgr->createEntity("Myplane","floor.mesh");
mapnode = mSceneMgr->getRootSceneNode()->createChildSceneNode( "MapNode" );
mapnode->attachObject( map );
map->setMaterialName( "Examples/Rockwall" );
mapnode->setPosition(0,0,0);
mapnode->scale(10,10,10);
map->setCastShadows( false );
OgreNewt::CollisionPrimitives::TreeCollisionSceneParser* stat_col = new OgreNewt::CollisionPrimitives::TreeCollisionSceneParser( m_World );
stat_col->parseScene( mapnode, true );
OgreNewt::Body* bod = new OgreNewt::Body( m_World, stat_col );
bod->attachToNode( mapnode );
Thanks in advance!