Integrate EnTT and refactor scene graph to use ECS

  • Replace custom NodeId with entt::entity.
  • Integrate entt::registry into Scene for node management.
  • Refactor Render to use EnTT views for Node3d and NodeUi rendering.
  • Replace isVisible member with isVisible() and setVisible() methods.
  • Implement Z-order sorting for NodeUi.
  • Update physics user data to store EnTT entities.
  • Update .dir-locals.el with EnTT include path.

I’m realizing that dynamic_cast and virtual calls are actually adding a noticeable cost. And it kind of makes sense—at 500 FPS, it’s only 2 ms per frame, so even a 0.5 ms overhead is very noticeable. I’ve decided to add ECS to the game, which should hopefully reduce the amount of dynamic_casts and virtual calls.

I converted Node3d and NodeUi to use entt. Next step: Sfx3d and SfxUi.

Previous