Skip to content

Commit 382892a

Browse files
committed
Merge branch 'development' of https://github.com/o3de/o3de into daimini/PythonTestBuildErrorFix
Signed-off-by: Danilo Aimini <[email protected]>
2 parents e9a0377 + f10206a commit 382892a

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.cpp

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,27 @@ namespace SurfaceData
5959
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
6060
->Attribute(AZ::Script::Attributes::Category, "Vegetation")
6161
->Attribute(AZ::Script::Attributes::Module, "surface_data")
62-
->Event("GetSurfacePoints", &SurfaceDataSystemRequestBus::Events::GetSurfacePoints)
62+
->Event(
63+
"GetSurfacePoints",
64+
[](SurfaceData::SurfaceDataSystem* handler, const AZ::Vector3& inPosition, const SurfaceTagVector& desiredTags) -> AZStd::vector<AzFramework::SurfaceData::SurfacePoint>
65+
{
66+
AZStd::vector<AzFramework::SurfaceData::SurfacePoint> result;
67+
SurfaceData::SurfacePointList surfacePointList;
68+
handler->GetSurfacePoints(inPosition, desiredTags, surfacePointList);
69+
surfacePointList.EnumeratePoints(
70+
[&result](
71+
[[maybe_unused]] size_t inPositionIndex, const AZ::Vector3& position, const AZ::Vector3& normal, const SurfaceData::SurfaceTagWeights& masks)-> bool
72+
{
73+
AzFramework::SurfaceData::SurfacePoint point;
74+
point.m_position = position;
75+
point.m_normal = normal;
76+
point.m_surfaceTags = masks.GetSurfaceTagWeightList();
77+
78+
result.emplace_back(point);
79+
return true;
80+
});
81+
return result;
82+
})
6383
->Event("RefreshSurfaceData", &SurfaceDataSystemRequestBus::Events::RefreshSurfaceData)
6484
->Event("GetSurfaceDataProviderHandle", &SurfaceDataSystemRequestBus::Events::GetSurfaceDataProviderHandle)
6585
->Event("GetSurfaceDataModifierHandle", &SurfaceDataSystemRequestBus::Events::GetSurfaceDataModifierHandle)
@@ -238,7 +258,7 @@ namespace SurfaceData
238258
auto entryItr = m_registeredSurfaceDataProviders.find(providerHandle);
239259
if (entryItr != m_registeredSurfaceDataProviders.end())
240260
{
241-
// Get the set of surface tags that can be affected by refreshing a surface data provider.
261+
// Get the set of surface tags that can be affected by refreshing a surface data provider.
242262
// This includes all of the provider's tags, as well as any surface modifier tags that exist in the bounds,
243263
// because the affected surface points have the potential of getting the modifier tags applied as well.
244264
SurfaceTagSet affectedSurfaceTags = GetAffectedSurfaceTags(dirtyBounds, entryItr->second.m_tags);

0 commit comments

Comments
 (0)