Class MotionTimer<T extends Motion>

All Implemented Interfaces:
Motion, RoleStateChange, IAnnotatedComponent
Direct Known Subclasses:
BodyMotionTimer, HeadMotionTimer

public abstract class MotionTimer<T extends Motion> extends MotionBase
  • Constructor Details

  • Method Details

    • activate

      public void activate(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
      Description copied from interface: Motion
      Called to activate this motion
      Parameters:
      ref - The entity ref of the NPC
      executionSupport - The ExecutionSupport
      componentAccessor - The entity store for component access
    • deactivate

      public void deactivate(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
      Description copied from interface: Motion
      Called to deactivate this motion
      Parameters:
      ref - The entity ref
      executionSupport - The ExecutionSupport
      componentAccessor - The component store for component access
    • computeSteering

      public boolean computeSteering(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, @Nullable InfoProvider sensorInfo, double dt, @Nonnull Steering desiredSteering, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
      Description copied from interface: Motion
      Calculate desired steering for MotionController.
      Parameters:
      ref - The entity ref
      executionSupport - The ExecutionSupport
      sensorInfo - SensorInfo with PositionProvider, PathProvider, etc. if required
      dt - The interval in seconds for this calculation
      desiredSteering - The computed steering force for the MotionController
      componentAccessor - The entity store
      Returns:
      false when the end condition has been reached, true if must be called again to reach end condition or is infinite.
    • registerWithSupport

      public void registerWithSupport(ExecutionSupport executionSupport)
    • motionControllerChanged

      public void motionControllerChanged(@Nullable Ref<EntityStore> ref, @Nonnull NPCEntity npcComponent, MotionController motionController, @Nullable ComponentAccessor<EntityStore> componentAccessor)
    • loaded

      public void loaded(ExecutionSupport executionSupport)
    • spawned

      public void spawned(ExecutionSupport executionSupport)
    • unloaded

      public void unloaded(ExecutionSupport executionSupport)
    • removed

      public void removed(ExecutionSupport executionSupport)
    • teleported

      public void teleported(ExecutionSupport executionSupport, World from, World to)