Quake II RTX doxygen
1.0 dev
|
|
Go to the source code of this file.
|
static areanode_t * | SV_CreateAreaNode (int depth, vec3_t mins, vec3_t maxs) |
|
void | SV_ClearWorld (void) |
|
qboolean | SV_EdictIsVisible (cm_t *cm, edict_t *ent, byte *mask) |
|
void | SV_LinkEdict (cm_t *cm, edict_t *ent) |
|
void | PF_UnlinkEdict (edict_t *ent) |
|
void | PF_LinkEdict (edict_t *ent) |
|
static void | SV_AreaEdicts_r (areanode_t *node) |
|
int | SV_AreaEdicts (vec3_t mins, vec3_t maxs, edict_t **list, int maxcount, int areatype) |
|
static mnode_t * | SV_HullForEntity (edict_t *ent) |
|
int | SV_PointContents (vec3_t p) |
|
static void | SV_ClipMoveToEntities (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, edict_t *passedict, int contentmask, trace_t *tr) |
|
trace_t q_gameabi | SV_Trace (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, edict_t *passedict, int contentmask) |
|
◆ AREA_DEPTH
◆ AREA_NODES
◆ areanode_t
◆ PF_LinkEdict()
void PF_LinkEdict |
( |
edict_t * |
ent | ) |
|
Definition at line 264 of file world.c.
276 if (ent ==
ge->edicts)
280 Com_DPrintf(
"%s: entity %d is not in use\n", __func__,
NUM_FOR_EDICT(ent));
292 switch (ent->solid) {
294 if ((ent->svflags & SVF_DEADMONSTER) || VectorCompare(ent->mins, ent->maxs)) {
298 ent->s.solid = MSG_PackSolid16(ent->mins, ent->maxs);
299 sent->
solid32 = MSG_PackSolid32(ent->mins, ent->maxs);
303 ent->s.solid = PACKED_BSP;
315 if (!ent->linkcount) {
316 VectorCopy(ent->s.origin, ent->s.old_origin);
318 VectorCopy(ent->s.origin, sent->create_origin);
327 VectorCopy(ent->s.origin, sent->history[i].origin);
331 if (ent->solid == SOLID_NOT)
337 if (node->
axis == -1)
339 if (ent->absmin[node->
axis] > node->
dist)
341 else if (ent->absmax[node->
axis] < node->
dist)
348 if (ent->solid == SOLID_TRIGGER)
Referenced by PF_setmodel(), and SV_InitGameProgs().
◆ PF_UnlinkEdict()
void PF_UnlinkEdict |
( |
edict_t * |
ent | ) |
|
◆ SV_AreaEdicts()
int SV_AreaEdicts |
( |
vec3_t |
mins, |
|
|
vec3_t |
maxs, |
|
|
edict_t ** |
list, |
|
|
int |
maxcount, |
|
|
int |
areatype |
|
) |
| |
◆ SV_AreaEdicts_r()
Definition at line 361 of file world.c.
372 LIST_FOR_EACH(edict_t, check, start, area) {
373 if (check->solid == SOLID_NOT)
384 Com_WPrintf(
"SV_AreaEdicts: MAXCOUNT\n");
392 if (node->
axis == -1)
Referenced by SV_AreaEdicts().
◆ SV_ClearWorld()
◆ SV_ClipMoveToEntities()
static void SV_ClipMoveToEntities |
( |
vec3_t |
start, |
|
|
vec3_t |
mins, |
|
|
vec3_t |
maxs, |
|
|
vec3_t |
end, |
|
|
edict_t * |
passedict, |
|
|
int |
contentmask, |
|
|
trace_t * |
tr |
|
) |
| |
|
static |
Definition at line 487 of file world.c.
490 vec3_t boxmins, boxmaxs;
492 edict_t *touchlist[MAX_EDICTS], *touch;
496 for (i = 0; i < 3; i++) {
497 if (end[i] > start[i]) {
498 boxmins[i] = start[i] + mins[i] - 1;
499 boxmaxs[i] = end[i] + maxs[i] + 1;
501 boxmins[i] = end[i] + mins[i] - 1;
502 boxmaxs[i] = start[i] + maxs[i] + 1;
506 num =
SV_AreaEdicts(boxmins, boxmaxs, touchlist, MAX_EDICTS, AREA_SOLID);
510 for (i = 0; i < num; i++) {
511 touch = touchlist[i];
512 if (touch->solid == SOLID_NOT)
514 if (touch == passedict)
519 if (touch->owner == passedict)
521 if (passedict->owner == touch)
525 if (!(contentmask & CONTENTS_DEADMONSTER)
526 && (touch->svflags & SVF_DEADMONSTER))
532 touch->s.origin, touch->s.angles);
Referenced by SV_Trace().
◆ SV_CreateAreaNode()
static areanode_t* SV_CreateAreaNode |
( |
int |
depth, |
|
|
vec3_t |
mins, |
|
|
vec3_t |
maxs |
|
) |
| |
|
static |
Definition at line 57 of file world.c.
61 vec3_t mins1, maxs1, mins2, maxs2;
75 VectorSubtract(maxs, mins, size);
76 if (size[0] > size[1])
81 anode->
dist = 0.5 * (maxs[anode->
axis] + mins[anode->
axis]);
82 VectorCopy(mins, mins1);
83 VectorCopy(mins, mins2);
84 VectorCopy(maxs, maxs1);
85 VectorCopy(maxs, maxs2);
Referenced by SV_ClearWorld().
◆ SV_EdictIsVisible()
qboolean SV_EdictIsVisible |
( |
cm_t * |
cm, |
|
|
edict_t * |
ent, |
|
|
byte * |
mask |
|
) |
| |
◆ SV_HullForEntity()
static mnode_t* SV_HullForEntity |
( |
edict_t * |
ent | ) |
|
|
static |
◆ SV_LinkEdict()
void SV_LinkEdict |
( |
cm_t * |
cm, |
|
|
edict_t * |
ent |
|
) |
| |
Definition at line 156 of file world.c.
166 VectorSubtract(ent->maxs, ent->mins, ent->size);
169 if (ent->solid == SOLID_BSP &&
170 (ent->s.angles[0] || ent->s.angles[1] || ent->s.angles[2])) {
176 for (i = 0; i < 3; i++) {
177 v = Q_fabs(ent->mins[i]);
180 v = Q_fabs(ent->maxs[i]);
184 for (i = 0; i < 3; i++) {
185 ent->absmin[i] = ent->s.origin[i] - max;
186 ent->absmax[i] = ent->s.origin[i] + max;
190 VectorAdd(ent->s.origin, ent->mins, ent->absmin);
191 VectorAdd(ent->s.origin, ent->maxs, ent->absmax);
204 ent->num_clusters = 0;
209 num_leafs =
CM_BoxLeafs(cm, ent->absmin, ent->absmax,
213 for (i = 0; i < num_leafs; i++) {
214 clusters[i] = CM_LeafCluster(leafs[i]);
215 area = CM_LeafArea(leafs[i]);
219 if (ent->areanum && ent->areanum != area) {
220 if (ent->areanum2 && ent->areanum2 != area &&
sv.
state == ss_loading) {
221 Com_DPrintf(
"Object touching 3 areas at %f %f %f\n",
222 ent->absmin[0], ent->absmin[1], ent->absmin[2]);
224 ent->areanum2 = area;
232 ent->num_clusters = -1;
233 ent->headnode = CM_NumNode(cm, topnode);
235 ent->num_clusters = 0;
236 for (i = 0; i < num_leafs; i++) {
237 if (clusters[i] == -1)
239 for (j = 0; j < i; j++)
240 if (clusters[j] == clusters[i])
243 if (ent->num_clusters == MAX_ENT_CLUSTERS) {
245 ent->num_clusters = -1;
246 ent->headnode = CM_NumNode(cm, topnode);
250 ent->clusternums[ent->num_clusters++] = clusters[i];
Referenced by MVD_LinkEdict(), and PF_LinkEdict().
◆ SV_PointContents()
int SV_PointContents |
( |
vec3_t |
p | ) |
|
Definition at line 454 of file world.c.
456 edict_t *touch[MAX_EDICTS], *hit;
461 Com_Error(ERR_DROP,
"%s: no map loaded", __func__);
470 for (i = 0; i < num; i++) {
475 hit->s.origin, hit->s.angles);
Referenced by SV_InitGameProgs().
◆ SV_Trace()
trace_t q_gameabi SV_Trace |
( |
vec3_t |
start, |
|
|
vec3_t |
mins, |
|
|
vec3_t |
maxs, |
|
|
vec3_t |
end, |
|
|
edict_t * |
passedict, |
|
|
int |
contentmask |
|
) |
| |
Definition at line 546 of file world.c.
552 Com_Error(ERR_DROP,
"%s: no map loaded", __func__);
557 Com_EPrintf(
"%s: runaway loop avoided\n", __func__);
558 memset(&trace, 0,
sizeof(trace));
560 trace.ent =
ge->edicts;
561 VectorCopy(end, trace.endpos);
572 CM_BoxTrace(&trace, start, end, mins, maxs,
sv.
cm.cache->nodes, contentmask);
573 trace.ent =
ge->edicts;
574 if (trace.fraction == 0) {
Referenced by SV_InitGameProgs().
◆ area_count
◆ area_list
◆ area_maxcount
◆ area_maxs
◆ area_mins
◆ area_type
◆ sv_areanodes
◆ sv_numareanodes
static void SV_ClipMoveToEntities(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, edict_t *passedict, int contentmask, trace_t *tr)
void CM_BoxTrace(trace_t *trace, vec3_t start, vec3_t end, vec3_t mins, vec3_t maxs, mnode_t *headnode, int brushmask)
static int sv_numareanodes
void SV_LinkEdict(cm_t *cm, edict_t *ent)
qboolean CM_HeadnodeVisible(mnode_t *node, byte *visbits)
static areanode_t * SV_CreateAreaNode(int depth, vec3_t mins, vec3_t maxs)
static edict_t ** area_list
mnode_t * CM_HeadnodeForBox(vec3_t mins, vec3_t maxs)
void PF_UnlinkEdict(edict_t *ent)
int CM_BoxLeafs(cm_t *cm, vec3_t mins, vec3_t maxs, mleaf_t **list, int listsize, mnode_t **topnode)
static mnode_t * SV_HullForEntity(edict_t *ent)
void Com_Error(error_type_t type, const char *fmt,...)
void CM_ClipEntity(trace_t *dst, const trace_t *src, struct edict_s *ent)
void CM_TransformedBoxTrace(trace_t *trace, vec3_t start, vec3_t end, vec3_t mins, vec3_t maxs, mnode_t *headnode, int brushmask, vec3_t origin, vec3_t angles)
#define MAX_TOTAL_ENT_LEAFS
int CM_PointContents(vec3_t p, mnode_t *headnode)
static void SV_AreaEdicts_r(areanode_t *node)
int SV_AreaEdicts(vec3_t mins, vec3_t maxs, edict_t **list, int maxcount, int areatype)
static areanode_t sv_areanodes[AREA_NODES]
struct areanode_s * children[2]
server_entity_t entities[MAX_EDICTS]
mnode_t * CM_NodeNum(cm_t *cm, int number)
int CM_TransformedPointContents(vec3_t p, mnode_t *headnode, vec3_t origin, vec3_t angles)