Skip to main content

allocate_offset_cube_mesh

Function allocate_offset_cube_mesh 

Source
pub fn allocate_offset_cube_mesh(
    world: &World,
    source_entity: Entity,
    key: &LitPipelineKey,
    offset: Vec3,
) -> GpuMesh
Expand description

Allocate the unit cube through the source, its vertices offset by offset in mesh space.

The offset is baked into the vertices, so two cubes allocated from different offsets draw differently even at the same transform — which is what tells a mesh apart from the one whose pool range it sits next to.