Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_VehicleCameraAimpoint.c
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
11 {
17  [Attribute("0 0 1 1", UIWidgets.GraphDialog, desc: "Source data. X (horizontal) axis represents the vehicle speed in kph, Y (vertical) axis represents the amount of translation.")]
18  private ref Curve m_pCurveData;
19 
23  [Attribute("60.0", UIWidgets.Slider, desc: "The scale of curve in X axis, i.e. the speed of vehicle in kph we are sampling at.")]
24  private float m_fMaxSpeed;
28  [Attribute("35.0", UIWidgets.Slider, desc: "The scale of curve in X axis, i.e. the speed of vehicle in kph we are sampling at (when in reverse).")]
29  private float m_fReverseMaxSpeed;
33  [Attribute("1.2", UIWidgets.Slider, desc: "The scale of translation in local Z axis (forward), i.e. the forward translation of camera in meters based on the value we've sampled our speed at.", params: "-2 2 0.01")]
34  private float m_fForwardTranslationScale;
38  [Attribute("-0.3", UIWidgets.Slider, desc: "The scale of translation in local Z axis (forward), i.e. the forward translation of camera in meters based on the value we've sampled our speed at (when in reverse).", params: "-2 2 0.01")]
39  private float m_fReverseForwardTranslationScale;
43  [Attribute("-0.1", UIWidgets.Slider, "The scale of translation in local Y axis (up), i.e. the up translation of camera in meters based on the value we've sampled our speed at.", params: "-2 2 0.01")]
44  private float m_fUpTranslationScale;
48  [Attribute("200", UIWidgets.Slider, "The scale of x-axis, i.e. maximum angular speed we're sampling at for the amount of aside translation.", params: "0.01 500 0.01")]
49  private float m_fAsideMaxAngularSpeed;
53  [Attribute("0.1", UIWidgets.Slider, "The scale of translation in local X axis (aside), i.e. the up translation of camera based on the value we've sampled our speed at.", params: "-10 10 0.01")]
54  private float m_fAsideTranslationScale;
55 
56  /*
57  Samples the curve for given speed (in kph).
58  \return Returns local translation in X axis (aside) in local space.
59  */
60  float SampleAside(float asideSpeed)
61  {
62  float key = 0.0;
63  // Reverse
64  if (asideSpeed < 0)
65  {
66  key = Math.Clamp(-asideSpeed / m_fAsideMaxAngularSpeed, 0.0, 1.0);
67  }
68  else
69  key = Math.Clamp(asideSpeed / m_fAsideMaxAngularSpeed, 0.0, 1.0);
70 
71  float sample = Math3D.Curve(ECurveType.CatmullRom, key, m_pCurveData)[1] * m_fAsideTranslationScale;
72  if (asideSpeed > 0)
73  return sample;
74  else
75  return -sample;
76  }
77 
78  /*
79  Samples the curve for given speed (in kph).
80  \return Returns the vector of translation. X = 0, Y = up, Z = forward in local space.
81  */
82  vector Sample(float speed)
83  {
84  if (m_fMaxSpeed == 0)
85  return vector.Zero;
86 
87  float upScale = m_fUpTranslationScale;
88  float fwdScale = m_fForwardTranslationScale;
89  float key = 0.0;
90  // Reverse
91  if (speed < 0)
92  {
93  key = Math.Clamp(-speed / m_fReverseMaxSpeed, 0.0, 1.0);
94  fwdScale = m_fReverseForwardTranslationScale;
95  }
96  else
97  key = Math.Clamp(speed / m_fMaxSpeed, 0.0, 1.0);
98 
99  float sample = Math3D.Curve(ECurveType.CatmullRom, key, m_pCurveData)[1];
100  return Vector(0, sample * upScale, sample * fwdScale);
101  }
102 };
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Attribute
typedef Attribute
Post-process effect of scripted camera.
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
SCR_VehicleCameraAimpoint
Definition: SCR_VehicleCameraAimpoint.c:10
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