ID3DXAnimationController Interface

 

 

' ****************************************************************************************
' ID3DXAnimationController Interface
' $IID_ID3DXAnimationController = GUID$("{AC8948EC-F86D-43e2-96DE-31FC35F96D9E}")
' ****************************************************************************************

' ****************************************************************************************
' This interface is used to control animation functionality, connecting animation sets with
' the transformation frames that are being animated. The interface has methods to mix multiple
' animations and to modify blending parameters over time to enable smooth transitions and
' other effects.
' Remarks
' Create an animation controller object with D3DXCreateAnimationController.
' 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_(ID3DXAnimationController, IUnknown)
'{
'    // IUnknown
'  0.  STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
'  1.  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
'  2.  STDMETHOD_(ULONG, Release)(THIS) PURE;

'    // Max sizes
'  3.  STDMETHOD_(UINT, GetMaxNumAnimationOutputs)(THIS) PURE;
'  4.  STDMETHOD_(UINT, GetMaxNumAnimationSets)(THIS) PURE;
'  5.  STDMETHOD_(UINT, GetMaxNumTracks)(THIS) PURE;
'  6.  STDMETHOD_(UINT, GetMaxNumEvents)(THIS) PURE;

'    // Animation output registration
'  7.  STDMETHOD(RegisterAnimationOutput)(THIS_
'        LPCSTR pName,
'        D3DXMATRIX *pMatrix,
'        D3DXVECTOR3 *pScale,
'        D3DXQUATERNION *pRotation,
'        D3DXVECTOR3 *pTranslation) PURE;

'    // Animation set registration
'  8.  STDMETHOD(RegisterAnimationSet)(THIS_ LPD3DXANIMATIONSET pAnimSet) PURE;
'  9.  STDMETHOD(UnregisterAnimationSet)(THIS_ LPD3DXANIMATIONSET pAnimSet) PURE;

' 10.  STDMETHOD_(UINT, GetNumAnimationSets)(THIS) PURE;
' 11.  STDMETHOD(GetAnimationSet)(THIS_ UINT Index, LPD3DXANIMATIONSET *ppAnimationSet) PURE;
' 12.  STDMETHOD(GetAnimationSetByName)(THIS_ LPCSTR szName, LPD3DXANIMATIONSET *ppAnimationSet) PURE;

'    // Global time
' 13.  STDMETHOD(AdvanceTime)(THIS_ DOUBLE TimeDelta, LPD3DXANIMATIONCALLBACKHANDLER pCallbackHandler) PURE;
' 14.  STDMETHOD(ResetTime)(THIS) PURE;
' 15.  STDMETHOD_(DOUBLE, GetTime)(THIS) PURE;

'    // Tracks
' 16.  STDMETHOD(SetTrackAnimationSet)(THIS_ UINT Track, LPD3DXANIMATIONSET pAnimSet) PURE;
' 17.  STDMETHOD(GetTrackAnimationSet)(THIS_ UINT Track, LPD3DXANIMATIONSET *ppAnimSet) PURE;

' 18.  STDMETHOD(SetTrackPriority)(THIS_ UINT Track, D3DXPRIORITY_TYPE Priority) PURE;

' 19.  STDMETHOD(SetTrackSpeed)(THIS_ UINT Track, FLOAT Speed) PURE;
' 20.  STDMETHOD(SetTrackWeight)(THIS_ UINT Track, FLOAT Weight) PURE;
' 21.  STDMETHOD(SetTrackPosition)(THIS_ UINT Track, DOUBLE Position) PURE;
' 22.  STDMETHOD(SetTrackEnable)(THIS_ UINT Track, BOOL Enable) PURE;

' 23.  STDMETHOD(SetTrackDesc)(THIS_ UINT Track, LPD3DXTRACK_DESC pDesc) PURE;
' 24.  STDMETHOD(GetTrackDesc)(THIS_ UINT Track, LPD3DXTRACK_DESC pDesc) PURE;

'    // Priority blending
' 25.  STDMETHOD(SetPriorityBlend)(THIS_ FLOAT BlendWeight) PURE;
' 26.  STDMETHOD_(FLOAT, GetPriorityBlend)(THIS) PURE;

