Add benchmarks and unit tests for GetSurfacePoints*. (#7216)
* Add benchmarks and unit tests for GetSurfacePoints*. The benchmarks are very enlightening - the existing implementation of GetSurfacePointsFromRegion (and GetSurfacePointsFromList) is currently measurably *slower* than just calling GetSurfacePoints() many times in a loop. This is due to all of the extra allocation overhead that's currently happening with the way these data structures are built. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Small syntax improvement Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Small update to the benchmark to use filtered results. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Removed accidental extra include. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
This commit is contained in:
@@ -240,15 +240,16 @@ namespace SurfaceData
|
||||
point.m_entityId = GetEntityId();
|
||||
point.m_position = hitPosition;
|
||||
point.m_normal = hitNormal;
|
||||
AddMaxValueForMasks(point.m_masks, m_configuration.m_providerTags, 1.0f);
|
||||
for (auto& tag : m_configuration.m_providerTags)
|
||||
{
|
||||
point.m_masks[tag] = 1.0f;
|
||||
}
|
||||
surfacePointList.push_back(point);
|
||||
}
|
||||
}
|
||||
|
||||
void SurfaceDataColliderComponent::ModifySurfacePoints(SurfacePointList& surfacePointList) const
|
||||
{
|
||||
AZ_PROFILE_FUNCTION(Entity);
|
||||
|
||||
AZStd::lock_guard<decltype(m_cacheMutex)> lock(m_cacheMutex);
|
||||
|
||||
if (m_colliderBounds.IsValid() && !m_configuration.m_modifierTags.empty())
|
||||
|
||||
Reference in New Issue
Block a user