UFO: Alien Invasion
|
model loading and grid oriented movement and scanning More...
Go to the source code of this file.
Functions | |
static void | CM_CalculateWidestBoundingBox (const cBspModel_t *model, AABB &box) |
Calculates the worst case bounding box for the given bsp model. More... | |
static bool | CM_LineMissesModel (const Line &tLine, const cBspModel_t *model) |
A quick test if the trace might hit the inline model. More... | |
trace_t | CM_HintedTransformedBoxTrace (MapTile &tile, const Line &traceLine, const AABB &traceBox, const int headnode, const int contentmask, const int brushrejects, const vec3_t origin, const vec3_t angles, const vec3_t rmaShift, const float fraction) |
Handles offseting and rotation of the end points for moving and rotating entities. More... | |
int32_t | CM_HeadnodeForBox (MapTile &tile, const AABB &box) |
To keep everything totally uniform, bounding boxes are turned into small BSP trees instead of being compared directly. More... | |
bool | CM_EntTestLine (mapTiles_t *mapTiles, const Line &traceLine, const int levelmask, const char **entlist) |
Checks traces against the world and all inline models. More... | |
bool | CM_EntTestLineDM (mapTiles_t *mapTiles, const Line &trLine, vec3_t hit, const int levelmask, const char **entlist) |
Checks traces against the world and all inline models, gives the hit position back. More... | |
trace_t | CM_CompleteBoxTrace (mapTiles_t *mapTiles, const Line &trLine, const AABB &box, int levelmask, int brushmask, int brushreject) |
Traces all submodels in all tiles. Used by ufo and ufo_ded. More... | |
trace_t | CM_EntCompleteBoxTrace (mapTiles_t *mapTiles, const Line &traceLine, const AABB *traceBox, int levelmask, int brushmask, int brushreject, const char **list) |
Performs box traces against the world and all inline models, gives the hit position back. More... | |
model loading and grid oriented movement and scanning
Definition in file cmodel.cpp.
|
static |
Calculates the worst case bounding box for the given bsp model.
[in] | model | The model to calculate the bbox for |
[out] | box | The bbox to fill |
Definition at line 41 of file cmodel.cpp.
References cBspModel_s::angles, cBspModel_s::cbmBox, AABB::expand(), f, AABB::getWidthX(), AABB::getWidthY(), AABB::getWidthZ(), cBspModel_s::origin, AABB::set(), AABB::shift(), and VectorNotEmpty.
Referenced by CM_EntCompleteBoxTrace(), and CM_LineMissesModel().
trace_t CM_CompleteBoxTrace | ( | mapTiles_t * | mapTiles, |
const Line & | trLine, | ||
const AABB & | box, | ||
int | levelmask, | ||
int | brushmask, | ||
int | brushreject | ||
) |
Traces all submodels in all tiles. Used by ufo and ufo_ded.
[in] | mapTiles | List of tiles the current (RMA-)map is composed of |
[in] | trLine | The line to trace |
[in] | box | The box we move through the world |
[in] | levelmask | Selects which submodels get scanned. |
[in] | brushmask | brushes the trace should stop at (see MASK_*) |
[in] | brushreject | brushes the trace should ignore (see MASK_*) |
Definition at line 283 of file cmodel.cpp.
References AABB::doesIntersect(), trace_s::endpos, trace_s::fraction, MapTile::getTileBox(), trace_s::mapTile, mapTiles_s::mapTiles, mapTiles_s::numTiles, AABB::set(), Line::stop, tr, TR_TileBoxTrace(), and VectorCopy.
Referenced by CL_Trace(), CM_EntCompleteBoxTrace(), R_Trace(), SV_PointContents(), and SV_Trace().
trace_t CM_EntCompleteBoxTrace | ( | mapTiles_t * | mapTiles, |
const Line & | traceLine, | ||
const AABB * | traceBox, | ||
int | levelmask, | ||
int | brushmask, | ||
int | brushreject, | ||
const char ** | list | ||
) |
Performs box traces against the world and all inline models, gives the hit position back.
[in] | mapTiles | List of tiles the current (RMA-)map is composed of |
[in] | traceLine | The start/stop position of the trace. |
[in] | traceBox | The minimum/maximum extents of the collision box that is projected. |
[in] | levelmask | A mask of the game levels to trace against. Mask 0x100 filters clips. |
[in] | brushmask | Any brush detected must at least have one of these contents. |
[in] | brushreject | Any brush detected with any of these contents will be ignored. |
[in] | list | The local models list (a local model has a name starting with * followed by the model number) |
Definition at line 327 of file cmodel.cpp.
References cBspModel_s::angles, CM_CalculateWidestBoundingBox(), CM_CompleteBoxTrace(), CM_HintedTransformedBoxTrace(), CM_InlineModel(), Com_Error(), AABB::doesIntersect(), ERR_DROP, trace_s::fraction, AABB::getMaxZ(), AABB::getMinZ(), cBspModel_s::headnode, i, mapTiles_s::mapTiles, name, cBspModel_s::origin, PATHFINDING_HEIGHT, AABB::set(), cBspModel_s::shift, cBspModel_s::tile, TL_FLAG_ACTORCLIP, tr, and UNIT_HEIGHT.
bool CM_EntTestLine | ( | mapTiles_t * | mapTiles, |
const Line & | traceLine, | ||
const int | levelmask, | ||
const char ** | entlist | ||
) |
Checks traces against the world and all inline models.
[in] | mapTiles | List of tiles the current (RMA-)map is composed of |
[in] | traceLine | The start/stop positions of the trace. |
[in] | levelmask | |
[in] | entlist | The local models list |
Definition at line 184 of file cmodel.cpp.
References cBspModel_s::angles, CM_HintedTransformedBoxTrace(), CM_InlineModel(), CM_LineMissesModel(), Com_Error(), ERR_DROP, trace_s::fraction, cBspModel_s::headnode, mapTiles_s::mapTiles, MASK_VISIBILILITY, name, cBspModel_s::origin, cBspModel_s::shift, Line::start, trace_s::startsolid, Line::stop, cBspModel_s::tile, and TR_TestLine().
Referenced by SV_TestLineWithEnt().
bool CM_EntTestLineDM | ( | mapTiles_t * | mapTiles, |
const Line & | trLine, | ||
vec3_t | hit, | ||
const int | levelmask, | ||
const char ** | entlist | ||
) |
Checks traces against the world and all inline models, gives the hit position back.
[in] | mapTiles | List of tiles the current (RMA-)map is composed of |
[in] | trLine | The start/stop positions of the trace. |
[out] | hit | The position where the line hits a object or the stop position if nothing is in the line |
[in] | levelmask | |
[in] | entlist | The local models list |
Definition at line 230 of file cmodel.cpp.
References cBspModel_s::angles, CM_HintedTransformedBoxTrace(), CM_InlineModel(), CM_LineMissesModel(), Com_Error(), trace_s::endpos, ERR_DROP, trace_s::fraction, cBspModel_s::headnode, mapTiles_s::mapTiles, MASK_ALL, name, cBspModel_s::origin, Line::start, trace_s::startsolid, Line::stop, cBspModel_s::tile, TR_TestLineDM(), vec3_origin, and VectorCopy.
Referenced by CL_ActorMouseTrace(), and CL_GetWorldCoordsUnderMouse().
To keep everything totally uniform, bounding boxes are turned into small BSP trees instead of being compared directly.
creates a clipping hull for an arbitrary box
Definition at line 151 of file cmodel.cpp.
References MapTile::box_headnode, MapTile::box_planes, cBspPlane_s::dist, MAX_MAP_NODES, AABB::maxs, and AABB::mins.
Referenced by CL_HullForEntity(), and SV_HullForEntity().
trace_t CM_HintedTransformedBoxTrace | ( | MapTile & | tile, |
const Line & | traceLine, | ||
const AABB & | traceBox, | ||
const int | headnode, | ||
const int | contentmask, | ||
const int | brushrejects, | ||
const vec3_t | origin, | ||
const vec3_t | angles, | ||
const vec3_t | rmaShift, | ||
const float | fraction | ||
) |
Handles offseting and rotation of the end points for moving and rotating entities.
[in] | tile | Tile to check (normally 0 - except in assembled maps) |
[in] | traceLine | The start and stop vectors of the trace |
[in] | traceBox | The box we shove through the world |
[in] | headnode | if < 0 we are in a leaf node |
[in] | contentmask | content flags the trace should stop at (see MASK_*) |
[in] | brushrejects | brushes the trace should ignore (see MASK_*) |
[in] | origin | center for rotating objects |
[in] | angles | current rotation status (in degrees) for rotating objects |
[in] | rmaShift | how much the object was shifted by the RMA process (needed for doors) |
[in] | fraction | The furthest distance needed to trace before we stop. |
Definition at line 84 of file cmodel.cpp.
References AngleVectors(), MapTile::box_headnode, DotProduct, trace_s::endpos, trace_s::fraction, MapTile::idx, boxtrace_s::init(), trace_s::mapTile, trace_s::plane, boxtrace_s::setLineAndBox(), Line::start, Line::stop, TR_BoxTrace(), VectorAdd, VectorCopy, VectorInterpolation, VectorNegate, VectorNotEmpty, and VectorSubtract.
Referenced by CL_ClipMoveToLEs(), CM_EntCompleteBoxTrace(), CM_EntTestLine(), CM_EntTestLineDM(), and SV_ClipMoveToEntities().
|
static |
A quick test if the trace might hit the inline model.
[in] | tLine | The traceline |
[in] | model | The entity to check |
Definition at line 58 of file cmodel.cpp.
References AABB::canBeHitBy(), and CM_CalculateWidestBoundingBox().
Referenced by CM_EntTestLine(), and CM_EntTestLineDM().