ModelSortGroup
A group that you assign to multiple entities to tell the renderer what order and how to render the entities in the group.
Declaration
struct ModelSortGroupOverview
Each model sort group relates model entities to each other so that you can define what order the renderer draws them. Pass the same model sort group instance to each ModelSortGroupComponent whose entity you want to group, along with an order number for that entity within the group.
let group1 = ModelSortGroup()
entityA.components.set(
ModelSortGroupComponent(group: group1, order: 0)
)
entityB.components.set(
ModelSortGroupComponent(group: group1, order: 1)
)In the example above, the renderer draws entityA before entityB.
Each ModelSortGroup instance represent a unique group.
let group2 = ModelSortGroup()
entityC.components.set(
ModelSortGroupComponent(group: group2, order: 2)
)
entityD.components.set(
ModelSortGroupComponent(group: group2, order: 3)
)In this example, entityC and entityD are in the same group as each other, but in a different group than entityA and entityB.