You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
2.8 KiB
C++
78 lines
2.8 KiB
C++
/*
|
|
* Copyright (c) Contributors to the Open 3D Engine Project.
|
|
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AzCore/Component/ComponentBus.h>
|
|
|
|
#include <SurfaceData/SurfaceDataTypes.h>
|
|
|
|
#include <Atom/RPI.Public/Material/Material.h>
|
|
|
|
#include <TerrainRenderer/Components/TerrainSurfaceMaterialsListComponent.h>
|
|
|
|
namespace Terrain
|
|
{
|
|
//! This bus provides retrieval of information from Terrain Surfaces.
|
|
class TerrainAreaMaterialRequests
|
|
: public AZ::ComponentBus
|
|
{
|
|
public:
|
|
////////////////////////////////////////////////////////////////////////
|
|
// EBusTraits
|
|
using MutexType = AZStd::recursive_mutex;
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
virtual ~TerrainAreaMaterialRequests() = default;
|
|
|
|
//! Get the Material asset assigned to a particular surface tag.
|
|
virtual const AZStd::vector<struct TerrainSurfaceMaterialMapping>& GetSurfaceMaterialMappings(AZ::Aabb& region) const = 0;
|
|
};
|
|
|
|
using TerrainAreaMaterialRequestBus = AZ::EBus<TerrainAreaMaterialRequests>;
|
|
|
|
//! Notifications for when the surface -> material mapping changes..
|
|
class TerrainAreaMaterialNotifications : public AZ::EBusTraits
|
|
{
|
|
public:
|
|
//////////////////////////////////////////////////////////////////////////
|
|
// EBusTraits overrides
|
|
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
|
|
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
virtual void OnTerrainSurfaceMaterialMappingCreated(
|
|
[[maybe_unused]] AZ::EntityId entityId,
|
|
[[maybe_unused]] SurfaceData::SurfaceTag surface,
|
|
[[maybe_unused]] AZ::Data::Instance<AZ::RPI::Material> material)
|
|
{
|
|
}
|
|
|
|
virtual void OnTerrainSurfaceMaterialMappingDestroyed(
|
|
[[maybe_unused]] AZ::EntityId entityId,
|
|
[[maybe_unused]] SurfaceData::SurfaceTag surface)
|
|
{
|
|
}
|
|
|
|
virtual void OnTerrainSurfaceMaterialMappingChanged(
|
|
[[maybe_unused]] AZ::EntityId entityId,
|
|
[[maybe_unused]] SurfaceData::SurfaceTag surface,
|
|
[[maybe_unused]] AZ::Data::Instance<AZ::RPI::Material> material)
|
|
{
|
|
}
|
|
|
|
virtual void OnTerrainSurfaceMaterialMappingRegionChanged(
|
|
[[maybe_unused]] AZ::EntityId entityId,
|
|
[[maybe_unused]] const AZ::Aabb& oldRegion,
|
|
[[maybe_unused]] const AZ::Aabb& newRegion)
|
|
{
|
|
}
|
|
};
|
|
using TerrainAreaMaterialNotificationBus = AZ::EBus<TerrainAreaMaterialNotifications>;
|
|
} // namespace Terrain
|