-
With CreateMapFromHeightMapToRef() , you can create as many map of data (maps) that you need and keep a reference to each of them with a simple variable. You could store them in an array for example.
-
Each map must hold the real World coordinates. Say, the map1 is located on the East of the map2, then all the x coordinates of the map1 should be greater than the map2 ones in theory (assuming that x increases when going to East and z increases when going to North).
-
It’s probably a missing feature here, but you need to translate by your own the computed Wordl coordinates of the generated map to your wanted final positions. If the map1 is supposed to be at x+1000 from the World origin, then add +1000 to each x coordinates in the map array. Only you know where the generated map1 is supposed to be in the World if it’s not centered on the World origin (default behavior).
-
The same way, only you know that the map1 should tile the map1 on its right side. So the rule “if (camera.position.x > someLimit) { terrain.mapData = map1; }” must be implemented by the user in his own logic. More generally, here again, if several data map must be tiled, maybe a side structure may be necessary to store for each tile what are the other tiles on its sides and from what world limit coordinates the terrain should be set with the next tile. This feature is not provided by the library because the DynamicTerrain wasn’t designed to work in a tiling mode. But it can also work that way. The feature is just be done by the user with his own needs.
-
If this kind of tiling is implemented and unless the camera always keep moving in the same direction, maybe it would be pertinent to have the maps covering each other on a certain width (holding the same data and depicting a shared part of the World), so the terrain map swapping could be smooth. Example : if camera heading toward the North and camera z > someLimit and camera z still < someHigherLimit, then swap the current map to the northern map, both rendering currently, between these both limits, the very same terrain.
1 Like