|
Finality Engine
|
Owns entities and dispatches script simulation. More...
#include <Scene.h>
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 |
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.
| FINALITY::Scene::Scene | ( | ) |
|
virtual |
| glm::mat4 FINALITY::Scene::GetWorldTransform | ( | entt::entity | entityHandle | ) | const |
|
pure virtual |
Implemented in BenchmarkScene, FINALITY::EditorCameraScene, FINALITY::EmptyScene, MainScene, MainScene, and SplashScreen.
|
virtual |
Dispatches activation and simulation callbacks for a scene update.
| ts | Elapsed 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.
|
virtual |
Reimplemented in FINALITY::EditorCameraScene, and FINALITY::EmptyScene.
|
virtual |
Reimplemented in BenchmarkScene, FINALITY::EmptyScene, MainScene, and SplashScreen.
| Entity FINALITY::Scene::CreateEntity | ( | const std::string & | name = std::string() | ) |
| Entity FINALITY::Scene::DuplicateEntity | ( | entt::entity | handle | ) |
| Entity FINALITY::Scene::GetEntity | ( | entt::entity | handle | ) |
| void FINALITY::Scene::DestroyEntity | ( | entt::entity | entity | ) |
| void FINALITY::Scene::CopyScriptsTo | ( | Scene & | destination | ) | const |
| void FINALITY::Scene::DeferScriptMutation | ( | std::function< void()> | operation | ) |
| void FINALITY::Scene::SetTimeScale | ( | float | scale | ) |
Changes the scene's simulation speed.
| scale | Finite 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. |
| void FINALITY::Scene::SetFixedTimeStep | ( | float | step | ) |
Sets the interval used for fixed simulation callbacks.
| step | Interval in seconds, between 0.001 and 1 inclusive. Accepted values reset the accumulated fixed-step backlog. Invalid values are ignored. |
|
inline |
|
inline |