Merge branch 'development' of https://github.com/o3de/o3de into TerrainMaterialsFix
This commit is contained in:
+4
@@ -57,6 +57,10 @@ namespace SurfaceData
|
||||
void UpdateSurfaceDataModifier(const SurfaceDataRegistryHandle& handle, const SurfaceDataRegistryEntry& entry) override;
|
||||
|
||||
void RefreshSurfaceData(const AZ::Aabb& dirtyArea) override;
|
||||
|
||||
SurfaceDataRegistryHandle GetSurfaceDataProviderHandle(const AZ::EntityId& providerEntityId) override;
|
||||
SurfaceDataRegistryHandle GetSurfaceDataModifierHandle(const AZ::EntityId& modifierEntityId) override;
|
||||
|
||||
private:
|
||||
SurfaceDataRegistryHandle RegisterSurfaceDataProviderInternal(const SurfaceDataRegistryEntry& entry);
|
||||
SurfaceDataRegistryEntry UnregisterSurfaceDataProviderInternal(const SurfaceDataRegistryHandle& handle);
|
||||
@@ -58,6 +58,10 @@ namespace SurfaceData
|
||||
|
||||
// Notify any dependent systems that they need to refresh their surface data for the provided area.
|
||||
virtual void RefreshSurfaceData(const AZ::Aabb& dirtyArea) = 0;
|
||||
|
||||
// Get the SurfaceDataRegistryHandle for a given entityId.
|
||||
virtual SurfaceDataRegistryHandle GetSurfaceDataProviderHandle(const AZ::EntityId& providerEntityId) = 0;
|
||||
virtual SurfaceDataRegistryHandle GetSurfaceDataModifierHandle(const AZ::EntityId& modifierEntityId) = 0;
|
||||
};
|
||||
|
||||
typedef AZ::EBus<SurfaceDataSystemRequests> SurfaceDataSystemRequestBus;
|
||||
|
||||
@@ -250,6 +250,16 @@ namespace UnitTest
|
||||
{
|
||||
}
|
||||
|
||||
SurfaceData::SurfaceDataRegistryHandle GetSurfaceDataProviderHandle(const AZ::EntityId& providerEntityId) override
|
||||
{
|
||||
return GetSurfaceProviderHandle(providerEntityId);
|
||||
}
|
||||
|
||||
SurfaceData::SurfaceDataRegistryHandle GetSurfaceDataModifierHandle(const AZ::EntityId& modifierEntityId) override
|
||||
{
|
||||
return GetSurfaceModifierHandle(modifierEntityId);
|
||||
}
|
||||
|
||||
SurfaceData::SurfaceDataRegistryHandle GetSurfaceProviderHandle(AZ::EntityId id)
|
||||
{
|
||||
return GetEntryHandle(id, m_providers);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "SurfaceDataColliderComponent.h"
|
||||
#include <SurfaceData/Components/SurfaceDataColliderComponent.h>
|
||||
|
||||
#include <AzCore/Debug/Profiler.h>
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "SurfaceDataShapeComponent.h"
|
||||
#include <SurfaceData/Components/SurfaceDataShapeComponent.h>
|
||||
|
||||
#include <AzCore/Component/TransformBus.h>
|
||||
#include <AzCore/Debug/Profiler.h>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <AzCore/Module/Module.h>
|
||||
#include <AzToolsFramework/ToolsComponents/EditorComponentBase.h>
|
||||
#include <AzToolsFramework/ToolsComponents/EditorVisibilityBus.h>
|
||||
#include <Components/SurfaceDataColliderComponent.h>
|
||||
#include <SurfaceData/Components/SurfaceDataColliderComponent.h>
|
||||
#include <LmbrCentral/Component/EditorWrappedComponentBase.h>
|
||||
|
||||
namespace SurfaceData
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <AzCore/Module/Module.h>
|
||||
#include <AzToolsFramework/ToolsComponents/EditorComponentBase.h>
|
||||
#include <AzToolsFramework/ToolsComponents/EditorVisibilityBus.h>
|
||||
#include <Components/SurfaceDataShapeComponent.h>
|
||||
#include <SurfaceData/Components/SurfaceDataShapeComponent.h>
|
||||
#include <LmbrCentral/Component/EditorWrappedComponentBase.h>
|
||||
|
||||
namespace SurfaceData
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
#include <SurfaceDataEditorModule.h>
|
||||
#include <SurfaceDataSystemComponent.h>
|
||||
#include <SurfaceData/Components/SurfaceDataSystemComponent.h>
|
||||
#include <Editor/EditorSurfaceDataSystemComponent.h>
|
||||
#include <Editor/EditorSurfaceDataColliderComponent.h>
|
||||
#include <Editor/EditorSurfaceDataShapeComponent.h>
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
*/
|
||||
|
||||
#include <SurfaceDataModule.h>
|
||||
#include <SurfaceDataSystemComponent.h>
|
||||
#include <Components/SurfaceDataColliderComponent.h>
|
||||
#include <Components/SurfaceDataShapeComponent.h>
|
||||
#include <SurfaceData/Components/SurfaceDataSystemComponent.h>
|
||||
#include <SurfaceData/Components/SurfaceDataColliderComponent.h>
|
||||
#include <SurfaceData/Components/SurfaceDataShapeComponent.h>
|
||||
|
||||
namespace SurfaceData
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <AzCore/std/sort.h>
|
||||
|
||||
#include "SurfaceDataSystemComponent.h"
|
||||
#include <SurfaceData/Components/SurfaceDataSystemComponent.h>
|
||||
#include <SurfaceData/SurfaceDataConstants.h>
|
||||
#include <SurfaceData/SurfaceTag.h>
|
||||
#include <SurfaceData/SurfaceDataSystemNotificationBus.h>
|
||||
@@ -175,6 +175,34 @@ namespace SurfaceData
|
||||
SurfaceDataSystemNotificationBus::Broadcast(&SurfaceDataSystemNotificationBus::Events::OnSurfaceChanged, AZ::EntityId(), dirtyBounds, dirtyBounds);
|
||||
}
|
||||
|
||||
SurfaceDataRegistryHandle SurfaceDataSystemComponent::GetSurfaceDataProviderHandle(const AZ::EntityId& providerEntityId)
|
||||
{
|
||||
AZStd::shared_lock<decltype(m_registrationMutex)> registrationLock(m_registrationMutex);
|
||||
|
||||
for (auto& [providerHandle, providerEntry] : m_registeredSurfaceDataProviders)
|
||||
{
|
||||
if (providerEntry.m_entityId == providerEntityId)
|
||||
{
|
||||
return providerHandle;
|
||||
}
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
SurfaceDataRegistryHandle SurfaceDataSystemComponent::GetSurfaceDataModifierHandle(const AZ::EntityId& modifierEntityId)
|
||||
{
|
||||
AZStd::shared_lock<decltype(m_registrationMutex)> registrationLock(m_registrationMutex);
|
||||
|
||||
for (auto& [modifierHandle, modifierEntry] : m_registeredSurfaceDataModifiers)
|
||||
{
|
||||
if (modifierEntry.m_entityId == modifierEntityId)
|
||||
{
|
||||
return modifierHandle;
|
||||
}
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
void SurfaceDataSystemComponent::GetSurfacePoints(const AZ::Vector3& inPosition, const SurfaceTagVector& desiredTags, SurfacePointList& surfacePointList) const
|
||||
{
|
||||
const bool useTagFilters = HasValidTags(desiredTags);
|
||||
|
||||
@@ -226,9 +226,7 @@ namespace SurfaceData
|
||||
|
||||
void SurfacePointList::ReserveSpace(size_t maxPointsPerInput)
|
||||
{
|
||||
AZ_Assert(
|
||||
m_surfacePositionList.size() < maxPointsPerInput,
|
||||
"Trying to reserve space on a list that is already using more points than requested.");
|
||||
AZ_Assert(m_surfacePositionList.empty(), "Trying to reserve space on a list that is already being used.");
|
||||
|
||||
m_surfaceCreatorIdList.reserve(maxPointsPerInput);
|
||||
m_surfacePositionList.reserve(maxPointsPerInput);
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
#include <AzFramework/Components/TransformComponent.h>
|
||||
#include <LmbrCentral/Shape/BoxShapeComponentBus.h>
|
||||
#include <LmbrCentral/Shape/CylinderShapeComponentBus.h>
|
||||
#include <SurfaceDataSystemComponent.h>
|
||||
#include <Components/SurfaceDataShapeComponent.h>
|
||||
#include <SurfaceData/Components/SurfaceDataSystemComponent.h>
|
||||
#include <SurfaceData/Components/SurfaceDataShapeComponent.h>
|
||||
|
||||
namespace UnitTest
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <AzCore/Component/Entity.h>
|
||||
#include <AzCore/Component/TransformBus.h>
|
||||
|
||||
#include <Source/Components/SurfaceDataColliderComponent.h>
|
||||
#include <SurfaceData/Components/SurfaceDataColliderComponent.h>
|
||||
|
||||
#include <AzFramework/Physics/Common/PhysicsSceneQueries.h>
|
||||
#include <AzFramework/Physics/Shape.h>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
#include <AzCore/Script/ScriptContext.h>
|
||||
#include <AzCore/std/chrono/clocks.h>
|
||||
#include <SurfaceDataSystemComponent.h>
|
||||
#include <SurfaceData/Components/SurfaceDataSystemComponent.h>
|
||||
#include <SurfaceDataModule.h>
|
||||
#include <SurfaceData/SurfaceDataProviderRequestBus.h>
|
||||
#include <SurfaceData/SurfaceDataModifierRequestBus.h>
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
#include <SurfaceData/Tests/SurfaceDataTestMocks.h>
|
||||
|
||||
#include <AzFramework/Components/TransformComponent.h>
|
||||
#include <SurfaceDataSystemComponent.h>
|
||||
#include <Components/SurfaceDataColliderComponent.h>
|
||||
#include <Components/SurfaceDataShapeComponent.h>
|
||||
#include <SurfaceData/Components/SurfaceDataSystemComponent.h>
|
||||
#include <SurfaceData/Components/SurfaceDataColliderComponent.h>
|
||||
#include <SurfaceData/Components/SurfaceDataShapeComponent.h>
|
||||
|
||||
|
||||
namespace UnitTest
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
#
|
||||
|
||||
set(FILES
|
||||
Include/SurfaceData/Components/SurfaceDataColliderComponent.h
|
||||
Include/SurfaceData/Components/SurfaceDataShapeComponent.h
|
||||
Include/SurfaceData/Components/SurfaceDataSystemComponent.h
|
||||
Include/SurfaceData/SurfaceDataConstants.h
|
||||
Include/SurfaceData/SurfaceDataTypes.h
|
||||
Include/SurfaceData/SurfaceDataSystemRequestBus.h
|
||||
@@ -18,12 +21,9 @@ set(FILES
|
||||
Include/SurfaceData/SurfaceTag.h
|
||||
Include/SurfaceData/Utility/SurfaceDataUtility.h
|
||||
Source/SurfaceDataSystemComponent.cpp
|
||||
Source/SurfaceDataSystemComponent.h
|
||||
Source/SurfaceDataTypes.cpp
|
||||
Source/SurfaceTag.cpp
|
||||
Source/Components/SurfaceDataColliderComponent.cpp
|
||||
Source/Components/SurfaceDataColliderComponent.h
|
||||
Source/Components/SurfaceDataShapeComponent.cpp
|
||||
Source/Components/SurfaceDataShapeComponent.h
|
||||
Source/SurfaceDataUtility.cpp
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user