Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_MoveToCursorManualCameraComponent.c
Go to the documentation of this file.
1
2
4[BaseContainerProps(), SCR_BaseManualCameraComponentTitle()]
6{
7 [Attribute("2", UIWidgets.Auto, "")]
8 private float m_fSpeed;
9
10 //------------------------------------------------------------------------------------------------
11 override void EOnCameraFrame(SCR_ManualCameraParam param)
12 {
13 if (!param.isManualInputEnabled || param.isManualInput || !param.isCursorEnabled)
14 return;
15
16 float inputValue = GetInputManager().GetActionValue("ManualCameraMoveToCursor");
17 if (inputValue == 0)
18 return;
19
20 WorkspaceWidget workspace = GetGame().GetWorkspace();
21 if (!workspace)
22 return;
23
24 // Get mouse position
25 int mouseX, mouseY;
26 WidgetManager.GetMousePos(mouseX, mouseY);
27
28 // Get move direction
29 vector outDir;
30 workspace.ProjScreenToWorld(workspace.DPIUnscale(mouseX), workspace.DPIUnscale(mouseY), outDir, GetGame().GetWorld());
31
32 param.transform[3] = param.transform[3] + outDir * inputValue * m_fSpeed * Math.Sqrt(param.multiplier.Length());
33 param.isDirty = true;
34 param.isManualInput = true;
35 }
36
37 //------------------------------------------------------------------------------------------------
38 override bool EOnCameraInit()
39 {
40 return true;
41 }
42}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition Math.c:13
Parent class from which all SCR_ManualCamera components inherit.
Parameter for carrying information between individual camera components.
Moving the camera to and away from the cursor position.
SCR_FieldOfViewSettings Attribute