An alternate approach for getting terrain vertex data

Maxi

09-04-2008 14:04:39

I was looking for an easy way to get a page's vertex data in order to use it for the physics of my game. The common way seems to be the following:

1. Force PLSM to load a page
2. Wait for the page being loaded in the background
3. Get the page's vertex data with getOption()
4. Unload the page

I would prefer a more direct way to get the vertex data, so I want to write a getVertexData() function that uses the heightmap of a page to calculate the position of the vertices at once.
Of course the calculations had to be as a near as possible to the calculations done by PLSM when the geometry is created, therefore I wanted to ask if someone has done something similar and could provide some code or at least can tell me where "heightmap to vertex positions" calculations are done in the PLSM source.

I know this sounds lazy, but since I focused on the physics of my project I'm realy in no mood to browse the whole PLSM2 source. :D