79void QQuick3DParticleTrailEmitter::emitTrailParticles(
const QVector3D ¢erPos,
int emitAmount,
int triggerType,
const QVector3D &normal,
const QVector3D &velocity)
87 const int systemTime = system()->currentTime();
88 for (
auto particle : std::as_const(m_system->m_particles)) {
89 if (particle == m_particle) {
90 emitAmount += getEmitAmountFromDynamicBursts(triggerType);
91 emitAmount = std::min(emitAmount,
int(particle->maxAmount()));
92 float addTime = ((systemTime - m_prevEmitTime) / 1000.0f) / emitAmount;
93 for (
int i = 0; i < emitAmount; i++) {
96 float startTime = (m_prevEmitTime / 1000.0f) + addTime *
float(i);
97 emitParticle(particle, startTime, QMatrix4x4(), QQuaternion(), centerPos, -1, velocity, normal);
100 for (
auto burst : std::as_const(m_bursts)) {
101 int burstAmount = std::min(burst.amount,
int(particle->maxAmount()));
102 float burstTime =
float(burst.time / 1000.0f);
103 for (
int i = 0; i < burstAmount; i++)
104 emitParticle(particle, burstTime, QMatrix4x4(), QQuaternion(), centerPos, -1, velocity, normal);
109 m_prevEmitTime = systemTime;