castle-web-cli 0.4.204 → 0.4.205

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.
Files changed (125) hide show
  1. package/dist/agent-failures.d.ts +3 -1
  2. package/dist/agent-failures.js +19 -0
  3. package/dist/agent-prompts.js +2 -1
  4. package/dist/agent.d.ts +3 -2
  5. package/dist/agent.js +19 -10
  6. package/dist/castle-host/host.d.ts +17 -0
  7. package/dist/castle-host/host.js +551 -4
  8. package/dist/devSessionStorage.js +65 -4
  9. package/dist/effortSupport.d.ts +7 -0
  10. package/dist/effortSupport.js +31 -0
  11. package/dist/init.js +13 -3
  12. package/dist/platformDoc.js +6 -1
  13. package/dist/serve.js +35 -2
  14. package/dist/shell/assets/{index-DHzA0-Sj.js → index-hWQTC8q6.js} +5 -5
  15. package/dist/shell/index.html +1 -1
  16. package/dist/vitePlugins.js +19 -1
  17. package/kits/base/CLAUDE.md +2 -0
  18. package/kits/base/castle.json +1 -1
  19. package/kits/base/sdk/README.md +131 -0
  20. package/kits/base/sdk/agent.d.ts +6 -0
  21. package/kits/base/sdk/agent.js +70 -0
  22. package/kits/base/sdk/castle.d.ts +4 -0
  23. package/kits/base/sdk/castle.js +2 -0
  24. package/kits/base/sdk/commands.d.ts +106 -0
  25. package/kits/base/sdk/commands.js +21 -0
  26. package/kits/base/sdk/decks.d.ts +7 -0
  27. package/kits/base/sdk/decks.js +31 -0
  28. package/kits/base/sdk/runtime.d.ts +4 -2
  29. package/kits/base/sdk/runtime.js +51 -40
  30. package/kits/base/sdk/server/storage.d.ts +44 -0
  31. package/kits/base/sdk/server/storage.js +54 -0
  32. package/kits/base/sdk/transport.d.ts +5 -1
  33. package/kits/base/sdk/transport.js +106 -23
  34. package/kits/multiplayer-2d/castle.json +4 -4
  35. package/kits/multiplayer-2d/code/client/poses.js +7 -0
  36. package/kits/multiplayer-2d/code/server/limits.js +3 -0
  37. package/kits/multiplayer-2d/code/server/ownership.js +36 -8
  38. package/kits/multiplayer-2d/code/systems/multiplayer.js +23 -2
  39. package/kits/multiplayer-3d/CLAUDE.md +12 -1
  40. package/kits/multiplayer-3d/castle.json +4 -4
  41. package/kits/multiplayer-3d/code/client/avatars.js +7 -1
  42. package/kits/multiplayer-3d/code/client/poses.js +61 -1
  43. package/kits/multiplayer-3d/code/client/steer.js +383 -0
  44. package/kits/multiplayer-3d/code/server/limits.js +3 -0
  45. package/kits/multiplayer-3d/code/server/ownership.js +114 -18
  46. package/kits/multiplayer-3d/code/server/world.js +12 -4
  47. package/kits/multiplayer-3d/code/systems/multiplayer.js +315 -34
  48. package/kits/physics-3d/CLAUDE.md +65 -7
  49. package/kits/physics-3d/castle.json +3 -3
  50. package/kits/physics-3d/docs/pxmodel-format.md +916 -15
  51. package/kits/physics-3d/engine3d/PxModelEditor.jsx +2 -2
  52. package/kits/physics-3d/engine3d/artobjects.js +218 -0
  53. package/kits/physics-3d/engine3d/blob.js +1058 -0
  54. package/kits/physics-3d/engine3d/branches.js +300 -0
  55. package/kits/physics-3d/engine3d/cage.js +496 -0
  56. package/kits/physics-3d/engine3d/cageops.js +516 -0
  57. package/kits/physics-3d/engine3d/frame.js +669 -0
  58. package/kits/physics-3d/engine3d/look.js +675 -0
  59. package/kits/physics-3d/engine3d/materialpresets.js +486 -0
  60. package/kits/physics-3d/engine3d/modelEditorWorld.js +3 -2
  61. package/kits/physics-3d/engine3d/modelrefs.js +120 -0
  62. package/kits/physics-3d/engine3d/motion.js +560 -0
  63. package/kits/physics-3d/engine3d/objtext.js +37 -0
  64. package/kits/physics-3d/engine3d/optimize.js +1083 -0
  65. package/kits/physics-3d/engine3d/paint.js +674 -0
  66. package/kits/physics-3d/engine3d/partgeometry.js +467 -0
  67. package/kits/physics-3d/engine3d/paths.js +324 -0
  68. package/kits/physics-3d/engine3d/pxmodel.js +429 -26
  69. package/kits/physics-3d/engine3d/scatter.js +102 -0
  70. package/kits/physics-3d/engine3d/sculpt.js +1148 -0
  71. package/kits/physics-3d/engine3d/surfacedetail.js +267 -0
  72. package/kits/physics-3d/engine3d/sweep.js +480 -0
  73. package/kits/physics-3d/engine3d/thumbnails.js +6 -4
  74. package/kits/physics-3d/engine3d/world3d.js +119 -17
  75. package/kits/physics-3d/eslint.config.js +13 -0
  76. package/kits/physics-3d/models/parts/axe.pxmodel +40 -0
  77. package/kits/physics-3d/models/parts/backpack.pxmodel +47 -0
  78. package/kits/physics-3d/models/parts/barrel.pxmodel +22 -0
  79. package/kits/physics-3d/models/parts/bedroll.pxmodel +28 -0
  80. package/kits/physics-3d/models/parts/belt-pouch.pxmodel +22 -0
  81. package/kits/physics-3d/models/parts/bolt.pxmodel +10 -0
  82. package/kits/physics-3d/models/parts/bracer.pxmodel +26 -0
  83. package/kits/physics-3d/models/parts/chain-span.pxmodel +12 -0
  84. package/kits/physics-3d/models/parts/chimney.pxmodel +11 -0
  85. package/kits/physics-3d/models/parts/crate.pxmodel +44 -0
  86. package/kits/physics-3d/models/parts/crystal.pxmodel +22 -0
  87. package/kits/physics-3d/models/parts/door-arched.pxmodel +12 -0
  88. package/kits/physics-3d/models/parts/engine-block.pxmodel +39 -0
  89. package/kits/physics-3d/models/parts/exhaust-pipe.pxmodel +30 -0
  90. package/kits/physics-3d/models/parts/fence-span.pxmodel +10 -0
  91. package/kits/physics-3d/models/parts/fender.pxmodel +19 -0
  92. package/kits/physics-3d/models/parts/headlight.pxmodel +24 -0
  93. package/kits/physics-3d/models/parts/hood.pxmodel +17 -0
  94. package/kits/physics-3d/models/parts/horned-helmet.pxmodel +37 -0
  95. package/kits/physics-3d/models/parts/jerry-can.pxmodel +26 -0
  96. package/kits/physics-3d/models/parts/ladder.pxmodel +10 -0
  97. package/kits/physics-3d/models/parts/lamp.pxmodel +20 -0
  98. package/kits/physics-3d/models/parts/lantern.pxmodel +30 -0
  99. package/kits/physics-3d/models/parts/leaf-cluster.pxmodel +21 -0
  100. package/kits/physics-3d/models/parts/offroad-tire.pxmodel +48 -0
  101. package/kits/physics-3d/models/parts/pauldron.pxmodel +26 -0
  102. package/kits/physics-3d/models/parts/rivet.pxmodel +8 -0
  103. package/kits/physics-3d/models/parts/rock.pxmodel +21 -0
  104. package/kits/physics-3d/models/parts/roll-bar-light.pxmodel +26 -0
  105. package/kits/physics-3d/models/parts/round-shield.pxmodel +31 -0
  106. package/kits/physics-3d/models/parts/saddlebag.pxmodel +30 -0
  107. package/kits/physics-3d/models/parts/spoked-wheel.pxmodel +39 -0
  108. package/kits/physics-3d/models/parts/staff.pxmodel +33 -0
  109. package/kits/physics-3d/models/parts/stepping-stones.pxmodel +8 -0
  110. package/kits/physics-3d/models/parts/stone-base.pxmodel +10 -0
  111. package/kits/physics-3d/models/parts/sword.pxmodel +33 -0
  112. package/kits/physics-3d/models/parts/window-lit.pxmodel +13 -0
  113. package/kits/physics-3d/models/parts/wizard-hat.pxmodel +28 -0
  114. package/kits/physics-3d/models/templates/biped-stout.pxmodel +59 -0
  115. package/kits/physics-3d/models/templates/biped-tall.pxmodel +63 -0
  116. package/kits/physics-3d/models/templates/quadruped.pxmodel +52 -0
  117. package/kits/physics-3d/scripts/render/filmstrip.js +217 -0
  118. package/kits/physics-3d/scripts/render/index.html +20 -0
  119. package/kits/physics-3d/scripts/render/sheet.js +411 -0
  120. package/kits/physics-3d/scripts/render.mjs +646 -0
  121. package/kits/real-time/castle.json +2 -2
  122. package/kits/real-time/code/client/ownership.js +14 -4
  123. package/kits/real-time/code/client/smooth.js +2 -2
  124. package/kits/real-time/code/server/session.js +20 -4
  125. package/package.json +2 -2