'    // Event keying
' 27.  STDMETHOD_(D3DXEVENTHANDLE, KeyTrackSpeed)(THIS_ UINT Track, FLOAT NewSpeed, DOUBLE StartTime, DOUBLE Duration, D3DXTRANSITION_TYPE Transition) PURE;
' 28.  STDMETHOD_(D3DXEVENTHANDLE, KeyTrackWeight)(THIS_ UINT Track, FLOAT NewWeight, DOUBLE StartTime, DOUBLE Duration, D3DXTRANSITION_TYPE Transition) PURE;
' 29.  STDMETHOD_(D3DXEVENTHANDLE, KeyTrackPosition)(THIS_ UINT Track, DOUBLE NewPosition, DOUBLE StartTime) PURE;
' 30.  STDMETHOD_(D3DXEVENTHANDLE, KeyTrackEnable)(THIS_ UINT Track, BOOL NewEnable, DOUBLE StartTime) PURE;

' 31.  STDMETHOD_(D3DXEVENTHANDLE, KeyPriorityBlend)(THIS_ FLOAT NewBlendWeight, DOUBLE StartTime, DOUBLE Duration, D3DXTRANSITION_TYPE Transition) PURE;

'    // Event unkeying
' 32.  STDMETHOD(UnkeyEvent)(THIS_ D3DXEVENTHANDLE hEvent) PURE;

' 33.  STDMETHOD(UnkeyAllTrackEvents)(THIS_ UINT Track) PURE;
' 34.  STDMETHOD(UnkeyAllPriorityBlends)(THIS) PURE;

'    // Event enumeration
' 35.  STDMETHOD_(D3DXEVENTHANDLE, GetCurrentTrackEvent)(THIS_ UINT Track, D3DXEVENT_TYPE EventType) PURE;
' 36.  STDMETHOD_(D3DXEVENTHANDLE, GetCurrentPriorityBlend)(THIS) PURE;

' 37.  STDMETHOD_(D3DXEVENTHANDLE, GetUpcomingTrackEvent)(THIS_ UINT Track, D3DXEVENTHANDLE hEvent) PURE;
' 38.  STDMETHOD_(D3DXEVENTHANDLE, GetUpcomingPriorityBlend)(THIS_ D3DXEVENTHANDLE hEvent) PURE;

' 39.  STDMETHOD(ValidateEvent)(THIS_ D3DXEVENTHANDLE hEvent) PURE;

' 40.  STDMETHOD(GetEventDesc)(THIS_ D3DXEVENTHANDLE hEvent, LPD3DXEVENT_DESC pDesc) PURE;

'    // Cloning
' 41.  STDMETHOD(CloneAnimationController)(THIS_
'        UINT MaxNumAnimationOutputs,
'        UINT MaxNumAnimationSets,
'        UINT MaxNumTracks,
'        UINT MaxNumEvents,
'        LPD3DXANIMATIONCONTROLLER *ppAnimController) PURE;
'};
' ****************************************************************************************

' ****************************************************************************************
' GetMaxNumAnimationOutputs method
' Get the maximum number of animation outputs the animation controller can support.
' UINT GetMaxNumAnimationOutputs();
' ****************************************************************************************
FUNCTION ID3DXAnimationController_GetMaxNumAnimationOutputs ALIAS "ID3DXAnimationController_GetMaxNumAnimationOutputs" (BYVAL pthis AS DWORD PTR) EXPORT AS DWORD

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

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

' ****************************************************************************************
' GetMaxNumAnimationSets method
' Gets the maximum number of animation sets the animation controller can support.
' UINT GetMaxNumAnimationSets();
' ****************************************************************************************
FUNCTION ID3DXAnimationController_GetMaxNumAnimationSets ALIAS "ID3DXAnimationController_GetMaxNumAnimationSets" (BYVAL pthis AS DWORD PTR) EXPORT AS DWORD

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

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

' ****************************************************************************************
' GetMaxNumTracks method
' Gets the maximum number of tracks in the animation controller.
' UINT GetMaxNumTracks();
' ****************************************************************************************
FUNCTION ID3DXAnimationController_GetMaxNumTracks ALIAS "ID3DXAnimationController_GetMaxNumTracks" (BYVAL pthis AS DWORD PTR) EXPORT AS DWORD

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

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

