class_immediategeometry.rst 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Draws simple geometry from code.
  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:`Texture<class_Texture>` 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. Description
  37. -----------
  38. Draws simple geometry from code. Uses a drawing mode similar to OpenGL 1.x.
  39. Method Descriptions
  40. -------------------
  41. .. _class_ImmediateGeometry_method_add_sphere:
  42. - 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 **)**
  43. Simple helper to draw a uvsphere, with given latitudes, longitude and radius.
  44. ----
  45. .. _class_ImmediateGeometry_method_add_vertex:
  46. - void **add_vertex** **(** :ref:`Vector3<class_Vector3>` position **)**
  47. Adds a vertex with the currently set color/uv/etc.
  48. ----
  49. .. _class_ImmediateGeometry_method_begin:
  50. - void **begin** **(** :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` primitive, :ref:`Texture<class_Texture>` texture=null **)**
  51. Begin drawing (And optionally pass a texture override). When done call end(). For more information on how this works, search for glBegin() glEnd() references.
  52. For the type of primitive, use the :ref:`Mesh<class_Mesh>`.PRIMITIVE\_\* enumerations.
  53. ----
  54. .. _class_ImmediateGeometry_method_clear:
  55. - void **clear** **(** **)**
  56. Clears everything that was drawn using begin/end.
  57. ----
  58. .. _class_ImmediateGeometry_method_end:
  59. - void **end** **(** **)**
  60. Ends a drawing context and displays the results.
  61. ----
  62. .. _class_ImmediateGeometry_method_set_color:
  63. - void **set_color** **(** :ref:`Color<class_Color>` color **)**
  64. The current drawing color.
  65. ----
  66. .. _class_ImmediateGeometry_method_set_normal:
  67. - void **set_normal** **(** :ref:`Vector3<class_Vector3>` normal **)**
  68. The next vertex's normal.
  69. ----
  70. .. _class_ImmediateGeometry_method_set_tangent:
  71. - void **set_tangent** **(** :ref:`Plane<class_Plane>` tangent **)**
  72. The next vertex's tangent (and binormal facing).
  73. ----
  74. .. _class_ImmediateGeometry_method_set_uv:
  75. - void **set_uv** **(** :ref:`Vector2<class_Vector2>` uv **)**
  76. The next vertex's UV.
  77. ----
  78. .. _class_ImmediateGeometry_method_set_uv2:
  79. - void **set_uv2** **(** :ref:`Vector2<class_Vector2>` uv **)**
  80. The next vertex's second layer UV.