id: gs; x: root.width/2; y: root.height/2; strength: 4000000;
system: particles
physics: PointAttractor.Acceleration
- proportionalToDistance: PointAttractor.Quadratic
+ proportionalToDistance: PointAttractor.InverseQuadratic
}
Kill{
system: particles
}
PointAttractor{
id: gs1; x: vorteX; y: vorteY; strength: 800000;
- proportionalToDistance: PointAttractor.Quadratic;
+ proportionalToDistance: PointAttractor.InverseQuadratic;
system: foreground
}
Kill{
PointAttractor{
id: gs2; x: vorteX2; y: vorteY2; strength: 800000;
- proportionalToDistance: PointAttractor.Quadratic;
+ proportionalToDistance: PointAttractor.InverseQuadratic;
system: foreground
}
Kill{
PointAttractor{
id: gs3; x: vorteX3; y: vorteY3; strength: 800000;
- proportionalToDistance: PointAttractor.Quadratic;
+ proportionalToDistance: PointAttractor.InverseQuadratic;
system: foreground
}
Kill{
{
if (m_strength == 0.0)
return false;
- qreal dx = m_y - d->curX();
- qreal dy = m_x - d->curY();
+ qreal dx = m_x - d->curX();
+ qreal dy = m_y - d->curY();
qreal r = sqrt((dx*dx) + (dy*dy));
qreal theta = atan2(dy,dx);
qreal ds = 0;
switch (m_proportionalToDistance){
+ case InverseQuadratic:
+ ds = (m_strength / qMax<qreal>(1.,r*r));
+ break;
+ case InverseLinear:
+ ds = (m_strength / qMax<qreal>(1.,r));
+ break;
case Quadratic:
- ds = (m_strength / qMax<qreal>(1.,r*r)) * dt;
+ ds = (m_strength * qMax<qreal>(1.,r*r));
break;
- case Linear://also default
- default:
- ds = (m_strength / qMax<qreal>(1.,r)) * dt;
+ case Linear:
+ ds = (m_strength * qMax<qreal>(1.,r));
+ break;
+ default: //also Constant
+ ds = m_strength;
}
+ ds *= dt;
dx = ds * cos(theta);
dy = ds * sin(theta);
qreal vx,vy;