Struct specs::PackedData
[−]
[src]
pub struct PackedData<T> { pub components: Vec<T>, pub offsets: Vec<Index>, }
Structure of packed components with offsets of which entities they belong to. Offsets define which entities the components correspond to, based on a list of entities the packed data is sent in with.
If the list of entities is all entities in the world, then the offsets in the packed data are the indices of the entities.
Fields
components: Vec<T>
List of components.
offsets: Vec<Index>
Offsets used to get entities which correspond to the components.
Methods
impl<T> PackedData<T>
[src]
pub fn pair_truncate<'a>(&mut self, entities: &'a [Entity])
[src]
Modifies the data to match an entity list's length for merging.
pub fn truncate(&mut self, length: usize)
[src]
Truncates the length of components and offsets.