class_geometryinstance.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the GeometryInstance.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_GeometryInstance:
  5. GeometryInstance
  6. ================
  7. **Inherits:** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  8. **Inherited By:** :ref:`CPUParticles<class_CPUParticles>`, :ref:`CSGShape<class_CSGShape>`, :ref:`ImmediateGeometry<class_ImmediateGeometry>`, :ref:`MeshInstance<class_MeshInstance>`, :ref:`MultiMeshInstance<class_MultiMeshInstance>`, :ref:`Particles<class_Particles>`, :ref:`SpriteBase3D<class_SpriteBase3D>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Base node for geometry-based visual instances.
  13. Properties
  14. ----------
  15. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------+
  16. | :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` | :ref:`cast_shadow<class_GeometryInstance_property_cast_shadow>` | 1 |
  17. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------+
  18. | :ref:`float<class_float>` | :ref:`extra_cull_margin<class_GeometryInstance_property_extra_cull_margin>` | 0.0 |
  19. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------+
  20. | :ref:`float<class_float>` | :ref:`lod_max_distance<class_GeometryInstance_property_lod_max_distance>` | 0.0 |
  21. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------+
  22. | :ref:`float<class_float>` | :ref:`lod_max_hysteresis<class_GeometryInstance_property_lod_max_hysteresis>` | 0.0 |
  23. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------+
  24. | :ref:`float<class_float>` | :ref:`lod_min_distance<class_GeometryInstance_property_lod_min_distance>` | 0.0 |
  25. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------+
  26. | :ref:`float<class_float>` | :ref:`lod_min_hysteresis<class_GeometryInstance_property_lod_min_hysteresis>` | 0.0 |
  27. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------+
  28. | :ref:`Material<class_Material>` | :ref:`material_override<class_GeometryInstance_property_material_override>` | |
  29. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------+
  30. | :ref:`bool<class_bool>` | :ref:`use_in_baked_light<class_GeometryInstance_property_use_in_baked_light>` | false |
  31. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------+
  32. Methods
  33. -------
  34. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`bool<class_bool>` | :ref:`get_flag<class_GeometryInstance_method_get_flag>` **(** :ref:`Flags<enum_GeometryInstance_Flags>` flag **)** const |
  36. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`set_custom_aabb<class_GeometryInstance_method_set_custom_aabb>` **(** :ref:`AABB<class_AABB>` aabb **)** |
  38. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`set_flag<class_GeometryInstance_method_set_flag>` **(** :ref:`Flags<enum_GeometryInstance_Flags>` flag, :ref:`bool<class_bool>` value **)** |
  40. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  41. Enumerations
  42. ------------
  43. .. _enum_GeometryInstance_ShadowCastingSetting:
  44. .. _class_GeometryInstance_constant_SHADOW_CASTING_SETTING_OFF:
  45. .. _class_GeometryInstance_constant_SHADOW_CASTING_SETTING_ON:
  46. .. _class_GeometryInstance_constant_SHADOW_CASTING_SETTING_DOUBLE_SIDED:
  47. .. _class_GeometryInstance_constant_SHADOW_CASTING_SETTING_SHADOWS_ONLY:
  48. enum **ShadowCastingSetting**:
  49. - **SHADOW_CASTING_SETTING_OFF** = **0** --- Will not cast any shadows.
  50. - **SHADOW_CASTING_SETTING_ON** = **1** --- Will cast shadows from all visible faces in the GeometryInstance.
  51. Will take culling into account, so faces not being rendered will not be taken into account when shadow casting.
  52. - **SHADOW_CASTING_SETTING_DOUBLE_SIDED** = **2** --- Will cast shadows from all visible faces in the GeometryInstance.
  53. Will not take culling into account, so all faces will be taken into account when shadow casting.
  54. - **SHADOW_CASTING_SETTING_SHADOWS_ONLY** = **3** --- Will only show the shadows casted from this object.
  55. In other words: The actual mesh will not be visible, only the shadows casted from the mesh.
  56. .. _enum_GeometryInstance_Flags:
  57. .. _class_GeometryInstance_constant_FLAG_USE_BAKED_LIGHT:
  58. .. _class_GeometryInstance_constant_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE:
  59. .. _class_GeometryInstance_constant_FLAG_MAX:
  60. enum **Flags**:
  61. - **FLAG_USE_BAKED_LIGHT** = **0** --- Will allow the GeometryInstance to be used when baking lights using a :ref:`GIProbe<class_GIProbe>` and/or any other form of baked lighting.
  62. - **FLAG_DRAW_NEXT_FRAME_IF_VISIBLE** = **1** --- Unused in this class, exposed for consistency with :ref:`InstanceFlags<enum_VisualServer_InstanceFlags>`.
  63. - **FLAG_MAX** = **2** --- Represents the size of the :ref:`Flags<enum_GeometryInstance_Flags>` enum.
  64. Description
  65. -----------
  66. Base node for geometry-based visual instances. Shares some common functionality like visibility and custom materials.
  67. Property Descriptions
  68. ---------------------
  69. .. _class_GeometryInstance_property_cast_shadow:
  70. - :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` **cast_shadow**
  71. +-----------+---------------------------------+
  72. | *Default* | 1 |
  73. +-----------+---------------------------------+
  74. | *Setter* | set_cast_shadows_setting(value) |
  75. +-----------+---------------------------------+
  76. | *Getter* | get_cast_shadows_setting() |
  77. +-----------+---------------------------------+
  78. The selected shadow casting flag. See :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` for possible values.
  79. .. _class_GeometryInstance_property_extra_cull_margin:
  80. - :ref:`float<class_float>` **extra_cull_margin**
  81. +-----------+------------------------------+
  82. | *Default* | 0.0 |
  83. +-----------+------------------------------+
  84. | *Setter* | set_extra_cull_margin(value) |
  85. +-----------+------------------------------+
  86. | *Getter* | get_extra_cull_margin() |
  87. +-----------+------------------------------+
  88. The extra distance added to the GeometryInstance's bounding box (:ref:`AABB<class_AABB>`) to increase its cull box.
  89. .. _class_GeometryInstance_property_lod_max_distance:
  90. - :ref:`float<class_float>` **lod_max_distance**
  91. +-----------+-----------------------------+
  92. | *Default* | 0.0 |
  93. +-----------+-----------------------------+
  94. | *Setter* | set_lod_max_distance(value) |
  95. +-----------+-----------------------------+
  96. | *Getter* | get_lod_max_distance() |
  97. +-----------+-----------------------------+
  98. The GeometryInstance's max LOD distance.
  99. .. _class_GeometryInstance_property_lod_max_hysteresis:
  100. - :ref:`float<class_float>` **lod_max_hysteresis**
  101. +-----------+-------------------------------+
  102. | *Default* | 0.0 |
  103. +-----------+-------------------------------+
  104. | *Setter* | set_lod_max_hysteresis(value) |
  105. +-----------+-------------------------------+
  106. | *Getter* | get_lod_max_hysteresis() |
  107. +-----------+-------------------------------+
  108. The GeometryInstance's max LOD margin.
  109. .. _class_GeometryInstance_property_lod_min_distance:
  110. - :ref:`float<class_float>` **lod_min_distance**
  111. +-----------+-----------------------------+
  112. | *Default* | 0.0 |
  113. +-----------+-----------------------------+
  114. | *Setter* | set_lod_min_distance(value) |
  115. +-----------+-----------------------------+
  116. | *Getter* | get_lod_min_distance() |
  117. +-----------+-----------------------------+
  118. The GeometryInstance's min LOD distance.
  119. .. _class_GeometryInstance_property_lod_min_hysteresis:
  120. - :ref:`float<class_float>` **lod_min_hysteresis**
  121. +-----------+-------------------------------+
  122. | *Default* | 0.0 |
  123. +-----------+-------------------------------+
  124. | *Setter* | set_lod_min_hysteresis(value) |
  125. +-----------+-------------------------------+
  126. | *Getter* | get_lod_min_hysteresis() |
  127. +-----------+-------------------------------+
  128. The GeometryInstance's min LOD margin.
  129. .. _class_GeometryInstance_property_material_override:
  130. - :ref:`Material<class_Material>` **material_override**
  131. +----------+------------------------------+
  132. | *Setter* | set_material_override(value) |
  133. +----------+------------------------------+
  134. | *Getter* | get_material_override() |
  135. +----------+------------------------------+
  136. The material override for the whole geometry.
  137. If there is a material in ``material_override``, it will be used instead of any material set in any material slot of the mesh.
  138. .. _class_GeometryInstance_property_use_in_baked_light:
  139. - :ref:`bool<class_bool>` **use_in_baked_light**
  140. +-----------+-----------------+
  141. | *Default* | false |
  142. +-----------+-----------------+
  143. | *Setter* | set_flag(value) |
  144. +-----------+-----------------+
  145. | *Getter* | get_flag() |
  146. +-----------+-----------------+
  147. If ``true``, this GeometryInstance will be used when baking lights using a :ref:`GIProbe<class_GIProbe>` and/or any other form of baked lighting.
  148. Method Descriptions
  149. -------------------
  150. .. _class_GeometryInstance_method_get_flag:
  151. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_GeometryInstance_Flags>` flag **)** const
  152. .. _class_GeometryInstance_method_set_custom_aabb:
  153. - void **set_custom_aabb** **(** :ref:`AABB<class_AABB>` aabb **)**
  154. Overrides the bounding box of this node with a custom one. To remove it, set an :ref:`AABB<class_AABB>` with all fields set to zero.
  155. .. _class_GeometryInstance_method_set_flag:
  156. - void **set_flag** **(** :ref:`Flags<enum_GeometryInstance_Flags>` flag, :ref:`bool<class_bool>` value **)**