d3dx9anim.h 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (C) Microsoft Corporation. All Rights Reserved.
  4. //
  5. // File: d3dx9anim.h
  6. // Content: D3DX mesh types and functions
  7. //
  8. //////////////////////////////////////////////////////////////////////////////
  9. #ifndef __D3DX9ANIM_H__
  10. #define __D3DX9ANIM_H__
  11. // {698CFB3F-9289-4d95-9A57-33A94B5A65F9}
  12. DEFINE_GUID(IID_ID3DXAnimationSet,
  13. 0x698cfb3f, 0x9289, 0x4d95, 0x9a, 0x57, 0x33, 0xa9, 0x4b, 0x5a, 0x65, 0xf9);
  14. // {FA4E8E3A-9786-407d-8B4C-5995893764AF}
  15. DEFINE_GUID(IID_ID3DXKeyframedAnimationSet,
  16. 0xfa4e8e3a, 0x9786, 0x407d, 0x8b, 0x4c, 0x59, 0x95, 0x89, 0x37, 0x64, 0xaf);
  17. // {6CC2480D-3808-4739-9F88-DE49FACD8D4C}
  18. DEFINE_GUID(IID_ID3DXCompressedAnimationSet,
  19. 0x6cc2480d, 0x3808, 0x4739, 0x9f, 0x88, 0xde, 0x49, 0xfa, 0xcd, 0x8d, 0x4c);
  20. // {AC8948EC-F86D-43e2-96DE-31FC35F96D9E}
  21. DEFINE_GUID(IID_ID3DXAnimationController,
  22. 0xac8948ec, 0xf86d, 0x43e2, 0x96, 0xde, 0x31, 0xfc, 0x35, 0xf9, 0x6d, 0x9e);
  23. //----------------------------------------------------------------------------
  24. // D3DXMESHDATATYPE:
  25. // -----------------
  26. // This enum defines the type of mesh data present in a MeshData structure.
  27. //----------------------------------------------------------------------------
  28. typedef enum _D3DXMESHDATATYPE {
  29. D3DXMESHTYPE_MESH = 0x001, // Normal ID3DXMesh data
  30. D3DXMESHTYPE_PMESH = 0x002, // Progressive Mesh - ID3DXPMesh
  31. D3DXMESHTYPE_PATCHMESH = 0x003, // Patch Mesh - ID3DXPatchMesh
  32. D3DXMESHTYPE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
  33. } D3DXMESHDATATYPE;
  34. //----------------------------------------------------------------------------
  35. // D3DXMESHDATA:
  36. // -------------
  37. // This struct encapsulates a the mesh data that can be present in a mesh
  38. // container. The supported mesh types are pMesh, pPMesh, pPatchMesh.
  39. // The valid way to access this is determined by the Type enum.
  40. //----------------------------------------------------------------------------
  41. typedef struct _D3DXMESHDATA
  42. {
  43. D3DXMESHDATATYPE Type;
  44. // current mesh data interface
  45. union
  46. {
  47. LPD3DXMESH pMesh;
  48. LPD3DXPMESH pPMesh;
  49. LPD3DXPATCHMESH pPatchMesh;
  50. };
  51. } D3DXMESHDATA, *LPD3DXMESHDATA;
  52. //----------------------------------------------------------------------------
  53. // D3DXMESHCONTAINER:
  54. // ------------------
  55. // This struct encapsulates a mesh object in a transformation frame
  56. // hierarchy. The app can derive from this structure to add other app specific
  57. // data to this.
  58. //----------------------------------------------------------------------------
  59. typedef struct _D3DXMESHCONTAINER
  60. {
  61. LPSTR Name;
  62. D3DXMESHDATA MeshData;
  63. LPD3DXMATERIAL pMaterials;
  64. LPD3DXEFFECTINSTANCE pEffects;
  65. DWORD NumMaterials;
  66. DWORD *pAdjacency;
  67. LPD3DXSKININFO pSkinInfo;
  68. struct _D3DXMESHCONTAINER *pNextMeshContainer;
  69. } D3DXMESHCONTAINER, *LPD3DXMESHCONTAINER;
  70. //----------------------------------------------------------------------------
  71. // D3DXFRAME:
  72. // ----------
  73. // This struct is the encapsulates a transform frame in a transformation frame
  74. // hierarchy. The app can derive from this structure to add other app specific
  75. // data to this
  76. //----------------------------------------------------------------------------
  77. typedef struct _D3DXFRAME
  78. {
  79. LPSTR Name;
  80. D3DXMATRIX TransformationMatrix;
  81. LPD3DXMESHCONTAINER pMeshContainer;
  82. struct _D3DXFRAME *pFrameSibling;
  83. struct _D3DXFRAME *pFrameFirstChild;
  84. } D3DXFRAME, *LPD3DXFRAME;
  85. //----------------------------------------------------------------------------
  86. // ID3DXAllocateHierarchy:
  87. // -----------------------
  88. // This interface is implemented by the application to allocate/free frame and
  89. // mesh container objects. Methods on this are called during loading and
  90. // destroying frame hierarchies
  91. //----------------------------------------------------------------------------
  92. typedef interface ID3DXAllocateHierarchy ID3DXAllocateHierarchy;
  93. typedef interface ID3DXAllocateHierarchy *LPD3DXALLOCATEHIERARCHY;
  94. #undef INTERFACE
  95. #define INTERFACE ID3DXAllocateHierarchy
  96. DECLARE_INTERFACE(ID3DXAllocateHierarchy)
  97. {
  98. // ID3DXAllocateHierarchy
  99. //------------------------------------------------------------------------
  100. // CreateFrame:
  101. // ------------
  102. // Requests allocation of a frame object.
  103. //
  104. // Parameters:
  105. // Name
  106. // Name of the frame to be created
  107. // ppNewFrame
  108. // Returns the created frame object
  109. //
  110. //------------------------------------------------------------------------
  111. STDMETHOD(CreateFrame)(THIS_ LPCSTR Name,
  112. LPD3DXFRAME *ppNewFrame) PURE;
  113. //------------------------------------------------------------------------
  114. // CreateMeshContainer:
  115. // --------------------
  116. // Requests allocation of a mesh container object.
  117. //
  118. // Parameters:
  119. // Name
  120. // Name of the mesh
  121. // pMesh
  122. // Pointer to the mesh object if basic polygon data found
  123. // pPMesh
  124. // Pointer to the progressive mesh object if progressive mesh data found
  125. // pPatchMesh
  126. // Pointer to the patch mesh object if patch data found
  127. // pMaterials
  128. // Array of materials used in the mesh
  129. // pEffectInstances
  130. // Array of effect instances used in the mesh
  131. // NumMaterials
  132. // Num elements in the pMaterials array
  133. // pAdjacency
  134. // Adjacency array for the mesh
  135. // pSkinInfo
  136. // Pointer to the skininfo object if the mesh is skinned
  137. // pBoneNames
  138. // Array of names, one for each bone in the skinned mesh.
  139. // The numberof bones can be found from the pSkinMesh object
  140. // pBoneOffsetMatrices
  141. // Array of matrices, one for each bone in the skinned mesh.
  142. //
  143. //------------------------------------------------------------------------
  144. STDMETHOD(CreateMeshContainer)(THIS_
  145. LPCSTR Name,
  146. CONST D3DXMESHDATA *pMeshData,
  147. CONST D3DXMATERIAL *pMaterials,
  148. CONST D3DXEFFECTINSTANCE *pEffectInstances,
  149. DWORD NumMaterials,
  150. CONST DWORD *pAdjacency,
  151. LPD3DXSKININFO pSkinInfo,
  152. LPD3DXMESHCONTAINER *ppNewMeshContainer) PURE;
  153. //------------------------------------------------------------------------
  154. // DestroyFrame:
  155. // -------------
  156. // Requests de-allocation of a frame object.
  157. //
  158. // Parameters:
  159. // pFrameToFree
  160. // Pointer to the frame to be de-allocated
  161. //
  162. //------------------------------------------------------------------------
  163. STDMETHOD(DestroyFrame)(THIS_ LPD3DXFRAME pFrameToFree) PURE;
  164. //------------------------------------------------------------------------
  165. // DestroyMeshContainer:
  166. // ---------------------
  167. // Requests de-allocation of a mesh container object.
  168. //
  169. // Parameters:
  170. // pMeshContainerToFree
  171. // Pointer to the mesh container object to be de-allocated
  172. //
  173. //------------------------------------------------------------------------
  174. STDMETHOD(DestroyMeshContainer)(THIS_ LPD3DXMESHCONTAINER pMeshContainerToFree) PURE;
  175. };
  176. //----------------------------------------------------------------------------
  177. // ID3DXLoadUserData:
  178. // ------------------
  179. // This interface is implemented by the application to load user data in a .X file
  180. // When user data is found, these callbacks will be used to allow the application
  181. // to load the data.
  182. //----------------------------------------------------------------------------
  183. typedef interface ID3DXLoadUserData ID3DXLoadUserData;
  184. typedef interface ID3DXLoadUserData *LPD3DXLOADUSERDATA;
  185. #undef INTERFACE
  186. #define INTERFACE ID3DXLoadUserData
  187. DECLARE_INTERFACE(ID3DXLoadUserData)
  188. {
  189. STDMETHOD(LoadTopLevelData)(LPD3DXFILEDATA pXofChildData) PURE;
  190. STDMETHOD(LoadFrameChildData)(LPD3DXFRAME pFrame,
  191. LPD3DXFILEDATA pXofChildData) PURE;
  192. STDMETHOD(LoadMeshChildData)(LPD3DXMESHCONTAINER pMeshContainer,
  193. LPD3DXFILEDATA pXofChildData) PURE;
  194. };
  195. //----------------------------------------------------------------------------
  196. // ID3DXSaveUserData:
  197. // ------------------
  198. // This interface is implemented by the application to save user data in a .X file
  199. // The callbacks are called for all data saved. The user can then add any
  200. // child data objects to the object provided to the callback.
  201. //----------------------------------------------------------------------------
  202. typedef interface ID3DXSaveUserData ID3DXSaveUserData;
  203. typedef interface ID3DXSaveUserData *LPD3DXSAVEUSERDATA;
  204. #undef INTERFACE
  205. #define INTERFACE ID3DXSaveUserData
  206. DECLARE_INTERFACE(ID3DXSaveUserData)
  207. {
  208. STDMETHOD(AddFrameChildData)(CONST D3DXFRAME *pFrame,
  209. LPD3DXFILESAVEOBJECT pXofSave,
  210. LPD3DXFILESAVEDATA pXofFrameData) PURE;
  211. STDMETHOD(AddMeshChildData)(CONST D3DXMESHCONTAINER *pMeshContainer,
  212. LPD3DXFILESAVEOBJECT pXofSave,
  213. LPD3DXFILESAVEDATA pXofMeshData) PURE;
  214. // NOTE: this is called once per Save. All top level objects should be added using the
  215. // provided interface. One call adds objects before the frame hierarchy, the other after
  216. STDMETHOD(AddTopLevelDataObjectsPre)(LPD3DXFILESAVEOBJECT pXofSave) PURE;
  217. STDMETHOD(AddTopLevelDataObjectsPost)(LPD3DXFILESAVEOBJECT pXofSave) PURE;
  218. // callbacks for the user to register and then save templates to the XFile
  219. STDMETHOD(RegisterTemplates)(LPD3DXFILE pXFileApi) PURE;
  220. STDMETHOD(SaveTemplates)(LPD3DXFILESAVEOBJECT pXofSave) PURE;
  221. };
  222. //----------------------------------------------------------------------------
  223. // D3DXCALLBACK_SEARCH_FLAGS:
  224. // --------------------------
  225. // Flags that can be passed into ID3DXAnimationSet::GetCallback.
  226. //----------------------------------------------------------------------------
  227. typedef enum _D3DXCALLBACK_SEARCH_FLAGS
  228. {
  229. D3DXCALLBACK_SEARCH_EXCLUDING_INITIAL_POSITION = 0x01, // exclude callbacks at the initial position from the search
  230. D3DXCALLBACK_SEARCH_BEHIND_INITIAL_POSITION = 0x02, // reverse the callback search direction
  231. D3DXCALLBACK_SEARCH_FORCE_DWORD = 0x7fffffff,
  232. } D3DXCALLBACK_SEARCH_FLAGS;
  233. //----------------------------------------------------------------------------
  234. // ID3DXAnimationSet:
  235. // ------------------
  236. // This interface implements an animation set.
  237. //----------------------------------------------------------------------------
  238. typedef interface ID3DXAnimationSet ID3DXAnimationSet;
  239. typedef interface ID3DXAnimationSet *LPD3DXANIMATIONSET;
  240. #undef INTERFACE
  241. #define INTERFACE ID3DXAnimationSet
  242. DECLARE_INTERFACE_(ID3DXAnimationSet, IUnknown)
  243. {
  244. // IUnknown
  245. STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
  246. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  247. STDMETHOD_(ULONG, Release)(THIS) PURE;
  248. // Name
  249. STDMETHOD_(LPCSTR, GetName)(THIS) PURE;
  250. // Period
  251. STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE;
  252. STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE Position) PURE; // Maps position into animation period
  253. // Animation names
  254. STDMETHOD_(UINT, GetNumAnimations)(THIS) PURE;
  255. STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT Index, LPCSTR *ppName) PURE;
  256. STDMETHOD(GetAnimationIndexByName)(THIS_ LPCSTR pName, UINT *pIndex) PURE;
  257. // SRT
  258. STDMETHOD(GetSRT)(THIS_
  259. DOUBLE PeriodicPosition, // Position mapped to period (use GetPeriodicPosition)
  260. UINT Animation, // Animation index
  261. D3DXVECTOR3 *pScale, // Returns the scale
  262. D3DXQUATERNION *pRotation, // Returns the rotation as a quaternion
  263. D3DXVECTOR3 *pTranslation) PURE; // Returns the translation
  264. // Callbacks
  265. STDMETHOD(GetCallback)(THIS_
  266. DOUBLE Position, // Position from which to find callbacks
  267. DWORD Flags, // Callback search flags
  268. DOUBLE *pCallbackPosition, // Returns the position of the callback
  269. LPVOID *ppCallbackData) PURE; // Returns the callback data pointer
  270. };
  271. //----------------------------------------------------------------------------
  272. // D3DXPLAYBACK_TYPE:
  273. // ------------------
  274. // This enum defines the type of animation set loop modes.
  275. //----------------------------------------------------------------------------
  276. typedef enum _D3DXPLAYBACK_TYPE
  277. {
  278. D3DXPLAY_LOOP = 0,
  279. D3DXPLAY_ONCE = 1,
  280. D3DXPLAY_PINGPONG = 2,
  281. D3DXPLAY_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
  282. } D3DXPLAYBACK_TYPE;
  283. //----------------------------------------------------------------------------
  284. // D3DXKEY_VECTOR3:
  285. // ----------------
  286. // This structure describes a vector key for use in keyframe animation.
  287. // It specifies a vector Value at a given Time. This is used for scale and
  288. // translation keys.
  289. //----------------------------------------------------------------------------
  290. typedef struct _D3DXKEY_VECTOR3
  291. {
  292. FLOAT Time;
  293. D3DXVECTOR3 Value;
  294. } D3DXKEY_VECTOR3, *LPD3DXKEY_VECTOR3;
  295. //----------------------------------------------------------------------------
  296. // D3DXKEY_QUATERNION:
  297. // -------------------
  298. // This structure describes a quaternion key for use in keyframe animation.
  299. // It specifies a quaternion Value at a given Time. This is used for rotation
  300. // keys.
  301. //----------------------------------------------------------------------------
  302. typedef struct _D3DXKEY_QUATERNION
  303. {
  304. FLOAT Time;
  305. D3DXQUATERNION Value;
  306. } D3DXKEY_QUATERNION, *LPD3DXKEY_QUATERNION;
  307. //----------------------------------------------------------------------------
  308. // D3DXKEY_CALLBACK:
  309. // -----------------
  310. // This structure describes an callback key for use in keyframe animation.
  311. // It specifies a pointer to user data at a given Time.
  312. //----------------------------------------------------------------------------
  313. typedef struct _D3DXKEY_CALLBACK
  314. {
  315. FLOAT Time;
  316. LPVOID pCallbackData;
  317. } D3DXKEY_CALLBACK, *LPD3DXKEY_CALLBACK;
  318. //----------------------------------------------------------------------------
  319. // D3DXCOMPRESSION_FLAGS:
  320. // ----------------------
  321. // Flags that can be passed into ID3DXKeyframedAnimationSet::Compress.
  322. //----------------------------------------------------------------------------
  323. typedef enum _D3DXCOMPRESSION_FLAGS
  324. {
  325. D3DXCOMPRESS_DEFAULT = 0x00,
  326. D3DXCOMPRESS_FORCE_DWORD = 0x7fffffff,
  327. } D3DXCOMPRESSION_FLAGS;
  328. //----------------------------------------------------------------------------
  329. // ID3DXKeyframedAnimationSet:
  330. // ---------------------------
  331. // This interface implements a compressable keyframed animation set.
  332. //----------------------------------------------------------------------------
  333. typedef interface ID3DXKeyframedAnimationSet ID3DXKeyframedAnimationSet;
  334. typedef interface ID3DXKeyframedAnimationSet *LPD3DXKEYFRAMEDANIMATIONSET;
  335. #undef INTERFACE
  336. #define INTERFACE ID3DXKeyframedAnimationSet
  337. DECLARE_INTERFACE_(ID3DXKeyframedAnimationSet, ID3DXAnimationSet)
  338. {
  339. // ID3DXAnimationSet
  340. STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
  341. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  342. STDMETHOD_(ULONG, Release)(THIS) PURE;
  343. // Name
  344. STDMETHOD_(LPCSTR, GetName)(THIS) PURE;
  345. // Period
  346. STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE;
  347. STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE Position) PURE; // Maps position into animation period
  348. // Animation names
  349. STDMETHOD_(UINT, GetNumAnimations)(THIS) PURE;
  350. STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT Index, LPCSTR *ppName) PURE;
  351. STDMETHOD(GetAnimationIndexByName)(THIS_ LPCSTR pName, UINT *pIndex) PURE;
  352. // SRT
  353. STDMETHOD(GetSRT)(THIS_
  354. DOUBLE PeriodicPosition, // Position mapped to period (use GetPeriodicPosition)
  355. UINT Animation, // Animation index
  356. D3DXVECTOR3 *pScale, // Returns the scale
  357. D3DXQUATERNION *pRotation, // Returns the rotation as a quaternion
  358. D3DXVECTOR3 *pTranslation) PURE; // Returns the translation
  359. // Callbacks
  360. STDMETHOD(GetCallback)(THIS_
  361. DOUBLE Position, // Position from which to find callbacks
  362. DWORD Flags, // Callback search flags
  363. DOUBLE *pCallbackPosition, // Returns the position of the callback
  364. LPVOID *ppCallbackData) PURE; // Returns the callback data pointer
  365. // Playback
  366. STDMETHOD_(D3DXPLAYBACK_TYPE, GetPlaybackType)(THIS) PURE;
  367. STDMETHOD_(DOUBLE, GetSourceTicksPerSecond)(THIS) PURE;
  368. // Scale keys
  369. STDMETHOD_(UINT, GetNumScaleKeys)(THIS_ UINT Animation) PURE;
  370. STDMETHOD(GetScaleKeys)(THIS_ UINT Animation, LPD3DXKEY_VECTOR3 pScaleKeys) PURE;
  371. STDMETHOD(GetScaleKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_VECTOR3 pScaleKey) PURE;
  372. STDMETHOD(SetScaleKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_VECTOR3 pScaleKey) PURE;
  373. // Rotation keys
  374. STDMETHOD_(UINT, GetNumRotationKeys)(THIS_ UINT Animation) PURE;
  375. STDMETHOD(GetRotationKeys)(THIS_ UINT Animation, LPD3DXKEY_QUATERNION pRotationKeys) PURE;
  376. STDMETHOD(GetRotationKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_QUATERNION pRotationKey) PURE;
  377. STDMETHOD(SetRotationKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_QUATERNION pRotationKey) PURE;
  378. // Translation keys
  379. STDMETHOD_(UINT, GetNumTranslationKeys)(THIS_ UINT Animation) PURE;
  380. STDMETHOD(GetTranslationKeys)(THIS_ UINT Animation, LPD3DXKEY_VECTOR3 pTranslationKeys) PURE;
  381. STDMETHOD(GetTranslationKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_VECTOR3 pTranslationKey) PURE;
  382. STDMETHOD(SetTranslationKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_VECTOR3 pTranslationKey) PURE;
  383. // Callback keys
  384. STDMETHOD_(UINT, GetNumCallbackKeys)(THIS) PURE;
  385. STDMETHOD(GetCallbackKeys)(THIS_ LPD3DXKEY_CALLBACK pCallbackKeys) PURE;
  386. STDMETHOD(GetCallbackKey)(THIS_ UINT Key, LPD3DXKEY_CALLBACK pCallbackKey) PURE;
  387. STDMETHOD(SetCallbackKey)(THIS_ UINT Key, LPD3DXKEY_CALLBACK pCallbackKey) PURE;
  388. // Key removal methods. These are slow, and should not be used once the animation starts playing
  389. STDMETHOD(UnregisterScaleKey)(THIS_ UINT Animation, UINT Key) PURE;
  390. STDMETHOD(UnregisterRotationKey)(THIS_ UINT Animation, UINT Key) PURE;
  391. STDMETHOD(UnregisterTranslationKey)(THIS_ UINT Animation, UINT Key) PURE;
  392. // One-time animaton SRT keyframe registration
  393. STDMETHOD(RegisterAnimationSRTKeys)(THIS_
  394. LPCSTR pName, // Animation name
  395. UINT NumScaleKeys, // Number of scale keys
  396. UINT NumRotationKeys, // Number of rotation keys
  397. UINT NumTranslationKeys, // Number of translation keys
  398. CONST D3DXKEY_VECTOR3 *pScaleKeys, // Array of scale keys
  399. CONST D3DXKEY_QUATERNION *pRotationKeys, // Array of rotation keys
  400. CONST D3DXKEY_VECTOR3 *pTranslationKeys, // Array of translation keys
  401. DWORD *pAnimationIndex) PURE; // Returns the animation index
  402. // Compression
  403. STDMETHOD(Compress)(THIS_
  404. DWORD Flags, // Compression flags (use D3DXCOMPRESS_STRONG for better results)
  405. FLOAT Lossiness, // Compression loss ratio in the [0, 1] range
  406. LPD3DXFRAME pHierarchy, // Frame hierarchy (optional)
  407. LPD3DXBUFFER *ppCompressedData) PURE; // Returns the compressed animation set
  408. STDMETHOD(UnregisterAnimation)(THIS_ UINT Index) PURE;
  409. };
  410. //----------------------------------------------------------------------------
  411. // ID3DXCompressedAnimationSet:
  412. // ----------------------------
  413. // This interface implements a compressed keyframed animation set.
  414. //----------------------------------------------------------------------------
  415. typedef interface ID3DXCompressedAnimationSet ID3DXCompressedAnimationSet;
  416. typedef interface ID3DXCompressedAnimationSet *LPD3DXCOMPRESSEDANIMATIONSET;
  417. #undef INTERFACE
  418. #define INTERFACE ID3DXCompressedAnimationSet
  419. DECLARE_INTERFACE_(ID3DXCompressedAnimationSet, ID3DXAnimationSet)
  420. {
  421. // ID3DXAnimationSet
  422. STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
  423. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  424. STDMETHOD_(ULONG, Release)(THIS) PURE;
  425. // Name
  426. STDMETHOD_(LPCSTR, GetName)(THIS) PURE;
  427. // Period
  428. STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE;
  429. STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE Position) PURE; // Maps position into animation period
  430. // Animation names
  431. STDMETHOD_(UINT, GetNumAnimations)(THIS) PURE;
  432. STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT Index, LPCSTR *ppName) PURE;
  433. STDMETHOD(GetAnimationIndexByName)(THIS_ LPCSTR pName, UINT *pIndex) PURE;
  434. // SRT
  435. STDMETHOD(GetSRT)(THIS_
  436. DOUBLE PeriodicPosition, // Position mapped to period (use GetPeriodicPosition)
  437. UINT Animation, // Animation index
  438. D3DXVECTOR3 *pScale, // Returns the scale
  439. D3DXQUATERNION *pRotation, // Returns the rotation as a quaternion
  440. D3DXVECTOR3 *pTranslation) PURE; // Returns the translation
  441. // Callbacks
  442. STDMETHOD(GetCallback)(THIS_
  443. DOUBLE Position, // Position from which to find callbacks
  444. DWORD Flags, // Callback search flags
  445. DOUBLE *pCallbackPosition, // Returns the position of the callback
  446. LPVOID *ppCallbackData) PURE; // Returns the callback data pointer
  447. // Playback
  448. STDMETHOD_(D3DXPLAYBACK_TYPE, GetPlaybackType)(THIS) PURE;
  449. STDMETHOD_(DOUBLE, GetSourceTicksPerSecond)(THIS) PURE;
  450. // Scale keys
  451. STDMETHOD(GetCompressedData)(THIS_ LPD3DXBUFFER *ppCompressedData) PURE;
  452. // Callback keys
  453. STDMETHOD_(UINT, GetNumCallbackKeys)(THIS) PURE;
  454. STDMETHOD(GetCallbackKeys)(THIS_ LPD3DXKEY_CALLBACK pCallbackKeys) PURE;
  455. };
  456. //----------------------------------------------------------------------------
  457. // D3DXPRIORITY_TYPE:
  458. // ------------------
  459. // This enum defines the type of priority group that a track can be assigned to.
  460. //----------------------------------------------------------------------------
  461. typedef enum _D3DXPRIORITY_TYPE {
  462. D3DXPRIORITY_LOW = 0, // This track should be blended with all low priority tracks before mixed with the high priority result
  463. D3DXPRIORITY_HIGH = 1, // This track should be blended with all high priority tracks before mixed with the low priority result
  464. D3DXPRIORITY_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
  465. } D3DXPRIORITY_TYPE;
  466. //----------------------------------------------------------------------------
  467. // D3DXTRACK_DESC:
  468. // ---------------
  469. // This structure describes the mixing information of an animation track.
  470. // The mixing information consists of the current position, speed, and blending
  471. // weight for the track. The Flags field also specifies whether the track is
  472. // low or high priority. Tracks with the same priority are blended together
  473. // and then the two resulting values are blended using the priority blend factor.
  474. // A track also has an animation set (stored separately) associated with it.
  475. //----------------------------------------------------------------------------
  476. typedef struct _D3DXTRACK_DESC
  477. {
  478. D3DXPRIORITY_TYPE Priority;
  479. FLOAT Weight;
  480. FLOAT Speed;
  481. DOUBLE Position;
  482. BOOL Enable;
  483. } D3DXTRACK_DESC, *LPD3DXTRACK_DESC;
  484. //----------------------------------------------------------------------------
  485. // D3DXEVENT_TYPE:
  486. // ---------------
  487. // This enum defines the type of events keyable via the animation controller.
  488. //----------------------------------------------------------------------------
  489. typedef enum _D3DXEVENT_TYPE
  490. {
  491. D3DXEVENT_TRACKSPEED = 0,
  492. D3DXEVENT_TRACKWEIGHT = 1,
  493. D3DXEVENT_TRACKPOSITION = 2,
  494. D3DXEVENT_TRACKENABLE = 3,
  495. D3DXEVENT_PRIORITYBLEND = 4,
  496. D3DXEVENT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
  497. } D3DXEVENT_TYPE;
  498. //----------------------------------------------------------------------------
  499. // D3DXTRANSITION_TYPE:
  500. // --------------------
  501. // This enum defines the type of transtion performed on a event that
  502. // transitions from one value to another.
  503. //----------------------------------------------------------------------------
  504. typedef enum _D3DXTRANSITION_TYPE {
  505. D3DXTRANSITION_LINEAR = 0x000, // Linear transition from one value to the next
  506. D3DXTRANSITION_EASEINEASEOUT = 0x001, // Ease-In Ease-Out spline transtion from one value to the next
  507. D3DXTRANSITION_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
  508. } D3DXTRANSITION_TYPE;
  509. //----------------------------------------------------------------------------
  510. // D3DXEVENT_DESC:
  511. // ---------------
  512. // This structure describes a animation controller event.
  513. // It gives the event's type, track (if the event is a track event), global
  514. // start time, duration, transition method, and target value.
  515. //----------------------------------------------------------------------------
  516. typedef struct _D3DXEVENT_DESC
  517. {
  518. D3DXEVENT_TYPE Type;
  519. UINT Track;
  520. DOUBLE StartTime;
  521. DOUBLE Duration;
  522. D3DXTRANSITION_TYPE Transition;
  523. union
  524. {
  525. FLOAT Weight;
  526. FLOAT Speed;
  527. DOUBLE Position;
  528. BOOL Enable;
  529. };
  530. } D3DXEVENT_DESC, *LPD3DXEVENT_DESC;
  531. //----------------------------------------------------------------------------
  532. // D3DXEVENTHANDLE:
  533. // ----------------
  534. // Handle values used to efficiently reference animation controller events.
  535. //----------------------------------------------------------------------------
  536. typedef DWORD D3DXEVENTHANDLE;
  537. typedef D3DXEVENTHANDLE *LPD3DXEVENTHANDLE;
  538. //----------------------------------------------------------------------------
  539. // ID3DXAnimationCallbackHandler:
  540. // ------------------------------
  541. // This interface is intended to be implemented by the application, and can
  542. // be used to handle callbacks in animation sets generated when
  543. // ID3DXAnimationController::AdvanceTime() is called.
  544. //----------------------------------------------------------------------------
  545. typedef interface ID3DXAnimationCallbackHandler ID3DXAnimationCallbackHandler;
  546. typedef interface ID3DXAnimationCallbackHandler *LPD3DXANIMATIONCALLBACKHANDLER;
  547. #undef INTERFACE
  548. #define INTERFACE ID3DXAnimationCallbackHandler
  549. DECLARE_INTERFACE(ID3DXAnimationCallbackHandler)
  550. {
  551. //----------------------------------------------------------------------------
  552. // ID3DXAnimationCallbackHandler::HandleCallback:
  553. // ----------------------------------------------
  554. // This method gets called when a callback occurs for an animation set in one
  555. // of the tracks during the ID3DXAnimationController::AdvanceTime() call.
  556. //
  557. // Parameters:
  558. // Track
  559. // Index of the track on which the callback occured.
  560. // pCallbackData
  561. // Pointer to user owned callback data.
  562. //
  563. //----------------------------------------------------------------------------
  564. STDMETHOD(HandleCallback)(THIS_ UINT Track, LPVOID pCallbackData) PURE;
  565. };
  566. //----------------------------------------------------------------------------
  567. // ID3DXAnimationController:
  568. // -------------------------
  569. // This interface implements the main animation functionality. It connects
  570. // animation sets with the transform frames that are being animated. Allows
  571. // mixing multiple animations for blended animations or for transistions
  572. // It adds also has methods to modify blending parameters over time to
  573. // enable smooth transistions and other effects.
  574. //----------------------------------------------------------------------------
  575. typedef interface ID3DXAnimationController ID3DXAnimationController;
  576. typedef interface ID3DXAnimationController *LPD3DXANIMATIONCONTROLLER;
  577. #undef INTERFACE
  578. #define INTERFACE ID3DXAnimationController
  579. DECLARE_INTERFACE_(ID3DXAnimationController, IUnknown)
  580. {
  581. // IUnknown
  582. STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
  583. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  584. STDMETHOD_(ULONG, Release)(THIS) PURE;
  585. // Max sizes
  586. STDMETHOD_(UINT, GetMaxNumAnimationOutputs)(THIS) PURE;
  587. STDMETHOD_(UINT, GetMaxNumAnimationSets)(THIS) PURE;
  588. STDMETHOD_(UINT, GetMaxNumTracks)(THIS) PURE;
  589. STDMETHOD_(UINT, GetMaxNumEvents)(THIS) PURE;
  590. // Animation output registration
  591. STDMETHOD(RegisterAnimationOutput)(THIS_
  592. LPCSTR pName,
  593. D3DXMATRIX *pMatrix,
  594. D3DXVECTOR3 *pScale,
  595. D3DXQUATERNION *pRotation,
  596. D3DXVECTOR3 *pTranslation) PURE;
  597. // Animation set registration
  598. STDMETHOD(RegisterAnimationSet)(THIS_ LPD3DXANIMATIONSET pAnimSet) PURE;
  599. STDMETHOD(UnregisterAnimationSet)(THIS_ LPD3DXANIMATIONSET pAnimSet) PURE;
  600. STDMETHOD_(UINT, GetNumAnimationSets)(THIS) PURE;
  601. STDMETHOD(GetAnimationSet)(THIS_ UINT Index, LPD3DXANIMATIONSET *ppAnimationSet) PURE;
  602. STDMETHOD(GetAnimationSetByName)(THIS_ LPCSTR szName, LPD3DXANIMATIONSET *ppAnimationSet) PURE;
  603. // Global time
  604. STDMETHOD(AdvanceTime)(THIS_ DOUBLE TimeDelta, LPD3DXANIMATIONCALLBACKHANDLER pCallbackHandler) PURE;
  605. STDMETHOD(ResetTime)(THIS) PURE;
  606. STDMETHOD_(DOUBLE, GetTime)(THIS) PURE;
  607. // Tracks
  608. STDMETHOD(SetTrackAnimationSet)(THIS_ UINT Track, LPD3DXANIMATIONSET pAnimSet) PURE;
  609. STDMETHOD(GetTrackAnimationSet)(THIS_ UINT Track, LPD3DXANIMATIONSET *ppAnimSet) PURE;
  610. STDMETHOD(SetTrackPriority)(THIS_ UINT Track, D3DXPRIORITY_TYPE Priority) PURE;
  611. STDMETHOD(SetTrackSpeed)(THIS_ UINT Track, FLOAT Speed) PURE;
  612. STDMETHOD(SetTrackWeight)(THIS_ UINT Track, FLOAT Weight) PURE;
  613. STDMETHOD(SetTrackPosition)(THIS_ UINT Track, DOUBLE Position) PURE;
  614. STDMETHOD(SetTrackEnable)(THIS_ UINT Track, BOOL Enable) PURE;
  615. STDMETHOD(SetTrackDesc)(THIS_ UINT Track, LPD3DXTRACK_DESC pDesc) PURE;
  616. STDMETHOD(GetTrackDesc)(THIS_ UINT Track, LPD3DXTRACK_DESC pDesc) PURE;
  617. // Priority blending
  618. STDMETHOD(SetPriorityBlend)(THIS_ FLOAT BlendWeight) PURE;
  619. STDMETHOD_(FLOAT, GetPriorityBlend)(THIS) PURE;
  620. // Event keying
  621. STDMETHOD_(D3DXEVENTHANDLE, KeyTrackSpeed)(THIS_ UINT Track, FLOAT NewSpeed, DOUBLE StartTime, DOUBLE Duration, D3DXTRANSITION_TYPE Transition) PURE;
  622. STDMETHOD_(D3DXEVENTHANDLE, KeyTrackWeight)(THIS_ UINT Track, FLOAT NewWeight, DOUBLE StartTime, DOUBLE Duration, D3DXTRANSITION_TYPE Transition) PURE;
  623. STDMETHOD_(D3DXEVENTHANDLE, KeyTrackPosition)(THIS_ UINT Track, DOUBLE NewPosition, DOUBLE StartTime) PURE;
  624. STDMETHOD_(D3DXEVENTHANDLE, KeyTrackEnable)(THIS_ UINT Track, BOOL NewEnable, DOUBLE StartTime) PURE;
  625. STDMETHOD_(D3DXEVENTHANDLE, KeyPriorityBlend)(THIS_ FLOAT NewBlendWeight, DOUBLE StartTime, DOUBLE Duration, D3DXTRANSITION_TYPE Transition) PURE;
  626. // Event unkeying
  627. STDMETHOD(UnkeyEvent)(THIS_ D3DXEVENTHANDLE hEvent) PURE;
  628. STDMETHOD(UnkeyAllTrackEvents)(THIS_ UINT Track) PURE;
  629. STDMETHOD(UnkeyAllPriorityBlends)(THIS) PURE;
  630. // Event enumeration
  631. STDMETHOD_(D3DXEVENTHANDLE, GetCurrentTrackEvent)(THIS_ UINT Track, D3DXEVENT_TYPE EventType) PURE;
  632. STDMETHOD_(D3DXEVENTHANDLE, GetCurrentPriorityBlend)(THIS) PURE;
  633. STDMETHOD_(D3DXEVENTHANDLE, GetUpcomingTrackEvent)(THIS_ UINT Track, D3DXEVENTHANDLE hEvent) PURE;
  634. STDMETHOD_(D3DXEVENTHANDLE, GetUpcomingPriorityBlend)(THIS_ D3DXEVENTHANDLE hEvent) PURE;
  635. STDMETHOD(ValidateEvent)(THIS_ D3DXEVENTHANDLE hEvent) PURE;
  636. STDMETHOD(GetEventDesc)(THIS_ D3DXEVENTHANDLE hEvent, LPD3DXEVENT_DESC pDesc) PURE;
  637. // Cloning
  638. STDMETHOD(CloneAnimationController)(THIS_
  639. UINT MaxNumAnimationOutputs,
  640. UINT MaxNumAnimationSets,
  641. UINT MaxNumTracks,
  642. UINT MaxNumEvents,
  643. LPD3DXANIMATIONCONTROLLER *ppAnimController) PURE;
  644. };
  645. #ifdef __cplusplus
  646. extern "C" {
  647. #endif //__cplusplus
  648. //----------------------------------------------------------------------------
  649. // D3DXLoadMeshHierarchyFromX:
  650. // ---------------------------
  651. // Loads the first frame hierarchy in a .X file.
  652. //
  653. // Parameters:
  654. // Filename
  655. // Name of the .X file
  656. // MeshOptions
  657. // Mesh creation options for meshes in the file (see d3dx9mesh.h)
  658. // pD3DDevice
  659. // D3D9 device on which meshes in the file are created in
  660. // pAlloc
  661. // Allocation interface used to allocate nodes of the frame hierarchy
  662. // pUserDataLoader
  663. // Application provided interface to allow loading of user data
  664. // ppFrameHierarchy
  665. // Returns root node pointer of the loaded frame hierarchy
  666. // ppAnimController
  667. // Returns pointer to an animation controller corresponding to animation
  668. // in the .X file. This is created with default max tracks and events
  669. //
  670. //----------------------------------------------------------------------------
  671. HRESULT WINAPI
  672. D3DXLoadMeshHierarchyFromXA
  673. (
  674. LPCSTR Filename,
  675. DWORD MeshOptions,
  676. LPDIRECT3DDEVICE9 pD3DDevice,
  677. LPD3DXALLOCATEHIERARCHY pAlloc,
  678. LPD3DXLOADUSERDATA pUserDataLoader,
  679. LPD3DXFRAME *ppFrameHierarchy,
  680. LPD3DXANIMATIONCONTROLLER *ppAnimController
  681. );
  682. HRESULT WINAPI
  683. D3DXLoadMeshHierarchyFromXW
  684. (
  685. LPCWSTR Filename,
  686. DWORD MeshOptions,
  687. LPDIRECT3DDEVICE9 pD3DDevice,
  688. LPD3DXALLOCATEHIERARCHY pAlloc,
  689. LPD3DXLOADUSERDATA pUserDataLoader,
  690. LPD3DXFRAME *ppFrameHierarchy,
  691. LPD3DXANIMATIONCONTROLLER *ppAnimController
  692. );
  693. #ifdef UNICODE
  694. #define D3DXLoadMeshHierarchyFromX D3DXLoadMeshHierarchyFromXW
  695. #else
  696. #define D3DXLoadMeshHierarchyFromX D3DXLoadMeshHierarchyFromXA
  697. #endif
  698. HRESULT WINAPI
  699. D3DXLoadMeshHierarchyFromXInMemory
  700. (
  701. LPCVOID Memory,
  702. DWORD SizeOfMemory,
  703. DWORD MeshOptions,
  704. LPDIRECT3DDEVICE9 pD3DDevice,
  705. LPD3DXALLOCATEHIERARCHY pAlloc,
  706. LPD3DXLOADUSERDATA pUserDataLoader,
  707. LPD3DXFRAME *ppFrameHierarchy,
  708. LPD3DXANIMATIONCONTROLLER *ppAnimController
  709. );
  710. //----------------------------------------------------------------------------
  711. // D3DXSaveMeshHierarchyToFile:
  712. // ----------------------------
  713. // Creates a .X file and saves the mesh hierarchy and corresponding animations
  714. // in it
  715. //
  716. // Parameters:
  717. // Filename
  718. // Name of the .X file
  719. // XFormat
  720. // Format of the .X file (text or binary, compressed or not, etc)
  721. // pFrameRoot
  722. // Root node of the hierarchy to be saved
  723. // pAnimController
  724. // The animation controller whose animation sets are to be stored
  725. // pUserDataSaver
  726. // Application provided interface to allow adding of user data to
  727. // data objects saved to .X file
  728. //
  729. //----------------------------------------------------------------------------
  730. HRESULT WINAPI
  731. D3DXSaveMeshHierarchyToFileA
  732. (
  733. LPCSTR Filename,
  734. DWORD XFormat,
  735. CONST D3DXFRAME *pFrameRoot,
  736. LPD3DXANIMATIONCONTROLLER pAnimcontroller,
  737. LPD3DXSAVEUSERDATA pUserDataSaver
  738. );
  739. HRESULT WINAPI
  740. D3DXSaveMeshHierarchyToFileW
  741. (
  742. LPCWSTR Filename,
  743. DWORD XFormat,
  744. CONST D3DXFRAME *pFrameRoot,
  745. LPD3DXANIMATIONCONTROLLER pAnimController,
  746. LPD3DXSAVEUSERDATA pUserDataSaver
  747. );
  748. #ifdef UNICODE
  749. #define D3DXSaveMeshHierarchyToFile D3DXSaveMeshHierarchyToFileW
  750. #else
  751. #define D3DXSaveMeshHierarchyToFile D3DXSaveMeshHierarchyToFileA
  752. #endif
  753. //----------------------------------------------------------------------------
  754. // D3DXFrameDestroy:
  755. // -----------------
  756. // Destroys the subtree of frames under the root, including the root
  757. //
  758. // Parameters:
  759. // pFrameRoot
  760. // Pointer to the root node
  761. // pAlloc
  762. // Allocation interface used to de-allocate nodes of the frame hierarchy
  763. //
  764. //----------------------------------------------------------------------------
  765. HRESULT WINAPI
  766. D3DXFrameDestroy
  767. (
  768. LPD3DXFRAME pFrameRoot,
  769. LPD3DXALLOCATEHIERARCHY pAlloc
  770. );
  771. //----------------------------------------------------------------------------
  772. // D3DXFrameAppendChild:
  773. // ---------------------
  774. // Add a child frame to a frame
  775. //
  776. // Parameters:
  777. // pFrameParent
  778. // Pointer to the parent node
  779. // pFrameChild
  780. // Pointer to the child node
  781. //
  782. //----------------------------------------------------------------------------
  783. HRESULT WINAPI
  784. D3DXFrameAppendChild
  785. (
  786. LPD3DXFRAME pFrameParent,
  787. CONST D3DXFRAME *pFrameChild
  788. );
  789. //----------------------------------------------------------------------------
  790. // D3DXFrameFind:
  791. // --------------
  792. // Finds a frame with the given name. Returns NULL if no frame found.
  793. //
  794. // Parameters:
  795. // pFrameRoot
  796. // Pointer to the root node
  797. // Name
  798. // Name of frame to find
  799. //
  800. //----------------------------------------------------------------------------
  801. LPD3DXFRAME WINAPI
  802. D3DXFrameFind
  803. (
  804. CONST D3DXFRAME *pFrameRoot,
  805. LPCSTR Name
  806. );
  807. //----------------------------------------------------------------------------
  808. // D3DXFrameRegisterNamedMatrices:
  809. // -------------------------------
  810. // Finds all frames that have non-null names and registers each of those frame
  811. // matrices to the given animation controller
  812. //
  813. // Parameters:
  814. // pFrameRoot
  815. // Pointer to the root node
  816. // pAnimController
  817. // Pointer to the animation controller where the matrices are registered
  818. //
  819. //----------------------------------------------------------------------------
  820. HRESULT WINAPI
  821. D3DXFrameRegisterNamedMatrices
  822. (
  823. LPD3DXFRAME pFrameRoot,
  824. LPD3DXANIMATIONCONTROLLER pAnimController
  825. );
  826. //----------------------------------------------------------------------------
  827. // D3DXFrameNumNamedMatrices:
  828. // --------------------------
  829. // Counts number of frames in a subtree that have non-null names
  830. //
  831. // Parameters:
  832. // pFrameRoot
  833. // Pointer to the root node of the subtree
  834. // Return Value:
  835. // Count of frames
  836. //
  837. //----------------------------------------------------------------------------
  838. UINT WINAPI
  839. D3DXFrameNumNamedMatrices
  840. (
  841. CONST D3DXFRAME *pFrameRoot
  842. );
  843. //----------------------------------------------------------------------------
  844. // D3DXFrameCalculateBoundingSphere:
  845. // ---------------------------------
  846. // Computes the bounding sphere of all the meshes in the frame hierarchy.
  847. //
  848. // Parameters:
  849. // pFrameRoot
  850. // Pointer to the root node
  851. // pObjectCenter
  852. // Returns the center of the bounding sphere
  853. // pObjectRadius
  854. // Returns the radius of the bounding sphere
  855. //
  856. //----------------------------------------------------------------------------
  857. HRESULT WINAPI
  858. D3DXFrameCalculateBoundingSphere
  859. (
  860. CONST D3DXFRAME *pFrameRoot,
  861. LPD3DXVECTOR3 pObjectCenter,
  862. FLOAT *pObjectRadius
  863. );
  864. //----------------------------------------------------------------------------
  865. // D3DXCreateKeyframedAnimationSet:
  866. // --------------------------------
  867. // This function creates a compressable keyframed animations set interface.
  868. //
  869. // Parameters:
  870. // pName
  871. // Name of the animation set
  872. // TicksPerSecond
  873. // Number of keyframe ticks that elapse per second
  874. // Playback
  875. // Playback mode of keyframe looping
  876. // NumAnimations
  877. // Number of SRT animations
  878. // NumCallbackKeys
  879. // Number of callback keys
  880. // pCallbackKeys
  881. // Array of callback keys
  882. // ppAnimationSet
  883. // Returns the animation set interface
  884. //
  885. //-----------------------------------------------------------------------------
  886. HRESULT WINAPI
  887. D3DXCreateKeyframedAnimationSet
  888. (
  889. LPCSTR pName,
  890. DOUBLE TicksPerSecond,
  891. D3DXPLAYBACK_TYPE Playback,
  892. UINT NumAnimations,
  893. UINT NumCallbackKeys,
  894. CONST D3DXKEY_CALLBACK *pCallbackKeys,
  895. LPD3DXKEYFRAMEDANIMATIONSET *ppAnimationSet
  896. );
  897. //----------------------------------------------------------------------------
  898. // D3DXCreateCompressedAnimationSet:
  899. // --------------------------------
  900. // This function creates a compressed animations set interface from
  901. // compressed data.
  902. //
  903. // Parameters:
  904. // pName
  905. // Name of the animation set
  906. // TicksPerSecond
  907. // Number of keyframe ticks that elapse per second
  908. // Playback
  909. // Playback mode of keyframe looping
  910. // pCompressedData
  911. // Compressed animation SRT data
  912. // NumCallbackKeys
  913. // Number of callback keys
  914. // pCallbackKeys
  915. // Array of callback keys
  916. // ppAnimationSet
  917. // Returns the animation set interface
  918. //
  919. //-----------------------------------------------------------------------------
  920. HRESULT WINAPI
  921. D3DXCreateCompressedAnimationSet
  922. (
  923. LPCSTR pName,
  924. DOUBLE TicksPerSecond,
  925. D3DXPLAYBACK_TYPE Playback,
  926. LPD3DXBUFFER pCompressedData,
  927. UINT NumCallbackKeys,
  928. CONST D3DXKEY_CALLBACK *pCallbackKeys,
  929. LPD3DXCOMPRESSEDANIMATIONSET *ppAnimationSet
  930. );
  931. //----------------------------------------------------------------------------
  932. // D3DXCreateAnimationController:
  933. // ------------------------------
  934. // This function creates an animation controller object.
  935. //
  936. // Parameters:
  937. // MaxNumMatrices
  938. // Maximum number of matrices that can be animated
  939. // MaxNumAnimationSets
  940. // Maximum number of animation sets that can be played
  941. // MaxNumTracks
  942. // Maximum number of animation sets that can be blended
  943. // MaxNumEvents
  944. // Maximum number of outstanding events that can be scheduled at any given time
  945. // ppAnimController
  946. // Returns the animation controller interface
  947. //
  948. //-----------------------------------------------------------------------------
  949. HRESULT WINAPI
  950. D3DXCreateAnimationController
  951. (
  952. UINT MaxNumMatrices,
  953. UINT MaxNumAnimationSets,
  954. UINT MaxNumTracks,
  955. UINT MaxNumEvents,
  956. LPD3DXANIMATIONCONTROLLER *ppAnimController
  957. );
  958. #ifdef __cplusplus
  959. }
  960. #endif //__cplusplus
  961. #endif //__D3DX9ANIM_H__