Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
Node3D¶
Inherited By: AudioListener3D, AudioStreamPlayer3D, BoneAttachment3D, Camera3D, CollisionObject3D, CollisionPolygon3D, CollisionShape3D, GridMap, ImporterMeshInstance3D, Joint3D, LightmapProbe, Marker3D, NavigationLink3D, NavigationObstacle3D, NavigationRegion3D, OccluderInstance3D, OpenXRHand, Path3D, PathFollow3D, RayCast3D, RemoteTransform3D, ShapeCast3D, Skeleton3D, SpringArm3D, VehicleWheel3D, VisualInstance3D, XRNode3D, XROrigin3D
Most basic 3D game object, parent of all 3D-related nodes.
描述¶
Most basic 3D game object, with a Transform3D and visibility settings. All other 3D game objects inherit from Node3D. Use Node3D as a parent node to move, scale, rotate and show/hide children in a 3D project.
Affine operations (rotate, scale, translate) happen in parent's local coordinate system, unless the Node3D object is set as top-level. Affine operations in this coordinate system correspond to direct affine operations on the Node3D's transform. The word local below refers to this coordinate system. The coordinate system that is attached to the Node3D object itself is referred to as object-local coordinate system.
Note: Unless otherwise specified, all methods that have angle parameters must have angles specified as radians. To convert degrees to radians, use @GlobalScope.deg_to_rad.
Note: Be aware that "Spatial" nodes are now called "Node3D" starting with Godot 4. Any Godot 3.x references to "Spatial" nodes refer to "Node3D" in Godot 4.
教程¶
属性¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Methods¶
信号¶
visibility_changed ( )
Emitted when node visibility changes.
Enumerations¶
enum RotationEditMode:
RotationEditMode ROTATION_EDIT_MODE_EULER = 0
The rotation is edited using Vector3 Euler angles.
RotationEditMode ROTATION_EDIT_MODE_QUATERNION = 1
The rotation is edited using a Quaternion.
RotationEditMode ROTATION_EDIT_MODE_BASIS = 2
The rotation is edited using a Basis. In this mode, scale can't be edited separately.
常量¶
NOTIFICATION_TRANSFORM_CHANGED = 2000
Node3D 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 NOTIFICATION_TRANSFORM_CHANGED to work, users first need to ask for it, with set_notify_transform. The notification is also sent if the node is in the editor context and it has at least one valid gizmo.
NOTIFICATION_ENTER_WORLD = 41
Node3D nodes receives this notification when they are registered to new World3D resource.