Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

be_aas.h

Go to the documentation of this file.
00001 /*
00002 ===========================================================================
00003 Copyright (C) 1999-2005 Id Software, Inc.
00004 
00005 This file is part of Quake III Arena source code.
00006 
00007 Quake III Arena source code is free software; you can redistribute it
00008 and/or modify it under the terms of the GNU General Public License as
00009 published by the Free Software Foundation; either version 2 of the License,
00010 or (at your option) any later version.
00011 
00012 Quake III Arena source code is distributed in the hope that it will be
00013 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 GNU General Public License for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Foobar; if not, write to the Free Software
00019 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020 ===========================================================================
00021 */
00022 //
00023 
00024 /*****************************************************************************
00025  * name:        be_aas.h
00026  *
00027  * desc:        Area Awareness System, stuff exported to the AI
00028  *
00029  * $Archive: /source/code/botlib/be_aas.h $
00030  *
00031  *****************************************************************************/
00032 
00033 #ifndef MAX_STRINGFIELD
00034 #define MAX_STRINGFIELD             80
00035 #endif
00036 
00037 //travel flags
00038 #define TFL_INVALID             0x00000001  //traveling temporary not possible
00039 #define TFL_WALK                0x00000002  //walking
00040 #define TFL_CROUCH              0x00000004  //crouching
00041 #define TFL_BARRIERJUMP         0x00000008  //jumping onto a barrier
00042 #define TFL_JUMP                0x00000010  //jumping
00043 #define TFL_LADDER              0x00000020  //climbing a ladder
00044 #define TFL_WALKOFFLEDGE        0x00000080  //walking of a ledge
00045 #define TFL_SWIM                0x00000100  //swimming
00046 #define TFL_WATERJUMP           0x00000200  //jumping out of the water
00047 #define TFL_TELEPORT            0x00000400  //teleporting
00048 #define TFL_ELEVATOR            0x00000800  //elevator
00049 #define TFL_ROCKETJUMP          0x00001000  //rocket jumping
00050 #define TFL_BFGJUMP             0x00002000  //bfg jumping
00051 #define TFL_GRAPPLEHOOK         0x00004000  //grappling hook
00052 #define TFL_DOUBLEJUMP          0x00008000  //double jump
00053 #define TFL_RAMPJUMP            0x00010000  //ramp jump
00054 #define TFL_STRAFEJUMP          0x00020000  //strafe jump
00055 #define TFL_JUMPPAD             0x00040000  //jump pad
00056 #define TFL_AIR                 0x00080000  //travel through air
00057 #define TFL_WATER               0x00100000  //travel through water
00058 #define TFL_SLIME               0x00200000  //travel through slime
00059 #define TFL_LAVA                0x00400000  //travel through lava
00060 #define TFL_DONOTENTER          0x00800000  //travel through donotenter area
00061 #define TFL_FUNCBOB             0x01000000  //func bobbing
00062 #define TFL_FLIGHT              0x02000000  //flight
00063 #define TFL_BRIDGE              0x04000000  //move over a bridge
00064 //
00065 #define TFL_NOTTEAM1            0x08000000  //not team 1
00066 #define TFL_NOTTEAM2            0x10000000  //not team 2
00067 
00068 //default travel flags
00069 #define TFL_DEFAULT TFL_WALK|TFL_CROUCH|TFL_BARRIERJUMP|\
00070     TFL_JUMP|TFL_LADDER|\
00071     TFL_WALKOFFLEDGE|TFL_SWIM|TFL_WATERJUMP|\
00072     TFL_TELEPORT|TFL_ELEVATOR|\
00073     TFL_AIR|TFL_WATER|TFL_JUMPPAD|TFL_FUNCBOB
00074 
00075 typedef enum
00076 {
00077     SOLID_NOT,          // no interaction with other objects
00078     SOLID_TRIGGER,      // only touch when inside, after moving
00079     SOLID_BBOX,         // touch on edge
00080     SOLID_BSP           // bsp clip, touch on edge
00081 } solid_t;
00082 
00083 //a trace is returned when a box is swept through the AAS world
00084 typedef struct aas_trace_s
00085 {
00086     qboolean    startsolid; // if true, the initial point was in a solid area
00087     float       fraction;   // time completed, 1.0 = didn't hit anything
00088     vec3_t      endpos;     // final position
00089     int         ent;        // entity blocking the trace
00090     int         lastarea;   // last area the trace was in (zero if none)
00091     int         area;       // area blocking the trace (zero if none)
00092     int         planenum;   // number of the plane that was hit
00093 } aas_trace_t;
00094 
00095 /* Defined in botlib.h
00096 
00097 //bsp_trace_t hit surface
00098 typedef struct bsp_surface_s
00099 {
00100     char name[16];
00101     int flags;
00102     int value;
00103 } bsp_surface_t;
00104 
00105 //a trace is returned when a box is swept through the BSP world
00106 typedef struct bsp_trace_s
00107 {
00108     qboolean        allsolid;   // if true, plane is not valid
00109     qboolean        startsolid; // if true, the initial point was in a solid area
00110     float           fraction;   // time completed, 1.0 = didn't hit anything
00111     vec3_t          endpos;     // final position
00112     cplane_t        plane;      // surface normal at impact
00113     float           exp_dist;   // expanded plane distance
00114     int             sidenum;    // number of the brush side hit
00115     bsp_surface_t   surface;    // hit surface
00116     int             contents;   // contents on other side of surface hit
00117     int             ent;        // number of entity hit
00118 } bsp_trace_t;
00119 //
00120 */
00121 
00122 //entity info
00123 typedef struct aas_entityinfo_s
00124 {
00125     int     valid;          // true if updated this frame
00126     int     type;           // entity type
00127     int     flags;          // entity flags
00128     float   ltime;          // local time
00129     float   update_time;    // time between last and current update
00130     int     number;         // number of the entity
00131     vec3_t  origin;         // origin of the entity
00132     vec3_t  angles;         // angles of the model
00133     vec3_t  old_origin;     // for lerping
00134     vec3_t  lastvisorigin;  // last visible origin
00135     vec3_t  mins;           // bounding box minimums
00136     vec3_t  maxs;           // bounding box maximums
00137     int     groundent;      // ground entity
00138     int     solid;          // solid type
00139     int     modelindex;     // model used
00140     int     modelindex2;    // weapons, CTF flags, etc
00141     int     frame;          // model frame number
00142     int     event;          // impulse events -- muzzle flashes, footsteps, etc
00143     int     eventParm;      // even parameter
00144     int     powerups;       // bit flags
00145     int     weapon;         // determines weapon and flash model, etc
00146     int     legsAnim;       // mask off ANIM_TOGGLEBIT
00147     int     torsoAnim;      // mask off ANIM_TOGGLEBIT
00148 } aas_entityinfo_t;
00149 
00150 // area info
00151 typedef struct aas_areainfo_s
00152 {
00153     int contents;
00154     int flags;
00155     int presencetype;
00156     int cluster;
00157     vec3_t mins;
00158     vec3_t maxs;
00159     vec3_t center;
00160 } aas_areainfo_t;
00161 
00162 // client movement prediction stop events, stop as soon as:
00163 #define SE_NONE                 0
00164 #define SE_HITGROUND            1       // the ground is hit
00165 #define SE_LEAVEGROUND          2       // there's no ground
00166 #define SE_ENTERWATER           4       // water is entered
00167 #define SE_ENTERSLIME           8       // slime is entered
00168 #define SE_ENTERLAVA            16      // lava is entered
00169 #define SE_HITGROUNDDAMAGE      32      // the ground is hit with damage
00170 #define SE_GAP                  64      // there's a gap
00171 #define SE_TOUCHJUMPPAD         128     // touching a jump pad area
00172 #define SE_TOUCHTELEPORTER      256     // touching teleporter
00173 #define SE_ENTERAREA            512     // the given stoparea is entered
00174 #define SE_HITGROUNDAREA        1024    // a ground face in the area is hit
00175 #define SE_HITBOUNDINGBOX       2048    // hit the specified bounding box
00176 #define SE_TOUCHCLUSTERPORTAL   4096    // touching a cluster portal
00177 
00178 typedef struct aas_clientmove_s
00179 {
00180     vec3_t endpos;          //position at the end of movement prediction
00181     int endarea;            //area at end of movement prediction
00182     vec3_t velocity;        //velocity at the end of movement prediction
00183     aas_trace_t trace;      //last trace
00184     int presencetype;       //presence type at end of movement prediction
00185     int stopevent;          //event that made the prediction stop
00186     int endcontents;        //contents at the end of movement prediction
00187     float time;             //time predicted ahead
00188     int frames;             //number of frames predicted ahead
00189 } aas_clientmove_t;
00190 
00191 // alternate route goals
00192 #define ALTROUTEGOAL_ALL                1
00193 #define ALTROUTEGOAL_CLUSTERPORTALS     2
00194 #define ALTROUTEGOAL_VIEWPORTALS        4
00195 
00196 typedef struct aas_altroutegoal_s
00197 {
00198     vec3_t origin;
00199     int areanum;
00200     unsigned short starttraveltime;
00201     unsigned short goaltraveltime;
00202     unsigned short extratraveltime;
00203 } aas_altroutegoal_t;
00204 
00205 // route prediction stop events
00206 #define RSE_NONE                0
00207 #define RSE_NOROUTE             1   //no route to goal
00208 #define RSE_USETRAVELTYPE       2   //stop as soon as on of the given travel types is used
00209 #define RSE_ENTERCONTENTS       4   //stop when entering the given contents
00210 #define RSE_ENTERAREA           8   //stop when entering the given area
00211 
00212 typedef struct aas_predictroute_s
00213 {
00214     vec3_t endpos;          //position at the end of movement prediction
00215     int endarea;            //area at end of movement prediction
00216     int stopevent;          //event that made the prediction stop
00217     int endcontents;        //contents at the end of movement prediction
00218     int endtravelflags;     //end travel flags
00219     int numareas;           //number of areas predicted ahead
00220     int time;               //time predicted ahead (in hundreth of a sec)
00221 } aas_predictroute_t;

Generated on Thu Aug 25 12:37:30 2005 for Quake III Arena by  doxygen 1.3.9.1