Control-theory procedural animation for named scalar properties. 更多...
#include <ControlAnim.h>
Public 成员函数 | |
| ControlAnim (float frequencyHz=3.f, float dampingZeta=1.f, float response=1.f) | |
| Control anim. | |
| ~ControlAnim ()=default | |
| Control anim. | |
| ControlAnim (const ControlAnim &)=delete | |
| ControlAnim & | operator= (const ControlAnim &)=delete |
| void | setFrequency (float frequencyHz) |
| Sets the frequency. | |
| float | getFrequency () const |
| Returns the frequency. | |
| void | setDamping (float dampingZeta) |
| Sets the damping. | |
| float | getDamping () const |
| Returns the damping. | |
| void | setResponse (float response) |
| Sets the response. | |
| float | getResponse () const |
| Returns the response. | |
| void | setIntegrator (const std::string &kind) |
| Integrator: "secondOrder" | "spring" | "pd". Invalid → exception. | |
| std::string | getIntegrator () const |
| Returns the integrator. | |
| void | set (const std::string &name, float value) |
Create/update a channel: current value snaps to value, velocity cleared. | |
| void | setTarget (const std::string &name, float value) |
| Move the tracking target (does not snap state). Creates channel if missing. | |
| void | setTargetVelocity (const std::string &name, float velocity) |
| Optional explicit target velocity (used by secondOrder / pd). | |
| void | impulse (const std::string &name, float deltaVelocity) |
| Inject an instantaneous velocity impulse (procedural “hit”). | |
| bool | has (const std::string &name) const |
| True when active. | |
| float | get (const std::string &name) const |
| Returns the value. | |
| float | getVelocity (const std::string &name) const |
| Returns the velocity. | |
| float | getTarget (const std::string &name) const |
| Returns the target. | |
| void | clear () |
| Clears . | |
| void | remove (const std::string &name) |
| Removes . | |
| int | getPropertyCount () const |
| Returns the property count. | |
| std::string | getPropertyName (int index) const |
| Returns the property name. | |
| eve::Result< void > | advance (const eve::SimulationStep &step) |
| Advance all channels by one scheduler-owned deterministic step. | |
| void | update (float dt) |
| Legacy seconds facade; explicitly forwards to advance(). | |
详细描述
Control-theory procedural animation for named scalar properties.
Tracks continuous targets with a second-order LTI system (default), a closed-form damped spring, or an explicit unit-mass PD law. Script type: ControlAnim.
Integrator kinds (string, no overloads):
- "secondOrder" — ÿ + k1 ẏ + k2 y = x + k3 ẋ (f, ζ, r)
- "spring" — closed-form damped spring about set-point (f, ζ; r ignored)
- "pd" — τ/m = Kp(x − y) + Kd(ẋ − ẏ) with Kp=ω², Kd=2ζω
在文件 ControlAnim.h 第 25 行定义.
构造及析构函数说明
◆ ControlAnim() [1/2]
| eve::animation::ControlAnim::ControlAnim | ( | float | frequencyHz = 3.f, |
| float | dampingZeta = 1.f, |
||
| float | response = 1.f |
||
| ) |
Control anim.
在文件 ControlAnim.cpp 第 10 行定义.
◆ ~ControlAnim()
|
default |
Control anim.
◆ ControlAnim() [2/2]
|
delete |
成员函数说明
◆ advance()
| eve::Result< void > eve::animation::ControlAnim::advance | ( | const eve::SimulationStep & | step | ) |
Advance all channels by one scheduler-owned deterministic step.
在文件 ControlAnim.cpp 第 162 行定义.
引用了 eve::Applied, eve::Result< T >::failure(), eve::animation::detail::secondsForStep(), step, eve::Status::success() , 以及 eve::Result< T >::success().
被这些函数引用 update().
◆ clear()
| void eve::animation::ControlAnim::clear | ( | ) |
Clears .
在文件 ControlAnim.cpp 第 118 行定义.
◆ get()
| float eve::animation::ControlAnim::get | ( | const std::string & | name | ) | const |
◆ getDamping()
|
inline |
Returns the damping.
在文件 ControlAnim.h 第 42 行定义.
◆ getFrequency()
|
inline |
Returns the frequency.
在文件 ControlAnim.h 第 38 行定义.
◆ getIntegrator()
| std::string eve::animation::ControlAnim::getIntegrator | ( | ) | const |
Returns the integrator.
在文件 ControlAnim.cpp 第 43 行定义.
◆ getPropertyCount()
|
inline |
Returns the property count.
在文件 ControlAnim.h 第 76 行定义.
◆ getPropertyName()
| std::string eve::animation::ControlAnim::getPropertyName | ( | int | index | ) | const |
◆ getResponse()
|
inline |
Returns the response.
在文件 ControlAnim.h 第 46 行定义.
◆ getTarget()
| float eve::animation::ControlAnim::getTarget | ( | const std::string & | name | ) | const |
◆ getVelocity()
| float eve::animation::ControlAnim::getVelocity | ( | const std::string & | name | ) | const |
◆ has()
| bool eve::animation::ControlAnim::has | ( | const std::string & | name | ) | const |
◆ impulse()
| void eve::animation::ControlAnim::impulse | ( | const std::string & | name, |
| float | deltaVelocity | ||
| ) |
Inject an instantaneous velocity impulse (procedural “hit”).
在文件 ControlAnim.cpp 第 94 行定义.
引用了 name.
◆ operator=()
|
delete |
◆ remove()
| void eve::animation::ControlAnim::remove | ( | const std::string & | name | ) |
◆ set()
| void eve::animation::ControlAnim::set | ( | const std::string & | name, |
| float | value | ||
| ) |
Create/update a channel: current value snaps to value, velocity cleared.
在文件 ControlAnim.cpp 第 66 行定义.
◆ setDamping()
| void eve::animation::ControlAnim::setDamping | ( | float | dampingZeta | ) |
Sets the damping.
在文件 ControlAnim.cpp 第 20 行定义.
◆ setFrequency()
| void eve::animation::ControlAnim::setFrequency | ( | float | frequencyHz | ) |
Sets the frequency.
在文件 ControlAnim.cpp 第 15 行定义.
◆ setIntegrator()
| void eve::animation::ControlAnim::setIntegrator | ( | const std::string & | kind | ) |
Integrator: "secondOrder" | "spring" | "pd". Invalid → exception.
在文件 ControlAnim.cpp 第 30 行定义.
引用了 kind.
◆ setResponse()
| void eve::animation::ControlAnim::setResponse | ( | float | response | ) |
Sets the response.
在文件 ControlAnim.cpp 第 25 行定义.
◆ setTarget()
| void eve::animation::ControlAnim::setTarget | ( | const std::string & | name, |
| float | value | ||
| ) |
Move the tracking target (does not snap state). Creates channel if missing.
在文件 ControlAnim.cpp 第 77 行定义.
◆ setTargetVelocity()
| void eve::animation::ControlAnim::setTargetVelocity | ( | const std::string & | name, |
| float | velocity | ||
| ) |
Optional explicit target velocity (used by secondOrder / pd).
在文件 ControlAnim.cpp 第 88 行定义.
引用了 name.
◆ update()
| void eve::animation::ControlAnim::update | ( | float | dt | ) |
Legacy seconds facade; explicitly forwards to advance().
在文件 ControlAnim.cpp 第 171 行定义.
引用了 advance(), eve::Result< void >::ignore(), eve::animation::detail::legacyStep() , 以及 step.
该类的文档由以下文件生成:
- src/modules/animation/ControlAnim.h
- src/modules/animation/ControlAnim.cpp