fix ldflags typo and other compile errors
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace blitz {
|
||||
|
||||
struct EMASmoother {
|
||||
class EMASmoother {
|
||||
private:
|
||||
float Alpha;
|
||||
public:
|
||||
|
||||
@@ -1,36 +1,30 @@
|
||||
#include <cmath>>
|
||||
#include <cmath>
|
||||
#include <cassert>
|
||||
#include "blitz/common/Smoothing.h"
|
||||
|
||||
namespace blitz {
|
||||
|
||||
struct EMASmoother {
|
||||
private:
|
||||
float Alpha;
|
||||
public:
|
||||
float Current;
|
||||
EMASmoother::EMASmoother() : Alpha(1.0f), Current(0.0f) {}
|
||||
|
||||
EMASmoother::EMASmoother() : Alpha(1.0f), Current(0.0f) {}
|
||||
void EMASmoother::TickUnitT(float target) {
|
||||
Current += Alpha * (target - Current);
|
||||
}
|
||||
|
||||
void TickUnitT(float target) {
|
||||
Current += Alpha * (target - Current);
|
||||
}
|
||||
void EMASmoother::Tick(float target, float delta) {
|
||||
Current += std::powf(Alpha, delta) * (target - Current);
|
||||
}
|
||||
|
||||
void Tick(float target, float delta) {
|
||||
Current += std::powf(Alpha, delta) * (target - Current);
|
||||
}
|
||||
float EMASmoother::GetAlpha() {
|
||||
return Alpha;
|
||||
}
|
||||
|
||||
float GetAlpha() {
|
||||
return Alpha;
|
||||
}
|
||||
void EMASmoother::SetAlpha(float alpha) {
|
||||
assert(0.0f < alpha && alpha <= 1.0f);
|
||||
Alpha = alpha;
|
||||
}
|
||||
|
||||
void SetAlpha(float alpha) {
|
||||
assert(0.0f < alpha && alpha <= 1.0f);
|
||||
Alpha = alpha;
|
||||
}
|
||||
|
||||
void SetSmoothingTime(float t) {
|
||||
Alpha = 0.999f;
|
||||
}
|
||||
void EMASmoother::SetSmoothingTime(float t) {
|
||||
Alpha = 0.999f;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user