/doc-gen/xml/nape/shape/Polygon.xml

http://github.com/deltaluca/nape · XML · 127 lines · 113 code · 13 blank · 1 comment · 0 complexity · 8d9fb166bf0364c1f36511b5b66e64ef MD5 · raw file

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <data>
  3. <class package="nape.shape" name="ValidationResult">
  4. <file>Polygon.hx</file>
  5. <short>Polygon validation result</short>
  6. <description><text>Result types for Polygon validation routine.</text><br/><br/><text>These are listed in order of precedence, meaning that if a polygon is both concave 'and' self intersecting, then the result will be ValidationResult.CONCAVE, this is because each check on the validity of the polygon is more expensive than the last and so is ordered to be as fast as possible in determining validity.</text></description>
  7. <property static="true" name="VALID" type="ValidationResult" readonly="true">
  8. <description>Valid</description>
  9. <detail><description>Polygon is valid.</description></detail>
  10. </property>
  11. <property static="true"/>
  12. <property static="true" name="DEGENERATE" type="ValidationResult" readonly="true">
  13. <description>Degenerate polygon</description>
  14. <detail><description>Polygon is degenerate; either it does not have enough vertices, or it has a very near zero area.</description></detail>
  15. </property>
  16. <property static="true" name="DEGENERATE_EDGES" type="ValidationResult" readonly="true">
  17. <description>Degenerate edges</description>
  18. <detail><description>Polygon has one or more edge with a near zero length.</description></detail>
  19. </property>
  20. <property static="true" name="CONCAVE" type="ValidationResult" readonly="true">
  21. <description>Concave polygon</description>
  22. <detail><description>Polygon is not convex.</description></detail>
  23. </property>
  24. <property static="true" name="SELF_INTERSECTING" type="ValidationResult" readonly="true">
  25. <description>Self intersecting polygon</description>
  26. <detail><description>Polygon is self-intersecting.</description></detail>
  27. </property>
  28. </class>
  29. <!-- ------------------------------------------------------------------------------------------- -->
  30. <class package="nape.shape" name="Polygon" super="Shape">
  31. <file>Polygon.hx</file>
  32. <short>Polygon shape type</short>
  33. <description>
  34. <text>Convex, simple polygon. Winding is not important.</text><br/><br/><text>You will be given errors should you try to simulate an invalid polygon (through a call to space.step() when space contains a rigid body with an invalid polygon). </text>
  35. </description>
  36. <property name="localVerts" type="Vec2List" readonly="true">
  37. <description>Mutable vertex list</description>
  38. <detail>
  39. <description>Vertex list for polygon in local coordinates</description>
  40. </detail>
  41. </property>
  42. <property name="worldVerts" type="Vec2List" readonly="true">
  43. <description>Immutable vertex list</description>
  44. <detail>
  45. <description>Immutable vertex list for polygon in world coordinates. Will give errors when Polygon is not within a rigid Body.</description>
  46. </detail>
  47. </property>
  48. <property name="edges" type="EdgeList" readonly="true">
  49. <description>Immutable edge list</description>
  50. <detail>
  51. <description>Immutable list of edge data. Edge at index 'n' corresponding to vertices 'n' and 'n+1' with wrap-around.</description>
  52. </detail>
  53. </property>
  54. <method name="validity" return="ValidationResult" const="true">
  55. <description>Whether polygon is valid for simulation</description>
  56. <detail>
  57. <description>If you're unsure of the validity of a polygon which would give errors on an attempt to simulate, this method can be used to check for validity and what is wrong if it is not valid.</description>
  58. </detail>
  59. </method>
  60. <constructor>
  61. <arg name="localVerts" type="CompatiblePolygon"/>
  62. <arg name="material" type="Material" optional="true"/>
  63. <arg name="material" type="Material" optional="true"/>
  64. <arg name="filter" type="InteractionFilter" optional="true"/>
  65. <description> Construct a new Polygon </description>
  66. <detail>
  67. <description><text>Construct Polygon with given local vertices, the Vec2 values will be copied on instantiation so that the same list of Vec2s can be used without explicit copying.</text><br/><br/>
  68. <bullet/><text>material defaults to new Material()</text><br/>
  69. <bullet/><text>filter defaults to new InteractionFilter()</text></description>
  70. <throws>localVerts contains null entries</throws>
  71. </detail>
  72. </constructor>
  73. <method static="true" name="copy" return="Polygon">
  74. <arg name="polygon" type="Polygon" const="true"/>
  75. <description>Deep* copy of polygon</description>
  76. <detail>
  77. <seealso><link type="class" href="Shape" anchor="copy">Shape::copy</link> </seealso>
  78. <throws><code inline="true">polygon==null</code> </throws>
  79. </detail>
  80. </method>
  81. <method static="true"/>
  82. <method static="true" name="rect" return="Array[Vec2]">
  83. <arg name="x" type="Float"/>
  84. <arg name="y" type="Float"/>
  85. <arg name="width" type="Float"/>
  86. <arg name="height" type="Float"/>
  87. <arg name="weak" type="Bool" optional="true" default="false"/>
  88. <description>Vertex list for rectangle</description>
  89. <detail>
  90. <description>Vertex list for rectangle. If weak=true, then the Vec2's will be weak</description>
  91. </detail>
  92. </method>
  93. <method static="true" name="box" return="Array[Vec2]">
  94. <arg name="width" type="Float"/>
  95. <arg name="height" type="Float"/>
  96. <arg name="weak" type="Bool" optional="true" default="false"/>
  97. <description>Vertex list for aligned box</description>
  98. <detail>
  99. <description>Vertex list for a box aligned at the origin. If weak=true, then the Vec2's will be weak</description>
  100. </detail>
  101. </method>
  102. <method static="true" name="regular" return="Array[Vec2]">
  103. <arg name="width" type="Float"/>
  104. <arg name="height" type="Float"/>
  105. <arg name="edgeCount" type="Int"/>
  106. <arg name="angleOffset" type="Float" optional="true" default="0.0"/>
  107. <arg name="weak" type="Bool" optional="true" default="false"/>
  108. <description>Vertex list for regular aligned polygon</description>
  109. <detail>
  110. <description>Vertex list for a regular polygon aligned at the origin with vertices starting from an angle of angleOffset. If weak=true, then the Vec2's will be weak</description>
  111. </detail>
  112. </method>
  113. </class>
  114. </data>