Another batch of GetValues() overrides. (#6915)

* Another batch of GetValues() overrides.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Added missing headers.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Addressed PR feedback.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
This commit is contained in:
Mike Balfour
2022-01-18 15:05:17 -06:00
committed by GitHub
parent 3a3aa20545
commit 4b9e53e623
18 changed files with 386 additions and 126 deletions
@@ -138,11 +138,22 @@ namespace GradientSignal
float ThresholdGradientComponent::GetValue(const GradientSampleParams& sampleParams) const
{
float output = 0.0f;
return (m_configuration.m_gradientSampler.GetValue(sampleParams) <= m_configuration.m_threshold) ? 0.0f : 1.0f;
}
output = 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
{
if (positions.size() != outValues.size())
{
AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size());
return;
}
return output;
m_configuration.m_gradientSampler.GetValues(positions, outValues);
for (auto& outValue : outValues)
{
outValue = (outValue <= m_configuration.m_threshold) ? 0.0f : 1.0f;
}
}
bool ThresholdGradientComponent::IsEntityInHierarchy(const AZ::EntityId& entityId) const