cubos::engine::RenderVoxelGrid struct

Component used to draw voxel grids.

When added to an entity, the grid may not be able to be rendered immediately, as the asset must load first, and the necessary data must be sent to the GPU. A LoadRenderVoxels component is automatically added to the entity by an observer, which can be used to track the grid's loading progress. When the grid is loaded, the task is removed.

If the grid is changed, in order to update the rendering, a new LoadRenderVoxels component must be added to the entity, manually.

Public variables

Asset<VoxelGrid> asset
Handle to the grid asset to be rendered.
glm::vec3 offset
Translation applied to the grid.

Variable documentation

Asset<VoxelGrid> cubos::engine::RenderVoxelGrid::asset

Handle to the grid asset to be rendered.

When null, no grid will be rendered.