Class MotionControllerDive
java.lang.Object
com.hypixel.hytale.server.npc.movement.controllers.MotionControllerBase
com.hypixel.hytale.server.npc.movement.controllers.MotionControllerDive
- All Implemented Interfaces:
com.hypixel.hytale.server.npc.movement.controllers.MotionController
-
Nested Class Summary
Nested classes/interfaces inherited from class com.hypixel.hytale.server.npc.movement.controllers.MotionControllerBase
MotionControllerBase.AppliedVelocityNested classes/interfaces inherited from interface com.hypixel.hytale.server.npc.movement.controllers.MotionController
com.hypixel.hytale.server.npc.movement.controllers.MotionController.VerticalRange -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final doubleprotected doublestatic final intstatic final intprotected booleanprotected doubleprotected static doublestatic final doubleprotected final doubleprotected final doubleprotected final doubleprotected final doubleprotected final floatprotected final doubleprotected final doubleprotected final doubleprotected final doubleprotected final doubleprotected final doubleprotected final doubleprotected final doubleprotected final doubleprotected final PositionProbeWaterprotected final PositionProbeWaterprotected final doubleprotected final doubleprotected doubleprotected final Vector3dprotected final Vector3dstatic final Stringprivate static final EnumSet<MotionKind> protected final com.hypixel.hytale.server.npc.movement.controllers.MotionController.VerticalRangeFields inherited from class com.hypixel.hytale.server.npc.movement.controllers.MotionControllerBase
appliedForce, appliedVelocities, BISECT_DIST, bisectInvalidPosition, bisectValidPosition, blendHeading, blendHeadingPosition, blendLevelAtTargetPosition, cachedMovementBlocked, collisionBoundingBox, collisionResult, componentSelector, DEBUG_APPLIED_FORCES, debugModeBlockCollisions, debugModeCollisions, debugModeMove, debugModeOverlaps, debugModeProbeBlockCollisions, debugModeSteer, debugModeValidateMath, debugModeValidatePositions, DEFAULT_BLOCK_DRAG, DOT_PRODUCT_EPSILON, effectHorizontalSpeedMultiplier, enableBlockDamage, enableTriggers, entity, epsilonAngle, epsilonSpeed, fastMotionKind, fastMotionThreshold, fastMotionThresholdRange, FILTER_COEFFICIENT, FORCE_SCALE, forceVelocity, forceVelocityDamping, gravity, haveBlendHeadingPosition, havePreciseMovementTarget, horizontalIdleKind, idleMotionKind, ignoreDamping, inertia, isAvoidingBlockDamage, isBlendingHeading, isObstructed, isReceivingBlockDamage, isRelaxedMoveConstraints, knockbackScale, lastMovementStateUpdatedMotionKind, lastValidPosition, LOGGER, maxHeadRotationSpeed, maxHorizontalSpeed, motionKind, movementSettings, moveSpeed, navState, planarComponentSelector, position, preciseMovementTarget, previousMotionKind, previousSpeed, recomputePath, requiresDepthProbing, requiresPreciseMovement, role, targetDeltaSquared, throttleDuration, translation, type, worldAntiNormal, worldNormal -
Constructor Summary
ConstructorsConstructorDescriptionMotionControllerDive(BuilderSupport builderSupport, BuilderMotionControllerDive builder) -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()doublebisect(Ref<EntityStore> ref, Vector3d validPosition, double validDistance, Vector3d invalidPosition, double invalidDistance, Vector3d result, ComponentAccessor<EntityStore> componentAccessor) doublebisect(Ref<EntityStore> ref, Vector3d validPosition, Vector3d invalidPosition, Vector3d result, ComponentAccessor<EntityStore> componentAccessor) booleancanAct(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) booleanprotected doublecomputeMove(Ref<EntityStore> ref, Role role, Steering steering, double dt, Vector3d translation, ComponentAccessor<EntityStore> componentAccessor) private voidcomputeTranslation(Vector3d translation, double dt, float heading, double moveSpeed, double climbSpeed) voidconstrainRotations(Role role, TransformComponent transform) protected voiddampForceVelocity(Vector3d forceVelocity, double forceVelocityDamping, double interval, ComponentAccessor<EntityStore> componentAccessor) booleanestimateVelocity(Steering steering, Vector3d velocityOut) protected doubleexecuteMove(Ref<EntityStore> ref, Role role, double dt, Vector3d translation, ComponentAccessor<EntityStore> componentAccessor) doubledoubledoubledoubledoublecom.hypixel.hytale.server.npc.movement.controllers.MotionController.VerticalRangegetDesiredVerticalRange(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) doublefloatdoublefloatgetType()doublebooleaninAir()booleaninWater()booleanis2D()booleanisFastMotionKind(double speed) private booleanisNearZero(float angle) booleanonGround()doubleprobeMove(Ref<EntityStore> ref, ProbeMoveData probeMoveData, ComponentAccessor<EntityStore> componentAccessor) static doublerelativeSwimDepthToBoundingBox(double swimDepth, Box boundingBox, float eyeHeight) static doublerelativeSwimDepthToHeight(double swimDepth, Box boundingBox, float eyeHeight) static doublerelativeSwimDepthToHeight(Ref<EntityStore> ref, double swimDepth, Model model, Box boundingBox, ComponentAccessor<EntityStore> componentAccessor) voidsetMotionKind(MotionKind motionKind) protected booleanprotected booleanvoidspawned()voidupdateModelParameters(Ref<EntityStore> ref, Model model, Box boundingBox, ComponentAccessor<EntityStore> componentAccessor) Methods inherited from class com.hypixel.hytale.server.npc.movement.controllers.MotionControllerBase
addForce, adjustReadPosition, adjustWritePosition, beforeInstructionMotion, beforeInstructionSensorsAndActions, bisect, bisect, blendBodyYaw, calculatePitch, calculateRoll, calculateYaw, clearBlendHeading, clearForce, clearRequireDepthProbing, clearRequirePreciseMovement, deactivate, dumpCollisionResults, enableHeadingBlending, enableHeadingBlending, forceVelocity, getComponentSelector, getEpsilonAngle, getEpsilonSpeed, getForce, getGravity, getInvalidOverlapMaterials, getMotionKind, getNavState, getPitch, getPlanarComponentSelector, getRole, getRoll, getTargetDeltaSquared, getThrottleDuration, getWorldAntiNormal, getWorldNormal, getYaw, isAlive, isAvoidingBlockDamage, isDebugMode, isForceRecomputePath, isHorizontalIdle, isInProgress, isMovementBlocked, isObstructed, isProcessTriggersHasMoved, isRelaxedMoveConstraints, isRequiresDepthProbing, isRequiresPreciseMovement, isValidPosition, isValidPosition, moveEntity, postExecuteMove, postReadPosition, probeMove, processTriggers, readEntityPosition, requireDepthProbing, requirePreciseMovement, resetNavState, resetObstructedFlags, saveMotionKind, setAvoidingBlockDamage, setComponentSelector, setEnableBlockDamage, setEnableTriggers, setForceRecomputePath, setGravity, setInertia, setKnockbackScale, setNavState, setRelaxedMoveConstraints, setRole, standingOnBlockOfType, steer, steer0, switchedToMotionKind, touchesWater, translateToAccessiblePosition, updateAscendingStates, updateDescendingStates, updateDroppingStates, updateFlyingStates, updateMovementState, updateMovingStates, updatePhysicsValues, updateStandingStates, updateSwimmingStates, waypointDistance, waypointDistance, waypointDistanceSquared, waypointDistanceSquared, willReceiveBlockDamageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hypixel.hytale.server.npc.movement.controllers.MotionController
clearOverrides, getSquaredDistance, matchesType
-
Field Details
-
TYPE
- See Also:
-
COLLISION_MATERIALS_ACTIVE
public static final int COLLISION_MATERIALS_ACTIVE- See Also:
-
COLLISION_MATERIALS_PASSIVE
public static final int COLLISION_MATERIALS_PASSIVE- See Also:
-
DEFAULT_SWIM_DEPTH
public static final double DEFAULT_SWIM_DEPTH- See Also:
-
DAMPING_FACTOR
protected static double DAMPING_FACTOR -
maxVerticalSpeed
protected final double maxVerticalSpeed -
acceleration
protected final double acceleration -
maxFallSpeed
protected final double maxFallSpeed -
maxSinkSpeed
protected final double maxSinkSpeed -
maxRotationSpeed
protected final double maxRotationSpeed -
maxMoveTurnAngle
protected final float maxMoveTurnAngle -
minDiveDepth
protected final double minDiveDepth -
maxDiveDepth
protected final double maxDiveDepth -
minWaterDepth
protected final double minWaterDepth -
maxWaterDepth
protected final double maxWaterDepth -
minDepthAboveGround
protected final double minDepthAboveGround -
minDepthBelowSurface
protected final double minDepthBelowSurface -
relativeSwimDepth
protected final double relativeSwimDepth -
sinkRatio
protected final double sinkRatio -
fastDiveThreshold
protected final double fastDiveThreshold -
minSpeedAfterForceSquared
protected final double minSpeedAfterForceSquared -
desiredDepthWeight
protected final double desiredDepthWeight -
swimDepth
protected double swimDepth -
climbSpeed
protected double climbSpeed -
currentRelativeSpeed
protected double currentRelativeSpeed -
collisionWithSolid
protected boolean collisionWithSolid -
verticalRange
protected final com.hypixel.hytale.server.npc.movement.controllers.MotionController.VerticalRange verticalRange -
moveProbe
-
probeMoveProbe
-
tempPosition
-
tempDirection
-
VALID_MOTIONS
-
-
Constructor Details
-
MotionControllerDive
public MotionControllerDive(@Nonnull BuilderSupport builderSupport, @Nonnull BuilderMotionControllerDive builder)
-
-
Method Details
-
activate
public void activate()- Specified by:
activatein interfacecom.hypixel.hytale.server.npc.movement.controllers.MotionController- Overrides:
activatein classMotionControllerBase
-
getWanderVerticalMovementRatio
public double getWanderVerticalMovementRatio() -
getDesiredVerticalRange
@Nonnull public com.hypixel.hytale.server.npc.movement.controllers.MotionController.VerticalRange getDesiredVerticalRange(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
computeMove
protected double computeMove(@Nonnull Ref<EntityStore> ref, @Nonnull Role role, @Nonnull Steering steering, double dt, @Nonnull Vector3d translation, @Nonnull ComponentAccessor<EntityStore> componentAccessor) - Specified by:
computeMovein classMotionControllerBase
-
shouldDampenAppliedVelocitiesY
protected boolean shouldDampenAppliedVelocitiesY()- Overrides:
shouldDampenAppliedVelocitiesYin classMotionControllerBase
-
shouldAlwaysUseGroundResistance
protected boolean shouldAlwaysUseGroundResistance()- Overrides:
shouldAlwaysUseGroundResistancein classMotionControllerBase
-
computeTranslation
private void computeTranslation(@Nonnull Vector3d translation, double dt, float heading, double moveSpeed, double climbSpeed) -
isNearZero
private boolean isNearZero(float angle) -
setMotionKind
- Overrides:
setMotionKindin classMotionControllerBase
-
executeMove
protected double executeMove(@Nonnull Ref<EntityStore> ref, @Nonnull Role role, double dt, @Nonnull Vector3d translation, @Nonnull ComponentAccessor<EntityStore> componentAccessor) - Specified by:
executeMovein classMotionControllerBase
-
constrainRotations
-
getCurrentMaxBodyRotationSpeed
public double getCurrentMaxBodyRotationSpeed() -
canAct
public boolean canAct(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor) - Specified by:
canActin interfacecom.hypixel.hytale.server.npc.movement.controllers.MotionController- Overrides:
canActin classMotionControllerBase
-
inAir
public boolean inAir() -
inWater
public boolean inWater() -
onGround
public boolean onGround() -
getType
-
bisect
public double bisect(@Nonnull Ref<EntityStore> ref, @Nonnull Vector3d validPosition, double validDistance, @Nonnull Vector3d invalidPosition, double invalidDistance, @Nonnull Vector3d result, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
bisect
public double bisect(@Nonnull Ref<EntityStore> ref, @Nonnull Vector3d validPosition, @Nonnull Vector3d invalidPosition, @Nonnull Vector3d result, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
probeMove
public double probeMove(@Nonnull Ref<EntityStore> ref, @Nonnull ProbeMoveData probeMoveData, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
spawned
public void spawned() -
getCurrentSpeed
public double getCurrentSpeed() -
getCurrentTurnRadius
public double getCurrentTurnRadius() -
getMaxClimbAngle
public float getMaxClimbAngle() -
getMaxSinkAngle
public float getMaxSinkAngle() -
getMaximumSpeed
public double getMaximumSpeed() -
isFastMotionKind
public boolean isFastMotionKind(double speed) - Specified by:
isFastMotionKindin classMotionControllerBase
-
is2D
public boolean is2D() -
canRestAtPlace
public boolean canRestAtPlace() -
getDesiredAltitudeWeight
public double getDesiredAltitudeWeight() -
getHeightOverGround
public double getHeightOverGround() -
estimateVelocity
-
updateModelParameters
public void updateModelParameters(Ref<EntityStore> ref, Model model, @Nonnull Box boundingBox, ComponentAccessor<EntityStore> componentAccessor) - Specified by:
updateModelParametersin interfacecom.hypixel.hytale.server.npc.movement.controllers.MotionController- Overrides:
updateModelParametersin classMotionControllerBase
-
dampForceVelocity
protected void dampForceVelocity(@Nonnull Vector3d forceVelocity, double forceVelocityDamping, double interval, ComponentAccessor<EntityStore> componentAccessor) - Overrides:
dampForceVelocityin classMotionControllerBase
-
relativeSwimDepthToBoundingBox
public static double relativeSwimDepthToBoundingBox(double swimDepth, @Nullable Box boundingBox, float eyeHeight) -
relativeSwimDepthToHeight
public static double relativeSwimDepthToHeight(double swimDepth, @Nullable Box boundingBox, float eyeHeight) -
relativeSwimDepthToHeight
public static double relativeSwimDepthToHeight(@Nullable Ref<EntityStore> ref, double swimDepth, Model model, Box boundingBox, @Nullable ComponentAccessor<EntityStore> componentAccessor) -
getDampingDeceleration
public double getDampingDeceleration()
-