/** * Returns time interval that contains this time fraction */ public int getInterval(float fraction) { return keyTimes.getInterval(fraction); }
/** * Returns a value for the given fraction elapsed of the animation cycle. * Given the fraction, this method will determine what interval the fraction * lies within, how much of that interval has elapsed, what the boundary * values are (from KeyValues), what the interpolated fraction is (from the * Interpolator for the interval), and what the final interpolated * intermediate value is (using the appropriate Evaluator). This method will * call into the Interpolator for the time interval to get the interpolated * method. To ensure that future operations succeed, the value received from * the interpolation will be clamped to the interval [0,1]. */ public Object getValue(float fraction) { // First, figure out the real fraction to use, given the // interpolation type and keyTimes int interval = getInterval(fraction); float t0 = keyTimes.getTime(interval); float t1 = keyTimes.getTime(interval + 1); float t = (fraction - t0) / (t1 - t0); float interpolatedT = interpolators.interpolate(interval, t); // clamp to avoid problems with buggy Interpolators if (interpolatedT < 0f) { interpolatedT = 0f; } else if (interpolatedT > 1f) { interpolatedT = 1f; } return keyValues.getValue(interval, (interval + 1), interpolatedT); }
/** * Returns a value for the given fraction elapsed of the animation cycle. * Given the fraction, this method will determine what interval the fraction * lies within, how much of that interval has elapsed, what the boundary * values are (from KeyValues), what the interpolated fraction is (from the * Interpolator for the interval), and what the final interpolated * intermediate value is (using the appropriate Evaluator). This method will * call into the Interpolator for the time interval to get the interpolated * method. To ensure that future operations succeed, the value received from * the interpolation will be clamped to the interval [0,1]. */ public Object getValue(float fraction) { // First, figure out the real fraction to use, given the // interpolation type and keyTimes int interval = getInterval(fraction); float t0 = keyTimes.getTime(interval); float t1 = keyTimes.getTime(interval + 1); float t = (fraction - t0) / (t1 - t0); float interpolatedT = interpolators.interpolate(interval, t); // clamp to avoid problems with buggy Interpolators if (interpolatedT < 0f) { interpolatedT = 0f; } else if (interpolatedT > 1f) { interpolatedT = 1f; } return keyValues.getValue(interval, (interval + 1), interpolatedT); }
/** * Returns time interval that contains this time fraction */ public int getInterval(float fraction) { return keyTimes.getInterval(fraction); }
/** * Returns a value for the given fraction elapsed of the animation cycle. * Given the fraction, this method will determine what interval the fraction * lies within, how much of that interval has elapsed, what the boundary * values are (from KeyValues), what the interpolated fraction is (from the * Interpolator for the interval), and what the final interpolated * intermediate value is (using the appropriate Evaluator). This method will * call into the Interpolator for the time interval to get the interpolated * method. To ensure that future operations succeed, the value received from * the interpolation will be clamped to the interval [0,1]. */ public Object getValue(float fraction) { // First, figure out the real fraction to use, given the // interpolation type and keyTimes int interval = getInterval(fraction); float t0 = keyTimes.getTime(interval); float t1 = keyTimes.getTime(interval + 1); float t = (fraction - t0) / (t1 - t0); float interpolatedT = interpolators.interpolate(interval, t); // clamp to avoid problems with buggy Interpolators if (interpolatedT < 0f) { interpolatedT = 0f; } else if (interpolatedT > 1f) { interpolatedT = 1f; } return keyValues.getValue(interval, (interval + 1), interpolatedT); }
/** * Returns time interval that contains this time fraction */ public int getInterval(float fraction) { return keyTimes.getInterval(fraction); }