' ****************************************************************************************
' GetMaxNumEvents method
' Gets the maximum number of tracks in the animation controller.
' UINT GetMaxNumEvents();
' ****************************************************************************************
FUNCTION ID3DXAnimationController_GetMaxNumEvents ALIAS "ID3DXAnimationController_GetMaxNumEvents" (BYVAL pthis AS DWORD PTR) EXPORT AS DWORD

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

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

' ****************************************************************************************
' RegisterAnimationOutput method
' Adds an animation output to the animation controller and registers pointers for scale,
' rotate, and translate (SRT) transformations.
' HRESULT RegisterAnimationOutput(
'   LPCSTR Name,
'   D3DXMATRIX * pMatrix,
'   D3DXVECTOR3 * pScale,
'   D3DXQUATERNION * pRotation,
'   D3DXVECTOR3 * pTranslation
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_RegisterAnimationOutput ALIAS "ID3DXAnimationController_RegisterAnimationOutput" ( _
    BYVAL pthis AS DWORD PTR, BYREF pName AS ASCIIZ, BYREF pMatrix AS D3DXMATRIX, _
    BYREF pScale AS D3DXVECTOR3, BYREF pRotation AS D3DXQUATERNION, _
    BYREF pTranslation AS D3DXVECTOR3) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[7] USING ID3DXAnimationController_RegisterAnimationOutput(pthis, pName, pMatrix, pScale, pRotation, pTranslation) TO HRESULT
    FUNCTION = HRESULT

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

' ****************************************************************************************
' RegisterAnimationSet method
' Adds an animation set to the animation controller.
' HRESULT RegisterAnimationSet(
'   LPD3DXANIMATIONSET pAnimSet
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_RegisterAnimationSet ALIAS "ID3DXAnimationController_RegisterAnimationSet" ( _
    BYVAL pthis AS DWORD PTR, BYVAL pAnimSet AS DWORD) EXPORT AS LONG

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

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

' ****************************************************************************************
' UnregisterAnimationSet method
' Removes an animation set from the animation controller.
' HRESULT UnregisterAnimationSet(
'   LPD3DXANIMATIONSET pAnimSet
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_UnregisterAnimationSet ALIAS "ID3DXAnimationController_UnregisterAnimationSet" ( _
    BYVAL pthis AS DWORD PTR, BYVAL pAnimSet AS DWORD) EXPORT AS LONG

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

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

' ****************************************************************************************
' GetNumAnimationSets method
' Returns the number of animation sets currently registered in the animation controller.
' UINT GetNumAnimationSets();
' ****************************************************************************************
FUNCTION ID3DXAnimationController_GetNumAnimationSets ALIAS "ID3DXAnimationController_GetNumAnimationSets" (BYVAL pthis AS DWORD PTR) EXPORT AS DWORD

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

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

' ****************************************************************************************
' GetAnimationSet method
' Gets an animation set.
' HRESULT GetAnimationSet(
'   UINT Index,
'   LPD3DXANIMATIONSET * ppAnimSet
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_GetAnimationSet ALIAS "ID3DXAnimationController_GetAnimationSet" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Index AS DWORD, BYREF ppAnimSet AS DWORD) EXPORT AS LONG

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

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

' ****************************************************************************************
' GetAnimationSetByName method
' Gets an animation set, given its name.
' HRESULT GetAnimationSetByName(
'   LPCSTR pName,
'   LPD3DXANIMATIONSET * ppAnimSet
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_GetAnimationSetByName ALIAS "ID3DXAnimationController_GetAnimationSetByName" ( _
    BYVAL pthis AS DWORD PTR, BYREF pName AS ASCIIZ, BYREF ppAnimSet AS DWORD) EXPORT AS LONG

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

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

