Clip-driven animation state machine with float/bool/trigger parameters and cross-fade transitions. Script type: AnimStateMachine.
更多...
#include <AnimStateMachine.h>
Public 成员函数 | |
| AnimStateMachine (AnimSkeleton *skeleton) | |
| ~AnimStateMachine () | |
| AnimStateMachine (const AnimStateMachine &)=delete | |
| AnimStateMachine & | operator= (const AnimStateMachine &)=delete |
| AnimSkeleton * | getSkeleton () const |
| void | addState (const std::string &name, AnimClip *clip) |
| void | setEntry (const std::string &name) |
| bool | hasState (const std::string &name) const |
| std::string | getCurrentState () const |
| int | getStateCount () const |
| int | addTransition (const std::string &from, const std::string &to, float blendSeconds) |
| Add transition from → to with blend duration. | |
| void | addFloatCondition (int transitionId, const std::string ¶m, const std::string &op, float threshold) |
| Comparison op: ">", ">=", "<", "<=", "==", "!=". | |
| void | addBoolCondition (int transitionId, const std::string ¶m, bool value) |
| void | addTriggerCondition (int transitionId, const std::string ¶m) |
| void | setExitTime (int transitionId, float normalizedTime) |
| Optional: require normalized local time in [0,1] >= exitTime before transition. | |
| void | setHasExitTime (int transitionId, bool enabled) |
| void | setFloat (const std::string &name, float value) |
| float | getFloat (const std::string &name) const |
| void | setBool (const std::string &name, bool value) |
| bool | getBool (const std::string &name) const |
| void | setTrigger (const std::string &name) |
| void | resetTrigger (const std::string &name) |
| bool | getTrigger (const std::string &name) const |
| Query a trigger's current state. | |
| AnimPose * | getPose () |
| float | getStateTime () const |
| bool | isBlending () const |
| void | update (float dt) |
| bool | captureState (StateValue &out) const |
| Serialize runtime state (params, current/next state, blend). | |
| bool | restoreState (const StateValue &in, std::string *err=nullptr) |
| Restore runtime state captured by captureState(). | |
| bool | resetToDefaults () |
| Clear params and re-seat the entry state (restore fallback). | |
详细描述
Clip-driven animation state machine with float/bool/trigger parameters and cross-fade transitions. Script type: AnimStateMachine.
在文件 AnimStateMachine.h 第 19 行定义.
构造及析构函数说明
◆ AnimStateMachine() [1/2]
|
explicit |
◆ ~AnimStateMachine()
| eve::animation::AnimStateMachine::~AnimStateMachine | ( | ) |
在文件 AnimStateMachine.cpp 第 74 行定义.
◆ AnimStateMachine() [2/2]
|
delete |
成员函数说明
◆ addBoolCondition()
| void eve::animation::AnimStateMachine::addBoolCondition | ( | int | transitionId, |
| const std::string & | param, | ||
| bool | value | ||
| ) |
在文件 AnimStateMachine.cpp 第 152 行定义.
◆ addFloatCondition()
| void eve::animation::AnimStateMachine::addFloatCondition | ( | int | transitionId, |
| const std::string & | param, | ||
| const std::string & | op, | ||
| float | threshold | ||
| ) |
◆ addState()
| void eve::animation::AnimStateMachine::addState | ( | const std::string & | name, |
| AnimClip * | clip | ||
| ) |
在文件 AnimStateMachine.cpp 第 101 行定义.
引用了 name.
◆ addTransition()
| int eve::animation::AnimStateMachine::addTransition | ( | const std::string & | from, |
| const std::string & | to, | ||
| float | blendSeconds | ||
| ) |
Add transition from → to with blend duration.
- 返回
- transition id
在文件 AnimStateMachine.cpp 第 124 行定义.
引用了 tr.
◆ addTriggerCondition()
| void eve::animation::AnimStateMachine::addTriggerCondition | ( | int | transitionId, |
| const std::string & | param | ||
| ) |
在文件 AnimStateMachine.cpp 第 163 行定义.
◆ captureState()
| bool eve::animation::AnimStateMachine::captureState | ( | StateValue & | out | ) | const |
Serialize runtime state (params, current/next state, blend).
在文件 AnimStateMachine.cpp 第 303 行定义.
引用了 eve::StateValue::boolean(), eve::StateValue::number(), eve::StateValue::object(), eve::StateValue::set() , 以及 eve::StateValue::string().
◆ getBool()
| bool eve::animation::AnimStateMachine::getBool | ( | const std::string & | name | ) | const |
在文件 AnimStateMachine.cpp 第 192 行定义.
引用了 name.
◆ getCurrentState()
|
inline |
在文件 AnimStateMachine.h 第 32 行定义.
◆ getFloat()
| float eve::animation::AnimStateMachine::getFloat | ( | const std::string & | name | ) | const |
在文件 AnimStateMachine.cpp 第 185 行定义.
引用了 name.
◆ getPose()
| AnimPose * eve::animation::AnimStateMachine::getPose | ( | ) |
在文件 AnimStateMachine.cpp 第 201 行定义.
◆ getSkeleton()
|
inline |
在文件 AnimStateMachine.h 第 27 行定义.
◆ getStateCount()
|
inline |
在文件 AnimStateMachine.h 第 33 行定义.
◆ getStateTime()
|
inline |
在文件 AnimStateMachine.h 第 63 行定义.
◆ getTrigger()
|
inline |
◆ hasState()
| bool eve::animation::AnimStateMachine::hasState | ( | const std::string & | name | ) | const |
◆ isBlending()
|
inline |
在文件 AnimStateMachine.h 第 64 行定义.
◆ operator=()
|
delete |
◆ resetToDefaults()
| bool eve::animation::AnimStateMachine::resetToDefaults | ( | ) |
Clear params and re-seat the entry state (restore fallback).
在文件 AnimStateMachine.cpp 第 385 行定义.
引用了 setEntry().
◆ resetTrigger()
| void eve::animation::AnimStateMachine::resetTrigger | ( | const std::string & | name | ) |
在文件 AnimStateMachine.cpp 第 199 行定义.
引用了 name.
◆ restoreState()
| bool eve::animation::AnimStateMachine::restoreState | ( | const StateValue & | in, |
| std::string * | err = nullptr |
||
| ) |
Restore runtime state captured by captureState().
- 返回
- false when the captured current state is not defined here; the reload session then falls back to resetToDefaults().
在文件 AnimStateMachine.cpp 第 327 行定义.
引用了 eve::StateValue::asBool(), eve::StateValue::asString(), eve::StateValue::find(), hasState(), eve::StateValue::isBool(), eve::StateValue::isObject(), eve::StateValue::isString() , 以及 v.
◆ setBool()
| void eve::animation::AnimStateMachine::setBool | ( | const std::string & | name, |
| bool | value | ||
| ) |
在文件 AnimStateMachine.cpp 第 190 行定义.
◆ setEntry()
| void eve::animation::AnimStateMachine::setEntry | ( | const std::string & | name | ) |
◆ setExitTime()
| void eve::animation::AnimStateMachine::setExitTime | ( | int | transitionId, |
| float | normalizedTime | ||
| ) |
Optional: require normalized local time in [0,1] >= exitTime before transition.
在文件 AnimStateMachine.cpp 第 173 行定义.
引用了 eve::animation::clampf() , 以及 tr.
◆ setFloat()
| void eve::animation::AnimStateMachine::setFloat | ( | const std::string & | name, |
| float | value | ||
| ) |
在文件 AnimStateMachine.cpp 第 183 行定义.
◆ setHasExitTime()
| void eve::animation::AnimStateMachine::setHasExitTime | ( | int | transitionId, |
| bool | enabled | ||
| ) |
在文件 AnimStateMachine.cpp 第 179 行定义.
引用了 enabled.
◆ setTrigger()
| void eve::animation::AnimStateMachine::setTrigger | ( | const std::string & | name | ) |
在文件 AnimStateMachine.cpp 第 197 行定义.
引用了 name.
◆ update()
| void eve::animation::AnimStateMachine::update | ( | float | dt | ) |
该类的文档由以下文件生成:
- src/modules/animation/AnimStateMachine.h
- src/modules/animation/AnimStateMachine.cpp