| 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.TransformInterpolator javax.media.j3d.PathInterpolator
All known Subclasses: javax.media.j3d.RotPosScalePathInterpolator, javax.media.j3d.PositionPathInterpolator, javax.media.j3d.RotationPathInterpolator, javax.media.j3d.RotPosPathInterpolator,
PathInterpolator | abstract public class PathInterpolator extends TransformInterpolator (Code) | | 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. |
Method Summary | |
protected void | computePathInterpolation(float alphaValue) Computes the base knot index and interpolation value
given the specified value of alpha and the knots[] array. | protected void | computePathInterpolation() | void | duplicateAttributes(Node originalNode, boolean forceDuplicate) Copies all PathInterpolator information from
originalNode into
the current node. | public int | getArrayLengths() Retrieves the length of the knots array. | public float | getKnot(int index) Retrieves the knot at the specified index. | public void | getKnots(float[] knots) Copies the array of knots from this interpolator
into the specified array. | public void | setKnot(int index, float knot) Sets the knot at the specified index for this interpolator. | protected void | setKnots(float[] knots) Replaces the existing array of knot values with
the specified array. |
currentInterpolationValue | protected float currentInterpolationValue(Code) | | 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(alphaValue) method from the subclass's
computeTransform() method. Then this variable will hold a valid
value which can be used in further calculations by the subclass.
|
currentKnotIndex | protected int currentKnotIndex(Code) | | 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(alphaValue) method from the subclass's
computeTransform() method. Then this variable will hold a valid
value which can be used in further calculations by the subclass.
|
PathInterpolator | PathInterpolator()(Code) | | Constructs a PathInterpolator node with a null alpha value and
a null target of TransformGroup
since Java 3D 1.3
|
PathInterpolator | public PathInterpolator(Alpha alpha, float[] knots)(Code) | | Constructs a new PathInterpolator object that interpolates
between the knot values in the knots array. The array of knots
is copied into this PathInterpolator object.
Parameters: alpha - the alpha object for this interpolator. Parameters: knots - an array of knot values that specify interpolationpoints. |
PathInterpolator | public PathInterpolator(Alpha alpha, TransformGroup target, float[] knots)(Code) | | Constructs a new PathInterpolator object that interpolates
between the knot values in the knots array. The array of knots
is copied into this PathInterpolator object.
Parameters: alpha - the alpha object for this interpolator. Parameters: target - the transformgroup node effected by this pathInterpolator Parameters: knots - an array of knot values that specify interpolationpoints. since: Java 3D 1.3 |
PathInterpolator | public PathInterpolator(Alpha alpha, TransformGroup target, Transform3D axisOfTransform, float[] knots)(Code) | | Constructs a new PathInterpolator object that interpolates
between the knot values in the knots array. The array of knots
is copied into this PathInterpolator object.
Parameters: alpha - the alpha object for this interpolator. Parameters: target - the transform node effected by this positionInterpolator Parameters: axisOfTransform - the transform that defines the local coordinate Parameters: knots - an array of knot values that specify interpolationpoints. since: Java 3D 1.3 |
computePathInterpolation | protected void computePathInterpolation(float alphaValue)(Code) | | Computes the base knot index and interpolation value
given the specified 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.
Parameters: alphaValue - alpha value between 0.0 and 1.0 since: Java 3D 1.3 |
computePathInterpolation | protected void computePathInterpolation()(Code) | | |
duplicateAttributes | void duplicateAttributes(Node originalNode, boolean forceDuplicate)(Code) | | Copies all PathInterpolator information from
originalNode into
the current node. This method is called from the
cloneNode method which is, in turn, called by the
cloneTree method.
Parameters: originalNode - the original node to duplicate. Parameters: forceDuplicate - when set to true , causes theduplicateOnCloneTree flag to be ignored. Whenfalse , the value of each node'sduplicateOnCloneTree variable determines whetherNodeComponent data is duplicated or copied. exception: RestrictedAccessException - if this object is part of a liveor compiled scenegraph. See Also: Node.duplicateNode See Also: Node.cloneTree See Also: NodeComponent.setDuplicateOnCloneTree |
getArrayLengths | public int getArrayLengths()(Code) | | Retrieves the length of the knots array.
the array length |
getKnot | public float getKnot(int index)(Code) | | Retrieves the knot at the specified index.
Parameters: index - the index of the value requested the interpolator's knot value at the associated index |
getKnots | public void getKnots(float[] knots)(Code) | | Copies the array of knots from this interpolator
into the specified array.
The array must be large enough to hold all of the knots.
Parameters: knots - array that will receive the knots. since: Java 3D 1.2 |
setKnot | public void setKnot(int index, float knot)(Code) | | Sets the knot at the specified index for this interpolator.
Parameters: index - the index to be changed Parameters: knot - the new knot value |
setKnots | protected void setKnots(float[] knots)(Code) | | Replaces the existing array of knot values with
the specified array. The array of knots is copied into this
interpolator object. Prior to calling this method,
subclasses should verify that the lengths of the new knots array
and subclass-specific parameter arrays are the same.
Parameters: knots - a new array of knot values that specifyinterpolation points. since: Java 3D 1.2 |
|
|