Adam's Lair Forum

game development and casual madness
It is currently 2020/01/21, 13:12

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 11 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: 2014/07/27, 16:45 
Novice Member
Novice Member

Joined: 2014/07/27, 02:41
Posts: 11
Role: Hobbyist
SirePi wrote:
pedromundo wrote:
Now, I'll update the op to include the newer and more elegant solution; but considering that my sprite was facing the right direction, why'd I have to add PI/2 anyways?


Do you mean the "correct" direction (i.e. facing up) or the "right" direction (i.e. facing right?) :D

in the first case, -Pi/2 is what is needed to compensate for the difference in behavior between Vector2.Angle and Atan2 (see my previous post)
EDIT:
In addition, in your first version of the post you calculated the direction as Source - Target, which is wrong. The correct way is, as you did now, Target - Source :)


Meant "right" as in... correct ;)
Yeah, had that mixed up at first, but I'll just blame it on the Math/Duality miscommunication, because otherwise I'd have a final vector with the correct attitude, and opposite direction... that would have been way easier to spot and fix :omg:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: MSN [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group