PLSM2 & OgreOde terrain scale and size problem

SuperMegaMau

13-02-2007 14:29:40

Just to make sure I'm doing the right thing:
- I'm using a heightmap 513x513 size
- I'm also using 2 pages on each side, so pages with 257x257 size (Width & Height in cfg file = 2)
- My Scale in cfg file is 100000x25000x100000 (x,y,z)

So, when creating the TerrainGeometry I do the following:

_terrain = new OgreOde::TerrainGeometry(_world->getDefaultSpace(),Ogre::Vector3(100000/512.0f,25000,100000/512.0f),513,true);


also tried this:

mSceneMgr->getOption("Scale", &scale);
mSceneMgr->getOption("PageSize", &nodes_per_side);

_terrain = new OgreOde::TerrainGeometry(_world->getDefaultSpace(),scale,nodes_per_side,true);


None of this methods worked, My object kept falling throw, and stop somewhere below the terrain...

tuan kuranes

24-02-2007 11:35:25

Can you link this thread in Known bugs thread ?

rewb0rn

24-02-2007 11:49:29


None of this methods worked, My object kept falling throw, and stop somewhere below the terrain...


Allthough you have no other physical objects in your world? Maybe you should create a transform geometry for your terrain, sounds to me like the collision is just not transformed to the correct position.

SuperMegaMau

26-02-2007 16:24:26

I think it's not just the transform that is incorrect, the scale seems to be wrong too. I tied all PLSM original terrains, the only one that works is NewWorld2 and that included in the LandScape demo.

I'm going to investigate some more now, and post result in a few houres

tuan kuranes

28-02-2007 13:59:15

Check if OgreODe::TerrainMeshGeometry correclty correct map Ode to PLSM2 and PLSM2 to Ode ray and results.

SuperMegaMau

28-02-2007 14:07:40

Do you mean if the getHeight from OgreOde and a vartical rayQuery throw the terrain give the same result?

If this is what you are requesting, I already did that, and the values I got are opposite, getHeight gives me for example -9000 and the ray gives 9000. I tried inverting the value and even switch the getHeight function for a rayquery, with no luck

tuan kuranes

28-02-2007 14:50:43

Nope, I mean check if Terrainmesh ray origin translation (upon terrain centered or not) is correct.

SuperMegaMau

28-02-2007 15:33:07

don't know how to do that :( sorry

tuan kuranes

28-02-2007 17:01:08

in TerrainGeometry::_heightCallback(), check if ray should no be translated by _halfWorldSizeX, _halfWorldSizeY, or any tweak to get correct ray origin on any page, on any terrain size.

SuperMegaMau

01-03-2007 16:54:27

now that you mention those two variables, I figured out that I was using an old version of OgreOde, not the last one from January 12, so I got it from CVS, and tried it.

Now to simplify the problem, I made a 1 page terrain, 513x513 vertex wide and a scale of 200000x20000x200000. The problem now is that the colision is at the max Y for the whole terrain, just like a plane this height.

The translation in the _heightCallback seems ok in both versions of OgreOde, correctly centered.

BTW, I'm using the last version of ODE from sourceforge