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

Go to the source code of this file.

Macros

#define BITCLR(a, b)   ((a) - ((a) & (b)))
 
#define BITCLR_ASSIGN(a, b)   ((a) = (a) - ((a) & (b)))
 
#define BITSET(a, b)   ((a) | (b))
 
#define BITSET_ASSIGN(a, b)   ((a) |= (b))
 
#define BITXOR(a, b)   (((a) | (b)) - ((a) & (b)))
 
#define BITXOR_ASSIGN(a, b)   ((a) = ((a) | (b)) - ((a) & (b)))
 
#define EXACTTRIGGER_INIT   WarpZoneLib_ExactTrigger_Init(this)
 
#define EXACTTRIGGER_TOUCH(e, t)   if(WarpZoneLib_ExactTrigger_Touch((e), (t))) return
 
#define MOVE_NOTHING   -1
 
#define move_out_of_solid(e)   WarpZoneLib_MoveOutOfSolid(e)
 

Typedefs

using WarpZone_trace_callback_t = void(vector start, vector hit, vector end)
 

Functions

 STATIC_INIT (g_warpzones)
 
void WarpZone_Camera_SetUp (entity e, vector my_org, vector my_ang)
 
entity WarpZone_Find (vector mi, vector ma)
 
entity WarpZone_FindRadius (vector org, float radius, float needlineofsight)
 
void WarpZone_MakeAllOther ()
 
void WarpZone_MakeAllSolid ()
 
float WarpZone_PlaneDist (entity wz, vector v)
 
void WarpZone_RefSys_Add (entity me, entity wz)
 
void WarpZone_RefSys_AddIncrementally (entity me, entity ref)
 
void WarpZone_RefSys_AddInverse (entity me, entity wz)
 
void WarpZone_RefSys_AddInverseTransform (entity me, vector t, vector s)
 
void WarpZone_RefSys_AddTransform (entity me, vector t, vector s)
 
void WarpZone_RefSys_BeginAddingIncrementally (entity me, entity ref)
 
void WarpZone_RefSys_Clear (entity me)
 
void WarpZone_RefSys_Copy (entity me, entity from)
 
entity WarpZone_RefSys_SpawnSameRefSys (entity me)
 
vector WarpZone_RefSys_TransformAngles (entity from, entity to, vector ang)
 
vector WarpZone_RefSys_TransformOrigin (entity from, entity to, vector org)
 
vector WarpZone_RefSys_TransformVAngles (entity from, entity to, vector ang)
 
vector WarpZone_RefSys_TransformVelocity (entity from, entity to, vector vel)
 
void WarpZone_SetUp (entity e, vector my_org, vector my_ang, vector other_org, vector other_ang)
 
float WarpZone_TargetPlaneDist (entity wz, vector v)
 
void WarpZone_TraceBox (vector org, vector min, vector max, vector end, float nomonsters, entity forent)
 
void WarpZone_TraceBox_ThroughZone (vector org, vector min, vector max, vector end, float nomonsters, entity forent, entity zone, WarpZone_trace_callback_t cb)
 
void WarpZone_TraceLine (vector org, vector end, float nomonsters, entity forent)
 
void WarpZone_TraceToss (entity e, entity forent)
 
void WarpZone_TraceToss_ThroughZone (entity e, entity forent, entity zone, WarpZone_trace_callback_t cb)
 
void WarpZone_TrailParticles (entity own, float eff, vector org, vector end)
 
vector WarpZone_TransformAngles (entity wz, vector v)
 
vector WarpZone_TransformOrigin (entity wz, vector v)
 
vector WarpZone_TransformVAngles (entity wz, vector v)
 
vector WarpZone_TransformVelocity (entity wz, vector v)
 
vector WarpZone_UnTransformAngles (entity wz, vector v)
 
vector WarpZone_UnTransformOrigin (entity wz, vector v)
 
vector WarpZone_UnTransformVAngles (entity wz, vector v)
 
vector WarpZone_UnTransformVelocity (entity wz, vector v)
 
float WarpZoneLib_BoxTouchesBrush (vector mi, vector ma, entity e, entity ig)
 
void WarpZoneLib_ExactTrigger_Init (entity this)
 
bool WarpZoneLib_ExactTrigger_Touch (entity this, entity toucher)
 
bool WarpZoneLib_MoveOutOfSolid (entity e)
 
vector WarpZoneLib_NearestPointOnBox (vector mi, vector ma, vector org)
 

Variables

IntrusiveList g_warpzones
 
vector warpzone_angles
 
float warpzone_cameras_exist
 
float warpzone_fadeend
 
float warpzone_fadestart
 
vector WarpZone_findradius_dist
 
vector WarpZone_findradius_findorigin
 
float WarpZone_findradius_findradius
 
vector WarpZone_findradius_nearest
 
vector warpzone_forward
 
float warpzone_isboxy
 
vector warpzone_origin
 
vector warpzone_shift
 
vector warpzone_targetangles
 
vector warpzone_targetforward
 
vector warpzone_targetorigin
 
var WarpZone_trace_callback_t WarpZone_trace_callback_t_null
 
entity WarpZone_trace_firstzone
 
entity WarpZone_trace_forent
 
entity WarpZone_trace_lastzone
 
entity WarpZone_trace_transform
 
float WarpZone_tracetoss_time
 
vector WarpZone_tracetoss_velocity
 
vector warpzone_transform
 
float warpzone_warpzones_exist
 

Macro Definition Documentation

◆ BITCLR

#define BITCLR (   a,
 
)    ((a) - ((a) & (b)))

Definition at line 92 of file common.qh.

◆ BITCLR_ASSIGN

#define BITCLR_ASSIGN (   a,
 
)    ((a) = (a) - ((a) & (b)))

Definition at line 101 of file common.qh.

Referenced by WarpZone_TeleportPlayer(), and WarpZone_TraceBox_ThroughZone().

◆ BITSET

#define BITSET (   a,
 
)    ((a) | (b))

Definition at line 95 of file common.qh.

◆ BITSET_ASSIGN

#define BITSET_ASSIGN (   a,
 
)    ((a) |= (b))

◆ BITXOR

#define BITXOR (   a,
 
)    (((a) | (b)) - ((a) & (b)))

Definition at line 98 of file common.qh.

◆ BITXOR_ASSIGN

#define BITXOR_ASSIGN (   a,
 
)    ((a) = ((a) | (b)) - ((a) & (b)))

◆ EXACTTRIGGER_INIT

◆ EXACTTRIGGER_TOUCH

◆ MOVE_NOTHING

#define MOVE_NOTHING   -1

Definition at line 33 of file common.qh.

Referenced by WarpZone_TraceBox_ThroughZone().

◆ move_out_of_solid

#define move_out_of_solid (   e)    WarpZoneLib_MoveOutOfSolid(e)

Typedef Documentation

◆ WarpZone_trace_callback_t

Definition at line 35 of file common.qh.

Function Documentation

◆ STATIC_INIT()

STATIC_INIT ( g_warpzones  )

Definition at line 7 of file common.qh.

References IL_NEW.

7 { g_warpzones = IL_NEW(); }
#define IL_NEW()
IntrusiveList g_warpzones
Definition: common.qh:6

◆ WarpZone_Camera_SetUp()

void WarpZone_Camera_SetUp ( entity  e,
vector  my_org,
vector  my_ang 
)

Definition at line 95 of file common.qc.

References setcamera_transform, and WarpZone_Camera_camera_transform().

Referenced by NET_HANDLE(), and WarpZone_Projectile_Touch().

96 {
97  e.warpzone_origin = my_org;
98  e.warpzone_angles = my_ang;
100 }
#define setcamera_transform(e, f)
vector WarpZone_Camera_camera_transform(entity this, vector org, vector ang)
Definition: common.qc:82
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_Find()

entity WarpZone_Find ( vector  mi,
vector  ma 
)

Definition at line 157 of file common.qc.

References g_warpzones, IL_EACH, NULL, warpzone_warpzones_exist, and WarpZoneLib_BoxTouchesBrush().

Referenced by WarpZone_FixNearClip(), WarpZone_FixPMove(), WarpZone_FixView(), WarpZone_Projectile_Touch(), WarpZone_Touch(), WarpZone_TraceBox_ThroughZone(), and WarpZone_TraceToss_ThroughZone().

158 {
159  // if we are near any warpzone planes - MOVE AWAY (work around nearclip)
161  return NULL;
163  {
164  return it;
165  });
166  return NULL;
167 }
#define IL_EACH(this, cond, body)
float warpzone_warpzones_exist
Definition: common.qh:9
float WarpZoneLib_BoxTouchesBrush(vector mi, vector ma, entity e, entity ig)
Definition: common.qc:138
#define NULL
Definition: post.qh:17
IntrusiveList g_warpzones
Definition: common.qh:6
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_FindRadius()

entity WarpZone_FindRadius ( vector  org,
float  radius,
float  needlineofsight 
)

◆ WarpZone_MakeAllOther()

void WarpZone_MakeAllOther ( )

Definition at line 179 of file common.qc.

References g_warpzones, IL_EACH, SOLID_TRIGGER, and warpzone_warpzones_exist.

Referenced by WarpZone_TraceBox_ThroughZone(), and WarpZone_TraceToss_ThroughZone().

180 {
182  return;
183  IL_EACH(g_warpzones, true,
184  {
185  it.solid = SOLID_TRIGGER;
186  });
187 }
#define IL_EACH(this, cond, body)
float warpzone_warpzones_exist
Definition: common.qh:9
IntrusiveList g_warpzones
Definition: common.qh:6
const float SOLID_TRIGGER
Definition: csprogsdefs.qc:245
+ Here is the caller graph for this function:

◆ WarpZone_MakeAllSolid()

void WarpZone_MakeAllSolid ( )

Definition at line 169 of file common.qc.

References g_warpzones, IL_EACH, SOLID_BSP, and warpzone_warpzones_exist.

Referenced by WarpZone_TraceBox_ThroughZone(), and WarpZone_TraceToss_ThroughZone().

170 {
172  return;
173  IL_EACH(g_warpzones, true,
174  {
175  it.solid = SOLID_BSP;
176  });
177 }
#define IL_EACH(this, cond, body)
float warpzone_warpzones_exist
Definition: common.qh:9
const float SOLID_BSP
Definition: csprogsdefs.qc:248
IntrusiveList g_warpzones
Definition: common.qh:6
+ Here is the caller graph for this function:

◆ WarpZone_PlaneDist()

float WarpZone_PlaneDist ( entity  wz,
vector  v 
)

Definition at line 489 of file common.qc.

Referenced by WarpZone_FixNearClip(), WarpZone_Projectile_Touch(), and WarpZone_Touch().

490 {
491  return (v - wz.warpzone_origin) * wz.warpzone_forward;
492 }
vector v
Definition: ent_cs.qc:116
+ Here is the caller graph for this function:

◆ WarpZone_RefSys_Add()

void WarpZone_RefSys_Add ( entity  me,
entity  wz 
)

Definition at line 714 of file common.qc.

References WarpZone_RefSys_AddTransform().

Referenced by WarpZone_Teleport().

715 {
716  WarpZone_RefSys_AddTransform(me, wz.warpzone_transform, wz.warpzone_shift);
717 }
void WarpZone_RefSys_AddTransform(entity me, vector t, vector s)
Definition: common.qc:706
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_RefSys_AddIncrementally()

void WarpZone_RefSys_AddIncrementally ( entity  me,
entity  ref 
)

Definition at line 732 of file common.qc.

References WarpZone_Accumulator_Add(), and WarpZone_Accumulator_AddInverseTransform().

Referenced by GrapplingHookThink().

733 {
734  //vector t, s;
735  if(me.WarpZone_refsys_incremental_transform == ref.WarpZone_refsys.warpzone_transform)
736  if(me.WarpZone_refsys_incremental_shift == ref.WarpZone_refsys.warpzone_shift)
737  return;
738  WarpZone_Accumulator_AddInverseTransform(me.WarpZone_refsys, me.WarpZone_refsys_incremental_transform, me.WarpZone_refsys_incremental_shift);
739  WarpZone_Accumulator_Add(me.WarpZone_refsys, ref.WarpZone_refsys);
740  me.WarpZone_refsys_incremental_shift = ref.WarpZone_refsys.warpzone_shift;
741  me.WarpZone_refsys_incremental_transform = ref.WarpZone_refsys.warpzone_transform;
742 }
void WarpZone_Accumulator_AddInverseTransform(entity acc, vector t, vector s)
Definition: common.qc:27
void WarpZone_Accumulator_Add(entity acc, entity wz)
Definition: common.qc:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_RefSys_AddInverse()

void WarpZone_RefSys_AddInverse ( entity  me,
entity  wz 
)

Definition at line 726 of file common.qc.

References WarpZone_RefSys_AddInverseTransform().

Referenced by ctf_Handle_Throw(), and Monster_Enemy_Check().

727 {
728  WarpZone_RefSys_AddInverseTransform(me, wz.warpzone_transform, wz.warpzone_shift);
729 }
void WarpZone_RefSys_AddInverseTransform(entity me, vector t, vector s)
Definition: common.qc:718
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_RefSys_AddInverseTransform()

void WarpZone_RefSys_AddInverseTransform ( entity  me,
vector  t,
vector  s 
)

Definition at line 718 of file common.qc.

References WarpZone_Accumulator_AddInverseTransform(), and WarpZone_RefSys_CheckCreate().

Referenced by WarpZone_RefSys_AddInverse().

719 {
720  if(t != '0 0 0' || s != '0 0 0')
721  {
723  WarpZone_Accumulator_AddInverseTransform(me.WarpZone_refsys, t, s);
724  }
725 }
void WarpZone_Accumulator_AddInverseTransform(entity acc, vector t, vector s)
Definition: common.qc:27
void WarpZone_RefSys_CheckCreate(entity me)
Definition: common.qc:687
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_RefSys_AddTransform()

void WarpZone_RefSys_AddTransform ( entity  me,
vector  t,
vector  s 
)

Definition at line 706 of file common.qc.

References WarpZone_Accumulator_AddTransform(), and WarpZone_RefSys_CheckCreate().

Referenced by WarpZone_RefSys_Add().

707 {
708  if(t != '0 0 0' || s != '0 0 0')
709  {
711  WarpZone_Accumulator_AddTransform(me.WarpZone_refsys, t, s);
712  }
713 }
void WarpZone_RefSys_CheckCreate(entity me)
Definition: common.qc:687
void WarpZone_Accumulator_AddTransform(entity acc, vector t, vector s)
Definition: common.qc:15
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_RefSys_BeginAddingIncrementally()

void WarpZone_RefSys_BeginAddingIncrementally ( entity  me,
entity  ref 
)

Definition at line 743 of file common.qc.

Referenced by GrapplingHookTouch().

744 {
745  me.WarpZone_refsys_incremental_shift = ref.WarpZone_refsys.warpzone_shift;
746  me.WarpZone_refsys_incremental_transform = ref.WarpZone_refsys.warpzone_transform;
747 }
+ Here is the caller graph for this function:

◆ WarpZone_RefSys_Clear()

void WarpZone_RefSys_Clear ( entity  me)

Definition at line 698 of file common.qc.

References NULL.

Referenced by WarpZone_RefSys_Copy().

699 {
700  if(me.WarpZone_refsys)
701  {
702  delete(me.WarpZone_refsys);
703  me.WarpZone_refsys = NULL;
704  }
705 }
#define NULL
Definition: post.qh:17
+ Here is the caller graph for this function:

◆ WarpZone_RefSys_Copy()

void WarpZone_RefSys_Copy ( entity  me,
entity  from 
)

Definition at line 780 of file common.qc.

References WarpZone_RefSys_CheckCreate(), and WarpZone_RefSys_Clear().

Referenced by ctf_Handle_Throw(), Monster_Enemy_Check(), and WarpZone_RefSys_SpawnSameRefSys().

781 {
782  if(from.WarpZone_refsys)
783  {
785  me.WarpZone_refsys.warpzone_shift = from.WarpZone_refsys.warpzone_shift;
786  me.WarpZone_refsys.warpzone_transform = from.WarpZone_refsys.warpzone_transform;
787  }
788  else
790 }
void WarpZone_RefSys_CheckCreate(entity me)
Definition: common.qc:687
void WarpZone_RefSys_Clear(entity me)
Definition: common.qc:698
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_RefSys_SpawnSameRefSys()

entity WarpZone_RefSys_SpawnSameRefSys ( entity  me)

Definition at line 791 of file common.qc.

References entity(), spawn(), and WarpZone_RefSys_Copy().

Referenced by FireGrapplingHook().

792 {
793  entity e = spawn();
794  WarpZone_RefSys_Copy(e, me);
795  return e;
796 }
void WarpZone_RefSys_Copy(entity me, entity from)
Definition: common.qc:780
entity() spawn
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_RefSys_TransformAngles()

vector WarpZone_RefSys_TransformAngles ( entity  from,
entity  to,
vector  ang 
)

Definition at line 764 of file common.qc.

References WarpZone_TransformAngles(), and WarpZone_UnTransformAngles().

765 {
766  if(from.WarpZone_refsys)
767  ang = WarpZone_UnTransformAngles(from.WarpZone_refsys, ang);
768  if(to.WarpZone_refsys)
769  ang = WarpZone_TransformAngles(to.WarpZone_refsys, ang);
770  return ang;
771 }
entity to
Definition: self.qh:96
vector WarpZone_UnTransformAngles(entity wz, vector v)
Definition: common.qc:545
vector WarpZone_TransformAngles(entity wz, vector v)
Definition: common.qc:509
+ Here is the call graph for this function:

◆ WarpZone_RefSys_TransformOrigin()

vector WarpZone_RefSys_TransformOrigin ( entity  from,
entity  to,
vector  org 
)

Definition at line 748 of file common.qc.

References WarpZone_TransformOrigin(), and WarpZone_UnTransformOrigin().

Referenced by ctf_FlagThink(), ctf_Handle_Throw(), GrapplingHookThink(), Monster_Enemy_Check(), and Monster_Move_Target().

749 {
750  if(from.WarpZone_refsys)
751  org = WarpZone_UnTransformOrigin(from.WarpZone_refsys, org);
752  if(to.WarpZone_refsys)
753  org = WarpZone_TransformOrigin(to.WarpZone_refsys, org);
754  return org;
755 }
vector WarpZone_TransformOrigin(entity wz, vector v)
Definition: common.qc:499
entity to
Definition: self.qh:96
vector WarpZone_UnTransformOrigin(entity wz, vector v)
Definition: common.qc:535
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_RefSys_TransformVAngles()

vector WarpZone_RefSys_TransformVAngles ( entity  from,
entity  to,
vector  ang 
)

Definition at line 772 of file common.qc.

References WarpZone_TransformVAngles(), and WarpZone_UnTransformVAngles().

773 {
774  if(from.WarpZone_refsys)
775  ang = WarpZone_UnTransformVAngles(from.WarpZone_refsys, ang);
776  if(to.WarpZone_refsys)
777  ang = WarpZone_TransformVAngles(to.WarpZone_refsys, ang);
778  return ang;
779 }
vector WarpZone_UnTransformVAngles(entity wz, vector ang)
Definition: common.qc:550
entity to
Definition: self.qh:96
vector WarpZone_TransformVAngles(entity wz, vector ang)
Definition: common.qc:514
+ Here is the call graph for this function:

◆ WarpZone_RefSys_TransformVelocity()

vector WarpZone_RefSys_TransformVelocity ( entity  from,
entity  to,
vector  vel 
)

Definition at line 756 of file common.qc.

References WarpZone_TransformVelocity(), and WarpZone_UnTransformVelocity().

Referenced by GrapplingHookThink().

757 {
758  if(from.WarpZone_refsys)
759  vel = WarpZone_UnTransformVelocity(from.WarpZone_refsys, vel);
760  if(to.WarpZone_refsys)
761  vel = WarpZone_TransformVelocity(to.WarpZone_refsys, vel);
762  return vel;
763 }
entity to
Definition: self.qh:96
vector WarpZone_TransformVelocity(entity wz, vector v)
Definition: common.qc:504
vector WarpZone_UnTransformVelocity(entity wz, vector v)
Definition: common.qc:540
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_SetUp()

