2#include "../as/foray_tlas.hpp"
3#include "../osi/foray_osi_declares.hpp"
45 template <
typename TComponent>
48 template <
typename TComponent>
70 template <
typename TComponent>
81 template <
typename TComponent>
Context used for render processes. This object is rebuilt for every frame. /.
Definition foray_framerenderinfo.hpp:14
Base class for operating system events.
Definition foray_event.hpp:13
Type maintaining callback lists for event distribution.
Definition foray_callbackdispatcher.hpp:12
A scene node. Extends the registry with hierarchical information.
Definition foray_node.hpp:8
Manages a type identified list of components.
Definition foray_registry.hpp:12
int32_t GetComponents(std::vector< TComponent * > &out)
Appends all components which can be cast to TComponent type to the out vector.
Definition foray_registry.hpp:145
Provides registries and methods as the anchor of a component based scene.
Definition foray_scene.hpp:17
friend Node
Definition foray_scene.hpp:19
virtual ~Scene()
Definition foray_scene.hpp:39
void UpdateLightManager()
Updates lights. If your project requires punctual lights, this must be called after altering the scen...
Node * MakeNode(Node *parent=nullptr)
Generates a new node and attaches it to the parent if it is set, root otherwise.
virtual void Destroy() override
Cleans up all memory, GPU structures, etc...
void Draw(const base::FrameRenderInfo &renderInfo, VkPipelineLayout pipelineLayout, base::CmdBufferIndex index=base::PRIMARY_COMMAND_BUFFER)
Draw the scene by invoking the Draw callbacks.
void Draw(const base::FrameRenderInfo &renderInfo, VkPipelineLayout pipelineLayout, VkCommandBuffer cmdBuffer)
Draw the scene by invoking the Draw callbacks.
int32_t FindNodesWithComponent(std::vector< Node * > &outnodes)
Definition foray_scene.hpp:82
void Update(const base::FrameRenderInfo &renderInfo, VkCommandBuffer cmdBuffer)
Scene(core::Context *context)
std::vector< std::unique_ptr< Node > > mNodeBuffer
Buffer holding ownership of all nodes.
Definition foray_scene.hpp:62
void UseDefaultCamera(bool invertAll=false)
Adds a default camera to the scene (standard perspective + freecameracontroller) and selects it in th...
int32_t FindComponents(std::vector< TComponent * > &outcomponents)
Definition foray_scene.hpp:71
core::Context * mContext
Definition foray_scene.hpp:59
void HandleEvent(const osi::Event *event)
Invokes event callbacks (NodeComponent, then GlobalComponent)
void Update(const base::FrameRenderInfo &renderInfo, base::CmdBufferIndex index)
Advance scene state by invoking all NodeComponent update callbacks, followed by GlobalComponent updat...
void UpdateTlasManager()
Rebuilds the Tlas. If your project requires a Tlas this must be called after altering the scene.
void InitDefaultGlobals()
std::vector< Node * > mRootNodes
All nodes directly attached to the root.
Definition foray_scene.hpp:65
#define FORAY_PROPERTY_V(member)
Getter+Setter shorthand for value types.
Definition foray_basics.hpp:81
#define FORAY_PROPERTY_R(member)
Getter+Setter shorthand for reference types.
Definition foray_basics.hpp:86
int32_t CmdBufferIndex
Definition foray_inflightframe.hpp:17
Definition foray_animation.hpp:8
Non owning context object.
Definition foray_context.hpp:16