Class AnimationFunctions.InterpolatedAnimationFunction<T>

    • Method Detail

      • checkValidKeyTimes

        private static void checkValidKeyTimes​(int valuesLength,
                                               float[] theKeyTimes)
      • discreteValueAt

        private T discreteValueAt​(long time)
      • indexAt

        private int indexAt​(long time,
                            int intervalCount)
      • interpolateLinear

        private T interpolateLinear​(T value1,
                                    T value2,
                                    long time,
                                    long duration)
        Currently we provide only linear interpolations that are based on floats.
        Parameters:
        value1 - the first interpolation key point
        value2 - the second interpolation key point
        time - the time to get an interpolated value for
        duration - the duration of the whole animation
        Returns:
        the interpolated value at the given time
      • linearValueAt

        private T linearValueAt​(long time)
      • valueAt

        public T valueAt​(long time)
        Description copied from interface: AnimationFunction
        Returns the function value at a given time in the valid time interval. The value is undefined for times outside this function's time interval. An implementation may throw an exception, if this method called with a time outside the time interval.
        Parameters:
        time - the time used to determine the animation effect
        Returns:
        the function value at the given time