Difference between revisions of "User talk:Cron Stardust/LLVector Spec"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with "== Using returned references more completely == While I converted all the method signatures that had a return type of void to const LLVector&, there are still several methods tha…")
(No difference)

Revision as of 15:40, 6 April 2014

Using returned references more completely

While I converted all the method signatures that had a return type of void to const LLVector&, there are still several methods that return what seems like semi-useless noise: BOOL and NUM. I'm not counting the ones that should return those types, but methods like normalize, which has no business returning NUM. The in-source documentation says "Normalizes and returns the magnitude of LLVector..." Ok... Ummm.... Isn't the result of normalization SUPPOSED TO BE 1.f?!!?!!? Wouldn't it be better if it returned const LLVector& so that we could do: <cpp> LLVector vec(); vec.normalize().scale(3.f); </cpp> I certainly think so, but I'll leave this change to stew for a bit - I've got bigger spuds to fry ATM. Cron Stardust 15:40, 6 April 2014 (PDT)