123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/GPUParticlesCollisionSDF3D.xml.
- .. _class_GPUParticlesCollisionSDF3D:
- GPUParticlesCollisionSDF3D
- ==========================
- **Inherits:** :ref:`GPUParticlesCollision3D<class_GPUParticlesCollision3D>` **<** :ref:`VisualInstance3D<class_VisualInstance3D>` **<** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
- A baked signed distance field 3D particle collision shape affecting :ref:`GPUParticles3D<class_GPUParticles3D>` nodes.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- A baked signed distance field 3D particle collision shape affecting :ref:`GPUParticles3D<class_GPUParticles3D>` nodes.
- 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.
- \ **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>`.
- \ **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.
- \ **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.
- \ **Note:** Particle collision only affects :ref:`GPUParticles3D<class_GPUParticles3D>`, not :ref:`CPUParticles3D<class_CPUParticles3D>`.
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +---------------------------------------------------------------+-------------------------------------------------------------------------+----------------------+
- | :ref:`int<class_int>` | :ref:`bake_mask<class_GPUParticlesCollisionSDF3D_property_bake_mask>` | ``4294967295`` |
- +---------------------------------------------------------------+-------------------------------------------------------------------------+----------------------+
- | :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` | :ref:`resolution<class_GPUParticlesCollisionSDF3D_property_resolution>` | ``2`` |
- +---------------------------------------------------------------+-------------------------------------------------------------------------+----------------------+
- | :ref:`Vector3<class_Vector3>` | :ref:`size<class_GPUParticlesCollisionSDF3D_property_size>` | ``Vector3(2, 2, 2)`` |
- +---------------------------------------------------------------+-------------------------------------------------------------------------+----------------------+
- | :ref:`Texture3D<class_Texture3D>` | :ref:`texture<class_GPUParticlesCollisionSDF3D_property_texture>` | |
- +---------------------------------------------------------------+-------------------------------------------------------------------------+----------------------+
- | :ref:`float<class_float>` | :ref:`thickness<class_GPUParticlesCollisionSDF3D_property_thickness>` | ``1.0`` |
- +---------------------------------------------------------------+-------------------------------------------------------------------------+----------------------+
- .. rst-class:: classref-reftable-group
- Methods
- -------
- .. table::
- :widths: auto
- +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`get_bake_mask_value<class_GPUParticlesCollisionSDF3D_method_get_bake_mask_value>`\ (\ layer_number\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_bake_mask_value<class_GPUParticlesCollisionSDF3D_method_set_bake_mask_value>`\ (\ layer_number\: :ref:`int<class_int>`, value\: :ref:`bool<class_bool>`\ ) |
- +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Enumerations
- ------------
- .. _enum_GPUParticlesCollisionSDF3D_Resolution:
- .. rst-class:: classref-enumeration
- enum **Resolution**: :ref:`🔗<enum_GPUParticlesCollisionSDF3D_Resolution>`
- .. _class_GPUParticlesCollisionSDF3D_constant_RESOLUTION_16:
- .. rst-class:: classref-enumeration-constant
- :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` **RESOLUTION_16** = ``0``
- Bake a 16×16×16 signed distance field. This is the fastest option, but also the least precise.
- .. _class_GPUParticlesCollisionSDF3D_constant_RESOLUTION_32:
- .. rst-class:: classref-enumeration-constant
- :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` **RESOLUTION_32** = ``1``
- Bake a 32×32×32 signed distance field.
- .. _class_GPUParticlesCollisionSDF3D_constant_RESOLUTION_64:
- .. rst-class:: classref-enumeration-constant
- :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` **RESOLUTION_64** = ``2``
- Bake a 64×64×64 signed distance field.
- .. _class_GPUParticlesCollisionSDF3D_constant_RESOLUTION_128:
- .. rst-class:: classref-enumeration-constant
- :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` **RESOLUTION_128** = ``3``
- Bake a 128×128×128 signed distance field.
- .. _class_GPUParticlesCollisionSDF3D_constant_RESOLUTION_256:
- .. rst-class:: classref-enumeration-constant
- :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` **RESOLUTION_256** = ``4``
- Bake a 256×256×256 signed distance field.
- .. _class_GPUParticlesCollisionSDF3D_constant_RESOLUTION_512:
- .. rst-class:: classref-enumeration-constant
- :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` **RESOLUTION_512** = ``5``
- Bake a 512×512×512 signed distance field. This is the slowest option, but also the most precise.
- .. _class_GPUParticlesCollisionSDF3D_constant_RESOLUTION_MAX:
- .. rst-class:: classref-enumeration-constant
- :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` **RESOLUTION_MAX** = ``6``
- Represents the size of the :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` enum.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_GPUParticlesCollisionSDF3D_property_bake_mask:
- .. rst-class:: classref-property
- :ref:`int<class_int>` **bake_mask** = ``4294967295`` :ref:`🔗<class_GPUParticlesCollisionSDF3D_property_bake_mask>`
- .. rst-class:: classref-property-setget
- - |void| **set_bake_mask**\ (\ value\: :ref:`int<class_int>`\ )
- - :ref:`int<class_int>` **get_bake_mask**\ (\ )
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GPUParticlesCollisionSDF3D_property_resolution:
- .. rst-class:: classref-property
- :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` **resolution** = ``2`` :ref:`🔗<class_GPUParticlesCollisionSDF3D_property_resolution>`
- .. rst-class:: classref-property-setget
- - |void| **set_resolution**\ (\ value\: :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>`\ )
- - :ref:`Resolution<enum_GPUParticlesCollisionSDF3D_Resolution>` **get_resolution**\ (\ )
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GPUParticlesCollisionSDF3D_property_size:
- .. rst-class:: classref-property
- :ref:`Vector3<class_Vector3>` **size** = ``Vector3(2, 2, 2)`` :ref:`🔗<class_GPUParticlesCollisionSDF3D_property_size>`
- .. rst-class:: classref-property-setget
- - |void| **set_size**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
- - :ref:`Vector3<class_Vector3>` **get_size**\ (\ )
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GPUParticlesCollisionSDF3D_property_texture:
- .. rst-class:: classref-property
- :ref:`Texture3D<class_Texture3D>` **texture** :ref:`🔗<class_GPUParticlesCollisionSDF3D_property_texture>`
- .. rst-class:: classref-property-setget
- - |void| **set_texture**\ (\ value\: :ref:`Texture3D<class_Texture3D>`\ )
- - :ref:`Texture3D<class_Texture3D>` **get_texture**\ (\ )
- The 3D texture representing the signed distance field.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GPUParticlesCollisionSDF3D_property_thickness:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **thickness** = ``1.0`` :ref:`🔗<class_GPUParticlesCollisionSDF3D_property_thickness>`
- .. rst-class:: classref-property-setget
- - |void| **set_thickness**\ (\ value\: :ref:`float<class_float>`\ )
- - :ref:`float<class_float>` **get_thickness**\ (\ )
- 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.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Method Descriptions
- -------------------
- .. _class_GPUParticlesCollisionSDF3D_method_get_bake_mask_value:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **get_bake_mask_value**\ (\ layer_number\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_GPUParticlesCollisionSDF3D_method_get_bake_mask_value>`
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GPUParticlesCollisionSDF3D_method_set_bake_mask_value:
- .. rst-class:: classref-method
- |void| **set_bake_mask_value**\ (\ layer_number\: :ref:`int<class_int>`, value\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_GPUParticlesCollisionSDF3D_method_set_bake_mask_value>`
- 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.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
- .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
- .. |void| replace:: :abbr:`void (No return value.)`
|