BIS fnc rotateVector3D: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (infobox to template)
m (Text replacement - "\{\{ *Wikipedia *\| *([-a-zA-Z0-9_#':%\/\\]+) *\| *([-a-zA-Z0-9_#':%\/\\ ]+) *\}\}" to "{{Link|https://en.wikipedia.org/wiki/$1|$2}}")
 
(24 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Function|= Comments
{{RV|type=function


| arma3 |Game name=
|game1= arma3
|version1= 1.00


|1.00|Game version=
|gr1= Vectors


<!---|arg= local |Multiplayer Arguments=--->
|descr= Rotates the vector around the given axis by the given angle


<!---|eff= local |Multiplayer Effects=--->
|s1= [vector, angle, axis] call [[BIS_fnc_rotateVector3D]]


| <pre>/*
|p1= vector: [[Array]] in format [[Vector3D]]
* Author: Zozo
* Rotates the vector around the given axis by the given angle
*
* Arguments:
* 0: _vector ARRAY [x,y,z]
* 1: _angle SCALAR (accepts also negative numbers)
* 2: _axis (AXIS_X - 0, AXIS_Y - 1 AXIS_Z - 2)
*
* Return Value:
* ARRAY [x,y,z]
*
* Example:
[vectorDir player, 90, AXIS_Z] call BIS_rotateVector;
*
*
* Dependency: BIS_fnc_multiplySquareMatrixByVector
*/</pre>{{placeholder}}<!-- Remove this after fill-in --> |Description=


|[] call [[BIS_fnc_rotateVector3D]]|Syntax=
|p2= angle: [[Number]] - given angle (taken in the opposite direction to the one defined by the {{Link|https://en.wikipedia.org/wiki/Right-hand_rule|right hand rule}})


|p1= parameter: Datatype - (Optional, default defValue) description |Parameter 1=
|p3= axis: [[Number]] - rotation axis:
* 0 - '''X''' axis
* 1 - '''Y''' axis
* 2 - '''Z''' axis
|r1= [[Array]] - rotated vector in format [[Vector3D]]


|Datatype - description|Return value=
|x1= <sqf>[vectorDir player, 90, 2] call BIS_fnc_rotateVector3D;</sqf>


|x1= <code></code>|Example 1=
|seealso= [[BIS_fnc_transformVectorDirAndUp]] [[BIS_fnc_rotateVector2D]]
 
| |See also=
}}
}}
[[Category:Function Group: Vectors|{{uc:rotateVector3D}}]]
[[Category:Functions|{{uc:rotateVector3D}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:rotateVector3D}}]]

Latest revision as of 01:47, 24 February 2023

Hover & click on the images for description

Description

Description:
Rotates the vector around the given axis by the given angle
Execution:
call
Groups:
Vectors

Syntax

Syntax:
[vector, angle, axis] call BIS_fnc_rotateVector3D
Parameters:
vector: Array in format Vector3D
angle: Number - given angle (taken in the opposite direction to the one defined by the right hand rule)
axis: Number - rotation axis:
  • 0 - X axis
  • 1 - Y axis
  • 2 - Z axis
Return Value:
Array - rotated vector in format Vector3D

Examples

Example 1:
[vectorDir player, 90, 2] call BIS_fnc_rotateVector3D;

Additional Information

See also:
BIS_fnc_transformVectorDirAndUp BIS_fnc_rotateVector2D

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