Repository navigation
ariadne: built-in sim.step and sim.restart (L0, last part: step and restart) - #1097
Merged
Merged
Conversation
…estart) - Every AppRuntime handles sim.step and sim.restart, the bare-name events sim_transport.ari's Step and Restart raise; a host's own Runtime::on replaces them. step_world(n) adds n to the scene clock's step key (<prefix>.sim.step by default), so the clock runs n more quanta whether this runtime drives it or an adapter does. restart_world() resets app.world_clock() to tick 0, rebuilds the scene's world, and adds one to <prefix>.sim.restarts. - SceneWorld::restart rebuilds the world as build() made it: the same physics::world object, a fresh one with the same config and materials, each body made again in the same order (so the same ids), each tracked node's colliders as they are now. The next follow() anchors on the clock again. A restarted world steps exactly as a world loaded fresh. - SceneAdapter::restart (default false); cvcGL's adapter calls restart_scene_world, which rebuilds a RealizedScene's world and binds its moving nodes again (RealizedScene::body_nodes). - pycvc AriApp: step_world(n), restart_world().
…/world-sim-verbs-picking # Conflicts: # inc/cvc/ariadne/app_runtime.h
…orld EachPolicyDrivesItsOwnAgents checked one coordinate of agent 1. On macOS, scatter_free's draw (std::uniform_*_distribution, which differs between standard libraries) puts that agent where it ends at the same x under both policies, so package-macos failed. Compare every agent's position instead.
transfix
added a commit
that referenced
this pull request
Nov 9, 2026
…acOS) The test asserted that agent 2 ends somewhere different under the two policies, but scatter_free's draw differs between standard libraries, and on macOS that agent starts where neither policy moves it: both runs leave it at the same point and the check fails. Compare every agent's position instead. The same change as #1097.
transfix
added a commit
that referenced
this pull request
Nov 10, 2026
#1096) * cloud_sky: near clouds over far ones, far clouds as view-aligned slices Near clouds showed behind far ones for two reasons. A near volume drew the copy of its cloud nearest the ground's centre, but the deck's pattern repeats out to far_reach, so with the camera at the ground's edge or past it the clouds in front of it were drawn by the coarse far deck, fuzzy, over crisp volumes further off. The near volumes now take the copies nearest the camera, ranking clouds out of view last. And the near volumes drew in whatever order they joined the renderer; they now draw after the far deck, farthest first. The far deck is drawn as VolSlice draws a volume: planes facing the camera, cut to the deck's box by cvc::volslice (new compute_slices_at, the same plane/box clip at the caller's distances) and blended back to front, spaced wider with distance, at most 64. Each slice marches the slab behind it, within the deck, so seen edge-on the far clouds no longer break into horizontal streaks. * nav: EachPolicyDrivesItsOwnAgents compares the whole world's poses (macOS) The test asserted that agent 2 ends somewhere different under the two policies, but scatter_free's draw differs between standard libraries, and on macOS that agent starts where neither policy moves it: both runs leave it at the same point and the check fails. Compare every agent's position instead. The same change as #1097. * cloud_sky: the far clouds are a VolSliceNode The far clouds were their own mesh of view-aligned slices that only borrowed cvc::volslice's plane clip. They are now a VolSliceNode, given the deck's coarse opacity as its volume, which gains what they need: - distance slicing (setDistanceSlicing): planes facing the camera at distances growing by a fixed fraction, from compute_slices_at, each cut to the box grown by a share of its slab's depth; - a sample shader of the caller's (setSampleShader) in place of the volume-then-LUT lookup, seeing the fragment's local position and the camera's eye, view direction and the slices' growth; - repeat wrap on the volume texture (setVolumeWrap) and vertices past the far plane drawn on it (setClampToFarPlane); - a node drawn with the volumes leaves the renderer's order-independent translucency on. The clouds' lighting march is the sample shader. Native snapshots match the previous mesh's from all five views. setDistanceSlicing is left out of pycvc (std::optional of a nested struct). * Align the far-cloud constant comments for clang-format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first half of L0's last part in ARIADNE_WORLDS.md (section 14, "Built-in handlers for
sim.stepandsim.restart"). Click-to-world picking in a viewport, the other half, comes in its own PR.Built-in handlers. Every
AppRuntimenow handlessim.stepandsim.restart, the bare-name events thatsim_transport.ari's Step and Restart buttons raise. Until now nothing in libcvc handled them: onlynav_convoyregistered its own. A host's ownon("sim.step", ...)still replaces the built-in one.step_world(n)addsnto the scene clock's step key (<prefix>.sim.stepby default, resolved as the clock's driver resolves it). The clock then runsnmore quanta, paused or not. It works whether the runtime drives the clock itself (headless) or an adapter does (cvcGL), because both drivers read the same key. For a document with no scene it does nothing.restart_world():app.world_clock()back to tick 0;SceneAdapter::restart);<prefix>.sim.restarts, so a program or a host can reset state of its own.SceneWorld::restart. This rebuilds the world asbuild()made it.physics::worldobject and builds a fresh one into it, with the same config and materials.build()made it, so the ids stay the same. Each starts where its node put it, at rest unless it declared a velocity.follow()anchors on the clock again.cvcGL.
restart_scene_world(RealizedScene&)rebuilds a drawn scene's world and binds its moving bodies' nodes again (RealizedScene::body_nodes).AriRuntime's adapter implementsSceneAdapter::restartwith it.pycvc.
AriApp.step_world(n)andAriApp.restart_world().Docs
sim_transport.ariandINDEX.aricomments.Tests (Windows Release)
AriadneSceneWorld.SimStepAndRestartAreBuiltIn, headless, on a paused clock:cvcgl_ariadne_physics'stest_restart_drawn_world: a drawn scene restarts into the samephysics::worldobject with the build's state hash, and after the same frames reaches the same hash.pycvc_ariadne:AriApp.step_worldbumps the step key and runs the paused world;restart_worldcounts the restart and the world steps as before.[Aa]riadne|[Ss]ceneWorld|scene_world|[Cc]lock|[Pp]hysics|pycvc|cvcgl_ariadne|[Nn]avConvoy|nav_convoy, exceptAriadneUri.StoreFileAtomicallyOverwrites, which failed once under-j8(a temp file) and passed when run alone.Not in this PR: viewport picking.
nav_convoykeeps its own handlers, since it drives a rawRuntime.