Contents
Class BodyMotionFindBase<T extends AStarBase>
java.lang.Object
com.hypixel.hytale.server.npc.corecomponents.AnnotatedComponentBase
com.hypixel.hytale.server.npc.corecomponents.MotionBase
com.hypixel.hytale.server.npc.corecomponents.BodyMotionBase
com.hypixel.hytale.server.npc.corecomponents.movement.BodyMotionFindBase<T>
- 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
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionBodyMotionFindBase(BuilderBodyMotionFindBase builderBodyMotionFindBase, BuilderSupport support, T aStar) -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(Ref<EntityStore> ref, ExecutionSupport executionSupport, ComponentAccessor<EntityStore> componentAccessor) Called to activate this motionbooleancomputeSteering(Ref<EntityStore> ref, ExecutionSupport executionSupport, InfoProvider infoProvider, double dt, Steering desiredSteering, ComponentAccessor<EntityStore> componentAccessor) Calculate desired steering for MotionController.voiddeactivate(Ref<EntityStore> ref, ExecutionSupport executionSupport, ComponentAccessor<EntityStore> componentAccessor) Called to deactivate this motionabstract voidfindBestPath(AStarBase aStarBase, MotionController controller) Returns the set of movement constraints that this body motion has been configured to relax, ornullfor body motions that do not support constraint relaxation.voidonDebugFlagsChanged(EnumSet<RoleDebugFlags> newFlags) Methods inherited from class AnnotatedComponentBase
getIndex, getInfo, getParent, setContextMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AStarEvaluator
estimateToGoal, isGoalReachedMethods inherited from interface BodyMotion
findWrappedBodyMotion, getDesiredTargetDistance, getDesiredTargetEntity, getSteeringMotionMethods inherited from interface IAnnotatedComponent
getBreadCrumbs, getBreadCrumbs, getIndex, getInfo, getLabel, getParent, setContextMethods inherited from interface Motion
preComputeSteeringMethods inherited from interface RoleStateChange
loaded, motionControllerChanged, registerWithSupport, removed, spawned, teleported, unloaded
-
Constructor Details
-
BodyMotionFindBase
public BodyMotionFindBase(@Nonnull BuilderBodyMotionFindBase builderBodyMotionFindBase, @Nonnull BuilderSupport support, @Nonnull T aStar)
-
-
Method Details
-
getRelaxedConstraints
Description copied from interface:BodyMotionReturns the set of movement constraints that this body motion has been configured to relax, ornullfor body motions that do not support constraint relaxation.- Specified by:
getRelaxedConstraintsin interfaceBodyMotion- Returns:
- the relaxed constraint set from the motion's configuration, or
nullif not applicable
-
activate
public void activate(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Description copied from interface:MotionCalled to activate this motion- Specified by:
activatein interfaceMotion- Parameters:
ref- The entity ref of the NPCexecutionSupport- TheExecutionSupportcomponentAccessor- 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:MotionCalled to deactivate this motion- Specified by:
deactivatein interfaceMotion- Parameters:
ref- The entity refexecutionSupport- TheExecutionSupportcomponentAccessor- 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:MotionCalculate desired steering for MotionController.- Specified by:
computeSteeringin interfaceMotion- Parameters:
ref- The entity refexecutionSupport- TheExecutionSupportinfoProvider- SensorInfo with PositionProvider, PathProvider, etc. if requireddt- The interval in seconds for this calculationdesiredSteering- The computed steering force for the MotionControllercomponentAccessor- The entity store- Returns:
falsewhen the end condition has been reached,trueif must be called again to reach end condition or is infinite.
-
onDebugFlagsChanged
- Specified by:
onDebugFlagsChangedin interfaceDebugSupport.DebugFlagsChangeListener
-