Skip to content

refactor/scene api ergonomics - #60

Merged
damacaa merged 21 commits into
mainfrom
refactor/scene-api-ergonomics
Aug 11, 2026
Merged

refactor/scene api ergonomics#60
damacaa merged 21 commits into
mainfrom
refactor/scene-api-ergonomics

Conversation

@damacaa

@damacaa damacaa commented Aug 11, 2026

Copy link
Copy Markdown
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

damacaa added 21 commits August 8, 2026 20:48
- 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 damacaa left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All checks passed successfully.

@damacaa
damacaa merged commit a4aa795 into main Aug 11, 2026
4 checks passed
@damacaa
damacaa deleted the refactor/scene-api-ergonomics branch August 11, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant