12 acc.warpzone_transform =
'0 0 0';
13 acc.warpzone_shift =
'0 0 0';
20 acc.warpzone_transform = tr;
21 acc.warpzone_shift = st;
70 e.warpzone_origin = my_org;
71 e.warpzone_targetorigin = other_org;
72 e.warpzone_angles = my_ang;
73 e.warpzone_targetangles = other_ang;
76 e.warpzone_forward = forward;
78 e.warpzone_targetforward = forward;
97 e.warpzone_origin = my_org;
98 e.warpzone_angles = my_ang;
118 LOG_TRACE(
"hit a network ent, cannot continue WarpZoneLib_BoxTouchesBrush");
142 if(!e.modelindex || e.warpzone_isboxy)
204 float nomonsters_adjusted;
244 nomonsters_adjusted = nomonsters;
256 if(zone && wz != zone)
276 LOG_TRACE(
"Too many warpzones in sequence, aborting trace.");
289 if(
trace_ent.classname !=
"trigger_warpzone")
312 if(zone && wz != zone)
346 vector vf, vr, vu, v0, o0;
351 g =
cvar(
"sv_gravity") * e.gravity;
363 dt =
vlen(e.origin - o0) /
vlen(e.velocity);
365 e.velocity_z -= dt * g;
381 if(zone && wz != zone)
400 LOG_TRACE(
"Too many warpzones in sequence, aborting trace.");
410 e.velocity_z -= dt * g;
413 if(
trace_ent.classname !=
"trigger_warpzone")
418 LOG_TRACE(
"I transformed into the same zone again, wtf, aborting the trace");
426 if(zone && wz != zone)
434 e.velocity = -e.velocity;
439 e.velocity = -e.velocity;
472 float WarpZone_TrailParticles_trace_callback_f;
473 float WarpZone_TrailParticles_trace_callback_flags;
474 void WarpZone_TrailParticles_WithMultiplier_trace_callback(
vector from,
vector endpos,
vector to)
479 void WarpZone_TrailParticles_WithMultiplier(
entity own,
float eff,
vector org,
vector end,
float f,
int boxflags)
483 WarpZone_TrailParticles_trace_callback_f = f;
491 return (v - wz.warpzone_origin) * wz.warpzone_forward;
496 return (v - wz.warpzone_targetorigin) * wz.warpzone_targetforward;
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);
578 string s = e.classname;
583 case "exteriorweaponentity":
584 case "sprite_waypoint":
587 case "chatbubbleentity":
612 bool needlineofsight)
614 if (rad <= 0)
return;
623 if (!it.WarpZone_findradius_hit ||
vlen2(it.WarpZone_findradius_dist) >
vlen2(org0 - p))
625 it.WarpZone_findradius_nearest = p;
626 it.WarpZone_findradius_dist = org0 - p;
627 it.WarpZone_findradius_findorigin = org;
628 it.WarpZone_findradius_findradius = rad;
629 if (it.classname ==
"warpzone_refsys")
633 else if (it.classname ==
"trigger_warpzone")
635 it.WarpZone_findradius_next = wz;
637 it.WarpZone_findradius_hit = 1;
638 it.enemy.WarpZone_findradius_dist =
'0 0 0';
639 it.enemy.WarpZone_findradius_hit = 1;
643 it.warpzone_transform = transform;
644 it.warpzone_shift = shift;
645 it.WarpZone_findradius_hit = 1;
649 for(
entity e = wz; e; e = e.WarpZone_findradius_next)
661 bound(0, rad -
vlen(org_new - org0_new), rad - 8),
663 transform_new, shift_new,
665 e.WarpZone_findradius_hit = 0;
666 e.enemy.WarpZone_findradius_hit = 0;
684 if(this.
owner.WarpZone_refsys !=
this)
689 if(me.WarpZone_refsys.owner != me)
691 me.WarpZone_refsys =
new(warpzone_refsys);
692 me.WarpZone_refsys.owner = me;
694 me.WarpZone_refsys.nextthink =
time + 1;
700 if(me.WarpZone_refsys)
702 delete(me.WarpZone_refsys);
703 me.WarpZone_refsys =
NULL;
708 if(t !=
'0 0 0' || s !=
'0 0 0')
720 if(t !=
'0 0 0' || s !=
'0 0 0')
735 if(me.WarpZone_refsys_incremental_transform == ref.WarpZone_refsys.warpzone_transform)
736 if(me.WarpZone_refsys_incremental_shift == ref.WarpZone_refsys.warpzone_shift)
740 me.WarpZone_refsys_incremental_shift = ref.WarpZone_refsys.warpzone_shift;
741 me.WarpZone_refsys_incremental_transform = ref.WarpZone_refsys.warpzone_transform;
745 me.WarpZone_refsys_incremental_shift = ref.WarpZone_refsys.warpzone_shift;
746 me.WarpZone_refsys_incremental_transform = ref.WarpZone_refsys.warpzone_transform;
750 if(from.WarpZone_refsys)
752 if(to.WarpZone_refsys)
758 if(from.WarpZone_refsys)
760 if(to.WarpZone_refsys)
766 if(from.WarpZone_refsys)
768 if(to.WarpZone_refsys)
774 if(from.WarpZone_refsys)
776 if(to.WarpZone_refsys)
782 if(from.WarpZone_refsys)
785 me.WarpZone_refsys.warpzone_shift = from.WarpZone_refsys.warpzone_shift;
786 me.WarpZone_refsys.warpzone_transform = from.WarpZone_refsys.warpzone_transform;
800 vector emin = toucher.absmin, emax = toucher.absmax;
814 const float eps = 0.0625;
815 tracebox(e.origin, e.mins -
'1 1 1' * eps, e.maxs +
'1 1 1' * eps, e.origin + by,
MOVE_WORLDONLY, e);
#define IL_EACH(this, cond, body)
void WarpZone_Accumulator_Clear(entity acc)
vector WarpZone_UnTransformVAngles(entity wz, vector ang)
#define FOREACH_LIST(list, next, cond, body)
void WarpZone_RefSys_AddInverse(entity me, entity wz)
vector WarpZoneLib_NearestPointOnBox(vector mi, vector ma, vector org)
bool WarpZoneLib_MoveOutOfSolid(entity e)
void WarpZone_TraceBox(vector org, vector mi, vector ma, vector end, float nomonsters, entity forent)
float trace_networkentity
#define setcamera_transform(e, f)
bool WarpZoneLib_ExactTrigger_Touch(entity this, entity toucher)
void WarpZone_RefSys_Copy(entity me, entity from)
float trace_dphitcontents
vector WarpZone_TransformOrigin(entity wz, vector v)
var WarpZone_trace_callback_t WarpZone_trace_callback_t_null
vector WarpZoneLib_BoxTouchesBrush_maxs
float WarpZone_tracetoss_time
void WarpZone_MakeAllOther()
void WarpZone_Trace_InitTransform()
void WarpZone_Accumulator_AddInverseTransform(entity acc, vector t, vector s)
vector WarpZoneLib_BoxTouchesBrush_mins
entity WarpZone_trace_lastzone
void WarpZone_RefSys_AddIncrementally(entity me, entity ref)
void WarpZone_RefSys_CheckCreate(entity me)
float warpzone_warpzones_exist
vector WarpZone_tracetoss_velocity
vector WarpZone_RefSys_TransformVelocity(entity from, entity to, vector vel)
void WarpZone_Accumulator_Add(entity acc, entity wz)
float autocvar_cl_warpzone_usetrace
float WarpZone_PlaneDist(entity wz, vector v)
void WarpZone_RefSys_AddInverseTransform(entity me, vector t, vector s)
#define BITSET_ASSIGN(a, b)
vector WarpZone_UnTransformOrigin(entity wz, vector v)
void WarpZone_MakeAllSolid()
void WarpZone_RefSys_BeginAddingIncrementally(entity me, entity ref)
void WarpZone_TraceToss(entity e, entity forent)
float WarpZone_TrailParticles_trace_callback_eff
entity WarpZone_findradius_next
vector WarpZone_RefSys_TransformOrigin(entity from, entity to, vector org)
void WarpZone_Accumulator_AddInverse(entity acc, entity wz)
entity WarpZone_trace_forent
#define BITCLR_ASSIGN(a, b)
const float MOVE_NOMONSTERS
vector WarpZone_UnTransformAngles(entity wz, vector v)
vector WarpZone_TransformAngles(entity wz, vector v)
void WarpZone_SetUp(entity e, vector my_org, vector my_ang, vector other_org, vector other_ang)
void WarpZone_Accumulator_AddTransform(entity acc, vector t, vector s)
entity WarpZone_trace_firstzone
vector WarpZone_TransformVAngles(entity wz, vector ang)
entity WarpZone_Find(vector mi, vector ma)
void WarpZone_RefSys_Add(entity me, entity wz)
float WarpZoneLib_BoxTouchesBrush(vector mi, vector ma, entity e, entity ig)
entity WarpZone_RefSys_SpawnSameRefSys(entity me)
bool WarpZoneLib_BadEntity(entity e)
#define startsWith(haystack, needle)
vector WarpZone_RefSys_TransformVAngles(entity from, entity to, vector ang)
void WarpZone_RefSys_GC(entity this)
float WarpZone_TargetPlaneDist(entity wz, vector v)
void WarpZone_RefSys_Clear(entity me)
entity WarpZone_FindRadius(vector org, float rad, bool needlineofsight)
void WarpZone_FindRadius_Recurse(vector org, float rad, vector org0, vector transform, vector shift, bool needlineofsight)
void WarpZone_RefSys_AddTransform(entity me, vector t, vector s)
vector warpzone_targetorigin
entity WarpZoneLib_BoxTouchesBrush_ignore
vector WarpZone_TransformVelocity(entity wz, vector v)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
entity WarpZone_trace_transform
vector WarpZone_Camera_camera_transform(entity this, vector org, vector ang)
void WarpZoneLib_MoveOutOfSolid_Expand(entity e, vector by)
vector WarpZone_camera_transform(entity this, vector org, vector ang)
void WarpZone_Camera_SetUp(entity e, vector my_org, vector my_ang)
IntrusiveList g_warpzones
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
void WarpZone_TraceLine(vector org, vector end, float nomonsters, entity forent)
float PARTICLES_DRAWASTRAIL
const float SOLID_TRIGGER
void WarpZone_TrailParticles(entity own, float eff, vector org, vector end)
#define new_pure(class)
purely logical entities (.origin doesn't work)
vector WarpZone_UnTransformVelocity(entity wz, vector v)
void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZone_trace_callback_t cb)
void WarpZone_Trace_AddTransform(entity wz)
entity WarpZoneLib_BoxTouchesBrush_ent
float WarpZone_findradius_hit
void WarpZone_TrailParticles_trace_callback(vector from, vector endpos, vector to)
void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end, float nomonsters, entity forent, entity zone, WarpZone_trace_callback_t cb)
vector WarpZone_RefSys_TransformAngles(entity from, entity to, vector ang)
void(vector start, vector hit, vector end) WarpZone_trace_callback_t
vector WarpZone_refsys_incremental_transform
vector WarpZone_refsys_incremental_shift
entity WarpZone_TrailParticles_trace_callback_own
float WarpZoneLib_BoxTouchesBrush_Recurse()