d3drm: Implement D3DRMVectorRandom.

This commit is contained in:
David Adam 2007-04-19 21:11:02 +02:00 committed by Alexandre Julliard
parent 819362d0f7
commit f9e6f42b86
2 changed files with 11 additions and 1 deletions

View File

@ -13,7 +13,7 @@
@ stdcall D3DRMVectorDotProduct(ptr ptr)
@ stdcall D3DRMVectorModulus(ptr)
@ stdcall D3DRMVectorNormalize(ptr)
@ stub D3DRMVectorRandom
@ stdcall D3DRMVectorRandom(ptr)
@ stub D3DRMVectorReflect
@ stub D3DRMVectorRotate
@ stdcall D3DRMVectorScale(ptr ptr long)

View File

@ -92,6 +92,16 @@ LPD3DVECTOR WINAPI D3DRMVectorNormalize(LPD3DVECTOR u)
return u;
}
/* Returns a random unit vector */
LPD3DVECTOR WINAPI D3DRMVectorRandom(LPD3DVECTOR d)
{
d->x = rand();
d->y = rand();
d->z = rand();
D3DRMVectorNormalize(d);
return d;
}
/* Scale a vector */
LPD3DVECTOR WINAPI D3DRMVectorScale(LPD3DVECTOR d, LPD3DVECTOR s, D3DVALUE factor)
{