Revert "raylib: 20 FPS onroad (#36208)"

This reverts commit 8de8c3eb00.
This commit is contained in:
Shane Smiskol
2025-09-26 21:41:12 -07:00
parent 8de8c3eb00
commit 5cbfc7705b
6 changed files with 15 additions and 40 deletions

View File

@@ -1,21 +1,16 @@
class FirstOrderFilter:
def __init__(self, x0, rc, dt, initialized=True):
self.x = x0
self._dt = dt
self.dt = dt
self.update_alpha(rc)
self.initialized = initialized
def update_dt(self, dt):
self._dt = dt
self.update_alpha(self._rc)
def update_alpha(self, rc):
self._rc = rc
self._alpha = self._dt / (self._rc + self._dt)
self.alpha = self.dt / (rc + self.dt)
def update(self, x):
if self.initialized:
self.x = (1. - self._alpha) * self.x + self._alpha * x
self.x = (1. - self.alpha) * self.x + self.alpha * x
else:
self.initialized = True
self.x = x