Thread Tools Display Modes
Prev Previous Post   Next Post Next
09-15-14, 12:56 AM   #21
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Gello View Post
UnitDistanceSquared is, as it says, the distance from you to the unit, squared. If your friendly target is 50 yards away, UnitDistanceSquared("target") returns 2500. I've not done any debugprofilestop testing on it to tell if it's faster than (x2-x1)^2 + (y2-y1)^2, but it's very likely.
I wonder why they're not doing the final step of that equation to give us 50 instead of 2500? Is there any situation where you'd actually want the squared distance, and wouldn't just be immedately doing (value ^ 0.5) in your code?
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
 
 

WoWInterface » Site Forums » Archived Beta Forums » WoD Beta archived threads » Added/removed API from live (18414) to build 18566


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off