Class MotionControllerFly

java.lang.Object
com.hypixel.hytale.server.npc.movement.controllers.MotionControllerBase
com.hypixel.hytale.server.npc.movement.controllers.MotionControllerFly
All Implemented Interfaces:
com.hypixel.hytale.server.npc.movement.controllers.MotionController

public class MotionControllerFly extends MotionControllerBase
  • Field Details

    • TYPE

      public static final String TYPE
      See Also:
    • DAMPING_FACTOR

      public static final double DAMPING_FACTOR
      See Also:
    • COLLISION_MATERIALS_PASSIVE

      public static final int COLLISION_MATERIALS_PASSIVE
      See Also:
    • COLLISION_MATERIALS_ACTIVE

      public static final int COLLISION_MATERIALS_ACTIVE
      See Also:
    • minAirSpeed

      protected final double minAirSpeed
    • maxClimbSpeed

      protected final double maxClimbSpeed
    • maxSinkSpeed

      protected final double maxSinkSpeed
    • maxFallSpeed

      protected final double maxFallSpeed
    • maxSinkSpeedFluid

      protected final double maxSinkSpeedFluid
    • maxClimbAngle

      protected final float maxClimbAngle
    • maxSinkAngle

      protected final float maxSinkAngle
    • acceleration

      protected final double acceleration
    • deceleration

      protected final double deceleration
    • sinkRatio

      protected final double sinkRatio
      See Also:
    • desiredAltitudeWeight

      protected final double desiredAltitudeWeight
    • maxTurnSpeed

      protected final float maxTurnSpeed
    • maxRollAngle

      protected final float maxRollAngle
    • maxRollSpeed

      protected final float maxRollSpeed
    • rollDamping

      protected final float rollDamping
    • fastFlyThreshold

      protected final double fastFlyThreshold
    • minHeightOverGround

      protected final double minHeightOverGround
    • maxHeightOverGround

      protected final double maxHeightOverGround
    • autoLevel

      protected final boolean autoLevel
    • sinMaxClimbAngle

      protected final double sinMaxClimbAngle
    • sinMaxSinkAngle

      protected final double sinMaxSinkAngle
    • verticalRange

      protected final com.hypixel.hytale.server.npc.movement.controllers.MotionController.VerticalRange verticalRange
    • moveProbe

      protected final PositionProbeAir moveProbe
    • probeMoveProbe

      protected final PositionProbeAir probeMoveProbe
    • lastVerticalPositionX

      protected int lastVerticalPositionX
    • lastVerticalPositionZ

      protected int lastVerticalPositionZ
    • lastVelocity

      protected final Vector3d lastVelocity
    • lastSpeed

      protected double lastSpeed
    • lastRoll

      protected float lastRoll
    • currentRelativeSpeed

      protected double currentRelativeSpeed
    • minSpeedAfterForceSquared

      protected double minSpeedAfterForceSquared
    • desiredAltitudeOverride

      @Nullable protected double[] desiredAltitudeOverride
  • Constructor Details

  • Method Details

    • getType

      @Nonnull public String getType()
    • 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
    • setDirectionFromTranslation

      private void setDirectionFromTranslation(@Nonnull Steering steering, @Nonnull Vector3d translation)
    • probeMove

      public double probeMove(@Nonnull Ref<EntityStore> ref, @Nonnull ProbeMoveData probeMoveData, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
    • isFastMotionKind

      public boolean isFastMotionKind(double speed)
      Specified by:
      isFastMotionKind in class MotionControllerBase
    • getDesiredVerticalRange

      public com.hypixel.hytale.server.npc.movement.controllers.MotionController.VerticalRange getDesiredVerticalRange(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
    • getWanderVerticalMovementRatio

      public double getWanderVerticalMovementRatio()
    • doMove

      protected double doMove(@Nonnull Ref<EntityStore> ref, @Nonnull Vector3d position, @Nonnull Vector3d translation, @Nonnull PositionProbeAir moveProbe, @Nullable ProbeMoveData probeMoveData, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
    • 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, TransformComponent transform)
    • getCurrentMaxBodyRotationSpeed

      public double getCurrentMaxBodyRotationSpeed()
    • dampForceVelocity

      protected void dampForceVelocity(@Nonnull Vector3d forceVelocity, double forceVelocityDamping, double interval, ComponentAccessor<EntityStore> componentAccessor)
      Overrides:
      dampForceVelocity in class MotionControllerBase
    • shouldDampenAppliedVelocitiesY

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

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

      public void spawned()
    • 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()
    • onGround

      public boolean onGround()
    • inWater

      public boolean inWater()
    • getCurrentSpeed

      public double getCurrentSpeed()
    • getCurrentTurnRadius

      public double getCurrentTurnRadius()
    • getMaxClimbAngle

      public float getMaxClimbAngle()
    • getMaxSinkAngle

      public float getMaxSinkAngle()
    • getMaximumSpeed

      public double getMaximumSpeed()
    • is2D

      public boolean is2D()
    • canRestAtPlace

      public boolean canRestAtPlace()
    • getDesiredAltitudeWeight

      public double getDesiredAltitudeWeight()
    • getHeightOverGround

      public double getHeightOverGround()
    • isHorizontalIdle

      public boolean isHorizontalIdle(double speed)
      Overrides:
      isHorizontalIdle in class MotionControllerBase
    • estimateVelocity

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

      public void clearOverrides()
    • setDesiredAltitudeOverride

      public void setDesiredAltitudeOverride(double[] desiredAltitudeOverride)
    • takeOff

      public void takeOff(@Nonnull Ref<EntityStore> ref, double speed, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
    • getMinSpeedAfterForceSquared

      public double getMinSpeedAfterForceSquared()
    • getDampingDeceleration

      public double getDampingDeceleration()
    • computeMaxSpeedFromPitch

      protected double computeMaxSpeedFromPitch(double pitch)