Open 3D Engine AzFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzFramework::ISceneSystem Class Referenceabstract

#include <SceneSystemInterface.h>

Public Types

enum class  EventType { SceneCreated , ScenePendingRemoval }
 
using SceneEvent = AZ::Event< EventType, const AZStd::shared_ptr< Scene > & >
 
using ActiveIterationCallback = AZStd::function< bool(const AZStd::shared_ptr< Scene > &scene)>
 
using ZombieIterationCallback = AZStd::function< bool(Scene &scene)>
 

Public Member Functions

 AZ_RTTI (AzFramework::ISceneSystem, "{DAE482A8-88AE-4BD3-8A5B-52D19A96E15F}")
 
 AZ_DISABLE_COPY_MOVE (ISceneSystem)
 
virtual AZ::Outcome< AZStd::shared_ptr< Scene >, AZStd::string > CreateScene (AZStd::string_view name)=0
 
virtual AZ::Outcome< AZStd::shared_ptr< Scene >, AZStd::string > CreateSceneWithParent (AZStd::string_view name, AZStd::shared_ptr< Scene > parent)=0
 
virtual AZStd::shared_ptr< SceneGetScene (AZStd::string_view name)=0
 
virtual void IterateActiveScenes (const ActiveIterationCallback &callback)=0
 Iterates over all scenes that are in active use. Iteration stops if the callback returns false or all scenes have been listed.
 
virtual void IterateZombieScenes (const ZombieIterationCallback &callback)=0
 
virtual bool RemoveScene (AZStd::string_view name)=0
 Remove a scene with a given name and return if the operation was successful.
 
virtual void ConnectToEvents (SceneEvent::Handler &handler)=0
 Connects the provided handler to the events that are called after scenes are created or before they get removed.
 

Protected Member Functions

void MarkSceneForDestruction (Scene &scene)
 

Detailed Description

Interface used to create, get, or destroy scenes. This interface is single thread and is intended to be called from a single thread, commonly the main thread. The exception is connecting events, which is thread safe.

Member Function Documentation

◆ CreateScene()

virtual AZ::Outcome< AZStd::shared_ptr< Scene >, AZStd::string > AzFramework::ISceneSystem::CreateScene ( AZStd::string_view  name)
pure virtual

Creates a scene with a given name.

  • If there is already a scene with the provided name this will return AZ::Failure().

◆ CreateSceneWithParent()

virtual AZ::Outcome< AZStd::shared_ptr< Scene >, AZStd::string > AzFramework::ISceneSystem::CreateSceneWithParent ( AZStd::string_view  name,
AZStd::shared_ptr< Scene parent 
)
pure virtual

Creates a scene with a given name and a parent.

  • If there is already a scene with the provided name this will return AZ::Failure().

◆ GetScene()

virtual AZStd::shared_ptr< Scene > AzFramework::ISceneSystem::GetScene ( AZStd::string_view  name)
pure virtual

Gets a scene with a given name

  • If a scene does not exist with the given name, nullptr is returned.

◆ IterateZombieScenes()

virtual void AzFramework::ISceneSystem::IterateZombieScenes ( const ZombieIterationCallback &  callback)
pure virtual

Iterates over all zombie scenes. Zombie scenes are scenes that have been removed but still have references held on to. This can happen because scenes hold on to subsystems that can't immediately be deleted. These subsystems may still require being called such as a periodic tick. Iteration stops if the callback returns false or all scenes have been listed.


The documentation for this class was generated from the following file: