Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hierarchical prototype
Now it is possible to have prototypes with children, this way more complex prototypes can be achieved (e.g. robots with multiple sensors).
Memory management
It is important to keep component data close in the memory to be cache-friendly when parallelizing.
Prototype without children
Let's say we want to create 2 clones, when the prototype does not have children, we would have:

Note that when executing in parallel, the
transform
component of each clone is sequential in the memory, as well as thename
, andmesh
components. This way, when the transform for the first clone is requested, there is a bigger probability that the transform of the next clone will already be in the cache line.Prototype with children
The same reasoning follows and we have a prototype with children.

Note that it is like each component from the prototype is "expanded" to the component of each clone.
Extra
Limitations:
cmp::Relationship
now)Changelog:
cmp::Camera
with newcaptureTime
fieldcmp::Entity
new methods:Entity::exists()
Entity::getParent()
Entity::getChildren()
Entity::getChild(unsigned i)
cmp::Relationship
newEntity get(uint32_t i)
methodmat4
vec3 mat4::getPosition()
quat mat4::getOrientation()
vec3 mat4::getScale()
cmp::Relationship
usingcmp::Entity
instead ofcmp::EntityId