6
#ifndef __GRAPH_NODE_LOOP_CONTROLLER_H__
7
#define __GRAPH_NODE_LOOP_CONTROLLER_H__
10
#include "BaseAnimationNode.h"
11
#include "IAnimationGraph.h"
16
class GraphNodeLoopController :
17
public BaseAnimationNode
20
GraphNodeLoopController(const std::string& _name) :
21
BaseAnimationNode("GraphNodeLoopController.layout", "LoopController", _name),
28
mPositionOut(nullptr),
33
virtual void addConnection(const std::string& _eventout, BaseAnimationNode* _node, const std::string& _eventin)
35
BaseAnimationNode::addConnection(_eventout, _node, _eventin);
36
if (_eventout == "Position")
38
mStateName = _node->getAnimationNode()->getName();
43
virtual void removeConnection(const std::string& _eventout, BaseAnimationNode* _node, const std::string& _eventin)
45
BaseAnimationNode::removeConnection(_eventout, _node, _eventin);
46
if (_eventout == "Position")
53
virtual void invalidateNode(BaseAnimationNode* _sender)
55
BaseAnimationNode::invalidateNode(_sender);
56
if (_sender->getAnimationNode()->getName() == mStateName)
63
void updateStateLenght()
66
animation::IAnimationNode* node = getAnimationNode()->getGraph()->getNodeByName(mStateName);
69
mLength = node->getLength();
70
//if (mLength > 0.0001) mLength -= 0.0001;
77
getAnimationNode()->setProperty("Length", MyGUI::utility::toString(mLength));
80
virtual void initialise()
82
mMainWidget->castType<MyGUI::Window>()->setCaption(getName());
84
assignBase(mStartIn, "StartIn");
85
assignBase(mStopIn, "StopIn");
86
assignBase(mWeightIn, "WeightIn");
87
assignBase(mStartOut, "StartOut");
88
assignBase(mStopOut, "StopOut");
89
assignBase(mWeightOut, "WeightOut");
90
assignBase(mPositionOut, "PositionOut");
94
virtual void shutdown()
99
wraps::BaseGraphConnection* mStartIn;
100
wraps::BaseGraphConnection* mStopIn;
101
wraps::BaseGraphConnection* mWeightIn;
102
wraps::BaseGraphConnection* mStartOut;
103
wraps::BaseGraphConnection* mStopOut;
104
wraps::BaseGraphConnection* mWeightOut;
105
wraps::BaseGraphConnection* mPositionOut;
108
std::string mStateName;
113
#endif // __GRAPH_NODE_LOOP_CONTROLLER_H__
6
#ifndef __GRAPH_NODE_LOOP_CONTROLLER_H__
7
#define __GRAPH_NODE_LOOP_CONTROLLER_H__
10
#include "BaseAnimationNode.h"
11
#include "IAnimationGraph.h"
16
class GraphNodeLoopController :
17
public BaseAnimationNode
20
GraphNodeLoopController(const std::string& _name) :
21
BaseAnimationNode("GraphNodeLoopController.layout", "LoopController", _name),
28
mPositionOut(nullptr),
33
virtual void addConnection(const std::string& _eventout, BaseAnimationNode* _node, const std::string& _eventin)
35
BaseAnimationNode::addConnection(_eventout, _node, _eventin);
36
if (_eventout == "Position")
38
mStateName = _node->getAnimationNode()->getName();
43
virtual void removeConnection(const std::string& _eventout, BaseAnimationNode* _node, const std::string& _eventin)
45
BaseAnimationNode::removeConnection(_eventout, _node, _eventin);
46
if (_eventout == "Position")
53
virtual void invalidateNode(BaseAnimationNode* _sender)
55
BaseAnimationNode::invalidateNode(_sender);
56
if (_sender->getAnimationNode()->getName() == mStateName)
63
void updateStateLenght()
66
animation::IAnimationNode* node = getAnimationNode()->getGraph()->getNodeByName(mStateName);
69
mLength = node->getLength();
70
//if (mLength > 0.0001) mLength -= 0.0001;
77
getAnimationNode()->setProperty("Length", MyGUI::utility::toString(mLength));
80
virtual void initialise()
82
mMainWidget->castType<MyGUI::Window>()->setCaption(getName());
84
assignBase(mStartIn, "StartIn");
85
assignBase(mStopIn, "StopIn");
86
assignBase(mWeightIn, "WeightIn");
87
assignBase(mStartOut, "StartOut");
88
assignBase(mStopOut, "StopOut");
89
assignBase(mWeightOut, "WeightOut");
90
assignBase(mPositionOut, "PositionOut");
94
virtual void shutdown()
99
wraps::BaseGraphConnection* mStartIn;
100
wraps::BaseGraphConnection* mStopIn;
101
wraps::BaseGraphConnection* mWeightIn;
102
wraps::BaseGraphConnection* mStartOut;
103
wraps::BaseGraphConnection* mStopOut;
104
wraps::BaseGraphConnection* mWeightOut;
105
wraps::BaseGraphConnection* mPositionOut;
108
std::string mStateName;
113
#endif // __GRAPH_NODE_LOOP_CONTROLLER_H__