d3dx8: Implement D3DXPlaneDotCoord.

This commit is contained in:
David Adam 2007-10-23 11:01:43 +02:00 committed by Alexandre Julliard
parent 10259cd87c
commit 3247fa0d67
2 changed files with 18 additions and 1 deletions

View File

@ -49,6 +49,17 @@ static void D3DXPlaneTest(void)
expected = 0.0f;
got = D3DXPlaneDot(NULL,NULL),
ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
/*_______________D3DXPlaneDotCoord________________*/
expected = -28.0f;
got = D3DXPlaneDotCoord(&plane,&vec),
ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
expected = 0.0f;
got = D3DXPlaneDotCoord(NULL,&vec),
ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
expected = 0.0f;
got = D3DXPlaneDotCoord(NULL,NULL),
ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
}
static void D3X8QuaternionTest(void)

View File

@ -258,12 +258,18 @@ static inline D3DXVECTOR4* D3DXVec4Subtract(D3DXVECTOR4 *pout, CONST D3DXVECTOR4
/*__________________D3DXQUATERNION____________________*/
static inline FLOAT D3DXPlaneDot( CONST D3DXPLANE *pp, CONST D3DXVECTOR4 *pv)
static inline FLOAT D3DXPlaneDot(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) + (pp->d) * (pv->w) );
}
static inline FLOAT D3DXPlaneDotCoord(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) + (pp->d) );
}
/*__________________D3DXQUATERNION____________________*/
static inline D3DXQUATERNION* D3DXQuaternionConjugate(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq)