BIS fnc rotateVector3D: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<code>([^<]*)<nowiki\/>\[\[([a-zA-Z0-9_]+)\]\](.*)<\/code>" to "<code>$1$2$3</code>")
m (Text replacement - "\{\{ *Wikipedia *\| *([-a-zA-Z0-9_#':%\/\\]+) *\| *([-a-zA-Z0-9_#':%\/\\ ]+) *\}\}" to "{{Link|https://en.wikipedia.org/wiki/$1|$2}}")
 
(5 intermediate revisions by the same user not shown)
Line 10: Line 10:
|s1= [vector, angle, axis] call [[BIS_fnc_rotateVector3D]]
|s1= [vector, angle, axis] call [[BIS_fnc_rotateVector3D]]


|p1= [vector, angle, axis]: [[Array]]
|p1= vector: [[Array]] in format [[Vector3D]]
|p2= vector: [[Array]] - given vector in format [[Vector3D]]
 
|p3= angle: [[Number]] - given angle (taken in the opposite direction to the one defined by the {{Wikipedia|Right-hand_rule|right hand rule}})
|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}})
|p4= axis: [[Number]] - rotation axis:
 
|p3= axis: [[Number]] - rotation axis:
* 0 - '''X''' axis
* 0 - '''X''' axis
* 1 - '''Y''' axis
* 1 - '''Y''' axis
Line 19: Line 20:
|r1= [[Array]] - rotated vector in format [[Vector3D]]
|r1= [[Array]] - rotated vector in format [[Vector3D]]


|x1= <code>[vectorDir [[player]], 90, 2] [[call]] [[BIS_fnc_rotateVector3D]];</code>
|x1= <sqf>[vectorDir player, 90, 2] call BIS_fnc_rotateVector3D;</sqf>


|seealso= [[BIS_fnc_transformVectorDirAndUp]] [[BIS_fnc_rotateVector2D]]
|seealso= [[BIS_fnc_transformVectorDirAndUp]] [[BIS_fnc_rotateVector2D]]
}}
}}

Latest revision as of 00: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