[Bf-python] Mathutils.AngleBetweenVecs Fixed..

Campbell Barton cbarton at metavr.com
Thu Apr 28 09:27:55 CEST 2005


Hi, details in the patch tracker, Is this bad form? Like crossposting? 
Its a farily bad bug that kept on getting at me so I had to patch it :)

Get the patch at
https://projects.blender.org/tracker/index.php?func=detail&aid=2491&group_id=9&atid=127

- Copied text.
Hi, theres a silly bug in the python Mathutils module.
This patch fixes the following bugs.

Passing 2 vectors to Mathutils.AngleBetweenVecs() will MODIFY THE 
VECTORS PASSED.
...This is fixed by making a copy of the vectors.

If the vectors are large then this function will return nan (Not a number)
...Fixed by making the vector copies doubles instead of floats.

if the numbers of both vecs were the same then 
Mathutils.AngleBetweenVecs() would return NAN, this might not be so bad, 
but nan is hard to deal with in python, since you cant check for it 
easerly. EG NAN will never == NAN. so 0.0 is returned instead.







-- 
Campbell J Barton

133 Hope Street
Geelong West, Victoria 3218 Australia

URL:    http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241




More information about the Bf-python mailing list