Finality Engine
Loading...
Searching...
No Matches
FINALITY::Scene Class Referenceabstract

Owns entities and dispatches script simulation. More...

#include <Scene.h>

Inheritance diagram for FINALITY::Scene:
BenchmarkScene FINALITY::EditorCameraScene FINALITY::EmptyScene MainScene MainScene SplashScreen

Public Member Functions

 Scene ()
glm::mat4 GetWorldTransform (entt::entity entityHandle) const
virtual ~Scene ()
virtual void OnInit ()=0
virtual void OnUpdate (float ts)
 Dispatches activation and simulation callbacks for a scene update.
virtual void OnRender ()
virtual void OnDestroy ()
Entity CreateEntity (const std::string &name=std::string())
Entity DuplicateEntity (entt::entity handle)
Entity InstantiateHierarchy (const Scene &source, entt::entity handle)
Entity GetEntity (entt::entity handle)
void DestroyEntity (entt::entity entity)
void CopyScriptsTo (Scene &destination) const
bool IsDispatchingScripts () const
void DeferScriptMutation (std::function< void()> operation)
double GetScriptTimeMS () const
uint64_t GetScriptCalls () const
void SetTimeScale (float scale)
 Changes the scene's simulation speed.
float GetTimeScale () const
void SetFixedTimeStep (float step)
 Sets the interval used for fixed simulation callbacks.
float GetFixedTimeStep () const
uint32_t GetFixedSteps () const
std::weak_ptr< void > GetLifetime () const
const entt::registry & GetRegistry () const
entt::registry & GetRegistry ()

Friends

class Entity
class SceneSerializer
class ScriptableComponent

Detailed Description

Owns entities and dispatches script simulation.

Scene owns the EnTT registry and supplies hierarchy cloning, destruction and world transforms. Script updates use a snapshot and defer structural mutations until callback dispatch completes. New attachments begin on the following update.

Usage
Call OnUpdate with elapsed seconds. FixedUpdate runs before Update; LateUpdate follows all Update calls. Use DestroyEntity rather than removing registry entries during callbacks.

Definition at line 35 of file Scene.h.

Constructor & Destructor Documentation

◆ Scene()

FINALITY::Scene::Scene ( )

◆ ~Scene()

virtual FINALITY::Scene::~Scene ( )
virtual

Member Function Documentation

◆ GetWorldTransform()

glm::mat4 FINALITY::Scene::GetWorldTransform ( entt::entity entityHandle) const

◆ OnInit()

virtual void FINALITY::Scene::OnInit ( )
pure virtual

◆ OnUpdate()

virtual void FINALITY::Scene::OnUpdate ( float ts)
virtual

Dispatches activation and simulation callbacks for a scene update.

Parameters
tsElapsed wall time in seconds, capped internally before simulation. FixedUpdate precedes Update; LateUpdate follows all Update callbacks. The fixed catch-up budget is eight steps. Structural mutations requested during dispatch are deferred to keep traversal valid. Recursive dispatch is ignored.

Reimplemented in BenchmarkScene, FINALITY::EditorCameraScene, FINALITY::EmptyScene, MainScene, MainScene, and SplashScreen.

◆ OnRender()

virtual void FINALITY::Scene::OnRender ( )
virtual

◆ OnDestroy()

virtual void FINALITY::Scene::OnDestroy ( )
virtual

◆ CreateEntity()

Entity FINALITY::Scene::CreateEntity ( const std::string & name = std::string())

◆ DuplicateEntity()

Entity FINALITY::Scene::DuplicateEntity ( entt::entity handle)

◆ InstantiateHierarchy()

Entity FINALITY::Scene::InstantiateHierarchy ( const Scene & source,
entt::entity handle )

◆ GetEntity()

Entity FINALITY::Scene::GetEntity ( entt::entity handle)

◆ DestroyEntity()

void FINALITY::Scene::DestroyEntity ( entt::entity entity)

◆ CopyScriptsTo()

void FINALITY::Scene::CopyScriptsTo ( Scene & destination) const

◆ IsDispatchingScripts()

bool FINALITY::Scene::IsDispatchingScripts ( ) const
inline

Definition at line 60 of file Scene.h.

◆ DeferScriptMutation()

void FINALITY::Scene::DeferScriptMutation ( std::function< void()> operation)

◆ GetScriptTimeMS()

double FINALITY::Scene::GetScriptTimeMS ( ) const
inline

Definition at line 62 of file Scene.h.

◆ GetScriptCalls()

uint64_t FINALITY::Scene::GetScriptCalls ( ) const
inline

Definition at line 63 of file Scene.h.

◆ SetTimeScale()

void FINALITY::Scene::SetTimeScale ( float scale)

Changes the scene's simulation speed.

Parameters
scaleFinite multiplier clamped to the range zero through 100. Non-finite values leave the current setting unchanged. Zero suppresses simulation callbacks while an update can still process activation changes.

◆ GetTimeScale()

float FINALITY::Scene::GetTimeScale ( ) const
inline

Definition at line 71 of file Scene.h.

◆ SetFixedTimeStep()

void FINALITY::Scene::SetFixedTimeStep ( float step)

Sets the interval used for fixed simulation callbacks.

Parameters
stepInterval in seconds, between 0.001 and 1 inclusive. Accepted values reset the accumulated fixed-step backlog. Invalid values are ignored.

◆ GetFixedTimeStep()

float FINALITY::Scene::GetFixedTimeStep ( ) const
inline

Definition at line 78 of file Scene.h.

◆ GetFixedSteps()

uint32_t FINALITY::Scene::GetFixedSteps ( ) const
inline

Definition at line 79 of file Scene.h.

◆ GetLifetime()

std::weak_ptr< void > FINALITY::Scene::GetLifetime ( ) const
inline

Definition at line 80 of file Scene.h.

◆ GetRegistry() [1/2]

const entt::registry & FINALITY::Scene::GetRegistry ( ) const
inline

Definition at line 82 of file Scene.h.

◆ GetRegistry() [2/2]

entt::registry & FINALITY::Scene::GetRegistry ( )
inline

Definition at line 83 of file Scene.h.

◆ Entity

friend class Entity
friend

Definition at line 99 of file Scene.h.

◆ SceneSerializer

friend class SceneSerializer
friend

Definition at line 100 of file Scene.h.

◆ ScriptableComponent

friend class ScriptableComponent
friend

Definition at line 101 of file Scene.h.


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