Contents
- Description
- Nested Class Summary
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- getType()
- getSupportedMovementModes()
- getDefaultSpawnMovementModes()
- spawned()
- getWanderVerticalMovementRatio()
- getDesiredVerticalRange(Ref, ComponentAccessor)
- isFastMotionKind(double)
- isInProgress()
- canSteer(Ref, ComponentAccessor)
- canSteerFailReason(Ref, ComponentAccessor)
- updateModelParameters(Ref, Model, Box, ComponentAccessor)
- constrainRotations(Role, TransformComponent)
- setVelocity(Vector3dc, VelocityConfig, boolean)
- setVelocity(Vector3dc, VelocityConfig, boolean, float)
- inAir()
- onGround()
- standingOnBlockOfType(int)
- inWater()
- touchesWater(boolean, ComponentAccessor)
- getCurrentSpeed()
- getCurrentTurnRadius()
- getMaxClimbAngle()
- getMaxSinkAngle()
- getMaxClimbHeight()
- getMaxDropHeight()
- getMaximumSpeed()
- is2D()
- canRestAtPlace()
- getDesiredAltitudeWeight()
- getHeightOverGround()
- estimateVelocity(Steering, Vector3d)
- setMotionKind(MotionKind)
- postReadPosition(Ref, ComponentAccessor)
- translateToAccessiblePosition(Vector3d, Box, double, double, ComponentAccessor)
- translateToAccessiblePosition(Vector3d, double, double, ComponentAccessor)
- probeMove(Ref, ProbeMoveData, ComponentAccessor)
- getCurrentMaxBodyRotationSpeed()
Class MotionControllerWalk
java.lang.Object
com.hypixel.hytale.server.npc.movement.controllers.MotionControllerBase
com.hypixel.hytale.server.npc.movement.controllers.MotionControllerWalk
- All Implemented Interfaces:
MotionController, DebugSupport.DebugFlagsChangeListener
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumNested classes/interfaces inherited from interface MotionController
MotionController.VerticalRange -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doublestatic final doublestatic final doublestatic final doublestatic final doublestatic final doublestatic final doublestatic final Set<MovementMode> static final StringFields inherited from class MotionControllerBase
BISECT_DIST, DEBUG_APPLIED_FORCES, DEFAULT_BLOCK_DRAG, DOT_PRODUCT_EPSILON, FILTER_COEFFICIENT, FORCE_SCALE -
Constructor Summary
ConstructorsConstructorDescriptionMotionControllerWalk(BuilderMotionControllerWalk builder, BuilderSupport builderSupport) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleancanSteer(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) canSteerFailReason(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) IfMotionController.canSteer(Ref, ComponentAccessor)returns false, this method can be called to get a human-readable reason for why the motion controller cannot steer.voidconstrainRotations(Role role, TransformComponent transform) booleanestimateVelocity(Steering steering, org.joml.Vector3d velocityOut) doubledoubledoubledoublegetDesiredVerticalRange(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) doublefloatdoubleMaximum vertical distance the controller can climb in a single step (e.g. on some block).doubleMaximum vertical distance the controller can drop in a single step (e.g. off a ledge).doublefloatgetType()doublebooleaninAir()booleaninWater()booleanis2D()booleanisFastMotionKind(double speed) booleanbooleanonGround()voidpostReadPosition(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) doubleprobeMove(Ref<EntityStore> ref, ProbeMoveData probeMoveData, ComponentAccessor<EntityStore> componentAccessor) voidsetMotionKind(MotionKind motionKind) voidsetVelocity(org.joml.Vector3dc velocity, VelocityConfig velocityConfig, boolean ignoreDamping) voidsetVelocity(org.joml.Vector3dc velocity, VelocityConfig velocityConfig, boolean ignoreDamping, float preMultiplier) voidspawned()booleanstandingOnBlockOfType(int blockSet) booleantouchesWater(boolean defaultValue, ComponentAccessor<EntityStore> componentAccessor) Determines whether the entity associated with this motion controller is touching water.static inttranslateToAccessiblePosition(org.joml.Vector3d position, double minYValue, double maxYValue, ComponentAccessor<EntityStore> componentAccessor) Find position not in solid block by translating position up or downbooleantranslateToAccessiblePosition(org.joml.Vector3d position, Box boundingBox, double minYValue, double maxYValue, ComponentAccessor<EntityStore> componentAccessor) voidupdateModelParameters(Ref<EntityStore> ref, Model model, Box boundingBox, ComponentAccessor<EntityStore> componentAccessor) Methods inherited from class MotionControllerBase
activate, addVelocity, applyRailStep, beforeInstructionMotion, beforeInstructionSensorsAndActions, bisect, bisect, clearBlendHeading, clearExternalForces, clearExternalVelocity, clearRequirePreciseMovement, deactivate, enableHeadingBlending, enableHeadingBlending, getCollisionBoundingBox, getCombinedExternalVelocityLength, getComponentSelector, getEpsilonAngle, getEpsilonSpeed, getExternalVelocity, getGravity, getInvalidOverlapMaterials, getMotionKind, getNavState, getPitch, getPlanarComponentSelector, getRelaxedConstraints, getRole, getRoll, getTargetDeltaSquared, getThrottleDuration, getWorldAntiNormal, getWorldNormal, getYaw, isAvoidingBlockDamage, isForcePushed, isForceRecomputePath, isHorizontalIdle, isMovementBlocked, isObstructed, isProcessTriggersHasMoved, isRequiresPreciseMovement, isValidPosition, isValidPosition, moveEntity, onDebugFlagsChanged, preScaleKnockback, probeMove, processTriggers, requirePreciseMovement, resetNavState, resetObstructedFlags, setComponentSelector, setDebugEntityId, setEnableBlockDamage, setEnableTriggers, setForceRecomputePath, setGravity, setHeadPitchAngleRange, setInertia, setKnockbackScale, setNavState, setRelaxedMoveConstraints, setRole, setUseFixedKnockback, steer, steer0, updateMovementState, updatePhysicsValues, waypointDistance, waypointDistance, waypointDistanceSquared, waypointDistanceSquared, willReceiveBlockDamageMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface MotionController
addVelocity, clearOverrides, getSquaredDistance, matchesType
-
Field Details
-
TYPE
- See Also:
-
SUPPORTED_MOVEMENT_MODES
-
CLIMB_FORWARD_DISTANCE
public static final double CLIMB_FORWARD_DISTANCE- See Also:
-
CLIMB_FORWARD_DISTANCE_SQUARED
public static final double CLIMB_FORWARD_DISTANCE_SQUARED- See Also:
-
JUMP_FORWARD_DISTANCE
public static final double JUMP_FORWARD_DISTANCE- See Also:
-
ONE_PLUS_THRESHOLD
public static final double ONE_PLUS_THRESHOLD- See Also:
-
MIN_SAFETY_DISTANCE
public static final double MIN_SAFETY_DISTANCE- See Also:
-
EDGE_MARGIN_BBOX_FACTOR
public static final double EDGE_MARGIN_BBOX_FACTOR- See Also:
-
MIN_SEPARATION_STEERING
public static final double MIN_SEPARATION_STEERING- See Also:
-
-
Constructor Details
-
MotionControllerWalk
public MotionControllerWalk(@Nonnull BuilderMotionControllerWalk builder, @Nonnull BuilderSupport builderSupport)
-
-
Method Details
-
getType
-
getSupportedMovementModes
-
getDefaultSpawnMovementModes
-
spawned
public void spawned() -
getWanderVerticalMovementRatio
public double getWanderVerticalMovementRatio() -
getDesiredVerticalRange
@Nonnull public MotionController.VerticalRange getDesiredVerticalRange(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
isFastMotionKind
public boolean isFastMotionKind(double speed) -
isInProgress
public boolean isInProgress()- Specified by:
isInProgressin interfaceMotionController- Overrides:
isInProgressin classMotionControllerBase
-
canSteer
public boolean canSteer(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor) - Specified by:
canSteerin interfaceMotionController- Overrides:
canSteerin classMotionControllerBase
-
canSteerFailReason
@Nullable public String canSteerFailReason(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Description copied from interface:MotionControllerIfMotionController.canSteer(Ref, ComponentAccessor)returns false, this method can be called to get a human-readable reason for why the motion controller cannot steer.- Specified by:
canSteerFailReasonin interfaceMotionController- Overrides:
canSteerFailReasonin classMotionControllerBase- Parameters:
ref- NPC entity referencecomponentAccessor- Accessor to get components of the NPC entity- Returns:
- A human-readable reason for why the motion controller cannot steer, or null if the motion controller can steer
-
updateModelParameters
public void updateModelParameters(Ref<EntityStore> ref, Model model, @Nonnull Box boundingBox, ComponentAccessor<EntityStore> componentAccessor) - Specified by:
updateModelParametersin interfaceMotionController- Overrides:
updateModelParametersin classMotionControllerBase
-
constrainRotations
-
setVelocity
public void setVelocity(@Nonnull org.joml.Vector3dc velocity, VelocityConfig velocityConfig, boolean ignoreDamping) - Specified by:
setVelocityin interfaceMotionController- Overrides:
setVelocityin classMotionControllerBase
-
setVelocity
public void setVelocity(@Nonnull org.joml.Vector3dc velocity, VelocityConfig velocityConfig, boolean ignoreDamping, float preMultiplier) - Specified by:
setVelocityin interfaceMotionController- Overrides:
setVelocityin classMotionControllerBase
-
inAir
public boolean inAir() -
onGround
public boolean onGround() -
standingOnBlockOfType
public boolean standingOnBlockOfType(int blockSet) - Specified by:
standingOnBlockOfTypein interfaceMotionController- Overrides:
standingOnBlockOfTypein classMotionControllerBase
-
inWater
public boolean inWater() -
touchesWater
public boolean touchesWater(boolean defaultValue, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Description copied from class:MotionControllerBaseDetermines whether the entity associated with this motion controller is touching water.- Overrides:
touchesWaterin classMotionControllerBase- Parameters:
defaultValue- The default value to return if the chunk is not loaded.componentAccessor- TheComponentAccessor<EntityStore>for component access.- Returns:
trueif the entity is touching water,falseotherwise.
-
getCurrentSpeed
public double getCurrentSpeed() -
getCurrentTurnRadius
public double getCurrentTurnRadius() -
getMaxClimbAngle
public float getMaxClimbAngle() -
getMaxSinkAngle
public float getMaxSinkAngle() -
getMaxClimbHeight
public double getMaxClimbHeight()Description copied from interface:MotionControllerMaximum vertical distance the controller can climb in a single step (e.g. on some block). Default0for controllers without a climb concept; overridden by ground-based controllers likeMotionControllerWalk. -
getMaxDropHeight
public double getMaxDropHeight()Description copied from interface:MotionControllerMaximum vertical distance the controller can drop in a single step (e.g. off a ledge). Default0for controllers without a drop concept; overridden by ground-based controllers likeMotionControllerWalk. -
getMaximumSpeed
public double getMaximumSpeed() -
is2D
public boolean is2D() -
canRestAtPlace
public boolean canRestAtPlace() -
getDesiredAltitudeWeight
public double getDesiredAltitudeWeight() -
getHeightOverGround
public double getHeightOverGround() -
estimateVelocity
-
setMotionKind
- Overrides:
setMotionKindin classMotionControllerBase
-
postReadPosition
public void postReadPosition(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor) - Overrides:
postReadPositionin classMotionControllerBase
-
translateToAccessiblePosition
public boolean translateToAccessiblePosition(@Nonnull org.joml.Vector3d position, @Nullable Box boundingBox, double minYValue, double maxYValue, ComponentAccessor<EntityStore> componentAccessor) - Specified by:
translateToAccessiblePositionin interfaceMotionController- Overrides:
translateToAccessiblePositionin classMotionControllerBase
-
translateToAccessiblePosition
public static int translateToAccessiblePosition(@Nonnull org.joml.Vector3d position, double minYValue, double maxYValue, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Find position not in solid block by translating position up or down- Parameters:
position- Initial position which will be updated with result position on successminYValue- Minimum allowed y positionmaxYValue- Maximum allowed y positioncomponentAccessor- TheComponentAccessor<EntityStore>for component access.- Returns:
- -1 in case of error, 0 in case no position in range could be found or 1 in case of success (position will be updated then)
-
probeMove
public double probeMove(@Nonnull Ref<EntityStore> ref, @Nonnull ProbeMoveData probeMoveData, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
getCurrentMaxBodyRotationSpeed
public double getCurrentMaxBodyRotationSpeed()
-