Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_MoveToCursorManualCameraComponent.c
Go to the documentation of this file.
1 
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 }
SCR_BaseManualCameraComponent
Parent class from which all SCR_ManualCamera components inherit.
Definition: SCR_BaseManualCameraComponent.c:5
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_ManualCameraParam
Parameter for carrying information between individual camera components.
Definition: SCR_ManualCameraParam.c:5
GetInputManager
protected InputManager GetInputManager()
Definition: SCR_BaseManualCameraComponent.c:65
SCR_MoveToCursorManualCameraComponent
Moving the camera to and away from the cursor position.
Definition: SCR_MoveToCursorManualCameraComponent.c:5
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468