interiorResObjects.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2012 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. #ifndef _INTERIORRESOBJECTS_H_
  23. #define _INTERIORRESOBJECTS_H_
  24. #ifndef _PLATFORM_H_
  25. #include "platform/platform.h"
  26. #endif
  27. #ifndef _MPOINT3_H_
  28. #include "math/mPoint3.h"
  29. #endif
  30. #ifndef _MBOX_H_
  31. #include "math/mBox.h"
  32. #endif
  33. #ifndef _MMATRIX_H_
  34. #include "math/mMatrix.h"
  35. #endif
  36. #ifndef _TVECTOR_H_
  37. #include "core/util/tVector.h"
  38. #endif
  39. #ifndef _MPOLYHEDRON_H_
  40. #include "math/mPolyhedron.h"
  41. #endif
  42. #ifndef _MQUAT_H_
  43. #include "math/mQuat.h"
  44. #endif
  45. class Stream;
  46. struct InteriorDictEntry
  47. {
  48. char name[256];
  49. char value[256];
  50. };
  51. class InteriorDict : public Vector<InteriorDictEntry>
  52. {
  53. public:
  54. void read(Stream& stream);
  55. void write(Stream& stream) const;
  56. };
  57. class InteriorResTrigger
  58. {
  59. public:
  60. enum Constants {
  61. MaxNameChars = 255
  62. };
  63. char mName[MaxNameChars+1];
  64. StringTableEntry mDataBlock;
  65. InteriorDict mDictionary;
  66. Point3F mOffset;
  67. Polyhedron mPolyhedron;
  68. public:
  69. InteriorResTrigger() { }
  70. bool read(Stream& stream);
  71. bool write(Stream& stream) const;
  72. };
  73. class InteriorPathFollower
  74. {
  75. public:
  76. struct WayPoint {
  77. Point3F pos;
  78. QuatF rot;
  79. U32 msToNext;
  80. U32 smoothingType;
  81. };
  82. StringTableEntry mName;
  83. StringTableEntry mDataBlock;
  84. U32 mInteriorResIndex;
  85. U32 mPathIndex;
  86. Point3F mOffset;
  87. Vector<U32> mTriggerIds;
  88. Vector<WayPoint> mWayPoints;
  89. U32 mTotalMS;
  90. InteriorDict mDictionary;
  91. public:
  92. InteriorPathFollower();
  93. ~InteriorPathFollower();
  94. bool read(Stream& stream);
  95. bool write(Stream& stream) const;
  96. };
  97. class AISpecialNode
  98. {
  99. public:
  100. enum
  101. {
  102. chute = 0,
  103. };
  104. public:
  105. StringTableEntry mName;
  106. Point3F mPos;
  107. //U32 mType;
  108. public:
  109. AISpecialNode();
  110. ~AISpecialNode();
  111. bool read(Stream& stream);
  112. bool write(Stream& stream) const;
  113. };
  114. class ItrGameEntity
  115. {
  116. public:
  117. StringTableEntry mDataBlock;
  118. StringTableEntry mGameClass;
  119. Point3F mPos;
  120. InteriorDict mDictionary;
  121. public:
  122. ItrGameEntity();
  123. ~ItrGameEntity();
  124. bool read(Stream& stream);
  125. bool write(Stream& stream) const;
  126. };
  127. #endif // _H_INTERIORRESOBJECTS_