Class BodyMotionFind

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

public class BodyMotionFind extends BodyMotionFindWithTarget
  • Constructor Details

  • Method Details

    • canComputeMotion

      public boolean canComputeMotion(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, @Nullable InfoProvider infoProvider, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
      Overrides:
      canComputeMotion in class BodyMotionFindWithTarget
    • isGoalReached

      public boolean isGoalReached(@Nonnull Ref<EntityStore> ref, AStarBase aStarBase, @Nonnull AStarNode aStarNode, @Nonnull MotionController motionController, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
    • estimateToGoal

      public float estimateToGoal(@Nonnull AStarBase aStarBase, @Nonnull org.joml.Vector3d fromPosition, MotionController motionController)
    • findBestPath

      public void findBestPath(@Nonnull AStarBase aStarBase, MotionController controller)
      Specified by:
      findBestPath in class BodyMotionFindBase<AStarWithTarget>
    • getDesiredTargetDistance

      public double getDesiredTargetDistance()
      Description copied from interface: BodyMotion
      Get desired target distance from the steering motion.

      Separation ranges can be larger than the desired distance from a target. To ensure that the target can be reached the NPC needs to know the desired target distance when computing separation.

      Returns:
      Desired target distance or a really large value if not applicable.
    • getDesiredTargetEntity

      @Nullable public Ref<EntityStore> getDesiredTargetEntity()
      Description copied from interface: BodyMotion
      Get the desired target entity from the steering motion.

      This is required to match the desired target distance with the actual target entity when computing separation.

      Returns:
      Desired target entity or null if not applicable.