diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2011-06-29 06:42:46 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2011-06-29 06:42:46 +0400 |
commit | 3afe0e9c8803bd04daa7a8e0ae813796b455a4b4 (patch) | |
tree | 6a864b18bb563e3c16828890e4c6a20a66a28bdb /source/gameengine/Ketsji/BL_Action.cpp | |
parent | d122f24c1af429dd59a0051db01650fd2b1abbba (diff) |
BGE Animations: Beginning work on layer blending. Blending armature actions works, but needs more testing. Also, currently the mode is forced to ADD and the weight to 1.
Diffstat (limited to 'source/gameengine/Ketsji/BL_Action.cpp')
-rw-r--r-- | source/gameengine/Ketsji/BL_Action.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/gameengine/Ketsji/BL_Action.cpp b/source/gameengine/Ketsji/BL_Action.cpp index 149189b6a79..33e4e179071 100644 --- a/source/gameengine/Ketsji/BL_Action.cpp +++ b/source/gameengine/Ketsji/BL_Action.cpp @@ -46,6 +46,7 @@ extern "C" { #include "BKE_action.h" #include "RNA_access.h" #include "RNA_define.h" +#include "DNA_nla_types.h" } BL_Action::BL_Action(class KX_GameObject* gameobj) @@ -172,6 +173,7 @@ bool BL_Action::Play(const char* name, m_endframe = end; m_blendin = blendin; m_playmode = play_mode; + m_blendmode = blend_mode; m_endtime = 0.f; m_blendframe = 0.f; m_blendstart = 0.f; @@ -328,12 +330,17 @@ void BL_Action::Update(float curtime) float weight = 1.f - (m_blendframe/m_blendin); // Blend the poses - game_blend_poses(m_pose, m_blendpose, weight); + game_blend_poses(m_pose, m_blendpose, weight, ACTSTRIPMODE_BLEND); } // Handle layer blending - + if (m_blendmode != ACT_BLEND_NONE) + { + obj->GetMRDPose(&m_blendpose); + game_blend_poses(m_pose, m_blendpose, 1.f, ACTSTRIPMODE_ADD); + } + obj->SetPose(m_pose); obj->SetActiveAction(NULL, 0, curtime); |