BGE bug #17459 fixed: action actuators depending on their order in the actuator list.
authorBenoit Bolsee <benoit.bolsee@online.be>
Sun, 31 Aug 2008 21:53:39 +0000 (21:53 +0000)
committerBenoit Bolsee <benoit.bolsee@online.be>
Sun, 31 Aug 2008 21:53:39 +0000 (21:53 +0000)
source/gameengine/Converter/BL_ArmatureObject.cpp
source/gameengine/Converter/BL_ArmatureObject.h

index 09f1d9d4d872c876d72c0a9774b53ddccb095c80..cdfce321713dc4e7c5593a1287d6256ae76c47b8 100644 (file)
@@ -54,6 +54,7 @@ BL_ArmatureObject::BL_ArmatureObject(
 :      KX_GameObject(sgReplicationInfo,callbacks),
        m_objArma(armature),
        m_mrdPose(NULL),
+       m_framePose(NULL),
        m_lastframe(0.),
        m_activeAct(NULL),
        m_activePriority(999)
@@ -114,10 +115,15 @@ bool BL_ArmatureObject::SetActiveAction(BL_ActionActuator *act, short priority,
                m_activePriority = 9999;
                m_lastframe= curtime;
                m_activeAct = NULL;
+               // remember the pose at the start of the frame
+               m_framePose = m_pose;
        }
 
        if (priority<=m_activePriority)
        {
+               if (priority<m_activePriority)
+                       // this action overwrites the previous ones, start from initial pose to cancel their effects
+                       m_pose = m_framePose;
                if (m_activeAct && (m_activeAct!=act))
                        m_activeAct->SetBlendTime(0.0); /* Reset the blend timer */
                m_activeAct = act;
index 752bd5eb365e945952ded3de06e482cde15fb2b8..a612ca77ec08acaa3ac391c80d87a4ee92803662 100644 (file)
@@ -80,6 +80,7 @@ protected:
        struct bArmature        *m_armature;
        struct bPose            *m_pose;
        struct bPose            *m_mrdPose;
+       struct bPose            *m_framePose;
        double  m_lastframe;
        class BL_ActionActuator *m_activeAct;
        short   m_activePriority;