Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_RecoilCameraShakeParams.c
Go to the documentation of this file.
1/*
2 This object defines the shape and default behaviour of camera shake and convenience API.
3*/
6{
7 [Attribute("0.01", UIWidgets.Slider, params: "0.001 1.0 0.001", precision: 3, category: "Camera Shake", desc: "Time rate of shake blending in.")]
8 float m_fBlendInTime;
9 [Attribute("0.175", UIWidgets.Slider, params: "0.001 1.0 0.001", precision: 3, category: "Camera Shake", desc: "Time rate of shake blending out.")]
10 float m_fBlendOutTime;
11 [Attribute("15.0", UIWidgets.Slider, params: "0.0 60.0 0.001", precision: 3, category: "Camera Shake", desc: "Maximum smoothing velocity.")]
12 float m_fMaxVelocity;
13
17 [Attribute("0.0375", UIWidgets.Slider, params: "0.0 1.0 0.001", precision: 4, category: "Camera Shake", desc: "Distance of translation at which recoil is deemed at maximum scale.")]
18 float m_fRecoilTarget;
19 [Attribute("1.25", UIWidgets.Slider, params: "0.0 3.0 0.001", precision: 3, category: "Camera Shake", desc: "Maximum percentage of recoil applied based on current vs target recoil translation.")]
20 float m_fMaximumPercentage;
21
22
23 /*
24 The minimum translation range to pick a random value from.
25 This is the raw value per axis (+right, +up, +forward in meters).
26 Keep positive only, sign is generated randomly.
27 */
28 [Attribute("0.0005 0.0005 0", UIWidgets.EditBox, precision: 4, category: "Camera Shake", desc: "Minimum range to pick translation values from. +right +up +forward in meters.")]
30 /*
31 The maximum translation range to pick a random value from.
32 This is the raw value per axis (+right, +up, +forward in meters).
33 Keep positive only, sign is generated randomly.
34 */
35 [Attribute("0.006 0.006 0", UIWidgets.EditBox, precision: 3, category: "Camera Shake", desc: "Maximum range to pick translation values from. +right +up +forward in meters.")]
37
41 [Attribute("0.975", UIWidgets.EditBox, precision: 3, category: "Camera Shake", desc: "Percentage of field of view when shake is at peak value.")]
42 protected float m_fFOVModifier;
43
44 /*
45 On top of the continuous shake there is an impulse which is stronger and has single direction
46 for the entirety or most of the underlying shake duration. This value defines the minimum
47 rotation range of this impulse.
48 */
49 [Attribute("0.005 0.005 1", UIWidgets.EditBox, precision: 3, category: "Camera Shake", desc: "On top of the continuous shake there is an impulse which is stronger and has single direction for the entirety or most of the underlying shake duration. This value defines the minimum rotation range of this impulse. +pitch +yaw +roll in in degrees.")]
51
52 /*
53 On top of the continuous shake there is an impulse which is stronger and has single direction
54 for the entirety or most of the underlying shake duration. This value defines the maximum
55 rotation range of this impulse.
56 */
57 [Attribute("0.012 0.012 1.5", UIWidgets.EditBox, precision: 3, category: "Camera Shake", desc: "On top of the continuous shake there is an impulse which is stronger and has single direction for the entirety or most of the underlying shake duration. This value defines the maximum rotation range of this impulse. +pitch +yaw +roll in degrees.")]
59
60 /*
61 The minimum recoil delta that can trigger large impulses.
62 */
63 [Attribute("0.04", UIWidgets.EditBox, precision: 3, category: "Camera Shake", desc: "The minimum recoil delta that can trigger impulses.")]
65
66 /*
67 The minimum rate at which impulses can be added. (0.1 == up to 0.1 impulses per second, 1 == up to 1 impulses per second)
68 */
69 [Attribute("0.333", UIWidgets.EditBox, precision: 3, category: "Camera Shake", desc: "The minimum rate at which impulses can be added. (0.1 == up to 0.1 impulses per second, 1 == up to 1 impulses per second.")]
71
72 /*
73 Impulse magnitude multiplier for when character is crouching.
74 */
75 [Attribute("0.8", UIWidgets.EditBox, precision: 3, category: "Camera Shake", desc: "Impulse magnitude multiplier for when character is crouching.", params: "0 1 0.01")]
77
78 /*
79 Impulse magnitude multiplier for when character is crouching.
80 */
81 [Attribute("0.6", UIWidgets.EditBox, precision: 3, category: "Camera Shake", desc: "Impulse magnitude multiplier for when character is crouching.", params: "0 1 0.01")]
83
84 /*
85 Continuous magnitude multiplier for when character is crouching.
86 */
87 [Attribute("0.8", UIWidgets.EditBox, precision: 3, category: "Camera Shake", desc: "Continuous magnitude multiplier for when character is crouching.", params: "0 1 0.01")]
89
90 /*
91 Continuous magnitude multiplier for when character is crouching.
92 */
93 [Attribute("0.6", UIWidgets.EditBox, precision: 3, category: "Camera Shake", desc: "Continuous magnitude multiplier for when character is crouching.", params: "0 1 0.01")]
95
100
105 float GetStanceImpulseMagnitude(float dynamicStance)
106 {
108 }
109
114 float GetStanceMagnitude(float dynamicStance)
115 {
117 }
118
119 protected float GetMagnitude(float stance, float crouch, float prone, float erect)
120 {
121 // Interpolate between crouch and erect
122 if (stance >= 0.5)
123 {
124 float t = (stance * 2) - 1;
125 return Math.Lerp(crouch, erect, t);
126 }
127
128 // Interpolate between prone and crouch
129 float t = (stance * 2);
130 return Math.Lerp(prone, crouch, t);
131 }
132
136 protected float RandomFloat(float min, float max)
137 {
138 if (min < 0.00001 || max < 0.00001)
139 return 0;
140
141 float sign = m_pRandomGenerator.RandFloatXY(-1337, 1337).Sign();
142 return sign * m_pRandomGenerator.RandFloatXY(min, max);
143 }
144
148 protected vector RandomVector(vector min, vector max)
149 {
150 vector result;
151 result[0] = RandomFloat(min[0], max[0]);
152 result[1] = RandomFloat(min[1], max[1]);
153 result[2] = RandomFloat(min[2], max[2]);
154 return result;
155 }
156
160 protected vector RandomVectorSphere(vector min, vector max, bool uniform = true)
161 {
162 float sign = m_pRandomGenerator.RandFloatXY(-1337, 1337).Sign();
163 vector res = m_pRandomGenerator.GenerateRandomPointInRadius(min.Length(), max.Length(), vector.Zero, uniform);
164 res[0] = Math.Clamp(res[0], min[0], max[0]);
165 res[1] = Math.Clamp(res[1], min[1], max[1]);
166 res[2] = Math.Clamp(res[2], min[2], max[2]);
167 return sign * res;
168 }
169
173 float GetFovScale(float progress01)
174 {
175 progress01 = Math.Clamp(progress01, 0, 1);
176 return Math.Lerp(1, m_fFOVModifier, progress01);
177 }
178
182 vector GetRandomTranslation(bool onSphere = false)
183 {
184 if (onSphere)
186
188 }
189
190 /*
191 Returns random angle impulse in the pitch yaw roll format.
192 */
200
201 /*
202 Returns random angle impulse in the yaw pitch roll format.
203 */
205 {
207 return Vector(angles[1], angles[0], angles[2]);
208 }
209};
ref array< string > angles
params precision
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition Math.c:13
vector RandomVectorSphere(vector min, vector max, bool uniform=true)
vector GetRandomAnglesImpulse(bool onSphere=false)
vector GetRandomTranslation(bool onSphere=false)
float RandomFloat(float min, float max)
float GetStanceMagnitude(float dynamicStance)
vector GetRandomYawPitchRollImpulse(bool onSphere=false)
float GetMagnitude(float stance, float crouch, float prone, float erect)
vector RandomVector(vector min, vector max)
float GetStanceImpulseMagnitude(float dynamicStance)
SCR_FieldOfViewSettings Attribute
proto native vector Vector(float x, float y, float z)