Spatial

Inherits: Node < Object

Inherited By: Joint, RayCast, Camera, BoneAttachment, CollisionShape, AudioStreamPlayer3D, Path, ARVRController, VisualInstance, VehicleWheel, Position3D, ProximityGroup, ARVRAnchor, RemoteTransform, CollisionObject, Listener, PathFollow, NavigationMeshInstance, VisibilityNotifier, Navigation, CollisionPolygon, GridMap, Skeleton, ARVROrigin

Category: Core

Brief Description

Base class for all 3D nodes.

Member Functions

SpatialGizmo get_gizmo ( ) const
Transform get_global_transform ( ) const
Spatial get_parent_spatial ( ) const
Vector3 get_rotation ( ) const
Vector3 get_rotation_deg ( ) const
Vector3 get_scale ( ) const
Transform get_transform ( ) const
Vector3 get_translation ( ) const
World get_world ( ) const
void global_rotate ( Vector3 normal, float radians )
void global_translate ( Vector3 offset )
void hide ( )
bool is_local_transform_notification_enabled ( ) const
bool is_set_as_toplevel ( ) const
bool is_transform_notification_enabled ( ) const
bool is_visible ( ) const
bool is_visible_in_tree ( ) const
void look_at ( Vector3 target, Vector3 up )
void look_at_from_pos ( Vector3 pos, Vector3 target, Vector3 up )
void orthonormalize ( )
void rotate ( Vector3 normal, float radians )
void rotate_x ( float radians )
void rotate_y ( float radians )
void rotate_z ( float radians )
void set_as_toplevel ( bool enable )
void set_gizmo ( SpatialGizmo gizmo )
void set_global_transform ( Transform global )
void set_identity ( )
void set_ignore_transform_notification ( bool enabled )
void set_notify_local_transform ( bool enable )
void set_notify_transform ( bool enable )
void set_rotation ( Vector3 rotation_rad )
void set_rotation_deg ( Vector3 rotation_deg )
void set_scale ( Vector3 scale )
void set_transform ( Transform local )
void set_translation ( Vector3 translation )
void set_visible ( bool visible )
void show ( )
Vector3 to_global ( Vector3 local_point ) const
Vector3 to_local ( Vector3 global_point ) const
void translate ( Vector3 offset )
void update_gizmo ( )

Signals

  • visibility_changed ( )

Member Variables

Numeric Constants

  • NOTIFICATION_TRANSFORM_CHANGED = 29 — Spatial nodes receive this notification with their global transform changes. This means that either the current or a parent node changed its transform.
  • NOTIFICATION_ENTER_WORLD = 41
  • NOTIFICATION_EXIT_WORLD = 42
  • NOTIFICATION_VISIBILITY_CHANGED = 43

Description

Spatial is the base for every type of 3D Node. It contains a 3D Transform which can be set or get as local or global. If a Spatial Node has Spatial children, their transforms will be relative to the parent.

Member Function Description

Return the global transform, relative to worldspace.

  • Spatial get_parent_spatial ( ) const

Return the parent Spatial, or an empty Object if no parent exists or parent is not of type Spatial.

Return the rotation (in radians).

  • Vector3 get_rotation_deg ( ) const

Return the rotation (in degrees).

Return the local transform, relative to the bone parent.

  • Vector3 get_translation ( ) const
  • World get_world ( ) const
  • void global_translate ( Vector3 offset )
  • void hide ( )
  • bool is_local_transform_notification_enabled ( ) const
  • bool is_set_as_toplevel ( ) const
  • bool is_transform_notification_enabled ( ) const
  • bool is_visible ( ) const
  • bool is_visible_in_tree ( ) const
  • void orthonormalize ( )
  • void rotate_x ( float radians )
  • void rotate_y ( float radians )
  • void rotate_z ( float radians )
  • void set_as_toplevel ( bool enable )
  • void set_global_transform ( Transform global )

Set the transform globally, relative to worldspace.

  • void set_identity ( )
  • void set_ignore_transform_notification ( bool enabled )
  • void set_notify_local_transform ( bool enable )
  • void set_notify_transform ( bool enable )
  • void set_rotation ( Vector3 rotation_rad )

Set the rotation (in radians).

  • void set_rotation_deg ( Vector3 rotation_deg )

Set the rotation (in degrees).

Set the transform locally, relative to the parent spatial node.

  • void set_translation ( Vector3 translation )
  • void set_visible ( bool visible )
  • void show ( )
  • void translate ( Vector3 offset )
  • void update_gizmo ( )