d3dx9: Fix D3DXQuaternionNormalize to make tests pass in Windows.

This commit is contained in:
David Adam 2009-07-17 11:32:38 +02:00 committed by Alexandre Julliard
parent 831d6b5886
commit 0788ac38ab
2 changed files with 7 additions and 18 deletions

View File

@ -1241,21 +1241,14 @@ D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQ
FLOAT norm;
norm = D3DXQuaternionLength(pq);
if ( !norm )
{
out.x = 0.0f;
out.y = 0.0f;
out.z = 0.0f;
out.w = 0.0f;
}
else
{
out.x = pq->x / norm;
out.y = pq->y / norm;
out.z = pq->z / norm;
out.w = pq->w / norm;
}
out.x = pq->x / norm;
out.y = pq->y / norm;
out.z = pq->z / norm;
out.w = pq->w / norm;
*pout=out;
return pout;
}

View File

@ -762,10 +762,6 @@ static void D3DXQuaternionTest(void)
expectedquat.x = 1.0f/11.0f; expectedquat.y = 2.0f/11.0f; expectedquat.z = 4.0f/11.0f; expectedquat.w = 10.0f/11.0f;
D3DXQuaternionNormalize(&gotquat,&q);
expect_vec4(expectedquat,gotquat);
/* Test the nul quaternion */
expectedquat.x = 0.0f; expectedquat.y = 0.0f; expectedquat.z = 0.0f; expectedquat.w = 0.0f;
D3DXQuaternionNormalize(&gotquat,&nul);
expect_vec4(expectedquat,gotquat);
/*_______________D3DXQuaternionRotationAxis___________________*/
axis.x = 2.0f; axis.y = 7.0; axis.z = 13.0f;