AP_Math: added new rotation for PITCH_7

This commit is contained in:
Andrew Tridgell committed 2019-05-29 17:12:32 +10:00
1 parent 977fe09276
commit e2eda63d2c
3 files changed
+11

No files matched your search

+9
View File
@@ -244,6 +244,15 @@ void Vector3<T>::rotate(enum Rotation rotation)
x = tmp;
return;
}
case ROTATION_PITCH_7: {
const float sin_pitch = 0.12186934340514748f; // sinf(pitch);
const float cos_pitch = 0.992546151641322f; // cosf(pitch);
float tmpx = x;
float tmpz = z;
x = cos_pitch * tmpx + sin_pitch * tmpz;
z = -sin_pitch * tmpx + cos_pitch * tmpz;
return;
}
case ROTATION_CUSTOM: // no-op; caller should perform custom rotations via matrix multiplication
return;
}