AASFile_local.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. ===========================================================================
  3. Doom 3 BFG Edition GPL Source Code
  4. Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
  5. This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
  6. Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with Doom 3 BFG Edition Source Code. If not, see <http://www.gnu.org/licenses/>.
  16. In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below.
  17. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
  18. ===========================================================================
  19. */
  20. #ifndef __AASFILELOCAL_H__
  21. #define __AASFILELOCAL_H__
  22. /*
  23. ===============================================================================
  24. AAS File Local
  25. ===============================================================================
  26. */
  27. class idAASFileLocal : public idAASFile {
  28. friend class idAASBuild;
  29. friend class idAASReach;
  30. friend class idAASCluster;
  31. public:
  32. idAASFileLocal();
  33. virtual ~idAASFileLocal();
  34. public:
  35. virtual idVec3 EdgeCenter( int edgeNum ) const;
  36. virtual idVec3 FaceCenter( int faceNum ) const;
  37. virtual idVec3 AreaCenter( int areaNum ) const;
  38. virtual idBounds EdgeBounds( int edgeNum ) const;
  39. virtual idBounds FaceBounds( int faceNum ) const;
  40. virtual idBounds AreaBounds( int areaNum ) const;
  41. virtual int PointAreaNum( const idVec3 &origin ) const;
  42. virtual int PointReachableAreaNum( const idVec3 &origin, const idBounds &searchBounds, const int areaFlags, const int excludeTravelFlags ) const;
  43. virtual int BoundsReachableAreaNum( const idBounds &bounds, const int areaFlags, const int excludeTravelFlags ) const;
  44. virtual void PushPointIntoAreaNum( int areaNum, idVec3 &point ) const;
  45. virtual bool Trace( aasTrace_t &trace, const idVec3 &start, const idVec3 &end ) const;
  46. virtual void PrintInfo() const;
  47. public:
  48. bool Load( const idStr &fileName, unsigned int mapFileCRC );
  49. bool Write( const idStr &fileName, unsigned int mapFileCRC );
  50. int MemorySize() const;
  51. void ReportRoutingEfficiency() const;
  52. void Optimize();
  53. void LinkReversedReachability();
  54. void FinishAreas();
  55. void Clear();
  56. void DeleteReachabilities();
  57. void DeleteClusters();
  58. private:
  59. bool ParseIndex( idLexer &src, idList<aasIndex_t> &indexes );
  60. bool ParsePlanes( idLexer &src );
  61. bool ParseVertices( idLexer &src );
  62. bool ParseEdges( idLexer &src );
  63. bool ParseFaces( idLexer &src );
  64. bool ParseReachabilities( idLexer &src, int areaNum );
  65. bool ParseAreas( idLexer &src );
  66. bool ParseNodes( idLexer &src );
  67. bool ParsePortals( idLexer &src );
  68. bool ParseClusters( idLexer &src );
  69. private:
  70. int BoundsReachableAreaNum_r( int nodeNum, const idBounds &bounds, const int areaFlags, const int excludeTravelFlags ) const;
  71. void MaxTreeDepth_r( int nodeNum, int &depth, int &maxDepth ) const;
  72. int MaxTreeDepth() const;
  73. int AreaContentsTravelFlags( int areaNum ) const;
  74. idVec3 AreaReachableGoal( int areaNum ) const;
  75. int NumReachabilities() const;
  76. };
  77. #endif /* !__AASFILELOCAL_H__ */