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) | |
| ~ControlAnim ()=default | |
| ControlAnim (const ControlAnim &)=delete | |
| ControlAnim & | operator= (const ControlAnim &)=delete |
| void | setFrequency (float frequencyHz) |
| float | getFrequency () const |
| void | setDamping (float dampingZeta) |
| float | getDamping () const |
| void | setResponse (float response) |
| float | getResponse () const |
| void | setIntegrator (const std::string &kind) |
| Integrator: "secondOrder" | "spring" | "pd". Invalid → exception. | |
| std::string | getIntegrator () const |
| 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 |
| float | get (const std::string &name) const |
| float | getVelocity (const std::string &name) const |
| float | getTarget (const std::string &name) const |
| void | clear () |
| void | remove (const std::string &name) |
| int | getPropertyCount () const |
| std::string | getPropertyName (int index) const |
| void | update (float dt) |
| Advance all channels by dt seconds. | |
详细描述
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 第 23 行定义.
构造及析构函数说明
◆ ControlAnim() [1/2]
| eve::animation::ControlAnim::ControlAnim | ( | float | frequencyHz = 3.f, |
| float | dampingZeta = 1.f, |
||
| float | response = 1.f |
||
| ) |
在文件 ControlAnim.cpp 第 9 行定义.
◆ ~ControlAnim()
|
default |
◆ ControlAnim() [2/2]
|
delete |
成员函数说明
◆ clear()
| void eve::animation::ControlAnim::clear | ( | ) |
在文件 ControlAnim.cpp 第 117 行定义.
◆ get()
| float eve::animation::ControlAnim::get | ( | const std::string & | name | ) | const |
在文件 ControlAnim.cpp 第 102 行定义.
引用了 name.
◆ getDamping()
|
inline |
在文件 ControlAnim.h 第 34 行定义.
◆ getFrequency()
|
inline |
在文件 ControlAnim.h 第 32 行定义.
◆ getIntegrator()
| std::string eve::animation::ControlAnim::getIntegrator | ( | ) | const |
在文件 ControlAnim.cpp 第 42 行定义.
◆ getPropertyCount()
|
inline |
在文件 ControlAnim.h 第 58 行定义.
◆ getPropertyName()
| std::string eve::animation::ControlAnim::getPropertyName | ( | int | index | ) | const |
在文件 ControlAnim.cpp 第 127 行定义.
◆ getResponse()
|
inline |
在文件 ControlAnim.h 第 36 行定义.
◆ getTarget()
| float eve::animation::ControlAnim::getTarget | ( | const std::string & | name | ) | const |
在文件 ControlAnim.cpp 第 112 行定义.
引用了 name.
◆ getVelocity()
| float eve::animation::ControlAnim::getVelocity | ( | const std::string & | name | ) | const |
在文件 ControlAnim.cpp 第 107 行定义.
引用了 name.
◆ has()
| bool eve::animation::ControlAnim::has | ( | const std::string & | name | ) | const |
在文件 ControlAnim.cpp 第 98 行定义.
引用了 name.
◆ impulse()
| void eve::animation::ControlAnim::impulse | ( | const std::string & | name, |
| float | deltaVelocity | ||
| ) |
Inject an instantaneous velocity impulse (procedural “hit”).
在文件 ControlAnim.cpp 第 93 行定义.
引用了 name.
◆ operator=()
|
delete |
◆ remove()
| void eve::animation::ControlAnim::remove | ( | const std::string & | name | ) |
在文件 ControlAnim.cpp 第 122 行定义.
引用了 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 第 65 行定义.
◆ setDamping()
| void eve::animation::ControlAnim::setDamping | ( | float | dampingZeta | ) |
在文件 ControlAnim.cpp 第 19 行定义.
◆ setFrequency()
| void eve::animation::ControlAnim::setFrequency | ( | float | frequencyHz | ) |
在文件 ControlAnim.cpp 第 14 行定义.
◆ setIntegrator()
| void eve::animation::ControlAnim::setIntegrator | ( | const std::string & | kind | ) |
Integrator: "secondOrder" | "spring" | "pd". Invalid → exception.
在文件 ControlAnim.cpp 第 29 行定义.
引用了 kind.
◆ setResponse()
| void eve::animation::ControlAnim::setResponse | ( | float | response | ) |
在文件 ControlAnim.cpp 第 24 行定义.
◆ 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 第 76 行定义.
◆ setTargetVelocity()
| void eve::animation::ControlAnim::setTargetVelocity | ( | const std::string & | name, |
| float | velocity | ||
| ) |
Optional explicit target velocity (used by secondOrder / pd).
在文件 ControlAnim.cpp 第 87 行定义.
引用了 name.
◆ update()
| void eve::animation::ControlAnim::update | ( | float | dt | ) |
Advance all channels by dt seconds.
在文件 ControlAnim.cpp 第 132 行定义.
引用了 eve::animation::hzToOmega(), eve::animation::stepDampedSpring(), eve::animation::stepPd() , 以及 eve::animation::stepSecondOrder().
该类的文档由以下文件生成:
- src/modules/animation/ControlAnim.h
- src/modules/animation/ControlAnim.cpp