class_immediategeometry.rst 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the ImmediateGeometry.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_ImmediateGeometry:
  6. ImmediateGeometry
  7. =================
  8. **Inherits:** :ref:`GeometryInstance<class_GeometryInstance>` **<** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Draws simple geometry from code.
  10. Description
  11. -----------
  12. Draws simple geometry from code. Uses a drawing mode similar to OpenGL 1.x.
  13. Methods
  14. -------
  15. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | 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 **)** |
  17. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | void | :ref:`add_vertex<class_ImmediateGeometry_method_add_vertex>` **(** :ref:`Vector3<class_Vector3>` position **)** |
  19. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | void | :ref:`begin<class_ImmediateGeometry_method_begin>` **(** :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` primitive, :ref:`Texture2D<class_Texture2D>` texture=null **)** |
  21. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`clear<class_ImmediateGeometry_method_clear>` **(** **)** |
  23. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | void | :ref:`end<class_ImmediateGeometry_method_end>` **(** **)** |
  25. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`set_color<class_ImmediateGeometry_method_set_color>` **(** :ref:`Color<class_Color>` color **)** |
  27. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`set_normal<class_ImmediateGeometry_method_set_normal>` **(** :ref:`Vector3<class_Vector3>` normal **)** |
  29. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`set_tangent<class_ImmediateGeometry_method_set_tangent>` **(** :ref:`Plane<class_Plane>` tangent **)** |
  31. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`set_uv<class_ImmediateGeometry_method_set_uv>` **(** :ref:`Vector2<class_Vector2>` uv **)** |
  33. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`set_uv2<class_ImmediateGeometry_method_set_uv2>` **(** :ref:`Vector2<class_Vector2>` uv **)** |
  35. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. Method Descriptions
  37. -------------------
  38. .. _class_ImmediateGeometry_method_add_sphere:
  39. - 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 **)**
  40. Simple helper to draw an UV sphere with given latitude, longitude and radius.
  41. ----
  42. .. _class_ImmediateGeometry_method_add_vertex:
  43. - void **add_vertex** **(** :ref:`Vector3<class_Vector3>` position **)**
  44. Adds a vertex in local coordinate space with the currently set color/uv/etc.
  45. ----
  46. .. _class_ImmediateGeometry_method_begin:
  47. - void **begin** **(** :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` primitive, :ref:`Texture2D<class_Texture2D>` texture=null **)**
  48. 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.
  49. For the type of primitive, see the :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` enum.
  50. ----
  51. .. _class_ImmediateGeometry_method_clear:
  52. - void **clear** **(** **)**
  53. Clears everything that was drawn using begin/end.
  54. ----
  55. .. _class_ImmediateGeometry_method_end:
  56. - void **end** **(** **)**
  57. Ends a drawing context and displays the results.
  58. ----
  59. .. _class_ImmediateGeometry_method_set_color:
  60. - void **set_color** **(** :ref:`Color<class_Color>` color **)**
  61. The current drawing color.
  62. ----
  63. .. _class_ImmediateGeometry_method_set_normal:
  64. - void **set_normal** **(** :ref:`Vector3<class_Vector3>` normal **)**
  65. The next vertex's normal.
  66. ----
  67. .. _class_ImmediateGeometry_method_set_tangent:
  68. - void **set_tangent** **(** :ref:`Plane<class_Plane>` tangent **)**
  69. The next vertex's tangent (and binormal facing).
  70. ----
  71. .. _class_ImmediateGeometry_method_set_uv:
  72. - void **set_uv** **(** :ref:`Vector2<class_Vector2>` uv **)**
  73. The next vertex's UV.
  74. ----
  75. .. _class_ImmediateGeometry_method_set_uv2:
  76. - void **set_uv2** **(** :ref:`Vector2<class_Vector2>` uv **)**
  77. The next vertex's second layer UV.