d3dx8: Implement D3DXMatrixTranslation.
This commit is contained in:
parent
716862d696
commit
4cd47e8b64
|
@ -25,7 +25,7 @@
|
|||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stub D3DXMatrixInverse
|
||||
@ stdcall D3DXMatrixScaling(ptr long long long)
|
||||
@ stub D3DXMatrixTranslation
|
||||
@ stdcall D3DXMatrixTranslation(ptr long long long)
|
||||
@ stub D3DXMatrixRotationX
|
||||
@ stub D3DXMatrixRotationY
|
||||
@ stub D3DXMatrixRotationZ
|
||||
|
|
|
@ -67,6 +67,15 @@ D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT
|
|||
return pout;
|
||||
}
|
||||
|
||||
D3DXMATRIX* WINAPI D3DXMatrixTranslation(D3DXMATRIX *pout, FLOAT x, FLOAT y, FLOAT z)
|
||||
{
|
||||
D3DXMatrixIdentity(pout);
|
||||
pout->m[3][0] = x;
|
||||
pout->m[3][1] = y;
|
||||
pout->m[3][2] = z;
|
||||
return pout;
|
||||
}
|
||||
|
||||
D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm)
|
||||
{
|
||||
int i,j;
|
||||
|
|
|
@ -204,6 +204,14 @@ static void D3DXMatrixTest(void)
|
|||
D3DXMatrixScaling(&gotmat,0.69f,0.53f,4.11f);
|
||||
expect_mat(expectedmat,gotmat);
|
||||
|
||||
/*____________D3DXMatrixTranslation______________*/
|
||||
expectedmat.m[0][0] = 1.0f; expectedmat.m[0][1] = 0.0f; expectedmat.m[0][2] = 0.0f; expectedmat.m[0][3] = 0.0f;
|
||||
expectedmat.m[1][0] = 0.0; expectedmat.m[1][1] = 1.0f; expectedmat.m[1][2] = 0.0f; expectedmat.m[1][3] = 0.0f;
|
||||
expectedmat.m[2][0] = 0.0f; expectedmat.m[2][1] = 0.0f; expectedmat.m[2][2] = 1.0f; expectedmat.m[2][3] = 0.0f;
|
||||
expectedmat.m[3][0] = 0.69f; expectedmat.m[3][1] = 0.53f; expectedmat.m[3][2] = 4.11f; expectedmat.m[3][3] = 1.0f;
|
||||
D3DXMatrixTranslation(&gotmat,0.69f,0.53f,4.11f);
|
||||
expect_mat(expectedmat,gotmat);
|
||||
|
||||
/*____________D3DXMatrixTranspose______________*/
|
||||
expectedmat.m[0][0] = 10.0f; expectedmat.m[0][1] = 11.0f; expectedmat.m[0][2] = 19.0f; expectedmat.m[0][3] = 2.0f;
|
||||
expectedmat.m[1][0] = 5.0; expectedmat.m[1][1] = 20.0f; expectedmat.m[1][2] = -21.0f; expectedmat.m[1][3] = 3.0f;
|
||||
|
|
|
@ -61,6 +61,7 @@ typedef struct D3DXCOLOR
|
|||
FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm);
|
||||
D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2);
|
||||
D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz);
|
||||
D3DXMATRIX* WINAPI D3DXMatrixTranslation(D3DXMATRIX *pout, FLOAT x, FLOAT y, FLOAT z);
|
||||
D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm);
|
||||
|
||||
D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
|
||||
|
|
Loading…
Reference in New Issue