Expand description
The animated-grid scene: meshes allocated, recycled and moved across eight frames.
Ported from the ecs_animated_scene_matches_snapshots test. One world is
evolved over several frames: meshes are allocated, some are recycled, the
moving ones translate and rotate, and the camera orbits the grid. Every
frame is stored as its own snapshot, so the sequence shows what a wrong
pooled range, a stale metadata entry or a mispacked instance looks like
from frame to frame.
Re-exportsΒ§
use super::SEQUENCE_STEP;πuse super::SceneControl;πuse super::SceneDef;πuse super::SceneOptions;πuse super::TEST_SIZE;πuse unlit_ecs::Bundle;πuse unlit_ecs::DynamicBundle;πuse unlit_ecs::bundle;πuse unlit3d::prelude::*;π
StructsΒ§
- Cell
Cube π - One cell of the grid: a cube placed at the cell this frame fills.
- Step π
- What a frame changes structurally, on top of the motion every frame applies.
ConstantsΒ§
- CELLS π
- CELL_
SPACING π - COLUMNS π
- The grid of cells a cube can occupy, in the XZ plane.
- GRID_
TARGET π - The point the orbiting camera looks at.
- ORBIT_
HEIGHT π - ORBIT_
RADIUS π - Where the camera orbits, and how high above the grid it sits.
- ORBIT_
STEP π - Radians the camera advances per frame.
- ROWS π
- STEPS π
- The structural change of each frame, as the snapshot test froze it.
- TINTS π
- The per-instance base colors the allocations cycle through.
StaticsΒ§
- SCENE
- The scene: a 3x3 grid of cubes that fills, moves and recycles over eight frames, each stored as its own snapshot.
FunctionsΒ§
- build π
- Build the animated-grid sceneβs world content.
- cell_
center π - The world-space centre of
cell. - cell_
transform π - The placement a cellβs mesh has in
frame. - orbit_
camera π - The camera of
frame, orbiting the grid once over the whole sequence. - orbit_
eye π - Where the camera of
frameorbits.