Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_SpeedByHeightManualCameraComponent.c
Go to the documentation of this file.
1 //#define CURVE_APPLIED
2 
4 
6 [BaseContainerProps(), SCR_BaseManualCameraComponentTitle()]
8 {
9  [Attribute("0.06")]
10  float m_fSpeedCoef;
11 
12  [Attribute(defvalue: "0.15")]
13  float m_fMinSpeed;
14 
15  [Attribute(defvalue: "400")]
16  float m_fMaxHeight;
17 
18  [Attribute("0 0 1 1", UIWidgets.GraphDialog, params: "1 1 0 0")]
19  private ref Curve m_fHeightCoef;
20 
21  //------------------------------------------------------------------------------------------------
22  override void EOnCameraFrame(SCR_ManualCameraParam param)
23  {
24  vector pos = CoordFromCamera(param.transform[3]);
25  float surfaceY = param.world.GetSurfaceY(pos[0], pos[2]);
26  if (pos[1] > 0)
27  surfaceY = Math.Max(surfaceY, 0); //--- When above ground, use ASL, not ATL height
28 
29 #ifdef CURVE_APPLIED
30  float height = Math3D.Curve(ECurveType.CurveProperty2D, (pos[1] - surfaceY) / m_fMaxHeight, m_fHeightCoef)[1];
31  param.multiplier *= Math.Max(height * m_fMaxHeight * m_fSpeedCoef, m_fMinSpeed);
32 #else
33  float height = pos[1] - surfaceY;
34  param.multiplier *= Math.Max(height * m_fSpeedCoef, m_fMinSpeed);
35 #endif
36  }
37 
38  //------------------------------------------------------------------------------------------------
39  override bool EOnCameraInit()
40  {
41  return true;
42  }
43 }
CoordFromCamera
protected vector CoordFromCamera(vector pos)
Definition: SCR_BaseManualCameraComponent.c:80
SCR_BaseManualCameraComponent
Parent class from which all SCR_ManualCamera components inherit.
Definition: SCR_BaseManualCameraComponent.c:5
SCR_SpeedByHeightManualCameraComponent
Camera speed based on height from terrain.
Definition: SCR_SpeedByHeightManualCameraComponent.c:7
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_ManualCameraParam
Parameter for carrying information between individual camera components.
Definition: SCR_ManualCameraParam.c:5
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
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