Hi,
I'm using WorldTerrainGet and WorldTerrainSet to copy/paste parts of a terrain.
But I can't get it to paste the terrain, and I'm not sure about a number of things:
1. If I use WorldTerrainSet on an area without existing terrain, will it create new terrain? So far, nothing shows up. Not even if I overwrite existing terrain. I also tried with WorldTerrainSetHeight, just to see if that works. But that's also not working.
2. I'm not sure if the height image I get is correct. I want to draw it using height.draw(rect), but that crashes. Shouldn't I be able to draw this image?
I store the info like this:
Code:
m_Areas[x][y] = new AreaInfo(area, &heightMap, colorMap, &materialMap);
My AreaInfo looks like this:
Code:
class AreaInfo
{
AreaInfo(VecI2& areaCoord, Image* heightMap, Image* colorMap, Edit.MaterialMap* matMap)
{
area = areaCoord;
height = heightMap;
color = colorMap;
materialMap = matMap;
}
VecI2 area;
Image* height = null;
Image* color = null;
Edit.MaterialMap* materialMap = null;
}
And then I set it like this:
Code:
EI.worldTerrainSet(m_CurWorld, VecI2(x, y), *(m_Areas[x][y].height), *(m_Areas[x][y].materialMap), m_Areas[x][y].color);
Thanks