BIS fnc vectorMultiply: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
m (Some wiki formatting)
 
(19 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma2
____________________________________________________________________________________________
|version1= 1.00


| arma2 |= Game name
|game2= arma2oa
|version2= 1.50


|1.00|= Game version
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| <pre>
|game4= arma3
/************************************************************
|version4= 0.50
Vector Multiply


Operand types:
|gr1= Vectors
<vector1>: array
<scale>: number
<resultant vector>: array


Returns a unit vector that 'points' from <vector1> to <vector2>.
|descr= Multiplies 3D vector by a scalar. {{Feature|arma3|Use [[vectorMultiply]] instead.}}
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.


<resultant vector> = [<vector>,<scale>] call BIS_fnc_vectorMultiply
|s1= [vector, factor] call [[BIS_fnc_vectorMultiply]]
************************************************************/


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|p1= vector: [[Array]] of [[Number]]s - to format [x,y,z]
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_vectorMultiply]]; --> |= Syntax
|p2= factor: [[Number]]


|p1= |= Parameter 1
|r1= [[Array]] of [[Number]]s - result vector


| |= Return value
|x1= <sqf>private _newVector = [[1,2,3], 3] call BIS_fnc_vectorMultiply; // returns [3,6,9]</sqf>
____________________________________________________________________________________________
 
|x1= <code></code> |=
____________________________________________________________________________________________
 
| |= See also


|seealso= [[vectorMultiply]] [[BIS_fnc_vectorDivide]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Vectors|{{uc:vectorMultiply}}]]
[[Category:Functions|{{uc:vectorMultiply}}]]
[[Category:{{Name|arma2}}: Functions|{{uc:vectorMultiply}}]]
[[Category:{{Name|arma2oa}}: Functions|{{uc:vectorMultiply}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:vectorMultiply}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:vectorMultiply}}]]

Latest revision as of 14:15, 13 July 2022

Hover & click on the images for description

Description

Description:
Multiplies 3D vector by a scalar.
Arma 3
Use vectorMultiply instead.
Execution:
call
Groups:
Vectors

Syntax

Syntax:
[vector, factor] call BIS_fnc_vectorMultiply
Parameters:
vector: Array of Numbers - to format [x,y,z]
factor: Number
Return Value:
Array of Numbers - result vector

Examples

Example 1:
private _newVector = [[1,2,3], 3] call BIS_fnc_vectorMultiply; // returns [3,6,9]

Additional Information

See also:
vectorMultiply BIS_fnc_vectorDivide

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