@@ -15,6 +15,18 @@ import {
15
15
  artRefSignature,
16
16
  } from './materials';
17
17
  import { parseModelCached, buildModelNode, modelArtSignature, animateModelParts } from './pxmodel';
18
+ import { animateMotion } from './motion';
19
+ import { modelRefSignature } from './modelrefs';
20
+ import {
21
+ takeModel,
22
+ releaseModel,
23
+ copyModel,
24
+ isStaticModel,
25
+ makeInstances,
26
+ drawInstances,
27
+ aimInstances,
28
+ removeInstances,
29
+ } from './optimize';
18
30
 
19
31
  const GROUND_SIZE = 60;
20
32
 
@@ -55,7 +67,24 @@ export function makeWorld3D(canvas) {
55
67
  debugLines.frustumCulled = false;
56
68
  scene.add(debugLines);
57
69
 
58
- return { scene, camera, renderer, composer, nodes: new Map(), debugLines, ground, grid };
70
+ // `models` shares one build of each model among the actors placing it, and
71
+ // `instances` draws the actors placing a static model together when
72
+ // `instanceModels` is on. It is off by default: in a measured game it saved
73
+ // a few draw calls and drew 40-60k more triangles. A deck with many copies
74
+ // of one static model can set `scene.three.instanceModels = true` early.
75
+ return {
76
+ scene,
77
+ camera,
78
+ renderer,
79
+ composer,
80
+ nodes: new Map(),
81
+ models: new Map(),
82
+ instances: new Map(),
83
+ instanceModels: false,
84
+ debugLines,
85
+ ground,
86
+ grid,
87
+ };
59
88
  }
60
89
 
61
90
  export function updatePhysicsDebug(world, buffers) {
@@ -85,7 +114,6 @@ function addLights(scene) {
85
114
  sun.shadow.camera.bottom = -35;
86
115
  sun.shadow.camera.left = -75;
87
116
  sun.shadow.camera.right = 75;
88
- sun.shadow.normalBias = -0.14;
89
117
  scene.add(sun);
90
118
  }
91
119
 
@@ -128,24 +156,27 @@ export function syncGround(world, setting, sprites) {
128
156
  }
129
157
 
130
158
  // The signature suffix for an actor's Model component: the model file's text
131
- // plus the readiness/identity of any art it references.
159
+ // plus the readiness/identity of any art it references, and the same for every
160
+ // model it references.
132
161
  function actorModelSig(actor, sprites, files) {
133
162
  const file = actor.components.Model?.file;
134
163
  if (!file) return '';
135
164
  const text = files?.[file];
136
165
  if (typeof text !== 'string') return 'missing';
137
- return `${text.length}:${modelArtSignature(parseModelCached(text), sprites)}:${text}`;
166
+ const model = parseModelCached(text);
167
+ const refs = modelRefSignature(model, sprites, files, file);
168
+ return `${text.length}:${modelArtSignature(model, sprites)}:${text}:${refs}`;
138
169
  }
139
170
 
140
171
  // Build / refresh the node for one actor. Rebuilds only when what it looks
141
172
  // like (Shape / Model / their art) changes. A Model replaces the Shape's own
142
173
  // mesh with the .pxmodel rig; the Shape still sizes the physics collider.
143
174
  function ensureActorNode(world, actor, sprites, files) {
144
- const sig = nodeSignature(actor, sprites, actorModelSig(actor, sprites, files));
175
+ const modelSig = actorModelSig(actor, sprites, files);
176
+ const sig = nodeSignature(actor, sprites, modelSig);
145
177
  let entry = world.nodes.get(actor.id);
146
178
  if (entry && entry.sig !== sig) {
147
- world.scene.remove(entry.node);
148
- disposeNode(entry.node);
179
+ releaseActorNode(world, entry);
149
180
  entry = null;
150
181
  }
151
182
  if (!entry) {
@@ -154,23 +185,64 @@ function ensureActorNode(world, actor, sprites, files) {
154
185
  const modelComponent = actor.components.Model;
155
186
  const shape = actor.components.Shape;
156
187
  const model = modelComponent?.file ? parseModelCached(files?.[modelComponent.file]) : null;
188
+ entry = { node, sig };
157
189
  if (model) {
158
- const rig = buildModelNode(model, sprites);
159
- rig.position.y = modelComponent.yOffset ?? 0;
160
- const scale = modelComponent.scale ?? 1;
161
- rig.scale.set(scale, scale, scale);
162
- node.userData.modelParts = rig.userData.modelParts;
163
- node.add(rig);
190
+ addModelRig(world, entry, model, modelComponent, `${modelComponent.file}|${modelSig}`, {
191
+ sprites,
192
+ files,
193
+ });
164
194
  } else if (shape) {
165
195
  node.add(makeShapeMesh(shape, sprites));
166
196
  }
167
197
  world.scene.add(node);
168
- entry = { node, sig };
169
198
  world.nodes.set(actor.id, entry);
170
199
  }
171
200
  return entry;
172
201
  }
173
202
 
203
+ // The actor's model, from the shared build of it: a copy of its own, or,
204
+ // for a static model in the player, a place among that model's instances.
205
+ function addModelRig(world, entry, model, modelComponent, key, { sprites, files }) {
206
+ const file = modelComponent.file;
207
+ entry.modelKey = key;
208
+ const template = takeModel(world.models, key, () =>
209
+ buildModelNode(model, sprites, files, file, [file], { optimize: true })
210
+ );
211
+ const instanced = world.instanceModels && isStaticModel(template);
212
+ const rig = instanced ? new THREE.Group() : copyModel(template);
213
+ rig.position.y = modelComponent.yOffset ?? 0;
214
+ const scale = modelComponent.scale ?? 1;
215
+ rig.scale.set(scale, scale, scale);
216
+ entry.node.userData.modelParts = rig.userData.modelParts;
217
+ entry.node.add(rig);
218
+ if (instanced) {
219
+ if (!world.instances.has(key)) {
220
+ world.instances.set(key, makeInstances(template, world.scene));
221
+ }
222
+ world.instances.get(key).rigs.add(rig);
223
+ entry.instancedRig = rig;
224
+ }
225
+ }
226
+
227
+ // Removes an actor's node. A shared model build is given back rather than
228
+ // disposed, since other actors may still draw it.
229
+ function releaseActorNode(world, entry) {
230
+ world.scene.remove(entry.node);
231
+ if (!entry.modelKey) {
232
+ disposeNode(entry.node);
233
+ return;
234
+ }
235
+ const instances = world.instances.get(entry.modelKey);
236
+ if (instances && entry.instancedRig) {
237
+ instances.rigs.delete(entry.instancedRig);
238
+ if (instances.rigs.size === 0) {
239
+ removeInstances(instances);
240
+ world.instances.delete(entry.modelKey);
241
+ }
242
+ }
243
+ releaseModel(world.models, entry.modelKey, disposeNode);
244
+ }
245
+
174
246
  const DEG = Math.PI / 180;
175
247
 
176
248
  // Copy actor Transforms into three nodes, creating and removing nodes as
@@ -191,13 +263,19 @@ export function syncActors(world, runtime, sprites, dt = 0) {
191
263
  if (quat) node.quaternion.set(quat.x, quat.y, quat.z, quat.w);
192
264
  else node.rotation.set(t.rotationX * DEG, t.rotationY * DEG, t.rotationZ * DEG);
193
265
  animateModelParts(entry, dt);
266
+ animateMotion(entry, dt, actor);
194
267
  }
195
268
  for (const [id, entry] of world.nodes) {
196
269
  if (seen.has(id)) continue;
197
- world.scene.remove(entry.node);
198
- disposeNode(entry.node);
270
+ releaseActorNode(world, entry);
199
271
  world.nodes.delete(id);
200
272
  }
273
+ if (world.instances.size > 0) {
274
+ aimInstances(world.camera);
275
+ }
276
+ for (const instances of world.instances.values()) {
277
+ drawInstances(instances, world.camera);
278
+ }
201
279
  }
202
280
 
203
281
  export function resizeWorld(world, width, height) {
@@ -208,11 +286,35 @@ export function resizeWorld(world, width, height) {
208
286
  }
209
287
 
210
288
  export function renderWorld(world) {
289
+ fitShadowBias(world);
211
290
  world.composer.render();
212
291
  }
213
292
 
293
+ // The sun's normal bias as a share of one shadow-map texel. Decks shrink the
294
+ // shadow box to follow the player; a fixed bias tuned for the wide default
295
+ // box then hides shadows on anything thinner than the bias (floor patches,
296
+ // plinths). The bias follows the box each frame unless a deck has set its
297
+ // own value, which is left alone.
298
+ const NORMAL_BIAS_TEXELS = 0.6;
299
+
300
+ function fitShadowBias(world) {
301
+ world.sun ??= world.scene.children.find((child) => child.isDirectionalLight && child.castShadow) ?? null;
302
+ const sun = world.sun;
303
+ if (!sun) {
304
+ return;
305
+ }
306
+ const shadow = sun.shadow;
307
+ if (shadow.userData?.fittedBias !== undefined && shadow.normalBias !== shadow.userData.fittedBias) {
308
+ return;
309
+ }
310
+ const texel = (shadow.camera.right - shadow.camera.left) / shadow.mapSize.width;
311
+ shadow.normalBias = texel * NORMAL_BIAS_TEXELS;
312
+ shadow.bias = -0.0004;
313
+ shadow.userData = { ...shadow.userData, fittedBias: shadow.normalBias };
314
+ }
315
+
214
316
  export function disposeWorld(world) {
215
- for (const entry of world.nodes.values()) disposeNode(entry.node);
317
+ for (const entry of world.nodes.values()) releaseActorNode(world, entry);
216
318
  world.nodes.clear();
217
319
  world.renderer.dispose();
218
320
  }
@@ -6,6 +6,19 @@ export default [
6
6
  ignores: ['node_modules/**', 'dist/**', '.castle/**', 'imports/**', '*.config.js'],
7
7
  },
8
8
  js.configs.recommended,
9
+ {
10
+ // Kit tooling. `npm run render` runs under Node and the sheet page it
11
+ // serves runs in the browser, so there is no one globals list.
12
+ files: ['scripts/**/*.{js,mjs}'],
13
+ languageOptions: {
14
+ ecmaVersion: 'latest',
15
+ sourceType: 'module',
16
+ },
17
+ rules: {
18
+ 'no-undef': 'off',
19
+ 'no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
20
+ },
21
+ },
9
22
  {
10
23
  files: [
11
24
  'engine3d/**/*.{js,jsx}',
@@ -0,0 +1,40 @@
1
+ {
2
+ "format": "pxmodel",
3
+ "name": "Axe",
4
+ "triangles": 850,
5
+ "parts": [
6
+ {
7
+ "id": "haft", "kind": "cylinder", "radius": 0.018, "radiusTop": 0.016, "height": 0.8, "offset": [0, 0.2, 0], "segments": 8,
8
+ "material": "wood", "materialColor": "#7a5433"
9
+ },
10
+ {
11
+ "id": "wrap", "kind": "sweep", "position": [0, -0.11, 0], "smooth": true, "profile": [[0.006, 0.0], [0.003, 0.0052], [-0.003, 0.0052], [-0.006, 0.0], [-0.003, -0.0052], [0.003, -0.0052]],
12
+ "helix": { "radius": 0.019, "turns": 4, "height": 0.18 }, "color": "#3e2a1b", "roughness": 0.8
13
+ },
14
+ {
15
+ "id": "pommel", "kind": "lathe", "position": [0, -0.215, 0], "segments": 8,
16
+ "profile": [[0, -0.02], [0.022, -0.016], [0.026, 0], [0.02, 0.02], [0, 0.02]],
17
+ "color": "#4a4540", "metalness": 0.7, "roughness": 0.45
18
+ },
19
+ {
20
+ "id": "collar", "kind": "cylinder", "position": [0, 0.52, 0], "radius": 0.026, "height": 0.1, "segments": 8,
21
+ "color": "#4a4540", "metalness": 0.7, "roughness": 0.45
22
+ },
23
+ {
24
+ "id": "blade", "kind": "extrude", "position": [0, 0.53, 0.018], "rotation": [0, -90, 0],
25
+ "outline": [[0, 0.045], [0.07, 0.055], [0.13, 0.1], [0.165, 0.1], [0.175, 0.03], [0.17, -0.05], [0.15, -0.12], [0.1, -0.13], [0.06, -0.07], [0, -0.045]],
26
+ "depth": 0.016, "bevel": 0.004,
27
+ "color": "#c3c9cf", "metalness": 0.5, "roughness": 0.3
28
+ },
29
+ {
30
+ "id": "cheek", "kind": "extrude", "position": [0, 0.53, 0.018], "rotation": [0, -90, 0],
31
+ "outline": [[0, 0.045], [0.07, 0.052], [0.105, 0.03], [0.11, -0.04], [0.07, -0.07], [0, -0.045]],
32
+ "depth": 0.024, "bevel": 0.004, "color": "#5d636a", "metalness": 0.7, "roughness": 0.45
33
+ },
34
+ {
35
+ "id": "spike", "kind": "extrude", "position": [0, 0.53, -0.018], "rotation": [0, -90, 0],
36
+ "outline": [[0, 0.03], [-0.05, 0.015], [-0.085, 0], [-0.05, -0.015], [0, -0.03]],
37
+ "depth": 0.02, "bevel": 0.005, "color": "#6f757c", "metalness": 0.8, "roughness": 0.4
38
+ }
39
+ ]
40
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "format": "pxmodel",
3
+ "name": "Backpack",
4
+ "triangles": 900,
5
+ "parts": [
6
+ {
7
+ "id": "body", "size": [0.3, 0.36, 0.16], "round": 0.05, "position": [0, 0, -0.09], "taper": 0.9,
8
+ "material": "cloth", "materialColor": "#8a7a55"
9
+ },
10
+ {
11
+ "id": "lid", "size": [0.31, 0.06, 0.175], "round": 0.028, "position": [0, 0.18, -0.09],
12
+ "material": "leather", "materialColor": "#6b4428"
13
+ },
14
+ {
15
+ "id": "lidFlap", "size": [0.22, 0.12, 0.03], "round": 0.014, "position": [0, 0.12, -0.172], "rotation": [-8, 0, 0],
16
+ "material": "leather", "materialColor": "#6b4428"
17
+ },
18
+ {
19
+ "id": "pocket", "size": [0.22, 0.15, 0.06], "round": 0.025, "position": [0, -0.07, -0.18],
20
+ "material": "cloth", "materialColor": "#7b6c4a"
21
+ },
22
+ {
23
+ "id": "sidePocket", "size": [0.05, 0.14, 0.1], "round": 0.02, "position": [0.165, -0.08, -0.09], "mirror": "x",
24
+ "material": "cloth", "materialColor": "#7b6c4a"
25
+ },
26
+ {
27
+ "id": "strap", "size": [0.03, 0.2, 0.012], "position": [0.07, 0.03, -0.21], "rotation": [6, 0, 0], "mirror": "x",
28
+ "color": "#4a3020", "roughness": 0.8
29
+ },
30
+ { "id": "buckle", "size": [0.036, 0.03, 0.01], "position": [0.07, -0.04, -0.218], "mirror": "x", "color": "#c7a25a", "metalness": 0.7, "roughness": 0.4 },
31
+ {
32
+ "id": "shoulderStrap", "kind": "sweep", "mirror": "x", "up": [1, 0, 0],
33
+ "path": [[0.08, 0.16, -0.02], [0.09, 0.22, 0.04], [0.09, 0.2, 0.12]],
34
+ "profile": [[-0.004, -0.022], [0.004, -0.022], [0.004, 0.022], [-0.004, 0.022]],
35
+ "color": "#4a3020", "roughness": 0.8
36
+ },
37
+ {
38
+ "id": "rope", "kind": "torus", "radius": 0.065, "tube": 0.014, "position": [-0.2, -0.02, -0.09], "rotation": [0, 90, 0], "segments": 16,
39
+ "color": "#b89a64", "roughness": 0.9
40
+ },
41
+ {
42
+ "id": "cup", "kind": "lathe", "position": [0.205, 0.07, -0.09], "rotation": [0, 0, -10], "segments": 10,
43
+ "profile": [[0, 0], [0.032, 0], [0.036, 0.06], [0.03, 0.06], [0.027, 0.006], [0, 0.006]],
44
+ "color": "#8e8a84", "metalness": 0.6, "roughness": 0.4
45
+ }
46
+ ]
47
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "format": "pxmodel",
3
+ "name": "Barrel",
4
+ "parts": [
5
+ {
6
+ "id": "body", "kind": "lathe", "segments": 18, "flat": true,
7
+ "profile": [[0, 0.01], [0.25, 0.01], [0.262, 0.02], [0.29, 0.14], [0.305, 0.3], [0.31, 0.45], [0.305, 0.6], [0.29, 0.76], [0.262, 0.88], [0.25, 0.89], [0, 0.89]],
8
+ "color": "#8e5f36", "roughness": 0.85,
9
+ "paint": [
10
+ { "pattern": "cavity", "amount": 0.5 },
11
+ { "pattern": "grime", "color": "#7a5230", "amount": 0.2, "scale": 10 },
12
+ { "pattern": "grime", "color": "#5a4230", "amount": 0.4, "scale": 8, "below": 0.1 }
13
+ ]
14
+ },
15
+ { "id": "hoopLow", "kind": "torus", "radius": 0.281, "tube": 0.014, "scale": [1, 1, 1.8], "rotation": [90, 0, 0], "position": [0, 0.1, 0], "color": "#3e3a36", "metalness": 0.75, "roughness": 0.5 },
16
+ { "id": "hoopMidLow", "kind": "torus", "radius": 0.302, "tube": 0.012, "scale": [1, 1, 1.8], "rotation": [90, 0, 0], "position": [0, 0.29, 0], "color": "#3e3a36", "metalness": 0.75, "roughness": 0.5 },
17
+ { "id": "hoopMidHigh", "kind": "torus", "radius": 0.302, "tube": 0.012, "scale": [1, 1, 1.8], "rotation": [90, 0, 0], "position": [0, 0.61, 0], "color": "#3e3a36", "metalness": 0.75, "roughness": 0.5 },
18
+ { "id": "hoopHigh", "kind": "torus", "radius": 0.281, "tube": 0.014, "scale": [1, 1, 1.8], "rotation": [90, 0, 0], "position": [0, 0.8, 0], "color": "#3e3a36", "metalness": 0.75, "roughness": 0.5 },
19
+ { "id": "head", "kind": "cylinder", "radius": 0.235, "height": 0.02, "position": [0, 0.88, 0], "color": "#7a5130", "roughness": 0.85 },
20
+ { "id": "bung", "kind": "cylinder", "radius": 0.03, "height": 0.02, "position": [0.12, 0.895, 0.04], "color": "#5b3b20", "roughness": 0.8 }
21
+ ]
22
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "format": "pxmodel",
3
+ "name": "Bedroll",
4
+ "triangles": 700,
5
+ "parts": [
6
+ {
7
+ "id": "roll", "kind": "cylinder", "radius": 0.075, "height": 0.46, "rotation": [0, 0, 90], "segments": 14,
8
+ "color": "#7d2f24", "roughness": 0.95
9
+ },
10
+ {
11
+ "id": "stripe", "kind": "cylinder", "radius": 0.079, "height": 0.024, "position": [0.19, 0, 0], "rotation": [0, 0, 90], "segments": 14, "mirror": "x",
12
+ "color": "#d8c7a0", "roughness": 0.95
13
+ },
14
+ {
15
+ "id": "edge", "kind": "torus", "radius": 0.066, "tube": 0.012, "position": [0.23, 0, 0], "rotation": [0, 90, 0], "segments": 14, "mirror": "x",
16
+ "color": "#8c382b", "roughness": 0.95
17
+ },
18
+ {
19
+ "id": "core", "kind": "cylinder", "radius": 0.03, "height": 0.468, "rotation": [0, 0, 90], "segments": 8,
20
+ "color": "#4e2019", "roughness": 0.95
21
+ },
22
+ {
23
+ "id": "strap", "kind": "torus", "radius": 0.079, "tube": 0.008, "position": [0.13, 0, 0], "rotation": [0, 90, 0], "scale": [1, 1, 2.2], "segments": 14, "mirror": "x",
24
+ "color": "#3e2a1b", "roughness": 0.8
25
+ },
26
+ { "id": "buckle", "size": [0.03, 0.026, 0.01], "position": [0.13, 0, 0.088], "mirror": "x", "color": "#c7a25a", "metalness": 0.7, "roughness": 0.4 }
27
+ ]
28
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "format": "pxmodel",
3
+ "name": "Belt Pouch",
4
+ "triangles": 500,
5
+ "parts": [
6
+ { "id": "loop", "size": [0.05, 0.07, 0.012], "round": 0.004, "position": [0, -0.015, 0.006], "color": "#3e2a1b", "roughness": 0.8 },
7
+ {
8
+ "id": "body", "size": [0.14, 0.12, 0.07], "round": 0.028, "position": [0, -0.08, 0.045], "taper": 1.15,
9
+ "material": "leather", "materialColor": "#7a4e2c"
10
+ },
11
+ {
12
+ "id": "flap", "kind": "extrude", "position": [0, -0.022, 0.083], "rotation": [-4, 0, 0],
13
+ "outline": [[-0.064, 0], [0.064, 0], [0.064, -0.035], [0.034, -0.06], [0, -0.066], [-0.034, -0.06], [-0.064, -0.035]],
14
+ "depth": 0.01, "bevel": 0.003, "material": "leather", "materialColor": "#5e3a20"
15
+ },
16
+ { "id": "lid", "size": [0.13, 0.014, 0.074], "round": 0.005, "position": [0, -0.022, 0.046], "material": "leather", "materialColor": "#5e3a20" },
17
+ {
18
+ "id": "toggle", "kind": "capsule", "radius": 0.008, "height": 0.035, "position": [0, -0.08, 0.092], "rotation": [0, 0, 90], "segments": 6,
19
+ "color": "#c7a25a", "metalness": 0.7, "roughness": 0.4
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "format": "pxmodel",
3
+ "name": "Bolt",
4
+ "parts": [
5
+ { "id": "washer", "kind": "cylinder", "radius": 0.022, "height": 0.003, "position": [0, 0.0015, 0], "color": "#9a9da3", "metalness": 0.5, "roughness": 0.4 },
6
+ { "id": "head", "kind": "cylinder", "radius": 0.017, "height": 0.012, "segments": 6, "position": [0, 0.009, 0], "color": "#c4c7cc", "metalness": 0.55, "roughness": 0.35 },
7
+ { "id": "chamfer", "parent": "head", "kind": "cylinder", "radius": 0.016, "radiusTop": 0.012, "height": 0.003, "position": [0, 0.0075, 0], "color": "#c4c7cc", "metalness": 0.55, "roughness": 0.35 },
8
+ { "id": "shaft", "kind": "cylinder", "radius": 0.008, "height": 0.04, "position": [0, -0.02, 0], "color": "#7d8086", "metalness": 0.9, "roughness": 0.4 }
9
+ ]
10
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "format": "pxmodel",
3
+ "name": "Bracer",
4
+ "triangles": 500,
5
+ "parts": [
6
+ {
7
+ "id": "cuff", "kind": "lathe", "segments": 12,
8
+ "profile": [[0.058, -0.085], [0.066, -0.08], [0.069, 0], [0.076, 0.075], [0.068, 0.085]],
9
+ "material": "leather", "materialColor": "#6b4428"
10
+ },
11
+ {
12
+ "id": "band", "kind": "torus", "radius": 0.068, "tube": 0.009, "position": [0, -0.068, 0], "rotation": [90, 0, 0], "segments": 14,
13
+ "color": "#8e8a84", "metalness": 0.6, "roughness": 0.4,
14
+ "repeat": { "count": 2, "offset": [0, 0.13, 0] }
15
+ },
16
+ {
17
+ "id": "plate", "kind": "box", "size": [0.05, 0.12, 0.012], "round": 0.005, "position": [0, 0, 0.074], "rotation": [-2, 0, 0],
18
+ "color": "#8e8a84", "metalness": 0.6, "roughness": 0.4
19
+ },
20
+ {
21
+ "id": "stud", "kind": "sphere", "radius": 0.009, "segments": 6, "position": [0, 0.04, 0.082],
22
+ "color": "#b7b1a8", "metalness": 0.7, "roughness": 0.35,
23
+ "repeat": { "count": 3, "offset": [0, -0.04, 0] }
24
+ }
25
+ ]
26
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "format": "pxmodel",
3
+ "name": "Chain Span",
4
+ "parts": [
5
+ {
6
+ "id": "link", "kind": "torus", "radius": 0.028, "tube": 0.008, "scale": [1, 1.7, 1], "segments": 12,
7
+ "color": "#8a8580", "metalness": 0.85, "roughness": 0.4,
8
+ "repeat": { "along": [[-0.5, 0, 0], [-0.25, -0.15, 0], [0, -0.2, 0], [0.25, -0.15, 0], [0.5, 0, 0]], "count": 16, "align": true, "alternate": [0, 90, 0] }
9
+ },
10
+ { "id": "endRing", "kind": "torus", "radius": 0.035, "tube": 0.01, "position": [0.5, 0.03, 0], "color": "#77726c", "metalness": 0.85, "roughness": 0.4, "mirror": "x" }
11
+ ]
12
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "format": "pxmodel",
3
+ "name": "Chimney",
4
+ "triangles": 700,
5
+ "parts": [
6
+ { "id": "stack", "size": [0.55, 1.3, 0.55], "round": 0.02, "roundSegments": 1, "position": [0, 0.55, 0], "color": "#8a5a44", "roughness": 0.95, "paint": [{ "pattern": "cavity", "amount": 0.5 }, { "pattern": "grime", "color": "#2d2724", "amount": 0.5, "scale": 5, "above": 0.4 }] },
7
+ { "id": "cap", "size": [0.68, 0.08, 0.68], "round": 0.015, "roundSegments": 1, "position": [0, 1.24, 0], "color": "#77746e", "roughness": 0.95, "paint": [{ "pattern": "grime", "color": "#2d2724", "amount": 0.4, "scale": 6 }] },
8
+ { "id": "pot", "kind": "cylinder", "radius": 0.09, "radiusTop": 0.075, "height": 0.2, "segments": 10, "position": [0.1, 1.38, 0.08], "color": "#a45f3c", "roughness": 0.9, "paint": [{ "pattern": "grime", "color": "#2a2422", "amount": 0.6, "scale": 10, "above": 0.05 }] },
9
+ { "id": "pot2", "kind": "cylinder", "radius": 0.075, "radiusTop": 0.065, "height": 0.15, "segments": 10, "position": [-0.12, 1.355, -0.08], "color": "#9c5a39", "roughness": 0.9 }
10
+ ]
11
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "format": "pxmodel",
3
+ "name": "Crate",
4
+ "parts": [
5
+ {
6
+ "id": "body", "size": [0.74, 0.74, 0.74], "position": [0, 0.4, 0],
7
+ "color": "#a3784a", "roughness": 0.85,
8
+ "paint": [
9
+ { "pattern": "stripes", "colors": ["#a77c4c", "#97703f"], "width": 0.123, "angle": 0 },
10
+ { "pattern": "cavity", "amount": 0.4 },
11
+ { "pattern": "grime", "color": "#7d5a36", "amount": 0.2, "scale": 9 }
12
+ ]
13
+ },
14
+ {
15
+ "id": "post", "parent": "body", "size": [0.08, 0.8, 0.08], "round": 0.008, "position": [0.36, 0, 0.36],
16
+ "color": "#7f5a33", "roughness": 0.85,
17
+ "repeat": { "count": 4, "rotate": [0, 90, 0] },
18
+ "paint": [{ "pattern": "edges", "color": "#b48d5e", "amount": 0.6, "width": 0.01 }]
19
+ },
20
+ {
21
+ "id": "railTop", "parent": "body", "size": [0.64, 0.08, 0.05], "round": 0.006, "position": [0, 0.36, 0.37],
22
+ "color": "#7f5a33", "roughness": 0.85,
23
+ "repeat": { "count": 4, "rotate": [0, 90, 0] },
24
+ "paint": [{ "pattern": "edges", "color": "#b48d5e", "amount": 0.6, "width": 0.01 }]
25
+ },
26
+ {
27
+ "id": "railBottom", "parent": "body", "size": [0.64, 0.08, 0.05], "round": 0.006, "position": [0, -0.36, 0.37],
28
+ "color": "#7f5a33", "roughness": 0.85,
29
+ "repeat": { "count": 4, "rotate": [0, 90, 0] },
30
+ "paint": [{ "pattern": "edges", "color": "#b48d5e", "amount": 0.6, "width": 0.01 }]
31
+ },
32
+ {
33
+ "id": "brace", "parent": "body", "size": [0.07, 0.86, 0.03], "round": 0.006, "rotation": [0, 0, 45], "position": [0, 0, 0.378],
34
+ "color": "#86603a", "roughness": 0.85,
35
+ "repeat": { "count": 4, "rotate": [0, 90, 0] }
36
+ },
37
+ {
38
+ "id": "lidPlank", "parent": "body", "size": [0.235, 0.025, 0.66], "round": 0.004, "position": [-0.24, 0.38, 0],
39
+ "color": "#a07548", "roughness": 0.85,
40
+ "repeat": { "count": 3, "offset": [0.24, 0, 0], "jitter": { "color": 0.04, "seed": 2 } },
41
+ "paint": [{ "pattern": "edges", "color": "#b48d5e", "amount": 0.5, "width": 0.008 }]
42
+ }
43
+ ]
44
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "format": "pxmodel",
3
+ "name": "Crystal",
4
+ "triangles": 500,
5
+ "parts": [
6
+ {
7
+ "id": "base", "kind": "sphere", "radius": 0.13, "scale": [1.3, 0.45, 1.1], "noise": 0.3, "seed": 4, "segments": 10,
8
+ "color": "#77736e", "roughness": 0.9
9
+ },
10
+ {
11
+ "id": "main", "kind": "lathe", "segments": 6, "flat": true, "rotation": [4, 0, -6],
12
+ "profile": [[0, 0], [0.055, 0.03], [0.058, 0.26], [0, 0.36]],
13
+ "color": "#8fdcff", "emissive": "#3fb6ff", "emissiveIntensity": 0.7, "roughness": 0.15, "clearcoat": 1
14
+ },
15
+ {
16
+ "id": "side", "kind": "lathe", "segments": 6, "flat": true, "position": [0.06, 0, 0], "rotation": [0, 0, -34], "scale": 0.6,
17
+ "profile": [[0, 0], [0.055, 0.03], [0.058, 0.26], [0, 0.36]],
18
+ "color": "#8fdcff", "emissive": "#3fb6ff", "emissiveIntensity": 0.7, "roughness": 0.15, "clearcoat": 1,
19
+ "repeat": { "count": 5, "rotate": [0, 72, 0], "jitter": { "rotate": [8, 20, 8], "scale": 0.3, "seed": 2 } }
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "format": "pxmodel",
3
+ "name": "Arched Door",
4
+ "triangles": 700,
5
+ "parts": [
6
+ { "id": "frame", "kind": "extrude", "outline": [[-0.62, 0], [0.62, 0], [0.62, 1.45], [0.59, 1.642], [0.502, 1.814], [0.364, 1.952], [0.192, 2.04], [0.0, 2.07], [-0.192, 2.04], [-0.364, 1.952], [-0.502, 1.814], [-0.59, 1.642], [-0.62, 1.45]], "holes": [[[-0.45, 0], [0.45, 0], [0.45, 1.45], [0.428, 1.589], [0.364, 1.715], [0.265, 1.814], [0.139, 1.878], [0.0, 1.9], [-0.139, 1.878], [-0.265, 1.814], [-0.364, 1.715], [-0.428, 1.589], [-0.45, 1.45]]], "depth": 0.16, "bevel": 0.02, "position": [0, 0, 0.06], "color": "#8d8a82", "roughness": 0.95, "paint": [{ "pattern": "cracks", "color": "#6b6862", "amount": 0.25, "scale": 5, "seed": 3 }, { "pattern": "cavity", "amount": 0.5 }] },
7
+ { "id": "leaf", "kind": "extrude", "outline": [[-0.45, 0], [0.45, 0], [0.45, 1.45], [0.428, 1.589], [0.364, 1.715], [0.265, 1.814], [0.139, 1.878], [0.0, 1.9], [-0.139, 1.878], [-0.265, 1.814], [-0.364, 1.715], [-0.428, 1.589], [-0.45, 1.45]], "depth": 0.06, "position": [0, 0, 0.03], "color": "#7a5130", "roughness": 0.85, "paint": [{ "pattern": "stripes", "colors": ["#7e5433", "#6c4629"], "width": 0.15, "angle": 90, "axis": "z" }, { "pattern": "grime", "color": "#5a3c22", "amount": 0.3, "scale": 6, "below": 0.4 }] },
8
+ { "id": "strap", "size": [0.86, 0.07, 0.015], "position": [0, 0.35, 0.065], "color": "#2f2c2a", "metalness": 0.7, "roughness": 0.5, "repeat": { "count": 2, "offset": [0, 0.95, 0] } },
9
+ { "id": "ring", "kind": "torus", "radius": 0.05, "tube": 0.009, "position": [0.3, 0.9, 0.085], "color": "#2f2c2a", "metalness": 0.75, "roughness": 0.45 },
10
+ { "id": "step", "size": [1.3, 0.1, 0.34], "round": 0.02, "roundSegments": 1, "position": [0, -0.05, 0.2], "color": "#7f7c75", "roughness": 0.95, "paint": [{ "pattern": "cavity", "amount": 0.5 }] }
11
+ ]
12
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "format": "pxmodel",
3
+ "name": "Engine Block",
4
+ "triangles": 900,
5
+ "parts": [
6
+ {
7
+ "id": "case", "size": [0.2, 0.17, 0.3], "round": 0.05, "position": [0, 0.085, 0],
8
+ "color": "#74777c", "metalness": 0.3, "roughness": 0.55,
9
+ "paint": [{ "pattern": "grime", "color": "#2b2622", "amount": 0.3, "scale": 6 }]
10
+ },
11
+ {
12
+ "id": "cover", "kind": "cylinder", "radius": 0.085, "height": 0.03, "position": [0.108, 0.085, -0.03], "rotation": [0, 0, 90], "segments": 16, "mirror": "x",
13
+ "color": "#b8bcc2", "metalness": 0.6, "roughness": 0.3
14
+ },
15
+ {
16
+ "id": "cylinder", "kind": "cylinder", "radius": 0.06, "height": 0.2, "position": [0, 0.17, 0.05], "rotation": [22, 0, 0], "offset": [0, 0.1, 0], "segments": 12,
17
+ "color": "#55585d", "metalness": 0.3, "roughness": 0.5
18
+ },
19
+ {
20
+ "id": "fin", "parent": "cylinder", "size": [0.17, 0.012, 0.15], "round": 0.005, "position": [0, 0.035, 0],
21
+ "color": "#9a9ea4", "metalness": 0.55, "roughness": 0.4,
22
+ "repeat": { "count": 6, "offset": [0, 0.026, 0] }
23
+ },
24
+ {
25
+ "id": "head", "parent": "cylinder", "size": [0.15, 0.05, 0.13], "round": 0.015, "position": [0, 0.215, 0],
26
+ "color": "#b8bcc2", "metalness": 0.6, "roughness": 0.3
27
+ },
28
+ { "id": "plug", "parent": "head", "kind": "cylinder", "radius": 0.01, "height": 0.05, "position": [0, 0.045, 0.02], "segments": 6, "color": "#e8e4dc", "roughness": 0.4 },
29
+ { "id": "plugCap", "parent": "plug", "kind": "cylinder", "radius": 0.012, "height": 0.02, "position": [0, 0.03, 0], "segments": 6, "color": "#1c1c1e", "roughness": 0.6 },
30
+ {
31
+ "id": "carb", "parent": "cylinder", "kind": "cylinder", "radius": 0.025, "height": 0.09, "position": [0, 0.1, -0.1], "rotation": [90, 0, 0], "segments": 8,
32
+ "color": "#8e8a84", "metalness": 0.6, "roughness": 0.4
33
+ },
34
+ {
35
+ "id": "filter", "parent": "carb", "kind": "cylinder", "radius": 0.045, "height": 0.06, "position": [0, -0.07, 0], "segments": 12,
36
+ "color": "#c23a2a", "roughness": 0.6
37
+ }
38
+ ]
39
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "format": "pxmodel",
3
+ "name": "Exhaust Pipe",
4
+ "triangles": 800,
5
+ "parts": [
6
+ { "id": "flange", "kind": "cylinder", "radius": 0.034, "height": 0.014, "rotation": [90, 0, 0], "segments": 10, "color": "#5a5550", "metalness": 0.6, "roughness": 0.45 },
7
+ {
8
+ "id": "header", "kind": "sweep", "smooth": true,
9
+ "path": [[0, 0, 0], [0, -0.02, 0.06], [0.02, -0.14, 0.08], [0.05, -0.2, -0.04], [0.07, -0.13, -0.3], [0.09, -0.02, -0.46]],
10
+ "profile": [[0.022, 0.0], [0.0156, 0.0156], [0.0, 0.022], [-0.0156, 0.0156], [-0.022, 0.0], [-0.0156, -0.0156], [0.0, -0.022], [0.0156, -0.0156]],
11
+ "material": "chrome",
12
+ "paint": [{ "pattern": "grime", "color": "#9a6a3a", "amount": 0.25, "scale": 7 }]
13
+ },
14
+ {
15
+ "id": "muffler", "kind": "lathe", "position": [0.095, 0.035, -0.62], "rotation": [-75, 0, 0], "segments": 14,
16
+ "profile": [[0.024, -0.2], [0.05, -0.15], [0.056, -0.12], [0.056, 0.12], [0.05, 0.15], [0.03, 0.17], [0.03, 0.2], [0, 0.2]],
17
+ "color": "#b8bcc2", "metalness": 0.6, "roughness": 0.3
18
+ },
19
+ {
20
+ "id": "clamp", "kind": "torus", "parent": "muffler", "radius": 0.057, "tube": 0.007, "position": [0, -0.08, 0], "rotation": [90, 0, 0], "segments": 14,
21
+ "color": "#2a2a2c", "metalness": 0.5, "roughness": 0.5,
22
+ "repeat": { "count": 2, "offset": [0, 0.17, 0] }
23
+ },
24
+ { "id": "tip", "parent": "muffler", "kind": "cylinder", "radius": 0.018, "height": 0.03, "position": [0, 0.21, 0], "segments": 8, "color": "#1c1c1e", "roughness": 0.7 },
25
+ {
26
+ "id": "shield", "kind": "box", "size": [0.012, 0.07, 0.2], "round": 0.005, "position": [0.095, -0.16, -0.2], "rotation": [-15, 0, 0],
27
+ "color": "#3a3a3d", "metalness": 0.5, "roughness": 0.5
28
+ }
29
+ ]
30
+ }