class_visualinstance3d.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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/VisualInstance3D.xml.
  6. .. _class_VisualInstance3D:
  7. VisualInstance3D
  8. ================
  9. **Inherits:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`Decal<class_Decal>`, :ref:`FogVolume<class_FogVolume>`, :ref:`GeometryInstance3D<class_GeometryInstance3D>`, :ref:`GPUParticlesAttractor3D<class_GPUParticlesAttractor3D>`, :ref:`GPUParticlesCollision3D<class_GPUParticlesCollision3D>`, :ref:`Light3D<class_Light3D>`, :ref:`LightmapGI<class_LightmapGI>`, :ref:`ReflectionProbe<class_ReflectionProbe>`, :ref:`RootMotionView<class_RootMotionView>`, :ref:`VisibleOnScreenNotifier3D<class_VisibleOnScreenNotifier3D>`, :ref:`VoxelGI<class_VoxelGI>`
  11. Parent of all visual 3D nodes.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. The **VisualInstance3D** is used to connect a resource to a visual representation. All visual 3D nodes inherit from the **VisualInstance3D**. In general, you should not access the **VisualInstance3D** properties directly as they are accessed and managed by the nodes that inherit from **VisualInstance3D**. **VisualInstance3D** is the node representation of the :ref:`RenderingServer<class_RenderingServer>` instance.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +---------------------------+-----------------------------------------------------------------------------------------+----------+
  22. | :ref:`int<class_int>` | :ref:`layers<class_VisualInstance3D_property_layers>` | ``1`` |
  23. +---------------------------+-----------------------------------------------------------------------------------------+----------+
  24. | :ref:`float<class_float>` | :ref:`sorting_offset<class_VisualInstance3D_property_sorting_offset>` | ``0.0`` |
  25. +---------------------------+-----------------------------------------------------------------------------------------+----------+
  26. | :ref:`bool<class_bool>` | :ref:`sorting_use_aabb_center<class_VisualInstance3D_property_sorting_use_aabb_center>` | ``true`` |
  27. +---------------------------+-----------------------------------------------------------------------------------------+----------+
  28. .. rst-class:: classref-reftable-group
  29. Methods
  30. -------
  31. .. table::
  32. :widths: auto
  33. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`AABB<class_AABB>` | :ref:`_get_aabb<class_VisualInstance3D_method__get_aabb>` **(** **)** |virtual| |const| |
  35. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`AABB<class_AABB>` | :ref:`get_aabb<class_VisualInstance3D_method_get_aabb>` **(** **)** |const| |
  37. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`RID<class_RID>` | :ref:`get_base<class_VisualInstance3D_method_get_base>` **(** **)** |const| |
  39. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`RID<class_RID>` | :ref:`get_instance<class_VisualInstance3D_method_get_instance>` **(** **)** |const| |
  41. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`bool<class_bool>` | :ref:`get_layer_mask_value<class_VisualInstance3D_method_get_layer_mask_value>` **(** :ref:`int<class_int>` layer_number **)** |const| |
  43. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | void | :ref:`set_base<class_VisualInstance3D_method_set_base>` **(** :ref:`RID<class_RID>` base **)** |
  45. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | void | :ref:`set_layer_mask_value<class_VisualInstance3D_method_set_layer_mask_value>` **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)** |
  47. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. .. rst-class:: classref-section-separator
  49. ----
  50. .. rst-class:: classref-descriptions-group
  51. Property Descriptions
  52. ---------------------
  53. .. _class_VisualInstance3D_property_layers:
  54. .. rst-class:: classref-property
  55. :ref:`int<class_int>` **layers** = ``1``
  56. .. rst-class:: classref-property-setget
  57. - void **set_layer_mask** **(** :ref:`int<class_int>` value **)**
  58. - :ref:`int<class_int>` **get_layer_mask** **(** **)**
  59. The render layer(s) this **VisualInstance3D** is drawn on.
  60. This object will only be visible for :ref:`Camera3D<class_Camera3D>`\ s whose cull mask includes the render object this **VisualInstance3D** is set to.
  61. For :ref:`Light3D<class_Light3D>`\ s, this can be used to control which **VisualInstance3D**\ s are affected by a specific light. For :ref:`GPUParticles3D<class_GPUParticles3D>`, this can be used to control which particles are effected by a specific attractor. For :ref:`Decal<class_Decal>`\ s, this can be used to control which **VisualInstance3D**\ s are affected by a specific decal.
  62. .. rst-class:: classref-item-separator
  63. ----
  64. .. _class_VisualInstance3D_property_sorting_offset:
  65. .. rst-class:: classref-property
  66. :ref:`float<class_float>` **sorting_offset** = ``0.0``
  67. .. rst-class:: classref-property-setget
  68. - void **set_sorting_offset** **(** :ref:`float<class_float>` value **)**
  69. - :ref:`float<class_float>` **get_sorting_offset** **(** **)**
  70. The sorting offset used by this **VisualInstance3D**. Adjusting it to a higher value will make the **VisualInstance3D** reliably draw on top of other **VisualInstance3D**\ s that are otherwise positioned at the same spot.
  71. .. rst-class:: classref-item-separator
  72. ----
  73. .. _class_VisualInstance3D_property_sorting_use_aabb_center:
  74. .. rst-class:: classref-property
  75. :ref:`bool<class_bool>` **sorting_use_aabb_center** = ``true``
  76. .. rst-class:: classref-property-setget
  77. - void **set_sorting_use_aabb_center** **(** :ref:`bool<class_bool>` value **)**
  78. - :ref:`bool<class_bool>` **is_sorting_use_aabb_center** **(** **)**
  79. If ``true``, the object is sorted based on the :ref:`AABB<class_AABB>` center. The object will be sorted based on the global position otherwise.
  80. The :ref:`AABB<class_AABB>` center based sorting is generally more accurate for 3D models. The position based sorting instead allows to better control the drawing order when working with :ref:`GPUParticles3D<class_GPUParticles3D>` and :ref:`CPUParticles3D<class_CPUParticles3D>`.
  81. .. rst-class:: classref-section-separator
  82. ----
  83. .. rst-class:: classref-descriptions-group
  84. Method Descriptions
  85. -------------------
  86. .. _class_VisualInstance3D_method__get_aabb:
  87. .. rst-class:: classref-method
  88. :ref:`AABB<class_AABB>` **_get_aabb** **(** **)** |virtual| |const|
  89. .. container:: contribute
  90. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  91. .. rst-class:: classref-item-separator
  92. ----
  93. .. _class_VisualInstance3D_method_get_aabb:
  94. .. rst-class:: classref-method
  95. :ref:`AABB<class_AABB>` **get_aabb** **(** **)** |const|
  96. Returns the :ref:`AABB<class_AABB>` (also known as the bounding box) for this **VisualInstance3D**.
  97. .. rst-class:: classref-item-separator
  98. ----
  99. .. _class_VisualInstance3D_method_get_base:
  100. .. rst-class:: classref-method
  101. :ref:`RID<class_RID>` **get_base** **(** **)** |const|
  102. Returns the RID of the resource associated with this **VisualInstance3D**. For example, if the Node is a :ref:`MeshInstance3D<class_MeshInstance3D>`, this will return the RID of the associated :ref:`Mesh<class_Mesh>`.
  103. .. rst-class:: classref-item-separator
  104. ----
  105. .. _class_VisualInstance3D_method_get_instance:
  106. .. rst-class:: classref-method
  107. :ref:`RID<class_RID>` **get_instance** **(** **)** |const|
  108. Returns the RID of this instance. This RID is the same as the RID returned by :ref:`RenderingServer.instance_create<class_RenderingServer_method_instance_create>`. This RID is needed if you want to call :ref:`RenderingServer<class_RenderingServer>` functions directly on this **VisualInstance3D**.
  109. .. rst-class:: classref-item-separator
  110. ----
  111. .. _class_VisualInstance3D_method_get_layer_mask_value:
  112. .. rst-class:: classref-method
  113. :ref:`bool<class_bool>` **get_layer_mask_value** **(** :ref:`int<class_int>` layer_number **)** |const|
  114. Returns whether or not the specified layer of the :ref:`layers<class_VisualInstance3D_property_layers>` is enabled, given a ``layer_number`` between 1 and 20.
  115. .. rst-class:: classref-item-separator
  116. ----
  117. .. _class_VisualInstance3D_method_set_base:
  118. .. rst-class:: classref-method
  119. void **set_base** **(** :ref:`RID<class_RID>` base **)**
  120. Sets the resource that is instantiated by this **VisualInstance3D**, which changes how the engine handles the **VisualInstance3D** under the hood. Equivalent to :ref:`RenderingServer.instance_set_base<class_RenderingServer_method_instance_set_base>`.
  121. .. rst-class:: classref-item-separator
  122. ----
  123. .. _class_VisualInstance3D_method_set_layer_mask_value:
  124. .. rst-class:: classref-method
  125. void **set_layer_mask_value** **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)**
  126. Based on ``value``, enables or disables the specified layer in the :ref:`layers<class_VisualInstance3D_property_layers>`, given a ``layer_number`` between 1 and 20.
  127. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  128. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  129. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  130. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  131. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  132. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`