Module: wine Branch: master Commit: de77d8e9fc73aae40e4f7301a4c721a4544469c9 URL: http://source.winehq.org/git/wine.git/?a=commit;h=de77d8e9fc73aae40e4f7301a4...
Author: David Adam David.Adam@math.cnrs.fr Date: Thu Apr 19 21:07:54 2007 +0200
d3drm: Implement D3DRMVectorDotProduct.
---
dlls/d3drm/d3drm.spec | 2 +- dlls/d3drm/math.c | 8 ++++++++ dlls/d3drm/tests/vector.c | 5 +++++ 3 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/dlls/d3drm/d3drm.spec b/dlls/d3drm/d3drm.spec index 4347160..59c1e03 100644 --- a/dlls/d3drm/d3drm.spec +++ b/dlls/d3drm/d3drm.spec @@ -10,7 +10,7 @@ @ stub D3DRMQuaternionSlerp @ stdcall D3DRMVectorAdd(ptr ptr ptr) @ stdcall D3DRMVectorCrossProduct(ptr ptr ptr) -@ stub D3DRMVectorDotProduct +@ stdcall D3DRMVectorDotProduct(ptr ptr) @ stub D3DRMVectorModulus @ stub D3DRMVectorNormalize @ stub D3DRMVectorRandom diff --git a/dlls/d3drm/math.c b/dlls/d3drm/math.c index 39b96d0..d9078fe 100644 --- a/dlls/d3drm/math.c +++ b/dlls/d3drm/math.c @@ -58,3 +58,11 @@ LPD3DVECTOR WINAPI D3DRMVectorCrossProduct(LPD3DVECTOR d, LPD3DVECTOR s1, LPD3DV d->z=s1->x * s2->y - s1->y * s2->x; return d; } + +/* Dot Product of Two vectors */ +D3DVALUE WINAPI D3DRMVectorDotProduct(LPD3DVECTOR s1, LPD3DVECTOR s2) +{ + D3DVALUE dot_product; + dot_product=s1->x * s2->x + s1->y * s2->y + s1->z * s2->z; + return dot_product; +} diff --git a/dlls/d3drm/tests/vector.c b/dlls/d3drm/tests/vector.c index 52c81e8..4b76ba2 100644 --- a/dlls/d3drm/tests/vector.c +++ b/dlls/d3drm/tests/vector.c @@ -32,6 +32,7 @@
void VectorTest(void) { + D3DVALUE mod; D3DVECTOR e,r,u,v;
u.x=2.0;u.y=2.0;u.z=1.0; @@ -51,6 +52,10 @@ void VectorTest(void) D3DRMVectorCrossProduct(&r,&u,&v); e.x=-4.0;e.y=4.0;e.z=0.0; expect_vec(e,r); + +/*_______________________VectorDotProduct__________________________*/ + mod=D3DRMVectorDotProduct(&u,&v); + ok((mod == 16.0), "Expected 16.0, Got %f",mod); }
START_TEST(vector)