void WarpZone_SetUp ( entity  e,
vector  my_org,
vector  my_ang,
vector  other_org,
vector  other_ang 
)

Definition at line 66 of file common.qc.

References AnglesTransform_PrePostShift_GetPostShift(), AnglesTransform_RightDivide(), AnglesTransform_TurnDirectionFR(), FIXED_MAKE_VECTORS, setcamera_transform, vector(), and WarpZone_camera_transform().

Referenced by NET_HANDLE(), and WarpZone_Projectile_Touch().

67 {
68  e.warpzone_transform = AnglesTransform_RightDivide(other_ang, AnglesTransform_TurnDirectionFR(my_ang));
69  e.warpzone_shift = AnglesTransform_PrePostShift_GetPostShift(my_org, e.warpzone_transform, other_org);
70  e.warpzone_origin = my_org;
71  e.warpzone_targetorigin = other_org;
72  e.warpzone_angles = my_ang;
73  e.warpzone_targetangles = other_ang;
74  vector forward, right, up;
75  FIXED_MAKE_VECTORS(my_ang, forward, right, up);
76  e.warpzone_forward = forward;
77  FIXED_MAKE_VECTORS(other_ang, forward, right, up);
78  e.warpzone_targetforward = forward;
80 }
#define setcamera_transform(e, f)
vector AnglesTransform_RightDivide(vector to_transform, vector from_transform)
vector AnglesTransform_TurnDirectionFR(vector transform)
vector AnglesTransform_PrePostShift_GetPostShift(vector sf, vector t, vector st)
#define FIXED_MAKE_VECTORS
vector(float skel, float bonenum) _skel_get_boneabs_hidden
vector WarpZone_camera_transform(entity this, vector org, vector ang)
Definition: common.qc:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_TargetPlaneDist()

float WarpZone_TargetPlaneDist ( entity  wz,
vector  v 
)

Definition at line 494 of file common.qc.

Referenced by WarpZone_Teleport().

495 {
496  return (v - wz.warpzone_targetorigin) * wz.warpzone_targetforward;
497 }
vector v
Definition: ent_cs.qc:116
+ Here is the caller graph for this function:

◆ WarpZone_TraceBox()

void WarpZone_TraceBox ( vector  org,
vector  min,
vector  max,
vector  end,
float  nomonsters,
entity  forent 
)

Definition at line 333 of file common.qc.

References NULL, WarpZone_trace_callback_t_null, and WarpZone_TraceBox_ThroughZone().

Referenced by CommonCommand_editmob(), tracebox_antilag_force_wz(), View_EventChase(), and WarpZone_TraceLine().

334 {
335  WarpZone_TraceBox_ThroughZone(org, mi, ma, end, nomonsters, forent, NULL, WarpZone_trace_callback_t_null);
336 }
var WarpZone_trace_callback_t WarpZone_trace_callback_t_null
Definition: common.qh:36
#define NULL
Definition: post.qh:17
void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end, float nomonsters, entity forent, entity zone, WarpZone_trace_callback_t cb)
Definition: common.qc:202
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_TraceBox_ThroughZone()

void WarpZone_TraceBox_ThroughZone ( vector  org,
vector  min,
vector  max,
vector  end,
float  nomonsters,
entity  forent,
entity  zone,
WarpZone_trace_callback_t  cb 
)

Definition at line 202 of file common.qc.

References BITCLR_ASSIGN, BITSET_ASSIGN, DPCONTENTS_SOLID, entity(), LABEL, LOG_TRACE, MOVE_NOMONSTERS, MOVE_NOTHING, MOVE_WORLDONLY, normalize(), NULL, trace_dphitcontents, trace_endpos, trace_ent, trace_fraction, trace_startsolid, v_forward, v_right, v_up, vector(), WarpZone_Find(), WarpZone_MakeAllOther(), WarpZone_MakeAllSolid(), WarpZone_Trace_AddTransform(), WarpZone_trace_firstzone, WarpZone_trace_forent, WarpZone_Trace_InitTransform(), WarpZone_trace_lastzone, WarpZone_TransformOrigin(), and warpzone_warpzones_exist.

Referenced by fireBullet_antilag(), WarpZone_TraceBox(), and WarpZone_TrailParticles().

