载入中...
搜索中...
未找到
eve::animation::AnimStateMachine类 参考

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
 
AnimStateMachineoperator= (const AnimStateMachine &)=delete
 
AnimSkeletongetSkeleton () 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 &param, const std::string &op, float threshold)
 Comparison op: ">", ">=", "<", "<=", "==", "!=".
 
void addBoolCondition (int transitionId, const std::string &param, bool value)
 
void addTriggerCondition (int transitionId, const std::string &param)
 
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.
 
AnimPosegetPose ()
 
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.h19 行定义.

构造及析构函数说明

◆ AnimStateMachine() [1/2]

eve::animation::AnimStateMachine::AnimStateMachine ( AnimSkeleton skeleton)
explicit

◆ ~AnimStateMachine()

eve::animation::AnimStateMachine::~AnimStateMachine ( )

在文件 AnimStateMachine.cpp74 行定义.

◆ AnimStateMachine() [2/2]

eve::animation::AnimStateMachine::AnimStateMachine ( const AnimStateMachine )
delete

成员函数说明

◆ addBoolCondition()

void eve::animation::AnimStateMachine::addBoolCondition ( int  transitionId,
const std::string &  param,
bool  value 
)

在文件 AnimStateMachine.cpp152 行定义.

引用了 c, tr , 以及 value.

◆ addFloatCondition()

void eve::animation::AnimStateMachine::addFloatCondition ( int  transitionId,
const std::string &  param,
const std::string &  op,
float  threshold 
)

Comparison op: ">", ">=", "<", "<=", "==", "!=".

在文件 AnimStateMachine.cpp139 行定义.

引用了 c , 以及 tr.

◆ addState()

void eve::animation::AnimStateMachine::addState ( const std::string &  name,
AnimClip clip 
)

在文件 AnimStateMachine.cpp101 行定义.

引用了 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.cpp124 行定义.

引用了 tr.

◆ addTriggerCondition()

void eve::animation::AnimStateMachine::addTriggerCondition ( int  transitionId,
const std::string &  param 
)

在文件 AnimStateMachine.cpp163 行定义.

引用了 c , 以及 tr.

◆ captureState()

bool eve::animation::AnimStateMachine::captureState ( StateValue out) const

Serialize runtime state (params, current/next state, blend).

在文件 AnimStateMachine.cpp303 行定义.

引用了 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.cpp192 行定义.

引用了 name.

◆ getCurrentState()

std::string eve::animation::AnimStateMachine::getCurrentState ( ) const
inline

在文件 AnimStateMachine.h32 行定义.

◆ getFloat()

float eve::animation::AnimStateMachine::getFloat ( const std::string &  name) const

在文件 AnimStateMachine.cpp185 行定义.

引用了 name.

◆ getPose()

AnimPose * eve::animation::AnimStateMachine::getPose ( )

在文件 AnimStateMachine.cpp201 行定义.

◆ getSkeleton()

AnimSkeleton * eve::animation::AnimStateMachine::getSkeleton ( ) const
inline

在文件 AnimStateMachine.h27 行定义.

◆ getStateCount()

int eve::animation::AnimStateMachine::getStateCount ( ) const
inline

在文件 AnimStateMachine.h33 行定义.

◆ getStateTime()

float eve::animation::AnimStateMachine::getStateTime ( ) const
inline

在文件 AnimStateMachine.h63 行定义.

◆ getTrigger()

bool eve::animation::AnimStateMachine::getTrigger ( const std::string &  name) const
inline

Query a trigger's current state.

在文件 AnimStateMachine.h57 行定义.

引用了 name.

◆ hasState()

bool eve::animation::AnimStateMachine::hasState ( const std::string &  name) const

在文件 AnimStateMachine.cpp120 行定义.

引用了 name.

被这些函数引用 restoreState().

◆ isBlending()

bool eve::animation::AnimStateMachine::isBlending ( ) const
inline

在文件 AnimStateMachine.h64 行定义.

◆ operator=()

AnimStateMachine & eve::animation::AnimStateMachine::operator= ( const AnimStateMachine )
delete

◆ resetToDefaults()

bool eve::animation::AnimStateMachine::resetToDefaults ( )

Clear params and re-seat the entry state (restore fallback).

在文件 AnimStateMachine.cpp385 行定义.

引用了 setEntry().

◆ resetTrigger()

void eve::animation::AnimStateMachine::resetTrigger ( const std::string &  name)

在文件 AnimStateMachine.cpp199 行定义.

引用了 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.cpp327 行定义.

引用了 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.cpp190 行定义.

引用了 name , 以及 value.

◆ setEntry()

void eve::animation::AnimStateMachine::setEntry ( const std::string &  name)

在文件 AnimStateMachine.cpp111 行定义.

引用了 name.

被这些函数引用 resetToDefaults() , 以及 update().

◆ setExitTime()

void eve::animation::AnimStateMachine::setExitTime ( int  transitionId,
float  normalizedTime 
)

Optional: require normalized local time in [0,1] >= exitTime before transition.

在文件 AnimStateMachine.cpp173 行定义.

引用了 eve::animation::clampf() , 以及 tr.

◆ setFloat()

void eve::animation::AnimStateMachine::setFloat ( const std::string &  name,
float  value 
)

在文件 AnimStateMachine.cpp183 行定义.

引用了 name , 以及 value.

◆ setHasExitTime()

void eve::animation::AnimStateMachine::setHasExitTime ( int  transitionId,
bool  enabled 
)

在文件 AnimStateMachine.cpp179 行定义.

引用了 enabled.

◆ setTrigger()

void eve::animation::AnimStateMachine::setTrigger ( const std::string &  name)

在文件 AnimStateMachine.cpp197 行定义.

引用了 name.

◆ update()

void eve::animation::AnimStateMachine::update ( float  dt)

该类的文档由以下文件生成: