class_visualinstance3d.rst 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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>` **(** **)** |const| |
  23. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`RID<class_RID>` | :ref:`get_base<class_VisualInstance3D_method_get_base>` **(** **)** |const| |
  25. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`RID<class_RID>` | :ref:`get_instance<class_VisualInstance3D_method_get_instance>` **(** **)** |const| |
  27. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`bool<class_bool>` | :ref:`get_layer_mask_value<class_VisualInstance3D_method_get_layer_mask_value>` **(** :ref:`int<class_int>` layer_number **)** |const| |
  29. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`AABB<class_AABB>` | :ref:`get_transformed_aabb<class_VisualInstance3D_method_get_transformed_aabb>` **(** **)** |const| |
  31. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`set_base<class_VisualInstance3D_method_set_base>` **(** :ref:`RID<class_RID>` base **)** |
  33. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`set_layer_mask_value<class_VisualInstance3D_method_set_layer_mask_value>` **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)** |
  35. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. Property Descriptions
  37. ---------------------
  38. .. _class_VisualInstance3D_property_layers:
  39. - :ref:`int<class_int>` **layers**
  40. +-----------+-----------------------+
  41. | *Default* | ``1`` |
  42. +-----------+-----------------------+
  43. | *Setter* | set_layer_mask(value) |
  44. +-----------+-----------------------+
  45. | *Getter* | get_layer_mask() |
  46. +-----------+-----------------------+
  47. The render layer(s) this ``VisualInstance3D`` is drawn on.
  48. This object will only be visible for :ref:`Camera3D<class_Camera3D>`\ s whose cull mask includes the render object this ``VisualInstance3D`` is set to.
  49. Method Descriptions
  50. -------------------
  51. .. _class_VisualInstance3D_method_get_aabb:
  52. - :ref:`AABB<class_AABB>` **get_aabb** **(** **)** |const|
  53. 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>`.
  54. ----
  55. .. _class_VisualInstance3D_method_get_base:
  56. - :ref:`RID<class_RID>` **get_base** **(** **)** |const|
  57. 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>`.
  58. ----
  59. .. _class_VisualInstance3D_method_get_instance:
  60. - :ref:`RID<class_RID>` **get_instance** **(** **)** |const|
  61. 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``.
  62. ----
  63. .. _class_VisualInstance3D_method_get_layer_mask_value:
  64. - :ref:`bool<class_bool>` **get_layer_mask_value** **(** :ref:`int<class_int>` layer_number **)** |const|
  65. 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.
  66. ----
  67. .. _class_VisualInstance3D_method_get_transformed_aabb:
  68. - :ref:`AABB<class_AABB>` **get_transformed_aabb** **(** **)** |const|
  69. Returns the transformed :ref:`AABB<class_AABB>` (also known as the bounding box) for this ``VisualInstance3D``.
  70. 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>`.
  71. ----
  72. .. _class_VisualInstance3D_method_set_base:
  73. - void **set_base** **(** :ref:`RID<class_RID>` base **)**
  74. 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>`.
  75. ----
  76. .. _class_VisualInstance3D_method_set_layer_mask_value:
  77. - void **set_layer_mask_value** **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)**
  78. 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.
  79. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  80. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  81. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  82. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  83. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  84. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`