Class BodyMotionTimer

All Implemented Interfaces:
BodyMotion, Motion, RoleStateChange, IAnnotatedComponent

public class BodyMotionTimer extends MotionTimer<BodyMotion> implements BodyMotion
  • Constructor Details

  • Method Details

    • getSteeringMotion

      public BodyMotion getSteeringMotion()
      Description copied from interface: BodyMotion
      Return Motion which actually generated the steering value

      Motions can be wrappers around other motions (like MotionTimer). This method returns the actually executed motion generating the steering value in #computeSteering.

      Specified by:
      getSteeringMotion in interface BodyMotion
      Returns:
      Motion generating the steering value
    • findWrappedBodyMotion

      @Nullable public <T extends BodyMotion> T findWrappedBodyMotion(@Nonnull Class<T> clazz)
      Description copied from interface: BodyMotion
      Search for a wrapped body motion of the given type, looking through wrapper body motions such as BodyMotionTimer and BodyMotionSequence.

      The default implementation uses BodyMotion.getSteeringMotion() to unwrap a single level of wrapping, which handles timers correctly at any depth since getSteeringMotion() is recursive. Wrapper types that aggregate multiple motions (e.g. sequences) should override to search their children.

      Specified by:
      findWrappedBodyMotion in interface BodyMotion
      Parameters:
      clazz - the type to look for
      Returns:
      the first wrapped instance of the given type, or null if none found