/** * Updates the {@link #getDelta() delta} and {@link #getIndex() index}. * * @param time * The raw time since this was last called. */ protected void updateDeltaAndIndex(final double time) { incrementDelta(getSpeed() * time); /* If >= DELTA_MAX then we need to start interpolating between next set of points */ while (getDelta() >= DELTA_MAX) { /* Adjust delta for new set of points */ decrementDelta(DELTA_MAX); /* Increment/decrement current index based on whether we are cycling forward or backwards */ if (isCycleForward()) { incrementIndex(); } else { decrementIndex(); } } }
/** * Updates the {@link #getDelta() delta} and {@link #getIndex() index}. * * @param time * The raw time since this was last called. */ protected void updateDeltaAndIndex(final double time) { incrementDelta(getSpeed() * time); /* If >= DELTA_MAX then we need to start interpolating between next set of points */ while (getDelta() >= DELTA_MAX) { /* Adjust delta for new set of points */ decrementDelta(DELTA_MAX); /* Increment/decrement current index based on whether we are cycling forward or backwards */ if (isCycleForward()) { incrementIndex(); } else { decrementIndex(); } } }