Android Open Source - pong-android Scalar Exp Smoother






From Project

Back to project page pong-android.

License

The source code is released under:

MIT License

If you think the Android project pong-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package me.zamecnik.android.pong;
//  w w  w. j av a  2 s  . c om
public class ScalarExpSmoother {

  double data;
  double currentWeight;
  double previousWeight;

  public ScalarExpSmoother(double currentWeight) {
    this.currentWeight = currentWeight;
    previousWeight = 1 - currentWeight;
  }

  public double smooth(double currentFrame) {
    data = previousWeight * data + currentWeight * currentFrame;
    return data;
  }

}




Java Source Code List

me.zamecnik.android.pong.FpsCounter.java
me.zamecnik.android.pong.GameActivity.java
me.zamecnik.android.pong.GameView.java
me.zamecnik.android.pong.PongGameView.java
me.zamecnik.android.pong.ScalarExpSmoother.java