Xonotic
angle.qc File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define angleofs(from, to)   angleofs3(from.origin, from.angles, to.origin)
 

Functions

ERASEABLE float anglemods (float v)
 
ERASEABLE vector angleofs3 (vector from, vector ang, vector to)
 
ERASEABLE float shortangle_f (float ang1, float ang2)
 
ERASEABLE vector shortangle_v (vector ang1, vector ang2)
 
ERASEABLE vector shortangle_vxy (vector ang1, vector ang2)
 

Variables

vector angles
 
vector origin
 

Macro Definition Documentation

◆ angleofs

#define angleofs (   from,
  to 
)    angleofs3(from.origin, from.angles, to.origin)

Definition at line 90 of file angle.qc.

Function Documentation

◆ anglemods()

ERASEABLE float anglemods ( float  v)

Definition at line 13 of file angle.qc.

References ERASEABLE, floor(), and v.

Referenced by Monster_Move_2D(), and SUB_CalcAngleMoveEnt().

14 {
15  v = v - 360 * floor(v / 360);
16 
17  if(v >= 180)
18  return v - 360;
19  else if(v <= -180)
20  return v + 360;
21  else
22  return v;
23 }
vector v
Definition: ent_cs.qc:116
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ angleofs3()

ERASEABLE vector angleofs3 ( vector  from,
vector  ang,
vector  to 
)

Definition at line 73 of file angle.qc.

References normalize(), vectoangles(), and vector().

74 {
75  vector v_res;
76 
77  v_res = normalize(to - from);
78  v_res = vectoangles(v_res);
79  v_res = v_res - ang;
80 
81  if (v_res_x < 0) v_res_x += 360;
82  if (v_res_x > 180) v_res_x -= 360;
83 
84  if (v_res_y < 0) v_res_y += 360;
85  if (v_res_y > 180) v_res_y -= 360;
86 
87  return v_res;
88 }
entity to
Definition: self.qh:96
vector(float skel, float bonenum) _skel_get_boneabs_hidden
+ Here is the call graph for this function:

◆ shortangle_f()

ERASEABLE float shortangle_f ( float  ang1,
float  ang2 
)

Definition at line 29 of file angle.qc.

References ERASEABLE.

Referenced by Monster_Move(), shortangle_v(), and shortangle_vxy().

30 {
31  if(ang1 > ang2)
32  {
33  if(ang1 > 180)
34  return ang1 - 360;
35  }
36  else
37  {
38  if(ang1 < -180)
39  return ang1 + 360;
40  }
41 
42  return ang1;
43 }
+ Here is the caller graph for this function:

◆ shortangle_v()

ERASEABLE vector shortangle_v ( vector  ang1,
vector  ang2 
)

Definition at line 46 of file angle.qc.

References ERASEABLE, shortangle_f(), and vector().

47 {
48  vector vtmp;
49 
50  vtmp_x = shortangle_f(ang1_x,ang2_x);
51  vtmp_y = shortangle_f(ang1_y,ang2_y);
52  vtmp_z = shortangle_f(ang1_z,ang2_z);
53 
54  return vtmp;
55 }
ERASEABLE float shortangle_f(float ang1, float ang2)
Definition: angle.qc:29
vector(float skel, float bonenum) _skel_get_boneabs_hidden
+ Here is the call graph for this function:

◆ shortangle_vxy()

ERASEABLE vector shortangle_vxy ( vector  ang1,
vector  ang2 
)

Definition at line 58 of file angle.qc.

References ERASEABLE, shortangle_f(), and vector().

59 {
60  vector vtmp = '0 0 0';
61 
62  vtmp_x = shortangle_f(ang1_x,ang2_x);
63  vtmp_y = shortangle_f(ang1_y,ang2_y);
64 
65  return vtmp;
66 }
ERASEABLE float shortangle_f(float ang1, float ang2)
Definition: angle.qc:29
vector(float skel, float bonenum) _skel_get_boneabs_hidden
+ Here is the call graph for this function:

Variable Documentation

◆ angles

vector angles

Definition at line 7 of file angle.qc.

◆ origin

vector origin

Definition at line 1 of file angle.qc.