class_node3d.rst 76 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120
  1. :github_url: hide
  2. .. meta::
  3. :keywords: spatial
  4. .. DO NOT EDIT THIS FILE!!!
  5. .. Generated automatically from Godot engine sources.
  6. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  7. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Node3D.xml.
  8. .. _class_Node3D:
  9. Node3D
  10. ======
  11. **Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  12. **Inherited By:** :ref:`AudioListener3D<class_AudioListener3D>`, :ref:`AudioStreamPlayer3D<class_AudioStreamPlayer3D>`, :ref:`BoneAttachment3D<class_BoneAttachment3D>`, :ref:`Camera3D<class_Camera3D>`, :ref:`CollisionObject3D<class_CollisionObject3D>`, :ref:`CollisionPolygon3D<class_CollisionPolygon3D>`, :ref:`CollisionShape3D<class_CollisionShape3D>`, :ref:`GridMap<class_GridMap>`, :ref:`ImporterMeshInstance3D<class_ImporterMeshInstance3D>`, :ref:`Joint3D<class_Joint3D>`, :ref:`LightmapProbe<class_LightmapProbe>`, :ref:`Marker3D<class_Marker3D>`, :ref:`NavigationLink3D<class_NavigationLink3D>`, :ref:`NavigationObstacle3D<class_NavigationObstacle3D>`, :ref:`NavigationRegion3D<class_NavigationRegion3D>`, :ref:`OpenXRCompositionLayer<class_OpenXRCompositionLayer>`, :ref:`OpenXRHand<class_OpenXRHand>`, :ref:`OpenXRRenderModel<class_OpenXRRenderModel>`, :ref:`OpenXRRenderModelManager<class_OpenXRRenderModelManager>`, :ref:`Path3D<class_Path3D>`, :ref:`PathFollow3D<class_PathFollow3D>`, :ref:`RayCast3D<class_RayCast3D>`, :ref:`RemoteTransform3D<class_RemoteTransform3D>`, :ref:`ShapeCast3D<class_ShapeCast3D>`, :ref:`Skeleton3D<class_Skeleton3D>`, :ref:`SkeletonModifier3D<class_SkeletonModifier3D>`, :ref:`SpringArm3D<class_SpringArm3D>`, :ref:`SpringBoneCollision3D<class_SpringBoneCollision3D>`, :ref:`VehicleWheel3D<class_VehicleWheel3D>`, :ref:`VisualInstance3D<class_VisualInstance3D>`, :ref:`XRFaceModifier3D<class_XRFaceModifier3D>`, :ref:`XRNode3D<class_XRNode3D>`, :ref:`XROrigin3D<class_XROrigin3D>`
  13. Base object in 3D space, inherited by all 3D nodes.
  14. .. rst-class:: classref-introduction-group
  15. Description
  16. -----------
  17. The **Node3D** node is the base representation of a node in 3D space. All other 3D nodes inherit from this class.
  18. Affine operations (translation, rotation, scale) are calculated in the coordinate system relative to the parent, unless the **Node3D**'s :ref:`top_level<class_Node3D_property_top_level>` is ``true``. In this coordinate system, affine operations correspond to direct affine operations on the **Node3D**'s :ref:`transform<class_Node3D_property_transform>`. The term *parent space* refers to this coordinate system. The coordinate system that is attached to the **Node3D** itself is referred to as object-local coordinate system, or *local space*.
  19. \ **Note:** Unless otherwise specified, all methods that need angle parameters must receive angles in *radians*. To convert degrees to radians, use :ref:`@GlobalScope.deg_to_rad()<class_@GlobalScope_method_deg_to_rad>`.
  20. \ **Note:** In Godot 3 and older, **Node3D** was named *Spatial*.
  21. .. rst-class:: classref-introduction-group
  22. Tutorials
  23. ---------
  24. - :doc:`Introduction to 3D <../tutorials/3d/introduction_to_3d>`
  25. - `All 3D Demos <https://github.com/godotengine/godot-demo-projects/tree/master/3d>`__
  26. .. rst-class:: classref-reftable-group
  27. Properties
  28. ----------
  29. .. table::
  30. :widths: auto
  31. +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+
  32. | :ref:`Basis<class_Basis>` | :ref:`basis<class_Node3D_property_basis>` | |
  33. +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+
  34. | :ref:`Basis<class_Basis>` | :ref:`global_basis<class_Node3D_property_global_basis>` | |
  35. +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+
  36. | :ref:`Vector3<class_Vector3>` | :ref:`global_position<class_Node3D_property_global_position>` | |
  37. +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+
  38. | :ref:`Vector3<class_Vector3>` | :ref:`global_rotation<class_Node3D_property_global_rotation>` | |
  39. +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+
  40. | :ref:`Vector3<class_Vector3>` | :ref:`global_rotation_degrees<class_Node3D_property_global_rotation_degrees>` | |
  41. +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+
  42. | :ref:`Transform3D<class_Transform3D>` | :ref:`global_transform<class_Node3D_property_global_transform>` | |
  43. +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+
  44. | :ref:`Vector3<class_Vector3>` | :ref:`position<class_Node3D_property_position>` | ``Vector3(0, 0, 0)`` |
  45. +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+
  46. | :ref:`Quaternion<class_Quaternion>` | :ref:`quaternion<class_Node3D_property_quaternion>` | |
  47. +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+
  48. | :ref:`Vector3<class_Vector3>` | :ref:`rotation<class_Node3D_property_rotation>` | ``Vector3(0, 0, 0)`` |
  49. +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+
  50. | :ref:`Vector3<class_Vector3>` | :ref:`rotation_degrees<class_Node3D_property_rotation_degrees>` | |
  51. +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+
  52. | :ref:`RotationEditMode<enum_Node3D_RotationEditMode>` | :ref:`rotation_edit_mode<class_Node3D_property_rotation_edit_mode>` | ``0`` |
  53. +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+
  54. | :ref:`EulerOrder<enum_@GlobalScope_EulerOrder>` | :ref:`rotation_order<class_Node3D_property_rotation_order>` | ``2`` |
  55. +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+
  56. | :ref:`Vector3<class_Vector3>` | :ref:`scale<class_Node3D_property_scale>` | ``Vector3(1, 1, 1)`` |
  57. +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+
  58. | :ref:`bool<class_bool>` | :ref:`top_level<class_Node3D_property_top_level>` | ``false`` |
  59. +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+
  60. | :ref:`Transform3D<class_Transform3D>` | :ref:`transform<class_Node3D_property_transform>` | ``Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)`` |
  61. +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+
  62. | :ref:`NodePath<class_NodePath>` | :ref:`visibility_parent<class_Node3D_property_visibility_parent>` | ``NodePath("")`` |
  63. +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+
  64. | :ref:`bool<class_bool>` | :ref:`visible<class_Node3D_property_visible>` | ``true`` |
  65. +-------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+
  66. .. rst-class:: classref-reftable-group
  67. Methods
  68. -------
  69. .. table::
  70. :widths: auto
  71. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | |void| | :ref:`add_gizmo<class_Node3D_method_add_gizmo>`\ (\ gizmo\: :ref:`Node3DGizmo<class_Node3DGizmo>`\ ) |
  73. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | |void| | :ref:`clear_gizmos<class_Node3D_method_clear_gizmos>`\ (\ ) |
  75. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | |void| | :ref:`clear_subgizmo_selection<class_Node3D_method_clear_subgizmo_selection>`\ (\ ) |
  77. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | |void| | :ref:`force_update_transform<class_Node3D_method_force_update_transform>`\ (\ ) |
  79. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`Array<class_Array>`\[:ref:`Node3DGizmo<class_Node3DGizmo>`\] | :ref:`get_gizmos<class_Node3D_method_get_gizmos>`\ (\ ) |const| |
  81. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`Transform3D<class_Transform3D>` | :ref:`get_global_transform_interpolated<class_Node3D_method_get_global_transform_interpolated>`\ (\ ) |
  83. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`Node3D<class_Node3D>` | :ref:`get_parent_node_3d<class_Node3D_method_get_parent_node_3d>`\ (\ ) |const| |
  85. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`World3D<class_World3D>` | :ref:`get_world_3d<class_Node3D_method_get_world_3d>`\ (\ ) |const| |
  87. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | |void| | :ref:`global_rotate<class_Node3D_method_global_rotate>`\ (\ axis\: :ref:`Vector3<class_Vector3>`, angle\: :ref:`float<class_float>`\ ) |
  89. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | |void| | :ref:`global_scale<class_Node3D_method_global_scale>`\ (\ scale\: :ref:`Vector3<class_Vector3>`\ ) |
  91. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | |void| | :ref:`global_translate<class_Node3D_method_global_translate>`\ (\ offset\: :ref:`Vector3<class_Vector3>`\ ) |
  93. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | |void| | :ref:`hide<class_Node3D_method_hide>`\ (\ ) |
  95. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`bool<class_bool>` | :ref:`is_local_transform_notification_enabled<class_Node3D_method_is_local_transform_notification_enabled>`\ (\ ) |const| |
  97. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`bool<class_bool>` | :ref:`is_scale_disabled<class_Node3D_method_is_scale_disabled>`\ (\ ) |const| |
  99. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`bool<class_bool>` | :ref:`is_transform_notification_enabled<class_Node3D_method_is_transform_notification_enabled>`\ (\ ) |const| |
  101. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`bool<class_bool>` | :ref:`is_visible_in_tree<class_Node3D_method_is_visible_in_tree>`\ (\ ) |const| |
  103. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | |void| | :ref:`look_at<class_Node3D_method_look_at>`\ (\ target\: :ref:`Vector3<class_Vector3>`, up\: :ref:`Vector3<class_Vector3>` = Vector3(0, 1, 0), use_model_front\: :ref:`bool<class_bool>` = false\ ) |
  105. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | |void| | :ref:`look_at_from_position<class_Node3D_method_look_at_from_position>`\ (\ position\: :ref:`Vector3<class_Vector3>`, target\: :ref:`Vector3<class_Vector3>`, up\: :ref:`Vector3<class_Vector3>` = Vector3(0, 1, 0), use_model_front\: :ref:`bool<class_bool>` = false\ ) |
  107. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | |void| | :ref:`orthonormalize<class_Node3D_method_orthonormalize>`\ (\ ) |
  109. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | |void| | :ref:`rotate<class_Node3D_method_rotate>`\ (\ axis\: :ref:`Vector3<class_Vector3>`, angle\: :ref:`float<class_float>`\ ) |
  111. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | |void| | :ref:`rotate_object_local<class_Node3D_method_rotate_object_local>`\ (\ axis\: :ref:`Vector3<class_Vector3>`, angle\: :ref:`float<class_float>`\ ) |
  113. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | |void| | :ref:`rotate_x<class_Node3D_method_rotate_x>`\ (\ angle\: :ref:`float<class_float>`\ ) |
  115. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | |void| | :ref:`rotate_y<class_Node3D_method_rotate_y>`\ (\ angle\: :ref:`float<class_float>`\ ) |
  117. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | |void| | :ref:`rotate_z<class_Node3D_method_rotate_z>`\ (\ angle\: :ref:`float<class_float>`\ ) |
  119. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | |void| | :ref:`scale_object_local<class_Node3D_method_scale_object_local>`\ (\ scale\: :ref:`Vector3<class_Vector3>`\ ) |
  121. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | |void| | :ref:`set_disable_scale<class_Node3D_method_set_disable_scale>`\ (\ disable\: :ref:`bool<class_bool>`\ ) |
  123. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | |void| | :ref:`set_identity<class_Node3D_method_set_identity>`\ (\ ) |
  125. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | |void| | :ref:`set_ignore_transform_notification<class_Node3D_method_set_ignore_transform_notification>`\ (\ enabled\: :ref:`bool<class_bool>`\ ) |
  127. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | |void| | :ref:`set_notify_local_transform<class_Node3D_method_set_notify_local_transform>`\ (\ enable\: :ref:`bool<class_bool>`\ ) |
  129. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | |void| | :ref:`set_notify_transform<class_Node3D_method_set_notify_transform>`\ (\ enable\: :ref:`bool<class_bool>`\ ) |
  131. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | |void| | :ref:`set_subgizmo_selection<class_Node3D_method_set_subgizmo_selection>`\ (\ gizmo\: :ref:`Node3DGizmo<class_Node3DGizmo>`, id\: :ref:`int<class_int>`, transform\: :ref:`Transform3D<class_Transform3D>`\ ) |
  133. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | |void| | :ref:`show<class_Node3D_method_show>`\ (\ ) |
  135. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | :ref:`Vector3<class_Vector3>` | :ref:`to_global<class_Node3D_method_to_global>`\ (\ local_point\: :ref:`Vector3<class_Vector3>`\ ) |const| |
  137. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | :ref:`Vector3<class_Vector3>` | :ref:`to_local<class_Node3D_method_to_local>`\ (\ global_point\: :ref:`Vector3<class_Vector3>`\ ) |const| |
  139. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | |void| | :ref:`translate<class_Node3D_method_translate>`\ (\ offset\: :ref:`Vector3<class_Vector3>`\ ) |
  141. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | |void| | :ref:`translate_object_local<class_Node3D_method_translate_object_local>`\ (\ offset\: :ref:`Vector3<class_Vector3>`\ ) |
  143. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | |void| | :ref:`update_gizmos<class_Node3D_method_update_gizmos>`\ (\ ) |
  145. +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. .. rst-class:: classref-section-separator
  147. ----
  148. .. rst-class:: classref-descriptions-group
  149. Signals
  150. -------
  151. .. _class_Node3D_signal_visibility_changed:
  152. .. rst-class:: classref-signal
  153. **visibility_changed**\ (\ ) :ref:`🔗<class_Node3D_signal_visibility_changed>`
  154. Emitted when this node's visibility changes (see :ref:`visible<class_Node3D_property_visible>` and :ref:`is_visible_in_tree()<class_Node3D_method_is_visible_in_tree>`).
  155. This signal is emitted *after* the related :ref:`NOTIFICATION_VISIBILITY_CHANGED<class_Node3D_constant_NOTIFICATION_VISIBILITY_CHANGED>` notification.
  156. .. rst-class:: classref-section-separator
  157. ----
  158. .. rst-class:: classref-descriptions-group
  159. Enumerations
  160. ------------
  161. .. _enum_Node3D_RotationEditMode:
  162. .. rst-class:: classref-enumeration
  163. enum **RotationEditMode**: :ref:`🔗<enum_Node3D_RotationEditMode>`
  164. .. _class_Node3D_constant_ROTATION_EDIT_MODE_EULER:
  165. .. rst-class:: classref-enumeration-constant
  166. :ref:`RotationEditMode<enum_Node3D_RotationEditMode>` **ROTATION_EDIT_MODE_EULER** = ``0``
  167. The rotation is edited using a :ref:`Vector3<class_Vector3>` in `Euler angles <https://en.wikipedia.org/wiki/Euler_angles>`__.
  168. .. _class_Node3D_constant_ROTATION_EDIT_MODE_QUATERNION:
  169. .. rst-class:: classref-enumeration-constant
  170. :ref:`RotationEditMode<enum_Node3D_RotationEditMode>` **ROTATION_EDIT_MODE_QUATERNION** = ``1``
  171. The rotation is edited using a :ref:`Quaternion<class_Quaternion>`.
  172. .. _class_Node3D_constant_ROTATION_EDIT_MODE_BASIS:
  173. .. rst-class:: classref-enumeration-constant
  174. :ref:`RotationEditMode<enum_Node3D_RotationEditMode>` **ROTATION_EDIT_MODE_BASIS** = ``2``
  175. The rotation is edited using a :ref:`Basis<class_Basis>`. In this mode, the raw :ref:`basis<class_Node3D_property_basis>`'s axes can be freely modified, but the :ref:`scale<class_Node3D_property_scale>` property is not available.
  176. .. rst-class:: classref-section-separator
  177. ----
  178. .. rst-class:: classref-descriptions-group
  179. Constants
  180. ---------
  181. .. _class_Node3D_constant_NOTIFICATION_TRANSFORM_CHANGED:
  182. .. rst-class:: classref-constant
  183. **NOTIFICATION_TRANSFORM_CHANGED** = ``2000`` :ref:`🔗<class_Node3D_constant_NOTIFICATION_TRANSFORM_CHANGED>`
  184. Notification received when this node's :ref:`global_transform<class_Node3D_property_global_transform>` changes, if :ref:`is_transform_notification_enabled()<class_Node3D_method_is_transform_notification_enabled>` is ``true``. See also :ref:`set_notify_transform()<class_Node3D_method_set_notify_transform>`.
  185. \ **Note:** Most 3D nodes such as :ref:`VisualInstance3D<class_VisualInstance3D>` or :ref:`CollisionObject3D<class_CollisionObject3D>` automatically enable this to function correctly.
  186. \ **Note:** In the editor, nodes will propagate this notification to their children if a gizmo is attached (see :ref:`add_gizmo()<class_Node3D_method_add_gizmo>`).
  187. .. _class_Node3D_constant_NOTIFICATION_ENTER_WORLD:
  188. .. rst-class:: classref-constant
  189. **NOTIFICATION_ENTER_WORLD** = ``41`` :ref:`🔗<class_Node3D_constant_NOTIFICATION_ENTER_WORLD>`
  190. Notification received when this node is registered to a new :ref:`World3D<class_World3D>` (see :ref:`get_world_3d()<class_Node3D_method_get_world_3d>`).
  191. .. _class_Node3D_constant_NOTIFICATION_EXIT_WORLD:
  192. .. rst-class:: classref-constant
  193. **NOTIFICATION_EXIT_WORLD** = ``42`` :ref:`🔗<class_Node3D_constant_NOTIFICATION_EXIT_WORLD>`
  194. Notification received when this node is unregistered from the current :ref:`World3D<class_World3D>` (see :ref:`get_world_3d()<class_Node3D_method_get_world_3d>`).
  195. This notification is sent in reversed order.
  196. .. _class_Node3D_constant_NOTIFICATION_VISIBILITY_CHANGED:
  197. .. rst-class:: classref-constant
  198. **NOTIFICATION_VISIBILITY_CHANGED** = ``43`` :ref:`🔗<class_Node3D_constant_NOTIFICATION_VISIBILITY_CHANGED>`
  199. Notification received when this node's visibility changes (see :ref:`visible<class_Node3D_property_visible>` and :ref:`is_visible_in_tree()<class_Node3D_method_is_visible_in_tree>`).
  200. This notification is received *before* the related :ref:`visibility_changed<class_Node3D_signal_visibility_changed>` signal.
  201. .. _class_Node3D_constant_NOTIFICATION_LOCAL_TRANSFORM_CHANGED:
  202. .. rst-class:: classref-constant
  203. **NOTIFICATION_LOCAL_TRANSFORM_CHANGED** = ``44`` :ref:`🔗<class_Node3D_constant_NOTIFICATION_LOCAL_TRANSFORM_CHANGED>`
  204. Notification received when this node's :ref:`transform<class_Node3D_property_transform>` changes, if :ref:`is_local_transform_notification_enabled()<class_Node3D_method_is_local_transform_notification_enabled>` is ``true``. This is not received when a parent **Node3D**'s :ref:`transform<class_Node3D_property_transform>` changes. See also :ref:`set_notify_local_transform()<class_Node3D_method_set_notify_local_transform>`.
  205. \ **Note:** Some 3D nodes such as :ref:`CSGShape3D<class_CSGShape3D>` or :ref:`CollisionShape3D<class_CollisionShape3D>` automatically enable this to function correctly.
  206. .. rst-class:: classref-section-separator
  207. ----
  208. .. rst-class:: classref-descriptions-group
  209. Property Descriptions
  210. ---------------------
  211. .. _class_Node3D_property_basis:
  212. .. rst-class:: classref-property
  213. :ref:`Basis<class_Basis>` **basis** :ref:`🔗<class_Node3D_property_basis>`
  214. .. rst-class:: classref-property-setget
  215. - |void| **set_basis**\ (\ value\: :ref:`Basis<class_Basis>`\ )
  216. - :ref:`Basis<class_Basis>` **get_basis**\ (\ )
  217. Basis of the :ref:`transform<class_Node3D_property_transform>` property. Represents the rotation, scale, and shear of this node in parent space (relative to the parent node).
  218. .. rst-class:: classref-item-separator
  219. ----
  220. .. _class_Node3D_property_global_basis:
  221. .. rst-class:: classref-property
  222. :ref:`Basis<class_Basis>` **global_basis** :ref:`🔗<class_Node3D_property_global_basis>`
  223. .. rst-class:: classref-property-setget
  224. - |void| **set_global_basis**\ (\ value\: :ref:`Basis<class_Basis>`\ )
  225. - :ref:`Basis<class_Basis>` **get_global_basis**\ (\ )
  226. Basis of the :ref:`global_transform<class_Node3D_property_global_transform>` property. Represents the rotation, scale, and shear of this node in global space (relative to the world).
  227. \ **Note:** If the node is not inside the tree, getting this property fails and returns :ref:`Basis.IDENTITY<class_Basis_constant_IDENTITY>`.
  228. .. rst-class:: classref-item-separator
  229. ----
  230. .. _class_Node3D_property_global_position:
  231. .. rst-class:: classref-property
  232. :ref:`Vector3<class_Vector3>` **global_position** :ref:`🔗<class_Node3D_property_global_position>`
  233. .. rst-class:: classref-property-setget
  234. - |void| **set_global_position**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
  235. - :ref:`Vector3<class_Vector3>` **get_global_position**\ (\ )
  236. Global position (translation) of this node in global space (relative to the world). This is equivalent to the :ref:`global_transform<class_Node3D_property_global_transform>`'s :ref:`Transform3D.origin<class_Transform3D_property_origin>`.
  237. \ **Note:** If the node is not inside the tree, getting this property fails and returns :ref:`Vector3.ZERO<class_Vector3_constant_ZERO>`.
  238. .. rst-class:: classref-item-separator
  239. ----
  240. .. _class_Node3D_property_global_rotation:
  241. .. rst-class:: classref-property
  242. :ref:`Vector3<class_Vector3>` **global_rotation** :ref:`🔗<class_Node3D_property_global_rotation>`
  243. .. rst-class:: classref-property-setget
  244. - |void| **set_global_rotation**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
  245. - :ref:`Vector3<class_Vector3>` **get_global_rotation**\ (\ )
  246. Global rotation of this node as `Euler angles <https://en.wikipedia.org/wiki/Euler_angles>`__, in radians and in global space (relative to the world). This value is obtained from :ref:`global_basis<class_Node3D_property_global_basis>`'s rotation.
  247. - The :ref:`Vector3.x<class_Vector3_property_x>` is the angle around the global X axis (pitch);
  248. - The :ref:`Vector3.y<class_Vector3_property_y>` is the angle around the global Y axis (yaw);
  249. - The :ref:`Vector3.z<class_Vector3_property_z>` is the angle around the global Z axis (roll).
  250. \ **Note:** Unlike :ref:`rotation<class_Node3D_property_rotation>`, this property always follows the YXZ convention (:ref:`@GlobalScope.EULER_ORDER_YXZ<class_@GlobalScope_constant_EULER_ORDER_YXZ>`).
  251. \ **Note:** If the node is not inside the tree, getting this property fails and returns :ref:`Vector3.ZERO<class_Vector3_constant_ZERO>`.
  252. .. rst-class:: classref-item-separator
  253. ----
  254. .. _class_Node3D_property_global_rotation_degrees:
  255. .. rst-class:: classref-property
  256. :ref:`Vector3<class_Vector3>` **global_rotation_degrees** :ref:`🔗<class_Node3D_property_global_rotation_degrees>`
  257. .. rst-class:: classref-property-setget
  258. - |void| **set_global_rotation_degrees**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
  259. - :ref:`Vector3<class_Vector3>` **get_global_rotation_degrees**\ (\ )
  260. The :ref:`global_rotation<class_Node3D_property_global_rotation>` of this node, in degrees instead of radians.
  261. \ **Note:** If the node is not inside the tree, getting this property fails and returns :ref:`Vector3.ZERO<class_Vector3_constant_ZERO>`.
  262. .. rst-class:: classref-item-separator
  263. ----
  264. .. _class_Node3D_property_global_transform:
  265. .. rst-class:: classref-property
  266. :ref:`Transform3D<class_Transform3D>` **global_transform** :ref:`🔗<class_Node3D_property_global_transform>`
  267. .. rst-class:: classref-property-setget
  268. - |void| **set_global_transform**\ (\ value\: :ref:`Transform3D<class_Transform3D>`\ )
  269. - :ref:`Transform3D<class_Transform3D>` **get_global_transform**\ (\ )
  270. The transformation of this node, in global space (relative to the world). Contains and represents this node's :ref:`global_position<class_Node3D_property_global_position>`, :ref:`global_rotation<class_Node3D_property_global_rotation>`, and global scale.
  271. \ **Note:** If the node is not inside the tree, getting this property fails and returns :ref:`Transform3D.IDENTITY<class_Transform3D_constant_IDENTITY>`.
  272. .. rst-class:: classref-item-separator
  273. ----
  274. .. _class_Node3D_property_position:
  275. .. rst-class:: classref-property
  276. :ref:`Vector3<class_Vector3>` **position** = ``Vector3(0, 0, 0)`` :ref:`🔗<class_Node3D_property_position>`
  277. .. rst-class:: classref-property-setget
  278. - |void| **set_position**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
  279. - :ref:`Vector3<class_Vector3>` **get_position**\ (\ )
  280. Position (translation) of this node in parent space (relative to the parent node). This is equivalent to the :ref:`transform<class_Node3D_property_transform>`'s :ref:`Transform3D.origin<class_Transform3D_property_origin>`.
  281. .. rst-class:: classref-item-separator
  282. ----
  283. .. _class_Node3D_property_quaternion:
  284. .. rst-class:: classref-property
  285. :ref:`Quaternion<class_Quaternion>` **quaternion** :ref:`🔗<class_Node3D_property_quaternion>`
  286. .. rst-class:: classref-property-setget
  287. - |void| **set_quaternion**\ (\ value\: :ref:`Quaternion<class_Quaternion>`\ )
  288. - :ref:`Quaternion<class_Quaternion>` **get_quaternion**\ (\ )
  289. Rotation of this node represented as a :ref:`Quaternion<class_Quaternion>` in parent space (relative to the parent node). This value is obtained from :ref:`basis<class_Node3D_property_basis>`'s rotation.
  290. \ **Note:** Quaternions are much more suitable for 3D math but are less intuitive. Setting this property can be useful for interpolation (see :ref:`Quaternion.slerp()<class_Quaternion_method_slerp>`).
  291. .. rst-class:: classref-item-separator
  292. ----
  293. .. _class_Node3D_property_rotation:
  294. .. rst-class:: classref-property
  295. :ref:`Vector3<class_Vector3>` **rotation** = ``Vector3(0, 0, 0)`` :ref:`🔗<class_Node3D_property_rotation>`
  296. .. rst-class:: classref-property-setget
  297. - |void| **set_rotation**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
  298. - :ref:`Vector3<class_Vector3>` **get_rotation**\ (\ )
  299. Rotation of this node as `Euler angles <https://en.wikipedia.org/wiki/Euler_angles>`__, in radians and in parent space (relative to the parent node). This value is obtained from :ref:`basis<class_Node3D_property_basis>`'s rotation.
  300. - The :ref:`Vector3.x<class_Vector3_property_x>` is the angle around the local X axis (pitch);
  301. - The :ref:`Vector3.y<class_Vector3_property_y>` is the angle around the local Y axis (yaw);
  302. - The :ref:`Vector3.z<class_Vector3_property_z>` is the angle around the local Z axis (roll).
  303. The order of each consecutive rotation can be changed with :ref:`rotation_order<class_Node3D_property_rotation_order>` (see :ref:`EulerOrder<enum_@GlobalScope_EulerOrder>` constants). By default, the YXZ convention is used (:ref:`@GlobalScope.EULER_ORDER_YXZ<class_@GlobalScope_constant_EULER_ORDER_YXZ>`).
  304. \ **Note:** This property is edited in degrees in the inspector. If you want to use degrees in a script, use :ref:`rotation_degrees<class_Node3D_property_rotation_degrees>`.
  305. .. rst-class:: classref-item-separator
  306. ----
  307. .. _class_Node3D_property_rotation_degrees:
  308. .. rst-class:: classref-property
  309. :ref:`Vector3<class_Vector3>` **rotation_degrees** :ref:`🔗<class_Node3D_property_rotation_degrees>`
  310. .. rst-class:: classref-property-setget
  311. - |void| **set_rotation_degrees**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
  312. - :ref:`Vector3<class_Vector3>` **get_rotation_degrees**\ (\ )
  313. The :ref:`rotation<class_Node3D_property_rotation>` of this node, in degrees instead of radians.
  314. \ **Note:** This is **not** the property available in the Inspector dock.
  315. .. rst-class:: classref-item-separator
  316. ----
  317. .. _class_Node3D_property_rotation_edit_mode:
  318. .. rst-class:: classref-property
  319. :ref:`RotationEditMode<enum_Node3D_RotationEditMode>` **rotation_edit_mode** = ``0`` :ref:`🔗<class_Node3D_property_rotation_edit_mode>`
  320. .. rst-class:: classref-property-setget
  321. - |void| **set_rotation_edit_mode**\ (\ value\: :ref:`RotationEditMode<enum_Node3D_RotationEditMode>`\ )
  322. - :ref:`RotationEditMode<enum_Node3D_RotationEditMode>` **get_rotation_edit_mode**\ (\ )
  323. How this node's rotation and scale are displayed in the Inspector dock.
  324. .. rst-class:: classref-item-separator
  325. ----
  326. .. _class_Node3D_property_rotation_order:
  327. .. rst-class:: classref-property
  328. :ref:`EulerOrder<enum_@GlobalScope_EulerOrder>` **rotation_order** = ``2`` :ref:`🔗<class_Node3D_property_rotation_order>`
  329. .. rst-class:: classref-property-setget
  330. - |void| **set_rotation_order**\ (\ value\: :ref:`EulerOrder<enum_@GlobalScope_EulerOrder>`\ )
  331. - :ref:`EulerOrder<enum_@GlobalScope_EulerOrder>` **get_rotation_order**\ (\ )
  332. The axis rotation order of the :ref:`rotation<class_Node3D_property_rotation>` property. The final orientation is calculated by rotating around the local X, Y, and Z axis in this order.
  333. .. rst-class:: classref-item-separator
  334. ----
  335. .. _class_Node3D_property_scale:
  336. .. rst-class:: classref-property
  337. :ref:`Vector3<class_Vector3>` **scale** = ``Vector3(1, 1, 1)`` :ref:`🔗<class_Node3D_property_scale>`
  338. .. rst-class:: classref-property-setget
  339. - |void| **set_scale**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
  340. - :ref:`Vector3<class_Vector3>` **get_scale**\ (\ )
  341. Scale of this node in local space (relative to this node). This value is obtained from :ref:`basis<class_Node3D_property_basis>`'s scale.
  342. \ **Note:** The behavior of some 3D node types is not affected by this property. These include :ref:`Light3D<class_Light3D>`, :ref:`Camera3D<class_Camera3D>`, :ref:`AudioStreamPlayer3D<class_AudioStreamPlayer3D>`, and more.
  343. \ **Warning:** The scale's components must either be all positive or all negative, and **not** exactly ``0.0``. Otherwise, it won't be possible to obtain the scale from the :ref:`basis<class_Node3D_property_basis>`. This may cause the intended scale to be lost when reloaded from disk, and potentially other unstable behavior.
  344. .. rst-class:: classref-item-separator
  345. ----
  346. .. _class_Node3D_property_top_level:
  347. .. rst-class:: classref-property
  348. :ref:`bool<class_bool>` **top_level** = ``false`` :ref:`🔗<class_Node3D_property_top_level>`
  349. .. rst-class:: classref-property-setget
  350. - |void| **set_as_top_level**\ (\ value\: :ref:`bool<class_bool>`\ )
  351. - :ref:`bool<class_bool>` **is_set_as_top_level**\ (\ )
  352. If ``true``, the node does not inherit its transformations from its parent. As such, node transformations will only be in global space, which also means that :ref:`global_transform<class_Node3D_property_global_transform>` and :ref:`transform<class_Node3D_property_transform>` will be identical.
  353. .. rst-class:: classref-item-separator
  354. ----
  355. .. _class_Node3D_property_transform:
  356. .. rst-class:: classref-property
  357. :ref:`Transform3D<class_Transform3D>` **transform** = ``Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)`` :ref:`🔗<class_Node3D_property_transform>`
  358. .. rst-class:: classref-property-setget
  359. - |void| **set_transform**\ (\ value\: :ref:`Transform3D<class_Transform3D>`\ )
  360. - :ref:`Transform3D<class_Transform3D>` **get_transform**\ (\ )
  361. The local transformation of this node, in parent space (relative to the parent node). Contains and represents this node's :ref:`position<class_Node3D_property_position>`, :ref:`rotation<class_Node3D_property_rotation>`, and :ref:`scale<class_Node3D_property_scale>`.
  362. .. rst-class:: classref-item-separator
  363. ----
  364. .. _class_Node3D_property_visibility_parent:
  365. .. rst-class:: classref-property
  366. :ref:`NodePath<class_NodePath>` **visibility_parent** = ``NodePath("")`` :ref:`🔗<class_Node3D_property_visibility_parent>`
  367. .. rst-class:: classref-property-setget
  368. - |void| **set_visibility_parent**\ (\ value\: :ref:`NodePath<class_NodePath>`\ )
  369. - :ref:`NodePath<class_NodePath>` **get_visibility_parent**\ (\ )
  370. Path to the visibility range parent for this node and its descendants. The visibility parent must be a :ref:`GeometryInstance3D<class_GeometryInstance3D>`.
  371. Any visual instance will only be visible if the visibility parent (and all of its visibility ancestors) is hidden by being closer to the camera than its own :ref:`GeometryInstance3D.visibility_range_begin<class_GeometryInstance3D_property_visibility_range_begin>`. Nodes hidden via the :ref:`visible<class_Node3D_property_visible>` property are essentially removed from the visibility dependency tree, so dependent instances will not take the hidden node or its descendants into account.
  372. .. rst-class:: classref-item-separator
  373. ----
  374. .. _class_Node3D_property_visible:
  375. .. rst-class:: classref-property
  376. :ref:`bool<class_bool>` **visible** = ``true`` :ref:`🔗<class_Node3D_property_visible>`
  377. .. rst-class:: classref-property-setget
  378. - |void| **set_visible**\ (\ value\: :ref:`bool<class_bool>`\ )
  379. - :ref:`bool<class_bool>` **is_visible**\ (\ )
  380. If ``true``, this node can be visible. The node is only rendered when all of its ancestors are visible, as well. That means :ref:`is_visible_in_tree()<class_Node3D_method_is_visible_in_tree>` must return ``true``.
  381. .. rst-class:: classref-section-separator
  382. ----
  383. .. rst-class:: classref-descriptions-group
  384. Method Descriptions
  385. -------------------
  386. .. _class_Node3D_method_add_gizmo:
  387. .. rst-class:: classref-method
  388. |void| **add_gizmo**\ (\ gizmo\: :ref:`Node3DGizmo<class_Node3DGizmo>`\ ) :ref:`🔗<class_Node3D_method_add_gizmo>`
  389. Attaches the given ``gizmo`` to this node. Only works in the editor.
  390. \ **Note:** ``gizmo`` should be an :ref:`EditorNode3DGizmo<class_EditorNode3DGizmo>`. The argument type is :ref:`Node3DGizmo<class_Node3DGizmo>` to avoid depending on editor classes in **Node3D**.
  391. .. rst-class:: classref-item-separator
  392. ----
  393. .. _class_Node3D_method_clear_gizmos:
  394. .. rst-class:: classref-method
  395. |void| **clear_gizmos**\ (\ ) :ref:`🔗<class_Node3D_method_clear_gizmos>`
  396. Clears all :ref:`EditorNode3DGizmo<class_EditorNode3DGizmo>` objects attached to this node. Only works in the editor.
  397. .. rst-class:: classref-item-separator
  398. ----
  399. .. _class_Node3D_method_clear_subgizmo_selection:
  400. .. rst-class:: classref-method
  401. |void| **clear_subgizmo_selection**\ (\ ) :ref:`🔗<class_Node3D_method_clear_subgizmo_selection>`
  402. Deselects all subgizmos for this node. Useful to call when the selected subgizmo may no longer exist after a property change. Only works in the editor.
  403. .. rst-class:: classref-item-separator
  404. ----
  405. .. _class_Node3D_method_force_update_transform:
  406. .. rst-class:: classref-method
  407. |void| **force_update_transform**\ (\ ) :ref:`🔗<class_Node3D_method_force_update_transform>`
  408. Forces the node's :ref:`global_transform<class_Node3D_property_global_transform>` to update, by sending :ref:`NOTIFICATION_TRANSFORM_CHANGED<class_Node3D_constant_NOTIFICATION_TRANSFORM_CHANGED>`. Fails if the node is not inside the tree.
  409. \ **Note:** For performance reasons, transform changes are usually accumulated and applied *once* at the end of the frame. The update propagates through **Node3D** children, as well. Therefore, use this method only when you need an up-to-date transform (such as during physics operations).
  410. .. rst-class:: classref-item-separator
  411. ----
  412. .. _class_Node3D_method_get_gizmos:
  413. .. rst-class:: classref-method
  414. :ref:`Array<class_Array>`\[:ref:`Node3DGizmo<class_Node3DGizmo>`\] **get_gizmos**\ (\ ) |const| :ref:`🔗<class_Node3D_method_get_gizmos>`
  415. Returns all the :ref:`EditorNode3DGizmo<class_EditorNode3DGizmo>` objects attached to this node. Only works in the editor.
  416. .. rst-class:: classref-item-separator
  417. ----
  418. .. _class_Node3D_method_get_global_transform_interpolated:
  419. .. rst-class:: classref-method
  420. :ref:`Transform3D<class_Transform3D>` **get_global_transform_interpolated**\ (\ ) :ref:`🔗<class_Node3D_method_get_global_transform_interpolated>`
  421. When using physics interpolation, there will be circumstances in which you want to know the interpolated (displayed) transform of a node rather than the standard transform (which may only be accurate to the most recent physics tick).
  422. This is particularly important for frame-based operations that take place in :ref:`Node._process()<class_Node_private_method__process>`, rather than :ref:`Node._physics_process()<class_Node_private_method__physics_process>`. Examples include :ref:`Camera3D<class_Camera3D>`\ s focusing on a node, or finding where to fire lasers from on a frame rather than physics tick.
  423. \ **Note:** This function creates an interpolation pump on the **Node3D** the first time it is called, which can respond to physics interpolation resets. If you get problems with "streaking" when initially following a **Node3D**, be sure to call :ref:`get_global_transform_interpolated()<class_Node3D_method_get_global_transform_interpolated>` at least once *before* resetting the **Node3D** physics interpolation.
  424. .. rst-class:: classref-item-separator
  425. ----
  426. .. _class_Node3D_method_get_parent_node_3d:
  427. .. rst-class:: classref-method
  428. :ref:`Node3D<class_Node3D>` **get_parent_node_3d**\ (\ ) |const| :ref:`🔗<class_Node3D_method_get_parent_node_3d>`
  429. Returns the parent **Node3D** that directly affects this node's :ref:`global_transform<class_Node3D_property_global_transform>`. Returns ``null`` if no parent exists, the parent is not a **Node3D**, or :ref:`top_level<class_Node3D_property_top_level>` is ``true``.
  430. \ **Note:** This method is not always equivalent to :ref:`Node.get_parent()<class_Node_method_get_parent>`, which does not take :ref:`top_level<class_Node3D_property_top_level>` into account.
  431. .. rst-class:: classref-item-separator
  432. ----
  433. .. _class_Node3D_method_get_world_3d:
  434. .. rst-class:: classref-method
  435. :ref:`World3D<class_World3D>` **get_world_3d**\ (\ ) |const| :ref:`🔗<class_Node3D_method_get_world_3d>`
  436. Returns the :ref:`World3D<class_World3D>` this node is registered to.
  437. Usually, this is the same as the world used by this node's viewport (see :ref:`Node.get_viewport()<class_Node_method_get_viewport>` and :ref:`Viewport.find_world_3d()<class_Viewport_method_find_world_3d>`).
  438. .. rst-class:: classref-item-separator
  439. ----
  440. .. _class_Node3D_method_global_rotate:
  441. .. rst-class:: classref-method
  442. |void| **global_rotate**\ (\ axis\: :ref:`Vector3<class_Vector3>`, angle\: :ref:`float<class_float>`\ ) :ref:`🔗<class_Node3D_method_global_rotate>`
  443. Rotates this node's :ref:`global_basis<class_Node3D_property_global_basis>` around the global ``axis`` by the given ``angle``, in radians. This operation is calculated in global space (relative to the world) and preserves the :ref:`global_position<class_Node3D_property_global_position>`.
  444. .. rst-class:: classref-item-separator
  445. ----
  446. .. _class_Node3D_method_global_scale:
  447. .. rst-class:: classref-method
  448. |void| **global_scale**\ (\ scale\: :ref:`Vector3<class_Vector3>`\ ) :ref:`🔗<class_Node3D_method_global_scale>`
  449. Scales this node's :ref:`global_basis<class_Node3D_property_global_basis>` by the given ``scale`` factor. This operation is calculated in global space (relative to the world) and preserves the :ref:`global_position<class_Node3D_property_global_position>`.
  450. \ **Note:** This method is not to be confused with the :ref:`scale<class_Node3D_property_scale>` property.
  451. .. rst-class:: classref-item-separator
  452. ----
  453. .. _class_Node3D_method_global_translate:
  454. .. rst-class:: classref-method
  455. |void| **global_translate**\ (\ offset\: :ref:`Vector3<class_Vector3>`\ ) :ref:`🔗<class_Node3D_method_global_translate>`
  456. Adds the given translation ``offset`` to the node's :ref:`global_position<class_Node3D_property_global_position>` in global space (relative to the world).
  457. .. rst-class:: classref-item-separator
  458. ----
  459. .. _class_Node3D_method_hide:
  460. .. rst-class:: classref-method
  461. |void| **hide**\ (\ ) :ref:`🔗<class_Node3D_method_hide>`
  462. Prevents this node from being rendered. Equivalent to setting :ref:`visible<class_Node3D_property_visible>` to ``false``. This is the opposite of :ref:`show()<class_Node3D_method_show>`.
  463. .. rst-class:: classref-item-separator
  464. ----
  465. .. _class_Node3D_method_is_local_transform_notification_enabled:
  466. .. rst-class:: classref-method
  467. :ref:`bool<class_bool>` **is_local_transform_notification_enabled**\ (\ ) |const| :ref:`🔗<class_Node3D_method_is_local_transform_notification_enabled>`
  468. Returns ``true`` if the node receives :ref:`NOTIFICATION_LOCAL_TRANSFORM_CHANGED<class_Node3D_constant_NOTIFICATION_LOCAL_TRANSFORM_CHANGED>` whenever :ref:`transform<class_Node3D_property_transform>` changes. This is enabled with :ref:`set_notify_local_transform()<class_Node3D_method_set_notify_local_transform>`.
  469. .. rst-class:: classref-item-separator
  470. ----
  471. .. _class_Node3D_method_is_scale_disabled:
  472. .. rst-class:: classref-method
  473. :ref:`bool<class_bool>` **is_scale_disabled**\ (\ ) |const| :ref:`🔗<class_Node3D_method_is_scale_disabled>`
  474. Returns ``true`` if this node's :ref:`global_transform<class_Node3D_property_global_transform>` is automatically orthonormalized. This results in this node not appearing distorted, as if its global scale were set to :ref:`Vector3.ONE<class_Vector3_constant_ONE>` (or its negative counterpart). See also :ref:`set_disable_scale()<class_Node3D_method_set_disable_scale>` and :ref:`orthonormalize()<class_Node3D_method_orthonormalize>`.
  475. \ **Note:** :ref:`transform<class_Node3D_property_transform>` is not affected by this setting.
  476. .. rst-class:: classref-item-separator
  477. ----
  478. .. _class_Node3D_method_is_transform_notification_enabled:
  479. .. rst-class:: classref-method
  480. :ref:`bool<class_bool>` **is_transform_notification_enabled**\ (\ ) |const| :ref:`🔗<class_Node3D_method_is_transform_notification_enabled>`
  481. Returns ``true`` if the node receives :ref:`NOTIFICATION_TRANSFORM_CHANGED<class_Node3D_constant_NOTIFICATION_TRANSFORM_CHANGED>` whenever :ref:`global_transform<class_Node3D_property_global_transform>` changes. This is enabled with :ref:`set_notify_transform()<class_Node3D_method_set_notify_transform>`.
  482. .. rst-class:: classref-item-separator
  483. ----
  484. .. _class_Node3D_method_is_visible_in_tree:
  485. .. rst-class:: classref-method
  486. :ref:`bool<class_bool>` **is_visible_in_tree**\ (\ ) |const| :ref:`🔗<class_Node3D_method_is_visible_in_tree>`
  487. Returns ``true`` if this node is inside the scene tree and the :ref:`visible<class_Node3D_property_visible>` property is ``true`` for this node and all of its **Node3D** ancestors *in sequence*. An ancestor of any other type (such as :ref:`Node<class_Node>` or :ref:`Node2D<class_Node2D>`) breaks the sequence. See also :ref:`Node.get_parent()<class_Node_method_get_parent>`.
  488. \ **Note:** This method cannot take :ref:`VisualInstance3D.layers<class_VisualInstance3D_property_layers>` into account, so even if this method returns ``true``, the node may not be rendered.
  489. .. rst-class:: classref-item-separator
  490. ----
  491. .. _class_Node3D_method_look_at:
  492. .. rst-class:: classref-method
  493. |void| **look_at**\ (\ target\: :ref:`Vector3<class_Vector3>`, up\: :ref:`Vector3<class_Vector3>` = Vector3(0, 1, 0), use_model_front\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_Node3D_method_look_at>`
  494. Rotates the node so that the local forward axis (-Z, :ref:`Vector3.FORWARD<class_Vector3_constant_FORWARD>`) points toward the ``target`` position. This operation is calculated in global space (relative to the world).
  495. The local up axis (+Y) points as close to the ``up`` vector as possible while staying perpendicular to the local forward axis. The resulting transform is orthogonal, and the scale is preserved. Non-uniform scaling may not work correctly.
  496. The ``target`` position cannot be the same as the node's position, the ``up`` vector cannot be :ref:`Vector3.ZERO<class_Vector3_constant_ZERO>`. Furthermore, the direction from the node's position to the ``target`` position cannot be parallel to the ``up`` vector, to avoid an unintended rotation around the local Z axis.
  497. If ``use_model_front`` is ``true``, the +Z axis (asset front) is treated as forward (implies +X is left) and points toward the ``target`` position. By default, the -Z axis (camera forward) is treated as forward (implies +X is right).
  498. \ **Note:** This method fails if the node is not in the scene tree. If necessary, use :ref:`look_at_from_position()<class_Node3D_method_look_at_from_position>` instead.
  499. .. rst-class:: classref-item-separator
  500. ----
  501. .. _class_Node3D_method_look_at_from_position:
  502. .. rst-class:: classref-method
  503. |void| **look_at_from_position**\ (\ position\: :ref:`Vector3<class_Vector3>`, target\: :ref:`Vector3<class_Vector3>`, up\: :ref:`Vector3<class_Vector3>` = Vector3(0, 1, 0), use_model_front\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_Node3D_method_look_at_from_position>`
  504. Moves the node to the specified ``position``, then rotates the node to point toward the ``target`` position, similar to :ref:`look_at()<class_Node3D_method_look_at>`. This operation is calculated in global space (relative to the world).
  505. .. rst-class:: classref-item-separator
  506. ----
  507. .. _class_Node3D_method_orthonormalize:
  508. .. rst-class:: classref-method
  509. |void| **orthonormalize**\ (\ ) :ref:`🔗<class_Node3D_method_orthonormalize>`
  510. Orthonormalizes this node's :ref:`basis<class_Node3D_property_basis>`. This method sets this node's :ref:`scale<class_Node3D_property_scale>` to :ref:`Vector3.ONE<class_Vector3_constant_ONE>` (or its negative counterpart), but preserves the :ref:`position<class_Node3D_property_position>` and :ref:`rotation<class_Node3D_property_rotation>`. See also :ref:`Transform3D.orthonormalized()<class_Transform3D_method_orthonormalized>`.
  511. .. rst-class:: classref-item-separator
  512. ----
  513. .. _class_Node3D_method_rotate:
  514. .. rst-class:: classref-method
  515. |void| **rotate**\ (\ axis\: :ref:`Vector3<class_Vector3>`, angle\: :ref:`float<class_float>`\ ) :ref:`🔗<class_Node3D_method_rotate>`
  516. Rotates this node's :ref:`basis<class_Node3D_property_basis>` around the ``axis`` by the given ``angle``, in radians. This operation is calculated in parent space (relative to the parent) and preserves the :ref:`position<class_Node3D_property_position>`.
  517. .. rst-class:: classref-item-separator
  518. ----
  519. .. _class_Node3D_method_rotate_object_local:
  520. .. rst-class:: classref-method
  521. |void| **rotate_object_local**\ (\ axis\: :ref:`Vector3<class_Vector3>`, angle\: :ref:`float<class_float>`\ ) :ref:`🔗<class_Node3D_method_rotate_object_local>`
  522. Rotates this node's :ref:`basis<class_Node3D_property_basis>` around the ``axis`` by the given ``angle``, in radians. This operation is calculated in local space (relative to this node) and preserves the :ref:`position<class_Node3D_property_position>`.
  523. .. rst-class:: classref-item-separator
  524. ----
  525. .. _class_Node3D_method_rotate_x:
  526. .. rst-class:: classref-method
  527. |void| **rotate_x**\ (\ angle\: :ref:`float<class_float>`\ ) :ref:`🔗<class_Node3D_method_rotate_x>`
  528. Rotates this node's :ref:`basis<class_Node3D_property_basis>` around the X axis by the given ``angle``, in radians. This operation is calculated in parent space (relative to the parent) and preserves the :ref:`position<class_Node3D_property_position>`.
  529. .. rst-class:: classref-item-separator
  530. ----
  531. .. _class_Node3D_method_rotate_y:
  532. .. rst-class:: classref-method
  533. |void| **rotate_y**\ (\ angle\: :ref:`float<class_float>`\ ) :ref:`🔗<class_Node3D_method_rotate_y>`
  534. Rotates this node's :ref:`basis<class_Node3D_property_basis>` around the Y axis by the given ``angle``, in radians. This operation is calculated in parent space (relative to the parent) and preserves the :ref:`position<class_Node3D_property_position>`.
  535. .. rst-class:: classref-item-separator
  536. ----
  537. .. _class_Node3D_method_rotate_z:
  538. .. rst-class:: classref-method
  539. |void| **rotate_z**\ (\ angle\: :ref:`float<class_float>`\ ) :ref:`🔗<class_Node3D_method_rotate_z>`
  540. Rotates this node's :ref:`basis<class_Node3D_property_basis>` around the Z axis by the given ``angle``, in radians. This operation is calculated in parent space (relative to the parent) and preserves the :ref:`position<class_Node3D_property_position>`.
  541. .. rst-class:: classref-item-separator
  542. ----
  543. .. _class_Node3D_method_scale_object_local:
  544. .. rst-class:: classref-method
  545. |void| **scale_object_local**\ (\ scale\: :ref:`Vector3<class_Vector3>`\ ) :ref:`🔗<class_Node3D_method_scale_object_local>`
  546. Scales this node's :ref:`basis<class_Node3D_property_basis>` by the given ``scale`` factor. This operation is calculated in local space (relative to this node) and preserves the :ref:`position<class_Node3D_property_position>`.
  547. .. rst-class:: classref-item-separator
  548. ----
  549. .. _class_Node3D_method_set_disable_scale:
  550. .. rst-class:: classref-method
  551. |void| **set_disable_scale**\ (\ disable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_Node3D_method_set_disable_scale>`
  552. If ``true``, this node's :ref:`global_transform<class_Node3D_property_global_transform>` is automatically orthonormalized. This results in this node not appearing distorted, as if its global scale were set to :ref:`Vector3.ONE<class_Vector3_constant_ONE>` (or its negative counterpart). See also :ref:`is_scale_disabled()<class_Node3D_method_is_scale_disabled>` and :ref:`orthonormalize()<class_Node3D_method_orthonormalize>`.
  553. \ **Note:** :ref:`transform<class_Node3D_property_transform>` is not affected by this setting.
  554. .. rst-class:: classref-item-separator
  555. ----
  556. .. _class_Node3D_method_set_identity:
  557. .. rst-class:: classref-method
  558. |void| **set_identity**\ (\ ) :ref:`🔗<class_Node3D_method_set_identity>`
  559. Sets this node's :ref:`transform<class_Node3D_property_transform>` to :ref:`Transform3D.IDENTITY<class_Transform3D_constant_IDENTITY>`, which resets all transformations in parent space (:ref:`position<class_Node3D_property_position>`, :ref:`rotation<class_Node3D_property_rotation>`, and :ref:`scale<class_Node3D_property_scale>`).
  560. .. rst-class:: classref-item-separator
  561. ----
  562. .. _class_Node3D_method_set_ignore_transform_notification:
  563. .. rst-class:: classref-method
  564. |void| **set_ignore_transform_notification**\ (\ enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_Node3D_method_set_ignore_transform_notification>`
  565. If ``true``, the node will not receive :ref:`NOTIFICATION_TRANSFORM_CHANGED<class_Node3D_constant_NOTIFICATION_TRANSFORM_CHANGED>` or :ref:`NOTIFICATION_LOCAL_TRANSFORM_CHANGED<class_Node3D_constant_NOTIFICATION_LOCAL_TRANSFORM_CHANGED>`.
  566. It may useful to call this method when handling these notifications to prevent infinite recursion.
  567. .. rst-class:: classref-item-separator
  568. ----
  569. .. _class_Node3D_method_set_notify_local_transform:
  570. .. rst-class:: classref-method
  571. |void| **set_notify_local_transform**\ (\ enable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_Node3D_method_set_notify_local_transform>`
  572. If ``true``, the node will receive :ref:`NOTIFICATION_LOCAL_TRANSFORM_CHANGED<class_Node3D_constant_NOTIFICATION_LOCAL_TRANSFORM_CHANGED>` whenever :ref:`transform<class_Node3D_property_transform>` changes.
  573. \ **Note:** Some 3D nodes such as :ref:`CSGShape3D<class_CSGShape3D>` or :ref:`CollisionShape3D<class_CollisionShape3D>` automatically enable this to function correctly.
  574. .. rst-class:: classref-item-separator
  575. ----
  576. .. _class_Node3D_method_set_notify_transform:
  577. .. rst-class:: classref-method
  578. |void| **set_notify_transform**\ (\ enable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_Node3D_method_set_notify_transform>`
  579. If ``true``, the node will receive :ref:`NOTIFICATION_TRANSFORM_CHANGED<class_Node3D_constant_NOTIFICATION_TRANSFORM_CHANGED>` whenever :ref:`global_transform<class_Node3D_property_global_transform>` changes.
  580. \ **Note:** Most 3D nodes such as :ref:`VisualInstance3D<class_VisualInstance3D>` or :ref:`CollisionObject3D<class_CollisionObject3D>` automatically enable this to function correctly.
  581. \ **Note:** In the editor, nodes will propagate this notification to their children if a gizmo is attached (see :ref:`add_gizmo()<class_Node3D_method_add_gizmo>`).
  582. .. rst-class:: classref-item-separator
  583. ----
  584. .. _class_Node3D_method_set_subgizmo_selection:
  585. .. rst-class:: classref-method
  586. |void| **set_subgizmo_selection**\ (\ gizmo\: :ref:`Node3DGizmo<class_Node3DGizmo>`, id\: :ref:`int<class_int>`, transform\: :ref:`Transform3D<class_Transform3D>`\ ) :ref:`🔗<class_Node3D_method_set_subgizmo_selection>`
  587. Selects the ``gizmo``'s subgizmo with the given ``id`` and sets its transform. Only works in the editor.
  588. \ **Note:** The gizmo object would typically be an instance of :ref:`EditorNode3DGizmo<class_EditorNode3DGizmo>`, but the argument type is kept generic to avoid creating a dependency on editor classes in **Node3D**.
  589. .. rst-class:: classref-item-separator
  590. ----
  591. .. _class_Node3D_method_show:
  592. .. rst-class:: classref-method
  593. |void| **show**\ (\ ) :ref:`🔗<class_Node3D_method_show>`
  594. Allows this node to be rendered. Equivalent to setting :ref:`visible<class_Node3D_property_visible>` to ``true``. This is the opposite of :ref:`hide()<class_Node3D_method_hide>`.
  595. .. rst-class:: classref-item-separator
  596. ----
  597. .. _class_Node3D_method_to_global:
  598. .. rst-class:: classref-method
  599. :ref:`Vector3<class_Vector3>` **to_global**\ (\ local_point\: :ref:`Vector3<class_Vector3>`\ ) |const| :ref:`🔗<class_Node3D_method_to_global>`
  600. Returns the ``local_point`` converted from this node's local space to global space. This is the opposite of :ref:`to_local()<class_Node3D_method_to_local>`.
  601. .. rst-class:: classref-item-separator
  602. ----
  603. .. _class_Node3D_method_to_local:
  604. .. rst-class:: classref-method
  605. :ref:`Vector3<class_Vector3>` **to_local**\ (\ global_point\: :ref:`Vector3<class_Vector3>`\ ) |const| :ref:`🔗<class_Node3D_method_to_local>`
  606. Returns the ``global_point`` converted from global space to this node's local space. This is the opposite of :ref:`to_global()<class_Node3D_method_to_global>`.
  607. .. rst-class:: classref-item-separator
  608. ----
  609. .. _class_Node3D_method_translate:
  610. .. rst-class:: classref-method
  611. |void| **translate**\ (\ offset\: :ref:`Vector3<class_Vector3>`\ ) :ref:`🔗<class_Node3D_method_translate>`
  612. Adds the given translation ``offset`` to the node's position, in local space (relative to this node).
  613. \ **Note:** Prefer using :ref:`translate_object_local()<class_Node3D_method_translate_object_local>`, instead, as this method may be changed in a future release.
  614. \ **Note:** Despite the naming convention, this operation is **not** calculated in parent space for compatibility reasons. To translate in parent space, add ``offset`` to the :ref:`position<class_Node3D_property_position>` (``node_3d.position += offset``).
  615. .. rst-class:: classref-item-separator
  616. ----
  617. .. _class_Node3D_method_translate_object_local:
  618. .. rst-class:: classref-method
  619. |void| **translate_object_local**\ (\ offset\: :ref:`Vector3<class_Vector3>`\ ) :ref:`🔗<class_Node3D_method_translate_object_local>`
  620. Adds the given translation ``offset`` to the node's position, in local space (relative to this node).
  621. .. rst-class:: classref-item-separator
  622. ----
  623. .. _class_Node3D_method_update_gizmos:
  624. .. rst-class:: classref-method
  625. |void| **update_gizmos**\ (\ ) :ref:`🔗<class_Node3D_method_update_gizmos>`
  626. Updates all the :ref:`EditorNode3DGizmo<class_EditorNode3DGizmo>` objects attached to this node. Only works in the editor.
  627. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  628. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  629. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  630. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  631. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  632. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  633. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  634. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  635. .. |void| replace:: :abbr:`void (No return value.)`