Commit 4be363ac authored by David Adam's avatar David Adam Committed by Alexandre Julliard

d3dx8: Implement D3DXQuaternionIdentity.

parent 77f5d4c8
......@@ -62,6 +62,14 @@ static void D3X8QuaternionTest(void)
got = D3DXQuaternionDot(NULL,NULL);
ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got);
/*_______________D3DXQuaternionIdentity________________*/
expectedquat.x = 0.0f; expectedquat.y = 0.0f; expectedquat.z = 0.0f; expectedquat.w = 1.0f;
D3DXQuaternionIdentity(&gotquat);
expect_vec4(expectedquat,gotquat);
/* Test the NULL case */
funcpointer = D3DXQuaternionIdentity(NULL);
ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
/*_______________D3DXQuaternionLength__________________________*/
expected = 11.0f;
got = D3DXQuaternionLength(&q);
......
......@@ -274,6 +274,16 @@ static inline FLOAT D3DXQuaternionDot(CONST D3DXQUATERNION *pq1, CONST D3DXQUATE
return (pq1->x) * (pq2->x) + (pq1->y) * (pq2->y) + (pq1->z) * (pq2->z) + (pq1->w) * (pq2->w);
}
static inline D3DXQUATERNION* D3DXQuaternionIdentity(D3DXQUATERNION *pout)
{
if ( !pout) return NULL;
pout->x = 0.0f;
pout->y = 0.0f;
pout->z = 0.0f;
pout->w = 1.0f;
return pout;
}
static inline FLOAT D3DXQuaternionLength(CONST D3DXQUATERNION *pq)
{
if (!pq) return 0.0f;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment