Class Scene#
Defined in File Scene.h
Class Documentation#
- 
class Scene#
 Public Functions
- 
Scene() noexcept = default#
 Constructor.
- 
~Scene() noexcept = default#
 Destructor.
- 
Entity CreateEntity(const std::string &name = std::string())#
 Create a new entity with the given name.
- Parameters:
 name – Name for the entity.
- Returns:
 Newly created entity.
- 
void DestroyEntity(Entity entity)#
 Destroy the given entity from the scene.
- Parameters:
 entity – Entity to destroy.
- 
void OnRuntimeStart()#
 Function to call on run time start.
- 
void OnRuntimeStop()#
 Function to call on run time stop.
- 
void OnTickRuntime(const TRAP::Utils::TimeStep &deltaTime)#
 Function to call on run time for each tick.
- Parameters:
 deltaTime – Delta time for fixed tick rate.
- 
void OnUpdateRuntime(Utils::TimeStep deltaTime)#
 Function to call on run time for each frame.
- Parameters:
 deltaTime – Delta time between frames.
- 
void OnUpdateEditor(Utils::TimeStep deltaTime, Graphics::EditorCamera &camera)#
 Function to call in TRAP-Editor for each frame while not in run mode.
Remark
Headless mode: This function is not available in headless mode.
- 
void OnViewportResize(u32 width, u32 height)#
 Function to call on viewport resize.
- Parameters:
 width – New viewport width.
height – New viewport height.
- 
void DuplicateEntity(Entity entity)#
 Duplicate the given entity. Create a new entity and copies all components from the given entity.
- Parameters:
 entity – Entity to duplicate.
- 
Entity GetPrimaryCameraEntity()#
 Retrieve the primary camera entity for the scene.
Note
If no camera was found a null entity is returned instead.
- Returns:
 Primary camera entity.
- 
template<typename ...Components>
inline auto GetAllEntitiesWithComponents()# Retrieve all entities that contain the given components.
- Template Parameters:
 Components – Components to retrieve.
- Returns:
 Found entities with requested components.
- 
Scene() noexcept = default#