Class 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 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: