Commit 8ec01f62 authored by David Adam's avatar David Adam Committed by Alexandre Julliard

d3dx8: Implement D3DXQuaternionSquad.

parent cb954ca6
......@@ -59,7 +59,7 @@
@ stub D3DXQuaternionLn
@ stub D3DXQuaternionExp
@ stdcall D3DXQuaternionSlerp(ptr ptr ptr long)
@ stub D3DXQuaternionSquad
@ stdcall D3DXQuaternionSquad(ptr ptr ptr ptr ptr long)
@ stub D3DXQuaternionBaryCentric
@ stdcall D3DXPlaneNormalize(ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
......
......@@ -650,6 +650,14 @@ D3DXQUATERNION* WINAPI D3DXQuaternionSlerp(D3DXQUATERNION *pout, CONST D3DXQUATE
return pout;
}
D3DXQUATERNION* WINAPI D3DXQuaternionSquad(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, CONST D3DXQUATERNION *pq3, CONST D3DXQUATERNION *pq4, FLOAT t)
{
D3DXQUATERNION temp1, temp2;
D3DXQuaternionSlerp(pout, D3DXQuaternionSlerp(&temp1, pq1, pq4, t), D3DXQuaternionSlerp(&temp2, pq2, pq3, t), 2.0f * t * (1.0f - t));
return pout;
}
/*_________________D3DXVec2_____________________*/
D3DXVECTOR2* WINAPI D3DXVec2BaryCentric(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT f, FLOAT g)
......
......@@ -552,7 +552,7 @@ static void D3DXPlaneTest(void)
static void D3X8QuaternionTest(void)
{
D3DXQUATERNION expectedquat, gotquat, nul, q, r, s, t;
D3DXQUATERNION expectedquat, gotquat, nul, q, r, s, t, u;
LPD3DXQUATERNION funcpointer;
FLOAT expected, got, scale;
BOOL expectedbool, gotbool;
......@@ -561,6 +561,7 @@ static void D3X8QuaternionTest(void)
q.x = 1.0f, q.y = 2.0f; q.z = 4.0f; q.w = 10.0f;
r.x = -3.0f; r.y = 4.0f; r.z = -5.0f; r.w = 7.0;
t.x = -1111.0f, t.y= 111.0f; t.z = -11.0f; t.w = 1.0f;
u.x = 91.0f; u.y = - 82.0f; u.z = 7.3f; u.w = -6.4f;
scale = 0.3f;
......@@ -655,6 +656,11 @@ static void D3X8QuaternionTest(void)
expectedquat.x = 334.0f; expectedquat.y = -31.9f; expectedquat.z = 6.1f; expectedquat.w = 6.7f;
D3DXQuaternionSlerp(&gotquat,&q,&t,scale);
expect_vec4(expectedquat,gotquat);
/*_______________D3DXQuaternionSquad________________________*/
expectedquat.x = -156.296f; expectedquat.y = 30.242f; expectedquat.z = -2.5022f; expectedquat.w = 7.3576f;
D3DXQuaternionSquad(&gotquat,&q,&r,&t,&u,scale);
expect_vec4(expectedquat,gotquat);
}
static void D3X8Vector2Test(void)
......
......@@ -306,6 +306,7 @@ D3DXQUATERNION* WINAPI D3DXQuaternionInverse(D3DXQUATERNION *pout, CONST D3DXQUA
D3DXQUATERNION* WINAPI D3DXQuaternionMultiply(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2);
D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
D3DXQUATERNION* WINAPI D3DXQuaternionSlerp(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, FLOAT t);
D3DXQUATERNION* WINAPI D3DXQuaternionSquad(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, CONST D3DXQUATERNION *pq3, CONST D3DXQUATERNION *pq4, FLOAT t);
D3DXVECTOR2* WINAPI D3DXVec2BaryCentric(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT f, FLOAT g);
D3DXVECTOR2* WINAPI D3DXVec2CatmullRom(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv0, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT s);
......
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