[Papervision3D] does pv3d have a vector length function
sebstar55 at gmail.com
Fri Oct 17 01:21:29 PDT 2008
I actually added the moduloSquared function, it's weird actually
because I'd never heard of the length of a vector being described as
modulo before, but I was just keeping consistent with the rest of
PV3D. I always called it magnitude before.
And just to be clear, if you want the actual length of a Number3D, use
the modulo property. moduloSquared will return the modulo to the power
of 2. You may ask what's the point of this? If you're just comparing
the lenght of a Number3D with some other value you'd use :
// do something
except in the modulo getter function there's a CPU expensive square
root calculation, which is slow (although massively faster in recent
versions of the flashplayer).
// do something
Which is the same as :
which does the comparison of the modulo squared with the value
squared. I'm not explaining things very well this morning (still
drinking my coffee) but suffice it to say, it's faster to use
Number3D.isModuloGreaterThan / isModuloLessThan methods.
On Fri, Oct 17, 2008 at 12:27 AM, dsdsdsdsd <shannonhburnett at hotmail.com> wrote:
> do you know why they are using the term 'modulo' in their naming; I have
> always understood modulus as being the remainder of a fraction;
> View this message in context: http://www.nabble.com/does-pv3d-have-a-vector-length-function-tp20015936p20019792.html
> Sent from the Papervision3D mailing list archive at Nabble.com.
> Papervision3D mailing list
> Papervision3D at osflash.org
More information about the Papervision3D