Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_RotationInteriaManualCameraComponent.c
Go to the documentation of this file.
1//#define INERTIA_DEBUG
2
4
6[BaseContainerProps(), SCR_BaseManualCameraComponentTitle()]
8{
9 protected static const float INERTIA_THRESHOLD = 0.0002; //--- Squared value
10
11 [Attribute(defvalue: "0.03", desc: "Inertia strength. Larger values mean more inertia.")]
12 private float m_fInertiaStrength;
13
14 private vector m_vRotDelta;
15
16 //------------------------------------------------------------------------------------------------
17 override void EOnCameraFrame(SCR_ManualCameraParam param)
18 {
19 //--- Terminate when target rotation was achieved
20 if (!param.isManualInput && m_vRotDelta.LengthSq() < INERTIA_THRESHOLD) return;
21
22 m_vRotDelta = vector.Lerp(m_vRotDelta, param.rotDelta, Math.Min(param.timeSlice * m_fInertiaStrength, 1));
23
24 #ifdef INERTIA_DEBUG
25 DbgUI.Begin("KEK", 0, 0);
26 DbgUI.Text("Yaw Before");
27 DbgUI.PlotLive("YawBefore", 500, 100, param.rotDelta[0], 0.01, 100, ARGBF(1, 0.25, 0.25, 0.25));
28 DbgUI.Text("Yaw After");
29 DbgUI.PlotLive("YawAfter", 500, 100, m_vRotDelta[0], 0.01, 100, ARGBF(1, 1, 1, 1));
30 DbgUI.Text("Pitch Before");
31 DbgUI.PlotLive("PitchBefore", 500, 100, param.rotDelta[1], 0.01, 100, ARGBF(1, 0.25, 0.25, 0.25));
32 DbgUI.Text("Pitch After");
33 DbgUI.PlotLive("PitchAfter", 500, 100, m_vRotDelta[1], 0.01, 100, ARGBF(1, 1, 1, 1));
34 DbgUI.End();
35 #endif
36
37 param.rotDelta = m_vRotDelta;
38 param.isDirty = true;
39 }
40
41 //------------------------------------------------------------------------------------------------
42 override bool EOnCameraInit()
43 {
44 m_fInertiaStrength = 1 / Math.Max(m_fInertiaStrength, 0.001);
45 return true;
46 }
47}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition DbgUI.c:66
Definition Math.c:13
Parent class from which all SCR_ManualCamera components inherit.
Parameter for carrying information between individual camera components.
float timeSlice
Frame time slice.
SCR_FieldOfViewSettings Attribute
proto int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.