[Bf-committers] Normalise patch

Martin Poirier theeth at yahoo.com
Thu Feb 9 17:19:34 CET 2006



--- Nathan Vegdahl <nathan at cessen.com> wrote:

> Hey guys,
>     I fixed a potential bug in the Normalise() code.
>  It was setting 
> super-small vectors to <0,0,0>, which really isn't a
> good behavior for 
> something that's supposed to return vectors of
> length 1.
>     I simply changed it to set super-small vectors
> to a default <0,0,1> 
> instead.
> 
>     It still returns zero for the length, so it can
> be checked.  But 
> this way it has a graceful default behavior.

While I can understand how that's better, I find the
use of a default magic value very distasteful.

With that change, instead of having to check if the
result of the normalise is a null vector, we'd have to
check beforehand to see if it's lower than a certain
threshold (since the rest of the operations on that
vector will be on a magic value, hence, wrong).

Martin

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Bf-committers mailing list