class_arraymesh.rst 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the ArrayMesh.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_ArrayMesh:
  5. ArrayMesh
  6. =========
  7. **Inherits:** :ref:`Mesh<class_mesh>` **<** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Member Functions
  12. ----------------
  13. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  14. | void | :ref:`add_blend_shape<class_ArrayMesh_add_blend_shape>` **(** :ref:`String<class_string>` name **)** |
  15. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | void | :ref:`add_surface_from_arrays<class_ArrayMesh_add_surface_from_arrays>` **(** :ref:`int<class_int>` primitive, :ref:`Array<class_array>` arrays, :ref:`Array<class_array>` blend_shapes=[ ], :ref:`int<class_int>` compress_flags=97792 **)** |
  17. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | void | :ref:`center_geometry<class_ArrayMesh_center_geometry>` **(** **)** |
  19. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | void | :ref:`clear_blend_shapes<class_ArrayMesh_clear_blend_shapes>` **(** **)** |
  21. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`int<class_int>` | :ref:`get_blend_shape_count<class_ArrayMesh_get_blend_shape_count>` **(** **)** const |
  23. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`int<class_int>` | :ref:`get_blend_shape_mode<class_ArrayMesh_get_blend_shape_mode>` **(** **)** const |
  25. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`String<class_string>` | :ref:`get_blend_shape_name<class_ArrayMesh_get_blend_shape_name>` **(** :ref:`int<class_int>` index **)** const |
  27. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`Rect3<class_rect3>` | :ref:`get_custom_aabb<class_ArrayMesh_get_custom_aabb>` **(** **)** const |
  29. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`int<class_int>` | :ref:`get_surface_count<class_ArrayMesh_get_surface_count>` **(** **)** const |
  31. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`regen_normalmaps<class_ArrayMesh_regen_normalmaps>` **(** **)** |
  33. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`set_blend_shape_mode<class_ArrayMesh_set_blend_shape_mode>` **(** :ref:`int<class_int>` mode **)** |
  35. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`set_custom_aabb<class_ArrayMesh_set_custom_aabb>` **(** :ref:`Rect3<class_rect3>` aabb **)** |
  37. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`int<class_int>` | :ref:`surface_get_array_index_len<class_ArrayMesh_surface_get_array_index_len>` **(** :ref:`int<class_int>` surf_idx **)** const |
  39. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`int<class_int>` | :ref:`surface_get_array_len<class_ArrayMesh_surface_get_array_len>` **(** :ref:`int<class_int>` surf_idx **)** const |
  41. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`Array<class_array>` | :ref:`surface_get_arrays<class_ArrayMesh_surface_get_arrays>` **(** :ref:`int<class_int>` surf_idx **)** const |
  43. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`Array<class_array>` | :ref:`surface_get_blend_shape_arrays<class_ArrayMesh_surface_get_blend_shape_arrays>` **(** :ref:`int<class_int>` surf_idx **)** const |
  45. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`int<class_int>` | :ref:`surface_get_format<class_ArrayMesh_surface_get_format>` **(** :ref:`int<class_int>` surf_idx **)** const |
  47. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`Material<class_material>` | :ref:`surface_get_material<class_ArrayMesh_surface_get_material>` **(** :ref:`int<class_int>` surf_idx **)** const |
  49. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`String<class_string>` | :ref:`surface_get_name<class_ArrayMesh_surface_get_name>` **(** :ref:`int<class_int>` surf_idx **)** const |
  51. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`int<class_int>` | :ref:`surface_get_primitive_type<class_ArrayMesh_surface_get_primitive_type>` **(** :ref:`int<class_int>` surf_idx **)** const |
  53. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | void | :ref:`surface_remove<class_ArrayMesh_surface_remove>` **(** :ref:`int<class_int>` surf_idx **)** |
  55. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | void | :ref:`surface_set_material<class_ArrayMesh_surface_set_material>` **(** :ref:`int<class_int>` surf_idx, :ref:`Material<class_material>` material **)** |
  57. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | void | :ref:`surface_set_name<class_ArrayMesh_surface_set_name>` **(** :ref:`int<class_int>` surf_idx, :ref:`String<class_string>` name **)** |
  59. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. Numeric Constants
  61. -----------------
  62. - **NO_INDEX_ARRAY** = **-1** --- Default value used for index_array_len when no indices are present.
  63. - **ARRAY_WEIGHTS_SIZE** = **4** --- Amount of weights/bone indices per vertex (always 4).
  64. - **ARRAY_VERTEX** = **0** --- Vertex array (array of :ref:`Vector3<class_vector3>` vertices).
  65. - **ARRAY_NORMAL** = **1** --- Normal array (array of :ref:`Vector3<class_vector3>` normals).
  66. - **ARRAY_TANGENT** = **2** --- Tangent array, array of groups of 4 floats. first 3 floats determine the tangent, and the last the binormal direction as -1 or 1.
  67. - **ARRAY_COLOR** = **3** --- Vertex array (array of :ref:`Color<class_color>` colors).
  68. - **ARRAY_TEX_UV** = **4** --- UV array (array of :ref:`Vector3<class_vector3>` UVs or float array of groups of 2 floats (u,v)).
  69. - **ARRAY_TEX_UV2** = **5** --- Second UV array (array of :ref:`Vector3<class_vector3>` UVs or float array of groups of 2 floats (u,v)).
  70. - **ARRAY_BONES** = **6** --- Array of bone indices, as a float array. Each element in groups of 4 floats.
  71. - **ARRAY_WEIGHTS** = **7** --- Array of bone weights, as a float array. Each element in groups of 4 floats.
  72. - **ARRAY_INDEX** = **8** --- Array of integers, used as indices referencing vertices. No index can be beyond the vertex array size.
  73. - **ARRAY_MAX** = **9**
  74. - **ARRAY_FORMAT_VERTEX** = **1** --- Array format will include vertices (mandatory).
  75. - **ARRAY_FORMAT_NORMAL** = **2** --- Array format will include normals
  76. - **ARRAY_FORMAT_TANGENT** = **4** --- Array format will include tangents
  77. - **ARRAY_FORMAT_COLOR** = **8** --- Array format will include a color array.
  78. - **ARRAY_FORMAT_TEX_UV** = **16** --- Array format will include UVs.
  79. - **ARRAY_FORMAT_TEX_UV2** = **32** --- Array format will include another set of UVs.
  80. - **ARRAY_FORMAT_BONES** = **64** --- Array format will include bone indices.
  81. - **ARRAY_FORMAT_WEIGHTS** = **128** --- Array format will include bone weights.
  82. - **ARRAY_FORMAT_INDEX** = **256** --- Index array will be used.
  83. Member Function Description
  84. ---------------------------
  85. .. _class_ArrayMesh_add_blend_shape:
  86. - void **add_blend_shape** **(** :ref:`String<class_string>` name **)**
  87. .. _class_ArrayMesh_add_surface_from_arrays:
  88. - void **add_surface_from_arrays** **(** :ref:`int<class_int>` primitive, :ref:`Array<class_array>` arrays, :ref:`Array<class_array>` blend_shapes=[ ], :ref:`int<class_int>` compress_flags=97792 **)**
  89. Create a new surface (:ref:`get_surface_count<class_ArrayMesh_get_surface_count>` that will become surf_idx for this.
  90. Surfaces are created to be rendered using a "primitive", which may be PRIMITIVE_POINTS, PRIMITIVE_LINES, PRIMITIVE_LINE_STRIP, PRIMITIVE_LINE_LOOP, PRIMITIVE_TRIANGLES, PRIMITIVE_TRIANGLE_STRIP, PRIMITIVE_TRIANGLE_FAN. (As a note, when using indices, it is recommended to only use just points, lines or triangles).
  91. .. _class_ArrayMesh_center_geometry:
  92. - void **center_geometry** **(** **)**
  93. .. _class_ArrayMesh_clear_blend_shapes:
  94. - void **clear_blend_shapes** **(** **)**
  95. .. _class_ArrayMesh_get_blend_shape_count:
  96. - :ref:`int<class_int>` **get_blend_shape_count** **(** **)** const
  97. .. _class_ArrayMesh_get_blend_shape_mode:
  98. - :ref:`int<class_int>` **get_blend_shape_mode** **(** **)** const
  99. .. _class_ArrayMesh_get_blend_shape_name:
  100. - :ref:`String<class_string>` **get_blend_shape_name** **(** :ref:`int<class_int>` index **)** const
  101. .. _class_ArrayMesh_get_custom_aabb:
  102. - :ref:`Rect3<class_rect3>` **get_custom_aabb** **(** **)** const
  103. .. _class_ArrayMesh_get_surface_count:
  104. - :ref:`int<class_int>` **get_surface_count** **(** **)** const
  105. Return the amount of surfaces that the ``ArrayMesh`` holds.
  106. .. _class_ArrayMesh_regen_normalmaps:
  107. - void **regen_normalmaps** **(** **)**
  108. .. _class_ArrayMesh_set_blend_shape_mode:
  109. - void **set_blend_shape_mode** **(** :ref:`int<class_int>` mode **)**
  110. .. _class_ArrayMesh_set_custom_aabb:
  111. - void **set_custom_aabb** **(** :ref:`Rect3<class_rect3>` aabb **)**
  112. .. _class_ArrayMesh_surface_get_array_index_len:
  113. - :ref:`int<class_int>` **surface_get_array_index_len** **(** :ref:`int<class_int>` surf_idx **)** const
  114. Return the length in indices of the index array in the requested surface (see :ref:`add_surface<class_ArrayMesh_add_surface>`).
  115. .. _class_ArrayMesh_surface_get_array_len:
  116. - :ref:`int<class_int>` **surface_get_array_len** **(** :ref:`int<class_int>` surf_idx **)** const
  117. Return the length in vertices of the vertex array in the requested surface (see :ref:`add_surface<class_ArrayMesh_add_surface>`).
  118. .. _class_ArrayMesh_surface_get_arrays:
  119. - :ref:`Array<class_array>` **surface_get_arrays** **(** :ref:`int<class_int>` surf_idx **)** const
  120. .. _class_ArrayMesh_surface_get_blend_shape_arrays:
  121. - :ref:`Array<class_array>` **surface_get_blend_shape_arrays** **(** :ref:`int<class_int>` surf_idx **)** const
  122. .. _class_ArrayMesh_surface_get_format:
  123. - :ref:`int<class_int>` **surface_get_format** **(** :ref:`int<class_int>` surf_idx **)** const
  124. Return the format mask of the requested surface (see :ref:`add_surface<class_ArrayMesh_add_surface>`).
  125. .. _class_ArrayMesh_surface_get_material:
  126. - :ref:`Material<class_material>` **surface_get_material** **(** :ref:`int<class_int>` surf_idx **)** const
  127. Return a :ref:`Material<class_material>` in a given surface. Surface is rendered using this material.
  128. .. _class_ArrayMesh_surface_get_name:
  129. - :ref:`String<class_string>` **surface_get_name** **(** :ref:`int<class_int>` surf_idx **)** const
  130. .. _class_ArrayMesh_surface_get_primitive_type:
  131. - :ref:`int<class_int>` **surface_get_primitive_type** **(** :ref:`int<class_int>` surf_idx **)** const
  132. Return the primitive type of the requested surface (see :ref:`add_surface<class_ArrayMesh_add_surface>`).
  133. .. _class_ArrayMesh_surface_remove:
  134. - void **surface_remove** **(** :ref:`int<class_int>` surf_idx **)**
  135. Remove a surface at position surf_idx, shifting greater surfaces one surf_idx slot down.
  136. .. _class_ArrayMesh_surface_set_material:
  137. - void **surface_set_material** **(** :ref:`int<class_int>` surf_idx, :ref:`Material<class_material>` material **)**
  138. .. _class_ArrayMesh_surface_set_name:
  139. - void **surface_set_name** **(** :ref:`int<class_int>` surf_idx, :ref:`String<class_string>` name **)**
  140. Set a :ref:`Material<class_material>` for a given surface. Surface will be rendered using this material.