Wasn't simulating the physics right, interacted wrong with other
attractors when in Velocity mode.
Change-Id: I5883eb748b398494ad552e35f06d1167da6023a6
Reviewed-on: http://codereview.qt.nokia.com/3835
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
}
dx = ds * cos(theta);
dy = ds * sin(theta);
+ qreal vx,vy;
switch (m_physics){
case Position:
d->x = (d->x + dx);
break;
case Velocity: //also default
default:
- d->setInstantaneousVX(d->vx + dx);
- d->setInstantaneousVY(d->vy + dy);
+ vx = d->curVX();
+ vy = d->curVY();
+ d->setInstantaneousVX(vx + dx);
+ d->setInstantaneousVY(vy + dy);
}
return true;