![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
#include <AnimationGraph.h>
Public Member Functions | |
| AnimationGraph ()=default | |
| ~AnimationGraph ()=default | |
| bool | LoadFromFile (const std::string &filePath) |
| void | SetParameter (const std::string &name, bool value) |
| void | SetParameter (const std::string &name, float value) |
| void | SetParameter (const std::string &name, int value) |
| void | SetParameter (const std::string &name, const std::string &value) |
| bool | GetParameterBool (const std::string &name, bool defaultValue=false) const |
| float | GetParameterFloat (const std::string &name, float defaultValue=0.0f) const |
| int | GetParameterInt (const std::string &name, int defaultValue=0) const |
| std::string | GetParameterString (const std::string &name, const std::string &defaultValue="") const |
| void | SetCurrentState (const std::string &stateName) |
| const std::string & | GetCurrentState () const |
| std::string | GetCurrentAnimationName () const |
| bool | Update (float deltaTime) |
| const std::string & | GetGraphName () const |
| const std::string & | GetAnimationBankPath () const |
| bool | IsValid () const |
Private Member Functions | |
| bool | ParseJSON (const std::string &jsonContent) |
| bool | EvaluateCondition (const Condition &condition) const |
| bool | EvaluateTransition (const Transition &transition) const |
| const Transition * | FindValidTransition () const |
Private Attributes | |
| std::string | m_graphName |
| std::string | m_description |
| std::string | m_animationBankPath |
| std::string | m_currentState |
| std::string | m_defaultState = "Idle" |
| bool | m_isValid = false |
| std::unordered_map< std::string, ParameterValue > | m_parameters |
| std::unordered_map< std::string, AnimationState > | m_states |
| std::vector< Transition > | m_transitions |
Definition at line 65 of file AnimationGraph.h.
|
default |
|
default |
|
private |
Definition at line 248 of file AnimationGraph.cpp.
References OlympeAnimation::Bool, OlympeAnimation::ParameterValue::boolValue, OlympeAnimation::Equal, OlympeAnimation::Float, GetComponentTypeID_Static(), OlympeAnimation::Greater, OlympeAnimation::GreaterOrEqual, OlympeAnimation::Int, OlympeAnimation::Less, OlympeAnimation::LessOrEqual, m_parameters, OlympeAnimation::NotEqual, and OlympeAnimation::String.
Referenced by EvaluateTransition().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 305 of file AnimationGraph.cpp.
References EvaluateCondition(), and GetComponentTypeID_Static().
Referenced by FindValidTransition().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 316 of file AnimationGraph.cpp.
References EvaluateTransition(), GetComponentTypeID_Static(), m_currentState, and m_transitions.
Referenced by Update().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 100 of file AnimationGraph.h.
References m_animationBankPath.
| std::string OlympeAnimation::AnimationGraph::GetCurrentAnimationName | ( | ) | const |
Definition at line 229 of file AnimationGraph.cpp.
References GetComponentTypeID_Static(), m_currentState, and m_states.
Here is the call graph for this function:
|
inline |
Definition at line 87 of file AnimationGraph.h.
References m_currentState.
|
inline |
Definition at line 97 of file AnimationGraph.h.
References m_graphName.
| bool OlympeAnimation::AnimationGraph::GetParameterBool | ( | const std::string & | name, |
| bool | defaultValue = false |
||
| ) | const |
Definition at line 189 of file AnimationGraph.cpp.
References OlympeAnimation::Bool, GetComponentTypeID_Static(), and m_parameters.
Here is the call graph for this function:| float OlympeAnimation::AnimationGraph::GetParameterFloat | ( | const std::string & | name, |
| float | defaultValue = 0.0f |
||
| ) | const |
Definition at line 197 of file AnimationGraph.cpp.
References OlympeAnimation::Float, GetComponentTypeID_Static(), and m_parameters.
Here is the call graph for this function:| int OlympeAnimation::AnimationGraph::GetParameterInt | ( | const std::string & | name, |
| int | defaultValue = 0 |
||
| ) | const |
Definition at line 205 of file AnimationGraph.cpp.
References GetComponentTypeID_Static(), OlympeAnimation::Int, and m_parameters.
Here is the call graph for this function:| std::string OlympeAnimation::AnimationGraph::GetParameterString | ( | const std::string & | name, |
| const std::string & | defaultValue = "" |
||
| ) | const |
Definition at line 213 of file AnimationGraph.cpp.
References GetComponentTypeID_Static(), m_parameters, and OlympeAnimation::String.
Here is the call graph for this function:
|
inline |
Definition at line 103 of file AnimationGraph.h.
References m_isValid.
Definition at line 19 of file AnimationGraph.cpp.
References GetComponentTypeID_Static(), JsonHelper::LoadJsonFromFile(), ParseJSON(), and SYSTEM_LOG.
Here is the call graph for this function:Definition at line 31 of file AnimationGraph.cpp.
References OlympeAnimation::Additive, OlympeAnimation::AnimationState::animationName, OlympeAnimation::Blend, OlympeAnimation::AnimationState::blendMode, OlympeAnimation::Bool, OlympeAnimation::ParameterValue::boolValue, OlympeAnimation::Equal, OlympeAnimation::Float, OlympeAnimation::ParameterValue::floatValue, OlympeAnimation::Transition::fromState, JsonHelper::GetBool(), GetComponentTypeID_Static(), JsonHelper::GetFloat(), JsonHelper::GetInt(), JsonHelper::GetString(), OlympeAnimation::Greater, OlympeAnimation::GreaterOrEqual, OlympeAnimation::Int, OlympeAnimation::ParameterValue::intValue, OlympeAnimation::Less, OlympeAnimation::LessOrEqual, m_animationBankPath, m_currentState, m_defaultState, m_description, m_graphName, m_isValid, m_parameters, m_states, m_transitions, OlympeAnimation::AnimationState::name, OlympeAnimation::NotEqual, OlympeAnimation::Override, OlympeAnimation::Condition::parameter, OlympeAnimation::AnimationState::priority, OlympeAnimation::String, OlympeAnimation::ParameterValue::stringValue, SYSTEM_LOG, and OlympeAnimation::ParameterValue::type.
Referenced by LoadFromFile().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 221 of file AnimationGraph.cpp.
References GetComponentTypeID_Static(), m_currentState, and m_states.
Here is the call graph for this function:Definition at line 169 of file AnimationGraph.cpp.
References m_parameters.
| void OlympeAnimation::AnimationGraph::SetParameter | ( | const std::string & | name, |
| const std::string & | value | ||
| ) |
Definition at line 184 of file AnimationGraph.cpp.
References m_parameters.
Definition at line 174 of file AnimationGraph.cpp.
References m_parameters.
Definition at line 179 of file AnimationGraph.cpp.
References m_parameters.
Definition at line 237 of file AnimationGraph.cpp.
References FindValidTransition(), GetComponentTypeID_Static(), and m_currentState.
Here is the call graph for this function:
|
private |
Definition at line 108 of file AnimationGraph.h.
Referenced by GetAnimationBankPath(), and ParseJSON().
|
private |
Definition at line 109 of file AnimationGraph.h.
Referenced by FindValidTransition(), GetCurrentAnimationName(), GetCurrentState(), ParseJSON(), SetCurrentState(), and Update().
|
private |
Definition at line 110 of file AnimationGraph.h.
Referenced by ParseJSON().
|
private |
Definition at line 107 of file AnimationGraph.h.
Referenced by ParseJSON().
|
private |
Definition at line 106 of file AnimationGraph.h.
Referenced by GetGraphName(), and ParseJSON().
Definition at line 111 of file AnimationGraph.h.
Referenced by IsValid(), and ParseJSON().
|
private |
Definition at line 113 of file AnimationGraph.h.
Referenced by EvaluateCondition(), GetParameterBool(), GetParameterFloat(), GetParameterInt(), GetParameterString(), ParseJSON(), SetParameter(), SetParameter(), SetParameter(), and SetParameter().
|
private |
Definition at line 114 of file AnimationGraph.h.
Referenced by GetCurrentAnimationName(), ParseJSON(), and SetCurrentState().
|
private |
Definition at line 115 of file AnimationGraph.h.
Referenced by FindValidTransition(), and ParseJSON().