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>2014-04-07 03:30:59 +0400
committerMitchell Stokes <mogurijin@gmail.com>2014-04-07 03:30:59 +0400
commitfe05f97841c0ee3e2a6e15f2252ad160fefc3509 (patch)
tree2a672e5d82448f43471ddb529a95fa547d5c311e /source/gameengine/Converter/BL_ArmatureObject.h
parentbe8b4b8b0c4d4fdeed6ebf88d8a3bd480e4c48ce (diff)
BGE: Multi-threading animation updates and skinning.
This required BL_ArmatureObject to have tighter control over armatures and poses. Also, (Blender) armature objects are now copied instead of shared between BL_ArmatureObjects to avoid race conditions. Also, due to the armature copy, shape key drivers need a bit of extra fiddling to get the correct armature copy. Initially OpenMP was used for threading, but then BLI_task was used due to being less compiler dependent. This commit also places time spent on skinning updates in the Animation profiler category (was previously under the Rasterizer category).
Diffstat (limited to 'source/gameengine/Converter/BL_ArmatureObject.h')
-rw-r--r--source/gameengine/Converter/BL_ArmatureObject.h24
1 files changed, 7 insertions, 17 deletions
diff --git a/source/gameengine/Converter/BL_ArmatureObject.h b/source/gameengine/Converter/BL_ArmatureObject.h
index 81388355fc4..691e73d6bde 100644
--- a/source/gameengine/Converter/BL_ArmatureObject.h
+++ b/source/gameengine/Converter/BL_ArmatureObject.h
@@ -55,14 +55,11 @@ class BL_ArmatureObject : public KX_GameObject
public:
double GetLastFrame ();
- short GetActivePriority();
virtual void ProcessReplica();
virtual void ReParentLogic();
virtual void Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map);
virtual bool UnlinkObject(SCA_IObject* clientobj);
- class BL_ActionActuator * GetActiveAction();
-
BL_ArmatureObject(
void* sgReplicationInfo,
SG_Callbacks callbacks,
@@ -73,21 +70,23 @@ public:
virtual ~BL_ArmatureObject();
virtual CValue* GetReplica();
- void GetMRDPose(struct bPose **pose);
void GetPose(struct bPose **pose);
void SetPose (struct bPose *pose);
struct bPose *GetOrigPose() {return m_pose;} // never edit this, only for accessing names
void ApplyPose();
+ void SetPoseByAction(struct bAction* action, float localtime);
+ void BlendInPose(struct bPose *blend_pose, float weight, short mode);
void RestorePose();
- bool SetActiveAction(class BL_ActionActuator *act, short priority, double curtime);
+ bool UpdateTimestep(double curtime);
- struct bArmature *GetArmature() { return m_armature; }
- const struct bArmature * GetArmature() const { return m_armature; }
+ struct bArmature *GetArmature() { return (bArmature*)m_objArma->data; }
+ const struct bArmature * GetArmature() const { return (bArmature*)m_objArma->data; }
const struct Scene * GetScene() const { return m_scene; }
Object* GetArmatureObject() {return m_objArma;}
+ Object* GetOrigArmatureObject() {return m_origObjArma;}
int GetVertDeformType() {return m_vert_deform_type;}
@@ -128,15 +127,12 @@ protected:
/* list element: BL_ArmatureChannel. Use SG_DList to avoid list replication */
SG_DList m_poseChannels;
Object *m_objArma;
- struct bArmature *m_armature;
+ Object *m_origObjArma;
struct bPose *m_pose;
struct bPose *m_armpose;
- struct bPose *m_framePose;
struct Scene *m_scene; // need for BKE_pose_where_is
double m_lastframe;
double m_timestep; // delta since last pose evaluation.
- class BL_ActionActuator *m_activeAct;
- short m_activePriority;
int m_vert_deform_type;
size_t m_constraintNumber;
size_t m_channelNumber;
@@ -146,10 +142,4 @@ protected:
double m_lastapplyframe;
};
-/* Pose function specific to the game engine */
-void game_blend_poses(struct bPose *dst, struct bPose *src, float srcweight, short mode); /* was blend_poses */
-//void extract_pose_from_pose(struct bPose *pose, const struct bPose *src);
-void game_copy_pose(struct bPose **dst, struct bPose *src, int copy_con);
-void game_free_pose(struct bPose *pose);
-
#endif /* __BL_ARMATUREOBJECT_H__ */