j3d.org Code

org.j3d.util.interpolator
Class Interpolator

java.lang.Object
  extended by org.j3d.util.interpolator.Interpolator
Direct Known Subclasses:
BooleanInterpolator, ColorInterpolator, Coordinate2DInterpolator, CoordinateInterpolator, IntegerInterpolator, NormalInterpolator, PositionInterpolator, RotationInterpolator, ScalarInterpolator

public abstract class Interpolator
extends java.lang.Object

An interpolator that works with positional coordinates.

The interpolation routine is just a simple linear interpolation between each of the points. The interpolator may take arbitrarily spaced keyframes and compute correct values.

Version:
$Revision: 1.5 $
Author:
Justin Couch

Field Summary
protected  int allocatedSize
          The current size of the array data
protected static int ARRAY_INCREMENT
          The number of items to increment the array with
protected  int currentSize
          Current total number of items in the array
protected static int DEFAULT_SIZE
          The default number of items in the interpolator
protected  int interpolationType
          The type of interpolation routine to use
protected  float[] keys
          The keys as a single array for fast searching
static int LINEAR
          The interpolator should act as a linear interpolator between keys
static int STEP
          The interpolator should act as a step interpolator between keys
 
Constructor Summary
protected Interpolator()
          Create a new interpolator instance with the default size for the number of key values.
protected Interpolator(int size)
          Create an interpolator with the given basic size.
protected Interpolator(int size, int type)
          Create a interpolator with the given basic size and interpolation type.
 
Method Summary
 void clear()
          Reset the interpolator to be empty so that new key values are replacing the old ones.
protected  int findKeyIndex(float key)
          Find the key in the array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINEAR

public static final int LINEAR
The interpolator should act as a linear interpolator between keys

See Also:
Constant Field Values

STEP

public static final int STEP
The interpolator should act as a step interpolator between keys

See Also:
Constant Field Values

DEFAULT_SIZE

protected static final int DEFAULT_SIZE
The default number of items in the interpolator

See Also:
Constant Field Values

ARRAY_INCREMENT

protected static final int ARRAY_INCREMENT
The number of items to increment the array with

See Also:
Constant Field Values

allocatedSize

protected int allocatedSize
The current size of the array data


currentSize

protected int currentSize
Current total number of items in the array


keys

protected float[] keys
The keys as a single array for fast searching


interpolationType

protected final int interpolationType
The type of interpolation routine to use

Constructor Detail

Interpolator

protected Interpolator()
Create a new interpolator instance with the default size for the number of key values.


Interpolator

protected Interpolator(int size)
Create an interpolator with the given basic size.

Parameters:
size - The starting number of items in interpolator

Interpolator

protected Interpolator(int size,
                       int type)
Create a interpolator with the given basic size and interpolation type.

Parameters:
size - The starting number of items in interpolator
type - The type of interpolation routine to do
Method Detail

clear

public void clear()
Reset the interpolator to be empty so that new key values are replacing the old ones.


findKeyIndex

protected int findKeyIndex(float key)
Find the key in the array. Performs a fast binary search of the values to locate the right index. Returns the index i such that key[i]
Parameters:
key - The key to search for
Returns:
The index i such that key[i]

j3d.org Code

Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org