UFO: Alien Invasion
Loading...
Searching...
No Matches
cmodel.h
Go to the documentation of this file.
1
5
6/*
7Copyright (C) 1997-2001 Id Software, Inc.
8
9This program is free software; you can redistribute it and/or
10modify it under the terms of the GNU General Public License
11as published by the Free Software Foundation; either version 2
12of the License, or (at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
18See the GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
24*/
25
26#pragma once
27
28/*==============================================================
29CMODEL
30==============================================================*/
31#include "tracing.h"
32#include "qfiles.h"
33
34void CM_LoadMap(const char* tiles, bool day, const char* pos, const char* entityString, mapData_t* mapData, mapTiles_t* mapTiles);
37void CM_GetInlineModelAABB(mapTiles_t* mapTiles, const char* name, AABB& aabb);
38float CM_GetVisibility(const mapTiles_t* mapTiles, const pos3_t position);
39void CM_LoadBsp(MapTile& tile, const dBspHeader_t& header, const vec3_t shift, const byte* base);
40
41/*==============================================================
42CMODEL BOX TRACING
43==============================================================*/
44
46int32_t CM_HeadnodeForBox(MapTile& tile, const AABB& box);
47trace_t CM_HintedTransformedBoxTrace(MapTile& tile, const Line& traceLine, const AABB& traceBox, const int headnode, const int brushmask, const int brushrejects, const vec3_t origin, const vec3_t angles, const vec3_t rmaShift, const float fraction);
48#define CM_TransformedBoxTrace(tile, line, box, headnode, brushmask, brushreject, origin, angles) CM_HintedTransformedBoxTrace(tile, line, box, headnode, brushmask, brushreject, origin, angles, vec3_origin, 1.0f);
49trace_t CM_EntCompleteBoxTrace(mapTiles_t* mapTiles, const Line& traceLine, const AABB* traceBox, int levelmask, int brushmask, int brushreject, const char** list);
50bool CM_EntTestLineDM(mapTiles_t* mapTiles, const Line& trLine, vec3_t hit, const int levelmask, const char** entlist);
51bool CM_EntTestLine(mapTiles_t* mapTiles, const Line& traceLine, const int levelmask, const char** entlist);
52trace_t CM_CompleteBoxTrace(mapTiles_t* mapTiles, const Line& trLine, const AABB& box, int levelmask, int brushmask, int brushreject);
Definition aabb.h:42
Definition line.h:31
Stores the data of a map tile, mostly the BSP stuff.
Definition typedefs.h:85
void CM_GetInlineModelAABB(mapTiles_t *mapTiles, const char *name, AABB &aabb)
This function calculates a model's aabb in world coordinates.
Definition bsp.cpp:979
bool CM_EntTestLine(mapTiles_t *mapTiles, const Line &traceLine, const int levelmask, const char **entlist)
Checks traces against the world and all inline models.
Definition cmodel.cpp:184
cBspModel_t * CM_SetInlineModelOrientation(mapTiles_t *mapTiles, const char *name, const vec3_t origin, const vec3_t angles)
This function updates a model's orientation.
Definition bsp.cpp:963
void CM_LoadMap(const char *tiles, bool day, const char *pos, const char *entityString, mapData_t *mapData, mapTiles_t *mapTiles)
Loads in the map and all submodels.
Definition bsp.cpp:860
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.
Definition cmodel.cpp:230
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.
Definition cmodel.cpp:283
float CM_GetVisibility(const mapTiles_t *mapTiles, const pos3_t position)
Checks how well a position is visible.
Definition bsp.cpp:991
void CM_LoadBsp(MapTile &tile, const dBspHeader_t &header, const vec3_t shift, const byte *base)
Definition bsp.cpp:644
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 c...
Definition cmodel.cpp:151
trace_t CM_HintedTransformedBoxTrace(MapTile &tile, const Line &traceLine, const AABB &traceBox, const int headnode, const int brushmask, 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.
Definition cmodel.cpp:84
cBspModel_t * CM_InlineModel(const mapTiles_t *mapTiles, const char *name)
Searches all inline models and return the cBspModel_t pointer for the given modelnumber or -name.
Definition bsp.cpp:929
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.
Definition cmodel.cpp:327
voidpf uLong int origin
Definition ioapi.h:45
Header for various formats like pak, and model formats as well as bsp format.
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition r_gl.h:110
static ipos3_t shift
The shift array is used for random map assemblies (RMA) to shift the mins/maxs and stuff like that.
The BSP header definition with the data block directory.
Definition qfiles.h:262
static mapTiles_t mapTiles
static mapData_t mapData
Tracing functions.
pos_t pos3_t[3]
Definition ufotypes.h:58
vec_t vec3_t[3]
Definition ufotypes.h:39