class_immediategeometry.rst 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the ImmediateGeometry.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_ImmediateGeometry:
  5. ImmediateGeometry
  6. =================
  7. **Inherits:** :ref:`GeometryInstance<class_geometryinstance>` **<** :ref:`VisualInstance<class_visualinstance>` **<** :ref:`Spatial<class_spatial>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Draws simple geometry from code.
  12. Member Functions
  13. ----------------
  14. +-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | void | :ref:`add_sphere<class_ImmediateGeometry_add_sphere>` **(** :ref:`int<class_int>` lats, :ref:`int<class_int>` lons, :ref:`float<class_float>` radius, :ref:`bool<class_bool>` add_uv=true **)** |
  16. +-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | void | :ref:`add_vertex<class_ImmediateGeometry_add_vertex>` **(** :ref:`Vector3<class_vector3>` position **)** |
  18. +-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | void | :ref:`begin<class_ImmediateGeometry_begin>` **(** :ref:`int<class_int>` primitive, :ref:`Texture<class_texture>` texture=null **)** |
  20. +-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | void | :ref:`clear<class_ImmediateGeometry_clear>` **(** **)** |
  22. +-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`end<class_ImmediateGeometry_end>` **(** **)** |
  24. +-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`set_color<class_ImmediateGeometry_set_color>` **(** :ref:`Color<class_color>` color **)** |
  26. +-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | void | :ref:`set_normal<class_ImmediateGeometry_set_normal>` **(** :ref:`Vector3<class_vector3>` normal **)** |
  28. +-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`set_tangent<class_ImmediateGeometry_set_tangent>` **(** :ref:`Plane<class_plane>` tangent **)** |
  30. +-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`set_uv<class_ImmediateGeometry_set_uv>` **(** :ref:`Vector2<class_vector2>` uv **)** |
  32. +-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`set_uv2<class_ImmediateGeometry_set_uv2>` **(** :ref:`Vector2<class_vector2>` uv **)** |
  34. +-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. Description
  36. -----------
  37. Draws simple geometry from code. Uses a drawing mode similar to OpenGL 1.x.
  38. Member Function Description
  39. ---------------------------
  40. .. _class_ImmediateGeometry_add_sphere:
  41. - 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 **)**
  42. Simple helper to draw a uvsphere, with given latitudes, longitude and radius.
  43. .. _class_ImmediateGeometry_add_vertex:
  44. - void **add_vertex** **(** :ref:`Vector3<class_vector3>` position **)**
  45. Adds a vertex with the currently set color/uv/etc.
  46. .. _class_ImmediateGeometry_begin:
  47. - void **begin** **(** :ref:`int<class_int>` primitive, :ref:`Texture<class_texture>` texture=null **)**
  48. Begin drawing (And optionally pass a texture override). When done call end(). For more information on how this works, search for glBegin() glEnd() references.
  49. For the type of primitive, use the :ref:`Mesh<class_mesh>`.PRIMITIVE\_\* enumerations.
  50. .. _class_ImmediateGeometry_clear:
  51. - void **clear** **(** **)**
  52. Clears everything that was drawn using begin/end.
  53. .. _class_ImmediateGeometry_end:
  54. - void **end** **(** **)**
  55. Ends a drawing context and displays the results.
  56. .. _class_ImmediateGeometry_set_color:
  57. - void **set_color** **(** :ref:`Color<class_color>` color **)**
  58. The current drawing color.
  59. .. _class_ImmediateGeometry_set_normal:
  60. - void **set_normal** **(** :ref:`Vector3<class_vector3>` normal **)**
  61. The next vertex's normal.
  62. .. _class_ImmediateGeometry_set_tangent:
  63. - void **set_tangent** **(** :ref:`Plane<class_plane>` tangent **)**
  64. The next vertex's tangent (and binormal facing).
  65. .. _class_ImmediateGeometry_set_uv:
  66. - void **set_uv** **(** :ref:`Vector2<class_vector2>` uv **)**
  67. The next vertex's UV.
  68. .. _class_ImmediateGeometry_set_uv2:
  69. - void **set_uv2** **(** :ref:`Vector2<class_vector2>` uv **)**
  70. The next vertex's second layer UV.