Пример #1
0
 public void setSpeed(float speedKmh) {
   float distanceMeters = motionPath.getLength();
   float speed = speedKmh / 3.6f;
   float duration = distanceMeters / speed;
   motionControl.setInitialDuration(duration);
 }
Пример #2
0
 public float getSpeed() {
   float duration = motionControl.getInitialDuration();
   float distanceMeters = motionPath.getLength();
   float speed = distanceMeters / duration;
   return 3.6f * speed;
 }