This guide outlines how to set up a hierarchical 3D transformation system using Flecs 4.x, focusing on correct entity-component-system (ECS) configuration, transformation order, and parent-child relationships. It is tailored for AI agents and developers building 3D applications (e.g., with OpenGL or other rendering APIs) where entities have position, rotation, and scale, and transformations are propagated through a parent-child hierarchy.Key Concepts1. Flecs Basics
- Entities: Unique identifiers representing objects (e.g., a cube in a 3D scene).
- Components: Data structures attached to entities (e.g., Transform3D for position, rotation, scale).
- Systems: Functions that operate on entities with specific components, executed in a defined order (e.g., EcsPreUpdate, EcsOnUpdate).
- Pairs: Relationships between entities, used for hierarchies (e.g., (EcsChildOf, ParentEntity) to denote a child-parent relationship).
- Hierarchical Transformat