class_visualinstance3d.rst 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the VisualInstance3D.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_VisualInstance3D:
  6. VisualInstance3D
  7. ================
  8. **Inherits:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Inherited By:** :ref:`Decal<class_Decal>`, :ref:`FogVolume<class_FogVolume>`, :ref:`GPUParticlesAttractor3D<class_GPUParticlesAttractor3D>`, :ref:`GPUParticlesCollision3D<class_GPUParticlesCollision3D>`, :ref:`GeometryInstance3D<class_GeometryInstance3D>`, :ref:`Light3D<class_Light3D>`, :ref:`LightmapGI<class_LightmapGI>`, :ref:`ReflectionProbe<class_ReflectionProbe>`, :ref:`RootMotionView<class_RootMotionView>`, :ref:`VisibleOnScreenNotifier3D<class_VisibleOnScreenNotifier3D>`, :ref:`VoxelGI<class_VoxelGI>`
  10. Parent of all visual 3D nodes.
  11. Description
  12. -----------
  13. 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.
  14. Properties
  15. ----------
  16. +-----------------------+-------------------------------------------------------+-------+
  17. | :ref:`int<class_int>` | :ref:`layers<class_VisualInstance3D_property_layers>` | ``1`` |
  18. +-----------------------+-------------------------------------------------------+-------+
  19. Methods
  20. -------
  21. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`AABB<class_AABB>` | :ref:`_get_aabb<class_VisualInstance3D_method__get_aabb>` **(** **)** |virtual| |const| |
  23. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`AABB<class_AABB>` | :ref:`get_aabb<class_VisualInstance3D_method_get_aabb>` **(** **)** |const| |
  25. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`RID<class_RID>` | :ref:`get_base<class_VisualInstance3D_method_get_base>` **(** **)** |const| |
  27. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`RID<class_RID>` | :ref:`get_instance<class_VisualInstance3D_method_get_instance>` **(** **)** |const| |
  29. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`bool<class_bool>` | :ref:`get_layer_mask_value<class_VisualInstance3D_method_get_layer_mask_value>` **(** :ref:`int<class_int>` layer_number **)** |const| |
  31. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`AABB<class_AABB>` | :ref:`get_transformed_aabb<class_VisualInstance3D_method_get_transformed_aabb>` **(** **)** |const| |
  33. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`set_base<class_VisualInstance3D_method_set_base>` **(** :ref:`RID<class_RID>` base **)** |
  35. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`set_layer_mask_value<class_VisualInstance3D_method_set_layer_mask_value>` **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)** |
  37. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. Property Descriptions
  39. ---------------------
  40. .. _class_VisualInstance3D_property_layers:
  41. - :ref:`int<class_int>` **layers**
  42. +-----------+-----------------------+
  43. | *Default* | ``1`` |
  44. +-----------+-----------------------+
  45. | *Setter* | set_layer_mask(value) |
  46. +-----------+-----------------------+
  47. | *Getter* | get_layer_mask() |
  48. +-----------+-----------------------+
  49. The render layer(s) this ``VisualInstance3D`` is drawn on.
  50. This object will only be visible for :ref:`Camera3D<class_Camera3D>`\ s whose cull mask includes the render object this ``VisualInstance3D`` is set to.
  51. Method Descriptions
  52. -------------------
  53. .. _class_VisualInstance3D_method__get_aabb:
  54. - :ref:`AABB<class_AABB>` **_get_aabb** **(** **)** |virtual| |const|
  55. ----
  56. .. _class_VisualInstance3D_method_get_aabb:
  57. - :ref:`AABB<class_AABB>` **get_aabb** **(** **)** |const|
  58. Returns the :ref:`AABB<class_AABB>` (also known as the bounding box) for this ``VisualInstance3D``. See also :ref:`get_transformed_aabb<class_VisualInstance3D_method_get_transformed_aabb>`.
  59. ----
  60. .. _class_VisualInstance3D_method_get_base:
  61. - :ref:`RID<class_RID>` **get_base** **(** **)** |const|
  62. 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>`.
  63. ----
  64. .. _class_VisualInstance3D_method_get_instance:
  65. - :ref:`RID<class_RID>` **get_instance** **(** **)** |const|
  66. 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``.
  67. ----
  68. .. _class_VisualInstance3D_method_get_layer_mask_value:
  69. - :ref:`bool<class_bool>` **get_layer_mask_value** **(** :ref:`int<class_int>` layer_number **)** |const|
  70. 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.
  71. ----
  72. .. _class_VisualInstance3D_method_get_transformed_aabb:
  73. - :ref:`AABB<class_AABB>` **get_transformed_aabb** **(** **)** |const|
  74. Returns the transformed :ref:`AABB<class_AABB>` (also known as the bounding box) for this ``VisualInstance3D``.
  75. Transformed in this case means the :ref:`AABB<class_AABB>` plus the position, rotation, and scale of the :ref:`Node3D<class_Node3D>`'s :ref:`Transform3D<class_Transform3D>`. See also :ref:`get_aabb<class_VisualInstance3D_method_get_aabb>`.
  76. ----
  77. .. _class_VisualInstance3D_method_set_base:
  78. - void **set_base** **(** :ref:`RID<class_RID>` base **)**
  79. 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>`.
  80. ----
  81. .. _class_VisualInstance3D_method_set_layer_mask_value:
  82. - void **set_layer_mask_value** **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)**
  83. 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.
  84. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  85. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  86. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  87. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  88. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  89. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`