1 /* 2 Copyright (C) 1996-1997 Id Software, Inc. 3 4 This program is free software; you can redistribute it and/or 5 modify it under the terms of the GNU General Public License 6 as published by the Free Software Foundation; either version 2 7 of the License, or (at your option) any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 13 See the GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 19 */ 20 // world.h 21 #ifndef __WORLD_H__ 22 #define __WORLD_H__ 23 24 #define MOVE_NORMAL 0 25 #define MOVE_NOMONSTERS 1 26 #define MOVE_MISSILE 2 27 // { sv_antilag related 28 #define MOVE_LAGGED 64 //trace touches current last-known-state, instead of actual ents (just affects players for now) 29 // } 30 31 typedef struct areanode_s 32 { 33 int axis; // -1 = leaf node 34 float dist; 35 struct areanode_s *children[2]; 36 link_t trigger_edicts; 37 link_t solid_edicts; 38 } areanode_t; 39 40 #define AREA_SOLID 0 41 #define AREA_TRIGGERS 1 42 43 #define AREA_DEPTH 4 44 #define AREA_NODES 32 45 46 extern areanode_t sv_areanodes[AREA_NODES]; 47 48 void SV_ClearWorld (void); 49 // called after the world model has been loaded, before linking any entities 50 51 void SV_UnlinkEdict (edict_t *ent); 52 // call before removing an entity, and before trying to move one, 53 // so it doesn't clip against itself 54 // flags ent->v.modified 55 56 void SV_LinkEdict (edict_t *ent, qbool touch_triggers); 57 // Needs to be called any time an entity changes origin, mins, maxs, or solid 58 // flags ent->v.modified 59 // sets ent->v.absmin and ent->v.absmax 60 // if touchtriggers, calls prog functions for the intersected triggers 61 62 int SV_PointContents (vec3_t p); 63 // returns the CONTENTS_* value from the world at the given point. 64 // does not check any entities at all 65 66 edict_t *SV_TestEntityPosition (edict_t *ent); 67 68 trace_t SV_Trace (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int type, edict_t *passedict); 69 // mins and maxs are relative 70 71 // if the entire move stays in a solid volume, trace.allsolid will be set 72 73 // if the starting point is in a solid, it will be allowed to move out 74 // to an open area 75 76 // nomonsters is used for line of sight or edge testing, where mosnters 77 // shouldn't be considered solid objects 78 79 // passedict is explicitly excluded from clipping checks (normally NULL) 80 81 int SV_AreaEdicts (vec3_t mins, vec3_t maxs, edict_t **edicts, int max_edicts, int area); 82 83 void SV_AntilagReset (edict_t *ent); 84 85 #endif /* !__WORLD_H__ */ 86