Looking back at all the posts, the only thing I can glean is simply this;
If you look at hl1, everywhere that valve used CVEctor->Normalize(); it was
like this:

Vector blah = Vector(x,y,z);
blah = blah.Normalize();

so you're copying the vector around.
They simply replaced that with
Vector blah = Vector(x,y,z);
blah->NormalizeInPlace();


-----Original Message-----
From: Jorge Rodriguez [mailto:[EMAIL PROTECTED]
Sent: March 23, 2006 12:58 PM
To: hlcoders@list.valvesoftware.com
Subject: Re: [hlcoders] Why VectorNormalize?

Tei wrote:

>Theres the C version:
>
>float VectorNormalize (vec3_t v){
>       float   length, ilength;
>
>       length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
>       length = sqrt (length);         // FIXME
>
>       if (length)     {
>               ilength = 1/length;
>               v[0] *= ilength;
>               v[1] *= ilength;
>               v[2] *= ilength;
>       }
>
>       return length;
>}
>
>Quake 1 source:
>http://www.untitled-game.org/source/mathlibc.html
>
>Thats why return a float. Because is C code. And is the right thing
>for "Think in C" mode. But is the wrong thing for "Think in OOP" mode.
>So is right that Valve change this stuff.
>
>
Nevermind.

--
Jorge "Vino" Rodriguez


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders




__________ NOD32 1.1454 (20060321) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com



_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to