Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ATLManualCameraComponent.c
Go to the documentation of this file.
1 
9 [BaseContainerProps(), SCR_BaseManualCameraComponentTitle()]
11 {
12  [Attribute(defvalue: "5", desc: "Below this height, camera copies terrain height precisely.")]
13  private int m_fATLMinHeight;
14 
15  [Attribute(defvalue: "50", desc: "When the camera is above this height, it moves ASL, not ATL.")]
16  private int m_fATLMaxHeight;
17 
18  //------------------------------------------------------------------------------------------------
19  override void EOnCameraFrame(SCR_ManualCameraParam param)
20  {
21  if (!param.isDirty)
22  return;
23 
24  //--- Get target height
25  vector pos = param.transform[3];
26  float height = pos[1] - Math.Max(param.world.GetSurfaceY(pos[0], pos[2]), 0);
27 
28  //--- Terminate when the height is above threshold
29  if (height > m_fATLMaxHeight)
30  return;
31 
32  //--- Get original height
33  vector posOrig = param.transformOriginal[3];
34  float heightOrig = posOrig[1] - Math.Max(param.world.GetSurfaceY(posOrig[0], posOrig[2]), 0);
35 
36  //--- Get interpolated height between min and max
37  float progress = Math.InverseLerp(m_fATLMinHeight, m_fATLMaxHeight, height);
38  float heightInterpolated = Math.Lerp(heightOrig - height, 0, progress);
39 
40  //--- Apply manual input
41  float inputDiff = 0;
42  if (param.isManualInput)
43  inputDiff = pos[1] - posOrig[1];
44 
45  //--- Apply transormation
46  pos[1] = pos[1] + heightInterpolated + inputDiff;
47  param.transform[3] = pos;
48  }
49 
50  //------------------------------------------------------------------------------------------------
51  override bool EOnCameraInit()
52  {
53  return true;
54  }
55 }
SCR_BaseManualCameraComponent
Parent class from which all SCR_ManualCamera components inherit.
Definition: SCR_BaseManualCameraComponent.c:5
SCR_ATLManualCameraComponent
Definition: SCR_ATLManualCameraComponent.c:10
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_ManualCameraParam
Parameter for carrying information between individual camera components.
Definition: SCR_ManualCameraParam.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