codemp/game/g_nav.h

Go to the documentation of this file.
00001 #ifndef __G_NAV_H__
00002 #define __G_NAV_H__
00003 
00004 //This file is shared by the exe nav code.
00005 //If you modify it without recompiling the exe with new code, there could be issues.
00006 
00007 #define WAYPOINT_NONE   -1
00008 
00009 #define MAX_STORED_WAYPOINTS    512//???
00010 #define MAX_WAYPOINT_REACHED_DIST_SQUARED       1024    //32 squared
00011 #define MAX_COLL_AVOID_DIST                                     128
00012 #define NAVGOAL_USE_RADIUS                                      16384   //Used to force the waypoint_navgoals with a manually set radius to actually do a DistanceSquared check, not just bounds overlap
00013 
00014 #define MIN_STOP_DIST 64
00015 #define MIN_BLOCKED_SPEECH_TIME 4000
00016 #define MIN_DOOR_BLOCK_DIST                     16
00017 #define MIN_DOOR_BLOCK_DIST_SQR         ( MIN_DOOR_BLOCK_DIST * MIN_DOOR_BLOCK_DIST )
00018 #define SHOVE_SPEED     200
00019 #define SHOVE_LIFT      10
00020 #define MAX_RADIUS_CHECK        1024
00021 #define YAW_ITERATIONS  16
00022 
00023 // This is probably wrong - VVFIXME
00024 // Some kind of wacky code sharing going on here, but we need these things
00025 // in g_navnew.c -- which is now C++ code in the GAME on Xbox, so the
00026 // original test fails.
00027 #if !defined(__cplusplus) || (defined(_XBOX) && defined(QAGAME)) || (defined(__linux__) && defined(QAGAME))
00028 //rww - Rest of defines here are also shared in exe, do not modify.
00029 #define __NEWCOLLECT    1
00030 
00031 #define _HARD_CONNECT   1
00032 
00033 //Node flags
00034 #define NF_ANY                  0
00035 //#define       NF_CLEAR_LOS    0x00000001
00036 #define NF_CLEAR_PATH   0x00000002
00037 #define NF_RECALC               0x00000004
00038 
00039 //Edge flags
00040 #define EFLAG_NONE              0
00041 #define EFLAG_BLOCKED   0x00000001
00042 #define EFLAG_FAILED    0x00000002
00043 
00044 //Miscellaneous defines
00045 #define NODE_NONE               -1
00046 #define NAV_HEADER_ID   'JNV5'
00047 #define NODE_HEADER_ID  'NODE'
00048 
00049 //this stuff is local and can be modified, don't even show it to the engine.
00050 extern  qboolean navCalculatePaths;
00051 
00052 extern  qboolean NAVDEBUG_showNodes;
00053 extern  qboolean NAVDEBUG_showRadius;
00054 extern  qboolean NAVDEBUG_showEdges;
00055 extern  qboolean NAVDEBUG_showTestPath;
00056 extern  qboolean NAVDEBUG_showEnemyPath;
00057 extern  qboolean NAVDEBUG_showCombatPoints;
00058 extern  qboolean NAVDEBUG_showNavGoals;
00059 extern  qboolean NAVDEBUG_showCollision;
00060 
00061 extern  int      NAVDEBUG_curGoal;
00062 
00063 void NAV_Shutdown( void );
00064 void NAV_CalculatePaths( const char *filename, int checksum );
00065 void NAV_CalculateSquadPaths( const char *filename, int checksum );
00066 
00067 void NAV_ShowDebugInfo( void );
00068 
00069 int NAV_GetNearestNode( gentity_t *self, int lastNode );
00070 extern int NAV_TestBestNode( gentity_t *self, int startID, int endID, qboolean failEdge );
00071 
00072 qboolean NPC_GetMoveDirection( vec3_t out, float *distance );
00073 void NPC_MoveToGoalExt( vec3_t point );
00074 void NAV_FindPlayerWaypoint( int clNum );
00075 qboolean NAV_CheckAhead( gentity_t *self, vec3_t end, trace_t *trace, int clipmask );
00076 #endif
00077 
00078 #endif //#ifndef __G_NAV_H__