private void InterfaceFlipTerrain(Object[] args)
{
String direction = (String)args[0];
if (direction.ToLower().StartsWith("y"))
{
for (int x = 0; x < Constants.RegionSize; x++)
{
for (int y = 0; y < Constants.RegionSize / 2; y++)
{
for (int z = 0; z < Constants.RegionSize; z++)
{
byte vox = m_channel.GetVoxel(x, y, z);
byte flippedVox = m_channel.GetVoxel(x, (int)Constants.RegionSize - 1 - y, z);
m_channel.SetVoxel(x, y, z, flippedVox);
m_channel.SetVoxel(x, (int)Constants.RegionSize - 1 - y, z, vox);
}
}
}
}
else if (direction.ToLower().StartsWith("x"))
{
for (int y = 0; y < Constants.RegionSize; y++)
{
for (int x = 0; x < Constants.RegionSize / 2; x++)
{
for (int z = 0; z < Constants.RegionSize; z++)
{
byte v = m_channel.GetVoxel(x, y, z);
byte flippedVox = m_channel.GetVoxel((int)Constants.RegionSize - 1 - x, y, z);
m_channel.SetVoxel(x, y, z, flippedVox);
m_channel.SetVoxel((int)Constants.RegionSize - 1 - x, y, z, v);
}
}
}
}
else
{
m_log.Error("Unrecognised direction - need x or y");
}
CheckForTerrainUpdates();
}