Change GetValues() to take in const positions. (#6987)
* Change GetValues() to take in const positions. To support this, span needed some template deductions to correctly convert from non-const containers to const ones. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Removed the most problematic template deduction rules. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Remove duplicate validate_iterator methods. iterator type is a pointer, not a value, so "const iterator" and "const const_iterator" produce the same function signature. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed the span types. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
This commit is contained in:
@@ -33,23 +33,24 @@ namespace AZStd
|
||||
*
|
||||
* Since the span does not copy and store any data, it is only valid as long as the data used to create it is valid.
|
||||
*/
|
||||
template <class Element>
|
||||
template <class T>
|
||||
class span final
|
||||
{
|
||||
public:
|
||||
using value_type = Element;
|
||||
using element_type = T;
|
||||
using value_type = AZStd::remove_cv_t<T>;
|
||||
|
||||
using pointer = value_type*;
|
||||
using const_pointer = const value_type*;
|
||||
using pointer = T*;
|
||||
using const_pointer = const T*;
|
||||
|
||||
using reference = value_type&;
|
||||
using const_reference = const value_type&;
|
||||
using reference = T&;
|
||||
using const_reference = const T&;
|
||||
|
||||
using size_type = AZStd::size_t;
|
||||
using difference_type = AZStd::ptrdiff_t;
|
||||
|
||||
using iterator = value_type*;
|
||||
using const_iterator = const value_type*;
|
||||
using iterator = T*;
|
||||
using const_iterator = const T*;
|
||||
using reverse_iterator = AZStd::reverse_iterator<iterator>;
|
||||
using const_reverse_iterator = AZStd::reverse_iterator<const_iterator>;
|
||||
|
||||
@@ -65,21 +66,11 @@ namespace AZStd
|
||||
// create a span to just the first element instead of an entire array.
|
||||
constexpr span(const_pointer s) = delete;
|
||||
|
||||
template<AZStd::size_t N>
|
||||
constexpr span(AZStd::array<value_type, N>& data);
|
||||
template<typename Container>
|
||||
constexpr span(Container& data);
|
||||
|
||||
constexpr span(AZStd::vector<value_type>& data);
|
||||
|
||||
template<AZStd::size_t N>
|
||||
constexpr span(AZStd::fixed_vector<value_type, N>& data);
|
||||
|
||||
template<AZStd::size_t N>
|
||||
constexpr span(const AZStd::array<value_type, N>& data);
|
||||
|
||||
constexpr span(const AZStd::vector<value_type>& data);
|
||||
|
||||
template<AZStd::size_t N>
|
||||
constexpr span(const AZStd::fixed_vector<value_type, N>& data);
|
||||
template<typename Container>
|
||||
constexpr span(const Container& data);
|
||||
|
||||
constexpr span(const span&) = default;
|
||||
|
||||
@@ -132,6 +123,7 @@ namespace AZStd
|
||||
pointer m_begin;
|
||||
pointer m_end;
|
||||
};
|
||||
|
||||
} // namespace AZStd
|
||||
|
||||
#include <AzCore/std/containers/span.inl>
|
||||
|
||||
@@ -29,42 +29,16 @@ namespace AZStd
|
||||
, m_end(last)
|
||||
{ }
|
||||
|
||||
template <class Element>
|
||||
template<AZStd::size_t N>
|
||||
inline constexpr span<Element>::span(AZStd::array<Element, N>& data)
|
||||
template<class Element>
|
||||
template<typename Container>
|
||||
inline constexpr span<Element>::span(Container& data)
|
||||
: m_begin(data.data())
|
||||
, m_end(m_begin + data.size())
|
||||
{ }
|
||||
|
||||
template <class Element>
|
||||
inline constexpr span<Element>::span(AZStd::vector<Element>& data)
|
||||
: m_begin(data.data())
|
||||
, m_end(m_begin + data.size())
|
||||
{ }
|
||||
|
||||
template <class Element>
|
||||
template<AZStd::size_t N>
|
||||
inline constexpr span<Element>::span(AZStd::fixed_vector<Element, N>& data)
|
||||
: m_begin(data.data())
|
||||
, m_end(m_begin + data.size())
|
||||
{ }
|
||||
|
||||
template <class Element>
|
||||
template<AZStd::size_t N>
|
||||
inline constexpr span<Element>::span(const AZStd::array<Element, N>& data)
|
||||
: m_begin(data.data())
|
||||
, m_end(m_begin + data.size())
|
||||
{ }
|
||||
|
||||
template <class Element>
|
||||
inline constexpr span<Element>::span(const AZStd::vector<Element>& data)
|
||||
: m_begin(data.data())
|
||||
, m_end(m_begin + data.size())
|
||||
{ }
|
||||
|
||||
template <class Element>
|
||||
template<AZStd::size_t N>
|
||||
inline constexpr span<Element>::span(const AZStd::fixed_vector<Element, N>& data)
|
||||
template<class Element>
|
||||
template<typename Container>
|
||||
inline constexpr span<Element>::span(const Container& data)
|
||||
: m_begin(data.data())
|
||||
, m_end(m_begin + data.size())
|
||||
{ }
|
||||
|
||||
@@ -954,25 +954,6 @@ namespace AZStd
|
||||
return true;
|
||||
}
|
||||
/// Validates an iter iterator. Returns a combination of \ref iterator_status_flag.
|
||||
AZ_FORCE_INLINE int validate_iterator(const iterator& iter) const
|
||||
{
|
||||
#ifdef AZSTD_HAS_CHECKED_ITERATORS
|
||||
AZ_Assert(iter.m_container == this, "Iterator doesn't belong to this container");
|
||||
pointer iterPtr = iter.m_iter;
|
||||
#else
|
||||
pointer iterPtr = iter;
|
||||
#endif
|
||||
if (iterPtr < m_start || iterPtr > m_last)
|
||||
{
|
||||
return isf_none;
|
||||
}
|
||||
else if (iterPtr == m_last)
|
||||
{
|
||||
return isf_valid;
|
||||
}
|
||||
|
||||
return isf_valid | isf_can_dereference;
|
||||
}
|
||||
AZ_FORCE_INLINE int validate_iterator(const const_iterator& iter) const
|
||||
{
|
||||
#ifdef AZSTD_HAS_CHECKED_ITERATORS
|
||||
@@ -992,7 +973,6 @@ namespace AZStd
|
||||
|
||||
return isf_valid | isf_can_dereference;
|
||||
}
|
||||
AZ_FORCE_INLINE int validate_iterator(const reverse_iterator& iter) const { return validate_iterator(iter.base()); }
|
||||
AZ_FORCE_INLINE int validate_iterator(const const_reverse_iterator& iter) const { return validate_iterator(iter.base()); }
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ namespace GradientSignal
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// GradientRequestBus
|
||||
float GetValue(const GradientSampleParams& sampleParams) const override;
|
||||
void GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
void GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
|
||||
protected:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ namespace GradientSignal
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// GradientRequestBus
|
||||
float GetValue(const GradientSampleParams& sampleParams) const override;
|
||||
void GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
void GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace GradientSignal
|
||||
|
||||
// GradientRequestBus overrides...
|
||||
float GetValue(const GradientSampleParams& sampleParams) const override;
|
||||
void GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
void GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
|
||||
// AZ::Data::AssetBus overrides...
|
||||
void OnAssetReady(AZ::Data::Asset<AZ::Data::AssetData> asset) override;
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ namespace GradientSignal
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// GradientRequestBus
|
||||
float GetValue(const GradientSampleParams& sampleParams) const override;
|
||||
void GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
void GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override;
|
||||
|
||||
protected:
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ namespace GradientSignal
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// GradientRequestBus
|
||||
float GetValue(const GradientSampleParams& sampleParams) const override;
|
||||
void GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
void GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace GradientSignal
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// GradientRequestBus
|
||||
float GetValue(const GradientSampleParams& sampleParams) const override;
|
||||
void GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
void GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override;
|
||||
|
||||
protected:
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ namespace GradientSignal
|
||||
|
||||
// GradientRequestBus overrides...
|
||||
float GetValue(const GradientSampleParams& sampleParams) const override;
|
||||
void GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
void GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
|
||||
private:
|
||||
PerlinGradientConfig m_configuration;
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ namespace GradientSignal
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// GradientRequestBus
|
||||
float GetValue(const GradientSampleParams& sampleParams) const override;
|
||||
void GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
void GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override;
|
||||
|
||||
protected:
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ namespace GradientSignal
|
||||
|
||||
// GradientRequestBus overrides...
|
||||
float GetValue(const GradientSampleParams& sampleParams) const override;
|
||||
void GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
void GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
|
||||
private:
|
||||
RandomGradientConfig m_configuration;
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ namespace GradientSignal
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// GradientRequestBus
|
||||
float GetValue(const GradientSampleParams& sampleParams) const override;
|
||||
void GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
void GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override;
|
||||
|
||||
protected:
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ namespace GradientSignal
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// GradientRequestBus
|
||||
float GetValue(const GradientSampleParams& sampleParams) const override;
|
||||
void GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
void GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
|
||||
protected:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ namespace GradientSignal
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// GradientRequestBus
|
||||
float GetValue(const GradientSampleParams& sampleParams) const override;
|
||||
void GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
void GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override;
|
||||
|
||||
protected:
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ namespace GradientSignal
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// GradientRequestBus
|
||||
float GetValue(const GradientSampleParams& sampleParams) const override;
|
||||
void GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
void GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
|
||||
protected:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ namespace GradientSignal
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// GradientRequestBus
|
||||
float GetValue(const GradientSampleParams& sampleParams) const override;
|
||||
void GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
void GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
|
||||
protected:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ namespace GradientSignal
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// GradientRequestBus
|
||||
float GetValue(const GradientSampleParams& sampleParams) const override;
|
||||
void GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
void GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
|
||||
protected:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ namespace GradientSignal
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// GradientRequestBus
|
||||
float GetValue(const GradientSampleParams& sampleParams) const override;
|
||||
void GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
void GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const override;
|
||||
bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace GradientSignal
|
||||
* \param positions The input list of positions to query.
|
||||
* \param outValues The output list of values. This list is expected to be the same size as the positions list.
|
||||
*/
|
||||
virtual void GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
virtual void GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
{
|
||||
// Reference implementation of GetValues for any gradients that don't have their own optimized implementations.
|
||||
// This is 10%-60% faster than calling GetValue via EBus many times due to the per-call EBus overhead.
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace GradientSignal
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
inline float GetValue(const GradientSampleParams& sampleParams) const;
|
||||
inline void GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const;
|
||||
inline void GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const;
|
||||
|
||||
bool IsEntityInHierarchy(const AZ::EntityId& entityId) const;
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace GradientSignal
|
||||
return output * m_opacity;
|
||||
}
|
||||
|
||||
inline void GradientSampler::GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
inline void GradientSampler::GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
{
|
||||
auto ClearOutputValues = [](AZStd::span<float> outValues)
|
||||
{
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace GradientSignal
|
||||
}
|
||||
|
||||
void ConstantGradientComponent::GetValues(
|
||||
[[maybe_unused]] AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
[[maybe_unused]] AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
{
|
||||
if (positions.size() != outValues.size())
|
||||
{
|
||||
|
||||
@@ -264,7 +264,7 @@ namespace GradientSignal
|
||||
return GetDitherValue(scaledCoordinate, value);
|
||||
}
|
||||
|
||||
void DitherGradientComponent::GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
void DitherGradientComponent::GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
{
|
||||
if (positions.size() != outValues.size())
|
||||
{
|
||||
|
||||
@@ -219,7 +219,7 @@ namespace GradientSignal
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
void ImageGradientComponent::GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
void ImageGradientComponent::GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
{
|
||||
if (positions.size() != outValues.size())
|
||||
{
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace GradientSignal
|
||||
return output;
|
||||
}
|
||||
|
||||
void InvertGradientComponent::GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
void InvertGradientComponent::GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
{
|
||||
if (positions.size() != outValues.size())
|
||||
{
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace GradientSignal
|
||||
return output;
|
||||
}
|
||||
|
||||
void LevelsGradientComponent::GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
void LevelsGradientComponent::GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
{
|
||||
if (positions.size() != outValues.size())
|
||||
{
|
||||
|
||||
@@ -284,7 +284,7 @@ namespace GradientSignal
|
||||
return AZ::GetClamp(result, 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
void MixedGradientComponent::GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
void MixedGradientComponent::GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
{
|
||||
if (positions.size() != outValues.size())
|
||||
{
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace GradientSignal
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
void PerlinGradientComponent::GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
void PerlinGradientComponent::GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
{
|
||||
if (positions.size() != outValues.size())
|
||||
{
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace GradientSignal
|
||||
return PosterizeValue(input, bands, m_configuration.m_mode);
|
||||
}
|
||||
|
||||
void PosterizeGradientComponent::GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
void PosterizeGradientComponent::GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
{
|
||||
if (positions.size() != outValues.size())
|
||||
{
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace GradientSignal
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
void RandomGradientComponent::GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
void RandomGradientComponent::GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
{
|
||||
if (positions.size() != outValues.size())
|
||||
{
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace GradientSignal
|
||||
return m_configuration.m_gradientSampler.GetValue(sampleParams);
|
||||
}
|
||||
|
||||
void ReferenceGradientComponent::GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
void ReferenceGradientComponent::GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
{
|
||||
if (positions.size() != outValues.size())
|
||||
{
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace GradientSignal
|
||||
return (distance <= 0.0f) ? 1.0f : AZ::GetMax(1.0f - (distance / m_configuration.m_falloffWidth), 0.0f);
|
||||
}
|
||||
|
||||
void ShapeAreaFalloffGradientComponent::GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
void ShapeAreaFalloffGradientComponent::GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
{
|
||||
if (positions.size() != outValues.size())
|
||||
{
|
||||
|
||||
@@ -172,7 +172,7 @@ namespace GradientSignal
|
||||
return m_configuration.m_smoothStep.GetSmoothedValue(value);
|
||||
}
|
||||
|
||||
void SmoothStepGradientComponent::GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
void SmoothStepGradientComponent::GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
{
|
||||
if (positions.size() != outValues.size())
|
||||
{
|
||||
|
||||
@@ -211,7 +211,7 @@ namespace GradientSignal
|
||||
return CalculateAltitudeRatio(points, m_configuration.m_altitudeMin, m_configuration.m_altitudeMax);
|
||||
}
|
||||
|
||||
void SurfaceAltitudeGradientComponent::GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
void SurfaceAltitudeGradientComponent::GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
{
|
||||
if (positions.size() != outValues.size())
|
||||
{
|
||||
|
||||
@@ -175,7 +175,7 @@ namespace GradientSignal
|
||||
return result;
|
||||
}
|
||||
|
||||
void SurfaceMaskGradientComponent::GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
void SurfaceMaskGradientComponent::GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
{
|
||||
if (positions.size() != outValues.size())
|
||||
{
|
||||
|
||||
@@ -215,7 +215,7 @@ namespace GradientSignal
|
||||
return GetSlopeRatio(points, angleMin, angleMax);
|
||||
}
|
||||
|
||||
void SurfaceSlopeGradientComponent::GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
void SurfaceSlopeGradientComponent::GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
{
|
||||
if (positions.size() != outValues.size())
|
||||
{
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace GradientSignal
|
||||
return (m_configuration.m_gradientSampler.GetValue(sampleParams) <= m_configuration.m_threshold) ? 0.0f : 1.0f;
|
||||
}
|
||||
|
||||
void ThresholdGradientComponent::GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
void ThresholdGradientComponent::GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const
|
||||
{
|
||||
if (positions.size() != outValues.size())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user