51 float minDelay = 0, maxDelay = 0;
52 float minDuration = -1, maxDuration = -1;
55 if(childNode->tag() ==
"delay") {
56 minDelay = childNode->value<
float>();
57 maxDelay = childNode->value<
float>();
58 }
else if(childNode->tag() ==
"min-delay")
59 minDelay = childNode->value<
float>();
60 else if(childNode->tag() ==
"max-delay")
61 maxDelay = childNode->value<
float>();
62 else if(childNode->tag() ==
"duration") {
63 minDuration = childNode->value<
float>();
64 maxDuration = childNode->value<
float>();
65 }
else if(childNode->tag() ==
"min-duration")
66 minDuration = childNode->value<
float>();
67 else if(childNode->tag() ==
"max-duration")
68 maxDuration = childNode->value<
float>();
83 if(childNode->tag() ==
"angle")
84 m_angle = childNode->value<
float>() *
DEG_TO_RAD;
85 else if(childNode->tag() ==
"gravity")
86 m_gravity = childNode->value<
float>();
95 PointF velocity = particle->getVelocity();
96 velocity +=
PointF(m_gravity * elapsedTime * std::cos(m_angle), m_gravity * elapsedTime * std::sin(m_angle));
97 particle->setVelocity(velocity);
109 if(childNode->tag() ==
"position")
110 m_position = childNode->value<
Point>();
111 else if(childNode->tag() ==
"acceleration")
112 m_acceleration = childNode->value<
float>();
113 else if(childNode->tag() ==
"velocity-reduction-percent")
114 m_reduction = childNode->value<
float>();
115 else if(childNode->tag() ==
"repelish")
116 m_repelish = childNode->value<
bool>();
125 PointF pPosition = particle->getPosition();
132 direction =
PointF(-1, -1);
134 PointF pVelocity = particle->getVelocity() + (d / d.
length() * m_acceleration * elapsedTime) * direction;
135 particle->setVelocity(pVelocity - pVelocity * m_reduction/100.0 * elapsedTime);