Mesh.xml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Mesh" inherits="Resource" category="Core" version="3.1">
  3. <brief_description>
  4. A [Resource] that contains vertex-array based geometry.
  5. </brief_description>
  6. <description>
  7. Mesh is a type of [Resource] that contains vertex-array based geometry, divided in [i]surfaces[/i]. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="create_convex_shape" qualifiers="const">
  15. <return type="Shape">
  16. </return>
  17. <description>
  18. Calculate a [ConvexPolygonShape] from the mesh.
  19. </description>
  20. </method>
  21. <method name="create_outline" qualifiers="const">
  22. <return type="Mesh">
  23. </return>
  24. <argument index="0" name="margin" type="float">
  25. </argument>
  26. <description>
  27. Calculate an outline mesh at a defined offset (margin) from the original mesh. Note: Typically returns the vertices in reverse order (e.g. clockwise to anti-clockwise).
  28. </description>
  29. </method>
  30. <method name="create_trimesh_shape" qualifiers="const">
  31. <return type="Shape">
  32. </return>
  33. <description>
  34. Calculate a [ConcavePolygonShape] from the mesh.
  35. </description>
  36. </method>
  37. <method name="generate_triangle_mesh" qualifiers="const">
  38. <return type="TriangleMesh">
  39. </return>
  40. <description>
  41. Generate a [TriangleMesh] from the mesh.
  42. </description>
  43. </method>
  44. <method name="get_faces" qualifiers="const">
  45. <return type="PoolVector3Array">
  46. </return>
  47. <description>
  48. Returns all the vertices that make up the faces of the mesh. Each three vertices represent one triangle.
  49. </description>
  50. </method>
  51. <method name="get_surface_count" qualifiers="const">
  52. <return type="int">
  53. </return>
  54. <description>
  55. Return the amount of surfaces that the [code]Mesh[/code] holds.
  56. </description>
  57. </method>
  58. <method name="surface_get_arrays" qualifiers="const">
  59. <return type="Array">
  60. </return>
  61. <argument index="0" name="surf_idx" type="int">
  62. </argument>
  63. <description>
  64. Returns the arrays for the vertices, normals, uvs, etc. that make up the requested surface (see [method ArrayMesh.add_surface_from_arrays]).
  65. </description>
  66. </method>
  67. <method name="surface_get_blend_shape_arrays" qualifiers="const">
  68. <return type="Array">
  69. </return>
  70. <argument index="0" name="surf_idx" type="int">
  71. </argument>
  72. <description>
  73. Returns the blend shape arrays for the requested surface.
  74. </description>
  75. </method>
  76. <method name="surface_get_material" qualifiers="const">
  77. <return type="Material">
  78. </return>
  79. <argument index="0" name="surf_idx" type="int">
  80. </argument>
  81. <description>
  82. Return a [Material] in a given surface. Surface is rendered using this material.
  83. </description>
  84. </method>
  85. </methods>
  86. <members>
  87. <member name="lightmap_size_hint" type="Vector2" setter="set_lightmap_size_hint" getter="get_lightmap_size_hint">
  88. </member>
  89. </members>
  90. <constants>
  91. <constant name="PRIMITIVE_POINTS" value="0" enum="PrimitiveType">
  92. Render array as points (one vertex equals one point).
  93. </constant>
  94. <constant name="PRIMITIVE_LINES" value="1" enum="PrimitiveType">
  95. Render array as lines (every two vertices a line is created).
  96. </constant>
  97. <constant name="PRIMITIVE_LINE_STRIP" value="2" enum="PrimitiveType">
  98. Render array as line strip.
  99. </constant>
  100. <constant name="PRIMITIVE_LINE_LOOP" value="3" enum="PrimitiveType">
  101. Render array as line loop (like line strip, but closed).
  102. </constant>
  103. <constant name="PRIMITIVE_TRIANGLES" value="4" enum="PrimitiveType">
  104. Render array as triangles (every three vertices a triangle is created).
  105. </constant>
  106. <constant name="PRIMITIVE_TRIANGLE_STRIP" value="5" enum="PrimitiveType">
  107. Render array as triangle strips.
  108. </constant>
  109. <constant name="PRIMITIVE_TRIANGLE_FAN" value="6" enum="PrimitiveType">
  110. Render array as triangle fans.
  111. </constant>
  112. <constant name="BLEND_SHAPE_MODE_NORMALIZED" value="0" enum="BlendShapeMode">
  113. </constant>
  114. <constant name="BLEND_SHAPE_MODE_RELATIVE" value="1" enum="BlendShapeMode">
  115. </constant>
  116. <constant name="ARRAY_FORMAT_VERTEX" value="1" enum="ArrayFormat">
  117. </constant>
  118. <constant name="ARRAY_FORMAT_NORMAL" value="2" enum="ArrayFormat">
  119. </constant>
  120. <constant name="ARRAY_FORMAT_TANGENT" value="4" enum="ArrayFormat">
  121. </constant>
  122. <constant name="ARRAY_FORMAT_COLOR" value="8" enum="ArrayFormat">
  123. </constant>
  124. <constant name="ARRAY_FORMAT_TEX_UV" value="16" enum="ArrayFormat">
  125. </constant>
  126. <constant name="ARRAY_FORMAT_TEX_UV2" value="32" enum="ArrayFormat">
  127. </constant>
  128. <constant name="ARRAY_FORMAT_BONES" value="64" enum="ArrayFormat">
  129. </constant>
  130. <constant name="ARRAY_FORMAT_WEIGHTS" value="128" enum="ArrayFormat">
  131. </constant>
  132. <constant name="ARRAY_FORMAT_INDEX" value="256" enum="ArrayFormat">
  133. </constant>
  134. <constant name="ARRAY_COMPRESS_BASE" value="9" enum="ArrayFormat">
  135. </constant>
  136. <constant name="ARRAY_COMPRESS_VERTEX" value="512" enum="ArrayFormat">
  137. </constant>
  138. <constant name="ARRAY_COMPRESS_NORMAL" value="1024" enum="ArrayFormat">
  139. </constant>
  140. <constant name="ARRAY_COMPRESS_TANGENT" value="2048" enum="ArrayFormat">
  141. </constant>
  142. <constant name="ARRAY_COMPRESS_COLOR" value="4096" enum="ArrayFormat">
  143. </constant>
  144. <constant name="ARRAY_COMPRESS_TEX_UV" value="8192" enum="ArrayFormat">
  145. </constant>
  146. <constant name="ARRAY_COMPRESS_TEX_UV2" value="16384" enum="ArrayFormat">
  147. </constant>
  148. <constant name="ARRAY_COMPRESS_BONES" value="32768" enum="ArrayFormat">
  149. </constant>
  150. <constant name="ARRAY_COMPRESS_WEIGHTS" value="65536" enum="ArrayFormat">
  151. </constant>
  152. <constant name="ARRAY_COMPRESS_INDEX" value="131072" enum="ArrayFormat">
  153. </constant>
  154. <constant name="ARRAY_FLAG_USE_2D_VERTICES" value="262144" enum="ArrayFormat">
  155. </constant>
  156. <constant name="ARRAY_FLAG_USE_16_BIT_BONES" value="524288" enum="ArrayFormat">
  157. </constant>
  158. <constant name="ARRAY_COMPRESS_DEFAULT" value="97280" enum="ArrayFormat">
  159. </constant>
  160. <constant name="ARRAY_VERTEX" value="0" enum="ArrayType">
  161. Array of vertices.
  162. </constant>
  163. <constant name="ARRAY_NORMAL" value="1" enum="ArrayType">
  164. Array of normals.
  165. </constant>
  166. <constant name="ARRAY_TANGENT" value="2" enum="ArrayType">
  167. Array of tangents as an array of floats, 4 floats per tangent.
  168. </constant>
  169. <constant name="ARRAY_COLOR" value="3" enum="ArrayType">
  170. Array of colors.
  171. </constant>
  172. <constant name="ARRAY_TEX_UV" value="4" enum="ArrayType">
  173. Array of UV coordinates.
  174. </constant>
  175. <constant name="ARRAY_TEX_UV2" value="5" enum="ArrayType">
  176. Array of second set of UV coordinates.
  177. </constant>
  178. <constant name="ARRAY_BONES" value="6" enum="ArrayType">
  179. Array of bone data.
  180. </constant>
  181. <constant name="ARRAY_WEIGHTS" value="7" enum="ArrayType">
  182. Array of weights.
  183. </constant>
  184. <constant name="ARRAY_INDEX" value="8" enum="ArrayType">
  185. Array of indices.
  186. </constant>
  187. <constant name="ARRAY_MAX" value="9" enum="ArrayType">
  188. </constant>
  189. </constants>
  190. </class>