class_gpuparticlescollisionheightfield3d.rst 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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/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. Real-time heightmap-shaped 3D particle attractor affecting :ref:`GPUParticles3D<class_GPUParticles3D>` nodes.
  11. Description
  12. -----------
  13. Real-time heightmap-shaped 3D particle attractor affecting :ref:`GPUParticles3D<class_GPUParticles3D>` nodes.
  14. 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.
  15. \ ``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, since heightmaps cannot represent overhangs, ``GPUParticlesCollisionHeightField3D`` is not suited for indoor particle collision.
  16. \ **Note:** :ref:`ParticlesMaterial.collision_enabled<class_ParticlesMaterial_property_collision_enabled>` must be ``true`` on the :ref:`GPUParticles3D<class_GPUParticles3D>`'s process material for collision to work.
  17. \ **Note:** Particle collision only affects :ref:`GPUParticles3D<class_GPUParticles3D>`, not :ref:`CPUParticles3D<class_CPUParticles3D>`.
  18. Properties
  19. ----------
  20. +-----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------+
  21. | :ref:`Vector3<class_Vector3>` | :ref:`extents<class_GPUParticlesCollisionHeightField3D_property_extents>` | ``Vector3(1, 1, 1)`` |
  22. +-----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------+
  23. | :ref:`bool<class_bool>` | :ref:`follow_camera_enabled<class_GPUParticlesCollisionHeightField3D_property_follow_camera_enabled>` | ``false`` |
  24. +-----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------+
  25. | :ref:`Resolution<enum_GPUParticlesCollisionHeightField3D_Resolution>` | :ref:`resolution<class_GPUParticlesCollisionHeightField3D_property_resolution>` | ``2`` |
  26. +-----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------+
  27. | :ref:`UpdateMode<enum_GPUParticlesCollisionHeightField3D_UpdateMode>` | :ref:`update_mode<class_GPUParticlesCollisionHeightField3D_property_update_mode>` | ``0`` |
  28. +-----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------------+
  29. Enumerations
  30. ------------
  31. .. _enum_GPUParticlesCollisionHeightField3D_Resolution:
  32. .. _class_GPUParticlesCollisionHeightField3D_constant_RESOLUTION_256:
  33. .. _class_GPUParticlesCollisionHeightField3D_constant_RESOLUTION_512:
  34. .. _class_GPUParticlesCollisionHeightField3D_constant_RESOLUTION_1024:
  35. .. _class_GPUParticlesCollisionHeightField3D_constant_RESOLUTION_2048:
  36. .. _class_GPUParticlesCollisionHeightField3D_constant_RESOLUTION_4096:
  37. .. _class_GPUParticlesCollisionHeightField3D_constant_RESOLUTION_8192:
  38. .. _class_GPUParticlesCollisionHeightField3D_constant_RESOLUTION_MAX:
  39. enum **Resolution**:
  40. - **RESOLUTION_256** = **0** --- Generate a 256×256 heightmap. Intended for small-scale scenes, or larger scenes with no distant particles.
  41. - **RESOLUTION_512** = **1** --- Generate a 512×512 heightmap. Intended for medium-scale scenes, or larger scenes with no distant particles.
  42. - **RESOLUTION_1024** = **2** --- Generate a 1024×1024 heightmap. Intended for large scenes with distant particles.
  43. - **RESOLUTION_2048** = **3** --- Generate a 2048×2048 heightmap. Intended for very large scenes with distant particles.
  44. - **RESOLUTION_4096** = **4** --- Generate a 4096×4096 heightmap. Intended for huge scenes with distant particles.
  45. - **RESOLUTION_8192** = **5** --- Generate a 8192×8192 heightmap. Intended for gigantic scenes with distant particles.
  46. - **RESOLUTION_MAX** = **6** --- Represents the size of the :ref:`Resolution<enum_GPUParticlesCollisionHeightField3D_Resolution>` enum.
  47. ----
  48. .. _enum_GPUParticlesCollisionHeightField3D_UpdateMode:
  49. .. _class_GPUParticlesCollisionHeightField3D_constant_UPDATE_MODE_WHEN_MOVED:
  50. .. _class_GPUParticlesCollisionHeightField3D_constant_UPDATE_MODE_ALWAYS:
  51. enum **UpdateMode**:
  52. - **UPDATE_MODE_WHEN_MOVED** = **0** --- 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.
  53. - **UPDATE_MODE_ALWAYS** = **1** --- 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.
  54. Property Descriptions
  55. ---------------------
  56. .. _class_GPUParticlesCollisionHeightField3D_property_extents:
  57. - :ref:`Vector3<class_Vector3>` **extents**
  58. +-----------+----------------------+
  59. | *Default* | ``Vector3(1, 1, 1)`` |
  60. +-----------+----------------------+
  61. | *Setter* | set_extents(value) |
  62. +-----------+----------------------+
  63. | *Getter* | get_extents() |
  64. +-----------+----------------------+
  65. The collision heightmap's extents in 3D units. To improve heightmap quality, :ref:`extents<class_GPUParticlesCollisionHeightField3D_property_extents>` should be set as small as possible while covering the parts of the scene you need.
  66. ----
  67. .. _class_GPUParticlesCollisionHeightField3D_property_follow_camera_enabled:
  68. - :ref:`bool<class_bool>` **follow_camera_enabled**
  69. +-----------+----------------------------------+
  70. | *Default* | ``false`` |
  71. +-----------+----------------------------------+
  72. | *Setter* | set_follow_camera_enabled(value) |
  73. +-----------+----------------------------------+
  74. | *Getter* | is_follow_camera_enabled() |
  75. +-----------+----------------------------------+
  76. 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.
  77. 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``.
  78. ----
  79. .. _class_GPUParticlesCollisionHeightField3D_property_resolution:
  80. - :ref:`Resolution<enum_GPUParticlesCollisionHeightField3D_Resolution>` **resolution**
  81. +-----------+-----------------------+
  82. | *Default* | ``2`` |
  83. +-----------+-----------------------+
  84. | *Setter* | set_resolution(value) |
  85. +-----------+-----------------------+
  86. | *Getter* | get_resolution() |
  87. +-----------+-----------------------+
  88. 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.
  89. ----
  90. .. _class_GPUParticlesCollisionHeightField3D_property_update_mode:
  91. - :ref:`UpdateMode<enum_GPUParticlesCollisionHeightField3D_UpdateMode>` **update_mode**
  92. +-----------+------------------------+
  93. | *Default* | ``0`` |
  94. +-----------+------------------------+
  95. | *Setter* | set_update_mode(value) |
  96. +-----------+------------------------+
  97. | *Getter* | get_update_mode() |
  98. +-----------+------------------------+
  99. The update policy to use for the generated heightmap.
  100. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  101. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  102. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  103. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  104. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  105. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`