class_gpuparticlesattractor3d.rst 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/GPUParticlesAttractor3D.xml.
  6. .. _class_GPUParticlesAttractor3D:
  7. GPUParticlesAttractor3D
  8. =======================
  9. **Inherits:** :ref:`VisualInstance3D<class_VisualInstance3D>` **<** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`GPUParticlesAttractorBox3D<class_GPUParticlesAttractorBox3D>`, :ref:`GPUParticlesAttractorSphere3D<class_GPUParticlesAttractorSphere3D>`, :ref:`GPUParticlesAttractorVectorField3D<class_GPUParticlesAttractorVectorField3D>`
  11. Abstract base class for 3D particle attractors.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Particle attractors can be used to attract particles towards the attractor's origin, or to push them away from the attractor's origin.
  16. Particle attractors work in real-time and can be moved, rotated and scaled during gameplay. Unlike collision shapes, non-uniform scaling of attractors is also supported.
  17. Attractors can be temporarily disabled by hiding them, or by setting their :ref:`strength<class_GPUParticlesAttractor3D_property_strength>` to ``0.0``.
  18. \ **Note:** Particle attractors only affect :ref:`GPUParticles3D<class_GPUParticles3D>`, not :ref:`CPUParticles3D<class_CPUParticles3D>`.
  19. .. rst-class:: classref-reftable-group
  20. Properties
  21. ----------
  22. .. table::
  23. :widths: auto
  24. +---------------------------+------------------------------------------------------------------------------+----------------+
  25. | :ref:`float<class_float>` | :ref:`attenuation<class_GPUParticlesAttractor3D_property_attenuation>` | ``1.0`` |
  26. +---------------------------+------------------------------------------------------------------------------+----------------+
  27. | :ref:`int<class_int>` | :ref:`cull_mask<class_GPUParticlesAttractor3D_property_cull_mask>` | ``4294967295`` |
  28. +---------------------------+------------------------------------------------------------------------------+----------------+
  29. | :ref:`float<class_float>` | :ref:`directionality<class_GPUParticlesAttractor3D_property_directionality>` | ``0.0`` |
  30. +---------------------------+------------------------------------------------------------------------------+----------------+
  31. | :ref:`float<class_float>` | :ref:`strength<class_GPUParticlesAttractor3D_property_strength>` | ``1.0`` |
  32. +---------------------------+------------------------------------------------------------------------------+----------------+
  33. .. rst-class:: classref-section-separator
  34. ----
  35. .. rst-class:: classref-descriptions-group
  36. Property Descriptions
  37. ---------------------
  38. .. _class_GPUParticlesAttractor3D_property_attenuation:
  39. .. rst-class:: classref-property
  40. :ref:`float<class_float>` **attenuation** = ``1.0`` :ref:`🔗<class_GPUParticlesAttractor3D_property_attenuation>`
  41. .. rst-class:: classref-property-setget
  42. - |void| **set_attenuation**\ (\ value\: :ref:`float<class_float>`\ )
  43. - :ref:`float<class_float>` **get_attenuation**\ (\ )
  44. The particle attractor's attenuation. Higher values result in more gradual pushing of particles as they come closer to the attractor's origin. Zero or negative values will cause particles to be pushed very fast as soon as the touch the attractor's edges.
  45. .. rst-class:: classref-item-separator
  46. ----
  47. .. _class_GPUParticlesAttractor3D_property_cull_mask:
  48. .. rst-class:: classref-property
  49. :ref:`int<class_int>` **cull_mask** = ``4294967295`` :ref:`🔗<class_GPUParticlesAttractor3D_property_cull_mask>`
  50. .. rst-class:: classref-property-setget
  51. - |void| **set_cull_mask**\ (\ value\: :ref:`int<class_int>`\ )
  52. - :ref:`int<class_int>` **get_cull_mask**\ (\ )
  53. The particle rendering layers (:ref:`VisualInstance3D.layers<class_VisualInstance3D_property_layers>`) that will be affected by the attractor. By default, all particles are affected by an attractor.
  54. After configuring particle nodes accordingly, specific layers can be unchecked to prevent certain particles from being affected by attractors. For example, this can be used if you're using an attractor as part of a spell effect but don't want the attractor to affect unrelated weather particles at the same position.
  55. Particle attraction can also be disabled on a per-process material basis by setting :ref:`ParticleProcessMaterial.attractor_interaction_enabled<class_ParticleProcessMaterial_property_attractor_interaction_enabled>` on the :ref:`GPUParticles3D<class_GPUParticles3D>` node.
  56. .. rst-class:: classref-item-separator
  57. ----
  58. .. _class_GPUParticlesAttractor3D_property_directionality:
  59. .. rst-class:: classref-property
  60. :ref:`float<class_float>` **directionality** = ``0.0`` :ref:`🔗<class_GPUParticlesAttractor3D_property_directionality>`
  61. .. rst-class:: classref-property-setget
  62. - |void| **set_directionality**\ (\ value\: :ref:`float<class_float>`\ )
  63. - :ref:`float<class_float>` **get_directionality**\ (\ )
  64. Adjusts how directional the attractor is. At ``0.0``, the attractor is not directional at all: it will attract particles towards its center. At ``1.0``, the attractor is fully directional: particles will always be pushed towards local -Z (or +Z if :ref:`strength<class_GPUParticlesAttractor3D_property_strength>` is negative).
  65. \ **Note:** If :ref:`directionality<class_GPUParticlesAttractor3D_property_directionality>` is greater than ``0.0``, the direction in which particles are pushed can be changed by rotating the **GPUParticlesAttractor3D** node.
  66. .. rst-class:: classref-item-separator
  67. ----
  68. .. _class_GPUParticlesAttractor3D_property_strength:
  69. .. rst-class:: classref-property
  70. :ref:`float<class_float>` **strength** = ``1.0`` :ref:`🔗<class_GPUParticlesAttractor3D_property_strength>`
  71. .. rst-class:: classref-property-setget
  72. - |void| **set_strength**\ (\ value\: :ref:`float<class_float>`\ )
  73. - :ref:`float<class_float>` **get_strength**\ (\ )
  74. Adjusts the strength of the attractor. If :ref:`strength<class_GPUParticlesAttractor3D_property_strength>` is negative, particles will be pushed in the opposite direction. Particles will be pushed *away* from the attractor's origin if :ref:`directionality<class_GPUParticlesAttractor3D_property_directionality>` is ``0.0``, or towards local +Z if :ref:`directionality<class_GPUParticlesAttractor3D_property_directionality>` is greater than ``0.0``.
  75. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  76. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  77. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  78. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  79. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  80. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  81. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  82. .. |void| replace:: :abbr:`void (No return value.)`