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.


On 3/21/06, LDuke <[EMAIL PROTECTED]> wrote:
> --
> [ Picked text/plain from multipart/alternative ]
> Isn't that exactly what you wanted?
>
> "Valve, why did you do VectorNormalize() instead of Vector::Normalize() ?"
>
>
>
> On 3/20/06, Jorge Rodriguez <[EMAIL PROTECTED]> wrote:
> >
> > [EMAIL PROTECTED] wrote:
> >
> > >By the way, there already is a member function for this.  It's called
> > NormalizeInPlace()
> > >
> > >
> > At the risk of reviving this fruitless discussion from its grave:
> >
> > NormalizeInPlace() and the Normalize() that I speak of are different.
> > Normalize() will return a normalized Vector, and NormalizeInPlace will
> > normalize the Vector it is called on.
> >
> > --
> > Jorge "Vino" Rodriguez
> >
> >
> > _______________________________________________
> > To unsubscribe, edit your list preferences, or view the list archives,
> > please visit:
> > http://list.valvesoftware.com/mailman/listinfo/hlcoders
> >
> >
> --
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives, please 
> visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>


--
Oscar Vives
--------------------------------------------------------------------
Consultor de Software Libre

  www.servicios-dpi.com
  Telf 645 167 472
  [EMAIL PROTECTED]
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to