get3DENCamera: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1.56)
m (Text replacement - "\[ +" to "[")
 
(63 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


|arma3|= Game name
|game1= arma3
|version1= 1.56


|1.56|= Game version
|gr1= Eden Editor
____________________________________________________________________________________________


| Returns the camera [[Object]] used by the [[Eden Editor]]. |= Description
|descr= Returns the camera [[Object]] used by the [[:Category:Eden Editor|Eden Editor]].
____________________________________________________________________________________________


| '''get3DENCamera''' |= Syntax
|s1= [[get3DENCamera]]  
| [[Object]] |= RETURNVALUE


|r1= [[Object]] - [[:Category:Eden Editor|Eden Editor]] camera


|x1= <code>// set exact yaw, pitch, and roll
|x1= <sqf>// set exact yaw, pitch, and roll
_y = 45; _p = -80; _r = 0;
_y = 45; _p = -80; _r = 0;
[[get3DENCamera]] [[setVectorDirAndUp]] [
get3DENCamera setVectorDirAndUp [
[ [[sin]] _y * [[cos]] _p,[[cos]] _y * [[cos]] _p,[[sin]] _p],
[sin _y * cos _p,cos _y * cos _p,sin _p],
[ [ [[sin]] _r,-[[sin]] _p,[[cos]] _r * [[cos]] _p],-_y] [[call]] [[BIS_fnc_rotateVector2D]]
[[sin _r,-sin _p,cos _r * cos _p],-_y] call BIS_fnc_rotateVector2D
];
];</sqf>
</code>|= EXAMPLE1
 
|x2= <code>//Look at player
|x2= <sqf>//Look at player
_a = [[positionCameraToWorld]] [0,0,0] [[vectorFromTo]] ([[getPosATL]] [[player]]);
_a = positionCameraToWorld [0,0,0] vectorFromTo (getPosATL player);
_y = [[asin]](_a [[select]] 0);
_y = asin(_a select 0);
_b = [_a,_y] [[call]] [[BIS_fnc_rotateVector2D]];
_b = [_a,_y] call BIS_fnc_rotateVector2D;
_z = _b [[select]] 2;
_z = _b select 2;
_p = [[asin]](_z / [[sqrt]]((_b [[select]] 1)^2 + _z^2));
_p = asin(_z / sqrt((_b select 1)^2 + _z^2));
get3DENCamera [[setVectorDirAndUp]] [
get3DENCamera setVectorDirAndUp [
_a,
_a,
[ [0,-[[sin]] _p,[[cos]] _p],-_y] [[call]] [[BIS_fnc_rotateVector2D]]
[[0,-sin _p,cos _p],-_y] call BIS_fnc_rotateVector2D
];
];</sqf>
</code>|= EXAMPLE2
____________________________________________________________________________________________


|  
|seealso= [[move3DENCamera]] [[set3DENAttributes]]
[[get3DENMouseOver]]
[[add3DENConnection]]
[[add3DENEventHandler]]
[[all3DENEntities]]
[[collect3DENHistory]]
[[create3DENComposition]]
[[create3DENEntity]]
[[current3DENOperation]]
[[delete3DENEntities]]
[[do3DENAction]]
[[get3DENActionState]]
[[get3DENAttribute]]
[[get3DENConnections]]
[[get3DENEntityID]]
[[get3DENGrid]] 
[[get3DENIconsVisible]]
[[get3DENLinesVisible]]
[[get3DENSelected]]
[[is3DEN]]
[[is3DENMultiplayer]]
[[move3DENCamera]]
[[remove3DENConnection]]
[[remove3DENEventHandler]]
[[removeAll3DENEventHandlers]]
[[set3DENAttributes]]
[[set3DENGrid]]
[[set3DENIconsVisible]]
[[set3DENLinesVisible]]
[[set3DENObjectType]]
|= SEEALSO
|  |= MPBEHAVIOUR
____________________________________________________________________________________________
}}
}}
<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<!-- DISCONTINUE Notes -->
<h3 style='display:none'>Bottom Section</h3>
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Command Group: Eden Editor|{{uc:{{PAGENAME}}}}]]

Latest revision as of 19:18, 8 November 2023

Hover & click on the images for description

Description

Description:
Returns the camera Object used by the Eden Editor.
Groups:
Eden Editor

Syntax

Syntax:
get3DENCamera
Return Value:
Object - Eden Editor camera

Examples

Example 1:
// set exact yaw, pitch, and roll _y = 45; _p = -80; _r = 0; get3DENCamera setVectorDirAndUp [ [sin _y * cos _p,cos _y * cos _p,sin _p], [[sin _r,-sin _p,cos _r * cos _p],-_y] call BIS_fnc_rotateVector2D ];
Example 2:
//Look at player _a = positionCameraToWorld [0,0,0] vectorFromTo (getPosATL player); _y = asin(_a select 0); _b = [_a,_y] call BIS_fnc_rotateVector2D; _z = _b select 2; _p = asin(_z / sqrt((_b select 1)^2 + _z^2)); get3DENCamera setVectorDirAndUp [ _a, [[0,-sin _p,cos _p],-_y] call BIS_fnc_rotateVector2D ];

Additional Information

See also:
move3DENCamera set3DENAttributes

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