ID3DXCompressedAnimationSet Interface

 

 

' ****************************************************************************************
' ID3DXCompressedAnimationSet interface
' $IID_ID3DXCompressedAnimationSet = GUID$("{FA4E8E3A-9786-407d-8B4C-5995893764AF}")
' ****************************************************************************************

' ****************************************************************************************
' An application uses the methods of this interface to implement a key frame animation set
' stored in a compressed data format.
' ****************************************************************************************

' ****************************************************************************************
'DECLARE_INTERFACE_(ID3DXCompressedAnimationSet, ID3DXAnimationSet)
'{
'    // ID3DXAnimationSet
'  0.  STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
'  1.  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
'  2.  STDMETHOD_(ULONG, Release)(THIS) PURE;

'    // Name
'  3.  STDMETHOD_(LPCSTR, GetName)(THIS) PURE;

'    // Period
'  4.  STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE;
'  5.  STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE Position) PURE;    // Maps position into animation period

'    // Animation names
'  6.  STDMETHOD_(UINT, GetNumAnimations)(THIS) PURE;
'  7.  STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT Index, LPCSTR *ppName) PURE;
'  8.  STDMETHOD(GetAnimationIndexByName)(THIS_ LPCSTR pName, UINT *pIndex) PURE;

'    // SRT
'  9.  STDMETHOD(GetSRT)(THIS_
'        DOUBLE PeriodicPosition,            // Position mapped to period (use GetPeriodicPosition)
'        UINT Animation,                     // Animation index
'        D3DXVECTOR3 *pScale,                // Returns the scale
'        D3DXQUATERNION *pRotation,          // Returns the rotation as a quaternion
'        D3DXVECTOR3 *pTranslation) PURE;    // Returns the translation

'    // Callbacks
' 10.  STDMETHOD(GetCallback)(THIS_
'        DOUBLE Position,                    // Position from which to find callbacks
'        DWORD Flags,                        // Callback search flags
'        DOUBLE *pCallbackPosition,          // Returns the position of the callback
'        LPVOID *ppCallbackData) PURE;       // Returns the callback data pointer

'    // Playback
' 11.  STDMETHOD_(D3DXPLAYBACK_TYPE, GetPlaybackType)(THIS) PURE;
' 12.  STDMETHOD_(DOUBLE, GetSourceTicksPerSecond)(THIS) PURE;

'    // Scale keys
' 14.  STDMETHOD(GetCompressedData)(THIS_ LPD3DXBUFFER *ppCompressedData) PURE;

'    // Callback keys
' 14.  STDMETHOD_(UINT, GetNumCallbackKeys)(THIS) PURE;
' 15.  STDMETHOD(GetCallbackKeys)(THIS_ LPD3DXKEY_CALLBACK pCallbackKeys) PURE;
'};
' ****************************************************************************************

' ****************************************************************************************
' GetPlaybackType
' Gets the type of the animation set playback loop.
' D3DXPLAYBACK_TYPE GetPlaybackType(VOID);
' ****************************************************************************************
FUNCTION ID3DXCompressedAnimationSet_GetPlaybackType ALIAS "ID3DXCompressedAnimationSet_GetPlaybackType" (BYVAL pthis AS DWORD PTR) EXPORT AS DWORD

    LOCAL DWRESULT AS DWORD
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[11] USING ID3DXCompressedAnimationSet_GetPlaybackType(pthis) TO DWRESULT
    FUNCTION = DWRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetSourceTicksPerSecond
' Gets the number of animation key frame ticks that occur per second.
' DOUBLE GetSourceTicksPerSecond(VOID);
' ****************************************************************************************
FUNCTION ID3DXCompressedAnimationSet_GetSourceTicksPerSecond ALIAS "ID3DXCompressedAnimationSet_GetSourceTicksPerSecond" (BYVAL pthis AS DWORD PTR) EXPORT AS DOUBLE

    LOCAL DRESULT AS DOUBLE
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[12] USING ID3DXCompressedAnimationSet_GetSourceTicksPerSecond(pthis) TO DRESULT
    FUNCTION = DRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetCompressedData
' Gets the data buffer that stores compressed key frame animation data.
' HRESULT GetCompressedData(
'    LPD3DXBUFFER *ppCompressedData
' );
' ****************************************************************************************
FUNCTION ID3DXCompressedAnimationSet_GetCompressedData ALIAS "ID3DXCompressedAnimationSet_GetCompressedData" ( _
    BYVAL pthis AS DWORD PTR, BYREF ppCompressedData AS DWORD) EXPORT AS DWORD

    LOCAL DWRESULT AS DWORD
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[13] USING ID3DXCompressedAnimationSet_GetCompressedData(pthis, ppCompressedData) TO DWRESULT
    FUNCTION = DWRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetNumCallbackKeys
' Gets the number of callback keys in the animation set.
' UINT GetNumCallbackKeys(VOID);
' ****************************************************************************************
FUNCTION ID3DXCompressedAnimationSet_GetNumCallbackKeys ALIAS "ID3DXCompressedAnimationSet_GetNumCallbackKeys" (BYVAL pthis AS DWORD PTR) EXPORT AS DWORD

    LOCAL DWRESULT AS LONG
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[14] USING ID3DXCompressedAnimationSet_GetNumCallbackKeys(pthis) TO DWRESULT
    FUNCTION = DWRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetCallbackKeys
' Fills an array with callback key data used for key frame animation.
' HRESULT GetCallbackKeys(
'    LPD3DXKEY_CALLBACK pCallbackKeys
' );
' ****************************************************************************************
FUNCTION ID3DXCompressedAnimationSet_GetCallbackKeys ALIAS "ID3DXCompressedAnimationSet_GetCallbackKeys" ( _
    BYVAL pthis AS DWORD PTR, BYREF pCallbackKeys AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[15] USING ID3DXCompressedAnimationSet_GetCallbackKeys(pthis, pCallbackKeys) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************
 

 

Page last updated on Wednesday, 15 March 2006 00:03:53 +0100