class_gpuparticlescollisionsdf3d.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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/GPUParticlesCollisionSDF3D.xml.
  6. .. _class_GPUParticlesCollisionSDF3D:
  7. GPUParticlesCollisionSDF3D
  8. ==========================
  9. **Inherits:** :ref:`GPUParticlesCollision3D<class_GPUParticlesCollision3D>` **<** :ref:`VisualInstance3D<class_VisualInstance3D>` **<** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A baked signed distance field 3D particle collision shape affecting :ref:`GPUParticles3D<class_GPUParticles3D>` nodes.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A baked signed distance field 3D particle collision shape affecting :ref:`GPUParticles3D<class_GPUParticles3D>` nodes.
  15. Signed distance fields (SDF) allow for efficiently representing approximate collision shapes for convex and concave objects of any shape. This is more flexible than :ref:`GPUParticlesCollisionHeightField3D<class_GPUParticlesCollisionHeightField3D>`, but it requires a baking step.
  16. \ **Baking:** The signed distance field texture can be baked by selecting the **GPUParticlesCollisionSDF3D** node in the editor, then clicking **Bake SDF** at the top of the 3D viewport. Any *visible* :ref:`MeshInstance3D<class_MeshInstance3D>`\ s within the :ref:`size<class_GPUParticlesCollisionSDF3D_property_size>` will be taken into account for baking, regardless of their :ref:`GeometryInstance3D.gi_mode<class_GeometryInstance3D_property_gi_mode>`.
  17. \ **Note:** Baking a **GPUParticlesCollisionSDF3D**'s :ref:`texture<class_GPUParticlesCollisionSDF3D_property_texture>` is only possible within the editor, as there is no bake method exposed for use in exported projects. However, it's still possible to load pre-baked :ref:`Texture3D<class_Texture3D>`\ s into its :ref:`texture<class_GPUParticlesCollisionSDF3D_property_texture>` property in an exported project.
  18. \ **Note:** :ref:`ParticleProcessMaterial.collision_mode<class_ParticleProcessMaterial_property_collision_mode>` must be :ref:`ParticleProcessMaterial.COLLISION_RIGID<class_ParticleProcessMaterial_constant_COLLISION_RIGID>` or :ref:`ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT<class_ParticleProcessMaterial_constant_COLLISION_HIDE_ON_CONTACT>` on the :ref:`GPUParticles3D<class_GPUParticles3D>`'s process material for collision to work.
  19. \ **Note:** Particle collision only affects :ref:`GPUParticles3D<class_GPUParticles3D>`, not :ref:`CPUParticles3D<class_CPUParticles3D>`.
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +---------------------------------------------------------------+-------------------------------------------------------------------------+----------------------+
  26. | :ref:`int<class_int>` | :ref:`bake_mask<class_GPUParticlesCollisionSDF3D_property_bake_mask>` | ``4294967295`` |
  27. +---------------------------------------------------------------+-------------------------------------------------------------------------+----------------------+
  28. | :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` | :ref:`resolution<class_GPUParticlesCollisionSDF3D_property_resolution>` | ``2`` |
  29. +---------------------------------------------------------------+-------------------------------------------------------------------------+----------------------+
  30. | :ref:`Vector3<class_Vector3>` | :ref:`size<class_GPUParticlesCollisionSDF3D_property_size>` | ``Vector3(2, 2, 2)`` |
  31. +---------------------------------------------------------------+-------------------------------------------------------------------------+----------------------+
  32. | :ref:`Texture3D<class_Texture3D>` | :ref:`texture<class_GPUParticlesCollisionSDF3D_property_texture>` | |
  33. +---------------------------------------------------------------+-------------------------------------------------------------------------+----------------------+
  34. | :ref:`float<class_float>` | :ref:`thickness<class_GPUParticlesCollisionSDF3D_property_thickness>` | ``1.0`` |
  35. +---------------------------------------------------------------+-------------------------------------------------------------------------+----------------------+
  36. .. rst-class:: classref-reftable-group
  37. Methods
  38. -------
  39. .. table::
  40. :widths: auto
  41. +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`bool<class_bool>` | :ref:`get_bake_mask_value<class_GPUParticlesCollisionSDF3D_method_get_bake_mask_value>`\ (\ layer_number\: :ref:`int<class_int>`\ ) |const| |
  43. +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | |void| | :ref:`set_bake_mask_value<class_GPUParticlesCollisionSDF3D_method_set_bake_mask_value>`\ (\ layer_number\: :ref:`int<class_int>`, value\: :ref:`bool<class_bool>`\ ) |
  45. +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. .. rst-class:: classref-section-separator
  47. ----
  48. .. rst-class:: classref-descriptions-group
  49. Enumerations
  50. ------------
  51. .. _enum_GPUParticlesCollisionSDF3D_Resolution:
  52. .. rst-class:: classref-enumeration
  53. enum **Resolution**: :ref:`🔗<enum_GPUParticlesCollisionSDF3D_Resolution>`
  54. .. _class_GPUParticlesCollisionSDF3D_constant_RESOLUTION_16:
  55. .. rst-class:: classref-enumeration-constant
  56. :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` **RESOLUTION_16** = ``0``
  57. Bake a 16×16×16 signed distance field. This is the fastest option, but also the least precise.
  58. .. _class_GPUParticlesCollisionSDF3D_constant_RESOLUTION_32:
  59. .. rst-class:: classref-enumeration-constant
  60. :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` **RESOLUTION_32** = ``1``
  61. Bake a 32×32×32 signed distance field.
  62. .. _class_GPUParticlesCollisionSDF3D_constant_RESOLUTION_64:
  63. .. rst-class:: classref-enumeration-constant
  64. :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` **RESOLUTION_64** = ``2``
  65. Bake a 64×64×64 signed distance field.
  66. .. _class_GPUParticlesCollisionSDF3D_constant_RESOLUTION_128:
  67. .. rst-class:: classref-enumeration-constant
  68. :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` **RESOLUTION_128** = ``3``
  69. Bake a 128×128×128 signed distance field.
  70. .. _class_GPUParticlesCollisionSDF3D_constant_RESOLUTION_256:
  71. .. rst-class:: classref-enumeration-constant
  72. :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` **RESOLUTION_256** = ``4``
  73. Bake a 256×256×256 signed distance field.
  74. .. _class_GPUParticlesCollisionSDF3D_constant_RESOLUTION_512:
  75. .. rst-class:: classref-enumeration-constant
  76. :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` **RESOLUTION_512** = ``5``
  77. Bake a 512×512×512 signed distance field. This is the slowest option, but also the most precise.
  78. .. _class_GPUParticlesCollisionSDF3D_constant_RESOLUTION_MAX:
  79. .. rst-class:: classref-enumeration-constant
  80. :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` **RESOLUTION_MAX** = ``6``
  81. Represents the size of the :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` enum.
  82. .. rst-class:: classref-section-separator
  83. ----
  84. .. rst-class:: classref-descriptions-group
  85. Property Descriptions
  86. ---------------------
  87. .. _class_GPUParticlesCollisionSDF3D_property_bake_mask:
  88. .. rst-class:: classref-property
  89. :ref:`int<class_int>` **bake_mask** = ``4294967295`` :ref:`🔗<class_GPUParticlesCollisionSDF3D_property_bake_mask>`
  90. .. rst-class:: classref-property-setget
  91. - |void| **set_bake_mask**\ (\ value\: :ref:`int<class_int>`\ )
  92. - :ref:`int<class_int>` **get_bake_mask**\ (\ )
  93. The visual layers to account for when baking the particle collision SDF. Only :ref:`MeshInstance3D<class_MeshInstance3D>`\ s whose :ref:`VisualInstance3D.layers<class_VisualInstance3D_property_layers>` match with this :ref:`bake_mask<class_GPUParticlesCollisionSDF3D_property_bake_mask>` will be included in the generated particle collision SDF. By default, all objects are taken into account for the particle collision SDF baking.
  94. .. rst-class:: classref-item-separator
  95. ----
  96. .. _class_GPUParticlesCollisionSDF3D_property_resolution:
  97. .. rst-class:: classref-property
  98. :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` **resolution** = ``2`` :ref:`🔗<class_GPUParticlesCollisionSDF3D_property_resolution>`
  99. .. rst-class:: classref-property-setget
  100. - |void| **set_resolution**\ (\ value\: :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>`\ )
  101. - :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` **get_resolution**\ (\ )
  102. The bake resolution to use for the signed distance field :ref:`texture<class_GPUParticlesCollisionSDF3D_property_texture>`. The texture must be baked again for changes to the :ref:`resolution<class_GPUParticlesCollisionSDF3D_property_resolution>` property to be effective. Higher resolutions have a greater performance cost and take more time to bake. Higher resolutions also result in larger baked textures, leading to increased VRAM and storage space requirements. To improve performance and reduce bake times, use the lowest resolution possible for the object you're representing the collision of.
  103. .. rst-class:: classref-item-separator
  104. ----
  105. .. _class_GPUParticlesCollisionSDF3D_property_size:
  106. .. rst-class:: classref-property
  107. :ref:`Vector3<class_Vector3>` **size** = ``Vector3(2, 2, 2)`` :ref:`🔗<class_GPUParticlesCollisionSDF3D_property_size>`
  108. .. rst-class:: classref-property-setget
  109. - |void| **set_size**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
  110. - :ref:`Vector3<class_Vector3>` **get_size**\ (\ )
  111. The collision SDF's size in 3D units. To improve SDF quality, the :ref:`size<class_GPUParticlesCollisionSDF3D_property_size>` should be set as small as possible while covering the parts of the scene you need.
  112. .. rst-class:: classref-item-separator
  113. ----
  114. .. _class_GPUParticlesCollisionSDF3D_property_texture:
  115. .. rst-class:: classref-property
  116. :ref:`Texture3D<class_Texture3D>` **texture** :ref:`🔗<class_GPUParticlesCollisionSDF3D_property_texture>`
  117. .. rst-class:: classref-property-setget
  118. - |void| **set_texture**\ (\ value\: :ref:`Texture3D<class_Texture3D>`\ )
  119. - :ref:`Texture3D<class_Texture3D>` **get_texture**\ (\ )
  120. The 3D texture representing the signed distance field.
  121. .. rst-class:: classref-item-separator
  122. ----
  123. .. _class_GPUParticlesCollisionSDF3D_property_thickness:
  124. .. rst-class:: classref-property
  125. :ref:`float<class_float>` **thickness** = ``1.0`` :ref:`🔗<class_GPUParticlesCollisionSDF3D_property_thickness>`
  126. .. rst-class:: classref-property-setget
  127. - |void| **set_thickness**\ (\ value\: :ref:`float<class_float>`\ )
  128. - :ref:`float<class_float>` **get_thickness**\ (\ )
  129. The collision shape's thickness. Unlike other particle colliders, **GPUParticlesCollisionSDF3D** is actually hollow on the inside. :ref:`thickness<class_GPUParticlesCollisionSDF3D_property_thickness>` can be increased to prevent particles from tunneling through the collision shape at high speeds, or when the **GPUParticlesCollisionSDF3D** is moved.
  130. .. rst-class:: classref-section-separator
  131. ----
  132. .. rst-class:: classref-descriptions-group
  133. Method Descriptions
  134. -------------------
  135. .. _class_GPUParticlesCollisionSDF3D_method_get_bake_mask_value:
  136. .. rst-class:: classref-method
  137. :ref:`bool<class_bool>` **get_bake_mask_value**\ (\ layer_number\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_GPUParticlesCollisionSDF3D_method_get_bake_mask_value>`
  138. Returns whether or not the specified layer of the :ref:`bake_mask<class_GPUParticlesCollisionSDF3D_property_bake_mask>` is enabled, given a ``layer_number`` between 1 and 32.
  139. .. rst-class:: classref-item-separator
  140. ----
  141. .. _class_GPUParticlesCollisionSDF3D_method_set_bake_mask_value:
  142. .. rst-class:: classref-method
  143. |void| **set_bake_mask_value**\ (\ layer_number\: :ref:`int<class_int>`, value\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_GPUParticlesCollisionSDF3D_method_set_bake_mask_value>`
  144. Based on ``value``, enables or disables the specified layer in the :ref:`bake_mask<class_GPUParticlesCollisionSDF3D_property_bake_mask>`, given a ``layer_number`` between 1 and 32.
  145. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  146. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  147. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  148. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  149. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  150. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  151. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  152. .. |void| replace:: :abbr:`void (No return value.)`