File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,13 @@ int main() {
144
144
float pos_offset_x = 0 ;
145
145
float pos_offset_y = 0 ;
146
146
147
+ // get the pitch min and max, and shift them to be centered around 0
148
+ float pitch_min = config->set_reference_limits [4 ][0 ][0 ];
149
+ float pitch_max = config->set_reference_limits [4 ][0 ][1 ];
150
+ float pitch_average = 0.5 * (pitch_min + pitch_max);
151
+ pitch_min -= pitch_average;
152
+ pitch_max -= pitch_average;
153
+
147
154
// param to specify whether this is the first loop
148
155
int count_one = 0 ;
149
156
@@ -195,14 +202,7 @@ int main() {
195
202
vtm_pos_x += ref->ref_data .kbm_interaction .mouse_speed_x * 0.05 * delta;
196
203
vtm_pos_y += ref->ref_data .kbm_interaction .mouse_speed_y * 0.05 * delta;
197
204
198
- // get pitch limits from config to clamp the pitch
199
- float pitch_min = config->set_reference_limits [4 ][0 ][0 ];
200
- float pitch_max = config->set_reference_limits [4 ][0 ][1 ];
201
- // shift the range to center around 0
202
- float pitch_average = 0.5 * (pitch_min + pitch_max);
203
- pitch_min -= pitch_average;
204
- pitch_max -= pitch_average;
205
- // do the clamp
205
+ // clamp to pitch limits
206
206
if (dr16_pos_y < pitch_min) { dr16_pos_y = pitch_min; }
207
207
if (dr16_pos_y > pitch_max) { dr16_pos_y = pitch_max; }
208
208
You can’t perform that action at this time.
0 commit comments