java.lang.Object
com.ardor3d.extension.animation.skeletal.state.AbstractFiniteState
com.ardor3d.extension.animation.skeletal.state.SteadyState

public class SteadyState extends AbstractFiniteState
A "steady" state is an animation state that is concrete and stand-alone (vs. a state that handles transitioning between two states, for example.)
  • Constructor Details

    • SteadyState

      public SteadyState(String name)
      Create a new steady state.
      Parameters:
      name - the name of our new state. Immutable.
  • Method Details

    • getName

      public String getName()
      Returns:
      the name of this state.
    • getEndTransition

      public AbstractTransitionState getEndTransition()
      Returns:
      the transition to use if we reach the end of this state. May be null.
    • setEndTransition

      public void setEndTransition(AbstractTransitionState endTransition)
      Parameters:
      endTransition - a transition to use if we reach the end of this state. May be null.
    • getSourceTree

      public BlendTreeSource getSourceTree()
      Returns:
      the root of our blend tree
    • setSourceTree

      public void setSourceTree(BlendTreeSource tree)
      Parameters:
      tree - the new root of our blend tree
    • addTransition

      public void addTransition(String keyword, AbstractTransitionState state)
      Add a new possible transition to this state.
      Parameters:
      keyword - the reference key for the added transition.
      state - the transition state to add.
      Throws:
      IllegalArgumentException - if keyword or state are null.
    • getTransition

      public AbstractTransitionState getTransition(String keyword)
      Parameters:
      keyword - the reference key for the transition state we wish to pull from this steady state.
      Returns:
      the transition related to the given keyword, or null if none are found.
      Throws:
      IllegalArgumentException - if keyword is null.
    • getTransitionKeywords

      public Set<String> getTransitionKeywords()
      Returns:
      a Set of the transition state keywords used by this steady state.
    • removeTransition

      public AbstractTransitionState removeTransition(String keyword)
      Remove a transition state by keyword.
      Parameters:
      keyword - the reference key for the transition state we wish to remove from this steady state.
      Returns:
      the removed transition, or null if none was found by the given keyword.
      Throws:
      IllegalArgumentException - if keyword is null.
    • removeTransition

      public boolean removeTransition(AbstractTransitionState transition)
      Remove the first instance of a specific transition state from this steady state.
      Parameters:
      transition - the transition state we wish to remove from this steady state.
      Returns:
      true if we found and removed the given transition.
      Throws:
      IllegalArgumentException - if transition is null.
    • doTransition

      public AbstractFiniteState doTransition(String key, AnimationLayer layer)
      Request that this state transition to another.
      Parameters:
      key - a key to match against a map of possible transitions.
      layer - the layer our state belongs to.
      Returns:
      the new state to transition to. May be null if the transition was not possible or was ignored for some reason.
    • update

      public void update(double globalTime, AnimationLayer layer)
      Description copied from class: AbstractFiniteState
      Update this state using the current global time.
      Specified by:
      update in class AbstractFiniteState
      Parameters:
      globalTime - the current global time.
      layer - the layer this state belongs to.
    • postUpdate

      public void postUpdate(AnimationLayer layer)
      Description copied from class: AbstractFiniteState
      Post update. If the state has no more clips and no end transition, this will clear this state from the layer.
      Specified by:
      postUpdate in class AbstractFiniteState
      Parameters:
      layer - the layer this state belongs to.
    • getCurrentSourceData

      public Map<String,? extends Object> getCurrentSourceData(AnimationManager manager)
      Specified by:
      getCurrentSourceData in class AbstractFiniteState
      Parameters:
      manager - animation manager
      Returns:
      the current map of source channel data for this layer.
    • resetClips

      public void resetClips(AnimationManager manager, double globalStartTime)
      Description copied from class: AbstractFiniteState
      Reset the clip instances held by this state's blend tree (or other leaf nodes in our blend tree) to given start time.
      Overrides:
      resetClips in class AbstractFiniteState
      Parameters:
      manager - our manager.
      globalStartTime - the new start time to use.