Added terrain surface data notifications (#5067)
* Fix notifications for surface data changes. Separated the notifications from the surface component and the height component to add a reason to a RefreshArea request. This makes it possible to distinguish between surface changes and height changes and provide the appropriate OnTerrainDataChanged flags. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Reworked to use a changeMask instead of separate calls. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * PR Feedback Judicious use of "using" to reduce a bunch of bulky namespaces. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
This commit is contained in:
@@ -119,7 +119,9 @@ namespace Terrain
|
||||
LmbrCentral::DependencyNotificationBus::Handler::BusDisconnect();
|
||||
|
||||
// Since this height data will no longer exist, notify the terrain system to refresh the area.
|
||||
TerrainSystemServiceRequestBus::Broadcast(&TerrainSystemServiceRequestBus::Events::RefreshArea, GetEntityId());
|
||||
TerrainSystemServiceRequestBus::Broadcast(
|
||||
&TerrainSystemServiceRequestBus::Events::RefreshArea, GetEntityId(),
|
||||
AzFramework::Terrain::TerrainDataNotifications::HeightData);
|
||||
}
|
||||
|
||||
bool TerrainHeightGradientListComponent::ReadInConfig(const AZ::ComponentConfig* baseConfig)
|
||||
@@ -176,7 +178,9 @@ namespace Terrain
|
||||
void TerrainHeightGradientListComponent::OnCompositionChanged()
|
||||
{
|
||||
RefreshMinMaxHeights();
|
||||
TerrainSystemServiceRequestBus::Broadcast(&TerrainSystemServiceRequestBus::Events::RefreshArea, GetEntityId());
|
||||
TerrainSystemServiceRequestBus::Broadcast(
|
||||
&TerrainSystemServiceRequestBus::Events::RefreshArea, GetEntityId(),
|
||||
AzFramework::Terrain::TerrainDataNotifications::HeightData);
|
||||
}
|
||||
|
||||
void TerrainHeightGradientListComponent::RefreshMinMaxHeights()
|
||||
|
||||
Reference in New Issue
Block a user