📄 d3dx9anim.h
字号:
// in the .X file. This is created with default max tracks and events
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXLoadMeshHierarchyFromXA(
LPCSTR Filename,
DWORD MeshOptions,
LPDIRECT3DDEVICE9 pD3DDevice,
LPD3DXALLOCATEHIERARCHY pAlloc,
LPD3DXLOADUSERDATA pUserDataLoader,
LPD3DXFRAME *ppFrameHierarchy,
LPD3DXANIMATIONCONTROLLER *ppAnimController
);
HRESULT WINAPI
D3DXLoadMeshHierarchyFromXW(
LPCWSTR Filename,
DWORD MeshOptions,
LPDIRECT3DDEVICE9 pD3DDevice,
LPD3DXALLOCATEHIERARCHY pAlloc,
LPD3DXLOADUSERDATA pUserDataLoader,
LPD3DXFRAME *ppFrameHierarchy,
LPD3DXANIMATIONCONTROLLER *ppAnimController
);
#ifdef UNICODE
#define D3DXLoadMeshHierarchyFromX D3DXLoadMeshHierarchyFromXW
#else
#define D3DXLoadMeshHierarchyFromX D3DXLoadMeshHierarchyFromXA
#endif
HRESULT WINAPI
D3DXLoadMeshHierarchyFromXInMemory(
LPCVOID Memory,
DWORD SizeOfMemory,
DWORD MeshOptions,
LPDIRECT3DDEVICE9 pD3DDevice,
LPD3DXALLOCATEHIERARCHY pAlloc,
LPD3DXLOADUSERDATA pUserDataLoader,
LPD3DXFRAME *ppFrameHierarchy,
LPD3DXANIMATIONCONTROLLER *ppAnimController
);
//----------------------------------------------------------------------------
// D3DXSaveMeshHierarchyToFile:
// ---------------------------
// Creates a .X file and saves the mesh hierarchy and corresponding animations
// in it
//
// Parameters:
// Filename
// Name of the .X file
// XFormat
// Format of the .X file (text or binary, compressed or not, etc)
// pFrameRoot
// Root node of the hierarchy to be saved
// pAnimController
// The animation mixer whose animation sets are to be stored
// pUserDataSaver
// Application provided interface to allow adding of user data to
// data objects saved to .X file
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXSaveMeshHierarchyToFileA(
LPCSTR Filename,
DWORD XFormat,
LPD3DXFRAME pFrameRoot,
LPD3DXANIMATIONCONTROLLER pAnimMixer,
LPD3DXSAVEUSERDATA pUserDataSaver
);
HRESULT WINAPI
D3DXSaveMeshHierarchyToFileW(
LPCWSTR Filename,
DWORD XFormat,
LPD3DXFRAME pFrameRoot,
LPD3DXANIMATIONCONTROLLER pAnimMixer,
LPD3DXSAVEUSERDATA pUserDataSaver
);
#ifdef UNICODE
#define D3DXSaveMeshHierarchyToFile D3DXSaveMeshHierarchyToFileW
#else
#define D3DXSaveMeshHierarchyToFile D3DXSaveMeshHierarchyToFileA
#endif
//----------------------------------------------------------------------------
// D3DXFrameDestroy:
// -----------------
// Destroys the subtree of frames under the root, including the root
//
// Parameters:
// pFrameRoot
// Pointer to the root node
// pAlloc
// Allocation interface used to de-allocate nodes of the frame hierarchy
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXFrameDestroy(
LPD3DXFRAME pFrameRoot,
LPD3DXALLOCATEHIERARCHY pAlloc
);
//----------------------------------------------------------------------------
// D3DXFrameAppendChild:
// ---------------------
// Add a child frame to a frame
//
// Parameters:
// pFrameParent
// Pointer to the parent node
// pFrameChild
// Pointer to the child node
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXFrameAppendChild(
LPD3DXFRAME pFrameParent,
LPD3DXFRAME pFrameChild
);
//----------------------------------------------------------------------------
// D3DXFrameFind:
// --------------
// Finds a frame with the given name. Returns NULL if no frame found.
//
// Parameters:
// pFrameRoot
// Pointer to the root node
// Name
// Name of frame to find
//
//----------------------------------------------------------------------------
LPD3DXFRAME WINAPI
D3DXFrameFind(
LPD3DXFRAME pFrameRoot,
LPCSTR Name
);
//----------------------------------------------------------------------------
// D3DXFrameRegisterNamedMatrices:
// --------------------------
// Finds all frames that have non-null names and registers each of those frame
// matrices to the given animation mixer
//
// Parameters:
// pFrameRoot
// Pointer to the root node
// pAnimMixer
// Pointer to the animation mixer where the matrices are registered
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXFrameRegisterNamedMatrices(
LPD3DXFRAME pFrameRoot,
LPD3DXANIMATIONCONTROLLER pAnimMixer
);
//----------------------------------------------------------------------------
// D3DXFrameNumNamedMatrices:
// --------------------------
// Counts number of frames in a subtree that have non-null names
//
// Parameters:
// pFrameRoot
// Pointer to the root node of the subtree
// Return Value:
// Count of frames
//
//----------------------------------------------------------------------------
UINT WINAPI
D3DXFrameNumNamedMatrices(
LPD3DXFRAME pFrameRoot
);
//----------------------------------------------------------------------------
// D3DXFrameCalculateBoundingSphere:
// ---------------------------------
// Computes the bounding sphere of all the meshes in the frame hierarchy
//
// Parameters:
// pFrameRoot
// Pointer to the root node
// pObjectCenter
// Returns the center of the bounding sphere
// pObjectRadius
// Returns the radius of the bounding sphere
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXFrameCalculateBoundingSphere(
LPD3DXFRAME pFrameRoot,
LPD3DXVECTOR3 pObjectCenter,
FLOAT *pObjectRadius
);
#ifdef __cplusplus
}
#endif //__cplusplus
#undef INTERFACE
#define INTERFACE ID3DXInterpolator
//----------------------------------------------------------------------------
// This interface defines a SRT (scale/rotate/translate) interpolator. This
// is an abstract interface. ID3DXKeyFrameInterpolator inherits from this.
// An application can implement this for custom SRT interpolator
//----------------------------------------------------------------------------
//////////////////////////////////////////////////////////////////////////////
// ID3DXInterpolator /////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
DECLARE_INTERFACE_(ID3DXInterpolator, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXInterpolator
STDMETHOD_(LPCSTR, GetName)(THIS) PURE;
STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE;
//----------------------------------------------------------------------------
// GetSRT:
// -------
// Returns the scale, rotation and translation at a given time
//
// Parameters:
// Time
// Time at which the interpolator should be queried
// pScale
// Returns the scale vector
// pRotate
// Returns the rotation qaternion
// pTranslate
// Returns the translate vector
//
//----------------------------------------------------------------------------
STDMETHOD(GetSRT)(THIS_ DOUBLE Time, D3DXVECTOR3 *pScale, D3DXQUATERNION *pRotate, D3DXVECTOR3 *pTranslate) PURE;
STDMETHOD(GetLastSRT)(THIS_ D3DXVECTOR3 *pScale, D3DXQUATERNION *pRotate, D3DXVECTOR3 *pTranslate) PURE;
};
//----------------------------------------------------------------------------
// This structure describes a vector key for use in keyframe animation.
// It specifies a vector Value at a given Time. This is used for scale and
// translation keys
//----------------------------------------------------------------------------
typedef struct _D3DXKEY_VECTOR3
{
FLOAT Time;
D3DXVECTOR3 Value;
} D3DXKEY_VECTOR3, *LPD3DXKEY_VECTOR3;
//----------------------------------------------------------------------------
// This structure describes a quaternion key for use in keyframe animation.
// It specifies a quaternion Value at a given Time. This is used for rotation
// keys
//----------------------------------------------------------------------------
typedef struct _D3DXKEY_QUATERNION
{
FLOAT Time;
D3DXQUATERNION Value;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -