Thanks Halfdan, I guess for every seemingly odd implementation,
there's a 10+ year old performance design choice ;-) Fair enough, but
the SDK manual could be a little more clear on the difference between
the two!
--
stockholm.postproduction | www.stopost.se
On 2/15/06, Halfdan Ingvarsson <hingvars(at)softimage.com> wrote:
>
>
> It's down to our internal math library. For the longest time it didn't have
> an assignment operator because of fears that people would start assigning
> vectors/matrices/transforms/quaternions back'n'forth and
> totally kill performance and/or waste memory. Remember, this was way back
> 12-15 years ago when optimising C++ compilers were few and far between
> (think cfront). Nowadays they fold assignment + operation into a single
> thing, no problem.
>
> Hence two versions of normalize: One that normalizes the vector in-place,
> and the other one that assigns from one vector to another one and normalizes
> the result.
>
> Now it actually comes in handy in the scripting environment, since it saves
> you a dispatch call down through the scripting engine into the SDK for the
> vector-vector assignment. Handy for those tight, inner loops.
>
> - ½
>
> ________________________________
> From: owner-xsi(at)Softimage.COM on behalf of Arvid Björn
> Sent: Wed 15-Feb-06 08:45
>
> To: XSI(at)Softimage.COM
> Subject: Re: Vector to rotation
>
>
>
>
> Hm. That didn't make sense to me. The way I've programmed with vectors
> in the past:
>
> Vector v1(Vector(0,10,0));
> Vector v2 = v1;
> v2.Normalize();
>
> Now you have one normalized vector (v2) and one 10 units long (v1).
> What seems to be the problem?
>
>
> --
> stockholm.postproduction | www.stopost.se
>
> On 2/15/06, kim aldis <kim(at)cg-soup.com> wrote:
> > You'd end up in a mess if you did that. Objects like vectors, perversely,
> > assign by reference, not by value. Following that assignment, anything you
> > did to v1 would also change v2.
> >
> > I'm not too bothered by the naming. Like all things, when you've worked
> out
> > what it does, so long as it does what you need you kind of grow in to it.
> >
> >
> >
> > > -----Original Message-----
> > > From: owner-xsi(at)Softimage.COM
> > > [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Arvid Björn
> > > Sent: 15-February-2006 12:36
> > > To: XSI(at)Softimage.COM
> > > Subject: Re: Vector to rotation
> > >
> > > v2 = v1;
> > > v2.Normalize();
> > >
> >
> >
> > ---
> > Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
> > unsubscribe xsi
> >
>
> ---
> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
> unsubscribe xsi
>
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi