class_immediatemesh.rst 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the ImmediateMesh.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_ImmediateMesh:
  6. ImmediateMesh
  7. =============
  8. **Inherits:** :ref:`Mesh<class_Mesh>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  9. Mesh optimized for creating geometry manually.
  10. Description
  11. -----------
  12. Mesh optimized for creating geometry manually, similar to OpenGL1.x immediate mode.
  13. Methods
  14. -------
  15. +------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | void | :ref:`clear_surfaces<class_ImmediateMesh_method_clear_surfaces>` **(** **)** |
  17. +------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | void | :ref:`surface_add_vertex<class_ImmediateMesh_method_surface_add_vertex>` **(** :ref:`Vector3<class_Vector3>` vertex **)** |
  19. +------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | void | :ref:`surface_add_vertex_2d<class_ImmediateMesh_method_surface_add_vertex_2d>` **(** :ref:`Vector2<class_Vector2>` vertex **)** |
  21. +------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`surface_begin<class_ImmediateMesh_method_surface_begin>` **(** :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` primitive, :ref:`Material<class_Material>` material=null **)** |
  23. +------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | void | :ref:`surface_end<class_ImmediateMesh_method_surface_end>` **(** **)** |
  25. +------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`surface_set_color<class_ImmediateMesh_method_surface_set_color>` **(** :ref:`Color<class_Color>` color **)** |
  27. +------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`surface_set_normal<class_ImmediateMesh_method_surface_set_normal>` **(** :ref:`Vector3<class_Vector3>` normal **)** |
  29. +------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`surface_set_tangent<class_ImmediateMesh_method_surface_set_tangent>` **(** :ref:`Plane<class_Plane>` tangent **)** |
  31. +------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`surface_set_uv<class_ImmediateMesh_method_surface_set_uv>` **(** :ref:`Vector2<class_Vector2>` uv **)** |
  33. +------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`surface_set_uv2<class_ImmediateMesh_method_surface_set_uv2>` **(** :ref:`Vector2<class_Vector2>` uv2 **)** |
  35. +------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. Method Descriptions
  37. -------------------
  38. .. _class_ImmediateMesh_method_clear_surfaces:
  39. - void **clear_surfaces** **(** **)**
  40. Clear all surfaces.
  41. ----
  42. .. _class_ImmediateMesh_method_surface_add_vertex:
  43. - void **surface_add_vertex** **(** :ref:`Vector3<class_Vector3>` vertex **)**
  44. Add a 3D vertex using the current attributes previously set.
  45. ----
  46. .. _class_ImmediateMesh_method_surface_add_vertex_2d:
  47. - void **surface_add_vertex_2d** **(** :ref:`Vector2<class_Vector2>` vertex **)**
  48. Add a 2D vertex using the current attributes previously set.
  49. ----
  50. .. _class_ImmediateMesh_method_surface_begin:
  51. - void **surface_begin** **(** :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` primitive, :ref:`Material<class_Material>` material=null **)**
  52. Begin a new surface.
  53. ----
  54. .. _class_ImmediateMesh_method_surface_end:
  55. - void **surface_end** **(** **)**
  56. End and commit current surface. Note that surface being created will not be visible until this function is called.
  57. ----
  58. .. _class_ImmediateMesh_method_surface_set_color:
  59. - void **surface_set_color** **(** :ref:`Color<class_Color>` color **)**
  60. Set the color attribute that will be pushed with the next vertex.
  61. ----
  62. .. _class_ImmediateMesh_method_surface_set_normal:
  63. - void **surface_set_normal** **(** :ref:`Vector3<class_Vector3>` normal **)**
  64. Set the normal attribute that will be pushed with the next vertex.
  65. ----
  66. .. _class_ImmediateMesh_method_surface_set_tangent:
  67. - void **surface_set_tangent** **(** :ref:`Plane<class_Plane>` tangent **)**
  68. Set the tangent attribute that will be pushed with the next vertex.
  69. ----
  70. .. _class_ImmediateMesh_method_surface_set_uv:
  71. - void **surface_set_uv** **(** :ref:`Vector2<class_Vector2>` uv **)**
  72. Set the UV attribute that will be pushed with the next vertex.
  73. ----
  74. .. _class_ImmediateMesh_method_surface_set_uv2:
  75. - void **surface_set_uv2** **(** :ref:`Vector2<class_Vector2>` uv2 **)**
  76. Set the UV2 attribute that will be pushed with the next vertex.
  77. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  78. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  79. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  80. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  81. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  82. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`