Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_RotateManualCameraComponent.c
Go to the documentation of this file.
1 
4 [BaseContainerProps(), SCR_BaseManualCameraComponentTitle()]
6 {
7  [Attribute("1")]
8  private float m_fSpeed;
9 
10  private float m_fYaw;
11  private float m_fPitch;
12 
13  //------------------------------------------------------------------------------------------------
14  override void EOnCameraFrame(SCR_ManualCameraParam param)
15  {
16  if (!param.isManualInputEnabled)
17  return;
18 
19  float yaw = GetInputManager().GetActionValue("ManualCameraRotateYaw");
20  float pitch = GetInputManager().GetActionValue("ManualCameraRotatePitch");
21 
22  //--- With mouse, the input is activated only every second frame. Correct it by using previous value.
23  if (GetInputManager().IsUsingMouseAndKeyboard())
24  {
25  float yawPrev = m_fYaw;
26  m_fYaw = yaw;
27  if (yaw == 0 && yawPrev != 0) yaw = yawPrev;
28 
29  float pitchPrev = m_fPitch;
30  m_fPitch = pitch;
31  if (pitch == 0 && pitchPrev != 0) pitch = pitchPrev;
32  }
33 
34  if (yaw == 0 && pitch == 0)
35  return;
36 
37  param.rotDelta += Vector(yaw, pitch, 0) * m_fSpeed * param.fov / Math.Max(GetCameraEntity().GetDefaultFOV(), 1);
38  param.isManualInput = true;
39  param.isDirty = true;
40  }
41 
42  //------------------------------------------------------------------------------------------------
43  override bool EOnCameraInit()
44  {
45  return true;
46  }
47 }
SCR_BaseManualCameraComponent
Parent class from which all SCR_ManualCamera components inherit.
Definition: SCR_BaseManualCameraComponent.c:5
Attribute
typedef Attribute
Post-process effect of scripted camera.
GetCameraEntity
protected SCR_ManualCamera GetCameraEntity()
Definition: SCR_BaseManualCameraComponent.c:59
SCR_ManualCameraParam
Parameter for carrying information between individual camera components.
Definition: SCR_ManualCameraParam.c:5
GetInputManager
protected InputManager GetInputManager()
Definition: SCR_BaseManualCameraComponent.c:65
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
SCR_RotateManualCameraComponent
Basic camera rotation.
Definition: SCR_RotateManualCameraComponent.c:5