203 {
204  float nomonsters_adjusted;
205  float frac, sol, i;
206  float contentshack;
207  entity wz;
208  vector vf, vr, vu;
209 
210  WarpZone_trace_forent = forent;
215  {
216  if(nomonsters == MOVE_NOTHING)
217  {
218  trace_endpos = end;
219  trace_fraction = 1;
220  if(cb)
221  cb(org, trace_endpos, end);
222  return;
223  }
224  else
225  {
226  tracebox(org, mi, ma, end, nomonsters, WarpZone_trace_forent);
227  if(cb)
228  cb(org, trace_endpos, end);
229  return;
230  }
231  }
232 
233  vf = v_forward;
234  vr = v_right;
235  vu = v_up;
236 
237  switch(nomonsters)
238  {
239  case MOVE_WORLDONLY:
240  case MOVE_NOTHING:
241  nomonsters_adjusted = MOVE_NOMONSTERS;
242  break;
243  default:
244  nomonsters_adjusted = nomonsters;
245  break;
246  }
247  if((contentshack = (WarpZone_trace_forent.dphitcontentsmask && !(WarpZone_trace_forent.dphitcontentsmask & DPCONTENTS_SOLID))))
249 
250  // if starting in warpzone, first transform
251  wz = WarpZone_Find(org + mi, org + ma);
252  if(wz)
253  {
256  if(zone && wz != zone)
257  {
258  // we are in ANOTHER warpzone. This is bad. Make a zero length trace and return.
259  sol = 1;
260  trace_fraction = 0;
261  trace_endpos = org;
262  goto fail;
263  }
265  org = WarpZone_TransformOrigin(wz, org);
266  end = WarpZone_TransformOrigin(wz, end);
267  }
269  sol = -1;
270  frac = 0;
271  i = 16;
272  for (;;)
273  {
274  if(--i < 1)
275  {
276  LOG_TRACE("Too many warpzones in sequence, aborting trace.");
277  trace_ent = NULL;
278  break;
279  }
280  tracebox(org, mi, ma, end, nomonsters_adjusted, WarpZone_trace_forent);
281  if(cb)
282  cb(org, trace_endpos, end);
283  if(sol < 0)
284  sol = trace_startsolid;
285 
286  frac = trace_fraction = frac + (1 - frac) * trace_fraction;
287  if(trace_fraction >= 1)
288  break;
289  if(trace_ent.classname != "trigger_warpzone")
290  {
291  if((nomonsters == MOVE_NOTHING) || ((nomonsters == MOVE_WORLDONLY) && trace_ent) || (contentshack && (trace_dphitcontents & WarpZone_trace_forent.dphitcontentsmask) == DPCONTENTS_SOLID))
292  {
293  // continue the trace, ignoring this hit (we only care for warpzones)
294  org = trace_endpos + normalize(end - org);
295  continue;
296  // we cannot do an inverted trace here, as we do care for further warpzones inside that "solid" to be found
297  // otherwise, players could block entrances that way
298  }
299  break;
300  }
301  /*if(trace_ent == wz)
302  {
303  // FIXME can this check be removed? Do we really need it?
304  LOG_TRACE("I transformed into the same zone again, wtf, aborting the trace");
305  trace_ent = NULL;
306  break;
307  }*/
308  wz = trace_ent;
312  if(zone && wz != zone)
313  break;
315  // we hit a warpzone... so, let's perform the trace after the warp again
317  end = WarpZone_TransformOrigin(wz, end);
318 
319  // we got warped, so let's step back a bit
320  tracebox(org, mi, ma, org + normalize(org - end) * 32, nomonsters_adjusted, WarpZone_trace_forent);
321  org = trace_endpos;
322  }
324 LABEL(fail)
325  if(contentshack)
327  trace_startsolid = sol;
328  v_forward = vf;
329  v_right = vr;
330  v_up = vu;
331 }
#define MOVE_NOTHING
Definition: common.qh:33
float trace_dphitcontents
entity() spawn
vector WarpZone_TransformOrigin(entity wz, vector v)
Definition: common.qc:499
void WarpZone_MakeAllOther()
Definition: common.qc:179
void WarpZone_Trace_InitTransform()
Definition: common.qc:189
entity WarpZone_trace_lastzone
Definition: common.qh:39
float warpzone_warpzones_exist
Definition: common.qh:9
#define BITSET_ASSIGN(a, b)
Definition: common.qh:104
entity trace_ent
Definition: csprogsdefs.qc:40
void WarpZone_MakeAllSolid()
Definition: common.qc:169
entity WarpZone_trace_forent
Definition: common.qh:34
#define BITCLR_ASSIGN(a, b)
Definition: common.qh:101
const float MOVE_NOMONSTERS
Definition: csprogsdefs.qc:253
entity WarpZone_trace_firstzone
Definition: common.qh:38
vector v_up
Definition: csprogsdefs.qc:31
entity WarpZone_Find(vector mi, vector ma)
Definition: common.qc:157
#define NULL
Definition: post.qh:17
float DPCONTENTS_SOLID
vector trace_endpos
Definition: csprogsdefs.qc:37
vector(float skel, float bonenum) _skel_get_boneabs_hidden
#define LOG_TRACE(...)
Definition: log.qh:81
vector v_right
Definition: csprogsdefs.qc:31
#define LABEL(id)
Definition: compiler.qh:36
float trace_startsolid
Definition: csprogsdefs.qc:35
float MOVE_WORLDONLY
void WarpZone_Trace_AddTransform(entity wz)
Definition: common.qc:197
float trace_fraction
Definition: csprogsdefs.qc:36
vector v_forward
Definition: csprogsdefs.qc:31
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_TraceLine()

void WarpZone_TraceLine ( vector  org,
vector  end,
float  nomonsters,
entity  forent 
)

Definition at line 338 of file common.qc.

References WarpZone_TraceBox().

Referenced by CommonCommand_editmob(), ctf_CalculatePassVelocity(), ctf_FlagThink(), HUD_Crosshair(), Monster_CalculateVelocity(), Monster_Move_Target(), RadiusDamageForSource(), sandbox_ObjectSpawn(), View_EventChase(), and W_SetupShot_Dir_ProjectileSize_Range().

339 {
340  WarpZone_TraceBox(org, '0 0 0', '0 0 0', end, nomonsters, forent);
341 }
void WarpZone_TraceBox(vector org, vector mi, vector ma, vector end, float nomonsters, entity forent)
Definition: common.qc:333
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_TraceToss()

void WarpZone_TraceToss ( entity  e,
entity  forent 
)

Definition at line 452 of file common.qc.

References NULL, WarpZone_trace_callback_t_null, and WarpZone_TraceToss_ThroughZone().

453 {
455 }
var WarpZone_trace_callback_t WarpZone_trace_callback_t_null
Definition: common.qh:36
#define NULL
Definition: post.qh:17
void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZone_trace_callback_t cb)
Definition: common.qc:343
+ Here is the call graph for this function:

◆ WarpZone_TraceToss_ThroughZone()

void WarpZone_TraceToss_ThroughZone ( entity  e,
entity  forent,
entity  zone,
WarpZone_trace_callback_t  cb 
)

Definition at line 343 of file common.qc.

References cvar(), entity(), LABEL, LOG_TRACE, NULL, setorigin(), trace_endpos, trace_ent, trace_fraction, v_forward, v_right, v_up, vector(), vlen(), WarpZone_Find(), WarpZone_MakeAllOther(), WarpZone_MakeAllSolid(), WarpZone_Trace_AddTransform(), WarpZone_trace_firstzone, WarpZone_trace_forent, WarpZone_Trace_InitTransform(), WarpZone_trace_lastzone, WarpZone_tracetoss_time, WarpZone_tracetoss_velocity, WarpZone_TransformOrigin(), WarpZone_TransformVelocity(), and warpzone_warpzones_exist.

Referenced by WarpZone_TraceToss().

