Commit 3f965d58 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

dsound: Make AngleBetweenVectorsRad when vectors have no magnitude.

parent 545a774f
......@@ -110,6 +110,9 @@ static inline D3DVALUE AngleBetweenVectorsRad (const D3DVECTOR *a, const D3DVECT
product = ScalarProduct (a,b);
la = VectorMagnitude (a);
lb = VectorMagnitude (b);
if (!la || !lb)
return 0;
cos = product/(la*lb);
angle = acos(cos);
TRACE("angle between (%f,%f,%f) and (%f,%f,%f) = %f radians (%f degrees)\n", a->x, a->y, a->z, b->x,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment