d3drm: Implement D3DRMVectorModulus.
This commit is contained in:
parent
de77d8e9fc
commit
d882ee2746
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue