ID3DXAnimationSet Interface

 

 

' ****************************************************************************************
' ID3DXAnimationSet interface
' $IID_ID3DXAnimationSet = GUID$("{698CFB3F-9289-4d95-9A57-33A94B5A65F9}")
' ****************************************************************************************

' ****************************************************************************************
' This interface encapsulates the minimum functionality required of an animation set by an
' animation controller. Advanced users might want to implement this interface themselves to
' suit their specialized needs; for most users, however, the derived ID3DXCompressedAnimationSet
' and ID3DXAnimationSet interfaces should suffice.
' Remarks
'    An animation set consists of animations for many nodes for the same animation.
' Interface Information
'    Stock Implementation   d3d9.dll
'    Custom Implementation  No
'    Inherits from  IUnknown
'    Header     d3dx9anim.h
'    Import library     d3dx9.lib
'    Minimum operating systems  Windows 98
' ****************************************************************************************

' ****************************************************************************************
'DECLARE_INTERFACE_(ID3DXAnimationSet, IUnknown)
'{
'    // IUnknown
'  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
'};
' ****************************************************************************************

' ****************************************************************************************
' GetName method
' Gets the animation set name.
' LPCSTR GetName(VOID);
' ****************************************************************************************
FUNCTION ID3DXAnimationSet_GetName ALIAS "ID3DXAnimationSet_GetName" (BYVAL pthis AS DWORD PTR) EXPORT AS DWORD

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

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

' ****************************************************************************************
' GetPeriod method
' Gets the period of the animation set.
' DOUBLE GetPeriod(VOID);
' ****************************************************************************************
FUNCTION ID3DXAnimationSet_GetPeriod ALIAS "ID3DXAnimationSet_GetPeriod" (BYVAL pthis AS DWORD PTR) EXPORT AS DOUBLE

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

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

' ****************************************************************************************
' GetPeriodicPosition method
' Returns time position in the local timeframe of an animation set.
' DOUBLE GetPeriodicPosition(
'    DOUBLE Position
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationSet_GetPeriodicPosition ALIAS "ID3DXAnimationSet_GetPeriodicPosition" (BYVAL pthis AS DWORD PTR) EXPORT AS DOUBLE

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

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

' ****************************************************************************************
' GetNumANimations method
' Gets the number of animations in the animation set.
' UINT GetNumAnimations(VOID);
' ****************************************************************************************
FUNCTION ID3DXAnimationSet_GetNumAnimations ALIAS "ID3DXAnimationSet_GetNumAnimations" (BYVAL pthis AS DWORD PTR) EXPORT AS DWORD

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

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

' ****************************************************************************************
' GetAnimationNameByIndex method
' Gets the name of an animation, given its index.
' HRESULT GetAnimationNameByIndex(
'    UINT Index,
'    LPCSTR *ppName
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationSet_GetAnimationNameByIndex ALIAS "ID3DXAnimationSet_GetAnimationNameByIndex" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Index AS DWORD, BYREF ppName AS ASCIIZ) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[7] USING ID3DXAnimationSet_GetAnimationNameByIndex(pthis, Index, ppName) TO HRESULT
    FUNCTION = HRESULT

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

' ****************************************************************************************
' GetAnimationIndexByName method
' Gets the index of an animation, given its name.
' HRESULT GetAnimationIndexByName(
'    LPCSTR pName,
'    UINT *pIndex
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationSet_GetAnimationIndexByName ALIAS "ID3DXAnimationSet_GetAnimationIndexByName" ( _
    BYVAL pthis AS DWORD PTR, BYREF pName AS ASCIIZ, BYREF pIndex AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[8] USING ID3DXAnimationSet_GetAnimationIndexByName(pthis, pName, pIndex) TO HRESULT
    FUNCTION = HRESULT

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

' ****************************************************************************************
' GetSRT
' Gets the scale, rotation, and translation values of the animation set.
' HRESULT GetSRT(
'    DOUBLE PeriodicPosition,
'    UINT Animation,
'    D3DXVECTOR3 *pScale,
'    D3DXQUATERNION *pRotation,
'    D3DXVECTOR3 *pTranslation
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationSet_GetSRT ALIAS "ID3DXAnimationSet_GetSRT" ( _
    BYVAL pthis AS DWORD PTR, BYVAL PeriodicPosition AS DOUBLE, BYVAL Animation AS DWORD, _
    BYREF pScale AS D3DXVECTOR3, BYREF pRotation AS D3DXVECTOR3, _
    BYREF pTranslation AS D3DXVECTOR3) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[9] USING ID3DXAnimationSet_GetSRT(pthis, PeriodicPosition, Animation, pScale, pRotation, pTranslation) TO HRESULT
    FUNCTION = HRESULT

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

' ****************************************************************************************
' GetCallback
' Gets information about a specific callback in the animation set.
' HRESULT GetCallback(
'    DOUBLE Position,
'    DWORD Flags,
'    DOUBLE *pCallbackPosition,
'    LPVOID *ppCallbackData
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationSet_GetCallback ALIAS "ID3DXAnimationSet_GetCallback" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Position AS DOUBLE, BYVAL Flags AS DWORD, _
    BYREF pCallbackPosition AS DOUBLE, BYREF ppCallbackData AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[10] USING ID3DXAnimationSet_GetCallback(pthis, Position, Flags, pCallbackPosition, ppCallbackData) TO HRESULT
    FUNCTION = HRESULT

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

 

Page last updated on Tuesday, 14 March 2006 23:57:46 +0100