Class ManagedTransformSource

java.lang.Object
com.ardor3d.extension.animation.skeletal.blendtree.ManagedTransformSource
All Implemented Interfaces:
BlendTreeSource

public class ManagedTransformSource extends Object implements BlendTreeSource
This tree source maintains its own source data, which can be modified directly using setJointXXX. This source is meant to be used for controlling a particular joint or set of joints programatically.
  • Constructor Details

    • ManagedTransformSource

      public ManagedTransformSource()
  • Method Details

    • setJointTransformData

      public void setJointTransformData(int jointIndex, JointData jointData)
      Set the local source transform data for a given joint index.
      Parameters:
      jointIndex - our joint index value.
      jointData - the joint transform data. This object is copied into the local store.
    • setJointTranslation

      public void setJointTranslation(int jointIndex, ReadOnlyVector3 translation)
      Sets a translation to the local transformdata for a given joint index.
      Parameters:
      jointIndex - our joint index value.
      translation - the translation to set
    • setJointScale

      public void setJointScale(int jointIndex, ReadOnlyVector3 scale)
      Sets a scale to the local transformdata for a given joint index.
      Parameters:
      jointIndex - our joint index value.
      scale - the scale to set
    • setJointRotation

      public void setJointRotation(int jointIndex, ReadOnlyQuaternion rotation)
      Sets a rotation to the local transformdata for a given joint index.
      Parameters:
      jointIndex - our joint index value.
      rotation - the rotation to set
    • getSourceData

      public Map<String,JointData> getSourceData(AnimationManager manager)
      Returns an immutable COPY of our local source data.
      Specified by:
      getSourceData in interface BlendTreeSource
      Parameters:
      manager - the manager this is being called from.
      Returns:
      a map of source information from the blend tree node.
    • setTime

      public boolean setTime(double globalTime, AnimationManager manager)
      Does nothing.
      Specified by:
      setTime in interface BlendTreeSource
      Parameters:
      globalTime - our new "global" timeline time.
      manager - the manager this is being called from.
      Returns:
      true if we found at least one active clip in the tree
    • resetClips

      public void resetClips(AnimationManager manager, double globalStartTime)
      Does nothing.
      Specified by:
      resetClips in interface BlendTreeSource
      Parameters:
      manager - the manager to use in resetting the clips.
      globalStartTime - the new start time to use.
    • isActive

      public boolean isActive(AnimationManager manager)
      Does nothing.
      Specified by:
      isActive in interface BlendTreeSource
      Parameters:
      manager - the manager this is being called from.
      Returns:
      true if we found at least one active clip in the tree
    • initJointsByName

      public void initJointsByName(SkeletonPose pose, AnimationClip clip, String... jointNames)
      Setup transform data on this source, using the first frame from a specific clip and jointNames from a specific pose.
      Parameters:
      pose - the pose to sample joints from
      clip - the animation clip to pull data from
      jointNames - the names of the joints to find indices of.
    • initJointsById

      public void initJointsById(AnimationClip clip, int... jointIndices)
      Setup transform data for specific joints on this source, using the first frame from a given clip.
      Parameters:
      clip - the animation clip to pull data from
      jointIndices - the indices of the joints to initialize data for.
    • getSourceName

      public String getSourceName()
    • setSourceName

      public void setSourceName(String name)