Lysa.nodes  0.0
Lysa 3D Engine
SceneTree Class Referenceabstract

Detailed Description

The root container for a scene hierarchy; manages the node tree, camera, and rendering attachment.

Lua full name: lysa.nodes.SceneTree

Public Member Functions

nil attach (target: any)
 Attaches the scene tree to a RenderingWindow or RenderTarget to start rendering. More...
 
nil detach ()
 Detaches the scene tree from its current render target and window; rendering stops. More...
 
nil set_camera (camera: Camera)
 Sets the active camera used to render this scene. More...
 
nil set_viewport (viewport: vireo.Viewport)
 Overrides the viewport rectangle used when rendering this scene. More...
 
nil set_scissors (scissors: vireo.Rect)
 Overrides the scissor rectangle used when rendering this scene. More...
 
Node add_child (child: Node, async: boolean|nil)
 Adds a root-level node to the scene tree. More...
 
boolean remove_child (child: Node)
 Removes a root-level node from the scene tree; takes effect at the start of the next frame. More...
 
nil remove_all_children ()
 Removes and detaches all root-level nodes from the scene tree. More...
 
RayCastHit|nil ray_cast (ray: lysa.Ray, parent: MeshInstance|nil)
 Casts a ray through all MeshInstances (no physics engine) and returns the closest hit, or nil. The length of direction defines the max distance. More...
 
RayCastHit[] ray_cast_all (ray: lysa.Ray, parent: MeshInstance|nil)
 Casts a ray through all MeshInstances (no physics engine) and returns all hits sorted by ascending distance, one per MeshInstance. More...
 

Properties

any self
 Shared pointer to this SceneTree (for passing to engine APIs that require a shared_ptr).
 
boolean is_paused
 Whether the scene tree is paused (paused nodes stop receiving process callbacks).
 
boolean is_attached
 True if the scene tree is currently attached to a render target. (read-only)
 
boolean is_attached_to_window
 True if the scene tree is currently attached to a RenderingWindow. (read-only)
 
lysa.RenderTarget render_target
 The RenderTarget this scene tree is rendering into. (read-only)
 
lysa.RenderingWindow rendering_window
 The RenderingWindow this scene tree is attached to. (read-only)
 

Member Function Documentation

nil attach ( any  target)

Attaches the scene tree to a RenderingWindow or RenderTarget to start rendering.

Parameters
targetany
nil detach ( )

Detaches the scene tree from its current render target and window; rendering stops.

nil set_camera ( Camera  camera)

Sets the active camera used to render this scene.

Parameters
cameraCamera
nil set_viewport ( vireo.Viewport  viewport)

Overrides the viewport rectangle used when rendering this scene.

Parameters
viewportvireo.Viewport
nil set_scissors ( vireo.Rect  scissors)

Overrides the scissor rectangle used when rendering this scene.

Parameters
scissorsvireo.Rect
Node add_child ( Node  child,
boolean|nil  async)

Adds a root-level node to the scene tree.

Parameters
childNode
asyncboolean|nil
Returns
Node
boolean remove_child ( Node  child)

Removes a root-level node from the scene tree; takes effect at the start of the next frame.

Parameters
childNode
Returns
boolean
nil remove_all_children ( )

Removes and detaches all root-level nodes from the scene tree.

RayCastHit|nil ray_cast ( lysa.Ray  ray,
MeshInstance|nil  parent)

Casts a ray through all MeshInstances (no physics engine) and returns the closest hit, or nil. The length of direction defines the max distance.

Parameters
raylysa.Ray
parentMeshInstance|nil
Returns
RayCastHit|nil
RayCastHit[] ray_cast_all ( lysa.Ray  ray,
MeshInstance|nil  parent)

Casts a ray through all MeshInstances (no physics engine) and returns all hits sorted by ascending distance, one per MeshInstance.

Parameters
raylysa.Ray
parentMeshInstance|nil
Returns
RayCastHit[]

Property Documentation

any self

Shared pointer to this SceneTree (for passing to engine APIs that require a shared_ptr).

boolean is_paused

Whether the scene tree is paused (paused nodes stop receiving process callbacks).

boolean is_attached

True if the scene tree is currently attached to a render target. (read-only)

boolean is_attached_to_window

True if the scene tree is currently attached to a RenderingWindow. (read-only)

lysa.RenderTarget render_target

The RenderTarget this scene tree is rendering into. (read-only)

lysa.RenderingWindow rendering_window

The RenderingWindow this scene tree is attached to. (read-only)