castle-web-cli 0.4.236 → 0.4.238
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/dist/api.d.ts +2 -0
- package/dist/bundle.d.ts +24 -0
- package/dist/bundle.js +447 -4
- package/dist/bundleLatin1.d.ts +6 -0
- package/dist/bundleLatin1.js +333 -0
- package/dist/castle-host/host.d.ts +10 -1
- package/dist/castle-host/host.js +78 -9
- package/dist/castleJson.d.ts +20 -0
- package/dist/castleJson.js +40 -0
- package/dist/deckExports.d.ts +35 -0
- package/dist/deckExports.js +365 -0
- package/dist/importCheckHook.d.ts +1 -0
- package/dist/importCheckHook.js +1 -1
- package/dist/index.js +5 -0
- package/dist/init.js +2 -1
- package/dist/save-deck.js +18 -13
- package/kits/base/castle.json +1 -1
- package/kits/base/sdk/README.md +47 -0
- package/kits/base/sdk/castle.d.ts +3 -1
- package/kits/base/sdk/castle.js +1 -0
- package/kits/base/sdk/commands.d.ts +25 -1
- package/kits/base/sdk/commands.js +29 -1
- package/kits/base/sdk/hub.d.ts +17 -0
- package/kits/base/sdk/hub.js +33 -9
- package/kits/base/sdk/localCache.d.ts +27 -0
- package/kits/base/sdk/localCache.js +115 -0
- package/kits/base/sdk/localCacheStore.d.ts +15 -0
- package/kits/base/sdk/localCacheStore.js +358 -0
- package/kits/base/sdk/transport.d.ts +1 -0
- package/kits/base/sdk/transport.js +4 -5
- package/kits/hub-game/CLAUDE.md +22 -2
- package/kits/hub-game/castle.json +4 -1
- package/kits/hub-game/code/client/act.js +66 -91
- package/kits/hub-game/code/client/actCore.js +134 -0
- package/kits/hub-game/code/client/car.js +35 -0
- package/kits/hub-game/code/client/chrome.js +207 -381
- package/kits/hub-game/code/client/crowdNames.js +2 -2
- package/kits/hub-game/code/client/emoteWheel.js +109 -0
- package/kits/hub-game/code/client/hats.js +2 -0
- package/kits/hub-game/code/client/hookLayer.js +99 -48
- package/kits/hub-game/code/client/hostGo.js +77 -0
- package/kits/hub-game/code/client/hubControls.js +125 -0
- package/kits/hub-game/code/client/hubEntry.js +187 -0
- package/kits/hub-game/code/client/hudSurface.js +148 -0
- package/kits/hub-game/code/client/hudTree.js +96 -0
- package/kits/hub-game/code/client/idle.js +59 -13
- package/kits/hub-game/code/client/invites.js +13 -4
- package/kits/hub-game/code/client/menuIcons.js +8 -0
- package/kits/hub-game/code/client/noTrips.js +38 -0
- package/kits/hub-game/code/client/qualityEntry.js +6 -1
- package/kits/hub-game/code/client/rehello.js +3 -1
- package/kits/hub-game/code/client/riders.js +26 -0
- package/kits/hub-game/code/client/role.js +79 -0
- package/kits/hub-game/code/client/safeLayout.js +32 -3
- package/kits/hub-game/code/client/sound.js +10 -3
- package/kits/hub-game/code/client/soundscape.js +2 -2
- package/kits/hub-game/code/client/soundscapeAmbience.js +38 -8
- package/kits/hub-game/code/client/soundscapeBaked.js +24 -5
- package/kits/hub-game/code/client/soundscapeCues.js +2 -1
- package/kits/hub-game/code/client/state.js +19 -0
- package/kits/hub-game/code/client/stuck.js +2 -1
- package/kits/hub-game/code/client/talkSurface.js +178 -0
- package/kits/hub-game/code/client/talkTree.js +238 -0
- package/kits/hub-game/code/client/tiers.js +8 -5
- package/kits/hub-game/code/client/uiDom.js +600 -0
- package/kits/hub-game/code/client/uiTree.js +359 -0
- package/kits/hub-game/code/client/vehicle.js +154 -0
- package/kits/hub-game/code/client/wear.js +27 -5
- package/kits/hub-game/code/client/worldLabels.js +3 -2
- package/kits/hub-game/code/client/yours.js +10 -3
- package/kits/hub-game/code/server/actors.js +4 -3
- package/kits/hub-game/code/server/analytics.js +56 -6
- package/kits/hub-game/code/server/decor.js +56 -16
- package/kits/hub-game/code/server/hub.js +258 -46
- package/kits/hub-game/code/server/idle.js +118 -5
- package/kits/hub-game/code/server/manifest.js +46 -4
- package/kits/hub-game/code/server/npcs.js +4 -2
- package/kits/hub-game/code/server/players.js +3 -0
- package/kits/hub-game/code/server/role.js +142 -0
- package/kits/hub-game/code/server/standing.js +6 -4
- package/kits/hub-game/code/server/vehicle.js +126 -0
- package/kits/hub-game/code/shared/car.js +52 -0
- package/kits/hub-game/code/shared/deckFlags.js +34 -0
- package/kits/hub-game/code/shared/deviceClass.js +39 -0
- package/kits/hub-game/code/shared/expression.js +9 -0
- package/kits/hub-game/code/systems/hub.js +300 -85
- package/kits/hub-game/docs/analytics.md +11 -2
- package/kits/hub-game/docs/contract.md +353 -14
- package/kits/hub-game/docs/vehicle-preset.md +132 -0
- package/kits/hub-game/models/hats/baker-cap.pxmodel +89 -0
- package/kits/hub-game/models/hats/chef-toque.pxmodel +60 -0
- package/kits/hub-game/models/hats/delivery-cap.pxmodel +105 -0
- package/kits/hub-game/models/hats/fire-helmet.pxmodel +87 -0
- package/kits/hub-game/models/hats/hard-hat.pxmodel +71 -0
- package/kits/hub-game/models/hats/nurse-cap.pxmodel +61 -0
- package/kits/hub-game/models/hats/police-cap.pxmodel +105 -0
- package/kits/hub-game/models/hats/teacher-beret.pxmodel +52 -0
- package/kits/hub-game/models/role/square/top-apron.pxmodel +109 -0
- package/kits/hub-game/models/role/square/top-cardigan.pxmodel +141 -0
- package/kits/hub-game/models/role/square/top-coat.pxmodel +157 -0
- package/kits/hub-game/models/role/square/top-scrubs.pxmodel +93 -0
- package/kits/hub-game/models/role/square/top-tabard.pxmodel +109 -0
- package/kits/hub-game/models/role/square/top-vest.pxmodel +109 -0
- package/kits/hub-game/models/role/tool-bag.pxmodel +75 -0
- package/kits/hub-game/models/role/tool-bell.pxmodel +71 -0
- package/kits/hub-game/models/role/tool-hose.pxmodel +60 -0
- package/kits/hub-game/models/role/tool-parcel.pxmodel +61 -0
- package/kits/hub-game/models/role/tool-torch.pxmodel +55 -0
- package/kits/hub-game/models/role/tool-tray.pxmodel +75 -0
- package/kits/hub-game/models/role/top-apron.pxmodel +70 -0
- package/kits/hub-game/models/role/top-cardigan.pxmodel +102 -0
- package/kits/hub-game/models/role/top-coat.pxmodel +79 -0
- package/kits/hub-game/models/role/top-scrubs.pxmodel +54 -0
- package/kits/hub-game/models/role/top-tabard.pxmodel +70 -0
- package/kits/hub-game/models/role/top-vest.pxmodel +70 -0
- package/kits/hub-game/package-lock.json +1 -1
- package/kits/hub-game/package.json +1 -1
- package/kits/hub-game/scripts/check.mjs +7 -4
- package/kits/hub-game/scripts/fixtures/car-vectors.json +279 -0
- package/kits/hub-game/scripts/fixtures/decor-keyless-draw.json +2 -1
- package/kits/hub-game/scripts/fixtures/hud-surface.json +670 -0
- package/kits/hub-game/scripts/fixtures/talk-surface.json +3930 -0
- package/kits/hub-game/scripts/gen-hats.mjs +46 -2
- package/kits/hub-game/scripts/gen-role.mjs +80 -0
- package/kits/hub-game/scripts/test-act-core.mjs +167 -0
- package/kits/hub-game/scripts/test-actions-client.mjs +34 -0
- package/kits/hub-game/scripts/test-actors.mjs +48 -0
- package/kits/hub-game/scripts/test-analytics.mjs +99 -5
- package/kits/hub-game/scripts/test-apply-deck.mjs +122 -0
- package/kits/hub-game/scripts/test-back-visibility.mjs +3 -1
- package/kits/hub-game/scripts/test-ballot.mjs +2 -0
- package/kits/hub-game/scripts/test-car.mjs +43 -0
- package/kits/hub-game/scripts/test-decor-client.mjs +2 -1
- package/kits/hub-game/scripts/test-decor.mjs +77 -0
- package/kits/hub-game/scripts/test-device-class.mjs +83 -0
- package/kits/hub-game/scripts/test-emote-wheel.mjs +374 -0
- package/kits/hub-game/scripts/test-hats.mjs +5 -4
- package/kits/hub-game/scripts/test-host-go.mjs +265 -0
- package/kits/hub-game/scripts/test-hub-controls.mjs +108 -0
- package/kits/hub-game/scripts/test-hub-entry.mjs +531 -0
- package/kits/hub-game/scripts/test-hub-ops.mjs +75 -0
- package/kits/hub-game/scripts/test-hub-trip.mjs +85 -0
- package/kits/hub-game/scripts/test-hud-clear.mjs +12 -2
- package/kits/hub-game/scripts/test-hud-rate.mjs +6 -2
- package/kits/hub-game/scripts/test-hud-surface.mjs +272 -0
- package/kits/hub-game/scripts/test-idle.mjs +347 -1
- package/kits/hub-game/scripts/test-interest-cells.mjs +8 -1
- package/kits/hub-game/scripts/test-invites-client.mjs +42 -1
- package/kits/hub-game/scripts/test-manifest.mjs +30 -0
- package/kits/hub-game/scripts/test-no-trips.mjs +42 -0
- package/kits/hub-game/scripts/test-placement-cache.mjs +1 -1
- package/kits/hub-game/scripts/test-quality.mjs +13 -0
- package/kits/hub-game/scripts/test-rehello.mjs +258 -3
- package/kits/hub-game/scripts/test-resume-pose-server.mjs +203 -0
- package/kits/hub-game/scripts/test-resync.mjs +183 -0
- package/kits/hub-game/scripts/test-role-client.mjs +421 -0
- package/kits/hub-game/scripts/test-role.mjs +350 -0
- package/kits/hub-game/scripts/test-safe-layout.mjs +50 -1
- package/kits/hub-game/scripts/test-soundscape.mjs +124 -7
- package/kits/hub-game/scripts/test-standing.mjs +15 -1
- package/kits/hub-game/scripts/test-talk-surface.mjs +296 -0
- package/kits/hub-game/scripts/test-tiers.mjs +13 -0
- package/kits/hub-game/scripts/test-ui-dom-dom.mjs +96 -0
- package/kits/hub-game/scripts/test-ui-tree.mjs +711 -0
- package/kits/hub-game/scripts/test-vehicle-client.mjs +159 -0
- package/kits/hub-game/scripts/test-vehicle.mjs +135 -0
- package/kits/hub-game/scripts/test-yours.mjs +33 -0
- package/kits/hub-game/tools/hubScene/export.mjs +613 -0
- package/kits/hub-game/tools/hubScene/hubdata.mjs +921 -0
- package/kits/hub-game/tools/hubScene/merge-root.mjs +39 -0
- package/kits/hub-game/tools/hubScene/nodeworld.mjs +227 -0
- package/kits/hub-game/tools/hubScene/test/export-fixture.mjs +798 -0
- package/kits/hub-game/tools/hubScene/test/fixture.json +637 -0
- package/kits/hub-game/tools/hubScene/test/paint-export.mjs +40 -0
- package/kits/hub-game/tools/hubScene/test/upload.test.mjs +655 -0
- package/kits/hub-game/tools/hubScene/upload.mjs +636 -0
- package/kits/hub-game/tools/hubScene/validate-manifest.mjs +291 -0
- package/kits/multiplayer-3d/castle.json +4 -4
- package/kits/multiplayer-3d/code/client/resumeGate.js +30 -2
- package/kits/multiplayer-3d/code/client/steer.js +3 -1
- package/kits/multiplayer-3d/code/systems/multiplayer.js +30 -2
- package/kits/multiplayer-3d/package-lock.json +1 -1
- package/kits/multiplayer-3d/scripts/test-resume-gate.mjs +74 -2
- package/kits/physics-3d/CLAUDE.md +1 -1
- package/kits/physics-3d/behaviors/Player.jsx +37 -27
- package/kits/physics-3d/castle.json +2 -2
- package/kits/physics-3d/docs/engine-geometry-memory.md +23 -0
- package/kits/physics-3d/engine3d/memoryprofile.js +17 -0
- package/kits/physics-3d/engine3d/playerRun.js +6 -1
- package/kits/physics-3d/engine3d/pxmodel.js +6 -1
- package/kits/physics-3d/engine3d/world3d.js +6 -3
- package/kits/physics-3d/package.json +1 -1
- package/kits/physics-3d/play/behaviors/Player.js +40 -28
- package/kits/physics-3d/scripts/test-memory-profile.mjs +237 -0
- package/kits/physics-3d/systems/physics3d.js +5 -2
- package/kits/real-time/castle.json +2 -2
- package/kits/real-time/code/client/messages.js +5 -0
- package/kits/real-time/code/server/session.js +28 -1
- package/kits/real-time/package-lock.json +1 -1
- package/package.json +5 -4
- package/vendor/three/LICENSE +21 -0
- package/vendor/three/build/three.core.js +58773 -0
- package/vendor/three/build/three.module.js +18251 -0
- package/vendor/three/examples/jsm/controls/OrbitControls.js +1860 -0
- package/vendor/three/examples/jsm/controls/TransformControls.js +1918 -0
- package/vendor/three/examples/jsm/exporters/GLTFExporter.js +3595 -0
- package/vendor/three/examples/jsm/geometries/RoundedBoxGeometry.js +216 -0
- package/vendor/three/examples/jsm/math/MeshSurfaceSampler.js +315 -0
- package/vendor/three/examples/jsm/postprocessing/EffectComposer.js +363 -0
- package/vendor/three/examples/jsm/postprocessing/MaskPass.js +195 -0
- package/vendor/three/examples/jsm/postprocessing/OutputPass.js +139 -0
- package/vendor/three/examples/jsm/postprocessing/Pass.js +191 -0
- package/vendor/three/examples/jsm/postprocessing/RenderPass.js +183 -0
- package/vendor/three/examples/jsm/postprocessing/ShaderPass.js +135 -0
- package/vendor/three/examples/jsm/shaders/CopyShader.js +52 -0
- package/vendor/three/examples/jsm/shaders/OutputShader.js +103 -0
- package/vendor/three/examples/jsm/utils/BufferGeometryUtils.js +1435 -0
- package/vendor/three/package.json +134 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# The `vehicle` preset: driving a car (contract v1.160)
|
|
2
|
+
|
|
3
|
+
Life RP build-plan line 3. The contract has reserved `vehicle` since v1 (§6,
|
|
4
|
+
"refused until built"). This builds it for one kind of vehicle, a car on a
|
|
5
|
+
road, with the boats as the precedent for the parts that already exist:
|
|
6
|
+
|
|
7
|
+
- The boats sail by **the server** moving kinematic twins (`hub.move` with
|
|
8
|
+
`overMs`). That is right for a scripted trip and wrong for a car a player
|
|
9
|
+
steers: a server-moved car answers the stick a round trip late.
|
|
10
|
+
- So a car is **the driver's own player body**, client-predicted and
|
|
11
|
+
server-clamped exactly as walking is, with a car's dynamics instead of a
|
|
12
|
+
walk's, and the car's model drawn under the driver's avatar node the way
|
|
13
|
+
`wear.js` draws a hat. No actor is made per car and nothing new rides the
|
|
14
|
+
pose stream: a moving car costs what a walking player costs.
|
|
15
|
+
- A hub game ships no client code, so all of it is the kit's; the place only
|
|
16
|
+
says who drives what (server API below).
|
|
17
|
+
|
|
18
|
+
## Server API
|
|
19
|
+
|
|
20
|
+
| call | what |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| `hub.drive(playerId, car)` | put a player who has arrived, is not held and not on a trip into the vehicle preset. `car` is below. Returns `true`, or `false` (logged once) when refused. A second call while driving replaces the car (a respray). |
|
|
23
|
+
| `hub.drive(playerId, null, at?)` | get out: the walk preset back, standing at `at` (`{ x, z, y?, facing? }`), default 1.6 m to the car's left. Every rider gets out too, beside their seat. |
|
|
24
|
+
| `hub.ride(playerId, driverId, seat)` | a passenger in seat `seat` (1..seats-1) of a driver's car. The rider is held (§8) and the kit keeps their server pose on the seat each tick; refused for a taken seat, a rider who is held, driving or riding, or more than 6 m from the car. |
|
|
25
|
+
| `hub.ride(playerId, null)` | get out, beside the seat. |
|
|
26
|
+
| `hub.vehicle(playerId)` | `{ driver: true, car }`, `{ driver: false, of, seat }` or `null`. |
|
|
27
|
+
|
|
28
|
+
`car`:
|
|
29
|
+
|
|
30
|
+
| field | default | bounds | meaning |
|
|
31
|
+
| --- | --- | --- | --- |
|
|
32
|
+
| `look` | required | a scene actor with a `Model` | the body: its model is cloned under the driver's avatar node, at the actor's authored scale; a hidden template (as the boats' are) |
|
|
33
|
+
| `color` | none | `#rrggbb` | tints the look's `paint` material colour, when it has one |
|
|
34
|
+
| `seats` | `[[0, 0, 0]]` | 1-4 points, metres, car-local (+Z forward) | seat 0 is the driver's; the car is drawn so seat 0 is over the driver's body |
|
|
35
|
+
| `length`, `width` | 4, 1.8 | 2-10, 1-3 | for the bumper probes and stuck |
|
|
36
|
+
| `speed` | 12 | 2-16 m/s | top speed forward |
|
|
37
|
+
| `reverse` | 4 | 1-6 m/s | |
|
|
38
|
+
| `accel`, `brake` | 6, 14 | 1-20 m/s² | |
|
|
39
|
+
| `turn` | 1.6 | 0.3-3 rad/s | yaw rate at speed; it falls to 0 at rest (no turning on the spot) |
|
|
40
|
+
| `camDistance`, `camHeight` | Player's × 1.4 | | the follow camera while driving |
|
|
41
|
+
| `horn` | none | a file the place's `idle.sounds` lists | offers a Horn button; one honk a second |
|
|
42
|
+
|
|
43
|
+
## What players see and do
|
|
44
|
+
|
|
45
|
+
- **Driver.** The same stick and keys as walking (tank-style: up/W forward,
|
|
46
|
+
down/S brake then reverse, sideways steers), through a pure step function
|
|
47
|
+
`stepCar(state, input, car, dt) -> state` (`code/client/car.js`, unit
|
|
48
|
+
tested): speed eases toward `speed * forward` at `accel` (at `brake` when
|
|
49
|
+
the input opposes the motion; a rolling coast of 2 m/s² with no input),
|
|
50
|
+
yaw rate is `turn * steer * clamp(|v| / 4, 0, 1) * sign(v)`, taken off the heading (a right steer lowers it and turns right, as walking does), and the follow
|
|
51
|
+
camera turns with the heading as it does walking. No jump. The body is
|
|
52
|
+
driven with the walk's velocity-matching impulse, so the server clamp and
|
|
53
|
+
the hover over the ground are unchanged.
|
|
54
|
+
- **Bumpers.** The body is still the walk's capsule, so the car's nose and
|
|
55
|
+
tail would pass into walls. Each frame two rays at body height, from the
|
|
56
|
+
capsule along ±heading, reach `length / 2`; a hit within that ahead (or
|
|
57
|
+
behind, reversing) stops the car (speed 0) and keeps it there while the
|
|
58
|
+
input pushes into the hit. Corners are not probed: a scraped corner
|
|
59
|
+
passes into a wall by at most `width / 2`. Other players are not solid
|
|
60
|
+
to a car (they are not to a walker either).
|
|
61
|
+
- **Riders** see themselves in their seat, drawn from the driver's DRAWN pose
|
|
62
|
+
(so a rider never lags its car), and their camera follows the car. Their
|
|
63
|
+
input is ignored but for the place's own Get out chip (actions, v1.74).
|
|
64
|
+
- **Everyone** draws the car on the driver's avatar, the driver seated in
|
|
65
|
+
seat 0 (the sit pose, §6), riders seated in theirs. The look follows the
|
|
66
|
+
avatar's node, so per-viewer hiding, cell interest, the far-avatar cap and
|
|
67
|
+
Low's rules all apply to cars as they do to avatars, and a car costs one
|
|
68
|
+
cloned merged model per viewer who draws it.
|
|
69
|
+
- **Stuck** (v1.33) counts drive input as walk input, and in a car the chip
|
|
70
|
+
reads "Stuck? Tap to reset the car". The place's `unstick` hook picks the
|
|
71
|
+
spot (the deck's nearest road point, facing along the road); the driver is
|
|
72
|
+
put there still driving and the riders come along.
|
|
73
|
+
|
|
74
|
+
## Dynamics model (agreed with the native engine)
|
|
75
|
+
|
|
76
|
+
Client-predicted, as walking is: the driver's own device steps the car and
|
|
77
|
+
reports its body's pose; the server only clamps the movement to `car.speed`
|
|
78
|
+
(or `reverse`, whichever is larger). The web client and the native engine run
|
|
79
|
+
the same pure function, `stepCar(state, input, car, dt)` exported from
|
|
80
|
+
`code/client/car.js`, on a car parsed by `parseCar` (`code/shared/car.js`).
|
|
81
|
+
`state` is `{ speed, heading }` (m/s signed, radians: 0 runs along +Z and a positive heading points toward +X, so a right steer lowers it); `input` is `{ forward, steer, front?, back? }`, where `front` and
|
|
82
|
+
`back` are the bumper rays' hit distances (absent for no hit). The native
|
|
83
|
+
engine casts those rays with its own physics. `scripts/fixtures/car-vectors.json`
|
|
84
|
+
holds input/output vectors that `scripts/test-car.mjs` checks the web function
|
|
85
|
+
against; the native engine checks its host against the same file.
|
|
86
|
+
|
|
87
|
+
## Wire
|
|
88
|
+
|
|
89
|
+
- `hubCars` in the snapshot and, when it changes, the delta (a latch: the
|
|
90
|
+
whole map each time, `{}` once the last car is gone; absent means no
|
|
91
|
+
change): `playerId -> { look, color?, seats, length, width, speed, reverse,
|
|
92
|
+
accel, brake, turn, cam: { distance?, height? }, horn?, riders: { [seat]:
|
|
93
|
+
playerId } }`. A rider's own seat is read from it.
|
|
94
|
+
- `{ k: "hub-horn" }` (client to server, driver only, one a second, only for a
|
|
95
|
+
car with `horn`); the server broadcasts `{ k: "hub-sound", player, file,
|
|
96
|
+
volume: 1, radius: 20 }`, the existing sound event with a player source in
|
|
97
|
+
place of `actor`.
|
|
98
|
+
|
|
99
|
+
## Server rules
|
|
100
|
+
|
|
101
|
+
- The driver's movement clamp follows `car.speed` (the way `hub.tune`'s does);
|
|
102
|
+
getting out puts the walk's back. A driver cannot be tuned while driving
|
|
103
|
+
(`hub.tune` is kept and applies on getting out).
|
|
104
|
+
- `hub.hold` of a driver stops the car (speed 0) and keeps them driving;
|
|
105
|
+
`release` lets them drive on. A seat (`HubSeat`) cannot be taken while
|
|
106
|
+
driving or riding.
|
|
107
|
+
- Leaving, a trip, a game's end, `hub.end` or the driver's drop past the
|
|
108
|
+
retained-reconnect window gets everyone out. A retained reconnect (v1.89)
|
|
109
|
+
keeps the car and its riders: the rejoining client is sent `hubCars`.
|
|
110
|
+
- A rider's server pose is the driver's server pose plus the seat offset,
|
|
111
|
+
rotated by the driver's heading, written each tick; its client sends no
|
|
112
|
+
pose while riding (and one sent is dropped).
|
|
113
|
+
- At most 24 cars in a place and 4 seats a car.
|
|
114
|
+
|
|
115
|
+
## Not in v1.160
|
|
116
|
+
|
|
117
|
+
Lights, damage, a car pushing loose objects harder than a walker does,
|
|
118
|
+
passengers changing seats, a car going through a door, and a car crossing
|
|
119
|
+
places. The deck's parked cars are its own spawned copies (§10): it
|
|
120
|
+
despawns one when its driver gets in and spawns one where they get out.
|
|
121
|
+
|
|
122
|
+
## Tests
|
|
123
|
+
|
|
124
|
+
- `scripts/test-car.mjs`: `stepCar` accel, brake, reverse, coast, no turn at
|
|
125
|
+
rest, top-speed bounds, bumper stop and back-off.
|
|
126
|
+
- `scripts/test-vehicle.mjs` (server): drive/ride validation and refusals,
|
|
127
|
+
seat pinning math, clamp follows speed, get-out positions, leave/trip/end
|
|
128
|
+
cleanup, retained reconnect keeps the car, `hubCars` deltas.
|
|
129
|
+
- `scripts/test-vehicle-client.mjs`: drawing a car on a driver's node and a
|
|
130
|
+
rider at its seat from the drawn pose; input ignored while riding; stuck
|
|
131
|
+
wording.
|
|
132
|
+
- A place without `hub.drive` is sent and draws exactly what it was.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "pxmodel",
|
|
3
|
+
"name": "baker-cap",
|
|
4
|
+
"triangles": 900,
|
|
5
|
+
"look": {
|
|
6
|
+
"outline": 0.02,
|
|
7
|
+
"outlineColor": "#241a2e",
|
|
8
|
+
"rim": 0.3,
|
|
9
|
+
"ao": 0.4
|
|
10
|
+
},
|
|
11
|
+
"parts": [
|
|
12
|
+
{
|
|
13
|
+
"id": "crown",
|
|
14
|
+
"kind": "cylinder",
|
|
15
|
+
"radius": 0.21,
|
|
16
|
+
"height": 0.12,
|
|
17
|
+
"position": [
|
|
18
|
+
0,
|
|
19
|
+
0.06,
|
|
20
|
+
0
|
|
21
|
+
],
|
|
22
|
+
"color": "#e8c96a",
|
|
23
|
+
"segments": 16,
|
|
24
|
+
"flat": true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "band",
|
|
28
|
+
"kind": "cylinder",
|
|
29
|
+
"radius": 0.215,
|
|
30
|
+
"height": 0.025,
|
|
31
|
+
"position": [
|
|
32
|
+
0,
|
|
33
|
+
0.012,
|
|
34
|
+
0
|
|
35
|
+
],
|
|
36
|
+
"color": "#2b2b33",
|
|
37
|
+
"segments": 16,
|
|
38
|
+
"flat": true
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "visor",
|
|
42
|
+
"kind": "extrude",
|
|
43
|
+
"outline": [
|
|
44
|
+
[
|
|
45
|
+
-0.19,
|
|
46
|
+
0
|
|
47
|
+
],
|
|
48
|
+
[
|
|
49
|
+
-0.1748,
|
|
50
|
+
0.165
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
-0.10450000000000001,
|
|
54
|
+
0.27
|
|
55
|
+
],
|
|
56
|
+
[
|
|
57
|
+
0,
|
|
58
|
+
0.3
|
|
59
|
+
],
|
|
60
|
+
[
|
|
61
|
+
0.10450000000000001,
|
|
62
|
+
0.27
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
0.1748,
|
|
66
|
+
0.165
|
|
67
|
+
],
|
|
68
|
+
[
|
|
69
|
+
0.19,
|
|
70
|
+
0
|
|
71
|
+
]
|
|
72
|
+
],
|
|
73
|
+
"depth": 0.02,
|
|
74
|
+
"bevel": 0.006,
|
|
75
|
+
"position": [
|
|
76
|
+
0,
|
|
77
|
+
0.015,
|
|
78
|
+
0
|
|
79
|
+
],
|
|
80
|
+
"rotation": [
|
|
81
|
+
82,
|
|
82
|
+
0,
|
|
83
|
+
0
|
|
84
|
+
],
|
|
85
|
+
"color": "#2b2b33",
|
|
86
|
+
"flat": true
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "pxmodel",
|
|
3
|
+
"name": "chef-toque",
|
|
4
|
+
"triangles": 900,
|
|
5
|
+
"look": {
|
|
6
|
+
"outline": 0.02,
|
|
7
|
+
"outlineColor": "#241a2e",
|
|
8
|
+
"rim": 0.3,
|
|
9
|
+
"ao": 0.4
|
|
10
|
+
},
|
|
11
|
+
"parts": [
|
|
12
|
+
{
|
|
13
|
+
"id": "band",
|
|
14
|
+
"kind": "cylinder",
|
|
15
|
+
"radius": 0.2,
|
|
16
|
+
"height": 0.12,
|
|
17
|
+
"position": [
|
|
18
|
+
0,
|
|
19
|
+
0.06,
|
|
20
|
+
0
|
|
21
|
+
],
|
|
22
|
+
"color": "#2b2b33",
|
|
23
|
+
"segments": 16,
|
|
24
|
+
"flat": true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "toque",
|
|
28
|
+
"kind": "lathe",
|
|
29
|
+
"profile": [
|
|
30
|
+
[
|
|
31
|
+
0.2,
|
|
32
|
+
0.025
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
0.2,
|
|
36
|
+
0.16
|
|
37
|
+
],
|
|
38
|
+
[
|
|
39
|
+
0.25,
|
|
40
|
+
0.2
|
|
41
|
+
],
|
|
42
|
+
[
|
|
43
|
+
0.25,
|
|
44
|
+
0.33
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
0.18,
|
|
48
|
+
0.37
|
|
49
|
+
],
|
|
50
|
+
[
|
|
51
|
+
0,
|
|
52
|
+
0.37
|
|
53
|
+
]
|
|
54
|
+
],
|
|
55
|
+
"color": "#f4f6fa",
|
|
56
|
+
"segments": 16,
|
|
57
|
+
"flat": true
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "pxmodel",
|
|
3
|
+
"name": "delivery-cap",
|
|
4
|
+
"triangles": 900,
|
|
5
|
+
"look": {
|
|
6
|
+
"outline": 0.02,
|
|
7
|
+
"outlineColor": "#241a2e",
|
|
8
|
+
"rim": 0.3,
|
|
9
|
+
"ao": 0.4
|
|
10
|
+
},
|
|
11
|
+
"parts": [
|
|
12
|
+
{
|
|
13
|
+
"id": "crown",
|
|
14
|
+
"kind": "cylinder",
|
|
15
|
+
"radius": 0.21,
|
|
16
|
+
"height": 0.12,
|
|
17
|
+
"position": [
|
|
18
|
+
0,
|
|
19
|
+
0.06,
|
|
20
|
+
0
|
|
21
|
+
],
|
|
22
|
+
"color": "#f0a12b",
|
|
23
|
+
"segments": 16,
|
|
24
|
+
"flat": true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "band",
|
|
28
|
+
"kind": "cylinder",
|
|
29
|
+
"radius": 0.215,
|
|
30
|
+
"height": 0.025,
|
|
31
|
+
"position": [
|
|
32
|
+
0,
|
|
33
|
+
0.012,
|
|
34
|
+
0
|
|
35
|
+
],
|
|
36
|
+
"color": "#2b2b33",
|
|
37
|
+
"segments": 16,
|
|
38
|
+
"flat": true
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "visor",
|
|
42
|
+
"kind": "extrude",
|
|
43
|
+
"outline": [
|
|
44
|
+
[
|
|
45
|
+
-0.19,
|
|
46
|
+
0
|
|
47
|
+
],
|
|
48
|
+
[
|
|
49
|
+
-0.1748,
|
|
50
|
+
0.165
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
-0.10450000000000001,
|
|
54
|
+
0.27
|
|
55
|
+
],
|
|
56
|
+
[
|
|
57
|
+
0,
|
|
58
|
+
0.3
|
|
59
|
+
],
|
|
60
|
+
[
|
|
61
|
+
0.10450000000000001,
|
|
62
|
+
0.27
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
0.1748,
|
|
66
|
+
0.165
|
|
67
|
+
],
|
|
68
|
+
[
|
|
69
|
+
0.19,
|
|
70
|
+
0
|
|
71
|
+
]
|
|
72
|
+
],
|
|
73
|
+
"depth": 0.02,
|
|
74
|
+
"bevel": 0.006,
|
|
75
|
+
"position": [
|
|
76
|
+
0,
|
|
77
|
+
0.015,
|
|
78
|
+
0
|
|
79
|
+
],
|
|
80
|
+
"rotation": [
|
|
81
|
+
82,
|
|
82
|
+
0,
|
|
83
|
+
0
|
|
84
|
+
],
|
|
85
|
+
"color": "#2b2b33",
|
|
86
|
+
"flat": true
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "patch",
|
|
90
|
+
"kind": "box",
|
|
91
|
+
"size": [
|
|
92
|
+
0.09,
|
|
93
|
+
0.04,
|
|
94
|
+
0.015
|
|
95
|
+
],
|
|
96
|
+
"position": [
|
|
97
|
+
0,
|
|
98
|
+
0.075,
|
|
99
|
+
0.212
|
|
100
|
+
],
|
|
101
|
+
"color": "#f4f6fa",
|
|
102
|
+
"flat": true
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "pxmodel",
|
|
3
|
+
"name": "fire-helmet",
|
|
4
|
+
"triangles": 900,
|
|
5
|
+
"look": {
|
|
6
|
+
"outline": 0.02,
|
|
7
|
+
"outlineColor": "#241a2e",
|
|
8
|
+
"rim": 0.3,
|
|
9
|
+
"ao": 0.4
|
|
10
|
+
},
|
|
11
|
+
"parts": [
|
|
12
|
+
{
|
|
13
|
+
"id": "brim",
|
|
14
|
+
"kind": "lathe",
|
|
15
|
+
"segments": 16,
|
|
16
|
+
"profile": [
|
|
17
|
+
[
|
|
18
|
+
0.16,
|
|
19
|
+
-0.011
|
|
20
|
+
],
|
|
21
|
+
[
|
|
22
|
+
0.26499999999999996,
|
|
23
|
+
-0.011
|
|
24
|
+
],
|
|
25
|
+
[
|
|
26
|
+
0.3,
|
|
27
|
+
-0.0044
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
0.3,
|
|
31
|
+
0.0088
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
0.26499999999999996,
|
|
35
|
+
0.011
|
|
36
|
+
],
|
|
37
|
+
[
|
|
38
|
+
0.16,
|
|
39
|
+
0.011
|
|
40
|
+
]
|
|
41
|
+
],
|
|
42
|
+
"color": "#e5484d",
|
|
43
|
+
"flat": true
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"id": "crown",
|
|
47
|
+
"kind": "lathe",
|
|
48
|
+
"profile": [
|
|
49
|
+
[
|
|
50
|
+
0.21,
|
|
51
|
+
0
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
0.21,
|
|
55
|
+
0.1
|
|
56
|
+
],
|
|
57
|
+
[
|
|
58
|
+
0.16,
|
|
59
|
+
0.22
|
|
60
|
+
],
|
|
61
|
+
[
|
|
62
|
+
0,
|
|
63
|
+
0.26
|
|
64
|
+
]
|
|
65
|
+
],
|
|
66
|
+
"color": "#e5484d",
|
|
67
|
+
"segments": 16,
|
|
68
|
+
"flat": true
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"id": "badge",
|
|
72
|
+
"kind": "box",
|
|
73
|
+
"size": [
|
|
74
|
+
0.07,
|
|
75
|
+
0.09,
|
|
76
|
+
0.02
|
|
77
|
+
],
|
|
78
|
+
"position": [
|
|
79
|
+
0,
|
|
80
|
+
0.1,
|
|
81
|
+
0.215
|
|
82
|
+
],
|
|
83
|
+
"color": "#e3c35a",
|
|
84
|
+
"flat": true
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "pxmodel",
|
|
3
|
+
"name": "hard-hat",
|
|
4
|
+
"triangles": 900,
|
|
5
|
+
"look": {
|
|
6
|
+
"outline": 0.02,
|
|
7
|
+
"outlineColor": "#241a2e",
|
|
8
|
+
"rim": 0.3,
|
|
9
|
+
"ao": 0.4
|
|
10
|
+
},
|
|
11
|
+
"parts": [
|
|
12
|
+
{
|
|
13
|
+
"id": "brim",
|
|
14
|
+
"kind": "lathe",
|
|
15
|
+
"segments": 16,
|
|
16
|
+
"profile": [
|
|
17
|
+
[
|
|
18
|
+
0.16,
|
|
19
|
+
-0.011
|
|
20
|
+
],
|
|
21
|
+
[
|
|
22
|
+
0.23500000000000001,
|
|
23
|
+
-0.011
|
|
24
|
+
],
|
|
25
|
+
[
|
|
26
|
+
0.26,
|
|
27
|
+
-0.0044
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
0.26,
|
|
31
|
+
0.0088
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
0.23500000000000001,
|
|
35
|
+
0.011
|
|
36
|
+
],
|
|
37
|
+
[
|
|
38
|
+
0.16,
|
|
39
|
+
0.011
|
|
40
|
+
]
|
|
41
|
+
],
|
|
42
|
+
"color": "#2b2b33",
|
|
43
|
+
"flat": true
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"id": "crown",
|
|
47
|
+
"kind": "lathe",
|
|
48
|
+
"profile": [
|
|
49
|
+
[
|
|
50
|
+
0.21,
|
|
51
|
+
0
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
0.2,
|
|
55
|
+
0.14
|
|
56
|
+
],
|
|
57
|
+
[
|
|
58
|
+
0.12,
|
|
59
|
+
0.23
|
|
60
|
+
],
|
|
61
|
+
[
|
|
62
|
+
0,
|
|
63
|
+
0.25
|
|
64
|
+
]
|
|
65
|
+
],
|
|
66
|
+
"color": "#f0c419",
|
|
67
|
+
"segments": 16,
|
|
68
|
+
"flat": true
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "pxmodel",
|
|
3
|
+
"name": "nurse-cap",
|
|
4
|
+
"triangles": 900,
|
|
5
|
+
"look": {
|
|
6
|
+
"outline": 0.02,
|
|
7
|
+
"outlineColor": "#241a2e",
|
|
8
|
+
"rim": 0.3,
|
|
9
|
+
"ao": 0.4
|
|
10
|
+
},
|
|
11
|
+
"parts": [
|
|
12
|
+
{
|
|
13
|
+
"id": "cap",
|
|
14
|
+
"kind": "box",
|
|
15
|
+
"size": [
|
|
16
|
+
0.4,
|
|
17
|
+
0.13,
|
|
18
|
+
0.3
|
|
19
|
+
],
|
|
20
|
+
"position": [
|
|
21
|
+
0,
|
|
22
|
+
0.065,
|
|
23
|
+
0
|
|
24
|
+
],
|
|
25
|
+
"color": "#f4f6fa",
|
|
26
|
+
"flat": true
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "crossV",
|
|
30
|
+
"kind": "box",
|
|
31
|
+
"size": [
|
|
32
|
+
0.025,
|
|
33
|
+
0.08,
|
|
34
|
+
0.015
|
|
35
|
+
],
|
|
36
|
+
"position": [
|
|
37
|
+
0,
|
|
38
|
+
0.07,
|
|
39
|
+
0.16
|
|
40
|
+
],
|
|
41
|
+
"color": "#e5484d",
|
|
42
|
+
"flat": true
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "crossH",
|
|
46
|
+
"kind": "box",
|
|
47
|
+
"size": [
|
|
48
|
+
0.08,
|
|
49
|
+
0.025,
|
|
50
|
+
0.015
|
|
51
|
+
],
|
|
52
|
+
"position": [
|
|
53
|
+
0,
|
|
54
|
+
0.07,
|
|
55
|
+
0.16
|
|
56
|
+
],
|
|
57
|
+
"color": "#e5484d",
|
|
58
|
+
"flat": true
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "pxmodel",
|
|
3
|
+
"name": "police-cap",
|
|
4
|
+
"triangles": 900,
|
|
5
|
+
"look": {
|
|
6
|
+
"outline": 0.02,
|
|
7
|
+
"outlineColor": "#241a2e",
|
|
8
|
+
"rim": 0.3,
|
|
9
|
+
"ao": 0.4
|
|
10
|
+
},
|
|
11
|
+
"parts": [
|
|
12
|
+
{
|
|
13
|
+
"id": "crown",
|
|
14
|
+
"kind": "cylinder",
|
|
15
|
+
"radius": 0.21,
|
|
16
|
+
"height": 0.12,
|
|
17
|
+
"position": [
|
|
18
|
+
0,
|
|
19
|
+
0.06,
|
|
20
|
+
0
|
|
21
|
+
],
|
|
22
|
+
"color": "#22335a",
|
|
23
|
+
"segments": 16,
|
|
24
|
+
"flat": true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "band",
|
|
28
|
+
"kind": "cylinder",
|
|
29
|
+
"radius": 0.215,
|
|
30
|
+
"height": 0.025,
|
|
31
|
+
"position": [
|
|
32
|
+
0,
|
|
33
|
+
0.012,
|
|
34
|
+
0
|
|
35
|
+
],
|
|
36
|
+
"color": "#2b2b33",
|
|
37
|
+
"segments": 16,
|
|
38
|
+
"flat": true
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "visor",
|
|
42
|
+
"kind": "extrude",
|
|
43
|
+
"outline": [
|
|
44
|
+
[
|
|
45
|
+
-0.19,
|
|
46
|
+
0
|
|
47
|
+
],
|
|
48
|
+
[
|
|
49
|
+
-0.1748,
|
|
50
|
+
0.165
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
-0.10450000000000001,
|
|
54
|
+
0.27
|
|
55
|
+
],
|
|
56
|
+
[
|
|
57
|
+
0,
|
|
58
|
+
0.3
|
|
59
|
+
],
|
|
60
|
+
[
|
|
61
|
+
0.10450000000000001,
|
|
62
|
+
0.27
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
0.1748,
|
|
66
|
+
0.165
|
|
67
|
+
],
|
|
68
|
+
[
|
|
69
|
+
0.19,
|
|
70
|
+
0
|
|
71
|
+
]
|
|
72
|
+
],
|
|
73
|
+
"depth": 0.02,
|
|
74
|
+
"bevel": 0.006,
|
|
75
|
+
"position": [
|
|
76
|
+
0,
|
|
77
|
+
0.015,
|
|
78
|
+
0
|
|
79
|
+
],
|
|
80
|
+
"rotation": [
|
|
81
|
+
82,
|
|
82
|
+
0,
|
|
83
|
+
0
|
|
84
|
+
],
|
|
85
|
+
"color": "#2b2b33",
|
|
86
|
+
"flat": true
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "badge",
|
|
90
|
+
"kind": "box",
|
|
91
|
+
"size": [
|
|
92
|
+
0.06,
|
|
93
|
+
0.06,
|
|
94
|
+
0.018
|
|
95
|
+
],
|
|
96
|
+
"position": [
|
|
97
|
+
0,
|
|
98
|
+
0.07,
|
|
99
|
+
0.212
|
|
100
|
+
],
|
|
101
|
+
"color": "#e3c35a",
|
|
102
|
+
"flat": true
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|