Vehicles: wheel size, width and position from the fragment's collision discs #49

Manually merged
github merged 1 commit from gh-pr/49/head into gh-pr/49/base 2026-11-26 20:05:48 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-23 14:24 UTC · original
holdmysocks:claude/vehicle-wheel-discs → master · +217 −23 · 3 files · 1 commits · merged 2026-11-23 14:43 UTC

Follow-up to #47, which sized wheels as 2 x wheelScale. That made the tyre as big as the wheel arch on about half the cars. The real size is stored.

  • Wheel collision discs. A vehicle fragment's physics is an embedded composite bound; each wheel is a type 8 child, a disc with the tyre's radius (+0x14) and half width (+0x2C, the margin), placed on the wheel's axle line. model.json now lists them as wheel_discs and gives each wheel_mounts entry its radius, half_width and centre.
  • Viewer. Wheels are sized to the stored radius and width and placed on the disc's centre. A vehicle without discs keeps 2 x wheelScale, fitted to its wheel arch and fork (estimates).
  • Viewer bug. The fit was computed against the previously loaded tyre model and not redone when the car's own tyre arrived, so some cars came out up to 28 % too small. It is recomputed when the wheel models finish loading.
  • A vehicle with data but no configuration takes a plain rim and tyre instead of the previous vehicle's.

The viewer re-exports cached vehicles that predate this.

Checked

  • In the viewer: blast, blazer4, blista2, bogan, buffalo, buffalo6, cheetah2, comet7, brigade, caddy, cliffhanger, phoenix, dubsta, mobilityscooter, towtruck, bmx.
  • Over 243 wheeled _hi vehicles, 228 had a disc on every wheel when matched on the pivot (before matching along the axle line, not recounted); helicopters have none.
  • 132 core tests pass.

Not decoded

The rim's own radius: rim and tyre are scaled together. What wheelScale measures is open.

**@⁠holdmysocks** on GitHub · 2026-11-23 14:24 UTC · [original](https://github.com/holdmysocks/SixNG/pull/49) `holdmysocks:claude/vehicle-wheel-discs` → `master` · +217 −23 · 3 files · 1 commits · merged 2026-11-23 14:43 UTC Follow-up to #47, which sized wheels as 2 x `wheelScale`. That made the tyre as big as the wheel arch on about half the cars. The real size is stored. - **Wheel collision discs.** A vehicle fragment's physics is an embedded composite bound; each wheel is a type 8 child, a disc with the tyre's radius (+0x14) and half width (+0x2C, the margin), placed on the wheel's axle line. `model.json` now lists them as `wheel_discs` and gives each `wheel_mounts` entry its `radius`, `half_width` and `centre`. - **Viewer.** Wheels are sized to the stored radius and width and placed on the disc's centre. A vehicle without discs keeps 2 x `wheelScale`, fitted to its wheel arch and fork (estimates). - **Viewer bug.** The fit was computed against the previously loaded tyre model and not redone when the car's own tyre arrived, so some cars came out up to 28 % too small. It is recomputed when the wheel models finish loading. - A vehicle with data but no configuration takes a plain rim and tyre instead of the previous vehicle's. The viewer re-exports cached vehicles that predate this. ## Checked - In the viewer: blast, blazer4, blista2, bogan, buffalo, buffalo6, cheetah2, comet7, brigade, caddy, cliffhanger, phoenix, dubsta, mobilityscooter, towtruck, bmx. - Over 243 wheeled `_hi` vehicles, 228 had a disc on every wheel when matched on the pivot (before matching along the axle line, not recounted); helicopters have none. - 132 core tests pass. ## Not decoded The rim's own radius: rim and tyre are scaled together. What `wheelScale` measures is open.
A vehicle fragment's physics is an embedded composite bound (type 6, the
layout of a bounds resource but not at the root). Each wheel is a child of
type 8, a disc on the X axis: +0x14 radius, +0x2C margin = half the width,
bbox max = (margin, radius, radius). The child's transform puts it on the
wheel's axle line, up to a few cm in or out of the wheel bone's pivot. A
second, thinner disc per wheel is the brake disc.

- model.json: wheel_discs lists them; each wheel_mounts entry gets the
  radius, half_width and centre of the largest disc on its axle line.
  Over 243 wheeled _hi vehicles, 228 had a disc on every wheel when
  matched on the pivot; helicopters have none.
- Viewer: wheels are sized to the stored radius, narrowed or widened to
  the stored width and placed on the disc's centre. This replaces
  2 x wheelScale, which made the tyre as big as the wheel arch on about
  half the cars (median 0.96 of the arch radius over 213 vehicles).
- Viewer: a vehicle without discs keeps 2 x wheelScale, now fitted to its
  wheel arch (the tyre reaches 93 % of the nearest body vertex above the
  axle, 0.6 to 1.5 times) and, on two-wheelers, to its fork. Estimates.
- Viewer: the fit is recomputed when the wheel models finish loading. It
  was computed against the tyre loaded before and kept, so a car whose
  tyre differs from the previous one came out wrong (28 % too small with
  a low-profile tyre after a muscle tyre).
- Viewer: a vehicle with data but no configuration takes a plain rim and
  tyre, not those of the vehicle opened before. Cached vehicle exports
  from before the discs are exported again.

Checked in the viewer on blast, blazer4, blista2, bogan, buffalo,
buffalo6, cheetah2, comet7, brigade, caddy, cliffhanger, phoenix, dubsta,
mobilityscooter, towtruck and bmx.

Not decoded: the rim's own radius. Rim and tyre are scaled together, so
the rim follows the tyre model's proportions. What wheelScale measures is
open: read as the rim radius it gives 21 inch rims on a small hatchback,
read as the tyre radius it is far too small (stored radius 0.325 against
wheelScale 0.269 there; the ratio runs 0.3 to 2.1 over the fleet).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:05:46 +00:00
github manually merged commit 247c4228be into gh-pr/49/base 2026-11-26 20:05:48 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.