' ****************************************************************************************
' AdvanceTime method
' Animates the mesh and advances the global animation time by a specified amount.
' HRESULT AdvanceTime(
'   DOUBLE TimeDelta,
'   LPD3DXANIMATIONCALLBACKHANDLER pCallbackHandler
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_AdvanceTime ALIAS "ID3DXAnimationController_AdvanceTime" ( _
    BYVAL pthis AS DWORD PTR, BYVAL TimeDelta AS DOUBLE, BYVAL pCallbackHandler AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[13] USING ID3DXAnimationController_AdvanceTime(pthis, TimeDelta, pCallbackHandler) TO HRESULT
    FUNCTION = HRESULT

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

' ****************************************************************************************
' ResetTime method
' Resets the global animation time to zero. Any pending events will retain their original
' schedules, but in the new timeframe.
' HRESULT ResetTime();
' ****************************************************************************************
FUNCTION ID3DXAnimationController_ResetTime ALIAS "ID3DXAnimationController_ResetTime" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[14] USING ID3DXAnimationController_ResetTime(pthis) TO HRESULT
    FUNCTION = HRESULT

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

' ****************************************************************************************
' GetTime method
' Gets the global animation time.
' DOUBLE GetTime();
' ****************************************************************************************
FUNCTION ID3DXAnimationController_GetTime ALIAS "ID3DXAnimationController_GetTime" (BYVAL pthis AS DWORD PTR) EXPORT AS DOUBLE

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

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

' ****************************************************************************************
' SetTrackAnimationSet method
' Applies the animation set to the specified track.
' HRESULT SetTrackAnimationSet(
'   UINT Track,
'   LPD3DXANIMATIONSET pAnimSet
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_SetTrackAnimationSet ALIAS "ID3DXAnimationController_SetTrackAnimationSet" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Track AS DWORD, BYVAL pAnimSet AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[16] USING ID3DXAnimationController_SetTrackAnimationSet(pthis, Track, pAnimSet) TO HRESULT
    FUNCTION = HRESULT

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

' ****************************************************************************************
' GetTrackAnimationSet method
' Gets the animation set for the given track.
' HRESULT GetTrackAnimationSet(
'   UINT Track,
'   LPD3DXANIMATIONSET * ppAnimSet
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_GetTrackAnimationSet ALIAS "ID3DXAnimationController_GetTrackAnimationSet" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Track AS DWORD, BYREF pAnimSet AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[17] USING ID3DXAnimationController_GetTrackAnimationSet(pthis, Track, pAnimSet) TO HRESULT
    FUNCTION = HRESULT

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

' ****************************************************************************************
' SetTrackPriority method
' Sets the priority blending weight for the specified animation track.
' HRESULT SetTrackPriority(
'   UINT Track,
'   D3DXPRIORITY_TYPE Priority
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_SetTrackPriority ALIAS "ID3DXAnimationController_SetTrackPriority" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Track AS DWORD, BYVAL Priority AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[18] USING ID3DXAnimationController_SetTrackPriority(pthis, Track, Priority) TO HRESULT
    FUNCTION = HRESULT

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

' ****************************************************************************************
' SetTrackSpeed method
' Sets the track speed. The track speed is similar to a multiplier that is used to speed up
' or slow down the playback of the track.
' HRESULT SetTrackSpeed(
'   UINT Track,
'   FLOAT Speed
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_SetTrackSpeed ALIAS "ID3DXAnimationController_SetTrackSpeed" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Track AS DWORD, BYVAL Speed AS SINGLE) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[19] USING ID3DXAnimationController_SetTrackSpeed(pthis, Track, Speed) TO HRESULT
    FUNCTION = HRESULT

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

' ****************************************************************************************
' SetTrackWeight method
' Sets the track weight. The weight is used to determine how to blend multiple tracks
' together.
' HRESULT SetTrackWeight(
'   UINT Track,
'   FLOAT Weight
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_SetTrackWeight ALIAS "ID3DXAnimationController_SetTrackWeight" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Track AS DWORD, BYVAL Weight AS SINGLE) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[20] USING ID3DXAnimationController_SetTrackWeight(pthis, Track, Weight) TO HRESULT
    FUNCTION = HRESULT

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

' ****************************************************************************************
' SetTrackPosition method
' Sets the track to the specified local animation time
' HRESULT SetTrackPosition(
'   UINT Track,
'   DOUBLE Position
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_SetTrackPosition ALIAS "ID3DXAnimationController_SetTrackPosition" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Track AS DWORD, BYVAL Position AS DOUBLE) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[21] USING ID3DXAnimationController_SetTrackPosition(pthis, Track, Position) TO HRESULT
    FUNCTION = HRESULT

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

' ****************************************************************************************
' SetTrackEnable method
' Enables or disables a track in the animation controller.
' HRESULT SetTrackEnable(
'   UINT Track,
'   BOOL Enable
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_SetTrackEnable ALIAS "ID3DXAnimationController_SetTrackEnable" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Track AS DWORD, BYVAL bEnable AS LONG) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[22] USING ID3DXAnimationController_SetTrackEnable(pthis, Track, bEnable) TO HRESULT
    FUNCTION = HRESULT

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

