View Javadoc

1   /*
2    * jcurl java curling software framework http://www.jcurl.org Copyright (C)
3    * 2005-2009 M. Rohrmoser
4    * 
5    * This program is free software; you can redistribute it and/or modify it under
6    * the terms of the GNU General Public License as published by the Free Software
7    * Foundation; either version 2 of the License, or (at your option) any later
8    * version.
9    * 
10   * This program is distributed in the hope that it will be useful, but WITHOUT
11   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12   * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13   * details.
14   * 
15   * You should have received a copy of the GNU General Public License along with
16   * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
17   * Place, Suite 330, Boston, MA 02111-1307 USA
18   */
19  
20  package org.jcurl.math;
21  
22  /**
23   * Re-implementation of <a
24   * href="http://download.java.net/javadesktop/scenario/releases/0.5/javadoc/com/sun/scenario/animation/Interpolator.html">Scenario
25   * Interpolator</a>.
26   * 
27   * @see Interpolators
28   * @author <a href="mailto:m@jcurl.org">M. Rohrmoser </a>
29   * @version $Id$
30   */
31  public interface Interpolator {
32  
33  	/**
34  	 * This function takes an input value between 0 and 1 and returns another
35  	 * value, also between 0 and 1. The purpose of the function is to define how
36  	 * time (represented as a (0-1) fraction of the duration of an animation) is
37  	 * altered to derive different value calculations during an animation.
38  	 * 
39  	 * @param fraction
40  	 *            a value between 0 and 1, representing the elapsed fraction of
41  	 *            a time interval (either an entire animation cycle or an
42  	 *            interval between two KeyFrames, depending on where this
43  	 *            Interpolator is used)
44  	 * @return a value between 0 and 1. Values outside of this boundary may be
45  	 *         clamped to the interval [0,1] and cause undefined results.
46  	 */
47  	float interpolate(float fraction);
48  
49  }