mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-03 05:48:42 +03:00
141 lines
8.7 KiB
ReStructuredText
141 lines
8.7 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the VisualInstance3D.xml source instead.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
|
.. _class_VisualInstance3D:
|
|
|
|
VisualInstance3D
|
|
================
|
|
|
|
**Inherits:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
**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>`
|
|
|
|
Parent of all visual 3D nodes.
|
|
|
|
Description
|
|
-----------
|
|
|
|
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.
|
|
|
|
Properties
|
|
----------
|
|
|
|
+-----------------------+-------------------------------------------------------+-------+
|
|
| :ref:`int<class_int>` | :ref:`layers<class_VisualInstance3D_property_layers>` | ``1`` |
|
|
+-----------------------+-------------------------------------------------------+-------+
|
|
|
|
Methods
|
|
-------
|
|
|
|
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`AABB<class_AABB>` | :ref:`_get_aabb<class_VisualInstance3D_method__get_aabb>` **(** **)** |virtual| |const| |
|
|
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`AABB<class_AABB>` | :ref:`get_aabb<class_VisualInstance3D_method_get_aabb>` **(** **)** |const| |
|
|
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`RID<class_RID>` | :ref:`get_base<class_VisualInstance3D_method_get_base>` **(** **)** |const| |
|
|
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`RID<class_RID>` | :ref:`get_instance<class_VisualInstance3D_method_get_instance>` **(** **)** |const| |
|
|
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`get_layer_mask_value<class_VisualInstance3D_method_get_layer_mask_value>` **(** :ref:`int<class_int>` layer_number **)** |const| |
|
|
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`AABB<class_AABB>` | :ref:`get_transformed_aabb<class_VisualInstance3D_method_get_transformed_aabb>` **(** **)** |const| |
|
|
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_base<class_VisualInstance3D_method_set_base>` **(** :ref:`RID<class_RID>` base **)** |
|
|
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_layer_mask_value<class_VisualInstance3D_method_set_layer_mask_value>` **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)** |
|
|
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_VisualInstance3D_property_layers:
|
|
|
|
- :ref:`int<class_int>` **layers**
|
|
|
|
+-----------+-----------------------+
|
|
| *Default* | ``1`` |
|
|
+-----------+-----------------------+
|
|
| *Setter* | set_layer_mask(value) |
|
|
+-----------+-----------------------+
|
|
| *Getter* | get_layer_mask() |
|
|
+-----------+-----------------------+
|
|
|
|
The render layer(s) this ``VisualInstance3D`` is drawn on.
|
|
|
|
This object will only be visible for :ref:`Camera3D<class_Camera3D>`\ s whose cull mask includes the render object this ``VisualInstance3D`` is set to.
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_VisualInstance3D_method__get_aabb:
|
|
|
|
- :ref:`AABB<class_AABB>` **_get_aabb** **(** **)** |virtual| |const|
|
|
|
|
----
|
|
|
|
.. _class_VisualInstance3D_method_get_aabb:
|
|
|
|
- :ref:`AABB<class_AABB>` **get_aabb** **(** **)** |const|
|
|
|
|
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>`.
|
|
|
|
----
|
|
|
|
.. _class_VisualInstance3D_method_get_base:
|
|
|
|
- :ref:`RID<class_RID>` **get_base** **(** **)** |const|
|
|
|
|
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>`.
|
|
|
|
----
|
|
|
|
.. _class_VisualInstance3D_method_get_instance:
|
|
|
|
- :ref:`RID<class_RID>` **get_instance** **(** **)** |const|
|
|
|
|
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``.
|
|
|
|
----
|
|
|
|
.. _class_VisualInstance3D_method_get_layer_mask_value:
|
|
|
|
- :ref:`bool<class_bool>` **get_layer_mask_value** **(** :ref:`int<class_int>` layer_number **)** |const|
|
|
|
|
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.
|
|
|
|
----
|
|
|
|
.. _class_VisualInstance3D_method_get_transformed_aabb:
|
|
|
|
- :ref:`AABB<class_AABB>` **get_transformed_aabb** **(** **)** |const|
|
|
|
|
Returns the transformed :ref:`AABB<class_AABB>` (also known as the bounding box) for this ``VisualInstance3D``.
|
|
|
|
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>`.
|
|
|
|
----
|
|
|
|
.. _class_VisualInstance3D_method_set_base:
|
|
|
|
- void **set_base** **(** :ref:`RID<class_RID>` base **)**
|
|
|
|
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>`.
|
|
|
|
----
|
|
|
|
.. _class_VisualInstance3D_method_set_layer_mask_value:
|
|
|
|
- void **set_layer_mask_value** **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)**
|
|
|
|
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.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|
|
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
|
|
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
|
|
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
|