• Advertisement
Sign in to follow this  

Ode and Ogre Paged terrain

This topic is 2816 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have been trying for weeks now to get Ode to work nicely with the paged terrain system on Ogre and I have nothing to show for it. I don't even know if the methods I am using to access the data Ode needs is even correct.

f32 worldSize = 0.0;
f32 test = 0.0;
u32 size = 0;
TerrainGroup::TerrainIterator ti = _terrainGroup->getTerrainIterator();
Terrain* t = ti.getNext()->instance;
size += t->getSize();
if(t->getMaxHeight() > _max_height)
_max_height = t->getMaxHeight();
//worldSize += t->getWorldSize();
worldSize = _terrainGroup->getTerrainWorldSize();

dHeightfieldDataID heightid = dGeomHeightfieldDataCreate();
dGeomHeightfieldDataBuildCallback( heightid, //getSpaceID(space),
this, // pUserData ?
(dReal) (worldSize), //X
(dReal) (worldSize), //Z
size, // w // Vertex count along edge >= 2
size, // h // Vertex count along edge >= 2
REAL( 1.0 ), //scale
REAL( 0.0 ), // vOffset
10.0f, // vThickness
0); // nWrapMode

// Give some very bounds which, while conservative,
// makes AABB computation more accurate than +/-INF.
dGeomHeightfieldDataSetBounds( heightid, REAL( 0.0 ), _max_height );
_geom = dCreateHeightfield( getSpaceID(space), heightid, 1 );

As you can see I am iterating through the terrain group to get data on each piece (4 terrains) of terrain. I am getting height data back when my "PagedTerrainGeometry::_heightCallback" is called using:

_terrainGroup->getHeightAtWorldPosition(position.x, position.y, position.z);

Does anyone know of what I should be looking at, or does anyone see something I am forgetting, am I giving it the right data.

Has anyone implemented collision on paged terrain using Ode or Bullet yet?


Share this post

Link to post
Share on other sites
Yes of course, but no one has replied and very rarely ever reply to any of my posts. I have 5 up there now that has not been touched.

Share this post

Link to post
Share on other sites
The Ogre3D forum is pretty crowded so if you are not getting replies there then you should consider re-formulating your post/question. You need to make a very clear question to get good replies (in general when posting to message boards).

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement