diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index 2d5bdbb5143..c318a45df13 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -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) diff --git a/include/d3dx8math.inl b/include/d3dx8math.inl index 78146ec87bd..e8e6a023799 100644 --- a/include/d3dx8math.inl +++ b/include/d3dx8math.inl @@ -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)