mirror of
https://github.com/okalachev/flix.git
synced 2026-09-06 00:10:58 +00:00
Fix vector, quaternion, pid and lpf libraries curly braces code style
This commit is contained in:
+2
-4
@@ -21,8 +21,7 @@ public:
|
||||
|
||||
PID(float p, float i, float d, float windup = 0, float dAlpha = 1) : p(p), i(i), d(d), windup(windup), lpf(dAlpha) {};
|
||||
|
||||
float update(float error, float dt)
|
||||
{
|
||||
float update(float error, float dt) {
|
||||
integral += error * dt;
|
||||
|
||||
if (isfinite(prevError) && dt > 0) {
|
||||
@@ -38,8 +37,7 @@ public:
|
||||
return p * error + constrain(i * integral, -windup, windup) + d * derivative; // PID
|
||||
}
|
||||
|
||||
void reset()
|
||||
{
|
||||
void reset() {
|
||||
prevError = NAN;
|
||||
integral = 0;
|
||||
derivative = 0;
|
||||
|
||||
Reference in New Issue
Block a user