344 {
345  float g, dt, i;
346  vector vf, vr, vu, v0, o0;
347  entity wz;
348 
349  o0 = e.origin;
350  v0 = e.velocity;
351  g = cvar("sv_gravity") * e.gravity;
352 
353  WarpZone_trace_forent = forent;
359  {
360  tracetoss(e, WarpZone_trace_forent);
361  if(cb)
362  cb(e.origin, trace_endpos, trace_endpos);
363  dt = vlen(e.origin - o0) / vlen(e.velocity);
365  e.velocity_z -= dt * g;
366  WarpZone_tracetoss_velocity = e.velocity;
367  e.velocity = v0;
368  return;
369  }
370 
371  vf = v_forward;
372  vr = v_right;
373  vu = v_up;
374 
375  // if starting in warpzone, first transform
376  wz = WarpZone_Find(e.origin + e.mins, e.origin + e.maxs);
377  if(wz)
378  {
381  if(zone && wz != zone)
382  {
383  // we are in ANOTHER warpzone. This is bad. Make a zero length trace and return.
384 
386  trace_endpos = o0;
387  goto fail;
388  }
390  vector org = WarpZone_TransformOrigin(wz, e.origin);
391  setorigin(e, org);
392  e.velocity = WarpZone_TransformVelocity(wz, e.velocity);
393  }
395  i = 16;
396  for (;;)
397  {
398  if(--i < 1)
399  {
400  LOG_TRACE("Too many warpzones in sequence, aborting trace.");
401  trace_ent = NULL;
402  break;
403  }
404  tracetoss(e, WarpZone_trace_forent);
405  if(cb)
406  cb(e.origin, trace_endpos, trace_endpos);
407  dt = vlen(trace_endpos - e.origin) / vlen(e.velocity);
409  e.origin = trace_endpos;
410  e.velocity_z -= dt * g;
411  if(trace_fraction >= 1)
412  break;
413  if(trace_ent.classname != "trigger_warpzone")
414  break;
415  if(trace_ent == wz)
416  {
417  // FIXME can this check be removed? Do we really need it?
418  LOG_TRACE("I transformed into the same zone again, wtf, aborting the trace");
419  trace_ent = NULL;
420  break;
421  }
422  wz = trace_ent;
426  if(zone && wz != zone)
427  break;
429  // we hit a warpzone... so, let's perform the trace after the warp again
430  e.origin = WarpZone_TransformOrigin(wz, e.origin);
431  e.velocity = WarpZone_TransformVelocity(wz, e.velocity);
432 
433  // we got warped, so let's step back a bit
434  e.velocity = -e.velocity;
435  tracetoss(e, WarpZone_trace_forent);
436  dt = vlen(trace_endpos - e.origin) / vlen(e.velocity);
438  e.origin = trace_endpos;
439  e.velocity = -e.velocity;
440  }
442 LABEL(fail)
443  WarpZone_tracetoss_velocity = e.velocity;
444  v_forward = vf;
445  v_right = vr;
446  v_up = vu;
447  // restore old entity data (caller just uses trace_endpos, WarpZone_tracetoss_velocity and the transform)
448  e.velocity = v0;
449  e.origin = o0;
450 }
entity() spawn
vector WarpZone_TransformOrigin(entity wz, vector v)
Definition: common.qc:499
void WarpZone_MakeAllOther()
Definition: common.qc:179
float WarpZone_tracetoss_time
Definition: common.qh:41
void WarpZone_Trace_InitTransform()
Definition: common.qc:189
entity WarpZone_trace_lastzone
Definition: common.qh:39
float warpzone_warpzones_exist
Definition: common.qh:9
vector WarpZone_tracetoss_velocity
Definition: common.qh:40
entity trace_ent
Definition: csprogsdefs.qc:40
void WarpZone_MakeAllSolid()
Definition: common.qc:169
entity WarpZone_trace_forent
Definition: common.qh:34
entity WarpZone_trace_firstzone
Definition: common.qh:38
vector v_up
Definition: csprogsdefs.qc:31
entity WarpZone_Find(vector mi, vector ma)
Definition: common.qc:157
#define NULL
Definition: post.qh:17
vector trace_endpos
Definition: csprogsdefs.qc:37
vector WarpZone_TransformVelocity(entity wz, vector v)
Definition: common.qc:504
vector(float skel, float bonenum) _skel_get_boneabs_hidden
#define LOG_TRACE(...)
Definition: log.qh:81
vector v_right
Definition: csprogsdefs.qc:31
#define LABEL(id)
Definition: compiler.qh:36
setorigin(ent, v)
void WarpZone_Trace_AddTransform(entity wz)
Definition: common.qc:197
float trace_fraction
Definition: csprogsdefs.qc:36
vector v_forward
Definition: csprogsdefs.qc:31
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_TrailParticles()

void WarpZone_TrailParticles ( entity  own,
float  eff,
vector  org,
vector  end 
)

Definition at line 464 of file common.qc.

References entity(), MOVE_NOMONSTERS, NULL, PARTICLES_DRAWASTRAIL, to, vector(), WarpZone_TraceBox_ThroughZone(), WarpZone_TrailParticles_trace_callback(), WarpZone_TrailParticles_trace_callback_eff, and WarpZone_TrailParticles_trace_callback_own.

Referenced by ctf_Handle_Throw().

465 {
469 }
float WarpZone_TrailParticles_trace_callback_eff
Definition: common.qc:458
const float MOVE_NOMONSTERS
Definition: csprogsdefs.qc:253
#define NULL
Definition: post.qh:17
void WarpZone_TrailParticles_trace_callback(vector from, vector endpos, vector to)
Definition: common.qc:459
void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end, float nomonsters, entity forent, entity zone, WarpZone_trace_callback_t cb)
Definition: common.qc:202
entity WarpZone_TrailParticles_trace_callback_own
Definition: common.qc:457
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_TransformAngles()

vector WarpZone_TransformAngles ( entity  wz,
vector  v 
)

Definition at line 509 of file common.qc.

References AnglesTransform_ApplyToAngles().

Referenced by WarpZone_RefSys_TransformAngles(), and WarpZone_Teleport().

510 {
511  return AnglesTransform_ApplyToAngles(wz.warpzone_transform, v);
512 }
vector AnglesTransform_ApplyToAngles(vector transform, vector v)
vector v
Definition: ent_cs.qc:116
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_TransformOrigin()

vector WarpZone_TransformOrigin ( entity  wz,
vector  v 
)

Definition at line 499 of file common.qc.

References AnglesTransform_Apply().

Referenced by fireBullet_antilag(), RadiusDamageForSource(), WarpZone_camera_transform(), WarpZone_FindRadius_Recurse(), WarpZone_FixPMove(), WarpZone_FixView(), WarpZone_RefSys_TransformOrigin(), WarpZone_Teleport(), WarpZone_TraceBox_ThroughZone(), and WarpZone_TraceToss_ThroughZone().

500 {
501  return wz.warpzone_shift + AnglesTransform_Apply(wz.warpzone_transform, v);
502 }
vector v
Definition: ent_cs.qc:116
vector AnglesTransform_Apply(vector transform, vector v)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_TransformVAngles()

vector WarpZone_TransformVAngles ( entity  wz,
vector  v 
)

Definition at line 514 of file common.qc.

References AnglesTransform_ApplyToVAngles(), AnglesTransform_CancelRoll(), and AnglesTransform_Normalize().

Referenced by NET_HANDLE(), View_EventChase(), WarpZone_FixPMove(), WarpZone_FixView(), WarpZone_Projectile_Touch(), WarpZone_RefSys_TransformVAngles(), and WarpZone_Teleport().

515 {
516 #ifdef KEEP_ROLL
517  float roll;
518  roll = ang.z;
519  ang.z = 0;
520 #endif
521 
522  ang = AnglesTransform_ApplyToVAngles(wz.warpzone_transform, ang);
523 
524 #ifdef KEEP_ROLL
525  ang = AnglesTransform_Normalize(ang, true);
526  ang = AnglesTransform_CancelRoll(ang);
527  ang.z = roll;
528 #else
529  ang = AnglesTransform_Normalize(ang, false);
530 #endif
531 
532  return ang;
533 }
vector AnglesTransform_CancelRoll(vector t)
vector AnglesTransform_ApplyToVAngles(vector transform, vector v)
vector AnglesTransform_Normalize(vector t, float minimize_roll)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_TransformVelocity()

