d3dx8: Implement D3DXQuaternionIdentity.
This commit is contained in:
parent
77f5d4c88c
commit
4be363ac80
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue