{
mOrderedComponents.Resize(mComponentCount);
- unsigned int sceneId = 0;
-
TransformId parentId;
for(TransformId i = 0; i < mComponentCount; ++i)
{
mOrderedComponents[i].level = 0u;
parentId = mParent[i];
- if(parentId == INVALID_TRANSFORM_ID)
- {
- mOrderedComponents[i].sceneId = sceneId++;
- }
-
while(parentId != INVALID_TRANSFORM_ID)
{
mOrderedComponents[i].level++;
- parentId = mParent[mIds[parentId]];
- mOrderedComponents[i].sceneId = mOrderedComponents[mIds[mParent[i]]].sceneId;
+ parentId = mParent[mIds[parentId]];
}
}
{
bool operator<(const SOrderItem& item) const
{
- if(sceneId != item.sceneId)
- {
- return sceneId < item.sceneId;
- }
- else
- {
- return level < item.level;
- }
+ return level < item.level;
}
TransformId id;
- uint16_t sceneId;
- uint16_t level;
+ uint32_t level;
};
/**
/**
* Reorders components in hierarchical order so update can iterate sequentially
- * updating the world transforms. The components are sorted in the breadth first
- * order for each scene and grouped per scene.
+ * updating the world transforms
*/
void ReorderComponents();