CLEO Help Get direction of a line from 2 points

CLEO related
Status
Not open for further replies.

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
Hi, I'm struggling to get direction of a line made from 2 points.

For example:
00A0: store_actor $PLAYER_ACTOR position_to 0@ 1@ 2@
00A0: store_actor 31@ position_to 3@ 4@ 5@

What I need is something like:
xxxx: 6@ = vector from 0@ 1@ to 3@ 4@
xxxx: 7@ = get direction of the vector 6@
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
If anyone has the same problem:
http://gtaforums.com/topic/479157-angles-in-script-help/
Code:
:getZAngleBetweenPoints
{
 Parameters:
   Passed:
     0@ - origin X
     1@ - origin Y
     2@ - destination X
     3@ - destination Y
   Result:
     4@ - absolute Z angle

 Example:
   0AB1: call_scm_func @getZAngleBetweenPoints 4 from_XY 0.0 0.0 and_XY 1.0 0.0 store_to 1@
}
0063: 0@ -= 2@
0063: 1@ -= 3@
0604: get_Z_angle_for_point 0@ 1@ store_to 4@
0AB2: ret 1 4@
 
Status
Not open for further replies.
Top