refactor/scene api ergonomics - #60
Merged
Merged
Conversation
damacaa
commented
Aug 11, 2026
Owner
- core/assert: introduce WEIRD_ASSERT runtime diagnostics system
- physics: enforce thread execution boundaries and batch snapshot readback
- scene: add onDestroy lifecycle hook and fix SceneManager index state
- physics: add BodyUserData for attaching custom data to rigidbodies
- core: refactor Scene API to use ServiceProvider and improve naming
- examples: update tools and example scenes to new Scene API
- Refactor Scene API to enforce ServiceProvider pattern and inject assets path
- Migrate examples and tools to the updated ServiceProvider Scene API
- Refactor Scene API to use strict internal access and GBuffer struct
- docs: add commit naming guidelines to AGENTS.md
- docs: add ServiceProvider pattern documentation to AGENTS.md
- scene: remove Simulation2D getter form the physics service
- scene: encapsulate internals and enforce ServiceProvider usage
- physics: take BodyUserData ownership via unique_ptr in setUserData
- scene: add system dispatcher for registering callbacks
- examples: migrate ServiceShowcaseScene to the system dispatcher
- core: rename ECSManager to Registry
- scene: remove stale comments from SceneManager
- scene: fix SceneSerializer failing to save when parent directories do not exist
- examples: disabled ServiceShowcaseScene
- core: refactor ShapeService to use ShapeConfig and fix memory safety
- Made Scene lifecycle and engine-driven methods private - Added friend declaration for Detail::runFrame to access Scene internals - Restored custom onRender signature (ecs, services, renderTarget) in Scene and inheriting classes - Refactored all example scenes and tools to access engine services through the ServiceProvider facade rather than direct Scene access or private variables
setUserData now consumes std::unique_ptr<BodyUserData>, forcing callers to hand off ownership and query the data back through getUserDataAs<T> instead of caching a raw pointer. Out-of-bounds ids now assert instead of silently returning. Documented the type discriminator must be set in the derived constructor.
Scenes can register plain functions (systems) for create, start, update, destroy, imgui render, entity collision and entity shape collision stages. Registered systems run sequentially after the virtual callback of the same stage, keeping the old override API working.
Replace thin virtual wrappers with add*System registrations and move scene state into the ECS. Physics-thread callbacks and onRender stay inlined: the dispatcher is not involved there. Character user data is handed to the simulation via make_unique and queried back through the physics service; restitution now drives the bounce response.
Renames the entity+component storage class, its members (m_ecs -> m_registry), the ecs() accessor and the ecs/ECS.h header (now ecs/Registry.h). The name no longer over-promises system management: scheduling stays on Scene, which dispatches systems with a Registry& and a ServiceProvider&. The ECS namespace and ecs/ folder are untouched.
- Introduce ShapeConfig and UIShapeConfig for designated initialization of SDFs. - Safely encapsulate parameter arrays in ShapeVariables to prevent dangling pointers. - Simplify addShape and addUIShape implementations. - Update SDF_SHAPES.md documentation.
damacaa
commented
Aug 11, 2026
damacaa
left a comment
Owner
Author
There was a problem hiding this comment.
All checks passed successfully.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.