Non-terrain-gem changes in support of upcoming terrain work. (#3345)

In preparation for a prototype Terrain Gem to get submitted, there are a few changes that are needed outside of the Terrain Gem as well:

The TerrainDataNotificationBus lives in AzFramework/Terrain, and needed to be extended to contain an optional OnTerrainDataChanged event to notify other systems when a terrain region has changed.
The HeightmapUpdateNotificationBus was removed, as this was a legacy file from the old already-removed terrain system.
The EditorWrappedComponentBase<> wrapper received a small optimization to ensure that ConfigurationChanged() is only called when the value of visibility actually changes. With prefabs, it appears that sometimes OnEntityVisibilityChanged could be called multiple times in a row with the same visibility value.
The TerrainSurfaceDataSystemComponent was updated to use the correct busses, and is ready to be moved to the Terrain Gem in a subsequent PR.

Signed-off-by: Mike Balfour 82224783+mbalfour-amzn@users.noreply.github.com
This commit is contained in:
Mike Balfour
2021-08-20 11:31:19 -05:00
committed by GitHub
parent cef82f0313
commit bf42e3f02a
8 changed files with 75 additions and 110 deletions
@@ -102,11 +102,25 @@ namespace AzFramework
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
//////////////////////////////////////////////////////////////////////////
virtual void OnTerrainDataCreateBegin() {};
virtual void OnTerrainDataCreateEnd() {};
enum TerrainDataChangedMask : uint8_t
{
None = 0b00000000,
Settings = 0b00000001,
HeightData = 0b00000010,
ColorData = 0b00000100,
SurfaceData = 0b00001000
};
virtual void OnTerrainDataDestroyBegin() {};
virtual void OnTerrainDataDestroyEnd() {};
virtual void OnTerrainDataCreateBegin() {}
virtual void OnTerrainDataCreateEnd() {}
virtual void OnTerrainDataDestroyBegin() {}
virtual void OnTerrainDataDestroyEnd() {}
virtual void OnTerrainDataChanged(
[[maybe_unused]] const AZ::Aabb& dirtyRegion, [[maybe_unused]] TerrainDataChangedMask dataChangedMask)
{
}
};
using TerrainDataNotificationBus = AZ::EBus<TerrainDataNotifications>;