@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,11 +0,0 @@
|
|
|
1
|
-
import type { VoxelBox } from "../types";
|
|
2
|
-
export interface GreedyQuad {
|
|
3
|
-
material: number;
|
|
4
|
-
axis: 0 | 1 | 2;
|
|
5
|
-
normal: 1 | -1;
|
|
6
|
-
plane: number;
|
|
7
|
-
origin: [number, number, number];
|
|
8
|
-
size: [number, number];
|
|
9
|
-
}
|
|
10
|
-
export declare function generateGreedyQuads(voxels: number[], dimensions: [number, number, number]): GreedyQuad[];
|
|
11
|
-
export declare function generateQuadsForVoxelBox(primitive: VoxelBox): GreedyQuad[];
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateGreedyQuads = generateGreedyQuads;
|
|
4
|
-
exports.generateQuadsForVoxelBox = generateQuadsForVoxelBox;
|
|
5
|
-
function getVoxel(voxels, dims, x, y, z) {
|
|
6
|
-
if (x < 0 || y < 0 || z < 0)
|
|
7
|
-
return 0;
|
|
8
|
-
if (x >= dims[0] || y >= dims[1] || z >= dims[2])
|
|
9
|
-
return 0;
|
|
10
|
-
const index = x + dims[0] * (y + dims[1] * z);
|
|
11
|
-
return voxels[index] ?? 0;
|
|
12
|
-
}
|
|
13
|
-
function mergeMask(quads, mask, dimsU, dimsV, axis, plane) {
|
|
14
|
-
let n = 0;
|
|
15
|
-
for (let j = 0; j < dimsV; j += 1) {
|
|
16
|
-
for (let i = 0; i < dimsU;) {
|
|
17
|
-
const cell = mask[n];
|
|
18
|
-
if (!cell) {
|
|
19
|
-
i += 1;
|
|
20
|
-
n += 1;
|
|
21
|
-
continue;
|
|
22
|
-
}
|
|
23
|
-
const material = cell.material;
|
|
24
|
-
const normal = cell.normal;
|
|
25
|
-
let width = 1;
|
|
26
|
-
while (i + width < dimsU) {
|
|
27
|
-
const next = mask[n + width];
|
|
28
|
-
if (!next || next.material !== material || next.normal !== normal) {
|
|
29
|
-
break;
|
|
30
|
-
}
|
|
31
|
-
width += 1;
|
|
32
|
-
}
|
|
33
|
-
let height = 1;
|
|
34
|
-
outer: while (j + height < dimsV) {
|
|
35
|
-
for (let w = 0; w < width; w += 1) {
|
|
36
|
-
const next = mask[n + w + height * dimsU];
|
|
37
|
-
if (!next || next.material !== material || next.normal !== normal) {
|
|
38
|
-
break outer;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
height += 1;
|
|
42
|
-
}
|
|
43
|
-
const origin = [0, 0, 0];
|
|
44
|
-
const u = ((axis + 1) % 3);
|
|
45
|
-
const v = ((axis + 2) % 3);
|
|
46
|
-
origin[u] = i;
|
|
47
|
-
origin[v] = j;
|
|
48
|
-
origin[axis] = plane;
|
|
49
|
-
quads.push({
|
|
50
|
-
material,
|
|
51
|
-
axis,
|
|
52
|
-
normal,
|
|
53
|
-
plane,
|
|
54
|
-
origin,
|
|
55
|
-
size: [width, height],
|
|
56
|
-
});
|
|
57
|
-
for (let h = 0; h < height; h += 1) {
|
|
58
|
-
for (let w = 0; w < width; w += 1) {
|
|
59
|
-
mask[n + w + h * dimsU] = null;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
i += width;
|
|
63
|
-
n += width;
|
|
64
|
-
}
|
|
65
|
-
n = (j + 1) * dimsU;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function generateGreedyQuads(voxels, dimensions) {
|
|
69
|
-
const quads = [];
|
|
70
|
-
for (let axisIndex = 0; axisIndex < 3; axisIndex += 1) {
|
|
71
|
-
const axis = axisIndex;
|
|
72
|
-
const u = (axis + 1) % 3;
|
|
73
|
-
const v = (axis + 2) % 3;
|
|
74
|
-
const dimsU = dimensions[u];
|
|
75
|
-
const dimsV = dimensions[v];
|
|
76
|
-
const dimsAxis = dimensions[axis];
|
|
77
|
-
const mask = new Array(dimsU * dimsV);
|
|
78
|
-
for (let slice = 0; slice <= dimsAxis; slice += 1) {
|
|
79
|
-
// Positive normals (faces on the "back" of the slice)
|
|
80
|
-
for (let j = 0; j < dimsV; j += 1) {
|
|
81
|
-
for (let i = 0; i < dimsU; i += 1) {
|
|
82
|
-
const aCoords = [0, 0, 0];
|
|
83
|
-
aCoords[axis] = slice - 1;
|
|
84
|
-
aCoords[u] = i;
|
|
85
|
-
aCoords[v] = j;
|
|
86
|
-
const bCoords = [0, 0, 0];
|
|
87
|
-
bCoords[axis] = slice;
|
|
88
|
-
bCoords[u] = i;
|
|
89
|
-
bCoords[v] = j;
|
|
90
|
-
const a = slice > 0 ? getVoxel(voxels, dimensions, aCoords[0], aCoords[1], aCoords[2]) : 0;
|
|
91
|
-
const b = slice < dimsAxis ? getVoxel(voxels, dimensions, bCoords[0], bCoords[1], bCoords[2]) : 0;
|
|
92
|
-
if (a && (!b || a !== b)) {
|
|
93
|
-
mask[i + dimsU * j] = { material: a, normal: 1 };
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
mask[i + dimsU * j] = null;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
mergeMask(quads, mask, dimsU, dimsV, axis, slice);
|
|
101
|
-
// Negative normals (faces on the "front" of the slice)
|
|
102
|
-
for (let j = 0; j < dimsV; j += 1) {
|
|
103
|
-
for (let i = 0; i < dimsU; i += 1) {
|
|
104
|
-
const aCoords = [0, 0, 0];
|
|
105
|
-
aCoords[axis] = slice - 1;
|
|
106
|
-
aCoords[u] = i;
|
|
107
|
-
aCoords[v] = j;
|
|
108
|
-
const bCoords = [0, 0, 0];
|
|
109
|
-
bCoords[axis] = slice;
|
|
110
|
-
bCoords[u] = i;
|
|
111
|
-
bCoords[v] = j;
|
|
112
|
-
const a = slice > 0 ? getVoxel(voxels, dimensions, aCoords[0], aCoords[1], aCoords[2]) : 0;
|
|
113
|
-
const b = slice < dimsAxis ? getVoxel(voxels, dimensions, bCoords[0], bCoords[1], bCoords[2]) : 0;
|
|
114
|
-
if (b && (!a || a !== b)) {
|
|
115
|
-
mask[i + dimsU * j] = { material: b, normal: -1 };
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
mask[i + dimsU * j] = null;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
mergeMask(quads, mask, dimsU, dimsV, axis, slice);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
return quads;
|
|
126
|
-
}
|
|
127
|
-
function generateQuadsForVoxelBox(primitive) {
|
|
128
|
-
const dims = [
|
|
129
|
-
Math.max(1, Math.round(primitive.size?.[0] ?? 1)),
|
|
130
|
-
Math.max(1, Math.round(primitive.size?.[1] ?? 1)),
|
|
131
|
-
Math.max(1, Math.round(primitive.size?.[2] ?? 1)),
|
|
132
|
-
];
|
|
133
|
-
return generateGreedyQuads(primitive.voxels ?? [], dims);
|
|
134
|
-
}
|
|
135
|
-
//# sourceMappingURL=greedy-mesher.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"greedy-mesher.js","sourceRoot":"","sources":["../../../src/voxels/greedy-mesher.ts"],"names":[],"mappings":";;AA6FA,kDAkEC;AAED,4DAOC;AAxJD,SAAS,QAAQ,CAAC,MAAgB,EAAE,IAA8B,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IACjG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC;IACtC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC;IAC3D,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED,SAAS,SAAS,CAChB,KAAmB,EACnB,IAA4B,EAC5B,KAAa,EACb,KAAa,EACb,IAAe,EACf,KAAa;IAEb,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC;YAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YACrB,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,CAA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CAAC,CAAC,CAAC;QACjD,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;KAClD,CAAC;IACF,OAAO,mBAAmB,CAAC,SAAS,CAAC,MAAM,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { VoxelBox } from "./types";
|
|
2
|
-
export type VoxelSize = [number, number, number];
|
|
3
|
-
export interface VoxelIndex {
|
|
4
|
-
x: number;
|
|
5
|
-
y: number;
|
|
6
|
-
z: number;
|
|
7
|
-
index: number;
|
|
8
|
-
}
|
|
9
|
-
export declare const clampSizeAxis: (value: number) => number;
|
|
10
|
-
export declare const createFilledVoxelData: (size: VoxelSize, materialIndex?: number) => number[];
|
|
11
|
-
export declare const validateVoxelData: (voxels: number[], size: VoxelSize) => boolean;
|
|
12
|
-
export declare const cloneVoxelData: (voxels: number[]) => number[];
|
|
13
|
-
export declare const forEachVoxel: (voxel: VoxelBox, callback: (info: VoxelIndex, material: number) => void) => void;
|
|
14
|
-
export declare const setVoxelAt: (voxels: number[], size: VoxelSize, coord: {
|
|
15
|
-
x: number;
|
|
16
|
-
y: number;
|
|
17
|
-
z: number;
|
|
18
|
-
}, value: number) => void;
|
|
19
|
-
export declare const getVoxelIndex: (size: VoxelSize, coord: {
|
|
20
|
-
x: number;
|
|
21
|
-
y: number;
|
|
22
|
-
z: number;
|
|
23
|
-
}) => number;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getVoxelIndex = exports.setVoxelAt = exports.forEachVoxel = exports.cloneVoxelData = exports.validateVoxelData = exports.createFilledVoxelData = exports.clampSizeAxis = void 0;
|
|
4
|
-
const clampSizeAxis = (value) => {
|
|
5
|
-
if (!Number.isFinite(value))
|
|
6
|
-
return 1;
|
|
7
|
-
const rounded = Math.floor(Math.max(1, Math.min(64, value)));
|
|
8
|
-
return rounded;
|
|
9
|
-
};
|
|
10
|
-
exports.clampSizeAxis = clampSizeAxis;
|
|
11
|
-
const createFilledVoxelData = (size, materialIndex = 0) => {
|
|
12
|
-
const [sx, sy, sz] = size;
|
|
13
|
-
const total = sx * sy * sz;
|
|
14
|
-
return new Array(total).fill(materialIndex);
|
|
15
|
-
};
|
|
16
|
-
exports.createFilledVoxelData = createFilledVoxelData;
|
|
17
|
-
const validateVoxelData = (voxels, size) => {
|
|
18
|
-
const expected = size[0] * size[1] * size[2];
|
|
19
|
-
if (voxels.length !== expected)
|
|
20
|
-
return false;
|
|
21
|
-
return voxels.every((value) => Number.isInteger(value) && value >= -1);
|
|
22
|
-
};
|
|
23
|
-
exports.validateVoxelData = validateVoxelData;
|
|
24
|
-
const cloneVoxelData = (voxels) => voxels.slice();
|
|
25
|
-
exports.cloneVoxelData = cloneVoxelData;
|
|
26
|
-
const forEachVoxel = (voxel, callback) => {
|
|
27
|
-
const [sx, sy, sz] = voxel.size;
|
|
28
|
-
const { voxels } = voxel;
|
|
29
|
-
for (let z = 0; z < sz; z += 1) {
|
|
30
|
-
for (let y = 0; y < sy; y += 1) {
|
|
31
|
-
for (let x = 0; x < sx; x += 1) {
|
|
32
|
-
const index = x + y * sx + z * sx * sy;
|
|
33
|
-
callback({ x, y, z, index }, voxels[index] ?? -1);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
exports.forEachVoxel = forEachVoxel;
|
|
39
|
-
const setVoxelAt = (voxels, size, coord, value) => {
|
|
40
|
-
const [sx, sy, sz] = size;
|
|
41
|
-
if (coord.x < 0 || coord.x >= sx || coord.y < 0 || coord.y >= sy || coord.z < 0 || coord.z >= sz) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
const index = coord.x + coord.y * sx + coord.z * sx * sy;
|
|
45
|
-
voxels[index] = value;
|
|
46
|
-
};
|
|
47
|
-
exports.setVoxelAt = setVoxelAt;
|
|
48
|
-
const getVoxelIndex = (size, coord) => {
|
|
49
|
-
return coord.x + coord.y * size[0] + coord.z * size[0] * size[1];
|
|
50
|
-
};
|
|
51
|
-
exports.getVoxelIndex = getVoxelIndex;
|
|
52
|
-
//# sourceMappingURL=voxels.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"voxels.js","sourceRoot":"","sources":["../../src/voxels.ts"],"names":[],"mappings":";;;AAWO,MAAM,aAAa,GAAG,CAAC,KAAa,EAAU,EAAE;IACrD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7D,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAJW,QAAA,aAAa,iBAIxB;AAEK,MAAM,qBAAqB,GAAG,CAAC,IAAe,EAAE,aAAa,GAAG,CAAC,EAAY,EAAE;IACpF,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC;IAC1B,MAAM,KAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IAC3B,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAC9C,CAAC,CAAC;AAJW,QAAA,qBAAqB,yBAIhC;AAEK,MAAM,iBAAiB,GAAG,CAAC,MAAgB,EAAE,IAAe,EAAW,EAAE;IAC9E,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7C,IAAI,MAAM,CA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E;IACF,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC;IAC1B,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;QACjG,OAAO;IACT,CAAC;IACD,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;IACzD,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;AACxB,CAAC,CAAC;AAZW,QAAA,UAAU,cAYrB;AAEK,MAAM,aAAa,GAAG,CAAC,IAAe,EAAE,KAA0C,EAAU,EAAE;IACnG,OAAO,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACnE,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@playdrop/boxel-core",
|
|
3
|
-
"version": "0.7.2",
|
|
4
|
-
"description": "Shared domain utilities for Playdrop boxel definitions",
|
|
5
|
-
"main": "dist/src/index.js",
|
|
6
|
-
"types": "dist/src/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "tsc",
|
|
9
|
-
"test": "node ../../scripts/run-node-tests.mjs --import tsx",
|
|
10
|
-
"dev": "tsc --watch",
|
|
11
|
-
"clean": "rm -rf dist"
|
|
12
|
-
},
|
|
13
|
-
"devDependencies": {
|
|
14
|
-
"@types/node": "^20.10.0",
|
|
15
|
-
"@types/pngjs": "^6.0.4",
|
|
16
|
-
"pngjs": "^7.0.0",
|
|
17
|
-
"typescript": "^5.3.0"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type * as THREEType from "three";
|
|
2
|
-
import type { BoxelDefinition } from "@playdrop/boxel-core";
|
|
3
|
-
import type { BoxelSceneAnimation } from "./types.js";
|
|
4
|
-
export declare function buildAnimations(THREE: typeof THREEType, entity: BoxelDefinition, nodeLookup: Map<string, THREEType.Object3D>): BoxelSceneAnimation[];
|
|
@@ -1,92 +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 animations_exports = {};
|
|
19
|
-
__export(animations_exports, {
|
|
20
|
-
buildAnimations: () => buildAnimations
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(animations_exports);
|
|
23
|
-
function createKeyframeTrack(THREE, channel, nodeLookup) {
|
|
24
|
-
const object = nodeLookup.get(channel.node);
|
|
25
|
-
if (!object) {
|
|
26
|
-
console.warn("[boxel-three] animation channel references missing node", channel.node);
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
const times = channel.keyframes.map((keyframe) => keyframe.time);
|
|
30
|
-
const targetName = object.name && object.name.length > 0 ? object.name : object.uuid;
|
|
31
|
-
switch (channel.property) {
|
|
32
|
-
case "position": {
|
|
33
|
-
const values = channel.keyframes.flatMap((keyframe) => keyframe.value);
|
|
34
|
-
return new THREE.VectorKeyframeTrack(`${targetName}.position`, times, values);
|
|
35
|
-
}
|
|
36
|
-
case "rotation": {
|
|
37
|
-
const values = [];
|
|
38
|
-
channel.keyframes.forEach((keyframe) => {
|
|
39
|
-
const radX = THREE.MathUtils.degToRad(keyframe.value[0]);
|
|
40
|
-
const radY = THREE.MathUtils.degToRad(keyframe.value[1]);
|
|
41
|
-
const radZ = THREE.MathUtils.degToRad(keyframe.value[2]);
|
|
42
|
-
const quaternion = new THREE.Quaternion().setFromEuler(new THREE.Euler(radX, radY, radZ));
|
|
43
|
-
values.push(quaternion.x, quaternion.y, quaternion.z, quaternion.w);
|
|
44
|
-
});
|
|
45
|
-
return new THREE.QuaternionKeyframeTrack(`${targetName}.quaternion`, times, values);
|
|
46
|
-
}
|
|
47
|
-
case "scale": {
|
|
48
|
-
const values = channel.keyframes.flatMap((keyframe) => keyframe.value);
|
|
49
|
-
return new THREE.VectorKeyframeTrack(`${targetName}.scale`, times, values);
|
|
50
|
-
}
|
|
51
|
-
default:
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function buildAnimation(THREE, animation, nodeLookup) {
|
|
56
|
-
const tracks = [];
|
|
57
|
-
animation.channels.forEach((channel) => {
|
|
58
|
-
const track = createKeyframeTrack(THREE, channel, nodeLookup);
|
|
59
|
-
if (!track)
|
|
60
|
-
return;
|
|
61
|
-
tracks.push({
|
|
62
|
-
nodeId: channel.node,
|
|
63
|
-
property: channel.property,
|
|
64
|
-
track
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
if (tracks.length === 0) {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
const threeTracks = tracks.map((channel) => channel.track);
|
|
71
|
-
const inferredDuration = threeTracks.reduce((max, track) => {
|
|
72
|
-
const times = track.times;
|
|
73
|
-
if (!times || times.length === 0)
|
|
74
|
-
return max;
|
|
75
|
-
return Math.max(max, times[times.length - 1]);
|
|
76
|
-
}, 0);
|
|
77
|
-
const duration = typeof animation.duration === "number" && animation.duration > 0 ? animation.duration : inferredDuration;
|
|
78
|
-
const clip = new THREE.AnimationClip(animation.id, duration, threeTracks);
|
|
79
|
-
return {
|
|
80
|
-
id: animation.id,
|
|
81
|
-
duration,
|
|
82
|
-
channels: tracks,
|
|
83
|
-
clip
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
function buildAnimations(THREE, entity, nodeLookup) {
|
|
87
|
-
return (entity.animations ?? []).map((animation) => buildAnimation(THREE, animation, nodeLookup)).filter((value) => Boolean(value));
|
|
88
|
-
}
|
|
89
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
90
|
-
0 && (module.exports = {
|
|
91
|
-
buildAnimations
|
|
92
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type * as THREEType from "three";
|
|
2
|
-
import type { Primitive } from "@playdrop/boxel-core";
|
|
3
|
-
import type { PrimitiveBuilderContext } from "./context.js";
|
|
4
|
-
export declare const DEFAULT_COLOR = 3900150;
|
|
5
|
-
export declare const DEFAULT_OPACITY = 0.45;
|
|
6
|
-
export declare const DEFAULT_WIREFRAME_COLOR = 6333946;
|
|
7
|
-
export declare function createBoundingBoxMesh(context: PrimitiveBuilderContext, size: [number, number, number]): THREEType.Mesh;
|
|
8
|
-
export declare function createPrimitiveObject(context: PrimitiveBuilderContext, primitive: Primitive, alignment: "centered" | "grounded", visited?: Set<string>): THREEType.Object3D | null;
|