@playdrop/playdrop-cli 0.16.12 → 0.17.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/config/client-meta.json +4 -4
- package/dist/apiClient.d.ts +1 -2
- package/dist/apiClient.js +1 -16
- package/dist/appUrls.js +4 -0
- package/dist/apps/build.d.ts +12 -4
- package/dist/apps/build.js +55 -22
- package/dist/apps/index.d.ts +2 -1
- package/dist/apps/index.js +4 -1
- package/dist/apps/loadCheck.d.ts +5 -1
- package/dist/apps/loadCheck.js +52 -18
- package/dist/apps/serverBuild.d.ts +17 -0
- package/dist/apps/serverBuild.js +155 -0
- package/dist/apps/staticHtml.d.ts +1 -0
- package/dist/apps/staticHtml.js +19 -10
- package/dist/apps/upload.d.ts +12 -2
- package/dist/apps/upload.js +127 -46
- package/dist/catalogue.d.ts +23 -1
- package/dist/catalogue.js +126 -100
- package/dist/commandContext.d.ts +6 -3
- package/dist/commandContext.js +108 -18
- package/dist/commands/build.js +0 -7
- package/dist/commands/captureListing.d.ts +3 -0
- package/dist/commands/captureListing.js +48 -4
- package/dist/commands/chat.d.ts +4 -7
- package/dist/commands/chat.js +165 -77
- package/dist/commands/check.js +34 -1
- package/dist/commands/create.js +30 -263
- package/dist/commands/dev.js +37 -3
- package/dist/commands/devBrowser.js +2 -2
- package/dist/commands/devGameServer.d.ts +16 -0
- package/dist/commands/devGameServer.js +237 -0
- package/dist/commands/devRuntimeAssets.d.ts +1 -0
- package/dist/commands/devRuntimeAssets.js +2 -0
- package/dist/commands/devServer.d.ts +3 -0
- package/dist/commands/devServer.js +111 -5
- package/dist/commands/generation.d.ts +33 -4
- package/dist/commands/generation.js +304 -115
- package/dist/commands/login.js +23 -7
- package/dist/commands/review.d.ts +1 -1
- package/dist/commands/review.js +68 -95
- package/dist/commands/source.d.ts +19 -0
- package/dist/commands/source.js +142 -0
- package/dist/commands/tweaks.js +5 -11
- package/dist/commands/upload-content.d.ts +1 -1
- package/dist/commands/upload-content.js +16 -12
- package/dist/commands/upload.d.ts +17 -1
- package/dist/commands/upload.js +47 -10
- package/dist/commands/worker/archive-staging.d.ts +1 -0
- package/dist/commands/worker/archive-staging.js +13 -2
- package/dist/commands/worker/e2e-fixtures.d.ts +32 -0
- package/dist/commands/worker/e2e-fixtures.js +466 -0
- package/dist/commands/worker/game-server-infra.d.ts +80 -0
- package/dist/commands/worker/game-server-infra.js +595 -0
- package/dist/commands/worker/game-source-git.d.ts +126 -0
- package/dist/commands/worker/game-source-git.js +780 -0
- package/dist/commands/worker/generation.d.ts +94 -0
- package/dist/commands/worker/generation.js +1458 -0
- package/dist/commands/worker/provider-telemetry.js +1 -1
- package/dist/commands/worker/runtime.d.ts +8 -10
- package/dist/commands/worker/runtime.js +53 -48
- package/dist/commands/worker.d.ts +79 -19
- package/dist/commands/worker.js +1796 -419
- package/dist/config.d.ts +2 -0
- package/dist/config.js +16 -3
- package/dist/environment.d.ts +0 -1
- package/dist/environment.js +0 -8
- package/dist/index.js +92 -22
- package/dist/workerAppProject.d.ts +1 -1
- package/dist/workerAppProject.js +15 -2
- package/node_modules/@playdrop/api-client/dist/client.d.ts +143 -39
- package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/client.js +33 -0
- package/node_modules/@playdrop/api-client/dist/core/request.d.ts +1 -0
- package/node_modules/@playdrop/api-client/dist/core/request.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/core/request.js +17 -11
- package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts +51 -6
- package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.js +338 -41
- package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts +24 -1
- package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/ai.js +20 -0
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts +13 -8
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/apps.js +158 -90
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts +4 -0
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/assets.js +27 -0
- package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts +152 -21
- package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/chat.js +477 -100
- package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts +2 -1
- package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/player-meta.js +9 -0
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts +1 -2
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.js +0 -11
- package/node_modules/@playdrop/api-client/dist/domains/social.d.ts +29 -0
- package/node_modules/@playdrop/api-client/dist/domains/social.d.ts.map +1 -0
- package/node_modules/@playdrop/api-client/dist/domains/social.js +79 -0
- package/node_modules/@playdrop/api-client/dist/index.d.ts +81 -30
- package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.js +217 -56
- package/node_modules/@playdrop/api-client/dist/runtime.d.ts +18 -0
- package/node_modules/@playdrop/api-client/dist/runtime.d.ts.map +1 -0
- package/node_modules/@playdrop/api-client/dist/runtime.js +54 -0
- package/node_modules/@playdrop/api-client/package.json +7 -0
- package/node_modules/@playdrop/config/client-meta.json +4 -4
- package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts +11 -0
- package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/creator-plans.js +13 -1
- package/node_modules/@playdrop/config/dist/src/deployment.d.ts +0 -1
- package/node_modules/@playdrop/config/dist/src/deployment.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/deployment.js +0 -8
- package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts +0 -1
- package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/public-deployment.js +0 -8
- package/node_modules/@playdrop/config/dist/src/runtime-service-origins.d.ts +1 -1
- package/node_modules/@playdrop/config/dist/src/runtime-service-origins.js +2 -2
- package/node_modules/@playdrop/config/dist/src/server/logging.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/server/logging.js +31 -2
- package/node_modules/@playdrop/config/dist/test/creator-plans.test.js +10 -0
- package/node_modules/@playdrop/config/dist/test/deployment.test.js +0 -4
- package/node_modules/@playdrop/config/dist/test/runtime-service-origins.test.js +2 -0
- package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@playdrop/config/package.json +6 -0
- package/node_modules/@playdrop/game-source-git/dist/src/archive.d.ts +9 -0
- package/node_modules/@playdrop/game-source-git/dist/src/archive.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/archive.js +107 -0
- package/node_modules/@playdrop/game-source-git/dist/src/bundle-storage.d.ts +29 -0
- package/node_modules/@playdrop/game-source-git/dist/src/bundle-storage.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/bundle-storage.js +64 -0
- package/node_modules/@playdrop/game-source-git/dist/src/export.d.ts +8 -0
- package/node_modules/@playdrop/game-source-git/dist/src/export.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/export.js +25 -0
- package/node_modules/@playdrop/game-source-git/dist/src/git.d.ts +39 -0
- package/node_modules/@playdrop/game-source-git/dist/src/git.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/git.js +195 -0
- package/node_modules/@playdrop/game-source-git/dist/src/ignore.d.ts +6 -0
- package/node_modules/@playdrop/game-source-git/dist/src/ignore.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/ignore.js +51 -0
- package/node_modules/@playdrop/game-source-git/dist/src/index.d.ts +10 -0
- package/node_modules/@playdrop/game-source-git/dist/src/index.d.ts.map +1 -0
- package/node_modules/@playdrop/{boxel-core/dist/src/humanoid/r15 → game-source-git/dist/src}/index.js +9 -4
- package/node_modules/@playdrop/game-source-git/dist/src/lock.d.ts +17 -0
- package/node_modules/@playdrop/game-source-git/dist/src/lock.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/lock.js +72 -0
- package/node_modules/@playdrop/game-source-git/dist/src/materialize.d.ts +10 -0
- package/node_modules/@playdrop/game-source-git/dist/src/materialize.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/materialize.js +99 -0
- package/node_modules/@playdrop/game-source-git/dist/src/paths.d.ts +24 -0
- package/node_modules/@playdrop/game-source-git/dist/src/paths.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/paths.js +207 -0
- package/node_modules/@playdrop/game-source-git/dist/src/repository.d.ts +66 -0
- package/node_modules/@playdrop/game-source-git/dist/src/repository.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/repository.js +213 -0
- package/node_modules/@playdrop/game-source-git/dist/test/core.test.d.ts +2 -0
- package/node_modules/@playdrop/game-source-git/dist/test/core.test.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/test/core.test.js +441 -0
- package/node_modules/@playdrop/game-source-git/dist/tsconfig.tsbuildinfo +1 -0
- package/node_modules/@playdrop/game-source-git/package.json +28 -0
- package/node_modules/@playdrop/types/dist/agent-task-terminal.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/agent-task-terminal.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/agent-task-terminal.js +15 -9
- package/node_modules/@playdrop/types/dist/api.d.ts +730 -166
- package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/api.js +65 -18
- package/node_modules/@playdrop/types/dist/asset-pack.d.ts +2 -0
- package/node_modules/@playdrop/types/dist/asset-pack.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/asset.d.ts +22 -8
- package/node_modules/@playdrop/types/dist/asset.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/asset.js +26 -26
- package/node_modules/@playdrop/types/dist/chat.d.ts +273 -31
- package/node_modules/@playdrop/types/dist/chat.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/chat.js +38 -4
- package/node_modules/@playdrop/types/dist/index.d.ts +3 -0
- package/node_modules/@playdrop/types/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/index.js +7 -1
- package/node_modules/@playdrop/types/dist/public-cache-tags.d.ts +11 -0
- package/node_modules/@playdrop/types/dist/public-cache-tags.d.ts.map +1 -0
- package/node_modules/@playdrop/types/dist/public-cache-tags.js +78 -0
- package/node_modules/@playdrop/types/dist/realtime.d.ts +3 -15
- package/node_modules/@playdrop/types/dist/realtime.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/social.d.ts +64 -0
- package/node_modules/@playdrop/types/dist/social.d.ts.map +1 -0
- package/node_modules/@playdrop/{boxel-three/dist/src/types.js → types/dist/social.js} +14 -2
- package/node_modules/@playdrop/types/dist/spritesheet.d.ts +51 -0
- package/node_modules/@playdrop/types/dist/spritesheet.d.ts.map +1 -0
- package/node_modules/@playdrop/types/dist/spritesheet.js +73 -0
- package/node_modules/@playdrop/types/dist/version.d.ts +86 -58
- package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/version.js +111 -0
- package/node_modules/@playdrop/types/package.json +14 -0
- package/node_modules/@playdrop/vox-three/dist/src/index.d.ts +1 -1
- package/node_modules/@playdrop/vox-three/dist/src/index.js +1 -1
- package/node_modules/@playdrop/vox-three/dist/src/index.js.map +1 -1
- package/node_modules/@playdrop/vox-three/dist/src/vox.d.ts +0 -3
- package/node_modules/@playdrop/vox-three/dist/src/vox.js +0 -110
- package/node_modules/@playdrop/vox-three/dist/src/vox.js.map +1 -1
- package/node_modules/@playdrop/vox-three/dist/test/vox.test.js +0 -18
- package/node_modules/@playdrop/vox-three/dist/test/vox.test.js.map +1 -1
- package/node_modules/@playdrop/vox-three/package.json +8 -4
- package/package.json +9 -11
- package/dist/assets/model-artifacts.d.ts +0 -8
- package/dist/assets/model-artifacts.js +0 -382
- package/dist/assets/model-worker.d.ts +0 -22
- package/dist/assets/model-worker.js +0 -123
- package/node_modules/@playdrop/ai-client/dist/index.d.ts +0 -441
- package/node_modules/@playdrop/ai-client/dist/index.d.ts.map +0 -1
- package/node_modules/@playdrop/ai-client/dist/index.js +0 -499
- package/node_modules/@playdrop/ai-client/package.json +0 -22
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.d.ts +0 -13
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js +0 -141
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.d.ts +0 -47
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js +0 -313
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/format-utils.d.ts +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js +0 -36
- package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.d.ts +0 -23
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.js +0 -11
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.d.ts +0 -4
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.js +0 -21
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.d.ts +0 -4
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.js +0 -24
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/index.d.ts +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/index.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.d.ts +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js +0 -387
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.d.ts +0 -6
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.js +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.d.ts +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js +0 -373
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.d.ts +0 -12
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js +0 -215
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.d.ts +0 -4
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.js +0 -18
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.d.ts +0 -42
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js +0 -145
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.d.ts +0 -26
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.js +0 -65
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.d.ts +0 -33
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js +0 -175
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/humanoid_r15.json +0 -1517
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/humanoid_r6.json +0 -61
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.d.ts +0 -10
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js +0 -23
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/index.d.ts +0 -19
- package/node_modules/@playdrop/boxel-core/dist/src/index.js +0 -36
- package/node_modules/@playdrop/boxel-core/dist/src/index.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/materials.d.ts +0 -26
- package/node_modules/@playdrop/boxel-core/dist/src/materials.js +0 -184
- package/node_modules/@playdrop/boxel-core/dist/src/materials.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.d.ts +0 -68
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js +0 -488
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.d.ts +0 -4
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.js +0 -380
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/textures.d.ts +0 -29
- package/node_modules/@playdrop/boxel-core/dist/src/textures.js +0 -208
- package/node_modules/@playdrop/boxel-core/dist/src/textures.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.d.ts +0 -9
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js +0 -312
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.d.ts +0 -9
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js +0 -154
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.d.ts +0 -2
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js +0 -121
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.d.ts +0 -20
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js +0 -389
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.d.ts +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js +0 -206
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.d.ts +0 -12
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js +0 -81
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.d.ts +0 -12
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js +0 -318
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/types.d.ts +0 -168
- package/node_modules/@playdrop/boxel-core/dist/src/types.js +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/types.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/validation.d.ts +0 -24
- package/node_modules/@playdrop/boxel-core/dist/src/validation.js +0 -620
- package/node_modules/@playdrop/boxel-core/dist/src/validation.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.d.ts +0 -11
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js +0 -135
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.d.ts +0 -23
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.js +0 -52
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/package.json +0 -19
- package/node_modules/@playdrop/boxel-three/dist/src/animations.d.ts +0 -4
- package/node_modules/@playdrop/boxel-three/dist/src/animations.js +0 -92
- package/node_modules/@playdrop/boxel-three/dist/src/builders.d.ts +0 -8
- package/node_modules/@playdrop/boxel-three/dist/src/builders.js +0 -363
- package/node_modules/@playdrop/boxel-three/dist/src/context.d.ts +0 -24
- package/node_modules/@playdrop/boxel-three/dist/src/context.js +0 -58
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.d.ts +0 -100
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.js +0 -927
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.d.ts +0 -18
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.js +0 -294
- package/node_modules/@playdrop/boxel-three/dist/src/index.d.ts +0 -17
- package/node_modules/@playdrop/boxel-three/dist/src/index.js +0 -64
- package/node_modules/@playdrop/boxel-three/dist/src/instantiate.d.ts +0 -40
- package/node_modules/@playdrop/boxel-three/dist/src/instantiate.js +0 -96
- package/node_modules/@playdrop/boxel-three/dist/src/nodes.d.ts +0 -8
- package/node_modules/@playdrop/boxel-three/dist/src/nodes.js +0 -88
- package/node_modules/@playdrop/boxel-three/dist/src/overlays.d.ts +0 -7
- package/node_modules/@playdrop/boxel-three/dist/src/overlays.js +0 -123
- package/node_modules/@playdrop/boxel-three/dist/src/primitives.d.ts +0 -4
- package/node_modules/@playdrop/boxel-three/dist/src/primitives.js +0 -48
- package/node_modules/@playdrop/boxel-three/dist/src/scene.d.ts +0 -3
- package/node_modules/@playdrop/boxel-three/dist/src/scene.js +0 -168
- package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.d.ts +0 -29
- package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.js +0 -623
- package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.d.ts +0 -13
- package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.js +0 -133
- package/node_modules/@playdrop/boxel-three/dist/src/textures.d.ts +0 -17
- package/node_modules/@playdrop/boxel-three/dist/src/textures.js +0 -216
- package/node_modules/@playdrop/boxel-three/dist/src/types.d.ts +0 -112
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.d.ts +0 -28
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.js +0 -344
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.d.ts +0 -24
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.js +0 -113
- package/node_modules/@playdrop/boxel-three/dist/test/export-image.playwright.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/export-image.playwright.test.js +0 -137
- package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.d.ts +0 -20
- package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.js +0 -85
- package/node_modules/@playdrop/boxel-three/dist/test/glb-skinned.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/glb-skinned.test.js +0 -104
- package/node_modules/@playdrop/boxel-three/dist/test/index.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/index.test.js +0 -30
- package/node_modules/@playdrop/boxel-three/dist/test/instantiate.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/instantiate.test.js +0 -88
- package/node_modules/@playdrop/boxel-three/dist/test/overlays.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/overlays.test.js +0 -42
- package/node_modules/@playdrop/boxel-three/dist/test/scene-filter.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/scene-filter.test.js +0 -73
- package/node_modules/@playdrop/boxel-three/dist/test/scene-smoke.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/scene-smoke.test.js +0 -85
- package/node_modules/@playdrop/boxel-three/dist/test/skinned-mesh.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/skinned-mesh.test.js +0 -73
- package/node_modules/@playdrop/boxel-three/dist/test/textured-overlay.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/textured-overlay.test.js +0 -136
- package/node_modules/@playdrop/boxel-three/dist/test/voxels.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/voxels.test.js +0 -42
- package/node_modules/@playdrop/boxel-three/package.json +0 -28
|
@@ -1,363 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var builders_exports = {};
|
|
19
|
-
__export(builders_exports, {
|
|
20
|
-
DEFAULT_COLOR: () => DEFAULT_COLOR,
|
|
21
|
-
DEFAULT_OPACITY: () => DEFAULT_OPACITY,
|
|
22
|
-
DEFAULT_WIREFRAME_COLOR: () => DEFAULT_WIREFRAME_COLOR,
|
|
23
|
-
createBoundingBoxMesh: () => createBoundingBoxMesh,
|
|
24
|
-
createPrimitiveObject: () => createPrimitiveObject
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(builders_exports);
|
|
27
|
-
var import_boxel_core = require("@playdrop/boxel-core");
|
|
28
|
-
var import_primitives = require("./primitives.js");
|
|
29
|
-
var import_textures = require("./textures.js");
|
|
30
|
-
var import_mesher = require("./voxels/mesher.js");
|
|
31
|
-
const DEFAULT_COLOR = 3900150;
|
|
32
|
-
const DEFAULT_OPACITY = 0.45;
|
|
33
|
-
const DEFAULT_WIREFRAME_COLOR = 6333946;
|
|
34
|
-
const BOX_FACES = ["east", "west", "top", "bottom", "north", "south"];
|
|
35
|
-
const OVERLAY_THICKNESS = 0.25;
|
|
36
|
-
function createBoundingBoxMesh(context, size) {
|
|
37
|
-
const geometry = (0, import_primitives.createBoxGeometry)(context.THREE, size);
|
|
38
|
-
const material = new context.THREE.MeshStandardMaterial({
|
|
39
|
-
color: DEFAULT_COLOR,
|
|
40
|
-
transparent: true,
|
|
41
|
-
opacity: DEFAULT_OPACITY,
|
|
42
|
-
metalness: 0,
|
|
43
|
-
roughness: 0.75
|
|
44
|
-
});
|
|
45
|
-
const mesh = new context.THREE.Mesh(geometry, material);
|
|
46
|
-
const edges = new context.THREE.EdgesGeometry(geometry);
|
|
47
|
-
const lineMaterial = new context.THREE.LineBasicMaterial({ color: DEFAULT_WIREFRAME_COLOR });
|
|
48
|
-
const wireframe = new context.THREE.LineSegments(edges, lineMaterial);
|
|
49
|
-
mesh.add(wireframe);
|
|
50
|
-
mesh.userData = {
|
|
51
|
-
...mesh.userData ?? {},
|
|
52
|
-
size: [...size],
|
|
53
|
-
placeholder: true
|
|
54
|
-
};
|
|
55
|
-
return mesh;
|
|
56
|
-
}
|
|
57
|
-
function createPlainBoxObject(context, primitive, alignment) {
|
|
58
|
-
const materialDef = context.materialsById.get(primitive.material);
|
|
59
|
-
const color = materialDef?.baseColor ?? [59, 130, 246];
|
|
60
|
-
const geometry = (0, import_primitives.createBoxGeometry)(context.THREE, primitive.size);
|
|
61
|
-
const meshMaterial = new context.THREE.MeshStandardMaterial({
|
|
62
|
-
color: (0, import_textures.toThreeColorRGB)(context, color),
|
|
63
|
-
metalness: 0,
|
|
64
|
-
roughness: 1,
|
|
65
|
-
transparent: materialDef?.opacity !== void 0 && materialDef.opacity < 1,
|
|
66
|
-
opacity: materialDef?.opacity !== void 0 ? materialDef.opacity : 1
|
|
67
|
-
});
|
|
68
|
-
if (materialDef?.emissiveColor) {
|
|
69
|
-
meshMaterial.emissive.copy((0, import_textures.toThreeColorRGB)(context, materialDef.emissiveColor));
|
|
70
|
-
meshMaterial.emissiveIntensity = 1;
|
|
71
|
-
}
|
|
72
|
-
meshMaterial.needsUpdate = true;
|
|
73
|
-
const mesh = new context.THREE.Mesh(geometry, meshMaterial);
|
|
74
|
-
mesh.name = primitive.id;
|
|
75
|
-
mesh.userData = {
|
|
76
|
-
...mesh.userData ?? {},
|
|
77
|
-
primitiveId: primitive.id,
|
|
78
|
-
size: [...primitive.size]
|
|
79
|
-
};
|
|
80
|
-
if (alignment === "grounded") {
|
|
81
|
-
mesh.position.y = primitive.size[1] / 2;
|
|
82
|
-
}
|
|
83
|
-
return mesh;
|
|
84
|
-
}
|
|
85
|
-
function createTexturedBoxObject(context, primitive, alignment) {
|
|
86
|
-
const geometry = (0, import_primitives.createBoxGeometry)(context.THREE, primitive.size);
|
|
87
|
-
const materials = BOX_FACES.map((face) => (0, import_textures.createTextureMaterial)(context, (0, import_boxel_core.resolveFaceTextureId)(primitive, face)));
|
|
88
|
-
const renderMode = primitive.renderMode === "cutout" ? "cutout" : "plain";
|
|
89
|
-
materials.forEach((material) => {
|
|
90
|
-
if (renderMode === "cutout") {
|
|
91
|
-
material.transparent = false;
|
|
92
|
-
material.alphaTest = 0.5;
|
|
93
|
-
material.side = context.THREE.DoubleSide;
|
|
94
|
-
} else {
|
|
95
|
-
material.transparent = true;
|
|
96
|
-
material.alphaTest = 0;
|
|
97
|
-
material.side = context.THREE.FrontSide;
|
|
98
|
-
}
|
|
99
|
-
material.depthWrite = true;
|
|
100
|
-
material.needsUpdate = true;
|
|
101
|
-
});
|
|
102
|
-
const mesh = new context.THREE.Mesh(geometry, materials);
|
|
103
|
-
mesh.name = primitive.id;
|
|
104
|
-
mesh.userData = {
|
|
105
|
-
...mesh.userData ?? {},
|
|
106
|
-
primitiveId: primitive.id,
|
|
107
|
-
size: [...primitive.size]
|
|
108
|
-
};
|
|
109
|
-
if (alignment === "grounded") {
|
|
110
|
-
mesh.position.y = primitive.size[1] / 2;
|
|
111
|
-
}
|
|
112
|
-
const overlayTextureIds = BOX_FACES.map((face) => (0, import_boxel_core.resolveOverlayFaceTextureId)(primitive, face));
|
|
113
|
-
const hasOverlay = overlayTextureIds.some((id) => typeof id === "string" && id.trim().length > 0);
|
|
114
|
-
if (hasOverlay) {
|
|
115
|
-
const overlaySize = [
|
|
116
|
-
primitive.size[0] + OVERLAY_THICKNESS * 2,
|
|
117
|
-
primitive.size[1] + OVERLAY_THICKNESS * 2,
|
|
118
|
-
primitive.size[2] + OVERLAY_THICKNESS * 2
|
|
119
|
-
];
|
|
120
|
-
const overlayGeometry = (0, import_primitives.createBoxGeometry)(context.THREE, overlaySize);
|
|
121
|
-
const overlayMaterials = overlayTextureIds.map((textureId) => {
|
|
122
|
-
if (!textureId) {
|
|
123
|
-
const emptyMaterial = new context.THREE.MeshStandardMaterial({
|
|
124
|
-
transparent: true,
|
|
125
|
-
opacity: 0,
|
|
126
|
-
depthWrite: false,
|
|
127
|
-
metalness: 0,
|
|
128
|
-
roughness: 1
|
|
129
|
-
});
|
|
130
|
-
emptyMaterial.visible = false;
|
|
131
|
-
emptyMaterial.needsUpdate = true;
|
|
132
|
-
return emptyMaterial;
|
|
133
|
-
}
|
|
134
|
-
const material = (0, import_textures.createTextureMaterial)(context, textureId);
|
|
135
|
-
material.transparent = true;
|
|
136
|
-
material.alphaTest = 0.5;
|
|
137
|
-
material.side = context.THREE.DoubleSide;
|
|
138
|
-
material.depthWrite = false;
|
|
139
|
-
material.needsUpdate = true;
|
|
140
|
-
return material;
|
|
141
|
-
});
|
|
142
|
-
const overlayMesh = new context.THREE.Mesh(overlayGeometry, overlayMaterials);
|
|
143
|
-
overlayMesh.name = `${primitive.id}_overlay`;
|
|
144
|
-
overlayMesh.renderOrder = mesh.renderOrder + 1;
|
|
145
|
-
overlayMesh.userData = {
|
|
146
|
-
...mesh.userData ?? {},
|
|
147
|
-
primitiveId: primitive.id,
|
|
148
|
-
overlay: true,
|
|
149
|
-
size: [...overlaySize]
|
|
150
|
-
};
|
|
151
|
-
mesh.add(overlayMesh);
|
|
152
|
-
}
|
|
153
|
-
return mesh;
|
|
154
|
-
}
|
|
155
|
-
function createVoxelObject(context, primitive, alignment) {
|
|
156
|
-
const hasData = Array.isArray(primitive.voxels) && primitive.voxels.length > 0;
|
|
157
|
-
const size = primitive.size ?? [1, 1, 1];
|
|
158
|
-
const dims = [
|
|
159
|
-
Math.max(1, Math.round(size[0])),
|
|
160
|
-
Math.max(1, Math.round(size[1])),
|
|
161
|
-
Math.max(1, Math.round(size[2]))
|
|
162
|
-
];
|
|
163
|
-
const worldSize = [dims[0], dims[1], dims[2]];
|
|
164
|
-
if (!hasData) {
|
|
165
|
-
const mesh2 = createBoundingBoxMesh(context, worldSize);
|
|
166
|
-
mesh2.userData = {
|
|
167
|
-
...mesh2.userData ?? {},
|
|
168
|
-
primitiveId: primitive.id,
|
|
169
|
-
size: [...worldSize]
|
|
170
|
-
};
|
|
171
|
-
if (alignment === "grounded") {
|
|
172
|
-
mesh2.position.y = worldSize[1] / 2;
|
|
173
|
-
}
|
|
174
|
-
return mesh2;
|
|
175
|
-
}
|
|
176
|
-
const meshResult = (0, import_mesher.buildVoxelMesh)({
|
|
177
|
-
voxels: primitive.voxels,
|
|
178
|
-
dimensions: dims,
|
|
179
|
-
size: worldSize
|
|
180
|
-
});
|
|
181
|
-
if (meshResult.indices.length === 0 || meshResult.positions.length === 0) {
|
|
182
|
-
const mesh2 = createBoundingBoxMesh(context, worldSize);
|
|
183
|
-
mesh2.userData = {
|
|
184
|
-
...mesh2.userData ?? {},
|
|
185
|
-
primitiveId: primitive.id,
|
|
186
|
-
size: [...worldSize]
|
|
187
|
-
};
|
|
188
|
-
if (alignment === "grounded") {
|
|
189
|
-
mesh2.position.y = worldSize[1] / 2;
|
|
190
|
-
}
|
|
191
|
-
return mesh2;
|
|
192
|
-
}
|
|
193
|
-
const paletteIds = primitive.palette ?? [];
|
|
194
|
-
const materialCache = /* @__PURE__ */ new Map();
|
|
195
|
-
const materialIndexMap = /* @__PURE__ */ new Map();
|
|
196
|
-
const materials = [];
|
|
197
|
-
const geometry = new context.THREE.BufferGeometry();
|
|
198
|
-
geometry.setAttribute("position", new context.THREE.Float32BufferAttribute(meshResult.positions, 3));
|
|
199
|
-
geometry.setAttribute("normal", new context.THREE.Float32BufferAttribute(meshResult.normals, 3));
|
|
200
|
-
geometry.setAttribute("uv", new context.THREE.Float32BufferAttribute(meshResult.uvs, 2));
|
|
201
|
-
if (meshResult.indices.length > 0) {
|
|
202
|
-
const vertexCount = meshResult.positions.length / 3;
|
|
203
|
-
const useUint32 = vertexCount > 65535;
|
|
204
|
-
const indexArray = useUint32 ? meshResult.indices : new Uint16Array(meshResult.indices);
|
|
205
|
-
geometry.setIndex(new context.THREE.BufferAttribute(indexArray, 1));
|
|
206
|
-
}
|
|
207
|
-
geometry.computeBoundingBox();
|
|
208
|
-
geometry.computeBoundingSphere();
|
|
209
|
-
meshResult.groups.forEach((groupData) => {
|
|
210
|
-
const paletteIndex = groupData.material;
|
|
211
|
-
let material = materialCache.get(paletteIndex);
|
|
212
|
-
if (!material) {
|
|
213
|
-
const materialId = paletteIds[paletteIndex - 1];
|
|
214
|
-
const materialDef = materialId ? context.materialsById.get(materialId) : void 0;
|
|
215
|
-
const baseColor = materialDef?.baseColor ?? [59, 130, 246];
|
|
216
|
-
const emissive = materialDef?.emissiveColor;
|
|
217
|
-
const opacity = materialDef?.opacity ?? 1;
|
|
218
|
-
material = new context.THREE.MeshStandardMaterial({
|
|
219
|
-
color: (0, import_textures.toThreeColorRGB)(context, baseColor),
|
|
220
|
-
metalness: 0,
|
|
221
|
-
roughness: 1,
|
|
222
|
-
transparent: opacity < 1,
|
|
223
|
-
opacity
|
|
224
|
-
});
|
|
225
|
-
if (emissive) {
|
|
226
|
-
material.emissive.copy((0, import_textures.toThreeColorRGB)(context, emissive));
|
|
227
|
-
material.emissiveIntensity = 1;
|
|
228
|
-
}
|
|
229
|
-
material.needsUpdate = true;
|
|
230
|
-
materialCache.set(paletteIndex, material);
|
|
231
|
-
}
|
|
232
|
-
let materialIndex = materialIndexMap.get(paletteIndex);
|
|
233
|
-
if (materialIndex === void 0) {
|
|
234
|
-
materialIndex = materials.length;
|
|
235
|
-
materials.push(material);
|
|
236
|
-
materialIndexMap.set(paletteIndex, materialIndex);
|
|
237
|
-
}
|
|
238
|
-
geometry.addGroup(groupData.start, groupData.count, materialIndex);
|
|
239
|
-
});
|
|
240
|
-
const meshMaterial = materials.length === 1 ? materials[0] : materials;
|
|
241
|
-
const mesh = new context.THREE.Mesh(geometry, meshMaterial);
|
|
242
|
-
mesh.name = primitive.id;
|
|
243
|
-
mesh.userData = {
|
|
244
|
-
...mesh.userData ?? {},
|
|
245
|
-
primitiveId: primitive.id,
|
|
246
|
-
size: [...worldSize]
|
|
247
|
-
};
|
|
248
|
-
if (alignment === "grounded") {
|
|
249
|
-
mesh.position.y = size[1] / 2;
|
|
250
|
-
}
|
|
251
|
-
return mesh;
|
|
252
|
-
}
|
|
253
|
-
function createComboObject(context, primitive, alignment, visited) {
|
|
254
|
-
const group = new context.THREE.Group();
|
|
255
|
-
group.name = primitive.id;
|
|
256
|
-
const sockets = [];
|
|
257
|
-
const slotEntries = [];
|
|
258
|
-
primitive.slots.forEach((slot) => {
|
|
259
|
-
const childPrimitive = context.primitivesById.get(slot.primitive);
|
|
260
|
-
if (!childPrimitive) {
|
|
261
|
-
console.warn("[boxel-three] combo slot references missing primitive", slot.primitive);
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
const object = createPrimitiveObject(context, childPrimitive, alignment, new Set(visited));
|
|
265
|
-
if (!object)
|
|
266
|
-
return;
|
|
267
|
-
const childSize = [
|
|
268
|
-
childPrimitive.size?.[0] ?? 0,
|
|
269
|
-
childPrimitive.size?.[1] ?? 0,
|
|
270
|
-
childPrimitive.size?.[2] ?? 0
|
|
271
|
-
];
|
|
272
|
-
slotEntries.push({ slot, object, size: childSize });
|
|
273
|
-
});
|
|
274
|
-
if (slotEntries.length === 0) {
|
|
275
|
-
const fallbackSize = [
|
|
276
|
-
primitive.size?.[0] ?? 1,
|
|
277
|
-
primitive.size?.[1] ?? 1,
|
|
278
|
-
primitive.size?.[2] ?? 1
|
|
279
|
-
];
|
|
280
|
-
const bounding = createBoundingBoxMesh(context, fallbackSize);
|
|
281
|
-
bounding.userData = {
|
|
282
|
-
...bounding.userData ?? {},
|
|
283
|
-
primitiveId: primitive.id,
|
|
284
|
-
size: [...fallbackSize]
|
|
285
|
-
};
|
|
286
|
-
if (alignment === "grounded") {
|
|
287
|
-
bounding.position.y = fallbackSize[1] / 2;
|
|
288
|
-
}
|
|
289
|
-
return bounding;
|
|
290
|
-
}
|
|
291
|
-
let minX = Infinity;
|
|
292
|
-
let minY = Infinity;
|
|
293
|
-
let minZ = Infinity;
|
|
294
|
-
let maxX = -Infinity;
|
|
295
|
-
let maxY = -Infinity;
|
|
296
|
-
let maxZ = -Infinity;
|
|
297
|
-
slotEntries.forEach(({ slot, size }) => {
|
|
298
|
-
const halfSize = [size[0] / 2, size[1] / 2, size[2] / 2];
|
|
299
|
-
minX = Math.min(minX, slot.offset[0] - halfSize[0]);
|
|
300
|
-
minY = Math.min(minY, slot.offset[1] - halfSize[1]);
|
|
301
|
-
minZ = Math.min(minZ, slot.offset[2] - halfSize[2]);
|
|
302
|
-
maxX = Math.max(maxX, slot.offset[0] + halfSize[0]);
|
|
303
|
-
maxY = Math.max(maxY, slot.offset[1] + halfSize[1]);
|
|
304
|
-
maxZ = Math.max(maxZ, slot.offset[2] + halfSize[2]);
|
|
305
|
-
});
|
|
306
|
-
const derivedSize = [
|
|
307
|
-
Math.max(0, maxX - minX),
|
|
308
|
-
Math.max(0, maxY - minY),
|
|
309
|
-
Math.max(0, maxZ - minZ)
|
|
310
|
-
];
|
|
311
|
-
slotEntries.forEach(({ slot, object }) => {
|
|
312
|
-
object.position.set(slot.offset[0], slot.offset[1], slot.offset[2]);
|
|
313
|
-
object.userData = {
|
|
314
|
-
...object.userData ?? {},
|
|
315
|
-
comboSlotId: slot.id,
|
|
316
|
-
comboParentId: primitive.id
|
|
317
|
-
};
|
|
318
|
-
group.add(object);
|
|
319
|
-
sockets.push([slot.offset[0], slot.offset[1], slot.offset[2]]);
|
|
320
|
-
});
|
|
321
|
-
const comboSize = [
|
|
322
|
-
primitive.size?.[0] ?? derivedSize[0],
|
|
323
|
-
primitive.size?.[1] ?? derivedSize[1],
|
|
324
|
-
primitive.size?.[2] ?? derivedSize[2]
|
|
325
|
-
];
|
|
326
|
-
group.userData = {
|
|
327
|
-
...group.userData ?? {},
|
|
328
|
-
primitiveId: primitive.id,
|
|
329
|
-
size: [...comboSize],
|
|
330
|
-
sockets
|
|
331
|
-
};
|
|
332
|
-
if (alignment === "grounded") {
|
|
333
|
-
group.position.y = comboSize[1] / 2;
|
|
334
|
-
}
|
|
335
|
-
return group;
|
|
336
|
-
}
|
|
337
|
-
function createPrimitiveObject(context, primitive, alignment, visited = /* @__PURE__ */ new Set()) {
|
|
338
|
-
if (visited.has(primitive.id)) {
|
|
339
|
-
console.warn("[boxel-three] detected recursive primitive reference", primitive.id);
|
|
340
|
-
return null;
|
|
341
|
-
}
|
|
342
|
-
visited.add(primitive.id);
|
|
343
|
-
switch (primitive.kind) {
|
|
344
|
-
case "plain_box":
|
|
345
|
-
return createPlainBoxObject(context, primitive, alignment);
|
|
346
|
-
case "textured_box":
|
|
347
|
-
return createTexturedBoxObject(context, primitive, alignment);
|
|
348
|
-
case "voxel_box":
|
|
349
|
-
return createVoxelObject(context, primitive, alignment);
|
|
350
|
-
case "combo_box":
|
|
351
|
-
return createComboObject(context, primitive, alignment, visited);
|
|
352
|
-
default:
|
|
353
|
-
return null;
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
357
|
-
0 && (module.exports = {
|
|
358
|
-
DEFAULT_COLOR,
|
|
359
|
-
DEFAULT_OPACITY,
|
|
360
|
-
DEFAULT_WIREFRAME_COLOR,
|
|
361
|
-
createBoundingBoxMesh,
|
|
362
|
-
createPrimitiveObject
|
|
363
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type * as THREEType from "three";
|
|
2
|
-
import type { BoxelDefinition, Material, Primitive } from "@playdrop/boxel-core";
|
|
3
|
-
import type { TextureBundle } from "./textures.js";
|
|
4
|
-
export interface BuilderSettings {
|
|
5
|
-
enableShadows: boolean;
|
|
6
|
-
}
|
|
7
|
-
export interface PrimitiveBuilderContext {
|
|
8
|
-
THREE: typeof THREEType;
|
|
9
|
-
settings: BuilderSettings;
|
|
10
|
-
entity: BoxelDefinition | null;
|
|
11
|
-
materialsById: Map<string, Material>;
|
|
12
|
-
primitivesById: Map<string, Primitive>;
|
|
13
|
-
textureCache: Map<string, TextureBundle>;
|
|
14
|
-
}
|
|
15
|
-
export interface BuilderUpdate {
|
|
16
|
-
entity?: BoxelDefinition | null;
|
|
17
|
-
settings?: Partial<BuilderSettings>;
|
|
18
|
-
}
|
|
19
|
-
export declare function createBuilderContext(options: {
|
|
20
|
-
THREE: typeof THREEType;
|
|
21
|
-
settings: BuilderSettings;
|
|
22
|
-
}): PrimitiveBuilderContext;
|
|
23
|
-
export declare function updateBuilderContext(context: PrimitiveBuilderContext, update: BuilderUpdate): void;
|
|
24
|
-
export declare function clearTextureCache(context: PrimitiveBuilderContext): void;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var context_exports = {};
|
|
19
|
-
__export(context_exports, {
|
|
20
|
-
clearTextureCache: () => clearTextureCache,
|
|
21
|
-
createBuilderContext: () => createBuilderContext,
|
|
22
|
-
updateBuilderContext: () => updateBuilderContext
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(context_exports);
|
|
25
|
-
function createBuilderContext(options) {
|
|
26
|
-
return {
|
|
27
|
-
THREE: options.THREE,
|
|
28
|
-
settings: { ...options.settings },
|
|
29
|
-
entity: null,
|
|
30
|
-
materialsById: /* @__PURE__ */ new Map(),
|
|
31
|
-
primitivesById: /* @__PURE__ */ new Map(),
|
|
32
|
-
textureCache: /* @__PURE__ */ new Map()
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
function updateBuilderContext(context, update) {
|
|
36
|
-
if (update.settings) {
|
|
37
|
-
context.settings = { ...context.settings, ...update.settings };
|
|
38
|
-
}
|
|
39
|
-
if (update.entity !== void 0) {
|
|
40
|
-
context.entity = update.entity;
|
|
41
|
-
context.materialsById = update.entity ? new Map(update.entity.materials.map((material) => [material.id, material])) : /* @__PURE__ */ new Map();
|
|
42
|
-
context.primitivesById = update.entity ? new Map(update.entity.primitives.map((primitive) => [primitive.id, primitive])) : /* @__PURE__ */ new Map();
|
|
43
|
-
clearTextureCache(context);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function clearTextureCache(context) {
|
|
47
|
-
context.textureCache.forEach((bundle) => {
|
|
48
|
-
bundle.color.dispose();
|
|
49
|
-
bundle.emissive?.dispose();
|
|
50
|
-
});
|
|
51
|
-
context.textureCache.clear();
|
|
52
|
-
}
|
|
53
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
54
|
-
0 && (module.exports = {
|
|
55
|
-
clearTextureCache,
|
|
56
|
-
createBuilderContext,
|
|
57
|
-
updateBuilderContext
|
|
58
|
-
});
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import type { BoxelDefinition, Material, Pattern, Primitive, Texture } from "@playdrop/boxel-core";
|
|
2
|
-
import type * as THREEType from "three";
|
|
3
|
-
import type { GLTFExporter } from "three/examples/jsm/exporters/GLTFExporter.js";
|
|
4
|
-
import type { BoxelSceneAnimation } from "../types.js";
|
|
5
|
-
import { type VoxelFacePatch } from "../voxels/faces.js";
|
|
6
|
-
interface TexturePixels {
|
|
7
|
-
id: string;
|
|
8
|
-
width: number;
|
|
9
|
-
height: number;
|
|
10
|
-
color: Uint8Array;
|
|
11
|
-
emissive?: Uint8Array;
|
|
12
|
-
hasEmissive: boolean;
|
|
13
|
-
hasTransparency: boolean;
|
|
14
|
-
}
|
|
15
|
-
interface TextureAtlasRegion {
|
|
16
|
-
uMin: number;
|
|
17
|
-
vMin: number;
|
|
18
|
-
uMax: number;
|
|
19
|
-
vMax: number;
|
|
20
|
-
}
|
|
21
|
-
interface TextureAtlas {
|
|
22
|
-
regions: Map<string, TextureAtlasRegion>;
|
|
23
|
-
fallbackRegion: TextureAtlasRegion;
|
|
24
|
-
map: THREEType.DataTexture;
|
|
25
|
-
emissiveMap: THREEType.DataTexture | null;
|
|
26
|
-
hasTransparency: boolean;
|
|
27
|
-
}
|
|
28
|
-
interface CachedVoxelPatch extends VoxelFacePatch {
|
|
29
|
-
textureId: string;
|
|
30
|
-
}
|
|
31
|
-
export type ExportMode = "hierarchical" | "merged" | "skinned";
|
|
32
|
-
interface ExportModelOptions {
|
|
33
|
-
THREE: typeof THREEType;
|
|
34
|
-
GLTFExporterCtor: new () => GLTFExporter;
|
|
35
|
-
model: BoxelDefinition;
|
|
36
|
-
mode?: ExportMode;
|
|
37
|
-
binary?: boolean;
|
|
38
|
-
animationIds?: string[] | null;
|
|
39
|
-
}
|
|
40
|
-
export declare function exportModelToGLB(options: ExportModelOptions): Promise<Blob>;
|
|
41
|
-
export declare function createBoxelSceneGraph(options: {
|
|
42
|
-
THREE: typeof THREEType;
|
|
43
|
-
model: BoxelDefinition;
|
|
44
|
-
mode?: ExportMode;
|
|
45
|
-
}): SceneGraphResult;
|
|
46
|
-
interface ExportContext {
|
|
47
|
-
THREE: typeof THREEType;
|
|
48
|
-
model: BoxelDefinition;
|
|
49
|
-
materialsById: Map<string, Material>;
|
|
50
|
-
primitivesById: Map<string, Primitive>;
|
|
51
|
-
texturesById: Map<string, Texture>;
|
|
52
|
-
patternsById: Map<string, Pattern>;
|
|
53
|
-
atlas: TextureAtlas | null;
|
|
54
|
-
voxelSurfacesByPrimitive: Map<string, CachedVoxelPatch[]>;
|
|
55
|
-
plainMaterialCache: Map<string, THREEType.MeshStandardMaterial>;
|
|
56
|
-
}
|
|
57
|
-
declare function createExportContext(THREE: typeof THREEType, model: BoxelDefinition): ExportContext;
|
|
58
|
-
interface AtlasBuildOptions {
|
|
59
|
-
THREE: typeof THREEType;
|
|
60
|
-
materialsById: Map<string, Material>;
|
|
61
|
-
texturesById: Map<string, Texture>;
|
|
62
|
-
patternsById: Map<string, Pattern>;
|
|
63
|
-
usedTextureIds: Set<string>;
|
|
64
|
-
}
|
|
65
|
-
declare function buildTextureAtlas(options: AtlasBuildOptions, extraEntries?: TexturePixels[]): TextureAtlas | null;
|
|
66
|
-
declare function collectUsedTextureIds(model: BoxelDefinition, primitivesById: Map<string, Primitive>): Set<string>;
|
|
67
|
-
interface SceneGraphResult {
|
|
68
|
-
root: THREEType.Object3D;
|
|
69
|
-
nodeLookup: Map<string, THREEType.Object3D>;
|
|
70
|
-
animations: BoxelSceneAnimation[];
|
|
71
|
-
dispose: () => void;
|
|
72
|
-
}
|
|
73
|
-
declare function buildSceneGraph(context: ExportContext, mode: ExportMode): SceneGraphResult;
|
|
74
|
-
declare function resolveAnimationClips(sceneGraph: SceneGraphResult, mode: ExportMode, animationIds?: string[] | null): THREEType.AnimationClip[];
|
|
75
|
-
interface AppendGeometryOptions {
|
|
76
|
-
THREE: typeof THREEType;
|
|
77
|
-
geometry: THREEType.BufferGeometry;
|
|
78
|
-
matrix: THREEType.Matrix4;
|
|
79
|
-
customUVs?: Float32Array;
|
|
80
|
-
}
|
|
81
|
-
declare class MeshAccumulator {
|
|
82
|
-
private readonly positions;
|
|
83
|
-
private readonly normals;
|
|
84
|
-
private readonly uvs;
|
|
85
|
-
private readonly indices;
|
|
86
|
-
private vertexCount;
|
|
87
|
-
constructor(withUVs: boolean);
|
|
88
|
-
appendGeometry(options: AppendGeometryOptions): void;
|
|
89
|
-
hasGeometry(): boolean;
|
|
90
|
-
build(THREE: typeof THREEType): THREEType.BufferGeometry;
|
|
91
|
-
}
|
|
92
|
-
export declare const __testing: {
|
|
93
|
-
buildTextureAtlas: typeof buildTextureAtlas;
|
|
94
|
-
collectUsedTextureIds: typeof collectUsedTextureIds;
|
|
95
|
-
MeshAccumulator: typeof MeshAccumulator;
|
|
96
|
-
createExportContext: typeof createExportContext;
|
|
97
|
-
buildSceneGraph: typeof buildSceneGraph;
|
|
98
|
-
resolveAnimationClips: typeof resolveAnimationClips;
|
|
99
|
-
};
|
|
100
|
-
export {};
|