Contents
Class PlayerVelocityEstimator
java.lang.Object
com.hypixel.hytale.server.core.modules.entity.player.PlayerVelocityEstimator
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidreset()voidupdateVelocity(double dt, org.joml.Vector3dc displacement, org.joml.Vector3d velocity) Updates a velocity estimate from one movement sample.
-
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()
-