Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_VehicleCameraAimpoint.c
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
11{
17 [Attribute("0 0 1 1", UIWidgets.CurveDialog, 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 = LegacyCurve.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 = LegacyCurve.Curve(ECurveType.CatmullRom, key, m_pCurveData)[1];
100 return Vector(0, sample * upScale, sample * fwdScale);
101 }
102};
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition Math.c:22
Definition Math.c:13
SCR_FieldOfViewSettings Attribute
ECurveType
Definition ECurveType.c:13
proto native vector Vector(float x, float y, float z)