[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42108] trunk/blender/source/gameengine/ Converter/BL_ActionActuator.cpp: BGE Animations: Getting the Action Actuator to behave better with pulse mode ( on the sensor) and continuous enabled.
Mitchell Stokes
mogurijin at gmail.com
Thu Nov 24 00:29:36 CET 2011
Revision: 42108
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42108
Author: moguri
Date: 2011-11-23 23:29:36 +0000 (Wed, 23 Nov 2011)
Log Message:
-----------
BGE Animations: Getting the Action Actuator to behave better with pulse mode (on the sensor) and continuous enabled.
Modified Paths:
--------------
trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp
Modified: trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp
===================================================================
--- trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp 2011-11-23 23:02:38 UTC (rev 42107)
+++ trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp 2011-11-23 23:29:36 UTC (rev 42108)
@@ -144,6 +144,7 @@
case ACT_ACTION_PLAY:
// Clamp
m_localtime = m_endframe;
+ ((KX_GameObject*)GetParent())->StopAction(m_layer);
break;
case ACT_ACTION_LOOP_END:
// Put the time back to the beginning
@@ -237,14 +238,14 @@
RemoveAllEvents();
}
+ // "Active" actions need to keep updating their current frame
if (bUseContinue && (m_flag & ACT_FLAG_ACTIVE))
- {
m_localtime = obj->GetActionFrame(m_layer);
- ResetStartTime(curtime);
- }
if (m_flag & ACT_FLAG_ATTEMPT_PLAY)
SetLocalTime(curtime);
+ else
+ ResetStartTime(curtime);
// Handle a frame property if it's defined
if ((m_flag & ACT_FLAG_ACTIVE) && m_framepropname[0] != 0)
@@ -299,6 +300,7 @@
else if ((m_flag & ACT_FLAG_ACTIVE) && bNegativeEvent)
{
m_flag &= ~ACT_FLAG_ATTEMPT_PLAY;
+ m_localtime = obj->GetActionFrame(m_layer);
bAction *curr_action = obj->GetCurrentAction(m_layer);
if (curr_action && curr_action != m_action)
{
More information about the Bf-blender-cvs
mailing list