Repository navigation
world: one world_geometry for render, physics and nav; the city bundle loader (G3a) - #656
Merged
Merged
Conversation
…e loader (G3a) world::surface_registry's classes gain contact physics (mu, restitution, rolling resistance), so the renderer, physics and nav read one table. world::world_geometry holds the surface table and named items, each a shared cvc::geometry (a height_field or a mesh) with a default surface, a placement and roles (render, collide, navigate). Consumers share the objects, never copy them. world::load_city_bundle reads a cvc-scenes bundle into it: one terrain.json parser, north first as measured (5636 Austin buildings sit on the terrain at RMS 0.465 m that way, 14.3 m the other), flipped once into row 0 = min y; buildings.glb as one mesh with face materials, z up and not lifted. cvc::world never links cvc::nav, so land cover plugs in through a land_cover provider of per-sample surfaces (G4 supplies one). physics::add_world_geometry makes the static bodies and one material per surface used (reused by name); gl::add_world_geometry makes one node per render item sharing the item's arrays, coloured by surface albedo, posed by placement.
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.
Why
G3 of one world representation (
docs/roadmap/WORLD-GEOMETRY-ROADMAP.md): the world as data that the renderer, the physics layer and the navigator all read, and a loader that builds it from a city bundle once, correctly. The city demos switch over in the next PR (G3b).Change
world::surface_registry): every class gainsmu,restitutionandrolling_resistance, from the usual vehicle-dynamics tables (asphalt 0.9 / 0.010, sand 0.45 / 0.2, snow 0.25 / 0.05, ...).to_json.ontology_hash, which covers the fields nav's rasters depend on.world::world_geometry: the surface table plus named items.cvc::geometry(aheight_fieldor a mesh), with a default surface, a placement and roles (render, collide, navigate).addvalidates every surface id;terrain(),find(),bounds()andsurfaces_used().world::load_city_bundle(dir, options): oneterrain.jsonparser, replacing the four hand-written ones over time.buildings.glbbecomes one mesh with face materials (building_surface). It is z up, as the bundles are; a y-up option converts standard glTF. The buildings are not lifted.cvc::worldnever linkscvc::nav(L-system roadmap §14.4, checked at configure time, so a world bundle stays a file format). The loader therefore takes aland_coverprovider of per-sample surfaces and reduces it to cells (majority of the four corners, the SW corner's on a tie). Without one, every cell isterrain_surface. The nav-side provider oversegment_scene_materialcomes with G4.physics::add_world_geometry(world, g)(cvc/physics/world_geometry.h):mu, restitution and C_rr, and reused by name, so a second world adds no duplicates.nav_materialstays -1 until G4, rather than add a physics→nav edge before P4's plant seam.gl::add_world_geometry(sg, g)(cvcGL):GeometryNodeper render item, sharing the item's arrays.PHYSICS_API.mdand the roadmap, split G3 into G3a / G3b and recorded what G3a found.Verified (Windows, MSVC Release)
world_geometry_test8/8, with a synthetic bundle written by the test (a north-firstterrain.jsonand a hand-builtbuildings.glb):height()exactly, and Jolt's raycast agrees within 6 mm. A roof raycast hits the buildings body with thebuilding_concretematerial and itsmu. Materials are reused.CityBundle.RealBundleBuildingsSitOnTheTerrainwithCVC_CITY_BUNDLEpointing at austin_south (skipped in CI): 5636 buildings, base minus terrain RMS 0.465 m, within the ≤ 0.5 m gate.cvcgl_world_geometry_nodes(headless): one node per render item, the node's points buffer is the item's (no copy), colours from the cell surfaces, placement as pose.ctest -R '^(World|CityBundle|PhysicsWorldGeometry|Geometry|HeightField|Physics|Nav|Model|Lod|Tiles|Pyramid|Assimp|Building|Road|cvcgl_(physics_scene_binding|world_geometry_nodes|pose_matrix|pose_echo|state_publisher))': 642/642 pass.