diff options
author | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-12-05 05:50:57 +0300 |
---|---|---|
committer | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-12-05 05:50:57 +0300 |
commit | ef971de66d946d69114c817b4340b82316c4d108 (patch) | |
tree | ea796d89d8acfa32bcaf3e686a1f40e1a8340c26 /source/gameengine/Converter | |
parent | 5d04d876f724626c36e5feba2dd6c16a3049243b (diff) |
Fix Action & IPO actuators: (Bugs #1921 & #1920)
Diffstat (limited to 'source/gameengine/Converter')
-rw-r--r-- | source/gameengine/Converter/BL_ActionActuator.cpp | 31 | ||||
-rw-r--r-- | source/gameengine/Converter/BL_ActionActuator.h | 22 |
2 files changed, 32 insertions, 21 deletions
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 0289ec42d74..22ee2371e8c 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -166,18 +166,28 @@ bool BL_ActionActuator::Update(double curtime, bool frame) // result = true if animation has to be continued, false if animation stops // maybe there are events for us in the queue ! - - for (vector<CValue*>::iterator i=m_events.end(); !(i==m_events.begin());) + if (frame) { - i--; - if ((*i)->GetNumber() == 0.0f) + for (vector<CValue*>::iterator i=m_events.end(); !(i==m_events.begin());) { - bNegativeEvent = true; + i--; + if ((*i)->GetNumber() == 0.0f) + bNegativeEvent = true; + else + bPositiveEvent= true; + (*i)->Release(); + m_events.pop_back(); + } + + if (bPositiveEvent) + m_flag |= ACT_FLAG_ACTIVE; + + if (bNegativeEvent) + { + if (!(m_flag & ACT_FLAG_ACTIVE)) + return false; + m_flag &= ~ACT_FLAG_ACTIVE; } - else - bPositiveEvent= true; - (*i)->Release(); - m_events.pop_back(); } /* We know that action actuators have been discarded from all non armature objects: @@ -236,7 +246,7 @@ bool BL_ActionActuator::Update(double curtime, bool frame) if (!(m_flag & ACT_FLAG_LOCKINPUT)){ m_flag &= ~ACT_FLAG_REVERSE; m_flag |= ACT_FLAG_LOCKINPUT; - m_starttime = curtime; + SetStartTime(curtime); } } else if (bNegativeEvent){ @@ -324,6 +334,7 @@ bool BL_ActionActuator::Update(double curtime, bool frame) m_localtime = m_endframe; m_flag &= ~ACT_FLAG_LOCKINPUT; } + SetStartTime(curtime); } break; case ACT_ACTION_PLAY: diff --git a/source/gameengine/Converter/BL_ActionActuator.h b/source/gameengine/Converter/BL_ActionActuator.h index 0c1eb780bcb..1c3f57e965a 100644 --- a/source/gameengine/Converter/BL_ActionActuator.h +++ b/source/gameengine/Converter/BL_ActionActuator.h @@ -52,22 +52,22 @@ public: PyTypeObject* T=&Type) : SCA_IActuator(gameobj,T), - m_blendframe(0), m_lastpos(0, 0, 0), + m_blendframe(0), m_flag(0), m_startframe (starttime), m_endframe(endtime) , m_localtime(starttime), m_lastUpdate(-1), - m_playtype(playtype), m_blendin(blendin), - m_priority(priority), m_stridelength(stride), + m_playtype(playtype), + m_priority(priority), m_pose(NULL), m_blendpose(NULL), m_userpose(NULL), - m_propname(propname), - m_action(action) + m_action(action), + m_propname(propname) { }; virtual ~BL_ActionActuator(); @@ -115,8 +115,8 @@ protected: void SetLocalTime(float curtime); bool ClampLocalTime(); - float m_blendframe; MT_Point3 m_lastpos; + float m_blendframe; int m_flag; /** The frame this action starts */ float m_startframe; @@ -128,23 +128,23 @@ protected: float m_localtime; float m_lastUpdate; - short m_playtype; float m_blendin; float m_blendstart; - short m_priority; float m_stridelength; + short m_playtype; + short m_priority; struct bPose* m_pose; struct bPose* m_blendpose; struct bPose* m_userpose; - STR_String m_propname; struct bAction *m_action; - + STR_String m_propname; }; enum { ACT_FLAG_REVERSE = 0x00000001, ACT_FLAG_LOCKINPUT = 0x00000002, - ACT_FLAG_KEYUP = 0x00000004 + ACT_FLAG_KEYUP = 0x00000004, + ACT_FLAG_ACTIVE = 0x00000008 }; #endif |