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>2013-08-15 03:31:49 +0400
committerMitchell Stokes <mogurijin@gmail.com>2013-08-15 03:31:49 +0400
commit9afae77fedb8a84f4d305ebce81b0cc509a2183b (patch)
treec8e747520371df4e3dd00a142419727ef6db60d9 /source/gameengine/Ketsji/BL_Action.cpp
parentc8f75fb5b1918a13a722ed39bb8cace1ee5b58b8 (diff)
BGE: Finally adding support for additive layer blending.
Currently this is only for the Python API. The logic brick will be updated in a future commit.
Diffstat (limited to 'source/gameengine/Ketsji/BL_Action.cpp')
-rw-r--r--source/gameengine/Ketsji/BL_Action.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/gameengine/Ketsji/BL_Action.cpp b/source/gameengine/Ketsji/BL_Action.cpp
index 9d189a6170e..6d9b22eed91 100644
--- a/source/gameengine/Ketsji/BL_Action.cpp
+++ b/source/gameengine/Ketsji/BL_Action.cpp
@@ -65,7 +65,8 @@ BL_Action::BL_Action(class KX_GameObject* gameobj)
m_blendstart(0.f),
m_speed(0.f),
m_priority(0),
- m_playmode(0),
+ m_playmode(ACT_MODE_PLAY),
+ m_blendmode(ACT_BLEND_BLEND),
m_ipo_flags(0),
m_done(true),
m_calc_localtime(true)
@@ -104,7 +105,8 @@ bool BL_Action::Play(const char* name,
short play_mode,
float layer_weight,
short ipo_flags,
- float playback_speed)
+ float playback_speed,
+ short blend_mode)
{
// Only start playing a new action if we're done, or if
@@ -229,6 +231,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;
@@ -423,7 +426,7 @@ void BL_Action::Update(float curtime)
float weight = 1.f - (m_blendframe/m_blendin);
// Blend the poses
- game_blend_poses(m_pose, m_blendinpose, weight);
+ game_blend_poses(m_pose, m_blendinpose, weight, ACT_BLEND_BLEND);
}
@@ -431,7 +434,7 @@ void BL_Action::Update(float curtime)
if (m_layer_weight >= 0)
{
obj->GetMRDPose(&m_blendpose);
- game_blend_poses(m_pose, m_blendpose, m_layer_weight);
+ game_blend_poses(m_pose, m_blendpose, m_layer_weight, m_blendmode);
}
obj->SetPose(m_pose);