class_gpuparticlescollisionheightfield3d.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/GPUParticlesCollisionHeightField3D.xml.
  6. .. _class_GPUParticlesCollisionHeightField3D:
  7. GPUParticlesCollisionHeightField3D
  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 real-time heightmap-shaped 3D particle collision shape affecting :ref:`GPUParticles3D<class_GPUParticles3D>` nodes.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A real-time heightmap-shaped 3D particle collision shape affecting :ref:`GPUParticles3D<class_GPUParticles3D>` nodes.
  15. Heightmap shapes allow for efficiently representing collisions for convex and concave objects with a single "floor" (such as terrain). This is less flexible than :ref:`GPUParticlesCollisionSDF3D<class_GPUParticlesCollisionSDF3D>`, but it doesn't require a baking step.
  16. \ **GPUParticlesCollisionHeightField3D** can also be regenerated in real-time when it is moved, when the camera moves, or even continuously. This makes **GPUParticlesCollisionHeightField3D** a good choice for weather effects such as rain and snow and games with highly dynamic geometry. However, this class is limited since heightmaps cannot represent overhangs (e.g. indoors or caves).
  17. \ **Note:** :ref:`ParticleProcessMaterial.collision_mode<class_ParticleProcessMaterial_property_collision_mode>` must be ``true`` on the :ref:`GPUParticles3D<class_GPUParticles3D>`'s process material for collision to work.
  18. \ **Note:** Particle collision only affects :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:`bool<class_bool>` | :ref:`follow_camera_enabled<class_GPUParticlesCollisionHeightField3D_property_follow_camera_enabled>` | ``false`` |
  26. +-----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------+
  27. | :ref:`Resolution<enum_GPUParticlesCollisionHeightField3D_Resolution>` | :ref:`resolution<class_GPUParticlesCollisionHeightField3D_property_resolution>` | ``2`` |
  28. +-----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------+
  29. | :ref:`Vector3<class_Vector3>` | :ref:`size<class_GPUParticlesCollisionHeightField3D_property_size>` | ``Vector3(2, 2, 2)`` |
  30. +-----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------+
  31. | :ref:`UpdateMode<enum_GPUParticlesCollisionHeightField3D_UpdateMode>` | :ref:`update_mode<class_GPUParticlesCollisionHeightField3D_property_update_mode>` | ``0`` |
  32. +-----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------+
  33. .. rst-class:: classref-section-separator
  34. ----
  35. .. rst-class:: classref-descriptions-group
  36. Enumerations
  37. ------------
  38. .. _enum_GPUParticlesCollisionHeightField3D_Resolution:
  39. .. rst-class:: classref-enumeration
  40. enum **Resolution**:
  41. .. _class_GPUParticlesCollisionHeightField3D_constant_RESOLUTION_256:
  42. .. rst-class:: classref-enumeration-constant
  43. :ref:`Resolution<enum_GPUParticlesCollisionHeightField3D_Resolution>` **RESOLUTION_256** = ``0``
  44. Generate a 256×256 heightmap. Intended for small-scale scenes, or larger scenes with no distant particles.
  45. .. _class_GPUParticlesCollisionHeightField3D_constant_RESOLUTION_512:
  46. .. rst-class:: classref-enumeration-constant
  47. :ref:`Resolution<enum_GPUParticlesCollisionHeightField3D_Resolution>` **RESOLUTION_512** = ``1``
  48. Generate a 512×512 heightmap. Intended for medium-scale scenes, or larger scenes with no distant particles.
  49. .. _class_GPUParticlesCollisionHeightField3D_constant_RESOLUTION_1024:
  50. .. rst-class:: classref-enumeration-constant
  51. :ref:`Resolution<enum_GPUParticlesCollisionHeightField3D_Resolution>` **RESOLUTION_1024** = ``2``
  52. Generate a 1024×1024 heightmap. Intended for large scenes with distant particles.
  53. .. _class_GPUParticlesCollisionHeightField3D_constant_RESOLUTION_2048:
  54. .. rst-class:: classref-enumeration-constant
  55. :ref:`Resolution<enum_GPUParticlesCollisionHeightField3D_Resolution>` **RESOLUTION_2048** = ``3``
  56. Generate a 2048×2048 heightmap. Intended for very large scenes with distant particles.
  57. .. _class_GPUParticlesCollisionHeightField3D_constant_RESOLUTION_4096:
  58. .. rst-class:: classref-enumeration-constant
  59. :ref:`Resolution<enum_GPUParticlesCollisionHeightField3D_Resolution>` **RESOLUTION_4096** = ``4``
  60. Generate a 4096×4096 heightmap. Intended for huge scenes with distant particles.
  61. .. _class_GPUParticlesCollisionHeightField3D_constant_RESOLUTION_8192:
  62. .. rst-class:: classref-enumeration-constant
  63. :ref:`Resolution<enum_GPUParticlesCollisionHeightField3D_Resolution>` **RESOLUTION_8192** = ``5``
  64. Generate a 8192×8192 heightmap. Intended for gigantic scenes with distant particles.
  65. .. _class_GPUParticlesCollisionHeightField3D_constant_RESOLUTION_MAX:
  66. .. rst-class:: classref-enumeration-constant
  67. :ref:`Resolution<enum_GPUParticlesCollisionHeightField3D_Resolution>` **RESOLUTION_MAX** = ``6``
  68. Represents the size of the :ref:`Resolution<enum_GPUParticlesCollisionHeightField3D_Resolution>` enum.
  69. .. rst-class:: classref-item-separator
  70. ----
  71. .. _enum_GPUParticlesCollisionHeightField3D_UpdateMode:
  72. .. rst-class:: classref-enumeration
  73. enum **UpdateMode**:
  74. .. _class_GPUParticlesCollisionHeightField3D_constant_UPDATE_MODE_WHEN_MOVED:
  75. .. rst-class:: classref-enumeration-constant
  76. :ref:`UpdateMode<enum_GPUParticlesCollisionHeightField3D_UpdateMode>` **UPDATE_MODE_WHEN_MOVED** = ``0``
  77. Only update the heightmap when the **GPUParticlesCollisionHeightField3D** node is moved, or when the camera moves if :ref:`follow_camera_enabled<class_GPUParticlesCollisionHeightField3D_property_follow_camera_enabled>` is ``true``. An update can be forced by slightly moving the **GPUParticlesCollisionHeightField3D** in any direction, or by calling :ref:`RenderingServer.particles_collision_height_field_update<class_RenderingServer_method_particles_collision_height_field_update>`.
  78. .. _class_GPUParticlesCollisionHeightField3D_constant_UPDATE_MODE_ALWAYS:
  79. .. rst-class:: classref-enumeration-constant
  80. :ref:`UpdateMode<enum_GPUParticlesCollisionHeightField3D_UpdateMode>` **UPDATE_MODE_ALWAYS** = ``1``
  81. Update the heightmap every frame. This has a significant performance cost. This update should only be used when geometry that particles can collide with changes significantly during gameplay.
  82. .. rst-class:: classref-section-separator
  83. ----
  84. .. rst-class:: classref-descriptions-group
  85. Property Descriptions
  86. ---------------------
  87. .. _class_GPUParticlesCollisionHeightField3D_property_follow_camera_enabled:
  88. .. rst-class:: classref-property
  89. :ref:`bool<class_bool>` **follow_camera_enabled** = ``false``
  90. .. rst-class:: classref-property-setget
  91. - void **set_follow_camera_enabled** **(** :ref:`bool<class_bool>` value **)**
  92. - :ref:`bool<class_bool>` **is_follow_camera_enabled** **(** **)**
  93. If ``true``, the **GPUParticlesCollisionHeightField3D** will follow the current camera in global space. The **GPUParticlesCollisionHeightField3D** does not need to be a child of the :ref:`Camera3D<class_Camera3D>` node for this to work.
  94. Following the camera has a performance cost, as it will force the heightmap to update whenever the camera moves. Consider lowering :ref:`resolution<class_GPUParticlesCollisionHeightField3D_property_resolution>` to improve performance if :ref:`follow_camera_enabled<class_GPUParticlesCollisionHeightField3D_property_follow_camera_enabled>` is ``true``.
  95. .. rst-class:: classref-item-separator
  96. ----
  97. .. _class_GPUParticlesCollisionHeightField3D_property_resolution:
  98. .. rst-class:: classref-property
  99. :ref:`Resolution<enum_GPUParticlesCollisionHeightField3D_Resolution>` **resolution** = ``2``
  100. .. rst-class:: classref-property-setget
  101. - void **set_resolution** **(** :ref:`Resolution<enum_GPUParticlesCollisionHeightField3D_Resolution>` value **)**
  102. - :ref:`Resolution<enum_GPUParticlesCollisionHeightField3D_Resolution>` **get_resolution** **(** **)**
  103. Higher resolutions can represent small details more accurately in large scenes, at the cost of lower performance. If :ref:`update_mode<class_GPUParticlesCollisionHeightField3D_property_update_mode>` is :ref:`UPDATE_MODE_ALWAYS<class_GPUParticlesCollisionHeightField3D_constant_UPDATE_MODE_ALWAYS>`, consider using the lowest resolution possible.
  104. .. rst-class:: classref-item-separator
  105. ----
  106. .. _class_GPUParticlesCollisionHeightField3D_property_size:
  107. .. rst-class:: classref-property
  108. :ref:`Vector3<class_Vector3>` **size** = ``Vector3(2, 2, 2)``
  109. .. rst-class:: classref-property-setget
  110. - void **set_size** **(** :ref:`Vector3<class_Vector3>` value **)**
  111. - :ref:`Vector3<class_Vector3>` **get_size** **(** **)**
  112. The collision heightmap's size in 3D units. To improve heightmap quality, :ref:`size<class_GPUParticlesCollisionHeightField3D_property_size>` should be set as small as possible while covering the parts of the scene you need.
  113. .. rst-class:: classref-item-separator
  114. ----
  115. .. _class_GPUParticlesCollisionHeightField3D_property_update_mode:
  116. .. rst-class:: classref-property
  117. :ref:`UpdateMode<enum_GPUParticlesCollisionHeightField3D_UpdateMode>` **update_mode** = ``0``
  118. .. rst-class:: classref-property-setget
  119. - void **set_update_mode** **(** :ref:`UpdateMode<enum_GPUParticlesCollisionHeightField3D_UpdateMode>` value **)**
  120. - :ref:`UpdateMode<enum_GPUParticlesCollisionHeightField3D_UpdateMode>` **get_update_mode** **(** **)**
  121. The update policy to use for the generated heightmap.
  122. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  123. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  124. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  125. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  126. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  127. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  128. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`