32 m_position =
Point(0, 0);
47 if(childNode->tag() ==
"position")
48 m_position = childNode->value<
Point>();
49 else if(childNode->tag() ==
"duration")
50 m_duration = childNode->value<
float>();
51 else if(childNode->tag() ==
"delay")
52 m_delay = childNode->value<
float>();
53 else if(childNode->tag() ==
"burst-rate")
54 m_burstRate = childNode->value<
float>();
55 else if(childNode->tag() ==
"burst-count")
56 m_burstCount = childNode->value<
int>();
57 else if(childNode->tag() ==
"particle-type")
67 m_elapsedTime += elapsedTime;
70 if(m_duration > 0 && m_elapsedTime >= m_duration + m_delay) {
75 if(!m_active && m_elapsedTime > m_delay)
81 int nextBurst = std::floor((m_elapsedTime - m_delay) * m_burstRate) + 1;
83 for(
int b = m_currentBurst; b < nextBurst; ++b) {
88 Point pPosition = m_position +
Point(pRadius * std::cos(pAngle), pRadius * std::sin(pAngle));
90 for(
int p = 0; p < m_burstCount; ++p) {
96 PointF pVelocity(pVelocityAbs * std::cos(pVelocityAngle), pVelocityAbs * std::sin(pVelocityAngle));
101 PointF pAcceleration(pAccelerationAbs * std::cos(pAccelerationAngle), pAccelerationAbs * std::sin(pAccelerationAngle));
104 pVelocity, pAcceleration,
108 system->addParticle(particle);
112 m_currentBurst = nextBurst;