RcConstants.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
  3. recast4j copyright (c) 2015-2019 Piotr Piastucki piotr@jtilia.org
  4. DotRecast Copyright (c) 2023 Choi Ikpil ikpil@naver.com
  5. This software is provided 'as-is', without any express or implied
  6. warranty. In no event will the authors be held liable for any damages
  7. arising from the use of this software.
  8. Permission is granted to anyone to use this software for any purpose,
  9. including commercial applications, and to alter it and redistribute it
  10. freely, subject to the following restrictions:
  11. 1. The origin of this software must not be misrepresented; you must not
  12. claim that you wrote the original software. If you use this software
  13. in a product, an acknowledgment in the product documentation would be
  14. appreciated but is not required.
  15. 2. Altered source versions must be plainly marked as such, and must not be
  16. misrepresented as being the original software.
  17. 3. This notice may not be removed or altered from any source distribution.
  18. */
  19. namespace DotRecast.Recast
  20. {
  21. public static class RcConstants
  22. {
  23. /// Represents the null area.
  24. /// When a data element is given this value it is considered to no longer be
  25. /// assigned to a usable area. (E.g. It is un-walkable.)
  26. public const int RC_NULL_AREA = 0;
  27. /// The default area id used to indicate a walkable polygon.
  28. /// This is also the maximum allowed area id, and the only non-null area id
  29. /// recognized by some steps in the build process.
  30. public const int RC_WALKABLE_AREA = 63;
  31. /// The value returned by #rcGetCon if the specified direction is not connected
  32. /// to another span. (Has no neighbor.)
  33. public const int RC_NOT_CONNECTED = 0x3f;
  34. /// Defines the number of bits allocated to rcSpan::smin and rcSpan::smax.
  35. public const int SPAN_HEIGHT_BITS = 20;
  36. /// Defines the maximum value for rcSpan::smin and rcSpan::smax.
  37. public const int SPAN_MAX_HEIGHT = (1 << SPAN_HEIGHT_BITS) - 1;
  38. /// Heighfield border flag.
  39. /// If a heightfield region ID has this bit set, then the region is a border
  40. /// region and its spans are considered unwalkable.
  41. /// (Used during the region and contour build process.)
  42. /// @see rcCompactSpan::reg
  43. public const int RC_BORDER_REG = 0x8000;
  44. /// Polygon touches multiple regions.
  45. /// If a polygon has this region ID it was merged with or created
  46. /// from polygons of different regions during the polymesh
  47. /// build step that removes redundant border vertices.
  48. /// (Used during the polymesh and detail polymesh build processes)
  49. /// @see rcPolyMesh::regs
  50. public const int RC_MULTIPLE_REGS = 0;
  51. // Border vertex flag.
  52. /// If a region ID has this bit set, then the associated element lies on
  53. /// a tile border. If a contour vertex's region ID has this bit set, the
  54. /// vertex will later be removed in order to match the segments and vertices
  55. /// at tile boundaries.
  56. /// (Used during the build process.)
  57. /// @see rcCompactSpan::reg, #rcContour::verts, #rcContour::rverts
  58. public const int RC_BORDER_VERTEX = 0x10000;
  59. /// Area border flag.
  60. /// If a region ID has this bit set, then the associated element lies on
  61. /// the border of an area.
  62. /// (Used during the region and contour build process.)
  63. /// @see rcCompactSpan::reg, #rcContour::verts, #rcContour::rverts
  64. public const int RC_AREA_BORDER = 0x20000;
  65. /// Applied to the region id field of contour vertices in order to extract the region id.
  66. /// The region id field of a vertex may have several flags applied to it. So the
  67. /// fields value can't be used directly.
  68. /// @see rcContour::verts, rcContour::rverts
  69. public const int RC_CONTOUR_REG_MASK = 0xffff;
  70. /// A value which indicates an invalid index within a mesh.
  71. /// @note This does not necessarily indicate an error.
  72. /// @see rcPolyMesh::polys
  73. public const int RC_MESH_NULL_IDX = 0xffff;
  74. public const int RC_CONTOUR_TESS_WALL_EDGES = 0x01;
  75. /// < Tessellate solid (impassable) edges during contour
  76. /// simplification.
  77. public const int RC_CONTOUR_TESS_AREA_EDGES = 0x02;
  78. public const int RC_LOG_WARNING = 1;
  79. }
  80. }