Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
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 }
m_fInertiaStrength
private float m_fInertiaStrength
Definition: SCR_TooltipManagerEditorUIComponent.c:14
SCR_BaseManualCameraComponent
Parent class from which all SCR_ManualCamera components inherit.
Definition: SCR_BaseManualCameraComponent.c:5
SCR_RotationInertiaManualCameraComponent
Inertia applied on camera rotation.
Definition: SCR_RotationInteriaManualCameraComponent.c:7
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