@@ -59,7 +59,27 @@ namespace SurfaceData
59
59
->Attribute (AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
60
60
->Attribute (AZ::Script::Attributes::Category, " Vegetation" )
61
61
->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
+ })
63
83
->Event (" RefreshSurfaceData" , &SurfaceDataSystemRequestBus::Events::RefreshSurfaceData)
64
84
->Event (" GetSurfaceDataProviderHandle" , &SurfaceDataSystemRequestBus::Events::GetSurfaceDataProviderHandle)
65
85
->Event (" GetSurfaceDataModifierHandle" , &SurfaceDataSystemRequestBus::Events::GetSurfaceDataModifierHandle)
@@ -238,7 +258,7 @@ namespace SurfaceData
238
258
auto entryItr = m_registeredSurfaceDataProviders.find (providerHandle);
239
259
if (entryItr != m_registeredSurfaceDataProviders.end ())
240
260
{
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.
242
262
// This includes all of the provider's tags, as well as any surface modifier tags that exist in the bounds,
243
263
// because the affected surface points have the potential of getting the modifier tags applied as well.
244
264
SurfaceTagSet affectedSurfaceTags = GetAffectedSurfaceTags (dirtyBounds, entryItr->second .m_tags );
0 commit comments