Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ATLManualCameraComponent.c
Go to the documentation of this file.
1
2
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 float vertical = m_InputManager.GetActionValue("ManualCameraMoveVertical");
25 if (vertical != 0.0)
26 return;
27
28 //--- Get target height
29 vector pos = param.transform[3];
30 float height = Math.AbsFloat(pos[1] - Math.Max(param.world.GetSurfaceY(pos[0], pos[2]), 0));
31
32 //--- Terminate when the height is above threshold
33 if (height > m_fATLMaxHeight)
34 return;
35
36 //--- Get original height
37 vector posOrig = param.transformOriginal[3];
38 float heightOrig = Math.AbsFloat(posOrig[1] - Math.Max(param.world.GetSurfaceY(posOrig[0], posOrig[2]), 0));
39
40 //--- Get interpolated height between min and max
41 float progress = Math.Clamp(Math.InverseLerp(m_fATLMinHeight, m_fATLMaxHeight, height), 0.0, 1.0);
42 float heightInterpolated = Math.Lerp(heightOrig - height, 0, progress);
43
44 //--- Apply manual input
45 float inputDiff = 0;
46 if (param.isManualInput)
47 inputDiff = pos[1] - posOrig[1];
48
49 //--- Apply transormation
50 pos[1] = pos[1] + heightInterpolated + inputDiff;
51 param.transform[3] = pos;
52 }
53
54 //------------------------------------------------------------------------------------------------
55 override bool EOnCameraInit()
56 {
57 return true;
58 }
59}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition Math.c:13
Parent class from which all SCR_ManualCamera components inherit.
Parameter for carrying information between individual camera components.
BaseWorld world
World in which the camera exists.
SCR_FieldOfViewSettings Attribute