fromdos the source

This commit is contained in:
Ryan Pavlik
2010-11-12 10:24:00 -06:00
parent 2432d5c867
commit 304bf4fc64
8 changed files with 122 additions and 122 deletions

View File

@@ -107,12 +107,12 @@ void calculate_orientation(struct accel_t* ac, struct vec3b_t* accel, struct ori
orient->pitch = y;
orient->a_pitch = y;
}
/* smooth the angles if enabled */
if (smooth) {
apply_smoothing(ac, orient, SMOOTH_ROLL);
apply_smoothing(ac, orient, SMOOTH_PITCH);
}
/* smooth the angles if enabled */
if (smooth) {
apply_smoothing(ac, orient, SMOOTH_ROLL);
apply_smoothing(ac, orient, SMOOTH_PITCH);
}
}
@@ -191,7 +191,7 @@ void calc_joystick_state(struct joystick_t* js, float x, float y) {
void apply_smoothing(struct accel_t* ac, struct orient_t* orient, int type) {
switch (type) {
case SMOOTH_ROLL:
{
{
/* it's possible last iteration was nan or inf, so set it to 0 if that happened */
if (isnan(ac->st_roll) || isinf(ac->st_roll))
ac->st_roll = 0.0f;