home *** CD-ROM | disk | FTP | other *** search
/ AI Game Programming Wisdom / AIGameProgrammingWisdom.iso / SourceCode / 09 Racing and Sports AI / 04 Adzima / aimap.h next >
Encoding:
C/C++ Source or Header  |  2001-08-19  |  1.7 KB  |  60 lines

  1. #ifndef AI_MAP_H
  2. #define AI_MAP_H
  3.  
  4. class aiPath;
  5. class aiObstacle;
  6.  
  7. class aiIntersection
  8. {
  9.     public:
  10.         aiIntersection();
  11.  
  12.         int Id();                                    // Return the intersection identification
  13.         int NumRoads();                                // Return the number of roads connected to this intersection
  14.         aiPath* Road(int nWhich);                    // Return a road connected to this intersection
  15.  
  16.         aiObstacle* Vehicles();
  17. };
  18.  
  19. class aiPath
  20. {
  21.     public:
  22.         aiPath();
  23.  
  24.         int Id();                                    // Return the road identification
  25.         int NumVerts();
  26.         int NumLanes(int nDirection);
  27.         bool Divider();                                // Returns true when the road is divided and cannot be crossed.
  28.         Vector3& CenterVertice(int nWhich);            
  29.         Vector3& VertXDir(int nWhich);    
  30.         Vector3& VertYDir(int nWhich);    
  31.         Vector3& VertZDir(int nWhich);    
  32.         Vector3& LBoundary(int nWhich);
  33.         Vector3& RBoundary(int nWhich);
  34.  
  35.         aiObstacle* Vehicles(int nVert,int nSide);
  36.         int  RoadVertice(const Vector3& Pos,int nDir,int nVertHint);
  37.         int  IsPosOnRoad(const Vector3& Pos,float fVehHalfWidth,float *pfSideDist);
  38.         float LaneWidth(int nIdx,int nInner,int nSide);
  39.  
  40.         aiIntersection* Destination();                // Return the destination intersection
  41.         aiIntersection* Departure();                // Return the departure intersection
  42. };
  43.  
  44. class aiMap
  45. {
  46.     public:
  47.         aiMap(){};
  48.  
  49.         aiPath*    Path(int nWhich);                    // Return the requested road.
  50.         aiIntersection* Intersection(int nWhich);    // Return the requested intersection.
  51.  
  52.         aiPath* DetRdSegBetweenInts(aiIntersection *pInt0,aiIntersection *pInt1,bool bDir);
  53.         int MapComponent(const Vector3& Position,short *pnCompId,short *pnCompType,short nHint,
  54.                          short nTargetRdId);
  55. };
  56.  
  57. enum aiMapCompTypes{kRoad,kIntersection};
  58.  
  59. #endif
  60.