com.sun.j3d.loaders.lw3d
Class FloatValueInterpolator

java.lang.Object
  extended by javax.media.j3d.SceneGraphObject
      extended by javax.media.j3d.Node
          extended by javax.media.j3d.Leaf
              extended by javax.media.j3d.Behavior
                  extended by javax.media.j3d.Interpolator
                      extended by com.sun.j3d.loaders.lw3d.FloatValueInterpolator
Direct Known Subclasses:
LightIntensityPathInterpolator, SwitchPathInterpolator

abstract class FloatValueInterpolator
extends Interpolator

This class acts as an interpolator between values specified in a floating point array, based on knot values (keyframes) specified in a knots array.


Field Summary
protected  float currentInterpolationRatio
           
protected  int currentKnotIndex
           
protected  float currentValue
           
private  float[] knots
           
private  int knotsLength
           
protected  float[] values
           
 
Fields inherited from class javax.media.j3d.Interpolator
defaultWakeupCriterion
 
Fields inherited from class javax.media.j3d.Node
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_LOCALE_READ, ALLOW_PARENT_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
 
Constructor Summary
FloatValueInterpolator(Alpha alpha, float[] k, float[] v)
          Constructs a new FloatValueInterpolator object.
 
Method Summary
protected  void computePathInterpolation()
          This method computes the bounding knot indices and interpolation value "currentValue" given the current value of alpha, the knots[] array and the array of values.
(package private)  float getValue(int index)
          This method retrieves the value at the specified index.
(package private)  void setValue(int index, float value)
          This method sets the value at the specified index for this interpolator.
 
Methods inherited from class javax.media.j3d.Interpolator
getAlpha, initialize, setAlpha
 
Methods inherited from class javax.media.j3d.Behavior
getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, getView, getWakeupCondition, postId, processStimulus, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, setSchedulingInterval, updateNodeReferences, wakeupOn
 
Methods inherited from class javax.media.j3d.Node
cloneNode, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
 
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

knots

private float[] knots

knotsLength

private int knotsLength

currentKnotIndex

protected int currentKnotIndex

currentInterpolationRatio

protected float currentInterpolationRatio

values

protected float[] values

currentValue

protected float currentValue
Constructor Detail

FloatValueInterpolator

FloatValueInterpolator(Alpha alpha,
                       float[] k,
                       float[] v)
Constructs a new FloatValueInterpolator object.

Parameters:
alpha - the alpha object for this interpolator
knots - an array of knot values that specify a spline
Method Detail

setValue

void setValue(int index,
              float value)
This method sets the value at the specified index for this interpolator.

Parameters:
index - the index to be changed
position - the new value at index

getValue

float getValue(int index)
This method retrieves the value at the specified index.

Parameters:
index - the index of the value requested
Returns:
the interpolator's value at the index

computePathInterpolation

protected void computePathInterpolation()
This method computes the bounding knot indices and interpolation value "currentValue" given the current value of alpha, the knots[] array and the array of values. If the index is 0 and there will be no interpolation, both the index variable and the interpolation variable are set to 0. Otherwise, currentKnotIndex is set to the lower index of the two bounding knot points and the currentInterpolationRatio variable is set to the ratio of the alpha value between these two bounding knot points.



Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.