Difference between revisions of "BIS fnc transformVectorDirAndUp"
Jump to navigation
Jump to search
killzone_kid (talk | contribs) m |
Lou Montana (talk | contribs) m (Text replacement - "\{\{ *Wikipedia *\| *([-a-zA-Z0-9_#':%\/\\]+) *\| *([-a-zA-Z0-9_#':%\/\\ ]+) *\}\}" to "{{Link|https://en.wikipedia.org/wiki/$1|$2}}") |
||
(33 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{RV|type=function |
− | |||
− | | | + | |game1= arma3 |
+ | |version1= 1.98 | ||
− | | | + | |gr1= Vectors |
− | |||
− | | Rotates both [[vectorDir]] and [[vectorUp]] on 3 axes: z (yaw), x (pitch) and y (roll). Positive angle direction is according to the | + | |descr= [[Image:transformVectorUpAndDir.jpg|300px|right]] |
+ | Rotates both [[vectorDir]] and [[vectorUp]] on 3 axes: z (yaw), x (pitch) and y (roll). Positive angle direction is according to the {{Link|https://en.wikipedia.org/wiki/Right-hand_rule|right hand rule}}. | ||
+ | {{Feature|Informative| The vectors are rotated first on '''z''' axis then on '''x''' axis then on '''y''' axis. For example standard [[0,1,0],[0,0,1]] pair rotated 90 degrees on every axis will result in [[0,0,1],[0,-1,0]]}} | ||
− | + | |s1= [vectorDirAndUp, yaw, pitch, roll] call [[BIS_fnc_transformVectorDirAndUp]] | |
− | |||
− | |||
− | | [ | + | |p1= vectorDirAndUp: [[Array]] in format [vectorDir, vectorUp] -(Optional, default [[0,1,0],[0,0,1]]) |
− | + | |p2= yaw: [[Number]] - (Optional, default 0) yaw angle | |
− | |p2 | ||
− | |||
− | |||
− | |||
− | | [[ | + | |p3= pitch: [[Number]] - (Optional, default 0) pitch angle |
− | |||
− | | | + | |p4= roll: [[Number]] - (Optional, default 0) roll angle |
− | |x2= Create UAV object and make it pitch with mouse up/down and roll with mouse left/right: < | + | |r1= [[Array]] in format [vectorDir, vectorUp] |
− | uav | + | |
− | + | |x1= <sqf>private _vDirUp = [[vectorDirVisual uav, vectorUpVisual uav], 0, 0, 90] call BIS_fnc_transformVectorDirAndUp;</sqf> | |
+ | |||
+ | |x2= Create UAV object and make it pitch with mouse up/down and roll with mouse left/right: | ||
+ | <sqf> | ||
+ | uav = "B_UAV_05_F" createVehicle [0,0,0]; | ||
+ | uav attachTo [player, [0,30,10]]; | ||
+ | findDisplay 46 displayAddEventHandler ["MouseMoving", | ||
{ | { | ||
− | uav | + | uav setVectorDirAndUp |
( | ( | ||
[ | [ | ||
− | + | [vectorDirVisual uav, vectorUpVisual uav], | |
− | + | getDirVisual uav, | |
− | + | _this select 2, | |
− | + | _this select 1 | |
− | ] | + | ] |
− | + | call BIS_fnc_transformVectorDirAndUp | |
); | ); | ||
− | }];</ | + | }]; |
− | + | </sqf> | |
− | |||
− | |||
+ | |seealso= [[vectorDir]] [[vectorUp]] [[setVectorDirAndUp]] | ||
}} | }} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 01:47, 24 February 2023
Description
- Description:
-
Rotates both vectorDir and vectorUp on 3 axes: z (yaw), x (pitch) and y (roll). Positive angle direction is according to the right hand rule.
- Execution:
- call
- Groups:
- Vectors
Syntax
- Syntax:
- [vectorDirAndUp, yaw, pitch, roll] call BIS_fnc_transformVectorDirAndUp
- Parameters:
- vectorDirAndUp: Array in format [vectorDir, vectorUp] -(Optional, default [[0,1,0],[0,0,1]])
- yaw: Number - (Optional, default 0) yaw angle
- pitch: Number - (Optional, default 0) pitch angle
- roll: Number - (Optional, default 0) roll angle
- Return Value:
- Array in format [vectorDir, vectorUp]
Examples
- Example 1:
- private _vDirUp = [[vectorDirVisual uav, vectorUpVisual uav], 0, 0, 90] call BIS_fnc_transformVectorDirAndUp;
- Example 2:
- Create UAV object and make it pitch with mouse up/down and roll with mouse left/right:
uav = "B_UAV_05_F" createVehicle [0,0,0]; uav attachTo [player, [0,30,10]]; findDisplay 46 displayAddEventHandler ["MouseMoving", { uav setVectorDirAndUp ( [ [vectorDirVisual uav, vectorUpVisual uav], getDirVisual uav, _this select 2, _this select 1 ] call BIS_fnc_transformVectorDirAndUp ); }];
Additional Information
- See also:
- vectorDir vectorUp setVectorDirAndUp
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