Ode and Ogre Paged terrain

Started by
2 comments, last by reptor 13 years, 9 months ago
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.
Advertisement
Have you tried posting this over at the Ogre forums?
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
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.
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).

This topic is closed to new replies.

Advertisement