Setting up"OGRE tutor. terrain"in Cake - Edit:DONE

nord

02-07-2008 23:41:53

Hi all.
I have read lots of terrain topics but I think I couldn't understand the terrain loading in nx ogre.
I am trying to create the same terrain in Ogre tutorial 3 (http://www.ogre3d.org/wiki/index.php/Basic_Tutorial_3)
of course with collision in cake example.

1) I have copied the same terrain.cfg file to cake's media directory.

2) I have put the terrain textures (terrain.png terrain_detail.jpg terrain_texture.jpg) under media\materials\textures path inside the cake's directory (same as in pure ogre example).

3) I have added "FileSystem=Media/Materials/Textures/" line to the resource.cfg file of Cake example.

4) Then in the "void start()" function of cake, I have loaded the physical terrain by this chunk of code.

mScene->createActor("terrainActor", new NxOgre::TerrainShape("terrain.png", 100 ), Ogre::Vector3::ZERO, "static: yes" );
mScene->getActor("terrainActor")->setGlobalPosition(Vector3(-70,-30,-70));

everything works fine I can see the terrain in remoteDebugger and my car can move on it. But of course I cannot see the visualisation of the terrain in cake application.

5) To see the visualisation I add the following code

mSceneMgr->setWorldGeometry("terrain.cfg");

to the "void start()" function in cake and

I changed the
mSceneMgr = r->getRoot()->createSceneManager("TerrainSceneManager");
to
mSceneMgr = r->getRoot()->createSceneManager(ST_EXTERIOR_CLOSE);
in cake's class terrain : public Decoration

But my app closes as soon as I run it. Here is the ogre log :

02:05:19: OGRE EXCEPTION(2:InvalidParametersException): World geometry is not supported by the generic SceneManager. in SceneManager::setWorldGeometry at e:\projects\ogrecvs\branches\eihort_vc8_clean\ogrenew\ogremain\src\ogrescenemanager.cpp (line 1306)


Any solution?
Probably I am lacking some knowledge about terrains.

PS:using nxogre Nxogre 0.9-38 and physx 2.7.3

nord

03-07-2008 00:17:57

DONE :) I have changed the chunk of code as follows

Ogre::SceneManager* Renderer::createSceneMgr(const Ogre::String &name) {
return mRoot->createSceneManager(ST_EXTERIOR_CLOSE,name);//(ST_GENERIC, name);
}

in cake.h

Now I can see the terrain in my Cake application.

PS : special thanks to Elric.