Skip to main content

Module shared

Module shared 

Source
Expand description

The scene’s assets, built once in the render world.

The render world allocates the meshes and materials in one job and publishes them. Every shape a drop needs is its own render instance, asked for when the drop happens; an instance the camera can no longer see is despawned by the render world, so nothing is kept hidden for reuse.

Re-exportsΒ§

use unlit_ecs::bundle; πŸ”’
use unlit_ecs::Bundle; πŸ”’
use unlit_ecs::DynamicBundle; πŸ”’
use unlit_ecs::World; πŸ”’
use unlit3d::components::Transform; πŸ”’
use super::HIDDEN_POSITION; πŸ”’
use super::Scene; πŸ”’
use super::shapes::BALL_COLORS; πŸ”’
use super::shapes::PATTERN_SIZE; πŸ”’
use super::shapes::SHAPE_KINDS; πŸ”’
use super::shapes::pattern_texture; πŸ”’
use super::shapes::shape_mesh; πŸ”’
use super::tick::advancing; πŸ”’
use crate::render::RenderEntity; πŸ”’
use crate::render::allocate_mesh; πŸ”’
use crate::render::allocate_rgba_material; πŸ”’
use crate::render::hidden_instance_of; πŸ”’
use crate::render::linear_sampler; πŸ”’
use unlit3dx::prelude::*; πŸ”’

StructsΒ§

SceneAssets
The render entities a shape is built from, in kind-major order.
SceneBuild πŸ”’
The scene’s assets and the tick that collects them.
SceneState
The scene’s assets, on their own entity in the gameplay world.

FunctionsΒ§

build_assets πŸ”’
Allocate the scene’s meshes and materials, and answer their entities.
create_instance
Spawn one hidden instance wearing the assets it names, and answer it.
look
The kind and color a drop wears, as indices into SceneAssets.