NatureSceneManager->"NaturePluginRoot"->setP

Problems building or running the engine, queries about how to use features etc.
User avatar
glateur
Halfling
Posts: 44
Joined: Mon Aug 02, 2004 6:39 pm
Location: Belgium

NatureSceneManager->"NaturePluginRoot"->setP

Post by glateur »

Hi all,

I'm experiencing some strange behaviour with the world geometry when using the NatureSceneManager. What I am trying to do is to change the position of this geometry. Apparently, the default position of it is off-center (positive x & z), and I would like to get it centered (eg -w/2 <= x <= w/2)

I have tried setPosition(), like you would with any other node, like this:

Code: Select all

SceneNode * rnode = mSceneMgr->getRootSceneNode();
static_cast<SceneNode*>(rnode->getChild("NaturePluginRoot"))->setPosition(-2048, 0, -1024);
The "NaturePluginRoot"-child is defined to contain the world geometry by the NatureSceneMgr. This appears to be correct when I examine the scene hierarchy. Btw, I'm using a non-square heightmap, but that doesn't seem to the problem - Demo_Terrain has simular issues.

What I'm seeing is that the terrain seems to run away as I approach it with the camera. I don't think the terrain is actually moving, but it's like the clipping of the camera has changed (near plane seems to be to far), so it's like this clipping is affected by setPosition(). :?:

I have no idea why this is happening, so I'm hoping someone can help me out here.



Thanks,
g



EDIT: I meant Demo_Nature, obviously