The base class for all scene-tree nodes. Provides transform, hierarchy, grouping, and lifecycle callbacks.
Lua full name: lysa.nodes.Node
|
| Node | create (name: string)static |
| | Creates a new plain Node at the origin without a parent. More...
|
| |
| nil | set_script (script: string) |
| | Attaches a Lua script table to the node. The table may implement _ready, _process, _physics_process, _input, _enter_scene, and _exit_scene callbacks. More...
|
| |
| boolean | has_script () |
| | Returns true if a Lua script is currently attached to this node. More...
|
| |
| table|nil | get_script () |
| | Returns the attached Lua script table, or nil if none is attached. More...
|
| |
| nil | set_position (x: number, y: number, z: number) |
| | Sets the local-space position with explicit x, y, z components. More...
|
| |
| nil | translate (vec: lysa.float3) |
| | Moves the node by an offset vector in local space. More...
|
| |
| nil | translate (x: number, y: number, z: number) |
| | Moves the node by x, y, z offset components in local space. More...
|
| |
| nil | set_position_global (x: number, y: number, z: number) |
| | Sets the world-space position with explicit x, y, z components. More...
|
| |
| nil | rotate (rotation: lysa.quaternion) |
| | Applies a quaternion rotation to the local transformation. More...
|
| |
| nil | rotate_x (angle: number) |
| | Rotates the local transformation around the X axis by angle radians. More...
|
| |
| nil | rotate_y (angle: number) |
| | Rotates the local transformation around the Y axis by angle radians. More...
|
| |
| nil | rotate_z (angle: number) |
| | Rotates the local transformation around the Z axis by angle radians. More...
|
| |
| nil | set_rotation (vec: lysa.float3) |
| | Sets the local rotation from Euler angles (radians, pitch/yaw/roll order). More...
|
| |
| nil | rotate_global_x (angle: number) |
| | Rotates the world transformation around the X axis by angle radians. More...
|
| |
| nil | rotate_global_y (angle: number) |
| | Rotates the world transformation around the Y axis by angle radians. More...
|
| |
| nil | rotate_global_z (angle: number) |
| | Rotates the world transformation around the Z axis by angle radians. More...
|
| |
| nil | scale (factor: number) |
| | Scales the local transformation uniformly by the given factor. More...
|
| |
| nil | set_scale (factor: lysa.float3) |
| | Sets the per-axis scale of the local transformation from a float3. More...
|
| |
| lysa.float3 | get_scale () |
| | Returns the per-axis scale of the local transformation. More...
|
| |
| lysa.float3 | to_global (local_pos: lysa.float3) |
| | Transforms a local-space position into world space. More...
|
| |
| lysa.float3 | to_local (global_pos: lysa.float3) |
| | Transforms a world-space position into this node's local space. More...
|
| |
| nil | look_at (target: lysa.float3) |
| | Rotates the node so that its forward axis points toward the target world-space position. More...
|
| |
| lysa.Tween | look_at_smooth (target: lysa.float3, duration: number, transition_type: lysa.TransitionType, callback: function|nil) |
| | Smoothly rotates the node toward the target over duration seconds using the given easing curve; returns the controlling Tween. More...
|
| |
| nil | set_process_mode (mode: ProcessMode) |
| | Changes the node's processing mode (see lysa.nodes.ProcessMode). More...
|
| |
| nil | add_to_group (group: string) |
| | Adds this node to the named group. More...
|
| |
| nil | remove_from_group (group: string) |
| | Removes this node from the named group; silently ignored if not a member. More...
|
| |
| boolean | is_in_group (group: string) |
| | Returns true if this node has been added to the given group. More...
|
| |
| nil | remove_all_children () |
| | Removes and detaches all child nodes (takes effect at the start of the next frame). More...
|
| |
| Node | duplicate () |
| | Returns a deep copy of this node (not supported on all node types). More...
|
| |
| Node|nil | get_child (name: string) |
| | Returns the direct child with the given name, or nil if not found (non-recursive). More...
|
| |
| Node|nil | get_child_by_path (path: string) |
| | Returns a descendant by relative path (e.g. 'child/grandchild'), or nil if not found. More...
|
| |
| Node|nil | find_first_child (name: string) |
| | Recursively finds and returns the first descendant with the given name, or nil. More...
|
| |
| Node | add_child (child: Node, async: boolean) |
| | Adds a child node. Pass async=true when batch-adding many nodes (set visibility to false first to avoid mid-frame flicker). More...
|
| |
| boolean | remove_child (child: Node) |
| | Requests removal of a child node; takes effect at the start of the next frame. Returns true on success. More...
|
| |
| AnimationPlayer | as_animation_player () |
| | Casts this node to AnimationPlayer; returns nil if the type does not match. More...
|
| |
| Camera | as_camera () |
| | Casts this node to Camera; returns nil if the type does not match. More...
|
| |
| Character | as_character () |
| | Casts this node to Character; returns nil if the type does not match. More...
|
| |
| CollisionArea | as_collision_area () |
| | Casts this node to CollisionArea; returns nil if the type does not match. More...
|
| |
| CollisionObject | as_collision_object () |
| | Casts this node to CollisionObject; returns nil if the type does not match. More...
|
| |
| DirectionalLight | as_directional_light () |
| | Casts this node to DirectionalLight; returns nil if the type does not match. More...
|
| |
| Environment | as_environment () |
| | Casts this node to Environment; returns nil if the type does not match. More...
|
| |
| KinematicBody | as_kinematic_body () |
| | Casts this node to KinematicBody; returns nil if the type does not match. More...
|
| |
| Light | as_light () |
| | Casts this node to Light; returns nil if the type does not match. More...
|
| |
| MeshInstance | as_mesh_instance () |
| | Casts this node to MeshInstance; returns nil if the type does not match. More...
|
| |
| OmniLight | as_omni_light () |
| | Casts this node to OmniLight; returns nil if the type does not match. More...
|
| |
| PhysicsBody | as_physics_body () |
| | Casts this node to PhysicsBody; returns nil if the type does not match. More...
|
| |
| RayCast | as_ray_cast () |
| | Casts this node to RayCast; returns nil if the type does not match. More...
|
| |
| RigidBody | as_rigid_body () |
| | Casts this node to RigidBody; returns nil if the type does not match. More...
|
| |
| SpotLight | as_spot_light () |
| | Casts this node to SpotLight; returns nil if the type does not match. More...
|
| |
| StaticBody | as_static_body ()static |
| | Casts this node to StaticBody; returns nil if the type does not match. More...
|
| |
| Timer | as_timer () |
| | Casts this node to Timer; returns nil if the type does not match. More...
|
| |
| Viewport | as_viewport () |
| | Casts this node to Viewport; returns nil if the type does not match. More...
|
| |
|
| any | self |
| | Shared pointer to this node (for passing to engine APIs that require a shared_ptr).
|
| |
| integer | id |
| | Unique identifier of the node. (read-only)
|
| |
| SceneTree | scene_tree |
| | The scene tree this node belongs to. (read-only)
|
| |
| integer | type |
| | The concrete node type (see lysa.nodes.NodeType). (read-only)
|
| |
| string | name |
| | Display name of the node.
|
| |
| string | path |
| | Absolute path of the node within the scene tree. (read-only)
|
| |
| lysa.float4x4 | transform |
| | Local-space transformation matrix (relative to parent).
|
| |
| lysa.float3 | position |
| | Local-space position (relative to parent).
|
| |
| lysa.float4x4 | transform_global |
| | World-space transformation matrix. (read-only)
|
| |
| lysa.float3 | position_global |
| | World-space position.
|
| |
| lysa.quaternion | rotation |
| | Rotation of the local transformation expressed as a quaternion.
|
| |
| lysa.quaternion | rotation_global |
| | Rotation of the world transformation expressed as a quaternion.
|
| |
| lysa.float3 | rotation_euler_angles |
| | Rotation of the local transformation in Euler angles (radians). (read-only)
|
| |
| lysa.float3 | rotation_euler_angles_global |
| | Rotation of the world transformation in Euler angles (radians). (read-only)
|
| |
| number | rotation_x |
| | X-axis rotation component of the local transformation in radians.
|
| |
| number | rotation_y |
| | Y-axis rotation component of the local transformation in radians.
|
| |
| number | rotation_z |
| | Z-axis rotation component of the local transformation in radians.
|
| |
| number | rotation_global_x |
| | X-axis rotation component of the world transformation in radians.
|
| |
| number | rotation_global_y |
| | Y-axis rotation component of the world transformation in radians.
|
| |
| number | rotation_global_z |
| | Z-axis rotation component of the world transformation in radians.
|
| |
| lysa.float3 | scale_global |
| | Per-axis scale of the world transformation. (read-only)
|
| |
| lysa.float3 | right_vector |
| | Normalized right (+X) direction vector in world space. (read-only)
|
| |
| lysa.float3 | left_vector |
| | Normalized left (-X) direction vector in world space. (read-only)
|
| |
| lysa.float3 | front_vector |
| | Normalized forward (-Z) direction vector in world space. (read-only)
|
| |
| lysa.float3 | back_vector |
| | Normalized backward (+Z) direction vector in world space. (read-only)
|
| |
| lysa.float3 | up_vector |
| | Normalized up (+Y) direction vector in world space. (read-only)
|
| |
| lysa.float3 | down_vector |
| | Normalized down (-Y) direction vector in world space. (read-only)
|
| |
| boolean | visible |
| | True if the node and its children are rendered.
|
| |
| boolean | is_processed |
| | True if the node is currently receiving process and input callbacks. (read-only)
|
| |
| boolean | have_parent |
| | True if this node has a parent in the scene tree. (read-only)
|
| |