CMyTerrainData
The reference application contains an example helper class used to populate the terrain with data.
Read time 1 minuteLast updated 2 hours ago
The reference application isn't necessarily intended for production use, but it does provide some useful functionality. The object, contained in , reads height maps and normal maps, providing all of the data needed by SpeedTree's terrain engine. Note that you are free to use any method you like to populate the terrain and that is completely decoupled and independent from the Runtime SDK's terrain system.
CMyTerrainDataMyTerrainData.h/cpp/inlCMyTerrainDataThe class also provides functionality for returning slope values at any point on the terrain which is useful for avoiding placing trees on areas that are too steep, or for providing slope cues that help you know how much to push the tree into the ground.
CMyTerrainDataSee for an example use of the class as well as a fully implemented callback used to populate the terrain in the reference application.
CMyTerrain::Populate()CMyTerrainData