d3dx8: Implement D3DXPlaneFromPointNormal.

This commit is contained in:
David Adam 2007-11-19 13:43:28 +01:00 committed by Alexandre Julliard
parent ac2c1b8070
commit 3d30866133
4 changed files with 18 additions and 1 deletions

View File

@ -63,7 +63,7 @@
@ stub D3DXQuaternionBaryCentric
@ stdcall D3DXPlaneNormalize(ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ stub D3DXPlaneFromPointNormal
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stub D3DXPlaneFromPoints
@ stub D3DXPlaneTransform
@ stub D3DXColorAdjustSaturation

View File

@ -482,6 +482,15 @@ D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm)
/*_________________D3DXPLANE________________*/
D3DXPLANE* WINAPI D3DXPlaneFromPointNormal(D3DXPLANE *pout, CONST D3DXVECTOR3 *pvpoint, CONST D3DXVECTOR3 *pvnormal)
{
pout->a = pvnormal->x;
pout->b = pvnormal->y;
pout->c = pvnormal->z;
pout->d = -D3DXVec3Dot(pvpoint, pvnormal);
return pout;
}
D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine(D3DXVECTOR3 *pout, CONST D3DXPLANE *pp, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2)
{
D3DXVECTOR3 direction, normal;

View File

@ -478,6 +478,13 @@ static void D3DXPlaneTest(void)
got = D3DXPlaneDotNormal(NULL,NULL),
ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
/*_______________D3DXPlaneFromPointNormal_______*/
vec1.x = 11.0f; vec1.y = 13.0f; vec1.z = 15.0f;
vec2.x = 17.0f; vec2.y = 31.0f; vec2.z = 24.0f;
expectedplane.a = 17.0f; expectedplane.b = 31.0f; expectedplane.c = 24.0f; expectedplane.d = -950.0f;
D3DXPlaneFromPointNormal(&gotplane,&vec1,&vec2);
expect_plane(expectedplane, gotplane);
/*_______________D3DXPlaneIntersectLine___________*/
vec1.x = 9.0f; vec1.y = 6.0f; vec1.z = 3.0f;
vec2.x = 2.0f; vec2.y = 5.0f; vec2.z = 8.0f;

View File

@ -293,6 +293,7 @@ D3DXMATRIX* WINAPI D3DXMatrixShadow(D3DXMATRIX *pout, CONST D3DXVECTOR4 *plight,
D3DXMATRIX* WINAPI D3DXMatrixTranslation(D3DXMATRIX *pout, FLOAT x, FLOAT y, FLOAT z);
D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm);
D3DXPLANE* WINAPI D3DXPlaneFromPointNormal(D3DXPLANE *pout, CONST D3DXVECTOR3 *pvpoint, CONST D3DXVECTOR3 *pvnormal);
D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine(D3DXVECTOR3 *pout, CONST D3DXPLANE *pp, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2);
D3DXPLANE* WINAPI D3DXPlaneNormalize(D3DXPLANE *pout, CONST D3DXPLANE *pp);