diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp index d4fc58f3d51d..604125175c2e 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.cpp +++ b/source/gameengine/Converter/BL_ArmatureObject.cpp @@ -205,13 +205,10 @@ static void game_blend_poses(bPose *dst, bPose *src, float srcweight, short mode BL_ArmatureObject::BL_ArmatureObject(void *sgReplicationInfo, SG_Callbacks callbacks, Object *armature, - Scene *scene, - int vert_deform_type) + Scene *scene) :KX_GameObject(sgReplicationInfo, callbacks), m_scene(scene), m_lastframe(0.0), - m_timestep(0.040), - m_vert_deform_type(vert_deform_type), m_drawDebug(false), m_lastapplyframe(0.0) { @@ -424,9 +421,6 @@ bool BL_ArmatureObject::UnlinkObject(SCA_IObject *clientobj) void BL_ArmatureObject::ApplyPose() // TODO: bouger dans SetPoseByAction ? { - // in the GE, we use ctime to store the timestep - m_objArma->pose->ctime = (float)m_timestep; - //m_scene->r.cfra++; if (m_lastapplyframe != m_lastframe) { // update the constraint if any, first put them all off so that only the active ones will be updated for (BL_ArmatureConstraint *constraint : m_controlledConstraints) { @@ -457,8 +451,10 @@ void BL_ArmatureObject::BlendInPose(bPose *blend_pose, float weight, short mode) bool BL_ArmatureObject::UpdateTimestep(double curtime) { if (curtime != m_lastframe) { - // compute the timestep for the underlying IK algorithm - m_timestep = curtime - m_lastframe; + /* Compute the timestep for the underlying IK algorithm, + * in the GE, we use ctime to store the timestep. + */ + m_objArma->pose->ctime = (float)(curtime - m_lastframe); m_lastframe = curtime; } @@ -474,9 +470,9 @@ Object *BL_ArmatureObject::GetOrigArmatureObject() return m_origObjArma; } -int BL_ArmatureObject::GetVertDeformType() +int BL_ArmatureObject::GetVertDeformType() const { - return m_vert_deform_type; + return ((bArmature *)m_objArma->data)->gevertdeformer; } void BL_ArmatureObject::GetPose(bPose **pose) const diff --git a/source/gameengine/Converter/BL_ArmatureObject.h b/source/gameengine/Converter/BL_ArmatureObject.h index e868248b4f68..1086331661d1 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.h +++ b/source/gameengine/Converter/BL_ArmatureObject.h @@ -59,9 +59,6 @@ class BL_ArmatureObject : public KX_GameObject // Need for BKE_pose_where_is. Scene *m_scene; double m_lastframe; - /// Delta since last pose evaluation. - double m_timestep; - int m_vert_deform_type; size_t m_constraintNumber; size_t m_channelNumber; /// Store the original armature object matrix. @@ -75,8 +72,7 @@ class BL_ArmatureObject : public KX_GameObject BL_ArmatureObject(void *sgReplicationInfo, SG_Callbacks callbacks, Object *armature, - Scene *scene, - int vert_deform_type); + Scene *scene); virtual ~BL_ArmatureObject(); virtual CValue *GetReplica(); @@ -99,7 +95,7 @@ class BL_ArmatureObject : public KX_GameObject Object *GetArmatureObject(); Object *GetOrigArmatureObject(); - int GetVertDeformType(); + int GetVertDeformType() const; bool GetDrawDebug() const; void DrawDebug(RAS_DebugDraw& debugDraw); diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index c639fdef4701..4fdf96b1058b 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -962,7 +962,7 @@ static KX_GameObject *BL_GameObjectFromBlenderObject(Object *ob, KX_Scene *kxsce case OB_ARMATURE: { bArmature *arm = (bArmature *)ob->data; - gameobj = new BL_ArmatureObject(kxscene, KX_Scene::m_callbacks, ob, kxscene->GetBlenderScene(), arm->gevertdeformer); + gameobj = new BL_ArmatureObject(kxscene, KX_Scene::m_callbacks, ob, kxscene->GetBlenderScene()); kxscene->AddAnimatedObject(gameobj);