Class BodyMotionFindBase<T extends AStarBase>

All Implemented Interfaces:
BodyMotion, Motion, RoleStateChange, AStarEvaluator, DebugSupport.DebugFlagsChangeListener, IAnnotatedComponent
Direct Known Subclasses:
BodyMotionFindWithTarget, BodyMotionLeave

public abstract class BodyMotionFindBase<T extends AStarBase> extends BodyMotionBase implements AStarEvaluator, DebugSupport.DebugFlagsChangeListener
  • Constructor Details

  • Method Details

    • getRelaxedConstraints

      @Nullable public EnumSet<RelaxedConstraint> getRelaxedConstraints()
      Description copied from interface: BodyMotion
      Returns the set of movement constraints that this body motion has been configured to relax, or null for body motions that do not support constraint relaxation.
      Specified by:
      getRelaxedConstraints in interface BodyMotion
      Returns:
      the relaxed constraint set from the motion's configuration, or null if not applicable
    • 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
      Specified by:
      activate in interface 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
      Specified by:
      deactivate in interface 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 infoProvider, double dt, @Nonnull Steering desiredSteering, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
      Description copied from interface: Motion
      Calculate desired steering for MotionController.
      Specified by:
      computeSteering in interface Motion
      Parameters:
      ref - The entity ref
      executionSupport - The ExecutionSupport
      infoProvider - 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.
    • findBestPath

      public abstract void findBestPath(AStarBase aStarBase, MotionController controller)
    • onDebugFlagsChanged

      public void onDebugFlagsChanged(EnumSet<RoleDebugFlags> newFlags)
      Specified by:
      onDebugFlagsChanged in interface DebugSupport.DebugFlagsChangeListener