BIS fnc vectorFromXToY: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
Lou Montana (talk | contribs) (Page filling) |
||
Line 1: | Line 1: | ||
{{Function|Comments= | |||
{{Function|= | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| arma2 | | | arma2 |Game name= | ||
|1.00| | |1.00|Game version= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| | | 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''). | |||
{{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 | ||
____________________________________________________________________________________________ | |||
| [vector1, vector2] call [[BIS_fnc_vectorFromXToY]] |Syntax= | |||
| | |p1= vector1: [[Array]] |Parameter 1= | ||
| | |p2= vector2: [[Array]] |Parameter 2= | ||
| | | | [[Array]] |Return value= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1= <code></code> |= | |x1= <code>_resultVector = <nowiki>[</nowiki>[[getPosASL]] [[vehicle]] [[player]], [[getPosASL]] airTarget] [[call]] [[BIS_fnc_vectorFromXToY]];</code> |Example 1= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| | | | [[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:{{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
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).
- 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