The falling-cubes sample: a Scene of GameObjects dropping cubes onto a plane (#74) #106
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crowmaki/cinnabar!106
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-74-falling-cubes-sample"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #74, the last child of #67.
The sample
sample_scenerequires the mesh and Physics Interfaces and builds a Scene of GameObjects: a static plane with a wide, thinBox_Colliderand aMesh_Rendereron the shared cube mesh scaled by its local transform, and a fixed camera framing the plane and the drop column. It has nodrawhook and never submits.Spawning runs in
fixed_update: the first cube on the first fixed step, then one every spawn interval of fixed steps. Each cube is a GameObject at the drop height with a seeded random offset inside the spawn radius, a uniformly random unit quaternion (Shoemake), a random colour, andMesh_Renderer,Rigidbody(Dynamic) andBox_Collider(half extents 0.5). A cube whose World Transform falls 20 m under the plane is destroyed.Paramsis seed, spawn interval, drop height, spawn radius and plane half extent.-instancesand-degeneracygo (reported as unknown flags),-seed:Narrives,-framesand-dump-framestay.app.scene_pluginslistsmesh_pipeline,box3d,sample_scene, then controls, with a comment on which orderings Core enforces.The plane's collider arrives by a Scene Document: the
box3dPlugin builds the hull inon_add, whichcomponent_addruns before the caller can write half extents, so a document is the one path that lands the authored extents first. A comment in the sample records this.mat4_translateandmat4_from_quaternionjoinmat4_mulincore/math.Tests
All eight acceptance criteria are covered in
tests/core/sample_test.odin: plane plus one cube at the first frame and N+1 cubes after N seconds; spawn interval as a parameter; two cubes differ in colour and rotation; a cube descends and settles within the resting range and then stays; a cube that misses the plane is destroyed; the same seed reproduces Draw Records bit for bit and a different seed does not; every cube's corners are inside the clip volume on its spawn tick; listingsample_scenebeforebox3dfailsengine_init. The winding, projection and vertex-layout tests survive; the grid, hero, instance and degeneracy tests are gone.One deviation from the acceptance text: a mis-ordered list fails with
Requires_Order_Violation, which is what Core's existing requires-order check produces.Missing_Interfaceis only reported when nobody publishes the Interface at all.imgui_testlisted the sample without a physics Plugin and now listsbox3d.Shader test failures
tests/shaderccompared the committed generated Odin andshaders/cinnabar.slangbyte for byte against the generator, which writes LF, whilecore.autocrlf=truechecked them out as CRLF. A.gitattributeswith* text=auto eol=lfpins every text file to LF on checkout. The index was already LF, so no committed content changed.just allpasses. The headless sample runs to its frame budget and the windowed sample runs 240 frames and quits cleanly.