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

d3dx8: Implement D3DXPlaneDotNormalize.

parent 3247fa0d
...@@ -60,6 +60,17 @@ static void D3DXPlaneTest(void) ...@@ -60,6 +60,17 @@ static void D3DXPlaneTest(void)
expected = 0.0f; expected = 0.0f;
got = D3DXPlaneDotCoord(NULL,NULL), got = D3DXPlaneDotCoord(NULL,NULL),
ok( expected == got, "Expected : %f, Got : %f\n",expected, got); ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
/*_______________D3DXPlaneDotNormal______________*/
expected = -35.0f;
got = D3DXPlaneDotNormal(&plane,&vec),
ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
expected = 0.0f;
got = D3DXPlaneDotNormal(NULL,&vec),
ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
expected = 0.0f;
got = D3DXPlaneDotNormal(NULL,NULL),
ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
} }
static void D3X8QuaternionTest(void) static void D3X8QuaternionTest(void)
......
...@@ -270,6 +270,12 @@ static inline FLOAT D3DXPlaneDotCoord(CONST D3DXPLANE *pp, CONST D3DXVECTOR4 *pv ...@@ -270,6 +270,12 @@ static inline FLOAT D3DXPlaneDotCoord(CONST D3DXPLANE *pp, CONST D3DXVECTOR4 *pv
return ( (pp->a) * (pv->x) + (pp->b) * (pv->y) + (pp->c) * (pv->z) + (pp->d) ); return ( (pp->a) * (pv->x) + (pp->b) * (pv->y) + (pp->c) * (pv->z) + (pp->d) );
} }
static inline FLOAT D3DXPlaneDotNormal(CONST D3DXPLANE *pp, CONST D3DXVECTOR4 *pv)
{
if ( !pp || !pv ) return 0.0f;
return ( (pp->a) * (pv->x) + (pp->b) * (pv->y) + (pp->c) * (pv->z) );
}
/*__________________D3DXQUATERNION____________________*/ /*__________________D3DXQUATERNION____________________*/
static inline D3DXQUATERNION* D3DXQuaternionConjugate(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq) static inline D3DXQUATERNION* D3DXQuaternionConjugate(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