Spatial

Inherits: Node < Object

Inherited By: Joint, RayCast, Camera, BoneAttachment, CollisionShape, Path, VisualInstance, VehicleWheel, Position3D, ProximityGroup, SpatialPlayer, WorldEnvironment, PathFollow, NavigationMeshInstance, Listener, InverseKinematics, VisibilityNotifier, Navigation, CollisionPolygon, GridMap, Skeleton, CollisionObject

Category: Core

Brief Description

Base class for all 3D nodes.

Member Functions

SpatialGizmo

get_gizmo ( ) const

Transform

get_global_transform ( ) const

Object

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_hidden ( ) const

bool

is_local_transform_notification_enabled ( ) const

bool

is_set_as_toplevel ( ) const

bool

is_visible ( ) 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_hidden ( bool hidden )

void

set_identity ( )

void

set_ignore_transform_notification ( bool enabled )

void

set_notify_local_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

show ( )

void

translate ( Vector3 offset )

void

update_gizmo ( )

Signals

  • visibility_changed ( )

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.

  • Object get_parent_spatial ( ) const

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

  • Vector3 get_rotation_deg ( ) const

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_hidden ( ) const

  • bool is_local_transform_notification_enabled ( ) const

  • bool is_set_as_toplevel ( ) const

  • bool is_visible ( ) 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_hidden ( bool hidden )

  • void set_identity ( )

  • void set_ignore_transform_notification ( bool enabled )

  • void set_notify_local_transform ( bool enable )

  • void set_rotation ( Vector3 rotation_rad )

  • void set_rotation_deg ( Vector3 rotation_deg )

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

  • void set_translation ( Vector3 translation )

  • void show ( )

  • void translate ( Vector3 offset )

  • void update_gizmo ( )