mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 10:34:06 +09:00
forgot to comment out the debug print
This commit is contained in:
@@ -238,7 +238,7 @@ public class AppLoader implements ApplicationListener {
|
|||||||
private static double _kalman_xhat_k = 1.0 / 60.0;
|
private static double _kalman_xhat_k = 1.0 / 60.0;
|
||||||
private static double _kalman_return_value = _kalman_xhat_k;
|
private static double _kalman_return_value = _kalman_xhat_k;
|
||||||
private static double _kalman_p_k = 1.0;
|
private static double _kalman_p_k = 1.0;
|
||||||
private static final double _kalman_R = 0.1;
|
private static final double _kalman_R = 0.2; // 0.2: empirical value
|
||||||
private final double _KALMAN_UPDATE_THRE = 0.1;
|
private final double _KALMAN_UPDATE_THRE = 0.1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -263,13 +263,15 @@ public class AppLoader implements ApplicationListener {
|
|||||||
*/
|
*/
|
||||||
private void updateKalmanRenderDelta() {
|
private void updateKalmanRenderDelta() {
|
||||||
|
|
||||||
// TODO implement nonlinear kalman filter or n-frames average
|
// TODO implement nonlinear kalman filter
|
||||||
|
|
||||||
// kalman filter is calculated but not actually being used.
|
// kalman filter is calculated but not actually being used.
|
||||||
// the problem with this kalman filter is that it assumes most simplistic situation:
|
// the problem with this kalman filter is that it assumes most simplistic situation:
|
||||||
// 1. the actual delta (measured delta - noise) is constant
|
// 1. the actual delta (measured delta - noise) is constant
|
||||||
// 2. everything is linear
|
// 2. everything is linear
|
||||||
// we may need to implement Extended Kalman Filter but wtf is Jacobian, I suck at maths.
|
// we may need to implement Extended Kalman Filter but wtf is Jacobian, I suck at maths.
|
||||||
|
// Instead, the kalman filter will reset when new delta is given-value-times greater/lesser
|
||||||
|
// it's not perfect but it works.
|
||||||
|
|
||||||
double observation = ((double) Gdx.graphics.getRawDeltaTime());
|
double observation = ((double) Gdx.graphics.getRawDeltaTime());
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package net.torvald.terrarum.gameactors
|
package net.torvald.terrarum.gameactors
|
||||||
|
|
||||||
import com.badlogic.gdx.Gdx
|
|
||||||
import com.badlogic.gdx.Input
|
import com.badlogic.gdx.Input
|
||||||
import com.badlogic.gdx.graphics.Color
|
import com.badlogic.gdx.graphics.Color
|
||||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||||
@@ -361,7 +360,7 @@ open class ActorWBMovable(renderOrder: RenderOrder, val immobileBody: Boolean =
|
|||||||
|
|
||||||
//val ddelta = Gdx.graphics.rawDeltaTime.toDouble()
|
//val ddelta = Gdx.graphics.rawDeltaTime.toDouble()
|
||||||
val ddelta = AppLoader.getSmoothDelta()
|
val ddelta = AppLoader.getSmoothDelta()
|
||||||
println("${Gdx.graphics.rawDeltaTime.toDouble()}\t${AppLoader.getSmoothDelta()}")
|
//println("${Gdx.graphics.rawDeltaTime.toDouble()}\t${AppLoader.getSmoothDelta()}")
|
||||||
|
|
||||||
|
|
||||||
if (!assertPrinted) assertInit()
|
if (!assertPrinted) assertInit()
|
||||||
|
|||||||
Reference in New Issue
Block a user