@adatechnology/game-urban 0.5.4 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -238,7 +238,7 @@ the road, z along the line) with every fixing point read from its `slots`, the s
238
238
  - **A crater over them** (`breachOf(pieces, { x, z, radius, depth })`): the bowl is a paraboloid; a pipe whose top the bowl gets down to is
239
239
  `reached`, one whose centre line it gets to is `severed` and says what leaks (`sewage`, `stormwater`, `water`); the covers inside the bowl are
240
240
  listed to be thrown. Pure: the same answer for the same bowl.
241
- - **What a break lets out and cuts** (`leaksOf`, `waterOutageOf`, `drainLeak`): a severed pipe is a `NetworkLeak` of its content at the break: water under pressure (6 l/s a main, 0.8 a service), sewage a slow run (0.5, 0.15), stormwater only when `isRaining`; each is finite (`rate` times `seconds` of `DEFAULT_LEAK_RULES`, patchable) and `drainLeak(startLeak(leak), dt)` gives what a step lets out until nothing is left. `waterOutageOf(networks, { before, after })` is the water a break cuts: the nodes the reservoir no longer reaches and the lots among them (a tree loses all downstream of the break), only what is new since `before`.
241
+ - **What a break lets out and cuts** (`leaksOf`, `waterOutageOf`, `drainLeak`): a severed pipe is a `NetworkLeak` of its content at the break: water under pressure (6 l/s a main, 0.8 a service), sewage a slow run (0.5, 0.15), stormwater only when `isRaining`; each is finite (`rate` times `seconds` of `DEFAULT_LEAK_RULES`, patchable) and `drainLeak(startLeak(leak), dt)` gives what a step lets out until nothing is left. `waterOutageOf(networks, { before, after })` is the water a break cuts: the nodes the reservoir no longer reaches and the lots among them (a tree loses all downstream of the break), only what is new since `before`. `leakOfPipe(pipe, reached, options)` is the same rule for one `PipePiece` of any owner: the houses' own buried pipes (`createHouseBuriedPipes` of `game-floorplan-three`) leak with it.
242
242
  - **The hole and the cover** (`openingOf`, `coverBodyOf`): a cover thrown off leaves the square of its shaft dug to the shaft's floor (a `GroundExcavation` for `Terrain.open`), and is itself a plate of its material (cast iron) as a `DestructibleSpec`, with its mass, for the host to hand to the destruction world as a loose piece.
243
243
  - Limits: straight streets along x or z only (another stretch throws); the ground defaults to flat (`groundAt` for terrain). The pole tree
244
244
  and the line trees are plain Dijkstra (tens of nodes a system); the nearest pole and the crossings are found by 20-40 m cells.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { L as LightAllowance, U as UrbanBuilder, D as DistrictKindDef, C as CityPlanInput, T as TowerPreset, F as FillBlockOptions, B as BlockBuilding, a as CityPlanDef, b as LayoutOptions, c as CityLayout, K as KindStats, d as Block, e as FillBlockCityOptions, f as ComposeOptions, g as UrbanKitCore, N as NeighbourhoodPattern, h as Composer, i as UrbanPlan, j as Locale, P as Point, R as Rect, k as TerrainOptions, l as TerrainGrid, m as PoleDef, n as PoleOptions, o as PoleShapeBuilder, p as TowerOptions, q as BuildingOptions, S as SilhouetteFactory, H as HouseProvider, r as PlantRequest, V as VehicleRequest, s as PlantProvider, t as VehicleProvider } from './types-mY6VwZgN.js';
2
- export { u as BarSpec, v as BlockUse, w as CityScale, x as ColorRule, y as ComposeContext, z as ConePart, A as CrossarmSpec, E as CrownPart, G as DEFAULT_FACADES, I as DEFAULT_POLES, J as DEFAULT_STOREY_PRESETS, M as DEFAULT_TOWER_PRESETS, O as DistributionPoleDef, Q as DistributionSpec, W as DistrictKindText, X as DoubleArmSpec, Y as Flatten, Z as Flickering, _ as FloodTowerSpec, $ as ForestOptions, a0 as HouseRequest, a1 as ItemBox, a2 as LabelPart, a3 as Lake, a4 as LampLightSpec, a5 as LampShares, a6 as LampSpec, a7 as LampState, a8 as LampStateParams, a9 as LanternSpec, aa as LensSpec, ab as LightBudget, ac as LightPart, ad as MastSpec, ae as POLE_SHAPES, af as PartStyle, ag as PatternText, ah as PlacementPart, ai as PlanDistrict, aj as PlanLandmark, ak as PlanLine, al as PlanPoint, am as PlanRect, an as PlanePart, ao as PoleSlotBand, ap as PoleSlots, aq as Providers, ar as Ramp, as as ResolvedDistrict, at as River, au as RiverBed, av as SingleArmSpec, aw as TOWER_DEFAULTS, ax as TerrainLayer, ay as TerrainPart, az as TowerProvider, aA as TowerRequest, aB as Trig, aC as UrbanBuilderOptions, aD as UrbanPart, aE as UrbanScene, aF as VaultPart, aG as Wave, aH as WorldFrame, aI as assertLampShares, aJ as createTowerDrawer, aK as createUrbanBuilder, aL as drawBuilding, aM as drawTower, aN as fillBlock, aO as flickerPhaseOf, aP as lampStateOf, aQ as pickTowerPreset, aR as towerPresetOf, aS as towerStoreys } from './types-mY6VwZgN.js';
1
+ import { L as LightAllowance, U as UrbanBuilder, D as DistrictKindDef, C as CityPlanInput, T as TowerPreset, F as FillBlockOptions, B as BlockBuilding, a as CityPlanDef, b as LayoutOptions, c as CityLayout, K as KindStats, d as Block, e as FillBlockCityOptions, f as ComposeOptions, g as UrbanKitCore, N as NeighbourhoodPattern, h as Composer, i as UrbanPlan, j as Locale, P as Point, R as Rect, k as TerrainOptions, l as TerrainGrid, m as PoleDef, n as PoleOptions, o as PoleShapeBuilder, p as TowerOptions, q as BuildingOptions, S as SilhouetteFactory, H as HouseProvider, r as PlantRequest, V as VehicleRequest, s as PlantProvider, t as VehicleProvider } from './types-B5jMjKip.js';
2
+ export { u as BarSpec, v as BlockUse, w as CityScale, x as ColorRule, y as ComposeContext, z as ConePart, A as CrossarmSpec, E as CrownPart, G as DEFAULT_FACADES, I as DEFAULT_POLES, J as DEFAULT_STOREY_PRESETS, M as DEFAULT_TOWER_PRESETS, O as DistributionPoleDef, Q as DistributionSpec, W as DistrictKindText, X as DoubleArmSpec, Y as Flatten, Z as Flickering, _ as FloodTowerSpec, $ as ForestOptions, a0 as HouseRequest, a1 as ItemBox, a2 as LabelPart, a3 as Lake, a4 as LampLightSpec, a5 as LampShares, a6 as LampSpec, a7 as LampState, a8 as LampStateParams, a9 as LanternSpec, aa as LensSpec, ab as LightBudget, ac as LightPart, ad as MastSpec, ae as POLE_SHAPES, af as PartStyle, ag as PatternText, ah as PlacementPart, ai as PlanDistrict, aj as PlanLandmark, ak as PlanLine, al as PlanPoint, am as PlanRect, an as PlanePart, ao as PoleSlotBand, ap as PoleSlots, aq as Providers, ar as Ramp, as as ResolvedDistrict, at as River, au as RiverBed, av as SingleArmSpec, aw as TOWER_DEFAULTS, ax as TerrainLayer, ay as TerrainPart, az as TowerProvider, aA as TowerRequest, aB as Trig, aC as UrbanBuilderOptions, aD as UrbanPart, aE as UrbanScene, aF as VaultPart, aG as Wave, aH as WorldFrame, aI as assertLampShares, aJ as createTowerDrawer, aK as createUrbanBuilder, aL as drawBuilding, aM as drawTower, aN as fillBlock, aO as flickerPhaseOf, aP as lampStateOf, aQ as pickTowerPreset, aR as towerPresetOf, aS as towerStoreys } from './types-B5jMjKip.js';
3
3
  import { DeepPartial } from '@adatechnology/game-contracts';
4
4
  import { RandomSource } from '@adatechnology/game-floorplan';
5
5
  export { RandomSource, Silhouette, SilhouettePart, SilhouetteWindow } from '@adatechnology/game-floorplan';
