mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-04 10:09:56 +03:00
Currently including `zh_CN` and `es` which both have very high completion ratios. Others will be added once they reach a significant percentage too. These RST files will be used by godot-docs in place of its `classes` folder after we sync with https://github.com/godotengine/godot-docs/pull/5458. The update workflow is manual for now (example for `zh_CN`): - Build `godotengine/godot` in the branch we currently track (now `3.x`) - Run `godot --doctool -l zh_CN` - Run `cd doc && make rst LANGARG=zh_CN` - Copy `doc/_build/rst/*` to `classes/zh_CN/` here - Make sure to have `classes/zh_CN/index.rst` copied from `docs/classes`
579 lines
37 KiB
ReStructuredText
579 lines
37 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 Spatial.xml source instead.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
|
.. _class_Spatial:
|
|
|
|
Spatial
|
|
=======
|
|
|
|
**Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
**Inherited By:** :ref:`ARVRAnchor<class_ARVRAnchor>`, :ref:`ARVRController<class_ARVRController>`, :ref:`ARVROrigin<class_ARVROrigin>`, :ref:`AudioStreamPlayer3D<class_AudioStreamPlayer3D>`, :ref:`BoneAttachment<class_BoneAttachment>`, :ref:`Camera<class_Camera>`, :ref:`CollisionObject<class_CollisionObject>`, :ref:`CollisionPolygon<class_CollisionPolygon>`, :ref:`CollisionShape<class_CollisionShape>`, :ref:`CullInstance<class_CullInstance>`, :ref:`GridMap<class_GridMap>`, :ref:`Joint<class_Joint>`, :ref:`Listener<class_Listener>`, :ref:`Navigation<class_Navigation>`, :ref:`NavigationMeshInstance<class_NavigationMeshInstance>`, :ref:`Occluder<class_Occluder>`, :ref:`Path<class_Path>`, :ref:`PathFollow<class_PathFollow>`, :ref:`Portal<class_Portal>`, :ref:`Position3D<class_Position3D>`, :ref:`ProximityGroup<class_ProximityGroup>`, :ref:`RayCast<class_RayCast>`, :ref:`RemoteTransform<class_RemoteTransform>`, :ref:`Room<class_Room>`, :ref:`RoomGroup<class_RoomGroup>`, :ref:`RoomManager<class_RoomManager>`, :ref:`Skeleton<class_Skeleton>`, :ref:`SpringArm<class_SpringArm>`, :ref:`VehicleWheel<class_VehicleWheel>`
|
|
|
|
El objeto de juego 3D más básico, padre de todos los nodos relacionados con el 3D.
|
|
|
|
Descripción
|
|
----------------------
|
|
|
|
El objeto más básico de un juego en 3D, con un :ref:`Transform<class_Transform>` 3D y ajustes de visibilidad. Todos los demás objetos de juegos 3D heredan de Spatial. Utiliza ``Spatial`` como nodo padre para mover, escalar, rotar y mostrar/esconder a los hijos en un proyecto 3D.
|
|
|
|
Las operaciones de afinación (rotar, escalar, traducir) ocurren en el sistema de coordenadas locales del padre, a menos que el objeto ``Spatial`` se establezca como de nivel superior. Las operaciones afines en este sistema de coordenadas corresponden a operaciones afines directas en la transformación de ``Spatial``. La palabra local a continuación se refiere a este sistema de coordenadas. El sistema de coordenadas que está unido al propio objeto ``Spatial`` se denomina sistema de coordenadas objeto-local.
|
|
|
|
\ **Nota:** A menos que se especifique lo contrario, todos los métodos que tienen parámetros de ángulo deben tener ángulos especificados como *radianes*. Para convertir los grados en radianes, utilice :ref:`@GDScript.deg2rad<class_@GDScript_method_deg2rad>`.
|
|
|
|
Tutoriales
|
|
--------------------
|
|
|
|
- :doc:`Introduction to 3D <../tutorials/3d/introduction_to_3d>`
|
|
|
|
- `All 3D Demos <https://github.com/godotengine/godot-demo-projects/tree/master/3d>`__
|
|
|
|
Propiedades
|
|
----------------------
|
|
|
|
+-----------------------------------------+------------------------------------------------------------------+-----------------------------------------------------+
|
|
| :ref:`SpatialGizmo<class_SpatialGizmo>` | :ref:`gizmo<class_Spatial_property_gizmo>` | |
|
|
+-----------------------------------------+------------------------------------------------------------------+-----------------------------------------------------+
|
|
| :ref:`Transform<class_Transform>` | :ref:`global_transform<class_Spatial_property_global_transform>` | |
|
|
+-----------------------------------------+------------------------------------------------------------------+-----------------------------------------------------+
|
|
| :ref:`Vector3<class_Vector3>` | :ref:`rotation<class_Spatial_property_rotation>` | |
|
|
+-----------------------------------------+------------------------------------------------------------------+-----------------------------------------------------+
|
|
| :ref:`Vector3<class_Vector3>` | :ref:`rotation_degrees<class_Spatial_property_rotation_degrees>` | ``Vector3( 0, 0, 0 )`` |
|
|
+-----------------------------------------+------------------------------------------------------------------+-----------------------------------------------------+
|
|
| :ref:`Vector3<class_Vector3>` | :ref:`scale<class_Spatial_property_scale>` | ``Vector3( 1, 1, 1 )`` |
|
|
+-----------------------------------------+------------------------------------------------------------------+-----------------------------------------------------+
|
|
| :ref:`Transform<class_Transform>` | :ref:`transform<class_Spatial_property_transform>` | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` |
|
|
+-----------------------------------------+------------------------------------------------------------------+-----------------------------------------------------+
|
|
| :ref:`Vector3<class_Vector3>` | :ref:`translation<class_Spatial_property_translation>` | ``Vector3( 0, 0, 0 )`` |
|
|
+-----------------------------------------+------------------------------------------------------------------+-----------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`visible<class_Spatial_property_visible>` | ``true`` |
|
|
+-----------------------------------------+------------------------------------------------------------------+-----------------------------------------------------+
|
|
|
|
Métodos
|
|
--------------
|
|
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`force_update_transform<class_Spatial_method_force_update_transform>` **(** **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Spatial<class_Spatial>` | :ref:`get_parent_spatial<class_Spatial_method_get_parent_spatial>` **(** **)** |const| |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`World<class_World>` | :ref:`get_world<class_Spatial_method_get_world>` **(** **)** |const| |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`global_rotate<class_Spatial_method_global_rotate>` **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`global_scale<class_Spatial_method_global_scale>` **(** :ref:`Vector3<class_Vector3>` scale **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`global_translate<class_Spatial_method_global_translate>` **(** :ref:`Vector3<class_Vector3>` offset **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`hide<class_Spatial_method_hide>` **(** **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_local_transform_notification_enabled<class_Spatial_method_is_local_transform_notification_enabled>` **(** **)** |const| |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_scale_disabled<class_Spatial_method_is_scale_disabled>` **(** **)** |const| |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_set_as_toplevel<class_Spatial_method_is_set_as_toplevel>` **(** **)** |const| |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_transform_notification_enabled<class_Spatial_method_is_transform_notification_enabled>` **(** **)** |const| |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_visible_in_tree<class_Spatial_method_is_visible_in_tree>` **(** **)** |const| |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`look_at<class_Spatial_method_look_at>` **(** :ref:`Vector3<class_Vector3>` target, :ref:`Vector3<class_Vector3>` up **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`look_at_from_position<class_Spatial_method_look_at_from_position>` **(** :ref:`Vector3<class_Vector3>` position, :ref:`Vector3<class_Vector3>` target, :ref:`Vector3<class_Vector3>` up **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`orthonormalize<class_Spatial_method_orthonormalize>` **(** **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`rotate<class_Spatial_method_rotate>` **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`rotate_object_local<class_Spatial_method_rotate_object_local>` **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`rotate_x<class_Spatial_method_rotate_x>` **(** :ref:`float<class_float>` angle **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`rotate_y<class_Spatial_method_rotate_y>` **(** :ref:`float<class_float>` angle **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`rotate_z<class_Spatial_method_rotate_z>` **(** :ref:`float<class_float>` angle **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`scale_object_local<class_Spatial_method_scale_object_local>` **(** :ref:`Vector3<class_Vector3>` scale **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_as_toplevel<class_Spatial_method_set_as_toplevel>` **(** :ref:`bool<class_bool>` enable **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_disable_scale<class_Spatial_method_set_disable_scale>` **(** :ref:`bool<class_bool>` disable **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_identity<class_Spatial_method_set_identity>` **(** **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_ignore_transform_notification<class_Spatial_method_set_ignore_transform_notification>` **(** :ref:`bool<class_bool>` enabled **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_notify_local_transform<class_Spatial_method_set_notify_local_transform>` **(** :ref:`bool<class_bool>` enable **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_notify_transform<class_Spatial_method_set_notify_transform>` **(** :ref:`bool<class_bool>` enable **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`show<class_Spatial_method_show>` **(** **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector3<class_Vector3>` | :ref:`to_global<class_Spatial_method_to_global>` **(** :ref:`Vector3<class_Vector3>` local_point **)** |const| |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector3<class_Vector3>` | :ref:`to_local<class_Spatial_method_to_local>` **(** :ref:`Vector3<class_Vector3>` global_point **)** |const| |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`translate<class_Spatial_method_translate>` **(** :ref:`Vector3<class_Vector3>` offset **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`translate_object_local<class_Spatial_method_translate_object_local>` **(** :ref:`Vector3<class_Vector3>` offset **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`update_gizmo<class_Spatial_method_update_gizmo>` **(** **)** |
|
|
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Señales
|
|
--------------
|
|
|
|
.. _class_Spatial_signal_gameplay_entered:
|
|
|
|
- **gameplay_entered** **(** **)**
|
|
|
|
Emitted by portal system gameplay monitor when a node enters the gameplay area.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_signal_gameplay_exited:
|
|
|
|
- **gameplay_exited** **(** **)**
|
|
|
|
Emitted by portal system gameplay monitor when a node exits the gameplay area.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_signal_visibility_changed:
|
|
|
|
- **visibility_changed** **(** **)**
|
|
|
|
Emitido cuando cambia la visibilidad del nodo.
|
|
|
|
Constantes
|
|
--------------------
|
|
|
|
.. _class_Spatial_constant_NOTIFICATION_TRANSFORM_CHANGED:
|
|
|
|
.. _class_Spatial_constant_NOTIFICATION_ENTER_WORLD:
|
|
|
|
.. _class_Spatial_constant_NOTIFICATION_EXIT_WORLD:
|
|
|
|
.. _class_Spatial_constant_NOTIFICATION_VISIBILITY_CHANGED:
|
|
|
|
.. _class_Spatial_constant_NOTIFICATION_ENTER_GAMEPLAY:
|
|
|
|
.. _class_Spatial_constant_NOTIFICATION_EXIT_GAMEPLAY:
|
|
|
|
- **NOTIFICATION_TRANSFORM_CHANGED** = **2000** --- Spatial nodes receives this notification when their global transform changes. This means that either the current or a parent node changed its transform.
|
|
|
|
In order for :ref:`NOTIFICATION_TRANSFORM_CHANGED<class_Spatial_constant_NOTIFICATION_TRANSFORM_CHANGED>` to work, users first need to ask for it, with :ref:`set_notify_transform<class_Spatial_method_set_notify_transform>`. The notification is also sent if the node is in the editor context and it has a valid gizmo.
|
|
|
|
- **NOTIFICATION_ENTER_WORLD** = **41** --- Spatial nodes receives this notification when they are registered to new :ref:`World<class_World>` resource.
|
|
|
|
- **NOTIFICATION_EXIT_WORLD** = **42** --- Spatial nodes receives this notification when they are unregistered from current :ref:`World<class_World>` resource.
|
|
|
|
- **NOTIFICATION_VISIBILITY_CHANGED** = **43** --- Spatial nodes receives this notification when their visibility changes.
|
|
|
|
- **NOTIFICATION_ENTER_GAMEPLAY** = **45** --- Spatial nodes receives this notification if the portal system gameplay monitor detects they have entered the gameplay area.
|
|
|
|
- **NOTIFICATION_EXIT_GAMEPLAY** = **46** --- Spatial nodes receives this notification if the portal system gameplay monitor detects they have exited the gameplay area.
|
|
|
|
Descripciones de Propiedades
|
|
--------------------------------------------------------
|
|
|
|
.. _class_Spatial_property_gizmo:
|
|
|
|
- :ref:`SpatialGizmo<class_SpatialGizmo>` **gizmo**
|
|
|
|
+----------+------------------+
|
|
| *Setter* | set_gizmo(value) |
|
|
+----------+------------------+
|
|
| *Getter* | get_gizmo() |
|
|
+----------+------------------+
|
|
|
|
The :ref:`SpatialGizmo<class_SpatialGizmo>` for this node. Used for example in :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` as custom visualization and editing handles in Editor.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_property_global_transform:
|
|
|
|
- :ref:`Transform<class_Transform>` **global_transform**
|
|
|
|
+----------+-----------------------------+
|
|
| *Setter* | set_global_transform(value) |
|
|
+----------+-----------------------------+
|
|
| *Getter* | get_global_transform() |
|
|
+----------+-----------------------------+
|
|
|
|
World space (global) :ref:`Transform<class_Transform>` of this node.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_property_rotation:
|
|
|
|
- :ref:`Vector3<class_Vector3>` **rotation**
|
|
|
|
+----------+---------------------+
|
|
| *Setter* | set_rotation(value) |
|
|
+----------+---------------------+
|
|
| *Getter* | get_rotation() |
|
|
+----------+---------------------+
|
|
|
|
Parte de la rotación de la transformación local en radianes, especificada en términos de ángulos YXZ-Euler en el formato (ángulo X, ángulo Y, ángulo Z).
|
|
|
|
\ **Nota:** En el sentido matemático, la rotación es una matriz y no un vector. Los tres ángulos de Euler, que son los tres parámetros independientes de la parametrización del ángulo de Euler de la matriz de rotación, se almacenan en una estructura de datos :ref:`Vector3<class_Vector3>` no porque la rotación sea un vector, sino sólo porque el :ref:`Vector3<class_Vector3>` existe como una estructura de datos conveniente para almacenar 3 números reales. Por lo tanto, la aplicación de operaciones afines en el "vector" de rotación no es significativa.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_property_rotation_degrees:
|
|
|
|
- :ref:`Vector3<class_Vector3>` **rotation_degrees**
|
|
|
|
+-----------+-----------------------------+
|
|
| *Default* | ``Vector3( 0, 0, 0 )`` |
|
|
+-----------+-----------------------------+
|
|
| *Setter* | set_rotation_degrees(value) |
|
|
+-----------+-----------------------------+
|
|
| *Getter* | get_rotation_degrees() |
|
|
+-----------+-----------------------------+
|
|
|
|
Parte de la rotación de la transformación local en grados, especificada en términos de ángulos YXZ-Euler en el formato (ángulo X, ángulo Y, ángulo Z).
|
|
|
|
----
|
|
|
|
.. _class_Spatial_property_scale:
|
|
|
|
- :ref:`Vector3<class_Vector3>` **scale**
|
|
|
|
+-----------+------------------------+
|
|
| *Default* | ``Vector3( 1, 1, 1 )`` |
|
|
+-----------+------------------------+
|
|
| *Setter* | set_scale(value) |
|
|
+-----------+------------------------+
|
|
| *Getter* | get_scale() |
|
|
+-----------+------------------------+
|
|
|
|
Parte de Escala de la transformación local.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_property_transform:
|
|
|
|
- :ref:`Transform<class_Transform>` **transform**
|
|
|
|
+-----------+-----------------------------------------------------+
|
|
| *Default* | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` |
|
|
+-----------+-----------------------------------------------------+
|
|
| *Setter* | set_transform(value) |
|
|
+-----------+-----------------------------------------------------+
|
|
| *Getter* | get_transform() |
|
|
+-----------+-----------------------------------------------------+
|
|
|
|
El espacio local :ref:`Transform<class_Transform>` de este nodo, con respecto al nodo padre.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_property_translation:
|
|
|
|
- :ref:`Vector3<class_Vector3>` **translation**
|
|
|
|
+-----------+------------------------+
|
|
| *Default* | ``Vector3( 0, 0, 0 )`` |
|
|
+-----------+------------------------+
|
|
| *Setter* | set_translation(value) |
|
|
+-----------+------------------------+
|
|
| *Getter* | get_translation() |
|
|
+-----------+------------------------+
|
|
|
|
Traducción local de este nodo.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_property_visible:
|
|
|
|
- :ref:`bool<class_bool>` **visible**
|
|
|
|
+-----------+--------------------+
|
|
| *Default* | ``true`` |
|
|
+-----------+--------------------+
|
|
| *Setter* | set_visible(value) |
|
|
+-----------+--------------------+
|
|
| *Getter* | is_visible() |
|
|
+-----------+--------------------+
|
|
|
|
Si ``true``, este nodo se dibuja. El nodo sólo es visible si todos sus antecedentes también lo son (en otras palabras, :ref:`is_visible_in_tree<class_Spatial_method_is_visible_in_tree>` debe devolver ``true``).
|
|
|
|
Descripciones de Métodos
|
|
------------------------------------------------
|
|
|
|
.. _class_Spatial_method_force_update_transform:
|
|
|
|
- void **force_update_transform** **(** **)**
|
|
|
|
Obliga a la transformación a actualizarse. Los cambios en la física de las transformaciones no son instantáneos por razones de rendimiento. Las transformaciones se acumulan y luego se fijan. Usa esto si necesitas una transformación actualizada cuando hagas operaciones de física.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_get_parent_spatial:
|
|
|
|
- :ref:`Spatial<class_Spatial>` **get_parent_spatial** **(** **)** |const|
|
|
|
|
Returns the parent ``Spatial``, or an empty :ref:`Object<class_Object>` if no parent exists or parent is not of type ``Spatial``.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_get_world:
|
|
|
|
- :ref:`World<class_World>` **get_world** **(** **)** |const|
|
|
|
|
Returns the current :ref:`World<class_World>` resource this ``Spatial`` node is registered to.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_global_rotate:
|
|
|
|
- void **global_rotate** **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)**
|
|
|
|
Gira la transformación global (del mundo) alrededor del eje, una unidad :ref:`Vector3<class_Vector3>`, por un ángulo especificado en radianes. El eje de rotación está en el sistema de coordenadas globales.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_global_scale:
|
|
|
|
- void **global_scale** **(** :ref:`Vector3<class_Vector3>` scale **)**
|
|
|
|
Escala la transformación global (del mundo) por los factores de escala :ref:`Vector3<class_Vector3>` dados.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_global_translate:
|
|
|
|
- void **global_translate** **(** :ref:`Vector3<class_Vector3>` offset **)**
|
|
|
|
Mueve la transformación global (del mundo) por el desplazamiento del :ref:`Vector3<class_Vector3>`. El desplazamiento está en el sistema de coordenadas globales.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_hide:
|
|
|
|
- void **hide** **(** **)**
|
|
|
|
Desactiva la representación de este nodo. Cambia :ref:`visible<class_Spatial_property_visible>` por ``false``.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_is_local_transform_notification_enabled:
|
|
|
|
- :ref:`bool<class_bool>` **is_local_transform_notification_enabled** **(** **)** |const|
|
|
|
|
Returns whether node notifies about its local transformation changes. ``Spatial`` will not propagate this by default.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_is_scale_disabled:
|
|
|
|
- :ref:`bool<class_bool>` **is_scale_disabled** **(** **)** |const|
|
|
|
|
Devuelve si este nodo utiliza una escala de ``(1, 1, 1)`` o su escala de transformación local.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_is_set_as_toplevel:
|
|
|
|
- :ref:`bool<class_bool>` **is_set_as_toplevel** **(** **)** |const|
|
|
|
|
Devuelve si este nodo se establece como Toplevel, es decir, si ignora las transformaciones de sus nodos padres.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_is_transform_notification_enabled:
|
|
|
|
- :ref:`bool<class_bool>` **is_transform_notification_enabled** **(** **)** |const|
|
|
|
|
Returns whether the node notifies about its global and local transformation changes. ``Spatial`` will not propagate this by default.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_is_visible_in_tree:
|
|
|
|
- :ref:`bool<class_bool>` **is_visible_in_tree** **(** **)** |const|
|
|
|
|
Devuelve ``true`` si el nodo está presente en el :ref:`SceneTree<class_SceneTree>`, su propiedad :ref:`visible<class_Spatial_property_visible>` es ``true`` y todos sus antecedentes también son visibles. Si algún antecedente está oculto, este nodo no será visible en el árbol de la escena.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_look_at:
|
|
|
|
- void **look_at** **(** :ref:`Vector3<class_Vector3>` target, :ref:`Vector3<class_Vector3>` up **)**
|
|
|
|
Se rota a sí mismo para que el eje -Z local apunte hacia la posición del ``target``.
|
|
|
|
La transformación girará primero alrededor del vector ``up`` dado, y luego se alineará completamente con el objetivo mediante una nueva rotación alrededor de un eje perpendicular tanto al vector ``target`` como al ``up``.
|
|
|
|
Las operaciones tienen lugar en el espacio global.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_look_at_from_position:
|
|
|
|
- void **look_at_from_position** **(** :ref:`Vector3<class_Vector3>` position, :ref:`Vector3<class_Vector3>` target, :ref:`Vector3<class_Vector3>` up **)**
|
|
|
|
Mueve el nodo a la posición ``position`` especificada, y luego se rota para apuntar hacia el ``target`` según el :ref:`look_at<class_Spatial_method_look_at>`. Las operaciones tienen lugar en el espacio global.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_orthonormalize:
|
|
|
|
- void **orthonormalize** **(** **)**
|
|
|
|
Restablece las transformaciones de este nodo (como escala, sesgo y conicidad) preservando su rotación y traslación al realizar la ortonormalización de Gram-Schmidt en la :ref:`Transform<class_Transform>` de este nodo.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_rotate:
|
|
|
|
- void **rotate** **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)**
|
|
|
|
Gira la transformación local alrededor del eje, una unidad :ref:`Vector3<class_Vector3>`, por un ángulo especificado en radianes.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_rotate_object_local:
|
|
|
|
- void **rotate_object_local** **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)**
|
|
|
|
Gira la transformación local alrededor del eje, una unidad :ref:`Vector3<class_Vector3>`, por un ángulo especificado en radianes. El eje de rotación está en el sistema de coordenadas locales del objeto.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_rotate_x:
|
|
|
|
- void **rotate_x** **(** :ref:`float<class_float>` angle **)**
|
|
|
|
Gira la transformación local alrededor del eje X por el ángulo en radianes.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_rotate_y:
|
|
|
|
- void **rotate_y** **(** :ref:`float<class_float>` angle **)**
|
|
|
|
Gira la transformación local alrededor del eje Y por el ángulo en radianes.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_rotate_z:
|
|
|
|
- void **rotate_z** **(** :ref:`float<class_float>` angle **)**
|
|
|
|
Gira la transformación local alrededor del eje Z por el ángulo en radianes.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_scale_object_local:
|
|
|
|
- void **scale_object_local** **(** :ref:`Vector3<class_Vector3>` scale **)**
|
|
|
|
Escala la transformación local mediante factores de escala tridimensionales dados en el sistema de coordenadas objeto-local.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_set_as_toplevel:
|
|
|
|
- void **set_as_toplevel** **(** :ref:`bool<class_bool>` enable **)**
|
|
|
|
Hace que el nodo ignore las transformaciones de sus padres. Las transformaciones del nodo sólo se dan en el espacio global.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_set_disable_scale:
|
|
|
|
- void **set_disable_scale** **(** :ref:`bool<class_bool>` disable **)**
|
|
|
|
Establece si el nodo utiliza una escala de ``(1, 1, 1)`` o su escala de transformación local. Los cambios en la escala de transformación local se conservan.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_set_identity:
|
|
|
|
- void **set_identity** **(** **)**
|
|
|
|
Reinicia todas las transformaciones para este nodo (establece su :ref:`Transform<class_Transform>` a la matriz de identidad).
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_set_ignore_transform_notification:
|
|
|
|
- void **set_ignore_transform_notification** **(** :ref:`bool<class_bool>` enabled **)**
|
|
|
|
Establece si el nodo ignora la notificación de que su transformación (global o local) ha cambiado.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_set_notify_local_transform:
|
|
|
|
- void **set_notify_local_transform** **(** :ref:`bool<class_bool>` enable **)**
|
|
|
|
Sets whether the node notifies about its local transformation changes. ``Spatial`` will not propagate this by default.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_set_notify_transform:
|
|
|
|
- void **set_notify_transform** **(** :ref:`bool<class_bool>` enable **)**
|
|
|
|
Sets whether the node notifies about its global and local transformation changes. ``Spatial`` will not propagate this by default, unless it is in the editor context and it has a valid gizmo.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_show:
|
|
|
|
- void **show** **(** **)**
|
|
|
|
Permite la representación de este nodo. Cambia :ref:`visible<class_Spatial_property_visible>` a ``true``.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_to_global:
|
|
|
|
- :ref:`Vector3<class_Vector3>` **to_global** **(** :ref:`Vector3<class_Vector3>` local_point **)** |const|
|
|
|
|
Transforma ``local_point`` del espacio local de este nodo al espacio mundial.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_to_local:
|
|
|
|
- :ref:`Vector3<class_Vector3>` **to_local** **(** :ref:`Vector3<class_Vector3>` global_point **)** |const|
|
|
|
|
Transforma ``global_point`` del espacio mundial al espacio local de este nodo.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_translate:
|
|
|
|
- void **translate** **(** :ref:`Vector3<class_Vector3>` offset **)**
|
|
|
|
Cambia la posición del nodo por el desplazamiento dado :ref:`Vector3<class_Vector3>`.
|
|
|
|
Observe que la traslación ``offset`` se ve afectada por la escala del nodo, de modo que si se escalara por ejemplo por ``(10, 1, 1)``, una traslación por un offset de ``(2, 0, 0)`` añadiría en realidad 20 (``2 * 10``) a la coordenada X.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_translate_object_local:
|
|
|
|
- void **translate_object_local** **(** :ref:`Vector3<class_Vector3>` offset **)**
|
|
|
|
Cambia la posición del nodo por el desplazamiento dado :ref:`Vector3<class_Vector3>` en el espacio local.
|
|
|
|
----
|
|
|
|
.. _class_Spatial_method_update_gizmo:
|
|
|
|
- void **update_gizmo** **(** **)**
|
|
|
|
Updates the :ref:`SpatialGizmo<class_SpatialGizmo>` of this node.
|
|
|
|
.. |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.)`
|