1 #ifndef ANGLETRANSFORM_H
2 #define ANGLETRANSFORM_H
4 #define POSITIVE_PITCH_IS_DOWN
6 #ifdef POSITIVE_PITCH_IS_DOWN
7 #define fixedmakevectors makevectors
8 vector fixedvectoangles(vector a);
9 vector fixedvectoangles2(vector a, vector b);
11 void fixedmakevectors(vector a);
12 #define fixedvectoangles2 vectoangles2
13 #define fixedvectoangles vectoangles
16 vector AnglesTransform_Apply(vector transform, vector v);
17 vector AnglesTransform_Multiply(vector t1, vector t2); // A B
18 vector AnglesTransform_Invert(vector transform);
19 vector AnglesTransform_TurnDirectionFU(vector transform);
20 vector AnglesTransform_TurnDirectionFR(vector transform);
21 vector AnglesTransform_RightDivide(vector to_transform, vector from_transform); // A B^-1
22 vector AnglesTransform_LeftDivide(vector from_transform, vector to_transform); // A^-1 B
24 vector AnglesTransform_Normalize(vector t, float minimize_roll); // makes sure all angles are in their range: yaw in -180..180, pitch in -90..90, roll in -180..180 (or if minimize_roll is set, pitch in -180..180, roll in -90..90)
26 vector AnglesTransform_ApplyToAngles(vector transform, vector v);
27 vector AnglesTransform_ApplyToVAngles(vector transform, vector v);
28 vector AnglesTransform_FromAngles(vector v);
29 vector AnglesTransform_ToAngles(vector v);
30 vector AnglesTransform_FromVAngles(vector v);
31 vector AnglesTransform_ToVAngles(vector v);
33 // transformed = original * transform + postshift
34 vector AnglesTransform_Multiply_GetPostShift(vector sf0, vector st0, vector t1, vector st1);
35 vector AnglesTransform_PrePostShift_GetPostShift(vector sf, vector t, vector st);