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

d3drm: Implement D3DRMVectorModulus.

parent de77d8e9
......@@ -11,7 +11,7 @@
@ stdcall D3DRMVectorAdd(ptr ptr ptr)
@ stdcall D3DRMVectorCrossProduct(ptr ptr ptr)
@ stdcall D3DRMVectorDotProduct(ptr ptr)
@ stub D3DRMVectorModulus
@ stdcall D3DRMVectorModulus(ptr)
@ stub D3DRMVectorNormalize
@ stub D3DRMVectorRandom
@ stub D3DRMVectorReflect
......
......@@ -66,3 +66,11 @@ D3DVALUE WINAPI D3DRMVectorDotProduct(LPD3DVECTOR s1, LPD3DVECTOR s2)
dot_product=s1->x * s2->x + s1->y * s2->y + s1->z * s2->z;
return dot_product;
}
/* Norm of a vector */
D3DVALUE WINAPI D3DRMVectorModulus(LPD3DVECTOR v)
{
D3DVALUE result;
result=sqrt(v->x * v->x + v->y * v->y + v->z * v->z);
return result;
}
......@@ -56,6 +56,10 @@ void VectorTest(void)
/*_______________________VectorDotProduct__________________________*/
mod=D3DRMVectorDotProduct(&u,&v);
ok((mod == 16.0), "Expected 16.0, Got %f",mod);
/*_______________________VectorModulus_____________________________*/
mod=D3DRMVectorModulus(&u);
ok((mod == 3.0), "Expected 3.0, Got %f",mod);
}
START_TEST(vector)
......
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