@Override
    public void internalUpdate(float tpf) {
        if (playState == PlayState.Playing) {
            time = time + (tpf * speed);
            if (loopMode == LoopMode.Loop && time < 0) {
                time = initialDuration;
            }
            if ((time >= initialDuration || time < 0) && loopMode == LoopMode.DontLoop) {
                if (time >= initialDuration) {
                    path.triggerWayPointReach(path.getNbWayPoints() - 1, this);
                }
                stop();
            } else {
                time = AnimationUtils.clampWrapTime(time, initialDuration, loopMode);
                if (time < 0) {
                    speed = -speed;
                    time = -time;
                }
                onUpdate(tpf);
            }
        }
    }
Creates a MotionPath for the given spatial on the given motion path.

@param spatial the Spatial to move (not null)
@param path the path to be taken (alias created)
@param initialDuration the desired duration (in seconds, default=10)
@param loopMode (default=DontLoop)
jme3-core/src/main/java/com/jme3/cinematic/events/MotionEvent.java