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