diff options
author | Diego Borghetti <bdiego@gmail.com> | 2008-07-13 21:17:57 +0400 |
---|---|---|
committer | Diego Borghetti <bdiego@gmail.com> | 2008-07-13 21:17:57 +0400 |
commit | ac450d0ee94b1ed8d821a7d1be2fa718cfee8a9e (patch) | |
tree | 0a9bf29e980003c05803f2ff652449d6e46442a2 /source | |
parent | 83f6a9d1b4b4a746b7c098d188310c0df7a3b6cd (diff) |
branches/blender-2.47
Bugfix from trunk (patch send by Benoit Bolsee to the ML):
Truncated loop n Ipo Actuator when start frame is not 1.
Parent Actuator did not check if activation was due to positive or
negative event
Diffstat (limited to 'source')
-rw-r--r-- | source/gameengine/Ketsji/KX_IpoActuator.cpp | 5 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_ParentActuator.cpp | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp index cf246342cf9..db306c49515 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.cpp +++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp @@ -352,7 +352,10 @@ bool KX_IpoActuator::Update(double curtime, bool frame) if (!m_bNegativeEvent){ /* Perform wraparound */ SetLocalTime(curtime); - m_localtime = m_startframe + fmod(m_localtime, m_startframe - m_endframe); + if (start_smaller_then_end > 0.f) + m_localtime = m_startframe + fmod(m_localtime - m_startframe, m_endframe - m_startframe); + else + m_localtime = m_startframe - fmod(m_startframe - m_localtime, m_startframe - m_endframe); SetStartTime(curtime); } else diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index 5c433cb68b1..8b379bcd44f 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -77,6 +77,12 @@ CValue* KX_ParentActuator::GetReplica() bool KX_ParentActuator::Update() { + bool bNegativeEvent = IsNegativeEvent(); + RemoveAllEvents(); + + if (bNegativeEvent) + return false; // do nothing on negative events + KX_GameObject *obj = (KX_GameObject*) GetParent(); KX_Scene *scene = PHY_GetActiveScene(); switch (m_mode) { |