' ****************************************************************************************
' SetTrackDesc method
' Sets the track description.
' HRESULT SetTrackDesc(
'   UINT Track,
'   LPD3DXTRACK_DESC pDesc
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_SetTrackDesc ALIAS "ID3DXAnimationController_SetTrackDesc" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Track AS DWORD, BYREF pDesc AS D3DXTRACK_DESC) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[23] USING ID3DXAnimationController_SetTrackDesc(pthis, Track, pDesc) TO HRESULT
    FUNCTION = HRESULT

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

' ****************************************************************************************
' GetTrackDesc method
' Gets the track description.
' HRESULT GetTrackDesc(
'   UINT Track,
'   LPD3DXTRACK_DESC pDesc
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_GetTrackDesc ALIAS "ID3DXAnimationController_GetTrackDesc" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Track AS DWORD, BYREF pDesc AS D3DXTRACK_DESC) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[24] USING ID3DXAnimationController_GetTrackDesc(pthis, Track, pDesc) TO HRESULT
    FUNCTION = HRESULT

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

' ****************************************************************************************
' SetPriorityBlend method
' Sets the priority blending weight used by the animation controller.
' HRESULT SetPriorityBlend(
'   FLOAT BlendWeight
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_SetPriorityBlend ALIAS "ID3DXAnimationController_SetPriorityBlend" ( _
    BYVAL pthis AS DWORD PTR, BYVAL BlendWeight AS SINGLE) EXPORT AS LONG

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

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

' ****************************************************************************************
' GetPriorityBlend method
' Gets the priority blending weight used by the animation controller.
' FLOAT GetPriorityBlend();
' ****************************************************************************************
FUNCTION ID3DXAnimationController_GetPriorityBlend ALIAS "ID3DXAnimationController_GetPriorityBlend" (BYVAL pthis AS DWORD PTR) EXPORT AS SINGLE

    LOCAL SRESULT AS SINGLE
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[26] USING ID3DXAnimationController_GetPriorityBlend(pthis) TO SRESULT
    FUNCTION = SRESULT

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

' ****************************************************************************************
' KeyTrackSpeed method
' Sets an event key that changes the rate of play of an animation track.
' D3DXEVENTHANDLE KeyTrackSpeed(
'   UINT Track,
'   FLOAT NewSpeed,
'   DOUBLE StartTime,
'   DOUBLE Duration,
'   D3DXTRANSITION_TYPE Transition
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_KeyTrackSpeed ALIAS "ID3DXAnimationController_KeyTrackSpeed" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Track AS DWORD, BYVAL NewSpeed AS SINGLE, _
    BYVAL StartTime AS DOUBLE, BYVAL Duration AS DOUBLE, BYVAL Transition AS DWORD) EXPORT AS DWORD

    LOCAL DWRESULT AS DWORD
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[27] USING ID3DXAnimationController_KeyTrackSpeed(pthis, Track, NewSpeed, StartTime, Duration, Transition) TO DWRESULT
    FUNCTION = DWRESULT

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

' ****************************************************************************************
' KeyTrackWeight method
' Sets an event key that changes the weight of an animation track. The weight is used as a
' multiplier when combining multiple tracks together.
' D3DXEVENTHANDLE KeyTrackWeight(
'   UINT Track,
'   FLOAT NewWeight,
'   DOUBLE StartTime,
'   DOUBLE Duration,
'   D3DXTRANSITION_TYPE Transition
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_KeyTrackWeight ALIAS "ID3DXAnimationController_KeyTrackWeight" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Track AS DWORD, BYVAL NewWeight AS SINGLE, _
    BYVAL StartTime AS DOUBLE, BYVAL Duration AS DOUBLE, BYVAL Transition AS DWORD) EXPORT AS DWORD

    LOCAL DWRESULT AS DWORD
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[28] USING ID3DXAnimationController_KeyTrackWeight(pthis, Track, NewWeight, StartTime, Duration, Transition) TO DWRESULT
    FUNCTION = DWRESULT

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

