Difference between revisions of "BIS fnc transformVectorDirAndUp"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects? in MP|Multiplayer Effects(...)
m (Text replacement - " |r1=[[" to " |r1= [[")
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Function| arma3|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 [https://en.wikipedia.org/wiki/Right-hand_rule right hand rule].<br><br>
+
{{RV|type=function
 +
 
 +
|game1= arma3
 +
|version1= 1.98
 +
 
 +
|gr1= Vectors
 +
 
 +
|descr= Rotates both [[vectorDir]] and [[vectorUp]] on 3 axes: z (yaw), x (pitch) and y (roll). Positive angle direction is according to the {{Wikipedia|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]]}}
 +
[[Image:transformVectorUpAndDir.jpg|300px]]
 +
 
 +
|s1=[vectorDirAndUp, yaw, pitch, roll] call [[BIS_fnc_transformVectorDirAndUp]]
 +
 
 +
|p1=[vectorDirAndUp, yaw, pitch, roll]: [[Array]]
  
{{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]]}}
 
[[Image:transformVectorUpAndDir.jpg|400px]]| [vectorDirAndUp, yaw, pitch, roll] call [[BIS_fnc_transformVectorDirAndUp]];|p1=[vectorDirAndUp, yaw, pitch, roll]: [[Array]]
 
 
|p2= vectorDirAndUp (Optional): [[Array]] in format [vectorDir, vectorUp]. Default: [[0,1,0],[0,0,1]]
 
|p2= vectorDirAndUp (Optional): [[Array]] in format [vectorDir, vectorUp]. Default: [[0,1,0],[0,0,1]]
 +
 
|p3= yaw (Optional): [[Number]] - yaw angle. Default: 0
 
|p3= yaw (Optional): [[Number]] - yaw angle. Default: 0
 +
 
|p4= pitch (Optional): [[Number]] - pitch angle. Default: 0
 
|p4= pitch (Optional): [[Number]] - pitch angle. Default: 0
|p5= roll (Optional): [[Number]] - roll angle. Default: 0| [[Array]] in format [vectorDir, vectorUp]|x1= <code>_vDirUp = <nowiki>[[</nowiki>[[vectorDirVisual]] uav, [[vectorUpVisual]] uav], 0, 0, 90] [[call]] [[BIS_fnc_transformVectorDirAndUp]];</code>|x2= Create UAV object and make it pitch with mouse up/down and roll with mouse left/right: <code>uav = "B_UAV_05_F" [[createVehicle]] [0,0,0];
+
 
 +
|p5= roll (Optional): [[Number]] - roll angle. Default: 0
 +
 
 +
|r1= [[Array]] in format [vectorDir, vectorUp]
 +
 
 +
|x1= <code>_vDirUp = <nowiki>[[</nowiki>[[vectorDirVisual]] uav, [[vectorUpVisual]] uav], 0, 0, 90] [[call]] [[BIS_fnc_transformVectorDirAndUp]];</code>
 +
 
 +
|x2= Create UAV object and make it pitch with mouse up/down and roll with mouse left/right: <code>uav = "B_UAV_05_F" [[createVehicle]] [0,0,0];
 
uav [[attachTo]] [<nowiki/>[[player]], [0,30,10]];
 
uav [[attachTo]] [<nowiki/>[[player]], [0,30,10]];
 
[[findDisplay]] 46 [[displayAddEventHandler]] ["MouseMoving",  
 
[[findDisplay]] 46 [[displayAddEventHandler]] ["MouseMoving",  
Line 15: Line 35:
 
<nowiki>[</nowiki>[[vectorDirVisual]] uav, [[vectorUpVisual]] uav],  
 
<nowiki>[</nowiki>[[vectorDirVisual]] uav, [[vectorUpVisual]] uav],  
 
[[getDirVisual]] uav,  
 
[[getDirVisual]] uav,  
[[_this]] [[select]] 2,  
+
[[Magic Variables#this|_this]] [[select]] 2,  
[[_this]] [[select]] 1
+
[[Magic Variables#this|_this]] [[select]] 1
 
]  
 
]  
 
[[call]] [[BIS_fnc_transformVectorDirAndUp]]
 
[[call]] [[BIS_fnc_transformVectorDirAndUp]]
Line 22: Line 42:
 
}];</code>
 
}];</code>
  
| [[vectorDir]], [[vectorUp]], [[setVectorDirAndUp]]}}
+
|seealso= [[vectorDir]], [[vectorUp]], [[setVectorDirAndUp]]
 
+
}}
 
 
 
 
[[Category:Functions|{{uc:transformVectorDirAndUp}}]]
 
[[Category:{{Name|arma3}}: Functions|{{uc:transformVectorDirAndUp}}]]
 

Latest revision as of 23:35, 7 August 2021

Hover & click on the images for description

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.
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]]
transformVectorUpAndDir.jpg
Execution:
call
Groups:
Vectors

Syntax

Syntax:
[vectorDirAndUp, yaw, pitch, roll] call BIS_fnc_transformVectorDirAndUp
Parameters:
[vectorDirAndUp, yaw, pitch, roll]: Array
vectorDirAndUp (Optional): Array in format [vectorDir, vectorUp]. Default: [[0,1,0],[0,0,1]]
yaw (Optional): Number - yaw angle. Default: 0
pitch (Optional): Number - pitch angle. Default: 0
roll (Optional): Number - roll angle. Default: 0
Return Value:
Array in format [vectorDir, vectorUp]

Examples

Example 1:
_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:
vectorDirvectorUpsetVectorDirAndUp

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