SurfaceTagWeights optimization (#7436)
* Add comparison operators to SurfaceTagWeight. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Changed AddSurfaceTagWeight to always combine weights. This simplifies the API a bit and defines the behavior if someone ever tries to add a duplicate tag. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added benchmarks for measuring the performance-critical APIs. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Changed SurfaceTagWeights to a fixed_vector. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
This commit is contained in:
@@ -29,6 +29,19 @@ namespace AzFramework::SurfaceData
|
||||
{
|
||||
}
|
||||
|
||||
//! Equality comparison operator for SurfaceTagWeight.
|
||||
bool operator==(const SurfaceTagWeight& rhs) const
|
||||
{
|
||||
return (m_surfaceType == rhs.m_surfaceType) && (m_weight == rhs.m_weight);
|
||||
}
|
||||
|
||||
//! Inequality comparison operator for SurfaceTagWeight.
|
||||
bool operator!=(const SurfaceTagWeight& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
|
||||
AZ::Crc32 m_surfaceType = AZ::Crc32(Constants::s_unassignedTagName);
|
||||
float m_weight = 0.0f; //! A Value in the range [0.0f .. 1.0f]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user