Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Stokes <mogurijin@gmail.com>2011-07-03 05:59:17 +0400
committerMitchell Stokes <mogurijin@gmail.com>2011-07-03 05:59:17 +0400
commit5f4f75c51a511f4f190c16eedfc4c04c3b9aa387 (patch)
tree9c226d26639fdeb1c4b546183f4178979e7b93cb /source/gameengine/Ketsji/BL_Action.cpp
parent8c3f2923fdc0626d4c2e7f6307c1ec4fd0e8c7f3 (diff)
BGE Animations: Adding in layer weights to allow for layer blending.
Diffstat (limited to 'source/gameengine/Ketsji/BL_Action.cpp')
-rw-r--r--source/gameengine/Ketsji/BL_Action.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/source/gameengine/Ketsji/BL_Action.cpp b/source/gameengine/Ketsji/BL_Action.cpp
index dec34289bbb..f764a4b1028 100644
--- a/source/gameengine/Ketsji/BL_Action.cpp
+++ b/source/gameengine/Ketsji/BL_Action.cpp
@@ -46,7 +46,6 @@ 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)
@@ -111,7 +110,7 @@ bool BL_Action::Play(const char* name,
short priority,
float blendin,
short play_mode,
- short blend_mode,
+ float layer_weight,
short ipo_flags,
float playback_speed)
{
@@ -173,11 +172,11 @@ 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;
m_speed = playback_speed;
+ m_layer_weight = layer_weight;
m_done = false;
@@ -335,15 +334,15 @@ 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, ACTSTRIPMODE_BLEND);
+ game_blend_poses(m_pose, m_blendpose, weight);
}
// Handle layer blending
- if (m_blendmode != ACT_BLEND_NONE)
+ if (m_layer_weight >= 0)
{
obj->GetMRDPose(&m_blendpose);
- game_blend_poses(m_pose, m_blendpose, 1.f, ACTSTRIPMODE_ADD);
+ game_blend_poses(m_pose, m_blendpose, m_layer_weight);
}
obj->SetPose(m_pose);