Class AnimationStateMachine

    • Field Detail

      • LOGGER

        private static final org.apache.logging.log4j.Logger LOGGER
      • parameters

        private final com.google.common.collect.ImmutableMap<java.lang.String,​ITimeValue> parameters
      • clips

        private final com.google.common.collect.ImmutableMap<java.lang.String,​IClip> clips
      • states

        private final com.google.common.collect.ImmutableList<java.lang.String> states
      • transitions

        private final com.google.common.collect.ImmutableMultimap<java.lang.String,​java.lang.String> transitions
      • startState

        @SerializedName("start_state")
        private final java.lang.String startState
      • shouldHandleSpecialEvents

        private transient boolean shouldHandleSpecialEvents
      • currentStateName

        private transient java.lang.String currentStateName
      • currentState

        private transient IClip currentState
      • lastPollTime

        private transient float lastPollTime
      • clipCache

        private static final com.google.common.cache.LoadingCache<org.apache.commons.lang3.tuple.Triple<? extends IClip,​java.lang.Float,​java.lang.Float>,​org.apache.commons.lang3.tuple.Pair<IModelTransform,​java.lang.Iterable<Event>>> clipCache
      • asmGson

        private static final com.google.gson.Gson asmGson
    • Constructor Detail

      • AnimationStateMachine

        public AnimationStateMachine​(com.google.common.collect.ImmutableMap<java.lang.String,​ITimeValue> parameters,
                                     com.google.common.collect.ImmutableMap<java.lang.String,​IClip> clips,
                                     com.google.common.collect.ImmutableList<java.lang.String> states,
                                     com.google.common.collect.ImmutableMultimap<java.lang.String,​java.lang.String> transitions,
                                     java.lang.String startState)
    • Method Detail

      • initialize

        void initialize()
        post-loading initialization hook.
      • apply

        public org.apache.commons.lang3.tuple.Pair<IModelTransform,​java.lang.Iterable<Event>> apply​(float time)
        Description copied from interface: IAnimationStateMachine
        Sample the state and events at the current time. Event iterable will contain all events that happened from the last invocation of this method, from most to least recent. Event offset is relative to the previous event, and for the first event it's relative to the current time.
        Specified by:
        apply in interface IAnimationStateMachine
      • shouldHandleSpecialEvents

        public void shouldHandleSpecialEvents​(boolean value)
        Description copied from interface: IAnimationStateMachine
        Set to true if the machine should handle special events that come from the clips (they start with '!'). Right now only implemented event is "!transition:". Default value is true.
        Specified by:
        shouldHandleSpecialEvents in interface IAnimationStateMachine