Hi.
How to get all vertices from terrain. I need this to construct my terrain collisions to NovodeX. When I loading terrain witch procedures from NovodeX demos my terrain don't cover terrain from OGRE. How to load terrain just as OGRE?
I search on forum but I don't find anything about this.
The easiest way I think is to register a TerrainPageSourceListener that will get called when the terrain is loaded. It will give you the raw terrain data as an array of normalised [0..1] Reals.
MyListener* myListener = new MyListener; // your custom page source listener class
TerrainPageSourceListenerManager::getSingleton().addListener(myListener)
And be sure to delete myListener again on program termination.
It's pretty straight forward - you just get callbacks as defined in TerrainPageSourceListener (parameters etc are in the docs).
But in TerrainPageSourceListener is only abstract pageConstructed(). I don't know yet how to do this. Please give me complete code with geting this array.
What is MyListener? I must create new class from TerrainPageSourceListener???
But in TerrainPageSourceListener is only abstract pageConstructed(). I don't know yet how to do this. Please give me complete code with geting this array.
It's a virtual member function which you override in your subclass of TerrainPageSourceListener, which DWORD called MyListener. Ie
class MyListener : public TerrainPageSourceListener
{
void pageConstructed(size_t pagex, size_t pagez, Real* heightData)
{
// Do what you want
}
};
This is such a common idiom that I didn't think it needed explaining. If this still confuses you, you probably need to get a little more C++ experience before tackling something like Ogre & Novodex integration.