138 if (m_easing == curve)
153 const auto fract = [](
const float v) ->
float {
156 const auto lerp = [](
const float a,
const float b,
const float f) ->
float {
157 return a + (
b -
a) *
f;
159 const auto smoothstep = [](
const float a,
const float b,
const float f) ->
float {
160 return a + (
b -
a) *
f *
f * (3.0f - 2.0f *
f);
163 float pos = fract(
time /
float(m_duration * 0.001f));
177 scale = m_minSize + (m_maxSize - m_minSize) * (1.0f +
qSin(2.0f *
M_PI *
pos)) * 0.5f;
189 scale = smoothstep(m_minSize, m_maxSize,
pos);
qreal valueForProgress(qreal progress) const
Return the effective progress for the easing curve at progress.
void prepareToAffect() override
void setDuration(int duration)
QQuick3DParticleScaleAffector(QQuick3DNode *parent=nullptr)
\qmltype ScaleAffector3D \inherits Affector3D \inqmlmodule QtQuick3D.Particles3D
void setMinSize(float size)
void setType(ScalingType type)
void setEasingCurve(const QEasingCurve &curve)
void setMaxSize(float size)
void easingCurveChanged()
void affectParticle(const QQuick3DParticleData &, QQuick3DParticleDataCurrent *d, float time) override
Combined button and popup list for selecting options.
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
constexpr const T & qMax(const T &a, const T &b)
constexpr T qAbs(const T &t)
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLenum GLenum GLenum scale
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent