Repository navigation
Ariadne worlds L2: vehicle archetypes, WorldVehicles and vehicle_selector - #1144
Merged
Merged
Conversation
A world document's vehicles (world: vehicles: archetypes:) spawn as Jolt vehicles into the scene's own physics world, driven by nav@1 (a policy each) or held still, with identity and settings within ranges. The runtime (WorldVehicles, one per SceneWorld) publishes vehicles.* and entities.*; cvcGL draws each on its chassis (the vehicle-humvee package's Humvee.glb, fitted, when installed) and a vehicle_preview node draws the selected one. vehicle_selector.ari is the panel; world_source takes a world: arg; world_physics lists the vehicles.
The vehicle presets and override keys are no longer static tables, and the fitted vehicle models are the realized scene's (RealizedScene:: vehicle_models) instead of a function-local cache. vehicle_view.cpp's VTK header static goes on the allowlist, as every other cvcGL file's does.
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.
L2 in ARIADNE_WORLDS.md (sections 14 and 15): a world document's vehicles, spawned into the scene's own physics world in C++, and the lab's
vehicle_selectorpanel with its studio preview. There is no new demo: per the owner, demos wait for L3.Vehicle archetypes. The top-level
world:block lists the vehicles a world offers, as a list of their own besideavatars:, so the relay's avatar (the first avatar archetype) is unchanged:world_rules::vehicles, parsed and checked inworld_rules.cpp: plant (jolt;kinematic,dynamicanddynamic4ware accepted but refused at spawn), preset and overrides, look, ranges, controllers (nav@1ornone).AppRuntimenow keeps a document'sworld:block on every host and copies its vehicles intoScene::vehicles.The runtime:
WorldVehicles(world_vehicles.h), one perSceneWorld, with nothing process-wide. A host that runs several worlds (a relay's rooms, RM1 and WD3) runs one each.The same physics world. Each spawn is a Jolt vehicle in the scene's own
cvc::physics::world:nav_plantwithstep_worldoff, so the world steps once, on the clock. Vehicles collide with the scene's bodies and step with them; each chassis is a body.Controllers.
nav@1drives a vehicle from goal to goal across the grid of the world on: onesim_world, the batch kernel over the entities that use it, as Q9 proposed, with a policy per entity through the runtime's ownpolicy_library.noneparks it where it starts.Placing. A spawn starts at a given point or at a free point of the grid. A world switch, a Regenerate or a reload places every entity again on the new ground.
sim.restartputs each back where it started, at rest.Identity and settings. Each entity has a name, a team, two colours, metadata, mass and top speed, the settings held to the archetype's ranges.
nav_plant::add_desclets each spawn have its own vehicle description.C++ API:
spawn(entity_spec),despawn,clear,entities()(pose, speed, power, energy, wheel load, drag, gear),SceneWorld::bind_vehiclesandvehicles().Keys.
<prefix>.vehicles.*:selectedandselection.*(the selected archetype as a spawn would make it now);spawn.*keys and theirspawn.request,remove.*andclear.request.Under
<prefix>.entities.*the table.physics.stats.vehicleshas a line per vehicle, whichworld_physicsnow shows.Drawing (cvcGL) (vehicle_view.h)
look:is the vehicle-humvee package'sHumvee.glb, with its texture, when it is installed.find_vehicle_modellooks beside$CVC_NAV_BUNDLE, then undershare/cvc-scenesin$CVC_PREFIX,$CVCPKG_PREFIX,$CONDA_PREFIXand the program's prefix. The model is oriented and scaled to the chassis as the nav demos'load_vehicle_templatedoes it, without mirroring, and stands on the ground. Anything else, or a humvee without the package, is its chassis box in the entity's colours, with a cabin and wheels.type: vehicle_previewdraws the selected archetype in the spawn's colours on a scene of its own, turning.The panel:
vehicle_selector.ari(argsvehicles,entities,scene,view, listed in INDEX.ari) has:scenes:entry holding avehicle_previewnode;vehicle_selector_controlsis the same without the window.Panels name their runtime.
world_sourcetakes aworld:arg (defaultscene.world) instead of hardcoding it, asworld_physicsalready takesphysics:. That lets a room's or a mounted document's panels point at its runtime by an absolute root.Docs
world_source'sworld:arg.Tests (Windows Release)
ariadne_scene_world_test, 7 new tests (AriadneWorldVehicles.*):world:block's vehicles and their errors;AppRuntimetaking a document's vehicles;cvcgl_ariadne_physicstest_vehicles_drawn: a spawned vehicle drawn on its chassis and gone when removed; the preview rebuilt when the pick changes.AriadneComponents.VehicleSelectorBindsTheVehiclesKeys, andworld_source'sworld:arg inWorldSourceAndPhysicsBindTheWorldsKeys.arigl snapshoton a scratch document, which is not shipped: the panel, the studio preview with the textured Humvee, and the Humvee in the world on the ground with a crate landed on it.[Aa]riadne|[Nn]av|pycvc_world|pycvc_ari|cvcgl_ariadne|SceneWorld|[Pp]hysics|arigl|[Ww]orld[Rr]ules|room_rules|arisrv). The one failure was the new look test, which did not register theworld:block when it ran in a process of its own; it is fixed, and the affected suites then passed, 31 of 31.Not in this PR
pycvc_gl.carsreads.