d3drm: Implement D3DRMVectorCrossProduct.

This commit is contained in:
David Adam 2007-04-19 21:06:54 +02:00 committed by Alexandre Julliard
parent 70a1cef5e4
commit d152211e21
3 changed files with 15 additions and 1 deletions

View file

@ -9,7 +9,7 @@
@ stub D3DRMQuaternionMultiply
@ stub D3DRMQuaternionSlerp
@ stdcall D3DRMVectorAdd(ptr ptr ptr)
@ stub D3DRMVectorCrossProduct
@ stdcall D3DRMVectorCrossProduct(ptr ptr ptr)
@ stub D3DRMVectorDotProduct
@ stub D3DRMVectorModulus
@ stub D3DRMVectorNormalize

View file

@ -49,3 +49,12 @@ LPD3DVECTOR WINAPI D3DRMVectorSubtract(LPD3DVECTOR d, LPD3DVECTOR s1, LPD3DVECTO
d->z=s1->z - s2->z;
return d;
}
/* Cross Product of Two Vectors */
LPD3DVECTOR WINAPI D3DRMVectorCrossProduct(LPD3DVECTOR d, LPD3DVECTOR s1, LPD3DVECTOR s2)
{
d->x=s1->y * s2->z - s1->z * s2->y;
d->y=s1->z * s2->x - s1->x * s2->z;
d->z=s1->x * s2->y - s1->y * s2->x;
return d;
}

View file

@ -46,6 +46,11 @@ void VectorTest(void)
D3DRMVectorSubtract(&r,&u,&v);
e.x=-2.0;e.y=-2.0;e.z=1.0;
expect_vec(e,r);
/*_______________________VectorCrossProduct_______________________*/
D3DRMVectorCrossProduct(&r,&u,&v);
e.x=-4.0;e.y=4.0;e.z=0.0;
expect_vec(e,r);
}
START_TEST(vector)