Contents
Interface Motion
- All Superinterfaces:
IAnnotatedComponent, RoleStateChange
- All Known Subinterfaces:
BodyMotion, HeadMotion
- All Known Implementing Classes:
BodyMotionAimCharge, BodyMotionBase, BodyMotionCharge, BodyMotionFind, BodyMotionFindBase, BodyMotionFindWithTarget, BodyMotionFlock, BodyMotionLand, BodyMotionLeave, BodyMotionMaintainDistance, BodyMotionMatchLook, BodyMotionMoveAway, BodyMotionNothing, BodyMotionPath, BodyMotionSequence, BodyMotionTakeOff, BodyMotionTeleport, BodyMotionTestProbe, BodyMotionTimer, BodyMotionWander, BodyMotionWanderBase, BodyMotionWanderInCircle, BodyMotionWanderInRect, HeadMotionAim, HeadMotionBase, HeadMotionNothing, HeadMotionObserve, HeadMotionRotate, HeadMotionSequence, HeadMotionTimer, HeadMotionWatch, MotionBase, MotionSequence, MotionTimer
A Motion computes a steering output (desired relative speed, direction and rotation)
A steering describes a desired speed and rotation relative to max speed.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidactivate(Ref<EntityStore> ref, ExecutionSupport executionSupport, ComponentAccessor<EntityStore> componentAccessor) Called to activate this motionbooleancomputeSteering(Ref<EntityStore> ref, ExecutionSupport executionSupport, InfoProvider sensorInfo, double dt, Steering desiredSteering, ComponentAccessor<EntityStore> componentAccessor) Calculate desired steering for MotionController.default voiddeactivate(Ref<EntityStore> ref, ExecutionSupport executionSupport, ComponentAccessor<EntityStore> componentAccessor) Called to deactivate this motiondefault voidpreComputeSteering(Ref<EntityStore> ref, ExecutionSupport executionSupport, InfoProvider provider, Store<EntityStore> store) Called before calculating the desired steering forMotionControllerMethods inherited from interface IAnnotatedComponent
getBreadCrumbs, getBreadCrumbs, getIndex, getInfo, getLabel, getParent, setContextMethods inherited from interface RoleStateChange
loaded, motionControllerChanged, registerWithSupport, removed, spawned, teleported, unloaded
-
Method Details
-
preComputeSteering
default void preComputeSteering(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, @Nullable InfoProvider provider, @Nonnull Store<EntityStore> store) Called before calculating the desired steering forMotionController- Parameters:
ref- The entity ref of the NPCexecutionSupport- TheExecutionSupportprovider- TheInfoProviderstore- The entity store for component access
-
activate
default void activate(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to activate this motion- Parameters:
ref- The entity ref of the NPCexecutionSupport- TheExecutionSupportcomponentAccessor- The entity store for component access
-
deactivate
default void deactivate(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to deactivate this motion- Parameters:
ref- The entity refexecutionSupport- TheExecutionSupportcomponentAccessor- The component store for component access
-
computeSteering
boolean computeSteering(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, @Nullable InfoProvider sensorInfo, double dt, @Nonnull Steering desiredSteering, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Calculate desired steering for MotionController.- Parameters:
ref- The entity refexecutionSupport- TheExecutionSupportsensorInfo- 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.
-