class_immediategeometry.rst 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/ImmediateGeometry.xml.
  6. .. _class_ImmediateGeometry:
  7. ImmediateGeometry
  8. =================
  9. **Inherits:** :ref:`GeometryInstance<class_GeometryInstance>` **<** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`CullInstance<class_CullInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Draws simple geometry from code.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Draws simple geometry from code. Uses a drawing mode similar to OpenGL 1.x.
  15. See also :ref:`ArrayMesh<class_ArrayMesh>`, :ref:`MeshDataTool<class_MeshDataTool>` and :ref:`SurfaceTool<class_SurfaceTool>` for procedural geometry generation.
  16. \ **Note:** ImmediateGeometry3D is best suited to small amounts of mesh data that change every frame. It will be slow when handling large amounts of mesh data. If mesh data doesn't change often, use :ref:`ArrayMesh<class_ArrayMesh>`, :ref:`MeshDataTool<class_MeshDataTool>` or :ref:`SurfaceTool<class_SurfaceTool>` instead.
  17. \ **Note:** Godot uses clockwise `winding order <https://learnopengl.com/Advanced-OpenGL/Face-culling>`__ for front faces of triangle primitive modes.
  18. \ **Note:** In case of missing points when handling large amounts of mesh data, try increasing its buffer size limit under :ref:`ProjectSettings.rendering/limits/buffers/immediate_buffer_size_kb<class_ProjectSettings_property_rendering/limits/buffers/immediate_buffer_size_kb>`.
  19. .. rst-class:: classref-reftable-group
  20. Methods
  21. -------
  22. .. table::
  23. :widths: auto
  24. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`add_sphere<class_ImmediateGeometry_method_add_sphere>` **(** :ref:`int<class_int>` lats, :ref:`int<class_int>` lons, :ref:`float<class_float>` radius, :ref:`bool<class_bool>` add_uv=true **)** |
  26. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | void | :ref:`add_vertex<class_ImmediateGeometry_method_add_vertex>` **(** :ref:`Vector3<class_Vector3>` position **)** |
  28. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`begin<class_ImmediateGeometry_method_begin>` **(** :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` primitive, :ref:`Texture<class_Texture>` texture=null **)** |
  30. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`clear<class_ImmediateGeometry_method_clear>` **(** **)** |
  32. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`end<class_ImmediateGeometry_method_end>` **(** **)** |
  34. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`set_color<class_ImmediateGeometry_method_set_color>` **(** :ref:`Color<class_Color>` color **)** |
  36. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`set_normal<class_ImmediateGeometry_method_set_normal>` **(** :ref:`Vector3<class_Vector3>` normal **)** |
  38. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`set_tangent<class_ImmediateGeometry_method_set_tangent>` **(** :ref:`Plane<class_Plane>` tangent **)** |
  40. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`set_uv<class_ImmediateGeometry_method_set_uv>` **(** :ref:`Vector2<class_Vector2>` uv **)** |
  42. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`set_uv2<class_ImmediateGeometry_method_set_uv2>` **(** :ref:`Vector2<class_Vector2>` uv **)** |
  44. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. .. rst-class:: classref-section-separator
  46. ----
  47. .. rst-class:: classref-descriptions-group
  48. Method Descriptions
  49. -------------------
  50. .. _class_ImmediateGeometry_method_add_sphere:
  51. .. rst-class:: classref-method
  52. void **add_sphere** **(** :ref:`int<class_int>` lats, :ref:`int<class_int>` lons, :ref:`float<class_float>` radius, :ref:`bool<class_bool>` add_uv=true **)**
  53. Simple helper to draw an UV sphere with given latitude, longitude and radius.
  54. .. rst-class:: classref-item-separator
  55. ----
  56. .. _class_ImmediateGeometry_method_add_vertex:
  57. .. rst-class:: classref-method
  58. void **add_vertex** **(** :ref:`Vector3<class_Vector3>` position **)**
  59. Adds a vertex in local coordinate space with the currently set color/uv/etc.
  60. .. rst-class:: classref-item-separator
  61. ----
  62. .. _class_ImmediateGeometry_method_begin:
  63. .. rst-class:: classref-method
  64. void **begin** **(** :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` primitive, :ref:`Texture<class_Texture>` texture=null **)**
  65. Begin drawing (and optionally pass a texture override). When done call :ref:`end<class_ImmediateGeometry_method_end>`. For more information on how this works, search for ``glBegin()`` and ``glEnd()`` references.
  66. For the type of primitive, see the :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` enum.
  67. .. rst-class:: classref-item-separator
  68. ----
  69. .. _class_ImmediateGeometry_method_clear:
  70. .. rst-class:: classref-method
  71. void **clear** **(** **)**
  72. Clears everything that was drawn using begin/end.
  73. .. rst-class:: classref-item-separator
  74. ----
  75. .. _class_ImmediateGeometry_method_end:
  76. .. rst-class:: classref-method
  77. void **end** **(** **)**
  78. Ends a drawing context and displays the results.
  79. .. rst-class:: classref-item-separator
  80. ----
  81. .. _class_ImmediateGeometry_method_set_color:
  82. .. rst-class:: classref-method
  83. void **set_color** **(** :ref:`Color<class_Color>` color **)**
  84. The current drawing color.
  85. .. rst-class:: classref-item-separator
  86. ----
  87. .. _class_ImmediateGeometry_method_set_normal:
  88. .. rst-class:: classref-method
  89. void **set_normal** **(** :ref:`Vector3<class_Vector3>` normal **)**
  90. The next vertex's normal.
  91. .. rst-class:: classref-item-separator
  92. ----
  93. .. _class_ImmediateGeometry_method_set_tangent:
  94. .. rst-class:: classref-method
  95. void **set_tangent** **(** :ref:`Plane<class_Plane>` tangent **)**
  96. The next vertex's tangent (and binormal facing).
  97. .. rst-class:: classref-item-separator
  98. ----
  99. .. _class_ImmediateGeometry_method_set_uv:
  100. .. rst-class:: classref-method
  101. void **set_uv** **(** :ref:`Vector2<class_Vector2>` uv **)**
  102. The next vertex's UV.
  103. .. rst-class:: classref-item-separator
  104. ----
  105. .. _class_ImmediateGeometry_method_set_uv2:
  106. .. rst-class:: classref-method
  107. void **set_uv2** **(** :ref:`Vector2<class_Vector2>` uv **)**
  108. The next vertex's second layer UV.
  109. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  110. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  111. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  112. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`