More tweaks to joystick code. amp settings have a far greater effect now...

This commit is contained in:
Ragnvald Maartmann-Moe IV 2001-12-30 06:08:24 +00:00
parent 3cfd2c0a8e
commit 29b48c594e

View file

@ -86,8 +86,8 @@ JOY_Move (void)
if (!joy_active || !joy_enable->int_val) if (!joy_active || !joy_enable->int_val)
return; return;
mult_joy = 1 / (201 - (4 * joy_amp->value * joy_pre_amp->value * mult_joy = (joy_amp->value * joy_pre_amp->value *
in_amp->value * in_pre_amp->value)); in_amp->value * in_pre_amp->value) / 200.0;
// Yes, mult_joy looks like a mess, but use of pre_amp values is useful in // Yes, mult_joy looks like a mess, but use of pre_amp values is useful in
// scripts, and *_pre_amp will matter once joystick filtering/acceleration // scripts, and *_pre_amp will matter once joystick filtering/acceleration
// is implemented // is implemented
@ -95,64 +95,44 @@ JOY_Move (void)
for (i = 0; i < JOY_MAX_AXES; i++) { for (i = 0; i < JOY_MAX_AXES; i++) {
switch (joy_axes[i].axis->int_val) { switch (joy_axes[i].axis->int_val) {
case 1: case 1:
if (joy_axes[i].current) { if (joy_axes[i].current)
viewdelta.angles[YAW] -= viewdelta.angles[YAW] -= joy_axes[i].current * mult_joy;
(float) (joy_axes[i].current * mult_joy);
}
break; break;
case -1: case -1:
if (joy_axes[i].current) { if (joy_axes[i].current)
viewdelta.angles[YAW] += viewdelta.angles[YAW] += joy_axes[i].current * mult_joy;
(float) (joy_axes[i].current * mult_joy);
}
break; break;
case 2: case 2:
if (joy_axes[i].current) { if (joy_axes[i].current)
viewdelta.position[2] -= viewdelta.position[2] -= joy_axes[i].current * mult_joy;
(float) (joy_axes[i].current * mult_joy);
}
break; break;
case -2: case -2:
if (joy_axes[i].current) { if (joy_axes[i].current)
viewdelta.position[2] += viewdelta.position[2] += joy_axes[i].current * mult_joy;
(float) (joy_axes[i].current * mult_joy);
}
break; break;
case 3: case 3:
if (joy_axes[i].current) { if (joy_axes[i].current)
viewdelta.position[0] += viewdelta.position[0] += joy_axes[i].current * mult_joy;
(float) (joy_axes[i].current * mult_joy);
}
break; break;
case -3: case -3:
if (joy_axes[i].current) { if (joy_axes[i].current)
viewdelta.position[0] -= viewdelta.position[0] -= joy_axes[i].current * mult_joy;
(float) (joy_axes[i].current * mult_joy);
}
break; break;
case 4: case 4:
if (joy_axes[i].current) { if (joy_axes[i].current)
viewdelta.angles[PITCH] -= viewdelta.angles[PITCH] -= joy_axes[i].current * mult_joy;
(float) (joy_axes[i].current * mult_joy);
}
break; break;
case -4: case -4:
if (joy_axes[i].current) { if (joy_axes[i].current)
viewdelta.angles[PITCH] += viewdelta.angles[PITCH] += joy_axes[i].current * mult_joy;
(float) (joy_axes[i].current * mult_joy);
}
break; break;
case 5: case 5:
if (joy_axes[i].current) { if (joy_axes[i].current)
viewdelta.position[1] -= viewdelta.position[1] -= joy_axes[i].current * mult_joy;
(float) (joy_axes[i].current * mult_joy);
}
break; break;
case -5: case -5:
if (joy_axes[i].current) { if (joy_axes[i].current)
viewdelta.position[1] += viewdelta.position[1] += joy_axes[i].current * mult_joy;
(float) (joy_axes[i].current * mult_joy);
}
break; break;
default: default:
break; break;