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

public class MotionControllerDive extends MotionControllerBase
  • Field Details

    • TYPE

      public static final String 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

      protected final PositionProbeWater moveProbe
    • probeMoveProbe

      protected final PositionProbeWater probeMoveProbe
    • tempPosition

      protected final Vector3d tempPosition
    • tempDirection

      protected final Vector3d tempDirection
    • VALID_MOTIONS

      private static final EnumSet<MotionKind> VALID_MOTIONS
  • Constructor Details

  • Method Details

    • activate

      public void activate()
      Specified by:
      activate in interface com.hypixel.hytale.server.npc.movement.controllers.MotionController
      Overrides:
      activate in class MotionControllerBase
    • 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:
      computeMove in class MotionControllerBase
    • shouldDampenAppliedVelocitiesY

      protected boolean shouldDampenAppliedVelocitiesY()
      Overrides:
      shouldDampenAppliedVelocitiesY in class MotionControllerBase
    • shouldAlwaysUseGroundResistance

      protected boolean shouldAlwaysUseGroundResistance()
      Overrides:
      shouldAlwaysUseGroundResistance in class MotionControllerBase
    • computeTranslation

      private void computeTranslation(@Nonnull Vector3d translation, double dt, float heading, double moveSpeed, double climbSpeed)
    • isNearZero

      private boolean isNearZero(float angle)
    • setMotionKind

      public void setMotionKind(MotionKind motionKind)
      Overrides:
      setMotionKind in class MotionControllerBase
    • executeMove

      protected double executeMove(@Nonnull Ref<EntityStore> ref, @Nonnull Role role, double dt, @Nonnull Vector3d translation, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
      Specified by:
      executeMove in class MotionControllerBase
    • constrainRotations

      public void constrainRotations(Role role, @Nonnull TransformComponent transform)
    • getCurrentMaxBodyRotationSpeed

      public double getCurrentMaxBodyRotationSpeed()
    • canAct

      public boolean canAct(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
      Specified by:
      canAct in interface com.hypixel.hytale.server.npc.movement.controllers.MotionController
      Overrides:
      canAct in class MotionControllerBase
    • inAir

      public boolean inAir()
    • inWater

      public boolean inWater()
    • onGround

      public boolean onGround()
    • getType

      @Nonnull public String 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:
      isFastMotionKind in class MotionControllerBase
    • is2D

      public boolean is2D()
    • canRestAtPlace

      public boolean canRestAtPlace()
    • getDesiredAltitudeWeight

      public double getDesiredAltitudeWeight()
    • getHeightOverGround

      public double getHeightOverGround()
    • estimateVelocity

      public boolean estimateVelocity(Steering steering, @Nonnull Vector3d velocityOut)
    • updateModelParameters

      public void updateModelParameters(Ref<EntityStore> ref, Model model, @Nonnull Box boundingBox, ComponentAccessor<EntityStore> componentAccessor)
      Specified by:
      updateModelParameters in interface com.hypixel.hytale.server.npc.movement.controllers.MotionController
      Overrides:
      updateModelParameters in class MotionControllerBase
    • dampForceVelocity

      protected void dampForceVelocity(@Nonnull Vector3d forceVelocity, double forceVelocityDamping, double interval, ComponentAccessor<EntityStore> componentAccessor)
      Overrides:
      dampForceVelocity in class MotionControllerBase
    • 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()