x method
The position of the object in the simulation at the given time.
Implementation
@override
double x(double time) {
final double newPosition = position + velocityPixelsPerSecond * time;
final distanceBetweenPositions = (newPosition - _pixelSnapPosition).abs();
if (distanceBetweenPositions <= tolerance.distance || time >= duration) {
return _pixelSnapPosition;
}
return newPosition;
}