BIS fnc transformVectorDirAndUp: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (fix page appearance)
m (Text replacement - "\{\{( *)Informative( *)\|" to "{{$1Feature$2|$2Informative$2|")
Line 8: Line 8:


| 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].
| 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].
{{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]]}}
{{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]]
[[Image:transformVectorUpAndDir.jpg|300px]]



Revision as of 01:01, 7 February 2021

Hover & click on the images for description

Description

Description:
Description needed
Execution:
call
Groups:
Vectors

Syntax

Syntax:
Syntax needed
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:
Return value needed

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:
See also needed

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