The falling-cubes sample #74

Closed
opened 2026-09-05 09:37:00 +00:00 by crowmaki · 0 comments
Owner

Parent

Part of #67.

What to build

The sample is a physics demo. sample_scene declares requires on the mesh Interface and the Physics Interface and builds a Scene of GameObjects: a static plane (a wide, thin Box_Collider and a Mesh_Renderer on the shared cube mesh scaled by the local transform) and a fixed camera framing the plane and the drop column. It has no draw hook and never submits; the mesh pipeline draws the Components.

Spawning runs in fixed_update on an accumulator: the first cube on the first fixed step, then one per spawn interval of simulated time. Each cube is a GameObject at the drop height with a random offset inside the spawn radius, a uniformly random unit quaternion orientation, a random colour, and Mesh_Renderer, Rigidbody (Dynamic) and Box_Collider (half extents 0.5). Randomness comes from a generator seeded by a seed parameter. A cube whose World Transform falls well below the plane has its GameObject destroyed.

Params becomes seed, spawn interval, drop height, spawn radius, plane half extent. The grid, hero cube, -instances, -degeneracy and their tests go; -seed:N arrives; -frames and -dump-frame stay. Both executables list mesh pipeline, then box3d, then sample_scene, then controls, with a comment saying which orderings Core enforces.

Acceptance criteria

  • At the first frame the Schedule holds the plane and one cube; after N seconds of fixed steps it holds the plane and N+1 cubes, minus any culled out.
  • Two cubes' payload colours differ and their transforms differ in rotation.
  • A cube's transform descends across frames and settles.
  • The same seed reproduces identical Draw Records; a different seed does not.
  • Every spawned cube's corners are inside the View's clip volume at spawn.
  • Listing sample_scene before box3d fails engine_init with the missing-Interface error.
  • The winding and vertex-layout tests survive; the grid and hero tests are removed.
  • The headless sample runs to its frame budget and the windowed sample shows cubes falling onto a plane.

Blocked by

  • #70 Mesh_Renderer carries a colour and the mesh pipeline draws with depth
  • #71 A cube falls onto a plane
## Parent Part of #67. ## What to build The sample is a physics demo. `sample_scene` declares `requires` on the mesh Interface and the Physics Interface and builds a Scene of GameObjects: a static plane (a wide, thin `Box_Collider` and a `Mesh_Renderer` on the shared cube mesh scaled by the local transform) and a fixed camera framing the plane and the drop column. It has no `draw` hook and never submits; the mesh pipeline draws the Components. Spawning runs in `fixed_update` on an accumulator: the first cube on the first fixed step, then one per spawn interval of simulated time. Each cube is a GameObject at the drop height with a random offset inside the spawn radius, a uniformly random unit quaternion orientation, a random colour, and `Mesh_Renderer`, `Rigidbody` (Dynamic) and `Box_Collider` (half extents 0.5). Randomness comes from a generator seeded by a `seed` parameter. A cube whose World Transform falls well below the plane has its GameObject destroyed. `Params` becomes seed, spawn interval, drop height, spawn radius, plane half extent. The grid, hero cube, `-instances`, `-degeneracy` and their tests go; `-seed:N` arrives; `-frames` and `-dump-frame` stay. Both executables list mesh pipeline, then `box3d`, then `sample_scene`, then controls, with a comment saying which orderings Core enforces. ## Acceptance criteria - [ ] At the first frame the Schedule holds the plane and one cube; after N seconds of fixed steps it holds the plane and N+1 cubes, minus any culled out. - [ ] Two cubes' payload colours differ and their transforms differ in rotation. - [ ] A cube's transform descends across frames and settles. - [ ] The same seed reproduces identical Draw Records; a different seed does not. - [ ] Every spawned cube's corners are inside the View's clip volume at spawn. - [ ] Listing `sample_scene` before `box3d` fails `engine_init` with the missing-Interface error. - [ ] The winding and vertex-layout tests survive; the grid and hero tests are removed. - [ ] The headless sample runs to its frame budget and the windowed sample shows cubes falling onto a plane. ## Blocked by - #70 Mesh_Renderer carries a colour and the mesh pipeline draws with depth - #71 A cube falls onto a plane
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
crowmaki/cinnabar#74
No description provided.