Skip to content

Ariadne: the Humvee in parts by default, its wheels turning; one Humvee loader - #1569

Merged
transfix merged 2 commits into
masterfrom
ariadne/humvee-parts-default
Nov 27, 2026
Merged

transfix merged 2 commits into
masterfrom
ariadne/humvee-parts-default

Conversation

@transfix

@transfix transfix commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

vehicle-humvee 1.0.0+cvc.5 (cy-pca/graphics-assets#21) ships its Humvee in parts beside Humvee.glb: share/cvc-scenes/shared/humvee/chassis.glb, humvee/wheel.glb and humvee/rig.json. The parted look (#1471, in 4.0.6+) already draws those parts with rolling, steering wheels. But nothing used them: every Ariadne Humvee drew the one-piece model, whose wheels never move.

This PR makes the parts the default. It also removes the copies of the Humvee loading code, so every Ariadne Humvee loads the same way.

The default look (commit 1)

  • resolve_vehicle_looks (world_vehicles.cpp) prefers the parts for:

    • a humvee with no look:;
    • look: { model: humvee } with no scale:, yaw: or z:. A parted look ignores those keys, so a placed model stays the one piece. A model look is always fitted, so fit: false never applied.

    It looks up find_vehicle_model("humvee/chassis.glb") and needs wheel.glb and rig.json in the same directory. If they are not all there, the look is Humvee.glb, then the box, as before.

  • A look that names a file is unchanged: file:, or data: with file:.

  • Relays. The parted look also keeps Humvee.glb in vehicle_look::path. A relay sends an entity's look as its kind and file only (room_entities), so a room's clients still draw the one piece, not the box. Sending the parts over the relay would be a follow-up.

  • world_lab.ari: its Humvee is now look: { data: humvee, chassis: humvee/chassis.glb, wheel: humvee/wheel.glb, rig: humvee/rig.json }.

  • Docs: docs/ARIADNE.md ("Looks", and a new "The Humvee in parts" item under "A model in parts") and ARIADNE_WORLDS.md's looks line.

One loader (commit 2)

  • vehicle_look_named(name) (world_vehicles.h) resolves a look by name the way resolve_vehicle_looks resolves a world vehicle's:
    • humvee is the default look;
    • a file that exists is that file, fitted;
    • any other name is model: NAME.
  • The swarm layer (swarm_nodes.cpp; used by nav_city_swarm.ari and nav_city_drive.ari):
    • Deleted read_vehicle, vehicle_template (a copy of fit_vehicle_geometry) and its own Humvee.glb search, including the ../shared guesses beside a city bundle.
    • An agents layer's look is now vehicle_look_named(look), and its template comes from vehicle_look_mesh_of, as an entity layer's does. With the parts installed, its wheels are baked in at rest, in a tyre's dark.
    • Its LOD rungs stay on mesh_lod, through the new decimate_mesh_by_role.
  • decimate_mesh_by_role (mesh_lod.h) is entity_view's per-role decimation, moved there so both layers share it. Coarse rungs keep their tyres dark.
  • nav_scrub:
    • Its runs take vehicle_look_named("humvee") instead of picking Humvee.glb (the bundle's copy, else find_vehicle_model).
    • A parted look is attached with attach_parted_model.
    • Each frame parted_wheel_poses poses the wheels. They roll by the distance driven to the play head (the logged speed, summed and interpolated between ticks) over the wheel radius. The front pair turns by the logged tel.steer.
    • One change in behaviour: --bundle DIR's own copy of Humvee.glb is no longer looked for. $CVC_NAV_BUNDLE and installed prefixes still are.
  • pycvc_gl: fit_vehicle_geometry is bound (pycvc_gl.fit_vehicle_geometry), and VehicleModel fits with it in place of its numpy copy of the same fit.

Not touched:

Tests

Run locally on Windows (MSVC, shared):

  • AriadneWorldVehicles.TheHumveeIsInPartsWhereTheyAreInstalled (core). In a fixture prefix:

    • the default and model: humvee resolve to the three parts, with the one piece kept in path;
    • yaw:, z: and file: Humvee.glb keep the one piece;
    • resolving again gives the same look;
    • vehicle_look_named gives the same looks by name;
    • without rig.json the look is the one piece, and with neither it is the box.

    All 36 AriadneWorldVehicles.* pass.

  • cvcgl_ariadne_wheeled_look test 5. A fixture prefix holds the fixture's meshes written as .glb. A vehicle: humvee archetype with no look:

    • draws vehicle_1_chassis and four wheels, and its vehicle_preview draws the parts too;
    • with only Humvee.glb, draws vehicle_1_mesh;
    • with neither, draws vehicle_1_body.

    131/131 checks pass.

  • cvcgl_ariadne_swarm, new "humvee" section. look: humvee over an installed parts fixture draws tyre-dark wheel points on its finest and its coarsest rung. 28/28 checks pass.

  • cvcgl_ariadne_entities (64/64) and cvcgl_ariadne_physics pass after the make_rungs refactor.

  • The pycvc change is checked by CI only: test_pycvc_gl_ariadne_host.py's vehicles case runs VehicleModel on its fixture.

Checked in arigl (this branch, vehicle-humvee cvc.5 on CVC_PREFIX):

  • A humvee with no look: draws the parts, and its front wheels turn with the steer.
  • nav_city_swarm.ari --follow 3 --capture follow draws the Humvee in the swarm. Its far, team-coloured copies keep dark tyres.
  • world_lab.ari's Vehicles preview draws the parted data look. With the network off, it uses the installed parts.

Cost

From the previous session's bench (arigl 4.0.9, 240 kinematic vehicles, medians in ms per frame):

  • chase view: 62.8 one piece, 62.5 parted;
  • overhead view: 19.8 one piece, 23.7 parted. The ranges overlap.

A promoted vehicle is 5 draws instead of 1. The fleet and swarm layers' instanced copies are one merged mesh either way.

vehicle-humvee 1.0.0+cvc.5 ships its Humvee in parts beside Humvee.glb:
share/cvc-scenes/shared/humvee/chassis.glb, wheel.glb and rig.json
(cy-pca/graphics-assets#21). A world vehicle's look now draws those
where it used to draw the one-piece model, so its wheels roll and its
front pair steers (the parted look, #1471).

- resolve_vehicle_looks: a humvee with no look:, or `model: humvee`
  with no scale:, yaw:, z: or fit: false, is a parted file look when
  all three parts are installed in one directory. If they are not, it
  is Humvee.glb, then the box, as before. A look that names a file
  (`file:`, or `data:` with `file:`) does not change.
- The parted look keeps Humvee.glb in its path. A relay sends an
  entity's look as its kind and file only (room_entities), so a room's
  clients still draw the one piece and not the box.
- world_lab.ari: its Humvee is
  { data: humvee, chassis: humvee/chassis.glb, wheel: humvee/wheel.glb,
  rig: humvee/rig.json }.
- docs/ARIADNE.md ("Looks", "A model in parts") and ARIADNE_WORLDS.md
  describe the new default.
- Tests: AriadneWorldVehicles.TheHumveeIsInPartsWhereTheyAreInstalled
  (core), and test_default_humvee in cvcgl_ariadne_wheeled_look. With
  the parts installed in a fixture prefix (.glb files), a `vehicle:
  humvee` archetype with no look draws vehicle_1_chassis and four
  wheels, and so does its vehicle_preview. Without them it draws the
  one-piece model, and with neither, the box.
The swarm layer, nav_scrub and pycvc_gl's VehicleModel each had their
own Humvee search and fit. They now use the shared code, so they get
the Humvee in parts too.

- vehicle_look_named(name) (world_vehicles.h) resolves a look by name
  the way resolve_vehicle_looks resolves a world vehicle's. `humvee` is
  the default look: the parts, else Humvee.glb, else the box. A file
  that exists is that file, fitted. Any other name is `model: NAME`.
- swarm_nodes: read_vehicle, vehicle_template (a copy of
  fit_vehicle_geometry) and its own path search are gone. This
  includes the ../shared guesses beside a city bundle. An agents
  layer's look is vehicle_look_named(look), and its template comes
  from vehicle_look_mesh_of, as an entity layer's does. With the parts
  installed, its wheels are baked in at rest in a tyre's dark. The
  glyphs keep a point's own colour (role 2) when they build and
  recolour.
- mesh_lod: decimate_mesh_by_role. This is entity_view's per-role
  decimation, moved here so both layers share it. The swarm's LOD rungs
  now use it, so the coarse rungs keep the tyres dark.
- nav_scrub: its runs take vehicle_look_named("humvee") instead of
  picking Humvee.glb (the bundle's copy, else find_vehicle_model). A
  parted look is attached with attach_parted_model. Its wheels are
  posed each frame by parted_wheel_poses: rolled by the distance driven
  to the play head (the logged speed, summed, interpolated between
  ticks) over the wheel radius, and the front pair turned by the logged
  tel.steer.
- pycvc_gl: fit_vehicle_geometry is bound, and VehicleModel fits with
  it in place of its numpy copy of the same fit.
- `model: humvee, fit: false` gets the parts too. A model look is
  always made fitted, so `fit: false` never applied to it. Only
  scale:, yaw: and z: keep the one piece.
- Tests: AriadneWorldVehicles.TheHumveeIsInPartsWhereTheyAreInstalled
  checks vehicle_look_named. cvcgl_ariadne_swarm's new humvee section
  installs a fixture of .glb parts and checks that `look: humvee` draws
  tyre-dark wheel points on the finest rung and the coarsest.
@transfix transfix changed the title Ariadne: the Humvee in parts by default, its wheels turning (vehicle-humvee cvc.5) Ariadne: the Humvee in parts by default, its wheels turning; one Humvee loader Nov 27, 2026
@transfix
transfix enabled auto-merge (squash) November 27, 2026 06:31
@transfix
transfix merged commit 5ce348d into master Nov 27, 2026
31 checks passed
@transfix
transfix deleted the ariadne/humvee-parts-default branch November 27, 2026 07:48
transfix added a commit that referenced this pull request Nov 27, 2026
master's #1569 moved entity_view's per-role decimation into mesh_lod's
decimate_mesh_by_role. This branch's fallback (a role that collapses at a rung keeps
its coarsest decimation so far, not its whole mesh) now lives there, as an optional
role_decimations cache that a ladder of rungs passes from finer to coarser.
make_rungs passes it; swarm_nodes does not, so the swarm view is unchanged.
transfix added a commit that referenced this pull request Nov 27, 2026
nav_city_swarm.ari and nav_city_drive.ari named themselves ports of examples/nav/*.cpp files this change deletes, and vehicle_view.cpp's fitted_model comment named nav_common's load_vehicle_template. Each now says the program is retired; the comment names fit_vehicle_geometry, which pycvc_gl's VehicleModel calls since #1569.
transfix added a commit that referenced this pull request Nov 27, 2026
One conflict, in inc/cvc/ariadne/world_rules.h's vehicle_look: this branch's
`texture` flag beside #1569's new comment on the parted-look fields (the default
Humvee in parts keeps a one-piece path). Both kept.
transfix added a commit that referenced this pull request Nov 27, 2026
nav_city_swarm.ari and nav_city_drive.ari named themselves ports of examples/nav/*.cpp files this change deletes, and vehicle_view.cpp's fitted_model comment named nav_common's load_vehicle_template. Each now says the program is retired; the comment names fit_vehicle_geometry, which pycvc_gl's VehicleModel calls since #1569.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant