Skip to content
Discussion options

You must be logged in to vote

The answer is a)

The fact that Position implements Component does nothing here. In other words, the entity you spawned does not have the Position component. It's just a field.

However:

per-T: Bundle memory layout boundaries (option a)

This is not correct. If you insert a (Position, Velocity) then the layout will look like &[Position], &[Velocity]. Similarly if you insert an instance of the following PosVel type:

#[derive(Bundle)] // <-- not Component!
struct PosVel {
    position: Position,
    velocity: Velocity,
}

The layout is per component: each component gets its own contiguous storage. But fields of components are not components themselves, so this doesn't recurse.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@bilsen
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Paladynee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants