void update(float appDeltaTimeInSeconds, float globalSpeed) {
        Action action = currentAction;
        if (action == null) {
            return;
        }

        double speedup = action.getSpeed() * globalSpeed;
        double scaledDeltaTime = speedup * appDeltaTimeInSeconds;
        time += scaledDeltaTime;

        // wrap negative times to the [0, length] range:
        if (time < 0.0) {
            double length = action.getLength();
            time = (time % length + length) % length;
        }

        // update the current Action, filtered by this layer's mask:
        action.setMask(mask);
        boolean running = action.interpolate(time);
        action.setMask(null);

        if (!running) { // went past the end of the current Action
            time = 0.0;
            if (!loop) {
                // Clear the current action
                setCurrentAction(null);
            }
        }
    }
Updates the animation time and the current Action during a
controlUpdate().

@param appDeltaTimeInSeconds the amount application time to advance the
    current Action, in seconds
@param globalSpeed the global speed applied to all layers.
jme3-core/src/main/java/com/jme3/anim/AnimLayer.java