10static inline trace_t PHYS_TraceBox(
prvm_prog_t *prog,
const vec3_t start,
const vec3_t mins,
const vec3_t maxs,
const vec3_t end,
int type,
prvm_edict_t *passedict,
int hitsupercontentsmask,
int skipsupercontentsmask,
int skipmaterialflagsmask,
float extend,
qbool hitnetworkbrushmodels,
qbool hitnetworkplayers,
int *hitnetworkentity,
qbool hitcsqcentities)
13 ?
SV_TraceBox(start,
mins,
maxs, end,
type, passedict, hitsupercontentsmask, skipsupercontentsmask, skipmaterialflagsmask, extend)
14 :
CL_TraceBox(start,
mins,
maxs, end,
type, passedict, hitsupercontentsmask, skipsupercontentsmask, skipmaterialflagsmask, extend, hitnetworkbrushmodels, hitnetworkplayers, hitnetworkentity, hitcsqcentities);
27 int skipsupercontentsmask = 0;
28 int skipmaterialflagsmask = 0;
29 vec3_t org, entorigin, entmins, entmaxs;
36 trace =
PHYS_TraceBox(prog, org, entmins, entmaxs, entorigin, ((
PRVM_serveredictfloat(ent,
movetype) ==
MOVETYPE_FLY_WORLDONLY) ?
MOVE_WORLDONLY :
MOVE_NOMONSTERS), ent, hitsupercontentsmask, skipsupercontentsmask, skipmaterialflagsmask,
collision_extendmovelength.
value,
true,
false,
NULL,
false);
52#define EPSILON (1.0f / 32.0f)
58 v[0] = (
i & 1) ? m2[0] : m1[0];
59 v[1] = (
i & 2) ? m2[1] : m1[1];
60 v[2] = (
i & 4) ? m2[2] : m1[2];
75 trace =
PHYS_TraceBox(prog, org, entmins, entmaxs, org,
MOVE_NOMONSTERS, ent, hitsupercontentsmask, skipsupercontentsmask, skipmaterialflagsmask,
collision_extendmovelength.
value,
true,
false,
NULL,
false);
77 Con_Printf(
"PHYS_TestEntityPosition: trace.endpos detected to be in solid. NOT using it.\n");
122 for(
i = 2;
i <= maxunstick; ++
i)
140 vec3_t testorigin, targetorigin;
141 vec3_t stuckmins, stuckmaxs;
156 Sys_Error(
"PHYS_NudgeOutOfSolid: cannot be called from %s VM\n", prog->
name);
169 stuckmins[0] -= separation;
170 stuckmins[1] -= separation;
171 stuckmins[2] -= separation;
172 stuckmaxs[0] += separation;
173 stuckmaxs[1] += separation;
174 stuckmaxs[2] += separation;
179 for (pass = 0;pass < 2;pass++)
182 for (bump = 0;bump < 10;bump++)
184 stucktrace =
PHYS_TraceBox(prog, testorigin, stuckmins, stuckmaxs, testorigin, pass ?
MOVE_WORLDONLY :
MOVE_NOMONSTERS, ent,
SV_GenericHitSuperContentsMask(ent), 0, 0,
collision_extendmovelength.
value, pass ?
false :
true,
false,
NULL,
false);
198 stucktrace =
PHYS_TraceBox(prog, testorigin, stuckmins, stuckmaxs, targetorigin, pass ?
MOVE_WORLDONLY :
MOVE_NOMONSTERS, ent,
SV_GenericHitSuperContentsMask(ent), 0, 0,
collision_extendmovelength.
value, pass ?
false :
true,
false,
NULL,
false);
trace_t CL_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitnetworkbrushmodels, qbool hitnetworkplayers, int *hitnetworkentity, qbool hitcsqcentities)
cvar_t cl_gameplayfix_nudgeoutofsolid_separation
cvar_t collision_extendmovelength
void Con_Printf(const char *fmt,...)
Prints to all appropriate console targets.
static int(ZEXPORT *qz_inflate)(z_stream *strm
GLuint GLuint GLintptr offset
#define VectorDistance2(a, b)
#define VectorSubtract(a, b, out)
#define VectorCompare(a, b)
#define VectorCopy(in, out)
#define VectorAdd(a, b, out)
#define VectorMA(a, scale, b, out)
void Mod_CollisionBIH_TraceBox(model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, trace_t *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask)
static trace_t PHYS_TraceBox(prvm_prog_t *prog, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitnetworkbrushmodels, qbool hitnetworkplayers, int *hitnetworkentity, qbool hitcsqcentities)
static float unstickoffsets[]
unstickresult_t PHYS_UnstickEntityReturnOffset(prvm_prog_t *prog, prvm_edict_t *ent, vec3_t offset)
unstickresult_t PHYS_NudgeOutOfSolid(prvm_prog_t *prog, prvm_edict_t *ent)
qbool PHYS_TestEntityPosition(prvm_prog_t *prog, prvm_edict_t *ent, vec3_t offset)
@ UNSTICK_GOOD
didn't need to be unstuck
#define PRVM_serveredictvector(ed, fieldname)
#define PRVM_serveredictfloat(ed, fieldname)
cvar_t sv_gameplayfix_nudgeoutofsolid_separation
int SV_GenericHitSuperContentsMask(const prvm_edict_t *edict)
calculates hitsupercontentsmask for a generic qc entity
#define MOVETYPE_FLY_WORLDONLY
like MOVETYPE_FLY, but uses MOVE_WORLDONLY for all its traces; objects of this movetype better be SOL...
int SV_PointSuperContents(const vec3_t point)
trace_t SV_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend)
traces a box move against worldmodel and all entities in the specified area
struct model_s * worldmodel
void(* TraceBox)(struct model_s *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask)
const char * name
name of the prog, e.g. "Server", "Client" or "Menu" (used for text output)
struct model_s * worldmodel
double startdepthnormal[3]
void Sys_Error(const char *error,...) DP_FUNC_PRINTF(1) DP_FUNC_NORETURN
Causes the entire program to exit ASAP.