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-06-16 05:18:52 +0400
committerMitchell Stokes <mogurijin@gmail.com>2011-06-16 05:18:52 +0400
commitc02006bc2b8566ae96af1e9e9630f0ecd5a1d05e (patch)
treecb8e6182e5186389a3c041c60d67f2c90f97bcef /source/gameengine/Ketsji/BL_Action.cpp
parent49f7a4d8f8001465388977e50c8a439ad53ef8ae (diff)
BGE Animations: Adding the ipo flag options to the action actuator. This still needs more testing.
Diffstat (limited to 'source/gameengine/Ketsji/BL_Action.cpp')
-rw-r--r--source/gameengine/Ketsji/BL_Action.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/gameengine/Ketsji/BL_Action.cpp b/source/gameengine/Ketsji/BL_Action.cpp
index bd65c7d45d8..836bc24ffcd 100644
--- a/source/gameengine/Ketsji/BL_Action.cpp
+++ b/source/gameengine/Ketsji/BL_Action.cpp
@@ -58,6 +58,7 @@ BL_Action::BL_Action(class KX_GameObject* gameobj)
m_blendframe(0.f),
m_blendstart(0.f),
m_speed(0.f),
+ m_ipo_flags(0),
m_pose(NULL),
m_blendpose(NULL),
m_sg_contr(NULL),
@@ -85,6 +86,7 @@ void BL_Action::Play(const char* name,
float blendin,
short play_mode,
short blend_mode,
+ short ipo_flags,
float playback_speed)
{
bAction* prev_action = m_action;
@@ -105,8 +107,10 @@ void BL_Action::Play(const char* name,
m_sg_contr = BL_CreateIPO(m_action, m_obj, KX_GetActiveScene()->GetSceneConverter());
m_obj->GetSGNode()->AddSGController(m_sg_contr);
m_sg_contr->SetObject(m_obj->GetSGNode());
- InitIPO();
}
+
+ m_ipo_flags = ipo_flags;
+ InitIPO();
// Now that we have an action, we have something we can play
m_starttime = KX_GetActiveEngine()->GetFrameTime();
@@ -131,9 +135,9 @@ void BL_Action::InitIPO()
{
// Initialize the IPO
m_sg_contr->SetOption(SG_Controller::SG_CONTR_IPO_RESET, true);
- m_sg_contr->SetOption(SG_Controller::SG_CONTR_IPO_IPO_AS_FORCE, false);
- m_sg_contr->SetOption(SG_Controller::SG_CONTR_IPO_IPO_ADD, false);
- m_sg_contr->SetOption(SG_Controller::SG_CONTR_IPO_LOCAL, false);
+ m_sg_contr->SetOption(SG_Controller::SG_CONTR_IPO_IPO_AS_FORCE, m_ipo_flags & ACT_IPOFLAG_FORCE);
+ m_sg_contr->SetOption(SG_Controller::SG_CONTR_IPO_IPO_ADD, m_ipo_flags & ACT_IPOFLAG_ADD);
+ m_sg_contr->SetOption(SG_Controller::SG_CONTR_IPO_LOCAL, m_ipo_flags & ACT_IPOFLAG_LOCAL);
}
float BL_Action::GetFrame()
@@ -259,8 +263,6 @@ void BL_Action::Update(float curtime)
else
{
InitIPO();
- m_sg_contr->SetSimulatedTime(m_localtime);
- m_obj->GetSGNode()->UpdateWorldData(m_localtime);
- m_obj->UpdateTransform();
+ m_obj->UpdateIPO(m_localtime, m_ipo_flags & ACT_IPOFLAG_CHILD);
}
}