From: Kevin M. <ke...@vr...> - 2003-04-18 21:40:50
|
yes. :) On Fri, 18 Apr 2003, Patrick Hartling wrote: > So what's the consensus on this? If I'm going to change the API, I'd > like to do what people want. > > Regarding the suggestion to rename one of the gmtl::cross() overloads to > gmtl::makeCross(), should it go in Generate.h? > > -Patrick > > Allen Bierbaum wrote: > > Ben Scott wrote: > > > >> He means the prenormalization length. > >> > >> I agree with Kevin's comments. :) > > > > > > I agreed with Kevin's comments, but then I thought some more and now I > > am not sure. > > > > I do understand why we return the pre normalized length out the backend. > > Doing this can help in some algorithms. (I think dist from point to > > plane may be able to use this, but I don't remember). > > > > But thinking about it why can't the user just do this: > > > > float len = lengthSqr(vec); > > if (not isEqual(len, 1.0, epsilon)) > > len = Math::sqr(len); > > vec /= len; > > > > This can be easily written in any algorithm that wants to take advantage > > of the performance gain. > > > > I am not insisting on doing it this way or anything, but it seems that > > making the API more complex for something that "might" be useful but can > > easily be done by the user really doesn't fit with our ideas. > > > > (Also when you take into account that the method where we return the > > float from normalize() actually introduces another temporary for the > > return value it isn't even as optimal as the hand coded one above). > > > > Thats what I am thinking right now at least... give me another couple > > minutes and I will have completely changed my mind and think we should > > just use templates, python, or some other crazy crap for all of it. :) > > > > -Allen > > > >> > >> cheers, > >> -ben > >> > >> Justin Hare wrote: > >> > >>>> normalizeAndGetLength( vec ); // reads well, and shows the special opt > >>>> normalize( vec ); // standard method, ret vec out back > >>> > >>> > >>> > >>> > >>> Wouldn't the length of the vector after normalization always be the > >>> same? > >>> Or do you mean to return the pre-normalization length? > > > > -- *--*---*---*----*-----*------*------*-----*----*---*---*--* Kevin Meinert /_/ home - http://www.vrsource.edu/~kevin \ / music - http://subatomic.vrsource.org \/ __ \/ \__ \_\ |