: Class PathInterpolator

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.media.j3d
Class PathInterpolator

    java.lang.Object
      |
      +--javax.media.j3d.SceneGraphObject
            |
            +--javax.media.j3d.Node
                  |
                  +--javax.media.j3d.Leaf
                        |
                        +--javax.media.j3d.Behavior
                              |
                              +--javax.media.j3d.Interpolator
                                    |
                                    +--javax.media.j3d.PathInterpolator

Direct Known Subclasses:
  PositionPathInterpolator, RotationPathInterpolator, RotPosPathInterpolator, RotPosScalePathInterpolator

public abstract class PathInterpolator
extends Interpolator

PathInterpolator behavior. This class defines the base class for all Path Interpolators. Subclasses have access to the computePathInterpolation() method, which computes the currentInterpolationValue given the current time and alpha. The method also computes the currentKnotIndex, which is based on the currentInterpolationValue. The currentInterpolationValue is calculated by linearly interpolating among a series of predefined knots (using the value generated by the specified Alpha object). The first knot must have a value of 0.0 and the last knot must have a value of 1.0. An intermediate knot with index k must have a value strictly greater than any knot with index less than k.

Field Summary
`protected float` | `currentInterpolationValue` This value is the ratio between knot values indicated by the currentKnotIndex variable.
`protected int` | `currentKnotIndex` This value is the index of the current base knot value, as determined by the alpha function.

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_PICK, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING`

Constructor Summary
`PathInterpolator(Alpha alpha, float[] knots)` Constructs a new PathInterpolator object that interpolates between the knot values in the knots array.

Method Summary
`protected void` | `computePathInterpolation()` This method computes the base knot index and interpolation value given the current value of alpha and the knots[] array.
`void` | `duplicateNode(Node originalNode, boolean forceDuplicate)` Copies all node information from `originalNode` into the current node.
`int` | `getArrayLengths()` This method retrieves the length of the knots array.
`float` | `getKnot(int index)` This method retrieves the knot at the specified index.
`void` | `setKnot(int index, float knot)` This method sets the knot 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, getSchedulingBoundingLeaf, getSchedulingBounds, getView, postId, processStimulus, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, updateNodeReferences, wakeupOn`

Methods inherited from class javax.media.j3d.Node
`cloneNode, cloneTree, cloneTree, cloneTree, getBounds, getBoundsAutoCompute, getCollidable, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable`

Methods inherited from class javax.media.j3d.SceneGraphObject
`clearCapability, duplicateSceneGraphObject, getCapability, getUserData, isCompiled, isLive, setCapability, setUserData`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### currentInterpolationValue

    protected float currentInterpolationValue

  This value is the ratio between knot values indicated by the currentKnotIndex variable. So if a subclass wanted to interpolate between knot values, it would use the currentKnotIndex to get the bounding knots for the "real" value, then use the currentInterpolationValue to interpolate between the knots. To calculate this variable, a subclass needs to call the computePathInterpolation() method from the subclass's processStimulus() method. Then this variable will hold a valid value which can be used in further calculations by the subclass.

### currentKnotIndex

    protected int currentKnotIndex

  This value is the index of the current base knot value, as determined by the alpha function. A subclass wishing to interpolate between bounding knots would use this index and the one following it, and would use the currentInterpolationValue variable as the ratio between these indices. To calculate this variable, a subclass needs to call the computePathInterpolation() method from the subclass's processStimulus() method. Then this variable will hold a valid value which can be used in further calculations by the subclass.

Constructor Detail

### PathInterpolator

    public PathInterpolator(Alpha alpha,
                            float[] knots)

  Constructs a new PathInterpolator object that interpolates between the knot values in the knots array.
  Parameters:
    `alpha` - the alpha object for this interpolator
    `knots` - an array of knot values that specify interpolation values

Method Detail

### getArrayLengths

    public int getArrayLengths()

  This method retrieves the length of the knots array.
  Returns:
    the array length

### setKnot

    public void setKnot(int index,
                        float knot)

  This method sets the knot at the specified index for this interpolator.
  Parameters:
    `index` - the index to be changed
    `knot` - the new knot value

### getKnot

    public float getKnot(int index)

  This method retrieves the knot at the specified index.
  Parameters:
    `index` - the index of the value requested
  Returns:
    the interpolator's knot value at the associated index

### computePathInterpolation

    protected void computePathInterpolation()

  This method computes the base knot index and interpolation value given the current value of alpha and the knots[] array. If the index is 0 and there should 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 currentInterpolationValue variable is set to the ratio of the alpha value between these two bounding knot points.

### duplicateNode

    public void duplicateNode(Node originalNode,
                              boolean forceDuplicate)

  Copies all node information from `originalNode` into the current node. This method is called from the `cloneNode` method which is, in turn, called by the `cloneTree` method.

  For any NodeComponent objects contained by the object being duplicated, each NodeComponent object's `duplicateOnCloneTree` value is used to determine whether the NodeComponent should be duplicated in the new node or if just a reference to the current node should be placed in the new node. This flag can be overridden by setting the `forceDuplicate` parameter in the `cloneTree` method to `true`.

  Overrides:
    duplicateNode in class Interpolator
  Parameters:
    `originalNode` - the original node to duplicate.
    `forceDuplicate` - when set to `true`, causes the `duplicateOnCloneTree` flag to be ignored. When `false`, the value of each node's `duplicateOnCloneTree` variable determines whether NodeComponent data is duplicated or copied.
  See Also:
    `Node.cloneTree()`, `Node.cloneNode(boolean)`, `NodeComponent.setDuplicateOnCloneTree(boolean)`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD