Package com.tenio.engine.physic.utility
Class SmootherVector<T extends Vector2>
- java.lang.Object
-
- com.tenio.engine.physic.utility.SmootherVector<T>
-
public class SmootherVector<T extends Vector2> extends java.lang.Object
Template class to help calculate the average value of a history of values. This can only be used with types that have a 'zero' value and that have the += and / operators overloaded. Example: Used to smooth frame rate calculations.- Author:
- sallyx (https://www.sallyx.org/sally/en/game-ai/)
-
-
Constructor Summary
Constructors Constructor Description SmootherVector(int SampleSize, T ZeroValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
update(T mostRecentValue)
Each time you want to get a new average, feed it the most recent value and this method will return an average over the last SampleSize updates
-
-
-
Constructor Detail
-
SmootherVector
public SmootherVector(int SampleSize, T ZeroValue)
-
-