@@ -3099,8 +3099,12 @@ var GameUrban = (() => {
3099
3099
  for (const part of silhouette.parts) parts.push(part.parent < 0 ? part : { ...part, parent: part.parent + offset });
3100
3100
  for (const window of silhouette.windows) (window.isLit ? windows.lit : windows.dark).push(window);
3101
3101
  };
3102
+ const covers = [];
3103
+ const cover = (footprint) => {
3104
+ covers.push(footprint);
3105
+ };
3102
3106
  const scene = () => ({ parts, items, windows });
3103
- return { random, pick, lights, parts, items, windows, group, box, cylinder, cone, prism, plane, vault, terrain, crown, line, label, light, spot, place, item, fence, add, scene };
3107
+ return { random, pick, lights, parts, items, windows, covers, cover, group, box, cylinder, cone, prism, plane, vault, terrain, crown, line, label, light, spot, place, item, fence, add, scene };
3104
3108
  }
3105
3109
 
3106
3110
  // src/networks/slots.ts
@@ -3360,6 +3364,7 @@ var GameUrban = (() => {
3360
3364
  var DEFAULT_STOREY_PRESETS = { commercial: "office", residential: "residential" };
3361
3365
  function drawBuilding(b, x, z, width, depth, height, color, options = {}) {
3362
3366
  b.add(createCityBuilding({ x, z, width, depth, height, color, random: b.random, shopChance: options.shop, litChance: options.lit }));
3367
+ b.cover({ x, z, halfX: width / 2, halfZ: depth / 2, yaw: 0, top: height });
3363
3368
  return { x, z, width, depth, height, color };
3364
3369
  }
3365
3370
  function pickUse(b, uses) {
@@ -3430,6 +3435,7 @@ var GameUrban = (() => {
3430
3435
  }
3431
3436
  function drawTent(b, x, z, ry, w, d, color, c) {
3432
3437
  b.prism(x, 0, z, w, w * 0.7, d, color ?? colors(c).tent, -1, ry);
3438
+ b.cover({ x, z, halfX: w / 2, halfZ: d / 2, yaw: -ry, top: w * 0.7 });
3433
3439
  }
3434
3440
  function drawPine(b, x, z, scale = 1, y = 0, c) {
3435
3441
  const palette2 = colors(c);
@@ -3447,12 +3453,14 @@ var GameUrban = (() => {
3447
3453
  const group = b.group(x, y, z, ry);
3448
3454
  b.box(0, 0, 0, 2.44, 2.6, 6.06, color, { parent: group, style: { roughness: 0.7, metalness: 0.3 } });
3449
3455
  for (let k = -2; k <= 2; k++) b.box(k * 0.5, 0, 3.04, 0.06, 2.6, 0.04, 1710618, { parent: group });
3456
+ b.cover({ x, z, halfX: 1.22, halfZ: 3.03, yaw: -ry, top: y + 2.6 });
3450
3457
  }
3451
3458
  function drawWatchtower(b, x, z, searchlight = false, c) {
3452
3459
  const palette2 = colors(c).watchtower;
3453
3460
  for (const a of [-1, 1]) for (const d of [-1, 1]) b.box(x + a * 1.2, 0, z + d * 1.2, 0.25, 7, 0.25, palette2.leg);
3454
3461
  b.box(x, 7, z, 3.2, 1.2, 3.2, palette2.cabin);
3455
3462
  b.box(x, 8.2, z, 3.6, 0.15, 3.6, palette2.deck);
3463
+ b.cover({ x, z, halfX: 1.8, halfZ: 1.8, yaw: 0, top: 8.35 });
3456
3464
  for (const side of [-1.5, 1.5]) b.box(x + side, 8.2, z, 0.15, 1.6, 0.15, palette2.deck);
3457
3465
  if (searchlight) b.spot({ x, y: 9, z, color: 15134463, intensity: 2.4, distance: 70, decay: 1.2, angle: 0.35, penumbra: 0.5, target: { x: x + 20, y: 0, z: z + 20 }, sweep: { speed: 0.5, radius: 25 } });
3458
3466
  }
@@ -4451,7 +4459,12 @@ var GameUrban = (() => {
4451
4459
  const propColors = { ...DEFAULT_PROP_COLORS, ...options.props };
4452
4460
  const towers = options.towers ? options.towers === true ? {} : options.towers : null;
4453
4461
  const building = (b, x, z, width, depth, height, color, o) => drawBuilding(b, x, z, width, depth, height, color, o);
4454
- const drawBlockBuilding = towers ? createTowerDrawer(towers, building) : building;
4462
+ const towerDrawer = towers ? createTowerDrawer(towers, building) : null;
4463
+ const drawBlockBuilding = towerDrawer ? (b, x, z, width, depth, height, color, o) => {
4464
+ const built = towerDrawer(b, x, z, width, depth, height, color, o);
4465
+ b.cover({ x, z, halfX: width / 2, halfZ: depth / 2, yaw: 0, top: built.height });
4466
+ return built;
4467
+ } : building;
4455
4468
  const poles = {
4456
4469
  ids: () => [...entries.keys()],
4457
4470
  list: () => [...entries.values()],
@@ -9256,8 +9269,9 @@ var GameUrban = (() => {
9256
9269
  c.rod(new V3(hx + 0.88, ih + 0.97, z - 0.05), new V3(hx + 0.78, ih + 1.12, z - 0.05), 0.012, MT.chrome);
9257
9270
  c.sphere(0.025, MT.plastic, hx + 0.78, ih + 1.12, z - 0.05);
9258
9271
  });
9259
- kit.seat(c, hx + 0.05, ih, 0.45, { w: 0.52, h: 0.62, back: 0.6, lean: 0.12, mat: CM("#25282b", { roughness: 0.8 }) });
9260
- kit.seat(c, hx + 0.05, ih, -0.45, { w: 0.52, h: 0.62, back: 0.6, lean: 0.12, mat: CM("#25282b", { roughness: 0.8 }) });
9272
+ kit.seat(c, hx + 0.05, ih, 0.45, { w: 0.52, h: 0.62, back: 0.6, lean: 0.12, mat: CM("#25282b", { roughness: 0.8 }), role: "front_passenger" });
9273
+ kit.seat(c, hx + 0.05, ih, -0.45, { w: 0.52, h: 0.62, back: 0.6, lean: 0.12, mat: CM("#25282b", { roughness: 0.8 }), id: "driver", role: "driver" });
9274
+ c.addDoor({ id: "cabin_door", widthMetres: 0.72, heightMetres: 1.65 });
9261
9275
  c.roundBox(0.45, 0.42, 1.9, 0.04, CM("#25282b", { roughness: 0.8 }), hx - 1.35, ih + 0.21, 0.1);
9262
9276
  c.seatTops.push({ x: hx - 1.35, y: ih + 0.44, z: 0.1, w: 1.8, l: 0.4 });
9263
9277
  c.roundBox(3, 0.02, 2, 0.01, CM("#3a3f44", { roughness: 0.9 }), hx, hy0 + hh - 0.06, 0).castShadow = false;
@@ -10198,8 +10212,9 @@ var GameUrban = (() => {
10198
10212
  m.tumble = T;
10199
10213
  m.frontQuad = qf;
10200
10214
  if (intr && s.shelf) {
10201
- const sx0 = gh.rb + 0.03, sx1 = gh.rb + s.shelf;
10202
- c.roundBox(sx1 - sx0, 0.014, gh.Wg - 0.24, 6e-3, CM("#1b1c1e", { roughness: 0.92 }), (sx0 + sx1) / 2, gh.belt - 0.02, 0).castShadow = false;
10215
+ const sx0 = gh.rb + 0.03, sx1 = Math.min(gh.rb + s.shelf, gh.rb + 0.26);
10216
+ if (sx1 > sx0 + 0.04)
10217
+ c.roundBox(sx1 - sx0, 0.014, gh.Wg - 0.24, 6e-3, CM("#1b1c1e", { roughness: 0.92 }), (sx0 + sx1) / 2, gh.belt - 0.02, 0).castShadow = false;
10203
10218
  }
10204
10219
  if (intr)
10205
10220
  kit.interior(
@@ -10210,11 +10225,17 @@ var GameUrban = (() => {
10210
10225
  ft: gh.ft,
10211
10226
  rb: gh.rb,
10212
10227
  rt: gh.rt,
10213
- roof: Math.min(gh.roof, roofR),
10228
+ roof: gh.roof + 0.02,
10214
10229
  belt: gh.belt,
10215
- floor: s.bottomY + 0.1,
10230
+ floor: s.bottomY + 0.02,
10231
+ seatH: 0.12,
10232
+ dashD: 0.32,
10233
+ dashH: 0.24,
10234
+ visorUp: true,
10216
10235
  zIn: gh.Wg / 2 - 0.09,
10217
10236
  zRoof: halfAt(gh.Wg, T, gh.roof) - 0.12,
10237
+ xFront: s.shelf ? gh.fb - 0.86 : void 0,
10238
+ rowPitch: s.shelf ? 0.72 : void 0,
10218
10239
  xRear: gh.rb + 0.06
10219
10240
  },
10220
10241
  intr
@@ -10762,7 +10783,7 @@ var GameUrban = (() => {
10762
10783
  ]);
10763
10784
  c2.roundBox(0.03, 0.05, 0.16, 0.012, MT.trim, I.S.endX(-1, 0.84) - 0.01, 0.84, 0);
10764
10785
  },
10765
- interior: { rows: 2, col: "#4a4c52", trim: "#26272a" },
10786
+ interior: { rows: 2, col: "#4a4c52", trim: "#26272a", rowPitch: 0.72 },
10766
10787
  hood: { motor: "gasoline" },
10767
10788
  wheels: [
10768
10789
  [1.17, 0.2875, 0.175, wheelOpts("hubcap")],
@@ -12262,7 +12283,7 @@ var GameUrban = (() => {
12262
12283
  const lip = K.grid(-1, 0, { z1: 0.7, y0: 0.88, y1: 0.97, du: 0.03, dv: 0.02 });
12263
12284
  K.skin(lip, GLOSS, { u0: 0.05, u1: 0.95, yb: 0.925, yt: 0.955, off: 0.016, thick: 0.02, nv: 2 });
12264
12285
  },
12265
- interior: { rows: 2, col: "#1c1d20", trim: "#121316" },
12286
+ interior: { rows: 2, col: "#1c1d20", trim: "#121316", xFront: -0.46, rowPitch: 0.62 },
12266
12287
  hood: { motor: "v8_na" },
12267
12288
  wheels: [
12268
12289
  [1.35, 0.3435, 0.255, { rim: ALLOYD, spokeMat: ALLOY, spokes: 10, rimR: 0.72 }],
@@ -12523,16 +12544,20 @@ var GameUrban = (() => {
12523
12544
  x: xd - 0.07,
12524
12545
  y: belt + 0.02,
12525
12546
  w: zi * 2,
12526
- d: 0.48,
12527
- h: Math.min(0.55, belt - fl - 0.08),
12547
+ d: 0.34,
12548
+ h: Math.min(0.28, belt - fl - 0.16),
12528
12549
  drv: -zi * 0.52,
12529
12550
  mat: trim,
12530
12551
  top: fab
12531
12552
  });
12532
12553
  kit.steeringWheel(c, xd - 0.66, belt + 0.06, -zi * 0.52, { r: 0.22, tilt: 1.12, col: 0.5, mat: trim });
12533
12554
  const sx = Math.max(f - len + 0.62, xd - 1.08);
12534
- kit.seat(c, sx, fl, -zi * 0.52, { w: 0.5, mat: fab, h: 0.44, back: 0.64, lean: 0.18 });
12535
- kit.seat(c, sx, fl, zi * 0.42, { w: zi * 0.98, n: 2, mat: fab, h: 0.44, back: 0.6, lean: 0.18 });
12555
+ kit.seat(c, sx, fl, -zi * 0.52, { w: 0.52, mat: fab, h: 0.24, back: 0.64, lean: 0.18, id: "driver", role: "driver" });
12556
+ kit.seat(c, sx, fl, zi * 0.42, { w: zi * 0.98, n: 2, mat: fab, h: 0.24, back: 0.6, lean: 0.18, role: "front_passenger" });
12557
+ const doorW = Math.max(0.75, f - 0.1 - (xr - 0.06));
12558
+ const doorH = Math.max(1.05, ry - fl - 0.1);
12559
+ c.addDoor({ id: "door_front_left", widthMetres: Math.round(doorW * 1e3) / 1e3, heightMetres: Math.round(doorH * 1e3) / 1e3 });
12560
+ c.addDoor({ id: "door_front_right", widthMetres: Math.round(doorW * 1e3) / 1e3, heightMetres: Math.round(doorH * 1e3) / 1e3 });
12536
12561
  c.rod(new V3(sx + 0.55, fl, -0.05), new V3(sx + 0.5, fl + 0.48, -0.08), 0.014, MT.chrome);
12537
12562
  c.sphere(0.035, MT.plastic, sx + 0.5, fl + 0.5, -0.08);
12538
12563
  c.roundBox(0.03, ry - fl - 0.12, zi * 2, 0.01, trim, f - len + 0.07, (ry + fl) / 2, 0);
@@ -13309,7 +13334,8 @@ var GameUrban = (() => {
13309
13334
  kit.busRows(c, { x0: dx0 - 0.15, x1: -4.15, pitch: 0.64, floor: fl, zIn: zi, aisle: 0.46, col: "#355a7a", ceil: 2.95, seatH: 0.4 });
13310
13335
  kit.dashboard(c, { x: f - 0.05, y: 1.42, w: zi * 2, d: 0.42, h: 0.4, drv: -0.7, mat: CM("#202124"), top: CM("#2a2b2e") });
13311
13336
  kit.steeringWheel(c, f - 0.6, 1.48, -0.7, { r: 0.25, tilt: 1.1, col: 0.45 });
13312
- kit.seat(c, f - 1.05, fl, -0.7, { w: 0.5, mat: CM("#2c2d30", { roughness: 0.85 }), h: 0.45 });
13337
+ kit.seat(c, f - 1.05, fl, -0.7, { w: 0.5, mat: CM("#2c2d30", { roughness: 0.85 }), h: 0.45, id: "driver", role: "driver" });
13338
+ c.addDoor({ id: "door_front_right", widthMetres: 0.85, heightMetres: 1.95 });
13313
13339
  c.roundBox(0.9, 0.38, 0.5, 0.08, CM("#2a2b2d"), f - 0.6, fl + 0.19, -0.05);
13314
13340
  c.rod(new V3(dx0 - 0.05, fl, zi - 0.35), new V3(dx0 - 0.05, 2.95, zi - 0.35), 0.02, MT.chrome);
13315
13341
  c.roundBox(L - 0.5, 0.02, zi * 2, 0.01, MT.headliner, 0, 2.98, 0).castShadow = false;
@@ -13643,9 +13669,11 @@ var GameUrban = (() => {
13643
13669
  [1, 1.5, -2.2].forEach(function(x) {
13644
13670
  c.rod(new V3(x, fl, 0), new V3(x, 2.95, 0), 0.018, pole);
13645
13671
  });
13646
- kit.dashboard(c, { x: fx2(1.3) - 0.08, y: 1.3, w: 1.2, d: 0.5, h: 0.5, drv: -0.68, mat: CM("#1d1e20"), top: CM("#2a2b2e") });
13672
+ kit.dashboard(c, { x: fx2(1.3) - 0.08, y: 1.3, w: 1.2, d: 0.34, h: 0.28, drv: -0.68, mat: CM("#1d1e20"), top: CM("#2a2b2e") });
13647
13673
  kit.steeringWheel(c, f - 0.62, 1.38, -0.68, { r: 0.25, tilt: 1.15, col: 0.4 });
13648
- kit.seat(c, f - 1.15, 0.6, -0.68, { w: 0.5, mat: CM("#2c2d30", { roughness: 0.85 }), h: 0.46 });
13674
+ kit.seat(c, f - 1.15, 0.6, -0.68, { w: 0.5, mat: CM("#2c2d30", { roughness: 0.85 }), h: 0.46, id: "driver", role: "driver" });
13675
+ c.addDoor({ id: "door_front_right", widthMetres: 1, heightMetres: 2.05 });
13676
+ c.addDoor({ id: "door_rear_right", widthMetres: 1, heightMetres: 2.05 });
13649
13677
  c.roundBox(0.4, 0.95, 0.32, 0.05, CM("#9aa0a4", { metalness: 0.5 }), 3.95, fl + 0.48, -0.55);
13650
13678
  [0, 2.09, 4.19].forEach(function(a) {
13651
13679
  c.rod(
@@ -13983,7 +14011,9 @@ var GameUrban = (() => {
13983
14011
  c.cylinder(0.05, 0.05, 0.012, MT.gauge, -0.165, 1.6, 0.1, "x");
13984
14012
  kit.steeringWheel(c, -0.38, 1.66, 0, { r: 0.2, tilt: 1, col: 0.42, mat: MT.trim });
13985
14013
  c.roundBox(1, 0.05, 0.94, 0.02, CM("#5c5f62", { metalness: 0.5 }), -0.7, 1.12, 0);
13986
- kit.seat(c, -1, 1.35, 0, { w: 0.5, h: 0.16, back: 0.44, lean: 0.12, mat: MT.seat, headrest: false });
14014
+ kit.seat(c, -1.08, 1.35, 0, { w: 0.54, h: 0.16, back: 0.44, lean: 0.12, mat: MT.seat, headrest: false, id: "driver", role: "driver" });
14015
+ c.addDoor({ id: "cab_entry_left", widthMetres: 0.85, heightMetres: 1.15 });
14016
+ c.addDoor({ id: "cab_entry_right", widthMetres: 0.85, heightMetres: 1.15 });
13987
14017
  c.roundBox(0.3, 0.2, 0.3, 0.04, dgray, -1, 1.28, 0);
13988
14018
  [
13989
14019
  [0.25, 1],
@@ -14333,7 +14363,11 @@ var GameUrban = (() => {
14333
14363
  const fl = 0.6, fab = CM("#2f3136", { roughness: 0.9 });
14334
14364
  GH.liner(c, ST, -0.3, 1, fl, MT.carpet, { h: 0.03, maxW: 0.98 });
14335
14365
  [0.26, -0.26].forEach(function(z) {
14336
- kit.seat(c, 0.05, fl, z, { w: 0.44, h: 0.34, back: 0.6, lean: 0.12, mat: fab });
14366
+ kit.seat(c, 0.05, fl, z, { w: 0.48, h: 0.12, back: 0.6, lean: 0.12, mat: fab, role: "pilot" });
14367
+ if (z < 0) {
14368
+ c.addDoor({ id: "door_front_left", widthMetres: 0.68, heightMetres: 0.95 });
14369
+ c.addDoor({ id: "door_front_right", widthMetres: 0.68, heightMetres: 0.95 });
14370
+ }
14337
14371
  EA.pedals(c, 1.15, fl, z);
14338
14372
  });
14339
14373
  c.roundBox(0.35, 0.5, 0.24, 0.05, CM("#232427"), 0.95, fl + 0.28, 0, { rot: [0, 0, 0.35] });
@@ -14701,7 +14735,11 @@ var GameUrban = (() => {
14701
14735
  const fl = 0.68, fab = CM("#4b4339", { roughness: 0.9 });
14702
14736
  GH.liner(c, ST, -0.6, 1.8, fl, MT.carpet, { h: 0.03, maxW: 1.15 });
14703
14737
  [0.3, -0.3].forEach(function(z) {
14704
- kit.seat(c, 1.05, fl, z, { w: 0.48, h: 0.36, back: 0.64, lean: 0.12, mat: fab });
14738
+ kit.seat(c, 1.05, fl, z, { w: 0.48, h: 0.28, back: 0.64, lean: 0.12, mat: fab, role: "pilot" });
14739
+ if (z < 0) {
14740
+ c.addDoor({ id: "door_front_left", widthMetres: 0.75, heightMetres: 1.05 });
14741
+ c.addDoor({ id: "door_front_right", widthMetres: 0.75, heightMetres: 1.05 });
14742
+ }
14705
14743
  EA.cyclic(c, 1.4, fl, z);
14706
14744
  EA.pedals(c, 2.1, fl, z);
14707
14745
  });
@@ -15105,7 +15143,11 @@ var GameUrban = (() => {
15105
15143
  const fl = 0.7, fab = CM("#2c3540", { roughness: 0.9 });
15106
15144
  GH.liner(c, ST, -2.9, 2.5, fl, MT.carpet, { h: 0.03, maxW: 1.5 });
15107
15145
  [0.42, -0.42].forEach(function(z) {
15108
- kit.seat(c, 1.55, fl, z, { w: 0.5, h: 0.4, back: 0.7, lean: 0.12, mat: fab });
15146
+ kit.seat(c, 1.55, fl, z, { w: 0.5, h: 0.4, back: 0.7, lean: 0.12, mat: fab, role: "pilot" });
15147
+ if (z < 0) {
15148
+ c.addDoor({ id: "door_front_left", widthMetres: 0.78, heightMetres: 1.15 });
15149
+ c.addDoor({ id: "door_front_right", widthMetres: 0.78, heightMetres: 1.15 });
15150
+ }
15109
15151
  EA.cyclic(c, 1.95, fl, z);
15110
15152
  EA.pedals(c, 2.75, fl, z);
15111
15153
  });
@@ -15538,10 +15580,12 @@ var GameUrban = (() => {
15538
15580
  kit.cutMesh(fus, [EA.sideCutP(tdP, 0.5)], 40, { sub: 0.12 });
15539
15581
  EA.colorize(fus.geometry, col);
15540
15582
  const fab = CM("#2e3328", { roughness: 0.85 });
15541
- kit.seat(c, 4.75, 1.55, 0, { w: 0.5, h: 0.32, back: 0.7, lean: 0.15, mat: fab });
15583
+ kit.seat(c, 4.75, 1.55, 0, { w: 0.5, h: 0.1, back: 0.7, lean: 0.15, mat: fab, role: "pilot" });
15542
15584
  c.roundBox(0.2, 0.3, 0.6, 0.04, CM("#232427"), 5.35, 1.98, 0, { rot: [0, 0, 0.3] });
15543
15585
  c.roundBox(0.2, 0.2, 0.15, 0.03, MT.plastic, 5.25, 2.15, 0);
15544
- kit.seat(c, 3.2, 2.12, 0, { w: 0.5, h: 0.32, back: 0.72, lean: 0.15, mat: fab });
15586
+ kit.seat(c, 3.2, 2.12, 0, { w: 0.5, h: 0.1, back: 0.72, lean: 0.15, mat: fab, role: "pilot" });
15587
+ c.addDoor({ id: "canopy_left", widthMetres: 0.72, heightMetres: 0.95 });
15588
+ c.addDoor({ id: "door_cargo_left", widthMetres: 0.9, heightMetres: 1.15 });
15545
15589
  EA.instPanel(c, 3.85, 2.62, 0.8, { gauges: 6, z0: -0.25, tilt: 0.3, screens: [[0.05, 0.2, 0.14, 0.18]] });
15546
15590
  EA.cyclic(c, 3.55, 2.12, 0);
15547
15591
  EA.collective(c, 3.3, 2.12, -0.38);
@@ -16351,6 +16395,10 @@ var GameUrban = (() => {
16351
16395
  mirrorCol: "#22231d",
16352
16396
  wheels: []
16353
16397
  };
16398
+ s.interior = Object.assign(
16399
+ { floor: s.bottomY + 0.02, roof: s.gh.roof + 0.02, seatH: 0.14, dashD: 0.32, dashH: 0.24, visorUp: true },
16400
+ s.interior || {}
16401
+ );
16354
16402
  kit.car(c, s);
16355
16403
  [xf, xr].forEach(function(x) {
16356
16404
  ;
@@ -16615,8 +16663,8 @@ var GameUrban = (() => {
16615
16663
  x: xd - 0.07,
16616
16664
  y: belt + 0.02,
16617
16665
  w: zi * 2,
16618
- d: 0.48,
16619
- h: Math.min(0.55, belt - fl - 0.08),
16666
+ d: 0.34,
16667
+ h: Math.min(0.28, belt - fl - 0.16),
16620
16668
  drv: -zi * 0.52,
16621
16669
  mat: trim,
16622
16670
  top: fab,
@@ -16624,8 +16672,12 @@ var GameUrban = (() => {
16624
16672
  });
16625
16673
  kit.steeringWheel(c, xd - 0.66, belt + 0.06, -zi * 0.52, { r: 0.23, tilt: 1.12, col: 0.5, mat: trim });
16626
16674
  const sx = Math.max(f - len + 0.62, xd - 1.08);
16627
- kit.seat(c, sx, fl, -zi * 0.52, { w: 0.5, mat: fab, h: 0.44, back: 0.64, lean: 0.18 });
16628
- kit.seat(c, sx, fl, zi * 0.42, { w: zi * 0.98, n: 2, mat: fab, h: 0.44, back: 0.6, lean: 0.18 });
16675
+ kit.seat(c, sx, fl, -zi * 0.52, { w: 0.52, mat: fab, h: 0.24, back: 0.64, lean: 0.18, id: "driver", role: "driver" });
16676
+ kit.seat(c, sx, fl, zi * 0.42, { w: zi * 0.98, n: 2, mat: fab, h: 0.24, back: 0.6, lean: 0.18, role: "front_passenger" });
16677
+ const mDoorW = Math.max(0.75, f - 0.1 - (xr - 0.06));
16678
+ const mDoorH = Math.max(1.05, ry - fl - 0.1);
16679
+ c.addDoor({ id: "door_front_left", widthMetres: Math.round(mDoorW * 1e3) / 1e3, heightMetres: Math.round(mDoorH * 1e3) / 1e3 });
16680
+ c.addDoor({ id: "door_front_right", widthMetres: Math.round(mDoorW * 1e3) / 1e3, heightMetres: Math.round(mDoorH * 1e3) / 1e3 });
16629
16681
  c.rod(new V3(sx + 0.55, fl, -0.05), new V3(sx + 0.5, fl + 0.48, -0.08), 0.014, OLIVE_STEEL);
16630
16682
  c.sphere(0.035, BLACK, sx + 0.5, fl + 0.5, -0.08);
16631
16683
  c.roundBox(0.25, 0.16, 0.34, 0.02, CM("#3b402d", { roughness: 0.7 }), xd - 0.35, belt + 0.12, 0.1);
@@ -17167,7 +17219,9 @@ var GameUrban = (() => {
17167
17219
  [-0.9, -2.2].forEach(function(x) {
17168
17220
  c.roundBox(0.3, 0.04, 0.1, 0.02, RED_LIGHT, x, roofY - 0.1, 0).castShadow = false;
17169
17221
  });
17170
- kit.seat(c, 0.95, fl + 0.1, -0.62, { w: 0.5, h: 0.42, back: 0.62, lean: 0.12, mat: CM("#2f3226", { roughness: 0.9 }) });
17222
+ kit.seat(c, 0.95, fl + 0.1, -0.62, { w: 0.5, h: 0.42, back: 0.62, lean: 0.12, mat: CM("#2f3226", { roughness: 0.9 }), id: "driver", role: "driver" });
17223
+ c.addDoor({ id: "hatch_driver", widthMetres: 0.58, heightMetres: 0.6 });
17224
+ c.addDoor({ id: "ramp_rear", widthMetres: 1.4, heightMetres: 1.35 });
17171
17225
  kit.steeringWheel(c, 1.5, 1.42, -0.62, { r: 0.2, tilt: 0.9, col: 0.35 });
17172
17226
  c.roundBox(0.35, 0.3, 0.7, 0.04, CM("#25261f"), 1.85, 1.45, -0.6);
17173
17227
  kit.seat(c, 0.15, fl, 0, { w: 0.5, h: 0.45, back: 0.62, lean: 0.12, mat: CM("#2f3226", { roughness: 0.9 }) });
@@ -17536,7 +17590,9 @@ var GameUrban = (() => {
17536
17590
  });
17537
17591
  const fl = 0.72, fab = CM("#2f3226", { roughness: 0.9 });
17538
17592
  c.roundBox(3, 0.04, 1.6, 0.01, MT.carpet, 0.2, fl, 0);
17539
- kit.seat(c, 1, fl + 0.3, -0.55, { w: 0.46, h: 0.4, back: 0.5, lean: 0.25, mat: fab });
17593
+ kit.seat(c, 1, fl, -0.55, { w: 0.46, h: 0.14, back: 0.5, lean: 0.25, mat: fab, id: "driver", role: "driver" });
17594
+ c.addDoor({ id: "hatch_driver", widthMetres: 0.54, heightMetres: 0.58 });
17595
+ c.addDoor({ id: "hatch_commander", widthMetres: 0.6, heightMetres: 0.6 });
17540
17596
  kit.steeringWheel(c, 1.5, 1.38, -0.55, { r: 0.18, tilt: 0.9, col: 0.3 });
17541
17597
  c.roundBox(0.3, 0.26, 0.6, 0.04, CM("#25261f"), 1.75, 1.35, -0.5);
17542
17598
  const nT = c.vehicle.children.length;
@@ -17584,8 +17640,8 @@ var GameUrban = (() => {
17584
17640
  for (let k = 0; k < 4; k++)
17585
17641
  c.rod(new V3(tx - 1.55, ty + 0.14, -0.6 + k * 0.4), new V3(tx - 1.55, ty + 0.4, -0.6 + k * 0.4), 0.015, OLIVE_STEEL);
17586
17642
  c.rod(new V3(tx - 1.55, ty + 0.4, -0.65), new V3(tx - 1.55, ty + 0.4, 0.65), 0.015, OLIVE_STEEL);
17587
- kit.seat(c, tx - 0.4, fl + 0.45, 0.42, { w: 0.42, h: 0.38, back: 0.45, lean: 0.1, mat: fab });
17588
- kit.seat(c, tx - 0.4, fl + 0.45, -0.42, { w: 0.42, h: 0.38, back: 0.45, lean: 0.1, mat: fab });
17643
+ kit.seat(c, tx - 0.4, fl + 0.12, 0.42, { w: 0.46, h: 0.16, back: 0.45, lean: 0.1, mat: fab, role: "crew" });
17644
+ kit.seat(c, tx - 0.4, fl + 0.12, -0.42, { w: 0.46, h: 0.16, back: 0.45, lean: 0.1, mat: fab, role: "crew" });
17589
17645
  c.roundBox(0.8, 0.3, 0.3, 0.05, BARREL, tx + 0.1, ty + 0.1, 0);
17590
17646
  c.roundBox(1.6, 0.02, 1.2, 0.01, MT.headliner, tx - 0.2, ty + 0.66, 0).castShadow = false;
17591
17647
  rigid(c, c.vehicle.children.slice(nT));
@@ -17778,7 +17834,18 @@ var GameUrban = (() => {
17778
17834
  { rot: [0, 0, -0.18] }
17779
17835
  );
17780
17836
  hatch(c, 2.05, roofY - 0.1, -0.78, 0.28, 0, OLIVE_STEEL, { yaw: 0 });
17781
- kit.seat(c, 1.95, 0.62, -0.76, { w: 0.44, h: 0.34, back: 0.5, lean: 0.5, mat: CM("#2f3226", { roughness: 0.9 }) });
17837
+ kit.seat(c, 1.65, 0.3, -0.76, {
17838
+ w: 0.46,
17839
+ h: 0.14,
17840
+ back: 0.5,
17841
+ lean: 0.5,
17842
+ mat: CM("#2f3226", { roughness: 0.9 }),
17843
+ id: "driver",
17844
+ role: "driver",
17845
+ headroomMetres: 0.9
17846
+ });
17847
+ c.addDoor({ id: "hatch_driver", widthMetres: 0.56, heightMetres: 0.58 });
17848
+ c.addDoor({ id: "hatch_commander", widthMetres: 0.68, heightMetres: 0.68 });
17782
17849
  [-0.95, -0.78, -0.61].forEach(function(z, i) {
17783
17850
  periscope(c, 2.3, roofY - 0.08, z, 0.14, i === 1 ? lbl("driver_periscope") : null);
17784
17851
  });
@@ -17855,9 +17922,9 @@ var GameUrban = (() => {
17855
17922
  });
17856
17923
  c.roundBox(0.25, 0.3, 1.6, 0.06, CANVAS2, bx + 0.12, ty + 0.4, 0);
17857
17924
  c.part("cargo", trl("labels.luggage_basket"), null, new V3(bx + 0.1, ty + 0.5, 0), 1);
17858
- kit.seat(c, tx - 0.55, ty - 0.45, 0.6, { w: 0.42, h: 0.38, back: 0.45, lean: 0.1, mat: fab });
17859
- kit.seat(c, tx + 0.2, ty - 0.55, 0.62, { w: 0.4, h: 0.36, back: 0.42, lean: 0.1, mat: fab });
17860
- kit.seat(c, tx - 0.3, ty - 0.55, -0.62, { w: 0.4, h: 0.36, back: 0.42, lean: 0.1, mat: fab });
17925
+ kit.seat(c, tx - 0.55, ty - 0.45, 0.6, { w: 0.46, h: 0.16, back: 0.45, lean: 0.1, mat: fab, role: "crew" });
17926
+ kit.seat(c, tx + 0.2, ty - 0.55, 0.62, { w: 0.46, h: 0.16, back: 0.42, lean: 0.1, mat: fab, role: "crew" });
17927
+ kit.seat(c, tx - 0.3, ty - 0.55, -0.62, { w: 0.46, h: 0.16, back: 0.42, lean: 0.1, mat: fab, role: "crew" });
17861
17928
  c.roundBox(1.1, 0.35, 0.4, 0.05, BARREL, tx + 0.6, ty + 0.35, 0.05);
17862
17929
  c.roundBox(2.2, 0.02, 1.6, 0.01, MT.headliner, tx - 0.3, tTop - 0.08, 0).castShadow = false;
17863
17930
  c.cylinder(0.05, 0.05, 0.03, RED_LIGHT, tx - 0.4, tTop - 0.1, 0.2);
@@ -18098,10 +18165,12 @@ var GameUrban = (() => {
18098
18165
  const fl = 0.86, fab = CM("#2f3226", { roughness: 0.9 });
18099
18166
  c.roundBox(5.6, 0.04, 2.05, 0.01, MT.carpet, -0.4, fl, 0).castShadow = false;
18100
18167
  [0.5, -0.5].forEach(function(z) {
18101
- kit.seat(c, 1.55, fl, z, { w: 0.5, h: 0.42, back: 0.72, lean: 0.12, mat: fab });
18102
- c.rod(new V3(2, fl, z), new V3(1.95, fl + 0.55, z), 0.016, BLACK);
18103
- c.sphere(0.035, BLACK, 1.95, fl + 0.57, z);
18168
+ kit.seat(c, 1.55, fl, z, { w: 0.5, h: 0.42, back: 0.72, lean: 0.12, mat: fab, role: "pilot" });
18169
+ c.rod(new V3(2, fl, z), new V3(1.95, fl + 0.55, z), 0.016, BLACK).userData.noCabinRay = true;
18170
+ c.sphere(0.035, BLACK, 1.95, fl + 0.57, z).userData.noCabinRay = true;
18104
18171
  });
18172
+ c.addDoor({ id: "door_front_left", widthMetres: 0.75, heightMetres: 1.15 });
18173
+ c.addDoor({ id: "door_front_right", widthMetres: 0.75, heightMetres: 1.15 });
18105
18174
  c.roundBox(0.25, 0.45, 1.9, 0.05, CM("#232427"), 2.45, fl + 0.55, 0);
18106
18175
  c.roundBox(0.4, 0.05, 1.95, 0.02, CM("#1a1b1d"), 2.4, fl + 0.8, 0, { rot: [0, 0, 0.25] });
18107
18176
  [-0.75, -0.45, -0.15, 0.15, 0.45, 0.75].forEach(function(z) {
@@ -19236,9 +19305,13 @@ var GameUrban = (() => {
19236
19305
  ft: gh.ft,
19237
19306
  rb: gh.rb,
19238
19307
  rt: gh.rt,
19239
- roof: Math.min(gh.roof, roofR),
19308
+ roof: gh.roof + 0.02,
19240
19309
  belt: gh.belt,
19241
- floor: s.bottomY + 0.1,
19310
+ floor: s.bottomY + 0.02,
19311
+ seatH: 0.12,
19312
+ dashD: 0.32,
19313
+ dashH: 0.24,
19314
+ visorUp: true,
19242
19315
  zIn: gh.Wg / 2 - 0.09,
19243
19316
  zRoof: halfAt(gh.Wg, T, gh.roof) - 0.12,
19244
19317
  xRear: gh.rb + 0.06
@@ -22711,7 +22784,7 @@ var GameUrban = (() => {
22711
22784
  c.cylinder(0.025, 0.025, 0.2, EXH, -1.98, 0.3, z, "x");
22712
22785
  });
22713
22786
  c.part("engine", trl("labels.air_cooled_engine_rear"), null, new V3(-1.6, 0.55, 0), 1);
22714
- const fab = CM("#4b3a2e", { roughness: 0.85 }), fl = 0.36;
22787
+ const fab = CM("#4b3a2e", { roughness: 0.85 }), fl = 0.31;
22715
22788
  c.roundBox(1.7, 0.03, 0.62, 0.01, MT.carpet, -0.15, fl, 0).castShadow = false;
22716
22789
  c.roundBox(0.2, 0.24, 1.14, 0.04, col, 0.66, 0.92, 0);
22717
22790
  c.roundBox(0.16, 0.05, 1.12, 0.02, CM("#1b1c1e"), 0.6, 1.03, 0);
@@ -22722,9 +22795,18 @@ var GameUrban = (() => {
22722
22795
  c.rod(new V3(0.12, fl, 0), new V3(0.02, fl + 0.42, 0), 0.01, MT.chrome);
22723
22796
  c.sphere(0.025, MT.plastic, 0.02, fl + 0.44, 0);
22724
22797
  [-1, 1].forEach(function(sd) {
22725
- kit.seat(c, -0.02, fl, sd * 0.27, { w: 0.44, mat: fab, back: 0.58, lean: 0.2, h: 0.28, headrest: false });
22798
+ kit.seat(c, -0.08, fl, sd * 0.27, {
22799
+ w: 0.44,
22800
+ mat: fab,
22801
+ back: 0.58,
22802
+ lean: 0.2,
22803
+ h: 0.14,
22804
+ headrest: false,
22805
+ id: sd < 0 ? "driver" : "front_right",
22806
+ role: sd < 0 ? "driver" : "front_passenger"
22807
+ });
22726
22808
  });
22727
- kit.seat(c, -0.66, fl, 0, { w: 0.94, n: 3, mat: fab, back: 0.44, lean: 0.14, h: 0.26, len: 0.42, headrest: false });
22809
+ kit.seat(c, -0.58, fl, 0, { w: 0.94, n: 3, mat: fab, back: 0.44, lean: 0.14, h: 0.11, len: 0.42, headrest: false, role: "rear" });
22728
22810
  [1, -1].forEach(function(sd) {
22729
22811
  for (let yk = 0.56; yk < 0.95; yk += 0.075) {
22730
22812
  const zf = Math.min(loftHalf(stS, -0.3, yk - 0.04), loftHalf(stS, 0.5, yk - 0.04)) - 0.045;
@@ -24781,11 +24863,12 @@ var GameUrban = (() => {
24781
24863
  c.roundBox(0.012, 0.012, 0.06, 4e-3, MT.steel, 2.06, 0.62, 0, PG);
24782
24864
  const fl = -0.4, fab = CM("#3c3a35", { roughness: 0.9 });
24783
24865
  c.roundBox(2, 0.025, 0.6, 0.01, MT.carpet, 0.55, fl, 0, PG).castShadow = false;
24784
- kit.seat(c, 0.62, fl, 0, { w: 0.48, h: 0.3, back: 0.55, lean: 0.2, mat: fab, parent: grp, headrest: false });
24785
- kit.seat(c, -0.22, fl + 0.04, 0, { w: 0.5, h: 0.3, back: 0.58, lean: 0.2, mat: fab, parent: grp, headrest: false });
24866
+ kit.seat(c, 0.62, fl, 0, { w: 0.48, h: 0.16, back: 0.55, lean: 0.2, mat: fab, parent: grp, headrest: false, role: "pilot" });
24867
+ kit.seat(c, -0.22, fl + 0.04, 0, { w: 0.5, h: 0.16, back: 0.58, lean: 0.2, mat: fab, parent: grp, headrest: false, role: "crew" });
24868
+ c.addDoor({ id: "canopy_door", widthMetres: 0.7, heightMetres: 0.85 });
24786
24869
  [1.12, 0.3].forEach(function(x) {
24787
- c.rod(new V3(x, fl, 0), new V3(x - 0.05, fl + 0.5, 0), 0.012, MT.plastic, PG);
24788
- c.sphere(0.025, MT.plastic, x - 0.055, fl + 0.52, 0, 1, 1.4, 1, PG);
24870
+ c.rod(new V3(x, fl, 0), new V3(x - 0.05, fl + 0.5, 0), 0.012, MT.plastic, PG).userData.noCabinRay = true;
24871
+ c.sphere(0.025, MT.plastic, x - 0.055, fl + 0.52, 0, 1, 1.4, 1, PG).userData.noCabinRay = true;
24789
24872
  });
24790
24873
  c.roundBox(0.05, 0.22, 0.6, 0.02, CM("#2a2b2d", { roughness: 0.8 }), 1.75, 0.3, 0, PG);
24791
24874
  [-0.2, -0.08, 0.04, 0.16, -0.14].forEach(function(z, i) {
@@ -25139,7 +25222,8 @@ var GameUrban = (() => {
25139
25222
  const fl = 0.98, fab = CM("#3d4552", { roughness: 0.9 });
25140
25223
  liner(c, ST, -4.6, 5.9, fl, MT.carpet, { h: 0.03 });
25141
25224
  [0.38, -0.38].forEach(function(z) {
25142
- kit.seat(c, 4.95, fl, z, { w: 0.5, h: 0.38, back: 0.7, lean: 0.14, mat: CM("#2a2c30", { roughness: 0.8 }) });
25225
+ kit.seat(c, 4.95, fl, z, { w: 0.5, h: 0.38, back: 0.7, lean: 0.14, mat: CM("#2a2c30", { roughness: 0.8 }), role: "pilot" });
25226
+ if (z < 0) c.addDoor({ id: "cabin_door_left", widthMetres: 0.78, heightMetres: 1.55 });
25143
25227
  kit.yoke(c, 5.5, 1.75, z);
25144
25228
  EA.pedals(c, 5.95, fl, z);
25145
25229
  });
@@ -25533,7 +25617,8 @@ var GameUrban = (() => {
25533
25617
  const fl = 2.06, fab = CM("#4a4640", { roughness: 0.9 });
25534
25618
  liner(c, ST, -3.2, 2, fl, MT.carpet, { h: 0.03 });
25535
25619
  [0.38, -0.38].forEach(function(z) {
25536
- kit.seat(c, 0.95, fl, z, { w: 0.5, h: 0.38, back: 0.7, lean: 0.14, mat: fab });
25620
+ kit.seat(c, 0.95, fl, z, { w: 0.5, h: 0.38, back: 0.7, lean: 0.14, mat: fab, role: "pilot" });
25621
+ if (z < 0) c.addDoor({ id: "cabin_door_left", widthMetres: 0.78, heightMetres: 1.4 });
25537
25622
  kit.yoke(c, 1.5, 2.85, z);
25538
25623
  EA.pedals(c, 1.95, fl, z);
25539
25624
  });
@@ -25948,7 +26033,8 @@ var GameUrban = (() => {
25948
26033
  const fl = 0.8, fab = CM("#c9bda6", { roughness: 0.75 });
25949
26034
  liner(c, ST, -2, 4, fl, MT.carpet, { h: 0.03 });
25950
26035
  [0.36, -0.36].forEach(function(z) {
25951
- kit.seat(c, 3.55, fl, z, { w: 0.48, h: 0.36, back: 0.66, lean: 0.14, mat: CM("#2a2c30") });
26036
+ kit.seat(c, 3.55, fl, z, { w: 0.48, h: 0.36, back: 0.66, lean: 0.14, mat: CM("#2a2c30"), role: "pilot" });
26037
+ if (z < 0) c.addDoor({ id: "cabin_door_left", widthMetres: 0.72, heightMetres: 1.35 });
25952
26038
  kit.yoke(c, 4.05, 1.55, z);
25953
26039
  });
25954
26040
  EA.instPanel(c, 4.3, 1.68, 1.35, {
@@ -26316,11 +26402,12 @@ var GameUrban = (() => {
26316
26402
  [1.55, 1.24],
26317
26403
  [0.2, 1.46]
26318
26404
  ].forEach(function(q, i) {
26319
- kit.seat(c, q[0], q[1], 0, { w: 0.5, h: 0.32, back: 0.85, lean: 0.24, mat: fab, headrest: false });
26405
+ kit.seat(c, q[0], q[1], 0, { w: 0.5, h: 0.32, back: 0.85, lean: 0.24, mat: fab, headrest: false, role: i === 0 ? "pilot" : "crew" });
26320
26406
  c.roundBox(0.14, 0.3, 0.44, 0.04, CM("#202224"), q[0] - 0.42, q[1] + 1.05, 0, { rot: [0, 0, 0.24] });
26321
26407
  c.rod(new V3(q[0] - 0.38, q[1] + 1.25, -0.06), new V3(q[0] - 0.3, q[1] + 1.4, 0.06), 0.012, MT.yellow);
26322
- c.rod(new V3(q[0] + 0.35, q[1], 0), new V3(q[0] + 0.32, q[1] + 0.45, 0), 0.016, blk);
26323
- c.sphere(0.03, blk, q[0] + 0.31, q[1] + 0.48, 0, 1, 1.5, 1);
26408
+ c.rod(new V3(q[0] + 0.35, q[1], 0), new V3(q[0] + 0.32, q[1] + 0.45, 0), 0.016, blk).userData.noCabinRay = true;
26409
+ c.sphere(0.03, blk, q[0] + 0.31, q[1] + 0.48, 0, 1, 1.5, 1).userData.noCabinRay = true;
26410
+ if (i === 0) c.addDoor({ id: "canopy_door", widthMetres: 0.68, heightMetres: 0.85 });
26324
26411
  const px = q[0] + 0.75;
26325
26412
  c.roundBox(0.16, 0.3, 0.6, 0.04, CM("#232427"), px, q[1] + 0.65, 0, { rot: [0, 0, 0.2] });
26326
26413
  [-0.15, 0.15].forEach(function(z) {
@@ -27154,10 +27241,26 @@ var GameUrban = (() => {
27154
27241
  roofLining(c, extra);
27155
27242
  if (!c.meta.damage) c.meta.damage = crashDamage;
27156
27243
  }
27244
+ function withCabinPackaging(s) {
27245
+ if (s.interior === false) return s;
27246
+ return Object.assign({}, s, {
27247
+ interior: Object.assign(
27248
+ {
27249
+ floor: s.bottomY + 0.02,
27250
+ roof: s.gh.roof + 0.02,
27251
+ seatH: 0.12,
27252
+ dashD: 0.32,
27253
+ dashH: 0.24,
27254
+ visorUp: true
27255
+ },
27256
+ s.interior || {}
27257
+ )
27258
+ });
27259
+ }
27157
27260
  function suvBuild(c, s, o) {
27158
27261
  o = o || {};
27159
27262
  const n0 = c.deform.length;
27160
- kit.car(c, s);
27263
+ kit.car(c, withCabinPackaging(s));
27161
27264
  const low = c.deform[n0], m = c.meta;
27162
27265
  let extra = [];
27163
27266
  if (o.flares !== false) extra = extra.concat(fenderFlares(c, s.arches, s.W, s.bottomY, o.flare));
@@ -27644,7 +27747,7 @@ var GameUrban = (() => {
27644
27747
  );
27645
27748
  function pickupBuild(c, s, o) {
27646
27749
  const n0 = c.deform.length;
27647
- kit.car(c, s);
27750
+ kit.car(c, withCabinPackaging(s));
27648
27751
  const low = c.deform[n0], m = c.meta;
27649
27752
  let extra = [];
27650
27753
  cargoBed(c, { low, x0: m.rear + 0.06, x1: o.bedFront, floor: o.floor, top: s.gh.belt, W: s.W, arches: s.arches });
@@ -28040,7 +28143,7 @@ var GameUrban = (() => {
28040
28143
  wheels: []
28041
28144
  };
28042
28145
  const n0 = c.deform.length;
28043
- kit.car(c, s);
28146
+ kit.car(c, withCabinPackaging(s));
28044
28147
  const low = c.deform[n0], m = c.meta;
28045
28148
  cargoBed(c, { low, x0: m.rear + 0.06, x1: -0.42, floor: 1.78, top: 2.25, W, arches: [] });
28046
28149
  c.roundBox(0.08, 0.08, W + 0.1, 0.03, MT.chrome, m.front + 0.06, 1.72, 0);
@@ -28360,7 +28463,10 @@ var GameUrban = (() => {
28360
28463
  xRear: P.cabBack - 0.12,
28361
28464
  xFront: P.cabBack + 0.42,
28362
28465
  seatH: 0.42,
28363
- front: "bench"
28466
+ front: "bench",
28467
+ dashD: 0.32,
28468
+ dashH: 0.24,
28469
+ visorUp: true
28364
28470
  });
28365
28471
  c.roundBox(
28366
28472
  0.04,
@@ -29396,8 +29502,8 @@ var GameUrban = (() => {
29396
29502
  });
29397
29503
  }
29398
29504
  function cyclic(c, x, fl, z) {
29399
- c.rod(new V3(x, fl, z), new V3(x - 0.04, fl + 0.55, z), 0.014, MT.plastic);
29400
- c.roundBox(0.04, 0.12, 0.04, 0.015, MT.plastic, x - 0.05, fl + 0.6, z);
29505
+ c.rod(new V3(x, fl, z), new V3(x - 0.04, fl + 0.55, z), 0.014, MT.plastic).userData.noCabinRay = true;
29506
+ c.roundBox(0.04, 0.12, 0.04, 0.015, MT.plastic, x - 0.05, fl + 0.6, z).userData.noCabinRay = true;
29401
29507
  }
29402
29508
  function collective(c, x, fl, z) {
29403
29509
  c.rod(new V3(x - 0.35, fl + 0.18, z), new V3(x + 0.05, fl + 0.32, z), 0.016, MT.plastic);
@@ -29928,8 +30034,8 @@ var GameUrban = (() => {
29928
30034
  c.rod(new V3(0.62, cy + 0.72, 0.62), new V3(0.55, cy + 0.82, 0.62), 0.02, MT.chrome);
29929
30035
  c.rod(new V3(0.55, cy + 0.7, 0.98), new V3(0.42, cy + 0.88, 1), 0.015, MT.chrome);
29930
30036
  c.sphere(0.035, MT.plastic, 0.42, cy + 0.9, 1);
29931
- kit.seat(c, -0.1, cy + 2e-3, 0.72, { w: 0.55, h: 0.42, back: 0.48, lean: 0.12, mat: vinyl, headrest: false });
29932
- kit.seat(c, -0.1, cy + 2e-3, -0.74, { w: 0.55, h: 0.42, back: 0.48, lean: 0.12, mat: vinyl, headrest: false });
30037
+ kit.seat(c, -0.1, cy + 2e-3, 0.72, { w: 0.55, h: 0.42, back: 0.48, lean: 0.12, mat: vinyl, headrest: false, open: true, role: "front_passenger" });
30038
+ kit.seat(c, -0.1, cy + 2e-3, -0.74, { w: 0.55, h: 0.42, back: 0.48, lean: 0.12, mat: vinyl, headrest: false, open: true, id: "driver", role: "driver" });
29933
30039
  [1, -1].forEach(function(s) {
29934
30040
  const pts = [];
29935
30041
  for (let i = 0; i <= 8; i++) {
@@ -30240,7 +30346,8 @@ var GameUrban = (() => {
30240
30346
  c.rod(new V3(0, 0, 0), new V3(0, Math.cos(a8) * 0.36, Math.sin(a8) * 0.36), 0.014, MT.wood, { parent: whl });
30241
30347
  }
30242
30348
  c.cylinder(0.05, 0.05, 0.14, MT.wood, 0.06, 0, 0, "x", { parent: whl });
30243
- kit.seat(c, hx - 0.05, hy0 + 2e-3, 0, { w: 0.5, h: 0.55, back: 0.45, mat: inner2, headrest: false });
30349
+ kit.seat(c, hx - 0.12, hy0 + 2e-3, 0, { w: 0.54, h: 0.55, back: 0.45, mat: inner2, headrest: false, id: "driver", role: "driver" });
30350
+ c.addDoor({ id: "cabin_door", widthMetres: 0.68, heightMetres: 1.55 });
30244
30351
  c.roundBox(1.8, 0.12, 0.65, 0.04, CM("#7c5a3b"), hx - 0.2, hy0 + 0.5, -0.72);
30245
30352
  c.roundBox(1.7, 0.08, 0.55, 0.04, CM("#6b7c8f", { roughness: 1 }), hx - 0.2, hy0 + 0.6, -0.72);
30246
30353
  c.roundBox(1.9, 0.02, 2.1, 0.01, inner2, hx, hy0 + hh - 0.06, 0).castShadow = false;
@@ -30456,11 +30563,13 @@ var GameUrban = (() => {
30456
30563
  const fl = 0.74, fab = CM("#4a463f", { roughness: 0.9 });
30457
30564
  c.roundBox(2.2, 0.03, 0.98, 0.01, MT.carpet, 0.2, fl, 0).castShadow = false;
30458
30565
  [0.26, -0.26].forEach(function(z) {
30459
- kit.seat(c, 0.38, fl, z, { w: 0.44, h: 0.34, back: 0.62, lean: 0.18, mat: fab });
30566
+ kit.seat(c, 0.38, fl, z, { w: 0.48, h: 0.24, back: 0.62, lean: 0.18, mat: fab, role: "pilot" });
30460
30567
  EA.pedals(c, 1.18, fl, z);
30461
30568
  kit.yoke(c, 0.98, 1.47, z);
30462
30569
  });
30463
- kit.seat(c, -0.52, fl, 0, { w: 0.96, n: 2, h: 0.34, back: 0.58, lean: 0.2, mat: fab });
30570
+ kit.seat(c, -0.52, fl, 0, { w: 0.96, n: 2, h: 0.24, back: 0.58, lean: 0.2, mat: fab });
30571
+ c.addDoor({ id: "door_front_left", widthMetres: 0.75, heightMetres: 0.95 });
30572
+ c.addDoor({ id: "door_front_right", widthMetres: 0.75, heightMetres: 0.95 });
30464
30573
  EA.instPanel(c, 1.1, 1.52, 1, { gauges: 6, z0: -0.38, screens: [[0, 0.12, 0.14, 0.22]] });
30465
30574
  c.roundBox(0.1, 0.1, 0.1, 0.02, MT.plastic, 1, 1.32, 0);
30466
30575
  c.cylinder(0.018, 0.018, 0.1, MT.chrome, 0.93, 1.34, 0.02, "x");
@@ -30735,9 +30844,10 @@ var GameUrban = (() => {
30735
30844
  );
30736
30845
  const fl = -0.36;
30737
30846
  c.roundBox(1.3, 0.03, 0.8, 0.01, MT.carpet, -0.4, fl, 0, { parent: grp }).castShadow = false;
30738
- kit.seat(c, -0.55, fl, 0, { w: 0.5, h: 0.32, back: 0.66, lean: 0.12, mat: CM("#3a3530", { roughness: 0.9 }), parent: grp });
30739
- c.rod(new V3(0, fl, 0), new V3(-0.06, fl + 0.55, 0), 0.016, MT.plastic, { parent: grp });
30740
- c.roundBox(0.04, 0.13, 0.05, 0.015, MT.plastic, -0.07, fl + 0.6, 0, { parent: grp });
30847
+ kit.seat(c, -0.55, fl, 0, { w: 0.5, h: 0.18, back: 0.66, lean: 0.12, mat: CM("#3a3530", { roughness: 0.9 }), parent: grp, role: "pilot" });
30848
+ c.addDoor({ id: "canopy_door", widthMetres: 0.7, heightMetres: 0.85 });
30849
+ c.rod(new V3(0, fl, 0), new V3(-0.06, fl + 0.55, 0), 0.016, MT.plastic, { parent: grp }).userData.noCabinRay = true;
30850
+ c.roundBox(0.04, 0.13, 0.05, 0.015, MT.plastic, -0.07, fl + 0.6, 0, { parent: grp }).userData.noCabinRay = true;
30741
30851
  c.roundBox(0.16, 0.3, 0.8, 0.04, CM("#232427"), 0.36, 0.5, 0, { parent: grp, rot: [0, 0, 0.2] });
30742
30852
  [-0.24, -0.12, 0, 0.12, 0.24].forEach(function(z, i) {
30743
30853
  c.cylinder(0.036, 0.036, 0.012, MT.gauge, 0.27, 0.55 - i % 2 * 0.09, z, "x", { seg: 16, parent: grp }).castShadow = false;
@@ -31147,10 +31257,12 @@ var GameUrban = (() => {
31147
31257
  const fl = 0.72, fab = CM("#3b3a38", { roughness: 0.9 });
31148
31258
  c.roundBox(1.9, 0.03, 1.16, 0.01, MT.carpet, 0.2, fl, 0).castShadow = false;
31149
31259
  [0.3, -0.3].forEach(function(z) {
31150
- kit.seat(c, 0.35, fl, z, { w: 0.48, h: 0.36, back: 0.62, lean: 0.14, mat: fab });
31260
+ kit.seat(c, 0.35, fl, z, { w: 0.48, h: 0.2, back: 0.62, lean: 0.14, mat: fab, role: "pilot" });
31151
31261
  EA.pedals(c, 1.35, fl, z);
31152
31262
  });
31153
- kit.seat(c, -0.55, fl + 0.06, 0, { w: 1.06, n: 2, h: 0.36, back: 0.6, lean: 0.12, mat: fab });
31263
+ kit.seat(c, -0.55, fl + 0.06, 0, { w: 1.06, n: 2, h: 0.2, back: 0.6, lean: 0.12, mat: fab });
31264
+ c.addDoor({ id: "door_front_left", widthMetres: 0.72, heightMetres: 1.05 });
31265
+ c.addDoor({ id: "door_front_right", widthMetres: 0.72, heightMetres: 1.05 });
31154
31266
  c.roundBox(0.42, 0.62, 0.3, 0.06, CM("#232427"), 1.15, fl + 0.32, 0, { rot: [0, 0, 0.35] });
31155
31267
  c.roundBox(0.06, 0.3, 0.3, 0.02, CM("#1a1b1d"), 1.25, fl + 0.65, 0, { rot: [0, 0, 0.6] });
31156
31268
  [-0.07, 0.07].forEach(function(z) {
@@ -31481,6 +31593,8 @@ var GameUrban = (() => {
31481
31593
  EA.collective(c, 1.3, fl, -0.72);
31482
31594
  EA.collective(c, 1.3, fl, 0.12);
31483
31595
  kit.seat(c, -0.35, fl + 0.04, 0, { w: 1.56, n: 4, h: 0.38, back: 0.62, lean: 0.1, mat: fab });
31596
+ c.addDoor({ id: "door_front_left", widthMetres: 0.78, heightMetres: 1.15 });
31597
+ c.addDoor({ id: "door_front_right", widthMetres: 0.78, heightMetres: 1.15 });
31484
31598
  EA.instPanel(c, 2.25, 1.55, 1.2, { gauges: 8, z0: -0.45, tilt: 0.3, screens: [[0.05, 0.25, 0.14, 0.2]] });
31485
31599
  c.roundBox(0.5, 0.45, 0.32, 0.06, CM("#232427"), 2.05, fl + 0.24, 0);
31486
31600
  c.roundBox(2.3, 0.02, 1.4, 0.01, MT.headliner, 0.45, 2.24, 0).castShadow = false;