Xonotic
anglestransform.qh
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef POSITIVE_PITCH_IS_DOWN
4 #define POSITIVE_PITCH_IS_DOWN 1
5 #endif
6 
7 #if POSITIVE_PITCH_IS_DOWN
8  #define fixedmakevectors makevectors
9  #define FIXED_MAKE_VECTORS MAKE_VECTORS
11  #define fixedvectoangles(a) (_fixedvectoangles = vectoangles(a), _fixedvectoangles.x *= -1, _fixedvectoangles)
13  #define fixedvectoangles2(a, b) (_fixedvectoangles2 = vectoangles2(a, b), _fixedvectoangles2.x *= -1, _fixedvectoangles2)
14 #else
15  void fixedmakevectors(vector a)
16  {
17  // a makevectors that actually inverts vectoangles
18  a.x = -a.x;
19  makevectors(a);
20  }
21  #define FIXED_MAKE_VECTORS(angles, forward, right, up) MACRO_BEGIN \
22  fixedmakevectors(angles); \
23  GET_V_GLOBALS(forward, right, up); \
24  CLEAR_V_GLOBALS(); \
25  MACRO_END
26  #define fixedvectoangles2 vectoangles2
27  #define fixedvectoangles vectoangles
28 #endif
29 
35 vector AnglesTransform_RightDivide(vector to_transform, vector from_transform); // A B^-1
36 vector AnglesTransform_LeftDivide(vector from_transform, vector to_transform); // A^-1 B
37 
38 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)
39 
46 
47 // transformed = original * transform + postshift
noref vector _fixedvectoangles2
vector AnglesTransform_Apply(vector transform, vector v)
vector AnglesTransform_Normalize(vector t, float minimize_roll)
vector AnglesTransform_TurnDirectionFR(vector transform)
noref vector _fixedvectoangles
vector AnglesTransform_TurnDirectionFU(vector transform)
vector AnglesTransform_ApplyToVAngles(vector transform, vector v)
vector AnglesTransform_Invert(vector transform)
vector AnglesTransform_PrePostShift_GetPostShift(vector sf, vector t, vector st)
vector AnglesTransform_ToVAngles(vector v)
vector AnglesTransform_ApplyToAngles(vector transform, vector v)
vector AnglesTransform_LeftDivide(vector from_transform, vector to_transform)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
vector v
Definition: ent_cs.qc:116
vector AnglesTransform_FromVAngles(vector v)
vector AnglesTransform_FromAngles(vector v)
#define makevectors
Definition: post.qh:21
#define fixedmakevectors
vector AnglesTransform_RightDivide(vector to_transform, vector from_transform)
vector AnglesTransform_Multiply_GetPostShift(vector sf0, vector st0, vector t1, vector st1)
vector AnglesTransform_Multiply(vector t1, vector t2)
vector AnglesTransform_ToAngles(vector v)