d3drm: Implement D3DRMVectorscale.

This commit is contained in:
David Adam 2007-04-19 21:09:48 +02:00 committed by Alexandre Julliard
parent d882ee2746
commit 5524923c07
3 changed files with 17 additions and 2 deletions

View File

@ -16,7 +16,7 @@
@ stub D3DRMVectorRandom
@ stub D3DRMVectorReflect
@ stub D3DRMVectorRotate
@ stub D3DRMVectorScale
@ stdcall D3DRMVectorScale(ptr ptr long)
@ stdcall D3DRMVectorSubtract(ptr ptr ptr)
@ stub Direct3DRMCreate
@ stub DllCanUnloadNow

View File

@ -74,3 +74,12 @@ D3DVALUE WINAPI D3DRMVectorModulus(LPD3DVECTOR v)
result=sqrt(v->x * v->x + v->y * v->y + v->z * v->z);
return result;
}
/* Scale a vector */
LPD3DVECTOR WINAPI D3DRMVectorScale(LPD3DVECTOR d, LPD3DVECTOR s, D3DVALUE factor)
{
d->x=factor * s->x;
d->y=factor * s->y;
d->z=factor * s->z;
return d;
}

View File

@ -32,7 +32,7 @@
void VectorTest(void)
{
D3DVALUE mod;
D3DVALUE mod,par;
D3DVECTOR e,r,u,v;
u.x=2.0;u.y=2.0;u.z=1.0;
@ -60,6 +60,12 @@ void VectorTest(void)
/*_______________________VectorModulus_____________________________*/
mod=D3DRMVectorModulus(&u);
ok((mod == 3.0), "Expected 3.0, Got %f",mod);
/*_______________________VectorScale__________________________*/
par=2.5;
D3DRMVectorScale(&r,&v,par);
e.x=10.0; e.y=10.0; e.z=0.0;
expect_vec(e,r);
}
START_TEST(vector)