vector WarpZone_TransformVelocity ( entity  wz,
vector  v 
)

Definition at line 504 of file common.qc.

References AnglesTransform_Apply().

Referenced by fireBullet_antilag(), FireRailgunBullet(), WarpZone_camera_transform(), WarpZone_RefSys_TransformVelocity(), WarpZone_Teleport(), and WarpZone_TraceToss_ThroughZone().

505 {
506  return AnglesTransform_Apply(wz.warpzone_transform, v);
507 }
vector v
Definition: ent_cs.qc:116
vector AnglesTransform_Apply(vector transform, vector v)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_UnTransformAngles()

vector WarpZone_UnTransformAngles ( entity  wz,
vector  v 
)

Definition at line 545 of file common.qc.

References AnglesTransform_ApplyToAngles(), and AnglesTransform_Invert().

Referenced by WarpZone_RefSys_TransformAngles().

546 {
547  return AnglesTransform_ApplyToAngles(AnglesTransform_Invert(wz.warpzone_transform), v);
548 }
vector AnglesTransform_ApplyToAngles(vector transform, vector v)
vector v
Definition: ent_cs.qc:116
vector AnglesTransform_Invert(vector transform)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_UnTransformOrigin()

vector WarpZone_UnTransformOrigin ( entity  wz,
vector  v 
)

Definition at line 535 of file common.qc.

References AnglesTransform_Apply(), and AnglesTransform_Invert().

Referenced by FireRailgunBullet(), MUTATOR_HOOKFUNCTION(), RadiusDamageForSource(), W_SetupShot_Dir_ProjectileSize_Range(), and WarpZone_RefSys_TransformOrigin().

536 {
537  return AnglesTransform_Apply(AnglesTransform_Invert(wz.warpzone_transform), v - wz.warpzone_shift);
538 }
vector v
Definition: ent_cs.qc:116
vector AnglesTransform_Invert(vector transform)
vector AnglesTransform_Apply(vector transform, vector v)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_UnTransformVAngles()

vector WarpZone_UnTransformVAngles ( entity  wz,
vector  v 
)

Definition at line 550 of file common.qc.

References AnglesTransform_ApplyToVAngles(), AnglesTransform_CancelRoll(), AnglesTransform_Invert(), and AnglesTransform_Normalize().

Referenced by WarpZone_RefSys_TransformVAngles().

551 {
552  float roll;
553 
554  roll = ang.z;
555  ang.z = 0;
556 
557  ang = AnglesTransform_ApplyToVAngles(AnglesTransform_Invert(wz.warpzone_transform), ang);
558  ang = AnglesTransform_Normalize(ang, true);
559  ang = AnglesTransform_CancelRoll(ang);
560 
561  ang.z = roll;
562  return ang;
563 }
vector AnglesTransform_CancelRoll(vector t)
vector AnglesTransform_ApplyToVAngles(vector transform, vector v)
vector AnglesTransform_Normalize(vector t, float minimize_roll)
vector AnglesTransform_Invert(vector transform)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZone_UnTransformVelocity()

vector WarpZone_UnTransformVelocity ( entity  wz,
vector  v 
)

Definition at line 540 of file common.qc.

References AnglesTransform_Apply(), and AnglesTransform_Invert().

Referenced by WarpZone_RefSys_TransformVelocity().

541 {
542  return AnglesTransform_Apply(AnglesTransform_Invert(wz.warpzone_transform), v);
543 }
vector v
Definition: ent_cs.qc:116
vector AnglesTransform_Invert(vector transform)
vector AnglesTransform_Apply(vector transform, vector v)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZoneLib_BoxTouchesBrush()

float WarpZoneLib_BoxTouchesBrush ( vector  mi,
vector  ma,
entity  e,
entity  ig 
)

Definition at line 138 of file common.qc.

References SOLID_BSP, WarpZoneLib_BoxTouchesBrush_ent, WarpZoneLib_BoxTouchesBrush_ignore, WarpZoneLib_BoxTouchesBrush_maxs, WarpZoneLib_BoxTouchesBrush_mins, and WarpZoneLib_BoxTouchesBrush_Recurse().

Referenced by conveyor_think(), func_ladder_think(), havocbot_moveto(), Teleport_Find(), WarpZone_Find(), and WarpZoneLib_ExactTrigger_Touch().

139 {
140  float f, s;
141 
142  if(!e.modelindex || e.warpzone_isboxy)
143  return 1;
144 
145  s = e.solid;
146  e.solid = SOLID_BSP;
152  e.solid = s;
153 
154  return f;
155 }
vector WarpZoneLib_BoxTouchesBrush_maxs
Definition: common.qc:105
vector WarpZoneLib_BoxTouchesBrush_mins
Definition: common.qc:104
entity WarpZoneLib_BoxTouchesBrush_ignore
Definition: common.qc:107
const float SOLID_BSP
Definition: csprogsdefs.qc:248
entity WarpZoneLib_BoxTouchesBrush_ent
Definition: common.qc:106
float WarpZoneLib_BoxTouchesBrush_Recurse()
Definition: common.qc:108
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZoneLib_ExactTrigger_Init()

void WarpZoneLib_ExactTrigger_Init ( entity  this)

Definition at line 12 of file util_server.qc.

References angles, maxs, mins, model, movedir, MOVETYPE_NONE, origin, scale, set_movetype(), setorigin(), solid, SOLID_TRIGGER, vector(), and warpzone_isboxy.

Referenced by WarpZone_Projectile_Touch().

13 {
14  vector mi, ma;
15  if (this.movedir == '0 0 0')
16  if (this.angles != '0 0 0')
17  {
18  vector forward, _r, _u;
19  MAKE_VECTORS(this.angles, forward, _r, _u);
20  this.movedir = forward;
21  }
22  if(this.model == "")
23  {
24  // It's a box! No need to match with exacttriggers.
25  this.warpzone_isboxy = 1;
26  }
27  else
28  {
29  mi = this.mins;
30  ma = this.maxs;
31  precache_model(this.model);
32  _setmodel(this, this.model);
33  // let mapper-set mins/maxs override the model's bounds if set
34  if(mi != '0 0 0' || ma != '0 0 0')
35  {
36  // It's a box! No need to match with exacttriggers.
37  this.mins = mi;
38  this.maxs = ma;
39  this.warpzone_isboxy = 1;
40  }
41  }
42  setorigin(this, this.origin);
43  if(this.scale)
44  setsize(this, this.mins * this.scale, this.maxs * this.scale);
45  else
46  setsize(this, this.mins, this.maxs);
48  this.solid = SOLID_TRIGGER;
49  this.model = "";
50 }
float MOVETYPE_NONE
Definition: progsdefs.qc:246
vector maxs
Definition: csprogsdefs.qc:113
origin
Definition: ent_cs.qc:114
string model
Definition: csprogsdefs.qc:108
vector movedir
Definition: progsdefs.qc:203
vector mins
Definition: csprogsdefs.qc:113
float scale
Definition: projectile.qc:14
vector(float skel, float bonenum) _skel_get_boneabs_hidden
float warpzone_isboxy
Definition: common.qh:12
const float SOLID_TRIGGER
Definition: csprogsdefs.qc:245
setorigin(ent, v)
vector angles
Definition: csprogsdefs.qc:104
void set_movetype(entity this, int mt)
float solid
Definition: csprogsdefs.qc:99
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZoneLib_ExactTrigger_Touch()

