![]() |
Lysa Nodes
0.0
Lysa Nodes — Scene Graph for the Lysa Engine
|
A scene tree representing a hierarchy of nodes.
Inheritance diagram for SceneTree:Public Member Functions | |
| SceneTree (const SceneConfiguration &sceneConfiguration={}) | |
| SceneTree (RenderingWindow &renderingWindow, const SceneConfiguration &sceneConfiguration={}) | |
| void | attach (RenderingWindow &renderingWindow) |
| void | attach (RenderTarget &renderTarget) |
| void | detach () |
| void | setCamera (const lysa::Camera &camera) |
| void | setViewport (const vireo::Viewport &viewport) |
| void | setScissors (const vireo::Rect &scissors) |
| virtual void | onReady () |
| virtual void | onPhysicsProcess (double delta) |
| virtual void | onProcess (double alpha) |
| virtual bool | onInput (const InputEvent &event) |
| virtual void | onResize (const vireo::Extent &extent) |
| virtual void | onPause () |
| virtual void | onResume () |
| virtual void | onAttach () |
| virtual void | onDetach () |
| template<typename T = Node> | |
| const std::shared_ptr< T > & | addChild (const std::shared_ptr< T > &child, const bool async=false) |
| template<typename T = Node> | |
| bool | removeChild (const std::shared_ptr< T > &child) |
| void | removeAllChildren () |
| template<typename T > | |
| bool | haveChild (const std::shared_ptr< T > &child, const bool recursive=true) const |
| bool | isPaused () const |
| void | setPaused (bool paused) |
| bool | isAttached () const |
| bool | isAttachedToWindow () const |
| RenderTarget & | getRenderTarget () const |
| RenderingWindow & | getRenderingWindow () const |
| std::optional< RayCastHit > | rayCast (const Ray &ray, const std::shared_ptr< MeshInstance > &parent=nullptr) const |
| std::set< RayCastHit > | rayCastAll (const Ray &ray, const std::shared_ptr< MeshInstance > &parent=nullptr) const |
| void | subscribe (const event_type &type, unique_id id, EventHandlerCallback callback) |
| void | subscribe (const event_type &type, EventHandlerCallback callback) |
| void | subscribe (const event_type &type, SignalHandlerCallback callback) |
| void | unsubscribe (unique_id id) |
Protected Attributes | |
| MaterialManager & | materialManager |
| Material resource manager shared with the engine context. More... | |
| MeshManager & | meshManager |
| Mesh resource manager shared with the engine context. More... | |
| ImageManager & | imageManager |
| Image (texture) resource manager shared with the engine context. More... | |
| SceneTree | ( | const SceneConfiguration & | sceneConfiguration = {} | ) |
Default constructor
| sceneConfiguration | The configuration for the scene |
| SceneTree | ( | RenderingWindow & | renderingWindow, |
| const SceneConfiguration & | sceneConfiguration = {} |
||
| ) |
Constructor that attaches the scene tree to a rendering window
| renderingWindow | The window to attach to |
| sceneConfiguration | The configuration for the scene |
|
inline |
Adds a child node to the scene tree
| T | The type of the child node |
| child | The child node to add |
| async | Whether to add the child asynchronously |
| void attach | ( | RenderingWindow & | renderingWindow | ) |
Attaches the scene tree to a rendering window
| void attach | ( | RenderTarget & | renderTarget | ) |
Attaches the scene tree to a render target
| void detach | ( | ) |
Detaches the scene tree from its current render target & window
|
inline |
Returns the rendering window the scene tree is attached to
|
inline |
Returns the render target the scene tree is attached to
|
inline |
Checks if the scene tree has a specific child node
| T | The type of the child node |
| child | The child node to check for |
| recursive | Whether to search recursively |
|
inline |
Returns whether the scene tree is attached to a render target
|
inline |
Returns whether the scene tree is attached to a rendering window
|
inline |
Returns whether the scene tree is paused
|
inlinevirtual |
Called when the scene tree is attached
|
inlinevirtual |
Called when the scene tree is detached
|
inlinevirtual |
Called when an input event occurs
| event | The input event |
|
inlinevirtual |
Called when the scene tree is paused
|
inlinevirtual |
Called during the physics process step
| delta | The time delta since the last physics step |
|
inlinevirtual |
Called during the process step
| alpha | The interpolated alpha |
|
inlinevirtual |
Called when the scene tree is ready
|
inlinevirtual |
Called when the viewport is resized
|
inlinevirtual |
Called when the scene tree is resumed
| std::optional<RayCastHit> rayCast | ( | const Ray & | ray, |
| const std::shared_ptr< MeshInstance > & | parent = nullptr |
||
| ) | const |
Casts a ray (without using the physics engine) through all MeshInstances in the scene and returns the closest hit. The size of direction defines the max distance.
| ray | World-space ray origin and World-space ray direction (un-normalized; length = max distance) |
| parent | Optional parent to ignore |
| std::set<RayCastHit> rayCastAll | ( | const Ray & | ray, |
| const std::shared_ptr< MeshInstance > & | parent = nullptr |
||
| ) | const |
Casts a ray through the entire scene and collects the closest hit per MeshInstance along its length.
| ray | World-space ray origin and world-space ray direction (un-normalized; length = max distance) |
| parent | Optional mesh to ignore |
|
inline |
Removes all child nodes from the scene tree. Each node is detached from the scene before removal.
|
inline |
Removes a child node from the scene tree
| T | The type of the child node |
| child | The child node to remove |
| void setCamera | ( | const lysa::Camera & | camera | ) |
Sets the camera for the scene tree
| void setPaused | ( | bool | paused | ) |
Sets whether the scene tree is paused
| void setScissors | ( | const vireo::Rect & | scissors | ) |
Sets the scissors for the scene tree
| void setViewport | ( | const vireo::Viewport & | viewport | ) |
Sets the viewport for the scene tree
| void subscribe | ( | const event_type & | type, |
| EventHandlerCallback | callback | ||
| ) |
Subscribe to an event and register the subscriber for the auto-unsubscribe mechanism
| void subscribe | ( | const event_type & | type, |
| SignalHandlerCallback | callback | ||
| ) |
Subscribe to an event and register the subscriber for the auto-unsubscribe mechanism
| void subscribe | ( | const event_type & | type, |
| unique_id | id, | ||
| EventHandlerCallback | callback | ||
| ) |
Subscribe to an event and register the subscriber for the auto-unsubscribe mechanism
| void unsubscribe | ( | unique_id | id | ) |
Unsubscribe a registered event subscriber
|
protected |
Image (texture) resource manager shared with the engine context.
|
protected |
Material resource manager shared with the engine context.
|
protected |
Mesh resource manager shared with the engine context.