class_geometryinstance.rst 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  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/3.5/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/GeometryInstance.xml.
  6. .. _class_GeometryInstance:
  7. GeometryInstance
  8. ================
  9. **Inherits:** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`CullInstance<class_CullInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`CPUParticles<class_CPUParticles>`, :ref:`CSGShape<class_CSGShape>`, :ref:`ImmediateGeometry<class_ImmediateGeometry>`, :ref:`Label3D<class_Label3D>`, :ref:`MeshInstance<class_MeshInstance>`, :ref:`MultiMeshInstance<class_MultiMeshInstance>`, :ref:`Particles<class_Particles>`, :ref:`SpriteBase3D<class_SpriteBase3D>`
  11. Base node for geometry-based visual instances.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Base node for geometry-based visual instances. Shares some common functionality like visibility and custom materials.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+
  22. | :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` | :ref:`cast_shadow<class_GeometryInstance_property_cast_shadow>` | ``1`` |
  23. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+
  24. | :ref:`float<class_float>` | :ref:`extra_cull_margin<class_GeometryInstance_property_extra_cull_margin>` | ``0.0`` |
  25. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+
  26. | :ref:`bool<class_bool>` | :ref:`generate_lightmap<class_GeometryInstance_property_generate_lightmap>` | ``true`` |
  27. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+
  28. | :ref:`LightmapScale<enum_GeometryInstance_LightmapScale>` | :ref:`lightmap_scale<class_GeometryInstance_property_lightmap_scale>` | ``0`` |
  29. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+
  30. | :ref:`float<class_float>` | :ref:`lod_max_distance<class_GeometryInstance_property_lod_max_distance>` | ``0.0`` |
  31. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+
  32. | :ref:`float<class_float>` | :ref:`lod_max_hysteresis<class_GeometryInstance_property_lod_max_hysteresis>` | ``0.0`` |
  33. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+
  34. | :ref:`float<class_float>` | :ref:`lod_min_distance<class_GeometryInstance_property_lod_min_distance>` | ``0.0`` |
  35. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+
  36. | :ref:`float<class_float>` | :ref:`lod_min_hysteresis<class_GeometryInstance_property_lod_min_hysteresis>` | ``0.0`` |
  37. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+
  38. | :ref:`Material<class_Material>` | :ref:`material_overlay<class_GeometryInstance_property_material_overlay>` | |
  39. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+
  40. | :ref:`Material<class_Material>` | :ref:`material_override<class_GeometryInstance_property_material_override>` | |
  41. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+
  42. | :ref:`bool<class_bool>` | :ref:`use_in_baked_light<class_GeometryInstance_property_use_in_baked_light>` | ``false`` |
  43. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+
  44. .. rst-class:: classref-reftable-group
  45. Methods
  46. -------
  47. .. table::
  48. :widths: auto
  49. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`bool<class_bool>` | :ref:`get_flag<class_GeometryInstance_method_get_flag>` **(** :ref:`Flags<enum_GeometryInstance_Flags>` flag **)** |const| |
  51. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | void | :ref:`set_custom_aabb<class_GeometryInstance_method_set_custom_aabb>` **(** :ref:`AABB<class_AABB>` aabb **)** |
  53. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | void | :ref:`set_flag<class_GeometryInstance_method_set_flag>` **(** :ref:`Flags<enum_GeometryInstance_Flags>` flag, :ref:`bool<class_bool>` value **)** |
  55. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  56. .. rst-class:: classref-section-separator
  57. ----
  58. .. rst-class:: classref-descriptions-group
  59. Enumerations
  60. ------------
  61. .. _enum_GeometryInstance_LightmapScale:
  62. .. rst-class:: classref-enumeration
  63. enum **LightmapScale**:
  64. .. _class_GeometryInstance_constant_LIGHTMAP_SCALE_1X:
  65. .. rst-class:: classref-enumeration-constant
  66. :ref:`LightmapScale<enum_GeometryInstance_LightmapScale>` **LIGHTMAP_SCALE_1X** = ``0``
  67. The generated lightmap texture will have the original size.
  68. .. _class_GeometryInstance_constant_LIGHTMAP_SCALE_2X:
  69. .. rst-class:: classref-enumeration-constant
  70. :ref:`LightmapScale<enum_GeometryInstance_LightmapScale>` **LIGHTMAP_SCALE_2X** = ``1``
  71. The generated lightmap texture will be twice as large, on each axis.
  72. .. _class_GeometryInstance_constant_LIGHTMAP_SCALE_4X:
  73. .. rst-class:: classref-enumeration-constant
  74. :ref:`LightmapScale<enum_GeometryInstance_LightmapScale>` **LIGHTMAP_SCALE_4X** = ``2``
  75. The generated lightmap texture will be 4 times as large, on each axis.
  76. .. _class_GeometryInstance_constant_LIGHTMAP_SCALE_8X:
  77. .. rst-class:: classref-enumeration-constant
  78. :ref:`LightmapScale<enum_GeometryInstance_LightmapScale>` **LIGHTMAP_SCALE_8X** = ``3``
  79. The generated lightmap texture will be 8 times as large, on each axis.
  80. .. _class_GeometryInstance_constant_LIGHTMAP_SCALE_MAX:
  81. .. rst-class:: classref-enumeration-constant
  82. :ref:`LightmapScale<enum_GeometryInstance_LightmapScale>` **LIGHTMAP_SCALE_MAX** = ``4``
  83. .. rst-class:: classref-item-separator
  84. ----
  85. .. _enum_GeometryInstance_ShadowCastingSetting:
  86. .. rst-class:: classref-enumeration
  87. enum **ShadowCastingSetting**:
  88. .. _class_GeometryInstance_constant_SHADOW_CASTING_SETTING_OFF:
  89. .. rst-class:: classref-enumeration-constant
  90. :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` **SHADOW_CASTING_SETTING_OFF** = ``0``
  91. Will not cast any shadows.
  92. .. _class_GeometryInstance_constant_SHADOW_CASTING_SETTING_ON:
  93. .. rst-class:: classref-enumeration-constant
  94. :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` **SHADOW_CASTING_SETTING_ON** = ``1``
  95. Will cast shadows from all visible faces in the GeometryInstance.
  96. Will take culling into account, so faces not being rendered will not be taken into account when shadow casting.
  97. .. _class_GeometryInstance_constant_SHADOW_CASTING_SETTING_DOUBLE_SIDED:
  98. .. rst-class:: classref-enumeration-constant
  99. :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` **SHADOW_CASTING_SETTING_DOUBLE_SIDED** = ``2``
  100. Will cast shadows from all visible faces in the GeometryInstance.
  101. Will not take culling into account, so all faces will be taken into account when shadow casting.
  102. .. _class_GeometryInstance_constant_SHADOW_CASTING_SETTING_SHADOWS_ONLY:
  103. .. rst-class:: classref-enumeration-constant
  104. :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` **SHADOW_CASTING_SETTING_SHADOWS_ONLY** = ``3``
  105. Will only show the shadows casted from this object.
  106. In other words, the actual mesh will not be visible, only the shadows casted from the mesh will be.
  107. .. rst-class:: classref-item-separator
  108. ----
  109. .. _enum_GeometryInstance_Flags:
  110. .. rst-class:: classref-enumeration
  111. enum **Flags**:
  112. .. _class_GeometryInstance_constant_FLAG_USE_BAKED_LIGHT:
  113. .. rst-class:: classref-enumeration-constant
  114. :ref:`Flags<enum_GeometryInstance_Flags>` **FLAG_USE_BAKED_LIGHT** = ``0``
  115. Will allow the GeometryInstance to be used when baking lights using a :ref:`GIProbe<class_GIProbe>` or :ref:`BakedLightmap<class_BakedLightmap>`.
  116. .. _class_GeometryInstance_constant_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE:
  117. .. rst-class:: classref-enumeration-constant
  118. :ref:`Flags<enum_GeometryInstance_Flags>` **FLAG_DRAW_NEXT_FRAME_IF_VISIBLE** = ``1``
  119. Unused in this class, exposed for consistency with :ref:`InstanceFlags<enum_VisualServer_InstanceFlags>`.
  120. .. _class_GeometryInstance_constant_FLAG_MAX:
  121. .. rst-class:: classref-enumeration-constant
  122. :ref:`Flags<enum_GeometryInstance_Flags>` **FLAG_MAX** = ``2``
  123. Represents the size of the :ref:`Flags<enum_GeometryInstance_Flags>` enum.
  124. .. rst-class:: classref-section-separator
  125. ----
  126. .. rst-class:: classref-descriptions-group
  127. Property Descriptions
  128. ---------------------
  129. .. _class_GeometryInstance_property_cast_shadow:
  130. .. rst-class:: classref-property
  131. :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` **cast_shadow** = ``1``
  132. .. rst-class:: classref-property-setget
  133. - void **set_cast_shadows_setting** **(** :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` value **)**
  134. - :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` **get_cast_shadows_setting** **(** **)**
  135. The selected shadow casting flag. See :ref:`ShadowCastingSetting<enum_GeometryInstance_ShadowCastingSetting>` for possible values.
  136. .. rst-class:: classref-item-separator
  137. ----
  138. .. _class_GeometryInstance_property_extra_cull_margin:
  139. .. rst-class:: classref-property
  140. :ref:`float<class_float>` **extra_cull_margin** = ``0.0``
  141. .. rst-class:: classref-property-setget
  142. - void **set_extra_cull_margin** **(** :ref:`float<class_float>` value **)**
  143. - :ref:`float<class_float>` **get_extra_cull_margin** **(** **)**
  144. The extra distance added to the GeometryInstance's bounding box (:ref:`AABB<class_AABB>`) to increase its cull box.
  145. .. rst-class:: classref-item-separator
  146. ----
  147. .. _class_GeometryInstance_property_generate_lightmap:
  148. .. rst-class:: classref-property
  149. :ref:`bool<class_bool>` **generate_lightmap** = ``true``
  150. .. rst-class:: classref-property-setget
  151. - void **set_generate_lightmap** **(** :ref:`bool<class_bool>` value **)**
  152. - :ref:`bool<class_bool>` **get_generate_lightmap** **(** **)**
  153. When disabled, the mesh will be taken into account when computing indirect lighting, but the resulting lightmap will not be saved. Useful for emissive only materials or shadow casters.
  154. .. rst-class:: classref-item-separator
  155. ----
  156. .. _class_GeometryInstance_property_lightmap_scale:
  157. .. rst-class:: classref-property
  158. :ref:`LightmapScale<enum_GeometryInstance_LightmapScale>` **lightmap_scale** = ``0``
  159. .. rst-class:: classref-property-setget
  160. - void **set_lightmap_scale** **(** :ref:`LightmapScale<enum_GeometryInstance_LightmapScale>` value **)**
  161. - :ref:`LightmapScale<enum_GeometryInstance_LightmapScale>` **get_lightmap_scale** **(** **)**
  162. Scale factor for the generated baked lightmap. Useful for adding detail to certain mesh instances.
  163. .. rst-class:: classref-item-separator
  164. ----
  165. .. _class_GeometryInstance_property_lod_max_distance:
  166. .. rst-class:: classref-property
  167. :ref:`float<class_float>` **lod_max_distance** = ``0.0``
  168. .. rst-class:: classref-property-setget
  169. - void **set_lod_max_distance** **(** :ref:`float<class_float>` value **)**
  170. - :ref:`float<class_float>` **get_lod_max_distance** **(** **)**
  171. The GeometryInstance's max LOD distance.
  172. \ **Note:** This property currently has no effect.
  173. .. rst-class:: classref-item-separator
  174. ----
  175. .. _class_GeometryInstance_property_lod_max_hysteresis:
  176. .. rst-class:: classref-property
  177. :ref:`float<class_float>` **lod_max_hysteresis** = ``0.0``
  178. .. rst-class:: classref-property-setget
  179. - void **set_lod_max_hysteresis** **(** :ref:`float<class_float>` value **)**
  180. - :ref:`float<class_float>` **get_lod_max_hysteresis** **(** **)**
  181. The GeometryInstance's max LOD margin.
  182. \ **Note:** This property currently has no effect.
  183. .. rst-class:: classref-item-separator
  184. ----
  185. .. _class_GeometryInstance_property_lod_min_distance:
  186. .. rst-class:: classref-property
  187. :ref:`float<class_float>` **lod_min_distance** = ``0.0``
  188. .. rst-class:: classref-property-setget
  189. - void **set_lod_min_distance** **(** :ref:`float<class_float>` value **)**
  190. - :ref:`float<class_float>` **get_lod_min_distance** **(** **)**
  191. The GeometryInstance's min LOD distance.
  192. \ **Note:** This property currently has no effect.
  193. .. rst-class:: classref-item-separator
  194. ----
  195. .. _class_GeometryInstance_property_lod_min_hysteresis:
  196. .. rst-class:: classref-property
  197. :ref:`float<class_float>` **lod_min_hysteresis** = ``0.0``
  198. .. rst-class:: classref-property-setget
  199. - void **set_lod_min_hysteresis** **(** :ref:`float<class_float>` value **)**
  200. - :ref:`float<class_float>` **get_lod_min_hysteresis** **(** **)**
  201. The GeometryInstance's min LOD margin.
  202. \ **Note:** This property currently has no effect.
  203. .. rst-class:: classref-item-separator
  204. ----
  205. .. _class_GeometryInstance_property_material_overlay:
  206. .. rst-class:: classref-property
  207. :ref:`Material<class_Material>` **material_overlay**
  208. .. rst-class:: classref-property-setget
  209. - void **set_material_overlay** **(** :ref:`Material<class_Material>` value **)**
  210. - :ref:`Material<class_Material>` **get_material_overlay** **(** **)**
  211. The material overlay for the whole geometry.
  212. If a material is assigned to this property, it will be rendered on top of any other active material for all the surfaces.
  213. .. rst-class:: classref-item-separator
  214. ----
  215. .. _class_GeometryInstance_property_material_override:
  216. .. rst-class:: classref-property
  217. :ref:`Material<class_Material>` **material_override**
  218. .. rst-class:: classref-property-setget
  219. - void **set_material_override** **(** :ref:`Material<class_Material>` value **)**
  220. - :ref:`Material<class_Material>` **get_material_override** **(** **)**
  221. The material override for the whole geometry.
  222. If a material is assigned to this property, it will be used instead of any material set in any material slot of the mesh.
  223. .. rst-class:: classref-item-separator
  224. ----
  225. .. _class_GeometryInstance_property_use_in_baked_light:
  226. .. rst-class:: classref-property
  227. :ref:`bool<class_bool>` **use_in_baked_light** = ``false``
  228. .. rst-class:: classref-property-setget
  229. - void **set_flag** **(** :ref:`Flags<enum_GeometryInstance_Flags>` flag, :ref:`bool<class_bool>` value **)**
  230. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_GeometryInstance_Flags>` flag **)** |const|
  231. If ``true``, this GeometryInstance will be used when baking lights using a :ref:`GIProbe<class_GIProbe>` or :ref:`BakedLightmap<class_BakedLightmap>`.
  232. .. rst-class:: classref-section-separator
  233. ----
  234. .. rst-class:: classref-descriptions-group
  235. Method Descriptions
  236. -------------------
  237. .. _class_GeometryInstance_method_get_flag:
  238. .. rst-class:: classref-method
  239. :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_GeometryInstance_Flags>` flag **)** |const|
  240. Returns the :ref:`Flags<enum_GeometryInstance_Flags>` that have been set for this object.
  241. .. rst-class:: classref-item-separator
  242. ----
  243. .. _class_GeometryInstance_method_set_custom_aabb:
  244. .. rst-class:: classref-method
  245. void **set_custom_aabb** **(** :ref:`AABB<class_AABB>` aabb **)**
  246. 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.
  247. .. rst-class:: classref-item-separator
  248. ----
  249. .. _class_GeometryInstance_method_set_flag:
  250. .. rst-class:: classref-method
  251. void **set_flag** **(** :ref:`Flags<enum_GeometryInstance_Flags>` flag, :ref:`bool<class_bool>` value **)**
  252. Sets the :ref:`Flags<enum_GeometryInstance_Flags>` specified. See :ref:`Flags<enum_GeometryInstance_Flags>` for options.
  253. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  254. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  255. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  256. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`