bool WarpZoneLib_ExactTrigger_Touch ( entity  this,
entity  toucher 
)

Definition at line 798 of file common.qc.

799 {
800  vector emin = toucher.absmin, emax = toucher.absmax;
801  if(STAT(Q3COMPAT))
802  {
803  // DP's tracebox enlarges absolute bounding boxes by a single quake unit
804  // we must undo that here to allow accurate touching
805  emin += '1 1 1';
806  emax -= '1 1 1';
807  }
808  return !WarpZoneLib_BoxTouchesBrush(emin, emax, this, toucher);
809 }
float WarpZoneLib_BoxTouchesBrush(vector mi, vector ma, entity e, entity ig)
Definition: common.qc:138
vector(float skel, float bonenum) _skel_get_boneabs_hidden

◆ WarpZoneLib_MoveOutOfSolid()

bool WarpZoneLib_MoveOutOfSolid ( entity  e)

Definition at line 826 of file common.qc.

827 {
828  vector o = e.origin;
829  traceline(o, o, MOVE_WORLDONLY, e);
830  if (trace_startsolid)
831  return false;
832 
833  tracebox(o, e.mins, e.maxs, o, MOVE_WORLDONLY, e);
834  if (!trace_startsolid)
835  return true;
836 
837  vector m0 = e.mins;
838  vector m1 = e.maxs;
839  e.mins = '0 0 0';
840  e.maxs = '0 0 0';
841  WarpZoneLib_MoveOutOfSolid_Expand(e, eX * m0.x); e.mins_x = m0.x;
842  WarpZoneLib_MoveOutOfSolid_Expand(e, eX * m1.x); e.maxs_x = m1.x;
843  WarpZoneLib_MoveOutOfSolid_Expand(e, eY * m0.y); e.mins_y = m0.y;
844  WarpZoneLib_MoveOutOfSolid_Expand(e, eY * m1.y); e.maxs_y = m1.y;
845  WarpZoneLib_MoveOutOfSolid_Expand(e, eZ * m0.z); e.mins_z = m0.z;
846  WarpZoneLib_MoveOutOfSolid_Expand(e, eZ * m1.z); e.maxs_z = m1.z;
847  setorigin(e, e.origin);
848 
849  tracebox(e.origin, e.mins, e.maxs, e.origin, MOVE_WORLDONLY, e);
850  if (trace_startsolid)
851  {
852  setorigin(e, o);
853  return false;
854  }
855 
856  return true;
857 }
const vector eY
Definition: vector.qh:45
vector(float skel, float bonenum) _skel_get_boneabs_hidden
void WarpZoneLib_MoveOutOfSolid_Expand(entity e, vector by)
Definition: common.qc:812
const vector eX
Definition: vector.qh:44
const vector eZ
Definition: vector.qh:46
setorigin(ent, v)
float trace_startsolid
Definition: csprogsdefs.qc:35
float MOVE_WORLDONLY

◆ WarpZoneLib_NearestPointOnBox()

vector WarpZoneLib_NearestPointOnBox ( vector  mi,
vector  ma,
vector  org 
)

Definition at line 565 of file common.qc.

References bound(), and vector().

Referenced by WarpZone_FindRadius_Recurse().

566 {
567  vector nearest;
568  nearest.x = bound(mi.x, org.x, ma.x);
569  nearest.y = bound(mi.y, org.y, ma.y);
570  nearest.z = bound(mi.z, org.z, ma.z);
571  return nearest;
572 }
vector(float skel, float bonenum) _skel_get_boneabs_hidden
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ g_warpzones

◆ warpzone_angles

vector warpzone_angles

◆ warpzone_cameras_exist

float warpzone_cameras_exist

Definition at line 10 of file common.qh.

Referenced by NET_HANDLE(), and WarpZone_Projectile_Touch().

◆ warpzone_fadeend

◆ warpzone_fadestart

◆ WarpZone_findradius_dist

vector WarpZone_findradius_dist

Definition at line 52 of file common.qh.

◆ WarpZone_findradius_findorigin

vector WarpZone_findradius_findorigin

Definition at line 55 of file common.qh.

◆ WarpZone_findradius_findradius

float WarpZone_findradius_findradius

Definition at line 56 of file common.qh.

◆ WarpZone_findradius_nearest

vector WarpZone_findradius_nearest

Definition at line 53 of file common.qh.

◆ warpzone_forward

vector warpzone_forward

Definition at line 16 of file common.qh.

◆ warpzone_isboxy

float warpzone_isboxy

◆ warpzone_origin

vector warpzone_origin

◆ warpzone_shift

vector warpzone_shift

Definition at line 13 of file common.qh.

◆ warpzone_targetangles

vector warpzone_targetangles

Definition at line 18 of file common.qh.

Referenced by WarpZone_Touch().

◆ warpzone_targetforward

vector warpzone_targetforward

Definition at line 19 of file common.qh.

◆ warpzone_targetorigin

vector warpzone_targetorigin

Definition at line 17 of file common.qh.

Referenced by WarpZone_camera_transform(), and WarpZone_Touch().

◆ WarpZone_trace_callback_t_null

var WarpZone_trace_callback_t WarpZone_trace_callback_t_null

Definition at line 36 of file common.qh.

Referenced by WarpZone_TraceBox(), and WarpZone_TraceToss().

◆ WarpZone_trace_firstzone

entity WarpZone_trace_firstzone

◆ WarpZone_trace_forent

◆ WarpZone_trace_lastzone

entity WarpZone_trace_lastzone

Definition at line 39 of file common.qh.

Referenced by WarpZone_TraceBox_ThroughZone(), and WarpZone_TraceToss_ThroughZone().

◆ WarpZone_trace_transform

◆ WarpZone_tracetoss_time

float WarpZone_tracetoss_time

Definition at line 41 of file common.qh.

Referenced by WarpZone_TraceToss_ThroughZone().

◆ WarpZone_tracetoss_velocity

vector WarpZone_tracetoss_velocity

Definition at line 40 of file common.qh.

Referenced by WarpZone_TraceToss_ThroughZone().

◆ warpzone_transform

vector warpzone_transform

Definition at line 20 of file common.qh.

Referenced by NET_HANDLE().

◆ warpzone_warpzones_exist