Class PlayerVelocityEstimator

java.lang.Object
com.hypixel.hytale.server.core.modules.entity.player.PlayerVelocityEstimator

public final class PlayerVelocityEstimator extends Object
  • Field Details

    • DEFAULT_SMOOTHING_HALF_LIFE_SECONDS

      public static final double DEFAULT_SMOOTHING_HALF_LIFE_SECONDS
      See Also:
  • Constructor Details

    • PlayerVelocityEstimator

      public PlayerVelocityEstimator()
    • PlayerVelocityEstimator

      public PlayerVelocityEstimator(double smoothingHalfLifeSeconds)
  • Method Details

    • updateVelocity

      public void updateVelocity(double dt, @Nonnull org.joml.Vector3dc displacement, @Nonnull org.joml.Vector3d velocity)
      Updates a velocity estimate from one movement sample.
      Parameters:
      dt - The elapsed seconds since the previous sample.
      displacement - The movement since the previous sample, not an absolute position.
      velocity - Receives the updated velocity estimate.
    • reset

      public void reset()