|
|
|
ID3DXMatrixStack Interface |
|
' ****************************************************************************************
' ID3DXMatrixStack interface
' $IID_ID3DXMatrixStack = GUID$("{C7885BA7-F990-4fe7-922D-8515E477DD85}")
' ****************************************************************************************
' Applications use the methods of the ID3DXMatrixStack interface to manipulate a matrix
' stack.
' ****************************************************************************************
'DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown)
'{
' //
' // IUnknown methods
' //
' STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
' STDMETHOD_(ULONG,AddRef)(THIS) PURE;
' STDMETHOD_(ULONG,Release)(THIS) PURE;
' //
' // ID3DXMatrixStack methods
' //
' // Pops the top of the stack, returns the current top
' // *after* popping the top.
' STDMETHOD(Pop)(THIS) PURE;
' // Pushes the stack by one, duplicating the current matrix.
' STDMETHOD(Push)(THIS) PURE;
' // Loads identity in the current matrix.
' STDMETHOD(LoadIdentity)(THIS) PURE;
' // Loads the given matrix into the current matrix
' STDMETHOD(LoadMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE;
' // Right-Multiplies the given matrix to the current matrix.
' // (transformation is about the current world origin)
' STDMETHOD(MultMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE;
' // Left-Multiplies the given matrix to the current matrix
' // (transformation is about the local origin of the object)
' STDMETHOD(MultMatrixLocal)(THIS_ CONST D3DXMATRIX* pM ) PURE;
' // Right multiply the current matrix with the computed rotation
' // matrix, counterclockwise about the given axis with the given angle.
' // (rotation is about the current world origin)
' STDMETHOD(RotateAxis)
' (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE;
' // Left multiply the current matrix with the computed rotation
' // matrix, counterclockwise about the given axis with the given angle.
' // (rotation is about the local origin of the object)
' STDMETHOD(RotateAxisLocal)
' (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE;
' // Right multiply the current matrix with the computed rotation
' // matrix. All angles are counterclockwise. (rotation is about the
' // current world origin)
' // The rotation is composed of a yaw around the Y axis, a pitch around
' // the X axis, and a roll around the Z axis.
' STDMETHOD(RotateYawPitchRoll)
' (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE;
' // Left multiply the current matrix with the computed rotation
' // matrix. All angles are counterclockwise. (rotation is about the
' // local origin of the object)
' // The rotation is composed of a yaw around the Y axis, a pitch around
' // the X axis, and a roll around the Z axis.
' STDMETHOD(RotateYawPitchRollLocal)
' (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE;
' // Right multiply the current matrix with the computed scale
' // matrix. (transformation is about the current world origin)
' STDMETHOD(Scale)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
' // Left multiply the current matrix with the computed scale
' // matrix. (transformation is about the local origin of the object)
' STDMETHOD(ScaleLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
' // Right multiply the current matrix with the computed translation
' // matrix. (transformation is about the current world origin)
' STDMETHOD(Translate)(THIS_ FLOAT x, FLOAT y, FLOAT z ) PURE;
' // Left multiply the current matrix with the computed translation
' // matrix. (transformation is about the local origin of the object)
' STDMETHOD(TranslateLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
' // Obtain the current matrix at the top of the stack
' STDMETHOD_(D3DXMATRIX*, GetTop)(THIS) PURE;
'};
' ****************************************************************************************
' Pop method
' Removes the current matrix from the top of the stack.
' STDMETHOD(Pop)(THIS) PURE;
' ****************************************************************************************
FUNCTION ID3DXMatrixStack_Pop ALIAS "ID3DXMatrixStack_Pop" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[3] USING ID3DXMatrixStack_Pop(pthis) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Push method
' Adds a matrix to the stack.
' STDMETHOD(Push)(THIS) PURE;
' ****************************************************************************************
FUNCTION ID3DXMatrixStack_Push ALIAS "ID3DXMatrixStack_Push" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[4] USING ID3DXMatrixStack_Push(pthis) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' LoadIdentity method
' Loads identity in the current matrix.
' STDMETHOD(Push)(THIS) PURE;
' ****************************************************************************************
FUNCTION ID3DXMatrixStack_LoadIdentity ALIAS "ID3DXMatrixStack_LoadIdentity" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[5] USING ID3DXMatrixStack_LoadIdentity(pthis) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' LoadMatrix method
' Loads the given matrix into the current matrix
' STDMETHOD(LoadMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE;
' ****************************************************************************************
FUNCTION ID3DXMatrixStack_LoadMatrix ALIAS "ID3DXMatrixStack_LoadMatrix" ( _
BYVAL pthis AS DWORD PTR, BYREF pM AS D3DXMATRIX) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[6] USING ID3DXMatrixStack_LoadMatrix(pthis, pM) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' MultMatrix method
' Determines the product of the current matrix and the given matrix.
' STDMETHOD(MultMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE;
' ****************************************************************************************
FUNCTION ID3DXMatrixStack_MultMatrix ALIAS "ID3DXMatrixStack_MultMatrix" ( _
BYVAL pthis AS DWORD PTR, BYREF pM AS D3DXMATRIX) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[7] USING ID3DXMatrixStack_MultMatrix(pthis, pM) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' MultMatrix method
' Determines the product of the given matrix and the current matrix.
' STDMETHOD(MultMatrixLocal)(THIS_ CONST D3DXMATRIX* pM ) PURE;
' ****************************************************************************************
FUNCTION ID3DXMatrixStack_MultMatrixLocal ALIAS "ID3DXMatrixStack_MultMatrixLocal" ( _
BYVAL pthis AS DWORD PTR, BYREF pM AS D3DXMATRIX) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[8] USING ID3DXMatrixStack_MultMatrixLocal(pthis, pM) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' RotateAxis method
' Rotates (relative to world coordinate space) around an arbitrary axis.
' STDMETHOD(RotateAxis)
' (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE;
' ****************************************************************************************
FUNCTION ID3DXMatrixStack_RotateAxis ALIAS "ID3DXMatrixStack_RotateAxis" ( _
BYVAL pthis AS DWORD PTR, BYREF pV AS D3DXVECTOR3, BYVAL Angle AS SINGLE) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[9] USING ID3DXMatrixStack_RotateAxis(pthis, pV, Angle) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' RotateAxisLocal method
' Rotates (relative to the object's local coordinate space) around an arbitrary axis.
' STDMETHOD(RotateAxisLocal)
' (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE;
' ****************************************************************************************
FUNCTION ID3DXMatrixStack_RotateAxisLocal ALIAS "ID3DXMatrixStack_RotateAxisLocal" ( _
BYVAL pthis AS DWORD PTR, BYREF pV AS D3DXVECTOR3, BYVAL Angle AS SINGLE) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[10] USING ID3DXMatrixStack_RotateAxisLocal(pthis, pV, Angle) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' RotateYawPitchRoll method
' Rotates (relative to world coordinate space) around an arbitrary axis.
' STDMETHOD(RotateYawPitchRoll)
' (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE;
' ****************************************************************************************
FUNCTION ID3DXMatrixStack_RotateYawPitchRoll ALIAS "ID3DXMatrixStack_RotateYawPitchRoll" ( _
BYVAL pthis AS DWORD PTR, BYVAL Yaw AS SINGLE, BYVAL Pitch AS SINGLE, _
BYVAL Roll AS SINGLE) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[11] USING ID3DXMatrixStack_RotateYawPitchRoll(pthis, Yaw, Pitch, Roll) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' RotateYawPitchRollLocal method
' Rotates (relative to the object's local coordinate space) around an arbitrary axis.
' STDMETHOD(RotateYawPitchRollLocal)
' (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE;
' ****************************************************************************************
FUNCTION ID3DXMatrixStack_RotateYawPitchRollLocal ALIAS "ID3DXMatrixStack_RotateYawPitchRollLocal" ( _
BYVAL pthis AS DWORD PTR, BYVAL Yaw AS SINGLE, BYVAL Pitch AS SINGLE, _
BYVAL Roll AS SINGLE) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[12] USING ID3DXMatrixStack_RotateYawPitchRollLocal(pthis, Yaw, Pitch, Roll) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Scale method
' Scale the current matrix about the world coordinate origin.
' STDMETHOD(Scale)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
' ****************************************************************************************
FUNCTION ID3DXMatrixStack_Scale ALIAS "ID3DXMatrixStack_Scale" ( _
BYVAL pthis AS DWORD PTR, BYVAL x AS SINGLE, BYVAL y AS SINGLE, _
BYVAL z AS SINGLE) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[13] USING ID3DXMatrixStack_Scale(pthis, x, y, z) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' ScaleLocal method
' Scale the current matrix about the object origin.
' STDMETHOD(ScaleLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
' ****************************************************************************************
FUNCTION ID3DXMatrixStack_ScaleLocal ALIAS "ID3DXMatrixStack_ScaleLocal" ( _
BYVAL pthis AS DWORD PTR, BYVAL x AS SINGLE, BYVAL y AS SINGLE, _
BYVAL z AS SINGLE) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[14] USING ID3DXMatrixStack_ScaleLocal(pthis, x, y, z) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Translate method
' Determines the product of the current matrix and the computed translation matrix
' determined by the given factors (x, y, and z).
' STDMETHOD(Translate)(THIS_ FLOAT x, FLOAT y, FLOAT z ) PURE;
' ****************************************************************************************
FUNCTION ID3DXMatrixStack_Translate ALIAS "ID3DXMatrixStack_Translate" ( _
BYVAL pthis AS DWORD PTR, BYVAL x AS SINGLE, BYVAL y AS SINGLE, _
BYVAL z AS SINGLE) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[15] USING ID3DXMatrixStack_Translate(pthis, x, y, z) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' TranslateLocal method
' Determines the product of the computed translation matrix determined by the given
' factors (x, y, and z) and the current matrix.
' STDMETHOD(TranslateLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
' ****************************************************************************************
FUNCTION ID3DXMatrixStack_TranslateLocal ALIAS "ID3DXMatrixStack_TranslateLocal" ( _
BYVAL pthis AS DWORD PTR, BYVAL x AS SINGLE, BYVAL y AS SINGLE, _
BYVAL z AS SINGLE) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[16] USING ID3DXMatrixStack_TranslateLocal(pthis, x, y, z) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' GetTop method
' Retrieves the current matrix at the top of the stack.
' STDMETHOD_(D3DXMATRIX*, GetTop)(THIS) PURE;
' ****************************************************************************************
FUNCTION ID3DXMatrixStack_GetTop ALIAS "ID3DXMatrixStack_GetTop" (BYVAL pthis AS DWORD PTR) EXPORT AS DWORD
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[17] USING ID3DXMatrixStack_GetTop(pthis) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
|
Page last updated on Wednesday, 15 March 2006 03:58:43 +0100