Data Realms Fan Forums
http://45.55.195.193/

Need help on vectors lulz
http://45.55.195.193/viewtopic.php?f=73&t=24226
Page 1 of 1

Author:  Asklar [ Tue Jun 14, 2011 2:12 am ]
Post subject:  Need help on vectors lulz

Yes, I knew that the title would catch your attention.

First off, I want to get a vector that starts at self and ends in self.target. The code should be something like
Code:
   self.NewVector = SceneMan:ShortestDistance(self.Pos,self.target.Pos,SceneMan.SceneWrapsX)

, right?

Now, with which commands can I get information about the vector, like the angle it has?

Author:  CaveCricket48 [ Tue Jun 14, 2011 2:35 am ]
Post subject:  Re: Need help on vectors lulz

vector.AbsRadAngle for angle in radians.
vector.AbsDegAngle for angle in degrees.

Author:  Asklar [ Tue Jun 14, 2011 2:48 am ]
Post subject:  Re: Need help on vectors lulz

It was that easy?
Thanks.

Author:  Grif [ Tue Jun 14, 2011 8:14 am ]
Post subject:  Re: Need help on vectors lulz

Alternately, in more general cases, you can get the angle between two cartesian coordinates with math.atan2.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/