Commit e8edc51d authored by David Adam's avatar David Adam Committed by Alexandre Julliard

d3dx8: Implement D3DXQuaternionBaryCentric.

parent 8ec01f62
......@@ -60,7 +60,7 @@
@ stub D3DXQuaternionExp
@ stdcall D3DXQuaternionSlerp(ptr ptr ptr long)
@ stdcall D3DXQuaternionSquad(ptr ptr ptr ptr ptr long)
@ stub D3DXQuaternionBaryCentric
@ stdcall D3DXQuaternionBaryCentric(ptr ptr ptr ptr long long)
@ stdcall D3DXPlaneNormalize(ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
......
......@@ -581,6 +581,13 @@ D3DXPLANE* WINAPI D3DXPlaneTransform(D3DXPLANE *pout, CONST D3DXPLANE *pplane, C
/*_________________D3DXQUATERNION________________*/
D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, CONST D3DXQUATERNION *pq3, FLOAT f, FLOAT g)
{
D3DXQUATERNION temp1, temp2;
D3DXQuaternionSlerp(pout, D3DXQuaternionSlerp(&temp1, pq1, pq2, f + g), D3DXQuaternionSlerp(&temp2, pq1, pq3, f+g), g / (f + g));
return pout;
}
D3DXQUATERNION* WINAPI D3DXQuaternionInverse(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq)
{
D3DXQUATERNION temp;
......
......@@ -554,7 +554,7 @@ static void D3X8QuaternionTest(void)
{
D3DXQUATERNION expectedquat, gotquat, nul, q, r, s, t, u;
LPD3DXQUATERNION funcpointer;
FLOAT expected, got, scale;
FLOAT expected, got, scale, scale2;
BOOL expectedbool, gotbool;
nul.x = 0.0f; nul.y = 0.0f; nul.z = 0.0f; nul.w = 0.0f;
......@@ -564,6 +564,12 @@ static void D3X8QuaternionTest(void)
u.x = 91.0f; u.y = - 82.0f; u.z = 7.3f; u.w = -6.4f;
scale = 0.3f;
scale2 = 0.78f;
/*_______________D3DXQuaternionBaryCentric________________________*/
expectedquat.x = -867.444458; expectedquat.y = 87.851111f; expectedquat.z = -9.937778f; expectedquat.w = 3.235555f;
D3DXQuaternionBaryCentric(&gotquat,&q,&r,&t,scale,scale2);
expect_vec4(expectedquat,gotquat);
/*_______________D3DXQuaternionConjugate________________*/
expectedquat.x = -1.0f; expectedquat.y = -2.0f; expectedquat.z = -4.0f; expectedquat.w = 10.0f;
......
......@@ -302,6 +302,7 @@ D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine(D3DXVECTOR3 *pout, CONST D3DXPLANE *p
D3DXPLANE* WINAPI D3DXPlaneNormalize(D3DXPLANE *pout, CONST D3DXPLANE *pp);
D3DXPLANE* WINAPI D3DXPlaneTransform(D3DXPLANE *pout, CONST D3DXPLANE *pplane, CONST D3DXMATRIX *pm);
D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, CONST D3DXQUATERNION *pq3, FLOAT f, FLOAT g);
D3DXQUATERNION* WINAPI D3DXQuaternionInverse(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
D3DXQUATERNION* WINAPI D3DXQuaternionMultiply(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2);
D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
......
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