' ****************************************************************************************
' KeyTrackPosition method
' Sets an event key that changes the local time of an animation track.
' D3DXEVENTHANDLE KeyTrackPosition(
'   UINT Track,
'   DOUBLE NewPosition,
'   DOUBLE StartTime
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_KeyTrackPosition ALIAS "ID3DXAnimationController_KeyTrackPosition" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Track AS DWORD, BYVAL NewPosition AS DOUBLE, _
    BYVAL StartTime AS DOUBLE) EXPORT AS DWORD

    LOCAL DWRESULT AS DWORD
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[29] USING ID3DXAnimationController_KeyTrackPosition(pthis, Track, NewPosition, StartTime) TO DWRESULT
    FUNCTION = DWRESULT

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

' ****************************************************************************************
' KeyTrackEnable method
' Sets an event key that enables or disables an animation track.
' D3DXEVENTHANDLE KeyTrackEnable(
'   UINT Track,
'   BOOL NewEnable,
'   DOUBLE StartTime
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_KeyTrackEnable ALIAS "ID3DXAnimationController_KeyTrackEnable" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Track AS DWORD, BYVAL NewEnable AS LONG, _
    BYVAL StartTime AS DOUBLE) EXPORT AS DWORD

    LOCAL DWRESULT AS DWORD
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[30] USING ID3DXAnimationController_KeyTrackEnable(pthis, Track, NewEnable, StartTime) TO DWRESULT
    FUNCTION = DWRESULT

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

' ****************************************************************************************
' KeyPriorityBlend method
' Sets blending event keys for the specified animation track.
' D3DXEVENTHANDLE KeyPriorityBlend(
'   FLOAT NewBlendWeight,
'   DOUBLE StartTime,
'   DOUBLE Duration,
'   D3DXTRANSITION_TYPE Transition
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_KeyPriorityBlend ALIAS "ID3DXAnimationController_KeyPriorityBlend" ( _
    BYVAL pthis AS DWORD PTR, BYVAL NewBlendWeight AS SINGLE, BYVAL StartTime AS DOUBLE, _
    BYVAL Duration AS DOUBLE, BYVAL Transition AS DWORD) EXPORT AS DWORD

    LOCAL DWRESULT AS DWORD
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[31] USING ID3DXAnimationController_KeyPriorityBlend(pthis, NewBlendWeight, StartTime, Duration, Transition) TO DWRESULT
    FUNCTION = DWRESULT

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

' ****************************************************************************************
' UnkeyEvent method
' Removes a specified event from an animation track, preventing the execution of the event.
' HRESULT UnkeyEvent(
'   D3DXEVENTHANDLE hEvent
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_UnkeyEvent ALIAS "ID3DXAnimationController_UnkeyEvent" ( _
    BYVAL pthis AS DWORD PTR, BYVAL hEvent AS DWORD) EXPORT AS LONG

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

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

' ****************************************************************************************
' UnkeyAllTrackEvents method
' Removes all events from a specified animation track.
' HRESULT UnkeyAllTrackEvents(
'   UINT Track
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_UnkeyAllTrackEvents ALIAS "ID3DXAnimationController_UnkeyAllTrackEvents" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Track AS DWORD) EXPORT AS LONG

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

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

' ****************************************************************************************
' UnkeyAllPriorityBlends method
' Removes all scheduled priority blend events from the animation controller.
' HRESULT UnkeyAllPriorityBlends();
' ****************************************************************************************
FUNCTION ID3DXAnimationController_UnkeyAllPriorityBlends ALIAS "ID3DXAnimationController_UnkeyAllPriorityBlends" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[34] USING ID3DXAnimationController_UnkeyAllPriorityBlends(pthis) TO HRESULT
    FUNCTION = HRESULT

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

' ****************************************************************************************
' GetCurrentTrackEvent method
' Returns an event handle to the event currently running on the specified animation track.
' D3DXEVENTHANDLE GetCurrentTrackEvent(
'   UINT Track,
'   D3DXEVENT_TYPE EventType
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_GetCurrentTrackEvent ALIAS "ID3DXAnimationController_GetCurrentTrackEvent" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Track AS DWORD, BYVAL EventType AS DWORD) EXPORT AS DWORD

    LOCAL DWRESULT AS LONG
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[35] USING ID3DXAnimationController_GetCurrentTrackEvent(pthis, Track, EventType) TO DWRESULT
    FUNCTION = DWRESULT

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

