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

Go to the source code of this file.

Functions

void WarpZone_FixPMove ()
 
void WarpZone_FixView ()
 
void WarpZone_Shutdown ()
 

Variables

vector warpzone_save_view_angles
 
vector warpzone_save_view_origin
 

Function Documentation

◆ WarpZone_FixPMove()

void WarpZone_FixPMove ( )

Definition at line 212 of file client.qc.

References entity(), input_angles, pmove_org, WarpZone_Find(), WarpZone_TransformOrigin(), and WarpZone_TransformVAngles().

213 {
215  if(e)
216  {
219  }
220 }
vector pmove_org
Definition: csprogsdefs.qc:54
entity() spawn
vector WarpZone_TransformOrigin(entity wz, vector v)
Definition: common.qc:499
vector input_angles
Definition: csprogsdefs.qc:60
vector WarpZone_TransformVAngles(entity wz, vector ang)
Definition: common.qc:514
entity WarpZone_Find(vector mi, vector ma)
Definition: common.qc:157
+ Here is the call graph for this function:

◆ WarpZone_FixView()

void WarpZone_FixView ( )

Definition at line 225 of file client.qc.

References autocvar_cl_rollkillspeed, cvar(), entity(), frametime, height, max(), min(), vector(), VF_ANGLES, VF_CL_VIEWANGLES_Z, VF_ORIGIN, WarpZone_Find(), WarpZone_FixNearClip(), warpzone_save_view_angles, warpzone_save_view_origin, WarpZone_TransformOrigin(), WarpZone_TransformVAngles(), WarpZone_View_Inside(), and WarpZone_View_Outside().

Referenced by CSQC_UpdateView().

226 {
227  entity e;
228  vector org, ang, nearclip, corner0, corner1, corner2, corner3, o;
229 
230  warpzone_save_view_origin = org = getpropertyvec(VF_ORIGIN);
231  warpzone_save_view_angles = ang = getpropertyvec(VF_ANGLES);
232 
233  e = WarpZone_Find(org, org);
234  if(e)
235  {
236  org = WarpZone_TransformOrigin(e, org);
237  ang = WarpZone_TransformVAngles(e, ang);
239  }
240  else
242 
243 #ifndef KEEP_ROLL
244  float rick;
245  float f;
246  static float rollkill;
247  if (STAT(HEALTH) > 0 || STAT(HEALTH) == -666 || STAT(HEALTH) == -2342)
248  {
249  f = 0;
250  // reset roll when passing through a warpzone that change player's roll angle
252  f = max(0, (1 - frametime * autocvar_cl_rollkillspeed));
253  if(rollkill)
254  rollkill = 0;
255  }
256  else
257  {
258  f = 1;
259  // roll the view when killed (v_deathtilt)
261  {
262  rollkill += frametime * autocvar_cl_rollkillspeed;
263  f = min(1, rollkill);
264  }
265  else if(rollkill)
266  rollkill = 0;
267  }
268 
269  rick = getproperty(VF_CL_VIEWANGLES_Z);
270  rick *= f;
271  setproperty(VF_CL_VIEWANGLES_Z, rick);
272  ang.z *= f;
273 #endif
274 
275  setproperty(VF_ORIGIN, org);
276  setproperty(VF_ANGLES, ang);
277 
278  vector width = '1 0 0' * cvar("vid_conwidth");
279  vector height = '0 1 0' * cvar("vid_conheight");
280  nearclip = '0 0 1' * (cvar("r_nearclip") * 1.125);
281  corner0 = cs_unproject('0 0 0' + nearclip);
282  corner1 = cs_unproject(width + nearclip);
283  corner2 = cs_unproject(height + nearclip);
284  corner3 = cs_unproject(width + height + nearclip);
285  o = WarpZone_FixNearClip(org, corner0, corner1, corner2, corner3);
286  if(o != '0 0 0')
287  setproperty(VF_ORIGIN, org + o);
288 }
vector warpzone_save_view_angles
Definition: client.qh:9
entity() spawn
vector WarpZone_TransformOrigin(entity wz, vector v)
Definition: common.qc:499
void WarpZone_View_Inside()
Definition: client.qc:166
vector warpzone_save_view_origin
Definition: client.qh:8
void WarpZone_View_Outside()
Definition: client.qc:158
const float VF_CL_VIEWANGLES_Z
Definition: csprogsdefs.qc:197
vector WarpZone_TransformVAngles(entity wz, vector ang)
Definition: common.qc:514
entity WarpZone_Find(vector mi, vector ma)
Definition: common.qc:157
float height
Definition: jumppads.qh:12
float frametime
Definition: csprogsdefs.qc:17
vector(float skel, float bonenum) _skel_get_boneabs_hidden
vector WarpZone_FixNearClip(vector o, vector c0, vector c1, vector c2, vector c3)
Definition: client.qc:180
const float VF_ANGLES
Definition: csprogsdefs.qc:186
float autocvar_cl_rollkillspeed
Definition: client.qc:223
const float VF_ORIGIN
Definition: csprogsdefs.qc:182
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_Shutdown()

void WarpZone_Shutdown ( )

Definition at line 290 of file client.qc.

References WarpZone_View_Outside().

Referenced by Shutdown().

291 {
293 }
void WarpZone_View_Outside()
Definition: client.qc:158
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ warpzone_save_view_angles

vector warpzone_save_view_angles

Definition at line 9 of file client.qh.

Referenced by WarpZone_FixView().

◆ warpzone_save_view_origin

vector warpzone_save_view_origin

Definition at line 8 of file client.qh.

Referenced by WarpZone_FixView().