8#include <unordered_map>
28 ControlAnim(
float frequencyHz = 3.f,
float dampingZeta = 1.f,
float response = 1.f);
36 void setFrequency(
float frequencyHz);
40 void setDamping(
float dampingZeta);
44 void setResponse(
float response);
49 void setIntegrator(
const std::string &
kind);
51 std::string getIntegrator()
const;
54 void set(
const std::string &
name,
float value);
56 void setTarget(
const std::string &
name,
float value);
58 void setTargetVelocity(
const std::string &
name,
float velocity);
60 void impulse(
const std::string &
name,
float deltaVelocity);
63 bool has(
const std::string &
name)
const;
65 float get(
const std::string &
name)
const;
67 float getVelocity(
const std::string &
name)
const;
69 float getTarget(
const std::string &
name)
const;
74 void remove(
const std::string &
name);
78 std::string getPropertyName(
int index)
const;
83 void update(
float dt);
86 enum class Integrator { SecondOrder, Spring, Pd };
93 float xdExplicit = 0.f;
95 bool hasPrevX =
false;
99 Channel &ensure(
const std::string &
name);
101 float frequencyHz_ = 3.f;
102 float dampingZeta_ = 1.f;
103 float response_ = 1.f;
104 Integrator integrator_ = Integrator::SecondOrder;
105 SecondOrderCoeffs coeffs_{};
109 std::unordered_map<std::string, Channel> channels_;
110 std::vector<std::string> order_;
112 bool hasLastTick_ =
false;
114 void updateUnchecked(
float dt);
#define EVENGINE_API_WORLD
Common time values and an injectable deterministic simulation clock.
Move-only operation result carrying either a value or Status.
Control-theory procedural animation for named scalar properties.
~ControlAnim()=default
Control anim.
float getResponse() const
Returns the response.
ControlAnim(const ControlAnim &)=delete
int getPropertyCount() const
Returns the property count.
float getFrequency() const
Returns the frequency.
float getDamping() const
Returns the damping.
ControlAnim & operator=(const ControlAnim &)=delete
static constexpr StrongUint64 zero() noexcept
Returns the zero value for this strong type.
One deterministic fixed-step emitted by SimulationClock.