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);
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