NxOgre PhysicsManager class and Heightmaps.xhf

EdCampion

03-01-2010 18:38:34

Hi guys,
I have a few questions Im slightly confused about the role scene manager's play in NxOgre.
I try to create a heightmap using the code below which is cobbled together from code I found on this forum.How does the mScene->createSceneGeometry work? i.e does it only create an Actor(I can see a heightmap using the visual debugger however it reduces my fps to 0.6) and I still need to use the Terrain scenemanager setting its sceneGeometry to terrain.cfg.? Or does it create a fully fledged body in which case how does it get texture info etc.

I also dont understand the setLocalPose I would like to position the heightmap at (0,0,0) as I presume the default terrain from terrain.cfg draws there(I'm aware of the flip/rotate issue with heightmaps solved in Ogre 1.7 but I dont want to go there atm if it is possible to achieve a good result without going there) but these numbers are the only ones that allow me to see the heightmap in the visual debugger.


NxOgre::ResourceSystem::getSingleton()->openArchive("resources", "file:C:/OgreHeightfield/Ogre Project/OgreDemo/Resources");
NxOgre::HeightField* hf = NxOgre::HeightFieldManager::getSingleton()->load("resources:terrain.xhf");
NxOgre::HeightFieldGeometry* hfg = new NxOgre::HeightFieldGeometry(hf, NxOgre::int3(1500,150,1500));
hfg->setLocalPose(NxOgre::Matrix44(NxOgre:(0,35,0)));
mScene->createSceneGeometry(hfg);



Finally, I'd like to write a Physics Manager class atm all NxOgre code is in the main game class. But I'm unsure of how it would work and how it would pass things around. i.e how would Player get access to World and scene from Physics Manager?
Thanks in advance,
Ed