BIS fnc vectorFromXToY: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
(Page filling)
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>[</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}}]]

Revision as of 17:03, 30 May 2018

Hover & click on the images for description

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.
Execution:
call
Groups:
Uncategorised

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

See also:
velocitysetVelocityvectorAdd

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section