Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_MovementInertiaManualCameraComponent.c
Go to the documentation of this file.
1 
4 [BaseContainerProps(), SCR_BaseManualCameraComponentTitle()]
6 {
7  protected static const float INERTIA_THRESHOLD = 0.0002; //--- Squared value
8 
9  [Attribute(defvalue: "0.08", desc: "Inertia strength. Larger values mean more inertia.")]
10  private float m_fInertiaStrength;
11 
12  private vector m_vVelocity;
13 
14  //------------------------------------------------------------------------------------------------
15  override void EOnCameraFrame(SCR_ManualCameraParam param)
16  {
17  //--- Current velocity
18  vector velocity = param.transform[3] - param.transformOriginal[3];
19 
20  //--- Terminate when target velocity was achieved
21  if (!param.isManualInput && vector.DistanceSq(velocity, param.velocityOriginal) < INERTIA_THRESHOLD)
22  return;
23 
24  //--- Apply
25  float progress = Math.Min(param.timeSlice * m_fInertiaStrength, 1);
26  velocity = vector.Lerp(param.velocityOriginal, velocity, progress);
27  vector pos = param.transformOriginal[3] + velocity;
28 
29  param.transform[3] = pos;
30  param.isDirty = true;
31  }
32 
33  //------------------------------------------------------------------------------------------------
34  override bool EOnCameraInit()
35  {
36  m_fInertiaStrength = 1 / Math.Max(m_fInertiaStrength, 0.001);
37  return true;
38  }
39 }
m_fInertiaStrength
private float m_fInertiaStrength
Definition: SCR_TooltipManagerEditorUIComponent.c:14
SCR_MovementInertiaManualCameraComponent
Inertia applied on camera movement.
Definition: SCR_MovementInertiaManualCameraComponent.c:5
SCR_BaseManualCameraComponent
Parent class from which all SCR_ManualCamera components inherit.
Definition: SCR_BaseManualCameraComponent.c:5
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