UFO: Alien Invasion
|
World query functions. More...
Go to the source code of this file.
Data Structures | |
struct | areaParms_t |
class | MoveClipSV |
Server side moveclip - see cmodel.c. More... | |
Macros | |
#define | AREA_DEPTH 4 |
Functions | |
static worldSector_t * | SV_CreateWorldSector (int depth, const AABB &sBox) |
Builds a uniformly subdivided tree for the given world size. More... | |
void | SV_ClearWorld (void) |
Clear physics interaction links. More... | |
static sv_edict_t * | SV_GetServerDataForEdict (const edict_t *ent) |
void | SV_UnlinkEdict (edict_t *ent) |
call before removing an entity, and before trying to move one, so it doesn't clip against itself More... | |
void | SV_LinkEdict (edict_t *ent) |
Needs to be called any time an entity changes origin, mins, maxs, or solid. Automatically unlinks if needed. Sets ent->absmin and ent->absBox.maxs. More... | |
static bool | SV_BoundingBoxesIntersect (const AABB &aabb, const edict_t *ent) |
Checks whether the bounding box of the given edict will intersect with the given bbox. More... | |
static void | SV_AreaEdicts_r (worldSector_t *node, areaParms_t *ap) |
fills in a table of edict pointers with edicts that have bounding boxes that intersect the given area. It is possible for a non-axial bmodel to be returned that doesn't actually intersect the area on an exact test. More... | |
static int | SV_AreaEdicts (const AABB &abox, edict_t **list, int maxCount) |
static int | SV_HullForEntity (const edict_t *ent, int *tile, vec3_t rmaShift) |
Returns a headnode that can be used for testing or clipping an object of mins/maxs size. Offset is filled in to contain the adjustment that must be added to the testing object's origin to get a point to use with the returned hull. More... | |
static void | SV_ClipMoveToEntities (MoveClipSV *clip) |
int | SV_PointContents (const vec3_t p) |
Returns the content flags for a given point. More... | |
trace_t | SV_Trace (const Line &traceLine, const AABB &box, const edict_t *passedict, int contentmask) |
Moves the given mins/maxs volume through the world from start to end. More... | |
const char * | SV_GetFootstepSound (const char *texture) |
Query the footstep sound for the given surface texture. More... | |
float | SV_GetBounceFraction (const char *texture) |
Different terrain types might have different bounce fraction. More... | |
static void | SV_ModLoadAliasMD2Model (sv_model_t *mod, const byte *buffer) |
Loads the mins/maxs for a md2 mesh model. More... | |
static void | SV_ModLoadAliasMD3Model (sv_model_t *mod, const byte *buffer) |
Loads the mins/maxs for a md3 mesh model. More... | |
static void | SV_ModLoadObjModel (sv_model_t *mod, const byte *buffer, int bufferLength) |
Loads the mins/maxs for a obj mesh model. More... | |
bool | SV_LoadModelAABB (const char *model, int frame, AABB &aabb) |
Load the bounding box for the model on the serverside for pathfinding and clipping. More... | |
Variables | |
static char const *const | mod_extensions [] |
all supported model formats More... | |
World query functions.
Definition in file sv_world.cpp.
#define AREA_DEPTH 4 |
Definition at line 33 of file sv_world.cpp.
Referenced by SV_CreateWorldSector().
[in] | abox | The bounding box |
[out] | list | The edict list that this trace is hitting |
[in] | maxCount | The size of the given list |
Definition at line 256 of file sv_world.cpp.
References areaParms_t::areaBox, areaParms_t::areaEdictList, areaParms_t::areaEdictListCount, areaParms_t::areaEdictListMaxCount, AABB::set(), sv, SV_AreaEdicts_r(), and serverInstanceGame_s::worldSectors.
Referenced by SV_ClipMoveToEntities().
|
static |
fills in a table of edict pointers with edicts that have bounding boxes that intersect the given area. It is possible for a non-axial bmodel to be returned that doesn't actually intersect the area on an exact test.
Definition at line 213 of file sv_world.cpp.
References areaParms_t::areaBox, areaParms_t::areaEdictList, areaParms_t::areaEdictListCount, areaParms_t::areaEdictListMaxCount, worldSector_s::axis, worldSector_s::children, Com_Printf(), worldSector_s::dist, sv_edict_s::ent, worldSector_s::entities, SrvEdict::inuse, LEAFNODE, AABB::maxs, AABB::mins, sv_edict_s::nextEntityInWorldSector, SrvEdict::solid, SOLID_NOT, and SV_BoundingBoxesIntersect().
Referenced by SV_AreaEdicts().
Checks whether the bounding box of the given edict will intersect with the given bbox.
[in] | aabb | the bounding box |
[in] | ent | The edict to check the intersection for |
true
if intersect, false
otherwise Definition at line 196 of file sv_world.cpp.
References SrvEdict::absBox, and AABB::doesIntersect().
Referenced by SV_AreaEdicts_r().
Clear physics interaction links.
Definition at line 81 of file sv_world.cpp.
References mapData_s::mapBox, serverInstanceGame_s::mapData, sv, and SV_CreateWorldSector().
|
static |
Definition at line 323 of file sv_world.cpp.
References trace_s::allsolid, SrvEdict::angles, MoveClip::clipBox, CM_HintedTransformedBoxTrace(), Com_DPrintf(), MoveClip::contentmask, DEBUG_SERVER, SrvEdict::entBox, trace_s::entNum, trace_s::fraction, i, SrvEdict::isParentship(), mapTiles_s::mapTiles, serverInstanceGame_s::mapTiles, MAX_EDICTS, MAX_MAP_NODES, AABB::maxs, AABB::mins, SrvEdict::modelindex, MoveClip::moveLine, SrvEdict::number, MoveClip::objBox, SrvEdict::origin, MoveClipSV::passedict, SrvEdict::solid, SOLID_BSP, SOLID_NOT, SOLID_TRIGGER, trace_s::startsolid, sv, SV_AreaEdicts(), SV_HullForEntity(), MoveClipSV::trace, and vec3_origin.
Referenced by SV_Trace().
|
static |
Builds a uniformly subdivided tree for the given world size.
Definition at line 40 of file sv_world.cpp.
References AREA_DEPTH, worldSector_s::axis, worldSector_s::children, Com_Error(), worldSector_s::dist, worldSector_s::entities, ERR_DROP, AABB::getDiagonal(), LEAFNODE, lengthof, AABB::maxs, AABB::mins, serverInstanceGame_s::numWorldSectors, PLANE_X, PLANE_Y, sv, and serverInstanceGame_s::worldSectors.
Referenced by SV_ClearWorld().
float SV_GetBounceFraction | ( | const char * | texture | ) |
Different terrain types might have different bounce fraction.
Definition at line 462 of file sv_world.cpp.
References terrainType_s::bounceFraction, and Com_GetTerrainType().
Referenced by SV_InitGameProgs().
const char* SV_GetFootstepSound | ( | const char * | texture | ) |
Query the footstep sound for the given surface texture.
nullptr
or the footstep sound filename if there is one assigned in the scripts Definition at line 451 of file sv_world.cpp.
References Com_GetTerrainType(), and terrainType_s::footstepSound.
Referenced by SV_InitGameProgs(), and TEST_F().
|
inlinestatic |
Definition at line 86 of file sv_world.cpp.
References Com_Error(), serverInstanceGame_s::edicts, ERR_DROP, lengthof, SrvEdict::number, and sv.
Referenced by SV_LinkEdict(), and SV_UnlinkEdict().
Returns a headnode that can be used for testing or clipping an object of mins/maxs size. Offset is filled in to contain the adjustment that must be added to the testing object's origin to get a point to use with the returned hull.
[in] | ent | The edict to get the bmodel from (at least in case of SOLID_BSP) |
[out] | tile | The maptile the bmodel belongs, too (at least in case of SOLID_BSP) |
[out] | rmaShift | the shift vector in case of an RMA (needed for doors) |
Definition at line 290 of file sv_world.cpp.
References CM_HeadnodeForBox(), Com_Error(), SrvEdict::entBox, ERR_FATAL, cBspModel_s::headnode, mapTiles_s::mapTiles, serverInstanceGame_s::mapTiles, MAX_MAP_NODES, MAX_MODELS, SrvEdict::modelindex, serverInstanceGame_s::models, cBspModel_s::shift, SrvEdict::solid, SOLID_BSP, SOLID_NOT, SOLID_TRIGGER, sv, cBspModel_s::tile, vec3_origin, and VectorCopy.
Referenced by SV_ClipMoveToEntities().
Needs to be called any time an entity changes origin, mins, maxs, or solid. Automatically unlinks if needed. Sets ent->absmin and ent->absBox.maxs.
Definition at line 131 of file sv_world.cpp.
References SrvEdict::absBox, SrvEdict::angles, worldSector_s::axis, CalculateMinsMaxs(), SrvEdict::child(), worldSector_s::children, worldSector_s::dist, game_export_s::edicts, sv_edict_s::ent, SrvEdict::entBox, worldSector_s::entities, AABB::expandXY(), serverInstanceStatic_s::ge, AABB::getDiagonal(), SrvEdict::inuse, LEAFNODE, SrvEdict::linkcount, sv_edict_s::linked, AABB::maxs, AABB::mins, sv_edict_s::nextEntityInWorldSector, SrvEdict::origin, AABB::set(), SrvEdict::size, SrvEdict::solid, SOLID_BSP, SOLID_NOT, sv, SV_GetServerDataForEdict(), SV_UnlinkEdict(), svs, UNIT_SIZE, vec3_origin, sv_edict_s::worldSector, and serverInstanceGame_s::worldSectors.
Referenced by SV_InitGameProgs().
Load the bounding box for the model on the serverside for pathfinding and clipping.
[in] | model | The relative model path to load the bounding box for |
[in] | frame | The frame to load the bounding box for |
[out] | aabb | The bounding box of the model - this is absolute to the worldorigin (0,0,0) |
Definition at line 543 of file sv_world.cpp.
References sv_model_s::aabb, Com_Error(), com_genericPool, Com_GetExtension(), Com_sprintf(), ERR_DROP, sv_model_s::frame, FS_FreeFile(), FS_LoadFile(), i, IDALIASHEADER, IDMD3HEADER, LittleLong, MAX_MOD_KNOWN, MAX_QPATH, Mem_PoolStrDup, mod_extensions, sv_model_s::name, serverInstanceGame_s::numSVModels, OBJZERO, Q_strcasecmp, Q_streq, AABB::reset(), AABB::set(), AABB::setNegativeVolume(), sv, SV_ModLoadAliasMD2Model(), SV_ModLoadAliasMD3Model(), SV_ModLoadObjModel(), and serverInstanceGame_s::svModels.
Referenced by SV_InitGameProgs().
|
static |
Loads the mins/maxs for a md2 mesh model.
[in,out] | mod | The server side model struct to store the results in |
[in] | buffer | The mesh model buffer |
Definition at line 473 of file sv_world.cpp.
References sv_model_s::aabb, AABB::add(), sv_model_s::frame, dMD2Model_t::framesize, LittleFloat, LittleLong, dMD2Model_t::num_frames, dMD2Model_t::ofs_frames, dAliasFrame_s::scale, scale, dAliasFrame_s::translate, and VectorMA().
Referenced by SV_LoadModelAABB().
|
static |
Loads the mins/maxs for a md3 mesh model.
[in,out] | mod | The server side model struct to store the results in |
[in] | buffer | The mesh model buffer |
Definition at line 499 of file sv_world.cpp.
References sv_model_s::aabb, AABB::add(), sv_model_s::frame, LittleFloat, LittleLong, dmd3frame_t::maxs, dmd3frame_t::mins, dmd3_t::num_frames, and dmd3_t::ofs_frames.
Referenced by SV_LoadModelAABB().
|
static |
Loads the mins/maxs for a obj mesh model.
[in,out] | mod | The server side model struct to store the results in |
[in] | buffer | The mesh model buffer |
[in] | bufferLength | The mesh model buffer length |
Definition at line 524 of file sv_world.cpp.
Referenced by SV_LoadModelAABB().
Returns the content flags for a given point.
Definition at line 395 of file sv_world.cpp.
References CM_CompleteBoxTrace(), trace_s::contentFlags, AABB::EMPTY, trace_s::fraction, serverInstanceGame_s::mapTiles, MASK_ALL, sv, and TRACE_ALL_LEVELS.
Referenced by SV_InitGameProgs().
trace_t SV_Trace | ( | const Line & | traceLine, |
const AABB & | box, | ||
const edict_t * | passedict, | ||
int | contentmask | ||
) |
Moves the given mins/maxs volume through the world from start to end.
[in] | traceLine | The from/to position in the world for this trace |
[in] | box | The bounding box that is moved through the world |
[in] | passedict | is explicitly excluded from clipping checks (normally nullptr) if the entire move stays in a solid volume, trace.allsolid will be set, trace.startsolid will be set, and trace.fraction will be 0 if the starting point is in a solid, it will be allowed to move out to an open area |
[in] | contentmask | brushes the trace should stop at (see MASK_*) |
clip.trace.mapTile
to get the correct one Definition at line 417 of file sv_world.cpp.
References MoveClip::calcBounds(), CM_CompleteBoxTrace(), MoveClip::contentmask, trace_s::entNum, trace_s::fraction, serverInstanceGame_s::mapTiles, MoveClip::moveLine, MoveClip::objBox, OBJZERO, MoveClipSV::passedict, Line::set(), AABB::set(), sv, SV_ClipMoveToEntities(), MoveClipSV::trace, and TRACE_ALL_LEVELS.
Referenced by SV_InitGameProgs(), and TEST_F().
call before removing an entity, and before trying to move one, so it doesn't clip against itself
Definition at line 97 of file sv_world.cpp.
References Com_Printf(), worldSector_s::entities, sv_edict_s::linked, sv_edict_s::nextEntityInWorldSector, SV_GetServerDataForEdict(), and sv_edict_s::worldSector.
Referenced by SV_InitGameProgs(), and SV_LinkEdict().
|
static |
all supported model formats
Definition at line 533 of file sv_world.cpp.
Referenced by SV_LoadModelAABB().