My Project
BoneAnimProvider.h
1 #pragma once
2 #include "ParaXBone.h"
3 #include "ParaXModel.h"
4 #include <map>
5 #include <vector>
6 #include <list>
7 #include <string>
8 
9 namespace ParaEngine
10 {
11  using namespace std;
12  class Bone;
13 
21  {
22  public:
30  CBoneAnimProvider(int nAnimID, const char* name, const char* filename);
31 
32  virtual ~CBoneAnimProvider(void);
33 
34  public:
36  //
37  // static functions: manager class functions.
38  //
40 
44  static CBoneAnimProvider* GetProviderByID(int id);
45 
51  static int GetProviderIDByName(const char* sName);
52 
61  static CBoneAnimProvider* CreateProvider(int nAnimID, const char* name, const char* filename, bool bOverwrite = false);
62 
66  static bool DeleteProvider(int nAnimID);
67 
69  static bool CleanupAllProviders();
70 
71  private:
72  static map<int, CBoneAnimProvider*> g_mapProviderIDs;
73  static map<string, CBoneAnimProvider*> g_mapProviderNames;
74 
75  public:
77  //
78  // member functions: per instance functions.
79  //
81 
83  enum MergeMode
84  {
89  };
90 
92  int GetAnimID();
93 
95  const string& GetAnimName();
96 
98  const string& GetAnimFileName();
99 
101  bool HasBone(KNOWN_BONE_NODES KnownBoneID);
102 
104  Bone* GetBone(KNOWN_BONE_NODES KnownBoneID);
106  Bone* GetBoneByIndex(int nIndex);
107 
109  MergeMode GetMergeMode();
110 
113  int GetSubAnimID();
114 
117  void SetSubAnimID(int nID);
118 
122  AnimIndex GetAnimIndex(int nSubAnimID=0);
123 
128  void GetAnimMoveSpeed(float* pSpeed, int nSubAnimID=0);
129  private:
131  bool LoadAsset();
132 
134  bool LoadFromBVHFile(const char* filename);
135 
137  bool LoadFromParaXFile(const char* filename);
138 
139  private:
141  asset_ptr<ParaXEntity> m_asset;
142 
144  int m_nAnimID;
146  string m_sName;
148  string m_sFileName;
149 
152  int m_nSubAnimID;
153 
155  int m_boneLookup[MAX_KNOWN_BONE_NODE];
156 
158  vector<Bone> m_bones;
159 
161  vector<ModelAnimation> m_anims;
162 
164  MergeMode m_MergeMode;
165 
167  bool m_bLoaded;
168  };
169 }
170 
different physics engine has different winding order.
Definition: EventBinding.h:32
a single animated bone, it contains both the bone instance data and all animation data of the bone...
Definition: ParaXBone.h:15
KNOWN_BONE_NODES
all known bones
Definition: modelheaders.h:406
replace the target model with all bones.
Definition: BoneAnimProvider.h:88
it presents a given in bone animation providers or parax local model bone animation pools ...
Definition: AnimInstanceBase.h:13
MergeMode
how bone animation is meant to be used with a parax model.
Definition: BoneAnimProvider.h:83
replace the target model with all existing bones defined in the provider
Definition: BoneAnimProvider.h:86
Supplying external animation loaded from ParaX or BVH files.
Definition: BoneAnimProvider.h:20