Difference between revisions of "BIS fnc vectorFromXToY"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
m (Text replacement - " <nowiki>[</nowiki>" to " [<nowiki/>")
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
+
{{Function|Comments=
{{Function|= Comments
 
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| arma2 |= Game name
+
| arma2 |Game name=
  
|1.00|= Game version
+
|1.00|Game version=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| <pre>
+
| Returns a unit vector that 'points' from ''vector1'' to ''vector2''.
/************************************************************
+
This is a very useful function as it can be used with the [[velocity]] command to move an object from one position to another (i.e ''vector1'' to ''vector2'').
Vector From X to Y
+
{{Informative|ensure both positions are found using [[getPosASL]].}} |Description=
  
 
<resultant vector> = [<vector1>,<vector2>] call BIS_fnc_vectorFromXToY
 
<resultant vector> = [<vector1>,<vector2>] call BIS_fnc_vectorFromXToY
  
Operand types:
+
____________________________________________________________________________________________
<vector1>: array
 
<vector2>: array
 
<resultant vector>: array
 
 
 
Returns a unit vector that 'points' from <vector1> to <vector2>.
 
This is a very useful function, as it can be used with the velocity
 
command to move an object from one position to another
 
(ie <vector1> to <vector2>) - ensure both positions are found using getposasl.
 
************************************************************/
 
  
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
+
| [vector1, vector2] call [[BIS_fnc_vectorFromXToY]] |Syntax=
____________________________________________________________________________________________
 
  
| <!-- [] call [[BIS_fnc_vectorFromXToY]]; --> |= Syntax
+
|p1= vector1: [[Array]] |Parameter 1=
  
|p1= |= Parameter 1
+
|p2= vector2: [[Array]] |Parameter 2=
  
| |= Return value
+
| [[Array]] |Return value=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
|x1= <code></code> |=  
+
|x1= <code>_resultVector = [<nowiki/>[[getPosASL]] [[vehicle]] [[player]], [[getPosASL]] airTarget] [[call]] [[BIS_fnc_vectorFromXToY]];</code> |Example 1=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| |= See also
+
| [[velocity]], [[setVelocity]], [[vectorAdd]] |See also=
 
 
 
}}
 
}}
  
Line 50: Line 38:
  
 
<h3 style="display:none">Bottom Section</h3>
 
<h3 style="display:none">Bottom Section</h3>
 +
[[Category:Functions|{{uc:vectorFromXToY}}]]
 
[[Category:Function Group: Vectors|{{uc:vectorFromXToY}}]]
 
[[Category:Function Group: Vectors|{{uc:vectorFromXToY}}]]
[[Category:Functions|{{uc:vectorFromXToY}}]]
 
 
[[Category:{{Name|arma2}}: Functions|{{uc:vectorFromXToY}}]]
 
[[Category:{{Name|arma2}}: Functions|{{uc:vectorFromXToY}}]]
 
[[Category:{{Name|arma2oa}}: Functions|{{uc:vectorFromXToY}}]]
 
[[Category:{{Name|arma2oa}}: Functions|{{uc:vectorFromXToY}}]]
 
[[Category:{{Name|tkoh}}: Functions|{{uc:vectorFromXToY}}]]
 
[[Category:{{Name|tkoh}}: Functions|{{uc:vectorFromXToY}}]]
 
[[Category:{{Name|arma3}}: Functions|{{uc:vectorFromXToY}}]]
 
[[Category:{{Name|arma3}}: Functions|{{uc:vectorFromXToY}}]]

Latest revision as of 13:16, 19 March 2020

Introduced with Arma 2 version 1.001.00
Hover & click on the images for descriptions

Description

Description:
Returns a unit vector that 'points' from vector1 to vector2. This is a very useful function as it can be used with the velocity command to move an object from one position to another (i.e vector1 to vector2).
ensure both positions are found using getPosASL.

Syntax

Syntax:
[vector1, vector2] call BIS_fnc_vectorFromXToY
Parameters:
vector1: Array
vector2: Array
Return Value:
Array

Examples

Example 1:
_resultVector = [getPosASL vehicle player, getPosASL airTarget] call BIS_fnc_vectorFromXToY;

Additional Information

Execution:
call
See also:
velocitysetVelocityvectorAdd

Notes

i
Only post proven facts here. Report bugs on the Feedback Tracker and discuss on the Arma Discord or on the Forums.

Notes

Bottom Section