View unanswered posts | View active topics It is currently Thu Dec 26, 2024 5:15 pm



Reply to topic  [ 4 posts ] 
 Need help on vectors lulz 
Author Message
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post 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?


Tue Jun 14, 2011 2:12 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Need help on vectors lulz
vector.AbsRadAngle for angle in radians.
vector.AbsDegAngle for angle in degrees.


Tue Jun 14, 2011 2:35 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: Need help on vectors lulz
It was that easy?
Thanks.


Tue Jun 14, 2011 2:48 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Need help on vectors lulz
Alternately, in more general cases, you can get the angle between two cartesian coordinates with math.atan2.


Tue Jun 14, 2011 8:14 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users


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
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.122s | 16 Queries | GZIP : Off ]