|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
Makes a subtree sort as ONE unit against the rest of the scene. More...


Go to the source code of this file.
Classes | |
| struct | esengine::ecs::SortingGroup |
| One sorting identity for an entity and everything under it. More... | |
Namespaces | |
| namespace | esengine |
| namespace | esengine::ecs |
Makes a subtree sort as ONE unit against the rest of the scene.
A character assembled from sprites — body, arm, weapon, cape — has an internal front-to-back order that must hold, and an external position among everything else. Without a group those are the same number: raising the weapon above another character's sprite raises it above its own body too, and the only fix is to hand out globally-unique orders across every entity that might ever overlap.
The group states the external promise, so its members no longer have to. Inside it each member's own order means "where in THIS group", and the group's layer/order is what the whole subtree presents outward. Nothing outside can land between two members, which is the property a per-sprite order cannot offer at all.
Nesting takes the NEAREST enclosing group: an inner group is itself a member of the outer one, so a weapon's own sub-assembly travels with the arm holding it.
Definition in file SortingGroup.hpp.