• 13
• 18
• 19
• 27
• 10

# 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.

## 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();	while(ti.hasMoreElements())	{		Terrain* t = ti.getNext()->instance;		if(t)		{			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 ?										PagedTerrainGeometry::_heightCallback, 										(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?

Thanks.

##### Share on other sites
Have you tried posting this over at the Ogre forums?

##### 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.