# Class TransformInterpolator

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

Direct Known Subclasses:
  `KBSplinePathInterpolator, PathInterpolator, PositionInterpolator, RotationInterpolator, ScaleInterpolator, TCBSplinePathInterpolator`

public abstract class TransformInterpolator extends Interpolator
TransformInterpolator is an abstract class that extends Interpolator to provide common methods used by various transform related interpolator subclasses. These include methods to set/get the target of TransformGroup, and set/get transform of axis.

Since:
  Java 3D 1.3

## Field Summary

Fields
Modifier and Type
Field
Description
`protected Transform3D`
`axis`
The transform that defines the local coordinate
`protected Transform3D`
`axisInverse`
The inverse transform that defines the local coordinate
`protected TransformGroup`
`target`
The TransformGroup node affected by this transformInterpolator

### Fields inherited from class Interpolator

`defaultWakeupCriterion`

### Fields inherited from class 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

Constructors
Constructor
Description
`TransformInterpolator()`
Constructs a TransformInterpolator node with a null alpha value and a null target of TransformGroup
`TransformInterpolator(Alpha alpha, TransformGroup target)`
Constructs a trivial transform interpolator with a specified alpha, a specified target and an default axis set to Identity.
`TransformInterpolator(Alpha alpha, TransformGroup target, Transform3D axisOfTransform)`
Constructs a new transform interpolator that set an specified alpha, a specified targe and a specified axisOfTransform.

## Method Summary

Modifier and Type
Method
Description
`abstract void`
`computeTransform(float alphaValue, Transform3D transform)`
Computes the new transform for this interpolator for a given alpha value.
`TransformGroup`
`getTarget()`
This method retrieves this interpolator's TransformGroup node reference.
`Transform3D`
`getTransformAxis()`
This method retrieves this interpolator's axis of transform.
`void`
`processStimulus(Enumeration criteria)`
This method is invoked by the behavior scheduler every frame.
`void`
`setTarget(TransformGroup target)`
This method sets the target TransformGroup node for this interpolator.
`void`
`setTransformAxis(Transform3D axisOfTransform)`
This method sets the axis of transform for this interpolator.
`void`
`updateNodeReferences(NodeReferenceTable referenceTable)`
Callback used to allow a node to check if any scene graph objects referenced by that node have been duplicated via a call to `cloneTree`.

### Methods inherited from class Interpolator

`getAlpha, initialize, setAlpha`

### Methods inherited from class Behavior

`getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, getView, getWakeupCondition, postId, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, setSchedulingInterval, wakeupOn`

### Methods inherited from class 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 SceneGraphObject

`clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### target

protected TransformGroup target
The TransformGroup node affected by this transformInterpolator

### axis

protected Transform3D axis
The transform that defines the local coordinate

### axisInverse

protected Transform3D axisInverse
The inverse transform that defines the local coordinate

## Constructor Details

### TransformInterpolator

public TransformInterpolator()
Constructs a TransformInterpolator node with a null alpha value and a null target of TransformGroup

### TransformInterpolator

public TransformInterpolator(Alpha alpha, TransformGroup target)
Constructs a trivial transform interpolator with a specified alpha, a specified target and an default axis set to Identity.

Parameters:
  `alpha` - The alpha object for this transform Interpolator
  `target` - The target TransformGroup for this TransformInterpolator

### TransformInterpolator

public TransformInterpolator(Alpha alpha, TransformGroup target, Transform3D axisOfTransform)
Constructs a new transform interpolator that set an specified alpha, a specified targe and a specified axisOfTransform.

Parameters:
  `alpha` - the alpha object for this interpolator
  `target` - the transformGroup node affected by this transformInterpolator
  `axisOfTransform` - the transform that defines the local coordinate system in which this interpolator operates.

## Method Details

### setTarget

public void setTarget(TransformGroup target)
This method sets the target TransformGroup node for this interpolator.

Parameters:
  `target` - The target TransformGroup

### getTarget

public TransformGroup getTarget()
This method retrieves this interpolator's TransformGroup node reference.

Returns:
  the Interpolator's target TransformGroup

### setTransformAxis

public void setTransformAxis(Transform3D axisOfTransform)
This method sets the axis of transform for this interpolator.

Parameters:
  `axisOfTransform` - the transform that defines the local coordinate system in which this interpolator operates

### getTransformAxis

public Transform3D getTransformAxis()
This method retrieves this interpolator's axis of transform.

Returns:
  the interpolator's axis of transform

### computeTransform

public abstract void computeTransform(float alphaValue, Transform3D transform)
Computes the new transform for this interpolator for a given alpha value.

Parameters:
  `alphaValue` - alpha value between 0.0 and 1.0
  `transform` - object that receives the computed transform for the specified alpha value

### processStimulus

public void processStimulus(Enumeration criteria)
This method is invoked by the behavior scheduler every frame. First it gets the alpha value that corresponds to the current time. Then it calls computeTransform() method to computes the transform based on this alpha vaule, and updates the specified TransformGroup node with this new transform.

Specified by:
  `processStimulus` in class `Behavior`
Parameters:
  `criteria` - an enumeration of the criteria that caused the stimulus

### updateNodeReferences

public void updateNodeReferences(NodeReferenceTable referenceTable)
Callback used to allow a node to check if any scene graph objects referenced by that node have been duplicated via a call to `cloneTree`. This method is called by `cloneTree` after all nodes in the sub-graph have been duplicated. The cloned Leaf node's method will be called and the Leaf node can then look up any object references by using the `getNewObjectReference` method found in the `NodeReferenceTable` object. If a match is found, a reference to the corresponding object in the newly cloned sub-graph is returned. If no corresponding reference is found, either a DanglingReferenceException is thrown or a reference to the original object is returned depending on the value of the `allowDanglingReferences` parameter passed in the `cloneTree` call.

NOTE: Applications should not call this method directly. It should only be called by the cloneTree method.

Overrides:
  `updateNodeReferences` in class `Behavior`
Parameters:
  `referenceTable` - a NodeReferenceTableObject that contains the `getNewObjectReference` method needed to search for new object instances.
See Also:
  - `NodeReferenceTable`
  - `Node.cloneTree()`
  - `DanglingReferenceException`