class_noise.rst 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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/4.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/modules/noise/doc_classes/Noise.xml.
  6. .. _class_Noise:
  7. Noise
  8. =====
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`FastNoiseLite<class_FastNoiseLite>`
  11. Abstract base class for noise generators.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. This class defines the interface for noise generation libraries to inherit from.
  16. A default get_seamless_noise() implementation is provided for libraries that do not provide seamless noise. This function requests a larger image from get_image(), reverses the quadrants of the image, then uses the strips of extra width to blend over the seams.
  17. Inheriting noise classes can optionally override this function to provide a more optimal algorithm.
  18. .. rst-class:: classref-reftable-group
  19. Methods
  20. -------
  21. .. table::
  22. :widths: auto
  23. +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`Image<class_Image>` | :ref:`get_image<class_Noise_method_get_image>` **(** :ref:`int<class_int>` width, :ref:`int<class_int>` height, :ref:`bool<class_bool>` invert=false, :ref:`bool<class_bool>` in_3d_space=false, :ref:`bool<class_bool>` normalize=true **)** |const| |
  25. +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`float<class_float>` | :ref:`get_noise_1d<class_Noise_method_get_noise_1d>` **(** :ref:`float<class_float>` x **)** |const| |
  27. +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`float<class_float>` | :ref:`get_noise_2d<class_Noise_method_get_noise_2d>` **(** :ref:`float<class_float>` x, :ref:`float<class_float>` y **)** |const| |
  29. +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`float<class_float>` | :ref:`get_noise_2dv<class_Noise_method_get_noise_2dv>` **(** :ref:`Vector2<class_Vector2>` v **)** |const| |
  31. +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`float<class_float>` | :ref:`get_noise_3d<class_Noise_method_get_noise_3d>` **(** :ref:`float<class_float>` x, :ref:`float<class_float>` y, :ref:`float<class_float>` z **)** |const| |
  33. +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`float<class_float>` | :ref:`get_noise_3dv<class_Noise_method_get_noise_3dv>` **(** :ref:`Vector3<class_Vector3>` v **)** |const| |
  35. +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`Image<class_Image>` | :ref:`get_seamless_image<class_Noise_method_get_seamless_image>` **(** :ref:`int<class_int>` width, :ref:`int<class_int>` height, :ref:`bool<class_bool>` invert=false, :ref:`bool<class_bool>` in_3d_space=false, :ref:`float<class_float>` skirt=0.1, :ref:`bool<class_bool>` normalize=true **)** |const| |
  37. +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. .. rst-class:: classref-section-separator
  39. ----
  40. .. rst-class:: classref-descriptions-group
  41. Method Descriptions
  42. -------------------
  43. .. _class_Noise_method_get_image:
  44. .. rst-class:: classref-method
  45. :ref:`Image<class_Image>` **get_image** **(** :ref:`int<class_int>` width, :ref:`int<class_int>` height, :ref:`bool<class_bool>` invert=false, :ref:`bool<class_bool>` in_3d_space=false, :ref:`bool<class_bool>` normalize=true **)** |const|
  46. Returns a 2D :ref:`Image<class_Image>` noise image.
  47. Note: With ``normalize`` set to ``false`` the default implementation expects the noise generator to return values in the range ``-1.0`` to ``1.0``.
  48. .. rst-class:: classref-item-separator
  49. ----
  50. .. _class_Noise_method_get_noise_1d:
  51. .. rst-class:: classref-method
  52. :ref:`float<class_float>` **get_noise_1d** **(** :ref:`float<class_float>` x **)** |const|
  53. Returns the 1D noise value at the given (x) coordinate.
  54. .. rst-class:: classref-item-separator
  55. ----
  56. .. _class_Noise_method_get_noise_2d:
  57. .. rst-class:: classref-method
  58. :ref:`float<class_float>` **get_noise_2d** **(** :ref:`float<class_float>` x, :ref:`float<class_float>` y **)** |const|
  59. Returns the 2D noise value at the given position.
  60. .. rst-class:: classref-item-separator
  61. ----
  62. .. _class_Noise_method_get_noise_2dv:
  63. .. rst-class:: classref-method
  64. :ref:`float<class_float>` **get_noise_2dv** **(** :ref:`Vector2<class_Vector2>` v **)** |const|
  65. Returns the 2D noise value at the given position.
  66. .. rst-class:: classref-item-separator
  67. ----
  68. .. _class_Noise_method_get_noise_3d:
  69. .. rst-class:: classref-method
  70. :ref:`float<class_float>` **get_noise_3d** **(** :ref:`float<class_float>` x, :ref:`float<class_float>` y, :ref:`float<class_float>` z **)** |const|
  71. Returns the 3D noise value at the given position.
  72. .. rst-class:: classref-item-separator
  73. ----
  74. .. _class_Noise_method_get_noise_3dv:
  75. .. rst-class:: classref-method
  76. :ref:`float<class_float>` **get_noise_3dv** **(** :ref:`Vector3<class_Vector3>` v **)** |const|
  77. Returns the 3D noise value at the given position.
  78. .. rst-class:: classref-item-separator
  79. ----
  80. .. _class_Noise_method_get_seamless_image:
  81. .. rst-class:: classref-method
  82. :ref:`Image<class_Image>` **get_seamless_image** **(** :ref:`int<class_int>` width, :ref:`int<class_int>` height, :ref:`bool<class_bool>` invert=false, :ref:`bool<class_bool>` in_3d_space=false, :ref:`float<class_float>` skirt=0.1, :ref:`bool<class_bool>` normalize=true **)** |const|
  83. Returns a seamless 2D :ref:`Image<class_Image>` noise image.
  84. Note: With ``normalize`` set to ``false`` the default implementation expects the noise generator to return values in the range ``-1.0`` to ``1.0``.
  85. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  86. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  87. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  88. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  89. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  90. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`