class_arraymesh.rst 18 KB

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