Skip to content

Dynamic Queries and adding dynamic components' data #11424

Answered by james-j-obrien
iancormac84 asked this question in Q&A
Discussion options

You must be logged in to vote

You have a pretty good understanding but there is one wrinkle in that the type in the example actually represents struct CompA([u64, X]) where X is some dynamically defined size (note the lack of a reference, it's stored inline). The purpose in using that type for the example is to show that the dynamic components can have their sizes chosen dynamically as well, for use cases where you don't know what data you need to store. I do understand nicopap's argument that it is somewhat niche however this is the only way to demonstrate "fully" dynamic components, we could also add a simpler variant that uses a known layout.

Since you know the exact layout of the data you want to store in your com…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@nicopap
Comment options

@iancormac84
Comment options

@james-j-obrien
Comment options

Answer selected by iancormac84
@iancormac84
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
A-ECS Entities, components, systems, and events
3 participants