' ****************************************************************************************
' GetCurrentPriorityBlend method
' Returns an event handle to a priority blend event that is currently running.
' D3DXEVENTHANDLE GetCurrentPriorityBlend();
' ****************************************************************************************
FUNCTION ID3DXAnimationController_GetCurrentPriorityBlend ALIAS "ID3DXAnimationController_GetCurrentPriorityBlend" (BYVAL pthis AS DWORD PTR) EXPORT AS DWORD

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

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

' ****************************************************************************************
' GetUpcomingTrackEvent method
' Returns an event handle to the next event scheduled to occur after a specified event on
' an animation track.
' D3DXEVENTHANDLE GetUpcomingTrackEvent(
'   UINT Track,
'   D3DXEVENTHANDLE hEvent
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_GetUpcomingTrackEvent ALIAS "ID3DXAnimationController_GetUpcomingTrackEvent" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Track AS DWORD, BYVAL hEvent AS DWORD) EXPORT AS DWORD

    LOCAL DWRESULT AS DWORD
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[37] USING ID3DXAnimationController_GetUpcomingTrackEvent(pthis, Track, hEvent) TO DWRESULT
    FUNCTION = DWRESULT

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

' ****************************************************************************************
' GetUpcomingPriorityBlend method
' Returns an event handle to the next priority blend event scheduled to occur after a
' specified event.
' D3DXEVENTHANDLE GetUpcomingPriorityBlend(
'   D3DXEVENTHANDLE hEvent
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_GetUpcomingPriorityBlend ALIAS "ID3DXAnimationController_GetUpcomingPriorityBlend" ( _
    BYVAL pthis AS DWORD PTR, BYVAL hEvent AS DWORD) EXPORT AS DWORD

    LOCAL DWRESULT AS DWORD
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[38] USING ID3DXAnimationController_GetUpcomingPriorityBlend(pthis, hEvent) TO DWRESULT
    FUNCTION = DWRESULT

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

' ****************************************************************************************
' ValidateEvent method
' Checks whether a specified event handle is valid and the animation event has not yet
' completed.
' HRESULT ValidateEvent(
'   D3DXEVENTHANDLE hEvent
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_ValidateEvent ALIAS "ID3DXAnimationController_ValidateEvent" ( _
    BYVAL pthis AS DWORD PTR, BYVAL hEvent AS DWORD) EXPORT AS LONG

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

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

' ****************************************************************************************
' GetEventDesc method
' Gets a description of a specified animation event.
' HRESULT GetEventDesc(
'   D3DXEVENTHANDLE hEvent,
'   LPD3DXEVENT_DESC pDesc
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_GetEventDesc ALIAS "ID3DXAnimationController_GetEventDesc" ( _
    BYVAL pthis AS DWORD PTR, BYVAL hEvent AS DWORD, BYREF pDesc AS D3DXEVENT_DESC) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[40] USING ID3DXAnimationController_GetEventDesc(pthis, hEvent, pDesc) TO HRESULT
    FUNCTION = HRESULT

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

' ****************************************************************************************
' CloneAnimationController method
' Clones, or copies, an animation controller.
' HRESULT CloneAnimationController(
'   UINT MaxNumAnimationOutputs,
'   UINT MaxNumAnimationSets,
'   UINT MaxNumTracks,
'   UINT MaxNumEvents,
'   LPD3DXANIMATIONCONTROLLER * ppAnimController
' );
' ****************************************************************************************
FUNCTION ID3DXAnimationController_CloneAnimationController ALIAS "ID3DXAnimationController_CloneAnimationController" ( _
    BYVAL pthis AS DWORD PTR, BYVAL MaxNumAnimationOutputs AS DWORD, _
    BYVAL MaxNumAnimationSets AS DWORD, BYVAL MaxNumTracks AS DWORD, _
    BYVAL MaxNumEvents AS DWORD, BYREF ppAnimController AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[41] USING ID3DXAnimationController_CloneAnimationController(pthis, MaxNumAnimationOutputs, MaxNumAnimationSets, MaxNumTracks, MaxNumEvents, ppAnimController) TO HRESULT
    FUNCTION = HRESULT

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

 

Page last updated on Wednesday, 15 March 2006 00:10:21 +0100