castle-web-cli 0.4.232 → 0.4.234
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-failures.d.ts +8 -0
- package/dist/agent-failures.js +19 -2
- package/dist/agent-prompts.d.ts +1 -1
- package/dist/agent-prompts.js +10 -3
- package/dist/agent.d.ts +64 -3
- package/dist/agent.js +170 -81
- package/dist/api.d.ts +11 -0
- package/dist/api.js +43 -0
- package/dist/bundle.d.ts +64 -0
- package/dist/bundle.js +558 -2
- package/dist/castle-host/host.d.ts +18 -2
- package/dist/castle-host/host.js +844 -39
- package/dist/castleJson.d.ts +23 -2
- package/dist/castleJson.js +46 -2
- package/dist/check.d.ts +3 -1
- package/dist/check.js +20 -3
- package/dist/chunkLoader.d.ts +3 -0
- package/dist/chunkLoader.js +111 -0
- package/dist/devParty.d.ts +26 -0
- package/dist/devParty.js +231 -0
- package/dist/devSaveStorage.js +4 -0
- package/dist/devSessionStorage.js +50 -2
- package/dist/devSocial.d.ts +24 -0
- package/dist/devSocial.js +70 -0
- package/dist/ide.d.ts +2 -0
- package/dist/ide.js +119 -15
- package/dist/importPinMismatch.d.ts +22 -0
- package/dist/importPinMismatch.js +77 -0
- package/dist/importRegression.js +3 -15
- package/dist/imports.d.ts +10 -3
- package/dist/imports.js +88 -20
- package/dist/index.js +11 -4
- package/dist/init.js +1 -1
- package/dist/platformDoc.js +22 -0
- package/dist/routerFences.d.ts +5 -0
- package/dist/routerFences.js +12 -2
- package/dist/save-deck.d.ts +25 -1
- package/dist/save-deck.js +178 -9
- package/dist/serve.js +32 -11
- package/dist/shell/assets/{index-D2tWM896.js → index-DulbYIJm.js} +97 -97
- package/dist/shell/assets/index-MVLfNYd9.css +1 -0
- package/dist/shell/index.html +2 -2
- package/dist/taskSteer.d.ts +13 -0
- package/dist/taskSteer.js +22 -2
- package/dist/vitePlugins.d.ts +2 -1
- package/dist/vitePlugins.js +13 -0
- package/kits/base/castle.json +1 -1
- package/kits/base/package-lock.json +1 -1
- package/kits/base/sdk/README.md +339 -5
- package/kits/base/sdk/avatar.d.ts +6 -2
- package/kits/base/sdk/avatar.js +12 -4
- package/kits/base/sdk/castle.d.ts +7 -3
- package/kits/base/sdk/castle.js +2 -0
- package/kits/base/sdk/commands.d.ts +176 -1
- package/kits/base/sdk/commands.js +3 -0
- package/kits/base/sdk/display.d.ts +3 -0
- package/kits/base/sdk/display.js +9 -3
- package/kits/base/sdk/hub.d.ts +37 -6
- package/kits/base/sdk/hub.js +63 -4
- package/kits/base/sdk/multiplayer.d.ts +7 -1
- package/kits/base/sdk/multiplayer.js +148 -32
- package/kits/base/sdk/multiplayerProtocol.d.ts +2 -0
- package/kits/base/sdk/party.d.ts +23 -0
- package/kits/base/sdk/party.js +91 -0
- package/kits/base/sdk/reconnectBudget.d.ts +23 -0
- package/kits/base/sdk/reconnectBudget.js +96 -0
- package/kits/base/sdk/save.d.ts +38 -1
- package/kits/base/sdk/save.js +81 -7
- package/kits/base/sdk/server/hub.d.ts +117 -0
- package/kits/base/sdk/server/hub.js +119 -2
- package/kits/base/sdk/server/platformHandle.d.ts +43 -1
- package/kits/base/sdk/server/storage.d.ts +17 -0
- package/kits/base/sdk/server/storage.js +65 -3
- package/kits/base/sdk/server/wrapper.d.ts +43 -6
- package/kits/base/sdk/server/wrapper.js +93 -9
- package/kits/base/sdk/social.d.ts +9 -0
- package/kits/base/sdk/social.js +5 -0
- package/kits/hub-game/CLAUDE.md +451 -13
- package/kits/hub-game/README.md +63 -0
- package/kits/hub-game/blueprints/avatar-10.scene +28 -0
- package/kits/hub-game/blueprints/avatar-11.scene +28 -0
- package/kits/hub-game/blueprints/avatar-12.scene +28 -0
- package/kits/hub-game/blueprints/avatar-13.scene +28 -0
- package/kits/hub-game/blueprints/avatar-14.scene +28 -0
- package/kits/hub-game/blueprints/avatar-15.scene +28 -0
- package/kits/hub-game/blueprints/avatar-4.scene +28 -0
- package/kits/hub-game/blueprints/avatar-5.scene +28 -0
- package/kits/hub-game/blueprints/avatar-6.scene +28 -0
- package/kits/hub-game/blueprints/avatar-7.scene +28 -0
- package/kits/hub-game/blueprints/avatar-8.scene +28 -0
- package/kits/hub-game/blueprints/avatar-9.scene +28 -0
- package/kits/hub-game/castle.json +5 -5
- package/kits/hub-game/code/client/act.js +312 -0
- package/kits/hub-game/code/client/actionLayout.js +147 -0
- package/kits/hub-game/code/client/actionOverflow.js +556 -0
- package/kits/hub-game/code/client/actorBudget.js +47 -0
- package/kits/hub-game/code/client/arrivalCamera.js +50 -0
- package/kits/hub-game/code/client/askSlot.js +117 -0
- package/kits/hub-game/code/client/attention.js +11 -2
- package/kits/hub-game/code/client/avatar.js +311 -35
- package/kits/hub-game/code/client/avatarCap.js +228 -0
- package/kits/hub-game/code/client/avatarColors.js +70 -0
- package/kits/hub-game/code/client/avatarFaces.js +21 -0
- package/kits/hub-game/code/client/avatarShare.js +253 -0
- package/kits/hub-game/code/client/backVisibility.js +13 -0
- package/kits/hub-game/code/client/ballot.js +472 -0
- package/kits/hub-game/code/client/build.js +38 -0
- package/kits/hub-game/code/client/chat.js +41 -5
- package/kits/hub-game/code/client/chatModeration.js +5 -0
- package/kits/hub-game/code/client/chrome.js +2144 -160
- package/kits/hub-game/code/client/companion.js +716 -0
- package/kits/hub-game/code/client/companionDress.js +99 -0
- package/kits/hub-game/code/client/crowdNames.js +241 -0
- package/kits/hub-game/code/client/decor.js +515 -0
- package/kits/hub-game/code/client/defaultEnvironment.js +194 -0
- package/kits/hub-game/code/client/doorErrors.js +39 -0
- package/kits/hub-game/code/client/earned.js +131 -0
- package/kits/hub-game/code/client/emoteBubble.js +75 -0
- package/kits/hub-game/code/client/fall.js +18 -0
- package/kits/hub-game/code/client/farAvatars.js +233 -0
- package/kits/hub-game/code/client/firstJoin.js +9 -2
- package/kits/hub-game/code/client/fpsTelemetry.js +50 -0
- package/kits/hub-game/code/client/frameBatch.js +5 -0
- package/kits/hub-game/code/client/grab.js +368 -29
- package/kits/hub-game/code/client/hookLayer.js +385 -20
- package/kits/hub-game/code/client/hudCopy.js +51 -0
- package/kits/hub-game/code/client/hudRate.js +20 -0
- package/kits/hub-game/code/client/idle.js +177 -24
- package/kits/hub-game/code/client/interestCap.js +81 -0
- package/kits/hub-game/code/client/invites.js +231 -0
- package/kits/hub-game/code/client/joinError.js +9 -0
- package/kits/hub-game/code/client/keys.js +36 -0
- package/kits/hub-game/code/client/labelsNear.js +234 -0
- package/kits/hub-game/code/client/landscapeLayout.js +17 -0
- package/kits/hub-game/code/client/layoutCache.js +264 -0
- package/kits/hub-game/code/client/loadTelemetry.js +20 -0
- package/kits/hub-game/code/client/loadingCover.js +148 -0
- package/kits/hub-game/code/client/loadingEntry.js +8 -0
- package/kits/hub-game/code/client/menuIcons.js +34 -0
- package/kits/hub-game/code/client/menuRows.js +43 -0
- package/kits/hub-game/code/client/modelReady.js +7 -0
- package/kits/hub-game/code/client/pack.js +6 -2
- package/kits/hub-game/code/client/packFormat.js +3 -3
- package/kits/hub-game/code/client/padCueArrival.js +23 -0
- package/kits/hub-game/code/client/padCues.js +112 -0
- package/kits/hub-game/code/client/padOccupancy.js +88 -0
- package/kits/hub-game/code/client/padReadability.js +26 -0
- package/kits/hub-game/code/client/padRings.js +69 -0
- package/kits/hub-game/code/client/pushVisit.js +14 -0
- package/kits/hub-game/code/client/quality.js +205 -0
- package/kits/hub-game/code/client/qualityEntry.js +55 -0
- package/kits/hub-game/code/client/rehello.js +167 -0
- package/kits/hub-game/code/client/safeLayout.js +338 -0
- package/kits/hub-game/code/client/safeStyle.js +42 -0
- package/kits/hub-game/code/client/say.js +12 -3
- package/kits/hub-game/code/client/shot.js +146 -0
- package/kits/hub-game/code/client/shotFit.js +56 -0
- package/kits/hub-game/code/client/signIn.js +28 -0
- package/kits/hub-game/code/client/sound.js +63 -8
- package/kits/hub-game/code/client/soundscape.js +1151 -0
- package/kits/hub-game/code/client/soundscapeActions.js +99 -0
- package/kits/hub-game/code/client/soundscapeAmbience.js +453 -0
- package/kits/hub-game/code/client/soundscapeBaked.js +143 -0
- package/kits/hub-game/code/client/soundscapeBusker.js +217 -0
- package/kits/hub-game/code/client/soundscapeCourt.js +200 -0
- package/kits/hub-game/code/client/soundscapeCrowd.js +331 -0
- package/kits/hub-game/code/client/soundscapeCues.js +362 -0
- package/kits/hub-game/code/client/soundscapeMap.js +181 -0
- package/kits/hub-game/code/client/soundscapeMarket.js +176 -0
- package/kits/hub-game/code/client/soundscapeMusic.js +126 -0
- package/kits/hub-game/code/client/soundscapeMusicEngine.js +460 -0
- package/kits/hub-game/code/client/soundscapeSimlish.js +737 -0
- package/kits/hub-game/code/client/soundscapeSongs.js +127 -0
- package/kits/hub-game/code/client/soundscapeSongsRound3.js +63 -0
- package/kits/hub-game/code/client/soundscapeSynthesis.js +168 -0
- package/kits/hub-game/code/client/soundscapeUi.js +211 -0
- package/kits/hub-game/code/client/soundscapeVoice.js +1209 -0
- package/kits/hub-game/code/client/soundscapeWaves.js +206 -0
- package/kits/hub-game/code/client/spin.js +101 -0
- package/kits/hub-game/code/client/state.js +162 -1
- package/kits/hub-game/code/client/stuck.js +259 -0
- package/kits/hub-game/code/client/talk.js +714 -59
- package/kits/hub-game/code/client/tiers.js +543 -52
- package/kits/hub-game/code/client/toastBand.js +37 -0
- package/kits/hub-game/code/client/together.js +39 -2
- package/kits/hub-game/code/client/visibility.js +43 -0
- package/kits/hub-game/code/client/weakestLookBake.js +92 -0
- package/kits/hub-game/code/client/weakestTier.js +295 -0
- package/kits/hub-game/code/client/wear.js +461 -170
- package/kits/hub-game/code/client/worldLabels.js +241 -0
- package/kits/hub-game/code/client/yours.js +200 -0
- package/kits/hub-game/code/companionSpec.js +45 -0
- package/kits/hub-game/code/npcDisplayText.js +55 -0
- package/kits/hub-game/code/privateText.js +7 -0
- package/kits/hub-game/code/server/act.js +124 -0
- package/kits/hub-game/code/server/actions.js +138 -0
- package/kits/hub-game/code/server/actors.js +11 -2
- package/kits/hub-game/code/server/analytics.js +83 -0
- package/kits/hub-game/code/server/anonymousEntry.js +49 -0
- package/kits/hub-game/code/server/arrivalPose.js +36 -0
- package/kits/hub-game/code/server/ask.js +155 -0
- package/kits/hub-game/code/server/ballot.js +539 -0
- package/kits/hub-game/code/server/cells.js +100 -0
- package/kits/hub-game/code/server/companion.js +107 -0
- package/kits/hub-game/code/server/cues.js +70 -0
- package/kits/hub-game/code/server/decor.js +269 -0
- package/kits/hub-game/code/server/doorAnalytics.js +52 -0
- package/kits/hub-game/code/server/earned.js +478 -0
- package/kits/hub-game/code/server/frameBatch.js +183 -0
- package/kits/hub-game/code/server/friendBests.js +166 -0
- package/kits/hub-game/code/server/friendsAmong.js +272 -0
- package/kits/hub-game/code/server/history.js +7 -0
- package/kits/hub-game/code/server/hub.js +2510 -95
- package/kits/hub-game/code/server/idle.js +60 -12
- package/kits/hub-game/code/server/index.js +28 -6
- package/kits/hub-game/code/server/invites.js +19 -0
- package/kits/hub-game/code/server/labels.js +36 -2
- package/kits/hub-game/code/server/loadAbandon.js +106 -0
- package/kits/hub-game/code/server/manifest.js +586 -7
- package/kits/hub-game/code/server/menu.js +161 -0
- package/kits/hub-game/code/server/npcs.js +1025 -113
- package/kits/hub-game/code/server/observe.js +408 -0
- package/kits/hub-game/code/server/padOccupancy.js +85 -0
- package/kits/hub-game/code/server/party.js +2 -2
- package/kits/hub-game/code/server/players.js +30 -0
- package/kits/hub-game/code/server/resumePose.js +152 -0
- package/kits/hub-game/code/server/say.js +1 -1
- package/kits/hub-game/code/server/shot.js +110 -0
- package/kits/hub-game/code/server/standing.js +123 -0
- package/kits/hub-game/code/server/storageLimit.js +187 -0
- package/kits/hub-game/code/server/vis.js +175 -0
- package/kits/hub-game/code/server/wear.js +12 -0
- package/kits/hub-game/code/server/yours.js +59 -0
- package/kits/hub-game/code/shared/act.js +35 -0
- package/kits/hub-game/code/shared/cues.js +9 -0
- package/kits/hub-game/code/shared/danceIdle.js +28 -0
- package/kits/hub-game/code/shared/decor.js +41 -0
- package/kits/hub-game/code/shared/loadStages.js +12 -0
- package/kits/hub-game/code/shared/quality.js +74 -0
- package/kits/hub-game/code/shared/say.js +2 -0
- package/kits/hub-game/code/shared/shot.js +53 -0
- package/kits/hub-game/code/shared/spin.js +57 -0
- package/kits/hub-game/code/systems/hub.js +1753 -202
- package/kits/hub-game/docs/analytics.md +279 -0
- package/kits/hub-game/docs/content-pack.md +1 -1
- package/kits/hub-game/docs/contract.md +3475 -77
- package/kits/hub-game/docs/home-pieces.md +71 -0
- package/kits/hub-game/docs/observed-progress.md +252 -0
- package/kits/hub-game/main.jsx +2 -0
- package/kits/hub-game/models/avatar-10.pxmodel +28 -0
- package/kits/hub-game/models/avatar-11.pxmodel +28 -0
- package/kits/hub-game/models/avatar-12.pxmodel +27 -0
- package/kits/hub-game/models/avatar-13.pxmodel +24 -0
- package/kits/hub-game/models/avatar-14.pxmodel +29 -0
- package/kits/hub-game/models/avatar-15.pxmodel +24 -0
- package/kits/hub-game/models/avatar-4.pxmodel +29 -0
- package/kits/hub-game/models/avatar-5.pxmodel +27 -0
- package/kits/hub-game/models/avatar-6.pxmodel +26 -0
- package/kits/hub-game/models/avatar-7.pxmodel +25 -0
- package/kits/hub-game/models/avatar-8.pxmodel +24 -0
- package/kits/hub-game/models/avatar-9.pxmodel +30 -0
- package/kits/hub-game/models/earned/badge-round.pxmodel +100 -0
- package/kits/hub-game/models/earned/badge-shield.pxmodel +117 -0
- package/kits/hub-game/models/earned/badge-star.pxmodel +87 -0
- package/kits/hub-game/models/earned/belt-plain.pxmodel +72 -0
- package/kits/hub-game/models/earned/held-ball.pxmodel +43 -0
- package/kits/hub-game/models/earned/held-lantern.pxmodel +85 -0
- package/kits/hub-game/models/earned/held-net.pxmodel +57 -0
- package/kits/hub-game/models/earned/held-trophy.pxmodel +109 -0
- package/kits/hub-game/models/earned/pin-round.pxmodel +62 -0
- package/kits/hub-game/models/earned/sash-plain.pxmodel +66 -0
- package/kits/hub-game/models/earned/square/belt-plain.pxmodel +104 -0
- package/kits/hub-game/models/earned/square/sash-plain.pxmodel +98 -0
- package/kits/hub-game/models/hats/bat-clip.pxmodel +206 -0
- package/kits/hub-game/models/hats/beekeeper.pxmodel +149 -0
- package/kits/hub-game/models/hats/cap.pxmodel +162 -0
- package/kits/hub-game/models/hats/captain.pxmodel +178 -0
- package/kits/hub-game/models/hats/crooked-top.pxmodel +172 -0
- package/kits/hub-game/models/hats/flower-crown.pxmodel +451 -0
- package/kits/hub-game/models/hats/foam-crown.pxmodel +179 -0
- package/kits/hub-game/models/hats/lantern.pxmodel +230 -0
- package/kits/hub-game/models/hats/laurel.pxmodel +533 -0
- package/kits/hub-game/models/hats/lighthouse.pxmodel +96 -0
- package/kits/hub-game/models/hats/sailor.pxmodel +141 -0
- package/kits/hub-game/models/hats/souwester.pxmodel +131 -0
- package/kits/hub-game/models/hats/straw.pxmodel +139 -0
- package/kits/hub-game/models/hats/sunflower.pxmodel +406 -0
- package/kits/hub-game/models/hats/sweatband.pxmodel +112 -0
- package/kits/hub-game/models/hats/witch.pxmodel +147 -0
- package/kits/hub-game/package-lock.json +10 -1
- package/kits/hub-game/package.json +6 -2
- package/kits/hub-game/play/player.js +142 -0
- package/kits/hub-game/play/registry.js +47 -0
- package/kits/hub-game/play.jsx +37 -0
- package/kits/hub-game/scripts/check.mjs +117 -16
- package/kits/hub-game/scripts/companion-follower-wire.json +1 -0
- package/kits/hub-game/scripts/fixtures/decor-keyless-draw.json +132 -0
- package/kits/hub-game/scripts/fixtures/decor-keyless.json +293 -0
- package/kits/hub-game/scripts/fixtures/engine-models-stub.mjs +26 -0
- package/kits/hub-game/scripts/fixtures/fake-dom.mjs +123 -0
- package/kits/hub-game/scripts/fixtures/interest-legacy.json +385 -0
- package/kits/hub-game/scripts/fixtures/npc-notes-v1.77.jsonl +4 -0
- package/kits/hub-game/scripts/fixtures/vis-shared-wire.json +1 -0
- package/kits/hub-game/scripts/gen-avatars.mjs +933 -16
- package/kits/hub-game/scripts/gen-earned.mjs +285 -0
- package/kits/hub-game/scripts/gen-hats.mjs +827 -0
- package/kits/hub-game/scripts/grab.before-orbit.mjs +400 -0
- package/kits/hub-game/scripts/pose-storage-fixture.mjs +46 -0
- package/kits/hub-game/scripts/soundscape-wave-analysis.mjs +125 -0
- package/kits/hub-game/scripts/test-act-client.mjs +186 -0
- package/kits/hub-game/scripts/test-act.mjs +171 -0
- package/kits/hub-game/scripts/test-action-layout.mjs +80 -0
- package/kits/hub-game/scripts/test-action-observers.mjs +46 -0
- package/kits/hub-game/scripts/test-actions-client.mjs +853 -0
- package/kits/hub-game/scripts/test-actions.mjs +298 -0
- package/kits/hub-game/scripts/test-actor-budget.mjs +44 -0
- package/kits/hub-game/scripts/test-actors.mjs +38 -23
- package/kits/hub-game/scripts/test-analytics.mjs +76 -0
- package/kits/hub-game/scripts/test-anonymous-entry.mjs +28 -0
- package/kits/hub-game/scripts/test-arrival-pose-server.mjs +196 -0
- package/kits/hub-game/scripts/test-arrival-pose.mjs +24 -0
- package/kits/hub-game/scripts/test-ask-client.mjs +358 -0
- package/kits/hub-game/scripts/test-ask-slot.mjs +85 -0
- package/kits/hub-game/scripts/test-ask.mjs +269 -0
- package/kits/hub-game/scripts/test-attention.mjs +10 -1
- package/kits/hub-game/scripts/test-avatar-cap.mjs +379 -0
- package/kits/hub-game/scripts/test-avatar-colors.mjs +72 -0
- package/kits/hub-game/scripts/test-avatar-models.mjs +181 -0
- package/kits/hub-game/scripts/test-avatar-share.mjs +318 -0
- package/kits/hub-game/scripts/test-avatar-wire.mjs +792 -0
- package/kits/hub-game/scripts/test-avatar.mjs +584 -7
- package/kits/hub-game/scripts/test-back-visibility.mjs +82 -0
- package/kits/hub-game/scripts/test-ballot.mjs +1008 -0
- package/kits/hub-game/scripts/test-ban-join.mjs +121 -13
- package/kits/hub-game/scripts/test-build.mjs +49 -0
- package/kits/hub-game/scripts/test-cells.mjs +71 -0
- package/kits/hub-game/scripts/test-chat.mjs +863 -0
- package/kits/hub-game/scripts/test-classic.mjs +2 -0
- package/kits/hub-game/scripts/test-companion-chat.mjs +216 -0
- package/kits/hub-game/scripts/test-companion-client.mjs +1167 -0
- package/kits/hub-game/scripts/test-companion.mjs +259 -0
- package/kits/hub-game/scripts/test-control-layout-dom.mjs +120 -0
- package/kits/hub-game/scripts/test-crowd-names.mjs +205 -0
- package/kits/hub-game/scripts/test-decor-client.mjs +344 -0
- package/kits/hub-game/scripts/test-decor.mjs +464 -0
- package/kits/hub-game/scripts/test-default-environment-root.mjs +95 -0
- package/kits/hub-game/scripts/test-default-environment.mjs +267 -0
- package/kits/hub-game/scripts/test-door-analytics.mjs +58 -0
- package/kits/hub-game/scripts/test-door-jump.mjs +100 -0
- package/kits/hub-game/scripts/test-earned-client.mjs +459 -0
- package/kits/hub-game/scripts/test-earned.mjs +1224 -0
- package/kits/hub-game/scripts/test-emote-bubble.mjs +110 -0
- package/kits/hub-game/scripts/test-far-avatars.mjs +340 -0
- package/kits/hub-game/scripts/test-fps-telemetry.mjs +112 -0
- package/kits/hub-game/scripts/test-frame-batch.mjs +252 -0
- package/kits/hub-game/scripts/test-fresh-friends.mjs +118 -0
- package/kits/hub-game/scripts/test-friend-bests.mjs +435 -0
- package/kits/hub-game/scripts/test-grab-orbit.mjs +961 -0
- package/kits/hub-game/scripts/test-grab.mjs +7 -0
- package/kits/hub-game/scripts/test-hats.mjs +422 -168
- package/kits/hub-game/scripts/test-high-only.mjs +170 -0
- package/kits/hub-game/scripts/test-hub-leaving.mjs +203 -0
- package/kits/hub-game/scripts/test-hub-ops.mjs +758 -2
- package/kits/hub-game/scripts/test-hub-trip.mjs +1594 -12
- package/kits/hub-game/scripts/test-hud-clear.mjs +484 -57
- package/kits/hub-game/scripts/test-hud-defects-dom.mjs +100 -0
- package/kits/hub-game/scripts/test-hud-rate.mjs +224 -0
- package/kits/hub-game/scripts/test-hud-safe-visibility-dom.mjs +83 -0
- package/kits/hub-game/scripts/test-idle.mjs +427 -1
- package/kits/hub-game/scripts/test-interest-cap.mjs +36 -0
- package/kits/hub-game/scripts/test-interest-cells.mjs +513 -0
- package/kits/hub-game/scripts/test-interest-client.mjs +118 -0
- package/kits/hub-game/scripts/test-interest.mjs +15 -0
- package/kits/hub-game/scripts/test-invites-client.mjs +430 -0
- package/kits/hub-game/scripts/test-invites.mjs +109 -0
- package/kits/hub-game/scripts/test-keys.mjs +46 -1
- package/kits/hub-game/scripts/test-labels.mjs +664 -0
- package/kits/hub-game/scripts/test-landscape-layout.mjs +194 -0
- package/kits/hub-game/scripts/test-list-scroll-dom.mjs +49 -0
- package/kits/hub-game/scripts/test-load-abandon.mjs +246 -0
- package/kits/hub-game/scripts/test-loading-cover.mjs +162 -0
- package/kits/hub-game/scripts/test-manifest.mjs +472 -0
- package/kits/hub-game/scripts/test-menu-client.mjs +585 -0
- package/kits/hub-game/scripts/test-menu.mjs +319 -0
- package/kits/hub-game/scripts/test-npcs.mjs +2528 -13
- package/kits/hub-game/scripts/test-object-entry.mjs +76 -0
- package/kits/hub-game/scripts/test-observed.mjs +745 -0
- package/kits/hub-game/scripts/test-pack.mjs +7 -0
- package/kits/hub-game/scripts/test-pad-cues.mjs +304 -0
- package/kits/hub-game/scripts/test-pad-occupancy.mjs +177 -0
- package/kits/hub-game/scripts/test-picker.mjs +541 -0
- package/kits/hub-game/scripts/test-placement-cache.mjs +690 -0
- package/kits/hub-game/scripts/test-progress-reset.mjs +559 -0
- package/kits/hub-game/scripts/test-push-visit.mjs +26 -0
- package/kits/hub-game/scripts/test-quality.mjs +385 -0
- package/kits/hub-game/scripts/test-rehello.mjs +1733 -0
- package/kits/hub-game/scripts/test-relations-among.mjs +222 -0
- package/kits/hub-game/scripts/test-relations-refresh.mjs +188 -0
- package/kits/hub-game/scripts/test-resume-action-order.mjs +598 -0
- package/kits/hub-game/scripts/test-resume-held.mjs +239 -0
- package/kits/hub-game/scripts/test-resume-pose.mjs +142 -0
- package/kits/hub-game/scripts/test-safe-events-dom.mjs +116 -0
- package/kits/hub-game/scripts/test-safe-layout.mjs +330 -0
- package/kits/hub-game/scripts/test-say.mjs +1 -1
- package/kits/hub-game/scripts/test-shot.mjs +901 -0
- package/kits/hub-game/scripts/test-signin-client.mjs +45 -0
- package/kits/hub-game/scripts/test-soundscape.mjs +5437 -0
- package/kits/hub-game/scripts/test-spin.mjs +314 -0
- package/kits/hub-game/scripts/test-standing.mjs +449 -0
- package/kits/hub-game/scripts/test-storage-limit.mjs +333 -0
- package/kits/hub-game/scripts/test-stuck.mjs +1904 -0
- package/kits/hub-game/scripts/test-talk-overlay-dom.mjs +130 -0
- package/kits/hub-game/scripts/test-tier-cells.mjs +706 -0
- package/kits/hub-game/scripts/test-tiers-render.mjs +412 -0
- package/kits/hub-game/scripts/test-tiers.mjs +476 -2
- package/kits/hub-game/scripts/test-toast-band.mjs +61 -0
- package/kits/hub-game/scripts/test-try-on.mjs +22 -22
- package/kits/hub-game/scripts/test-vis.mjs +770 -0
- package/kits/hub-game/scripts/test-visibility.mjs +134 -0
- package/kits/hub-game/scripts/test-weakest-tier.mjs +924 -0
- package/kits/hub-game/scripts/test-world-labels.mjs +367 -0
- package/kits/hub-game/scripts/test-yours-chrome.mjs +210 -0
- package/kits/hub-game/scripts/test-yours.mjs +403 -0
- package/kits/multiplayer-3d/CLAUDE.md +50 -0
- package/kits/multiplayer-3d/castle.json +5 -5
- package/kits/multiplayer-3d/code/client/avatars.js +7 -0
- package/kits/multiplayer-3d/code/client/gait.js +65 -0
- package/kits/multiplayer-3d/code/client/joinFailure.js +27 -0
- package/kits/multiplayer-3d/code/client/nameTags.js +59 -4
- package/kits/multiplayer-3d/code/client/resumeGate.js +139 -0
- package/kits/multiplayer-3d/code/options.js +5 -0
- package/kits/multiplayer-3d/code/server/ownership.js +10 -2
- package/kits/multiplayer-3d/code/server/sceneBodies.js +12 -0
- package/kits/multiplayer-3d/code/server/world.js +7 -0
- package/kits/multiplayer-3d/code/systems/multiplayer.js +443 -34
- package/kits/multiplayer-3d/package-lock.json +8 -1
- package/kits/multiplayer-3d/package.json +3 -1
- package/kits/multiplayer-3d/scripts/fixtures/README.md +11 -0
- package/kits/multiplayer-3d/scripts/fixtures/ownership-legacy.json +2 -0
- package/kits/multiplayer-3d/scripts/ownership-harness.mjs +102 -0
- package/kits/multiplayer-3d/scripts/ownership-loader.mjs +46 -0
- package/kits/multiplayer-3d/scripts/ownership-worker.mjs +15 -0
- package/kits/multiplayer-3d/scripts/record-ownership-session.mjs +98 -0
- package/kits/multiplayer-3d/scripts/test-eligible-claims.mjs +167 -0
- package/kits/multiplayer-3d/scripts/test-join-watchdog.mjs +436 -0
- package/kits/multiplayer-3d/scripts/test-own-name-tag.mjs +247 -0
- package/kits/multiplayer-3d/scripts/test-resume-gate.mjs +624 -0
- package/kits/physics-2d/CLAUDE.md +19 -1
- package/kits/physics-2d/castle.json +2 -2
- package/kits/physics-2d/engine/frozenActors.js +233 -0
- package/kits/physics-2d/engine/scene.js +337 -3
- package/kits/physics-2d/engine/skyKey.js +129 -0
- package/kits/physics-2d/engine/stillClock.js +106 -0
- package/kits/physics-2d/engine/updateBudget.js +21 -0
- package/kits/physics-2d/eslint.config.js +1 -1
- package/kits/physics-2d/play/behaviors/AnalogStick.js +198 -0
- package/kits/physics-2d/play/behaviors/Camera.js +40 -0
- package/kits/physics-2d/play/behaviors/Collider.js +122 -0
- package/kits/physics-2d/play/behaviors/Draggable.js +115 -0
- package/kits/physics-2d/play/behaviors/Goal.js +46 -0
- package/kits/physics-2d/play/behaviors/Joints.js +126 -0
- package/kits/physics-2d/play/behaviors/Layout.js +71 -0
- package/kits/physics-2d/play/behaviors/RigidBody.js +57 -0
- package/kits/physics-2d/play/behaviors/Slingshot.js +142 -0
- package/kits/physics-2d/play/behaviors/SoundPlayer.js +263 -0
- package/kits/physics-2d/play/behaviors/Sprite.js +406 -0
- package/kits/physics-2d/play/behaviors/Style.js +209 -0
- package/kits/physics-2d/play/behaviors/Text.js +85 -0
- package/kits/physics-2d/play/behaviors/Video.js +93 -0
- package/kits/physics-2d/scripts/test-skip-unchanged.mjs +326 -1
- package/kits/physics-3d/CLAUDE.md +42 -529
- package/kits/physics-3d/behaviors/Body.jsx +3 -0
- package/kits/physics-3d/behaviors/Model.jsx +3 -0
- package/kits/physics-3d/behaviors/Player.jsx +661 -87
- package/kits/physics-3d/behaviors/Shape.jsx +3 -0
- package/kits/physics-3d/behaviors/Solid.jsx +3 -0
- package/kits/physics-3d/behaviors/Transform.jsx +3 -0
- package/kits/physics-3d/castle.json +3 -3
- package/kits/physics-3d/docs/engine-camera.md +542 -0
- package/kits/physics-3d/docs/engine-frame-cap.md +136 -0
- package/kits/physics-3d/docs/engine-load.md +149 -0
- package/kits/physics-3d/docs/engine-look.md +114 -0
- package/kits/physics-3d/docs/engine-shadows.md +372 -0
- package/kits/physics-3d/docs/engine-skip-work.md +187 -0
- package/kits/physics-3d/docs/engine-sky.md +198 -0
- package/kits/physics-3d/docs/engine-static-actors.md +226 -0
- package/kits/physics-3d/docs/engine-view.md +37 -0
- package/kits/physics-3d/docs/pxmodel-format.md +9 -1
- package/kits/physics-3d/engine3d/PlayOnly3D.jsx +5 -1
- package/kits/physics-3d/engine3d/Scene3DPlayer.jsx +19 -277
- package/kits/physics-3d/engine3d/actornode.js +87 -0
- package/kits/physics-3d/engine3d/animationBudget.js +23 -0
- package/kits/physics-3d/engine3d/branches.js +3 -13
- package/kits/physics-3d/engine3d/cage.js +2 -7
- package/kits/physics-3d/engine3d/cageops.js +2 -17
- package/kits/physics-3d/engine3d/dataBehaviors.js +12 -0
- package/kits/physics-3d/engine3d/editorWorld.js +6 -0
- package/kits/physics-3d/engine3d/emptynodes.js +232 -0
- package/kits/physics-3d/engine3d/framecap.js +99 -0
- package/kits/physics-3d/engine3d/frozenphysics.js +140 -0
- package/kits/physics-3d/engine3d/frozenstatics.js +273 -0
- package/kits/physics-3d/engine3d/gait.js +126 -0
- package/kits/physics-3d/engine3d/initialModelFiles.js +18 -0
- package/kits/physics-3d/engine3d/kithooks.js +47 -0
- package/kits/physics-3d/engine3d/look.js +514 -48
- package/kits/physics-3d/engine3d/lookbake.js +208 -0
- package/kits/physics-3d/engine3d/materialpresets.js +2 -0
- package/kits/physics-3d/engine3d/modelFiles.js +3 -17
- package/kits/physics-3d/engine3d/modelMath.js +49 -0
- package/kits/physics-3d/engine3d/modelready.js +16 -0
- package/kits/physics-3d/engine3d/motion.js +39 -10
- package/kits/physics-3d/engine3d/nearshadows.js +106 -21
- package/kits/physics-3d/engine3d/optimize.js +9 -5
- package/kits/physics-3d/engine3d/orbitinput.js +522 -10
- package/kits/physics-3d/engine3d/orbitlens.js +48 -0
- package/kits/physics-3d/engine3d/ownmodel.js +213 -0
- package/kits/physics-3d/engine3d/partgeometry.js +1 -16
- package/kits/physics-3d/engine3d/paths.js +1 -9
- package/kits/physics-3d/engine3d/playTimings.js +50 -0
- package/kits/physics-3d/engine3d/playerRun.js +372 -0
- package/kits/physics-3d/engine3d/pxmodel.js +42 -11
- package/kits/physics-3d/engine3d/rapier.js +27 -0
- package/kits/physics-3d/engine3d/scatter.js +1 -11
- package/kits/physics-3d/engine3d/shadowfade.js +890 -0
- package/kits/physics-3d/engine3d/sky.js +547 -0
- package/kits/physics-3d/engine3d/skylife.js +306 -0
- package/kits/physics-3d/engine3d/squarefirst.js +177 -0
- package/kits/physics-3d/engine3d/stillshadows.js +399 -0
- package/kits/physics-3d/engine3d/sweep.js +1 -25
- package/kits/physics-3d/engine3d/unchanged.js +11 -0
- package/kits/physics-3d/engine3d/viewrange.js +52 -0
- package/kits/physics-3d/engine3d/world3d.js +1253 -76
- package/kits/physics-3d/eslint.config.js +2 -1
- package/kits/physics-3d/main.jsx +10 -2
- package/kits/physics-3d/package-lock.json +7 -0
- package/kits/physics-3d/package.json +5 -1
- package/kits/physics-3d/play/behaviors/Body.js +31 -0
- package/kits/physics-3d/play/behaviors/Door.js +37 -0
- package/kits/physics-3d/play/behaviors/Lookable.js +16 -0
- package/kits/physics-3d/play/behaviors/Model.js +23 -0
- package/kits/physics-3d/play/behaviors/Pickup.js +46 -0
- package/kits/physics-3d/play/behaviors/Player.js +1204 -0
- package/kits/physics-3d/play/behaviors/Shape.js +47 -0
- package/kits/physics-3d/play/behaviors/Solid.js +16 -0
- package/kits/physics-3d/play/behaviors/Transform.js +29 -0
- package/kits/physics-3d/pnpm-lock.yaml +8 -0
- package/kits/physics-3d/scripts/bench-shadow-fade.mjs +37 -0
- package/kits/physics-3d/scripts/build-rapier-gz.mjs +56 -0
- package/kits/physics-3d/scripts/frozen-statics-fixture.mjs +141 -0
- package/kits/physics-3d/scripts/look-baseline.mjs +155 -0
- package/kits/physics-3d/scripts/test-camera-follow.mjs +5 -1
- package/kits/physics-3d/scripts/test-camera-orbit.mjs +2613 -82
- package/kits/physics-3d/scripts/test-drop-empty-parts.mjs +2 -2
- package/kits/physics-3d/scripts/test-empty-gait-hints.mjs +89 -0
- package/kits/physics-3d/scripts/test-frame-cap-bob.mjs +438 -0
- package/kits/physics-3d/scripts/test-frame-cap.mjs +452 -0
- package/kits/physics-3d/scripts/test-frozen-nested.mjs +49 -0
- package/kits/physics-3d/scripts/test-frozen-statics-legacy-physics2d.mjs +123 -0
- package/kits/physics-3d/scripts/test-frozen-statics.mjs +434 -0
- package/kits/physics-3d/scripts/test-gait.mjs +387 -0
- package/kits/physics-3d/scripts/test-look-bake.mjs +1056 -0
- package/kits/physics-3d/scripts/test-model-parse-cache.mjs +92 -0
- package/kits/physics-3d/scripts/test-near-shadows.mjs +5 -2
- package/kits/physics-3d/scripts/test-orbit-shadow-fade.mjs +2001 -0
- package/kits/physics-3d/scripts/test-orbit-shift-lock.mjs +582 -0
- package/kits/physics-3d/scripts/test-orbit-shot.mjs +657 -0
- package/kits/physics-3d/scripts/test-orbit-view.mjs +230 -0
- package/kits/physics-3d/scripts/test-rapier-gz.mjs +106 -0
- package/kits/physics-3d/scripts/test-skip-empty-nodes.mjs +845 -0
- package/kits/physics-3d/scripts/test-sky.mjs +2470 -0
- package/kits/physics-3d/scripts/test-square-first.mjs +921 -0
- package/kits/physics-3d/scripts/test-static-actors.mjs +10 -1
- package/kits/physics-3d/scripts/test-static-physics.mjs +4 -1
- package/kits/physics-3d/scripts/test-static-scenery.mjs +2174 -0
- package/kits/physics-3d/scripts/test-steady-hover.mjs +7 -2
- package/kits/physics-3d/scripts/test-still-shadows.mjs +477 -0
- package/kits/physics-3d/scripts/test-view-range.mjs +260 -0
- package/kits/physics-3d/systems/physics3d.js +419 -9
- package/kits/real-time/castle.json +2 -2
- package/kits/real-time/code/client/connection.js +33 -10
- package/kits/real-time/code/client/gameHooks.js +2 -0
- package/kits/real-time/code/client/joinOverlay.js +9 -4
- package/kits/real-time/code/server/gameHooks.js +7 -0
- package/kits/real-time/code/server/session.js +102 -22
- package/kits/real-time/package-lock.json +1 -1
- package/package.json +2 -2
- package/dist/shell/assets/index-Cf61cNfT.css +0 -1
|
@@ -109,9 +109,12 @@ const hooks = `
|
|
|
109
109
|
const fake = 'data:text/javascript,' + encodeURIComponent(${JSON.stringify(fakeRapier)});
|
|
110
110
|
const real = ${JSON.stringify(realRapier)};
|
|
111
111
|
export async function resolve(specifier, context, next) {
|
|
112
|
+
const isRapier = specifier === '@dimforge/rapier3d-compat' ||
|
|
113
|
+
((specifier.startsWith('.') || specifier.startsWith('file:')) &&
|
|
114
|
+
new URL(specifier, context.parentURL).href.endsWith('/kits/physics-3d/engine3d/rapier.js'));
|
|
112
115
|
const parent = context.parentURL ?? '';
|
|
113
|
-
if (
|
|
114
|
-
if (
|
|
116
|
+
if (isRapier && parent.endsWith('?steady-fake')) return { url: fake, shortCircuit: true };
|
|
117
|
+
if (isRapier && parent.endsWith('?steady-real')) return { url: real, shortCircuit: true };
|
|
115
118
|
// This file's own copies of the physics system, one per rapier; settled
|
|
116
119
|
// here so no other test's hooks rewrite the address.
|
|
117
120
|
if (/\\?steady-(fake|real)$/.test(specifier)) return { url: new URL(specifier, parent).href, shortCircuit: true };
|
|
@@ -257,6 +260,8 @@ async function makeWorld(Physics3DSystem, mode) {
|
|
|
257
260
|
persistent: {},
|
|
258
261
|
three: null,
|
|
259
262
|
cameraFollowsRigidly: mode === 'steady',
|
|
263
|
+
// What SceneRuntime has without `engine.maxFps`.
|
|
264
|
+
maxFps: 0,
|
|
260
265
|
skipsUnchangedActors: false,
|
|
261
266
|
data: {},
|
|
262
267
|
actors: [newPlayer()],
|
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
// Real r180 WebGLRenderer, shadow pass, render lists, and shader compilation
|
|
2
|
+
// over the existing fake WebGL2 context. A tiny software depth target also
|
|
3
|
+
// checks copy/clear ordering, overlapping casters, and departed movers.
|
|
4
|
+
import assert from 'node:assert/strict';
|
|
5
|
+
import * as THREE from 'three';
|
|
6
|
+
import { makeWorld, makeStuff, runtime, frames } from './test-orbit-shadow-fade.mjs';
|
|
7
|
+
import { ActorNode, freezeWhenUnchanged, isFrozen } from '../engine3d/actornode.js';
|
|
8
|
+
import { StillKeeper } from '../../physics-2d/engine/stillClock.js';
|
|
9
|
+
import { STABLE_FRAMES } from '../engine3d/stillshadows.js';
|
|
10
|
+
const { renderWorld, disposeWorld } = await import('../engine3d/world3d.js');
|
|
11
|
+
const { dropNearShadows: dropNearShadowsForTest } = await import('../engine3d/nearshadows.js');
|
|
12
|
+
const WARMUP = STABLE_FRAMES + 1; // Includes near shadows' first plain frame.
|
|
13
|
+
|
|
14
|
+
function setup(options = {}) {
|
|
15
|
+
const { orbit = false } = options;
|
|
16
|
+
const key = Object.hasOwn(options, 'key') ? options.key : true;
|
|
17
|
+
const world = makeWorld(makeStuff());
|
|
18
|
+
const run = runtime(world, { orbit, distance: 40 });
|
|
19
|
+
if (key !== undefined) run.data.engine.shadows.cacheStill = key;
|
|
20
|
+
run.stillVersion = 1;
|
|
21
|
+
run.keepsStaticActors = true;
|
|
22
|
+
let clock = 1;
|
|
23
|
+
Object.assign(world.skipping, { on: true, epoch: 1, clock: () => clock, clockAt: clock });
|
|
24
|
+
world.stillKeeper = new StillKeeper();
|
|
25
|
+
const mesh = world.scene.getObjectByName('standard');
|
|
26
|
+
const mover = world.scene.getObjectByName('physical');
|
|
27
|
+
const node = new ActorNode(world.skipping);
|
|
28
|
+
world.scene.remove(mesh);
|
|
29
|
+
node.add(mesh);
|
|
30
|
+
world.scene.add(node);
|
|
31
|
+
const freeze = () => {
|
|
32
|
+
world.stillKeeper.adopted = { version: run.stillVersion };
|
|
33
|
+
world.skipping.clockAt = clock;
|
|
34
|
+
world.scene.updateMatrixWorld();
|
|
35
|
+
freezeWhenUnchanged(node);
|
|
36
|
+
world.scene.updateMatrixWorld();
|
|
37
|
+
assert.ok(isFrozen(node));
|
|
38
|
+
};
|
|
39
|
+
freeze();
|
|
40
|
+
const events = [];
|
|
41
|
+
const pixels = new Map();
|
|
42
|
+
const direct = world.renderer.renderBufferDirect;
|
|
43
|
+
const clear = world.renderer.clear;
|
|
44
|
+
world.renderer.clear = function (...args) {
|
|
45
|
+
const target = this.getRenderTarget();
|
|
46
|
+
pixels.set(target, [1, 1]);
|
|
47
|
+
events.push({ clear: target });
|
|
48
|
+
return clear.apply(this, args);
|
|
49
|
+
};
|
|
50
|
+
mesh.userData.testPixel = [0, 0.3];
|
|
51
|
+
mover.userData.testPixel = [0, 0.2];
|
|
52
|
+
world.renderer.renderBufferDirect = function (camera, scene, geometry, material, object, group) {
|
|
53
|
+
const target = this.getRenderTarget();
|
|
54
|
+
const copy = material.uniforms?.cachedDepth !== undefined;
|
|
55
|
+
events.push({ target, object, material, copy });
|
|
56
|
+
if (copy) pixels.set(target, [...pixels.get(world.nearShadows.shadow.stillCache.shadow.map)]);
|
|
57
|
+
if (material.isMeshDepthMaterial && object.userData.testPixel) {
|
|
58
|
+
const [pixel, depth] = object.userData.testPixel;
|
|
59
|
+
const image = pixels.get(target);
|
|
60
|
+
image[pixel] = Math.min(image[pixel], depth);
|
|
61
|
+
}
|
|
62
|
+
return direct.call(this, camera, scene, geometry, material, object, group);
|
|
63
|
+
};
|
|
64
|
+
const step = (count = 1) => {
|
|
65
|
+
for (let i = 0; i < count; i++) {
|
|
66
|
+
events.length = 0;
|
|
67
|
+
frames(world, run, 1);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const touch = () => { clock += 1; run.stillVersion += 1; };
|
|
71
|
+
return { world, run, mesh, mover, node, freeze, step, touch, events, pixels };
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const cacheOf = side => side.world.nearShadows?.shadow?.stillCache;
|
|
75
|
+
const shadowDraws = side => side.events.filter(event => event.material?.isMeshDepthMaterial);
|
|
76
|
+
const ownState = sun => [sun.shadow, sun.shadow.camera.matrixWorld.clone(), sun.shadow.matrix.clone(), sun.target.matrixWorld.clone()];
|
|
77
|
+
|
|
78
|
+
const scenarios = {
|
|
79
|
+
'three consecutive matching frames qualify; misses draw only the ordinary pass'() {
|
|
80
|
+
const side = setup();
|
|
81
|
+
side.step();
|
|
82
|
+
for (let frame = 1; frame <= STABLE_FRAMES; frame++) {
|
|
83
|
+
side.step();
|
|
84
|
+
const cache = cacheOf(side);
|
|
85
|
+
assert.equal(cache.valid, frame === STABLE_FRAMES);
|
|
86
|
+
assert.equal(side.events.filter(draw => draw.copy).length, frame === STABLE_FRAMES ? 1 : 0);
|
|
87
|
+
assert.equal(shadowDraws(side).filter(draw => draw.object === side.mesh).length, 1);
|
|
88
|
+
assert.equal(shadowDraws(side).filter(draw => draw.object === side.mover).length, 1);
|
|
89
|
+
if (frame < STABLE_FRAMES) assert.equal(cache.shadow.map, null, 'pending frames allocate no still target');
|
|
90
|
+
}
|
|
91
|
+
side.step();
|
|
92
|
+
assert.ok(!shadowDraws(side).some(draw => draw.object === side.mesh));
|
|
93
|
+
assert.equal(side.events.filter(draw => draw.copy).length, 1);
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
'layer 1 uploads the copy geometry and keeps still shadows on a hit'() {
|
|
97
|
+
const side = setup();
|
|
98
|
+
side.world.camera.layers.set(1);
|
|
99
|
+
side.world.scene.traverse(object => object.layers.set(1));
|
|
100
|
+
side.step(WARMUP);
|
|
101
|
+
const cache = cacheOf(side);
|
|
102
|
+
assert.ok(cache.valid);
|
|
103
|
+
assert.ok(cache.triangle.layers.test(side.world.camera.layers));
|
|
104
|
+
assert.equal(side.world.renderer.info.memory.geometries, 3, 'the camera walk uploaded the copy geometry');
|
|
105
|
+
side.step();
|
|
106
|
+
assert.equal(side.events.filter(draw => draw.copy).length, 1);
|
|
107
|
+
assert.ok(!shadowDraws(side).some(draw => draw.object === side.mesh));
|
|
108
|
+
assert.deepEqual(side.pixels.get(side.world.nearShadows.shadow.map), [0.2, 1]);
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
'nested renders with another camera or scene bypass the primary cache'() {
|
|
112
|
+
for (const kind of ['camera', 'scene']) {
|
|
113
|
+
const side = setup();
|
|
114
|
+
side.world.scene.children.find(object => object.isDirectionalLight).layers.enableAll();
|
|
115
|
+
let renderScene = side.world.scene;
|
|
116
|
+
let renderCamera = side.world.camera;
|
|
117
|
+
const secondary = new THREE.Mesh(new THREE.BoxGeometry(), new THREE.MeshStandardMaterial());
|
|
118
|
+
secondary.name = 'secondary-only';
|
|
119
|
+
secondary.castShadow = true;
|
|
120
|
+
if (kind === 'camera') {
|
|
121
|
+
secondary.layers.set(1);
|
|
122
|
+
side.world.scene.add(secondary);
|
|
123
|
+
renderCamera = side.world.camera.clone();
|
|
124
|
+
renderCamera.layers.set(1);
|
|
125
|
+
} else {
|
|
126
|
+
renderScene = new THREE.Scene();
|
|
127
|
+
renderScene.add(secondary);
|
|
128
|
+
// Render the same sun, without reparenting or changing the primary
|
|
129
|
+
// scene. This isolates scene identity from camera identity.
|
|
130
|
+
renderScene.children.push(side.world.scene.children.find(object => object.isDirectionalLight));
|
|
131
|
+
}
|
|
132
|
+
side.step(WARMUP);
|
|
133
|
+
const cache = cacheOf(side);
|
|
134
|
+
const primaryKey = cache.was.slice();
|
|
135
|
+
const nested = [];
|
|
136
|
+
const direct = side.world.renderer.renderBufferDirect;
|
|
137
|
+
let inside = false;
|
|
138
|
+
side.world.renderer.renderBufferDirect = function (...args) {
|
|
139
|
+
if (inside) nested.push({ object: args[4], depth: args[3].isMeshDepthMaterial, copy: args[3] === cache.material });
|
|
140
|
+
return direct.apply(this, args);
|
|
141
|
+
};
|
|
142
|
+
let once = true;
|
|
143
|
+
side.world.scene.getObjectByName('ground').onBeforeRender = () => {
|
|
144
|
+
if (!once) return;
|
|
145
|
+
once = false;
|
|
146
|
+
inside = true;
|
|
147
|
+
try { side.world.renderer.render(renderScene, renderCamera); }
|
|
148
|
+
finally { inside = false; }
|
|
149
|
+
};
|
|
150
|
+
side.step();
|
|
151
|
+
assert.ok(nested.some(draw => draw.depth && draw.object === secondary), `${kind}: the actual render's caster draws`);
|
|
152
|
+
assert.ok(!nested.some(draw => draw.copy), `${kind}: no cached primary depths are copied`);
|
|
153
|
+
assert.ok(!nested.some(draw => draw.depth && draw.object === side.mesh), `${kind}: primary-only scenery stays out`);
|
|
154
|
+
assert.deepEqual(cache.was, primaryKey, `${kind}: secondary rendering does not change the primary candidate`);
|
|
155
|
+
assert.ok(cache.valid);
|
|
156
|
+
side.step();
|
|
157
|
+
assert.equal(side.events.filter(draw => draw.copy).length, 1, `${kind}: primary cache still hits`);
|
|
158
|
+
assert.ok(!shadowDraws(side).some(draw => draw.object === side.mesh));
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
'ten moving frames never add depth draws or copies, from cold and warm caches'() {
|
|
163
|
+
for (const warm of [false, true]) {
|
|
164
|
+
const side = setup();
|
|
165
|
+
const plain = setup({ key: false });
|
|
166
|
+
side.step(warm ? WARMUP : 2);
|
|
167
|
+
plain.step(warm ? WARMUP : 2);
|
|
168
|
+
const cache = cacheOf(side);
|
|
169
|
+
const target = cache.shadow.map;
|
|
170
|
+
const geometries = side.world.renderer.info.memory.geometries;
|
|
171
|
+
const buffers = new Set([cache.now, cache.was]);
|
|
172
|
+
const casters = cache.casters;
|
|
173
|
+
const flags = cache.stillFlags;
|
|
174
|
+
// Guard against allocating a descriptor for every caster in every
|
|
175
|
+
// key computation, as well as replacing the reusable key buffers.
|
|
176
|
+
let collecting = 0;
|
|
177
|
+
let descriptors = 0;
|
|
178
|
+
const collect = cache.collect;
|
|
179
|
+
const descriptor = Object.getOwnPropertyDescriptor;
|
|
180
|
+
cache.collect = function (...args) {
|
|
181
|
+
collecting++;
|
|
182
|
+
try { return collect.apply(this, args); } finally { collecting--; }
|
|
183
|
+
};
|
|
184
|
+
Object.getOwnPropertyDescriptor = function (...args) {
|
|
185
|
+
if (collecting) descriptors++;
|
|
186
|
+
return descriptor(...args);
|
|
187
|
+
};
|
|
188
|
+
let cachedDraws = 0;
|
|
189
|
+
let plainDraws = 0;
|
|
190
|
+
try {
|
|
191
|
+
for (let frame = 0; frame < 10; frame++) {
|
|
192
|
+
side.world.camera.position.x += 1;
|
|
193
|
+
plain.world.camera.position.x += 1;
|
|
194
|
+
side.step();
|
|
195
|
+
plain.step();
|
|
196
|
+
cachedDraws += shadowDraws(side).length;
|
|
197
|
+
plainDraws += shadowDraws(plain).length;
|
|
198
|
+
assert.equal(shadowDraws(side).length, shadowDraws(plain).length, `frame ${frame}: ordinary depth draws only`);
|
|
199
|
+
assert.equal(side.events.filter(draw => draw.copy).length, 0);
|
|
200
|
+
assert.ok(!cache.valid);
|
|
201
|
+
assert.ok(buffers.has(cache.now) && buffers.has(cache.was));
|
|
202
|
+
assert.equal(cache.casters, casters);
|
|
203
|
+
assert.equal(cache.stillFlags, flags);
|
|
204
|
+
}
|
|
205
|
+
} finally {
|
|
206
|
+
Object.getOwnPropertyDescriptor = descriptor;
|
|
207
|
+
}
|
|
208
|
+
assert.equal(descriptors, 0);
|
|
209
|
+
assert.ok(cachedDraws <= plainDraws);
|
|
210
|
+
assert.equal(cache.shadow.map, target, 'moving frames never allocate or rebuild the still target');
|
|
211
|
+
assert.equal(side.world.renderer.info.memory.geometries, geometries);
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
'still depths reuse; movers update, overlap, and leave no trails'() {
|
|
216
|
+
const side = setup();
|
|
217
|
+
side.step(); // the ordinary warm-up frame
|
|
218
|
+
const sun = side.world.sun;
|
|
219
|
+
const own = ownState(sun);
|
|
220
|
+
side.step(STABLE_FRAMES);
|
|
221
|
+
const near = side.world.nearShadows.shadow;
|
|
222
|
+
const cache = cacheOf(side);
|
|
223
|
+
assert.ok(cache.valid);
|
|
224
|
+
assert.equal(shadowDraws(side).filter(draw => draw.object === side.mesh).length, 1);
|
|
225
|
+
assert.deepEqual(side.pixels.get(near.map), [0.2, 1]);
|
|
226
|
+
for (let i = 0; i < 4; i++) {
|
|
227
|
+
side.step();
|
|
228
|
+
assert.equal(shadowDraws(side).filter(draw => draw.object === side.mesh).length, 0);
|
|
229
|
+
assert.equal(shadowDraws(side).filter(draw => draw.object === side.mover).length, 1);
|
|
230
|
+
assert.equal(side.events.filter(draw => draw.copy).length, 1);
|
|
231
|
+
}
|
|
232
|
+
side.mover.userData.testPixel = [1, 0.4];
|
|
233
|
+
side.mover.position.x += 0.2;
|
|
234
|
+
side.step();
|
|
235
|
+
assert.deepEqual(side.pixels.get(near.map), [0.3, 0.4], 'old mover depth is cleared by the next seed');
|
|
236
|
+
side.mover.userData.testPixel = [0, 0.7];
|
|
237
|
+
side.step();
|
|
238
|
+
assert.deepEqual(side.pixels.get(near.map), [0.3, 1], 'a mover behind scenery loses the hardware depth test');
|
|
239
|
+
assert.deepEqual(ownState(sun), own, 'the sun and its original shadow stay unchanged');
|
|
240
|
+
assert.ok(side.mesh.castShadow && side.mover.castShadow);
|
|
241
|
+
assert.equal(cache.triangle.parent, null);
|
|
242
|
+
assert.equal(cache.material.depthFunc, THREE.AlwaysDepth);
|
|
243
|
+
assert.ok(side.world.gl.sources.some(source => source.includes('gl_FragDepth = texture2D(cachedDepth, vUv).x')));
|
|
244
|
+
assert.equal(side.world.renderer.info.memory.geometries, 3, 'the copy geometry was uploaded by the ordinary object walk');
|
|
245
|
+
},
|
|
246
|
+
|
|
247
|
+
'subtexel motion reuses; box/light/lens and still-version changes invalidate'() {
|
|
248
|
+
const side = setup();
|
|
249
|
+
side.step(WARMUP);
|
|
250
|
+
const cache = cacheOf(side);
|
|
251
|
+
const original = cache.shadow.map;
|
|
252
|
+
side.world.camera.position.x += 1e-7;
|
|
253
|
+
side.step();
|
|
254
|
+
assert.ok(!shadowDraws(side).some(draw => draw.object === side.mesh));
|
|
255
|
+
for (const change of [
|
|
256
|
+
() => { side.world.camera.position.x += 2; },
|
|
257
|
+
() => { side.world.sun.position.x += 1; },
|
|
258
|
+
() => { side.world.sun.target.position.y += 0.1; side.world.sun.target.updateMatrixWorld(); },
|
|
259
|
+
() => { side.run.stillVersion += 1; side.world.stillKeeper.adopted.version = side.run.stillVersion; },
|
|
260
|
+
() => { side.world.scene.position.x += 1; },
|
|
261
|
+
() => { side.mesh.material.side = THREE.DoubleSide; },
|
|
262
|
+
]) {
|
|
263
|
+
change();
|
|
264
|
+
side.step();
|
|
265
|
+
assert.ok(shadowDraws(side).some(draw => draw.object === side.mesh), 'a changed key draws the ordinary pass');
|
|
266
|
+
assert.equal(side.events.filter(draw => draw.copy).length, 0, 'a miss never copies or rebuilds');
|
|
267
|
+
assert.equal(cache.valid, false);
|
|
268
|
+
assert.equal(cache.shadow.map, original, 'invalidation reuses storage');
|
|
269
|
+
side.step(STABLE_FRAMES - 1);
|
|
270
|
+
assert.ok(cache.valid && shadowDraws(side).some(draw => draw.object === side.mesh && draw.target === original), 'the settled key rebuilds');
|
|
271
|
+
}
|
|
272
|
+
let freed = 0;
|
|
273
|
+
original.addEventListener('dispose', () => { freed++; });
|
|
274
|
+
side.world.camera.aspect = 2;
|
|
275
|
+
side.world.camera.updateProjectionMatrix();
|
|
276
|
+
side.step();
|
|
277
|
+
assert.equal(freed, 1, 'a resized map is disposed');
|
|
278
|
+
assert.equal(cacheOf(side).shadow.map, null, 'a resize miss draws normally');
|
|
279
|
+
side.freeze();
|
|
280
|
+
side.step(STABLE_FRAMES);
|
|
281
|
+
assert.ok(cacheOf(side).valid);
|
|
282
|
+
assert.notEqual(cacheOf(side).shadow.map, original);
|
|
283
|
+
},
|
|
284
|
+
|
|
285
|
+
'touch/thaw, animation, spawn, visibility, and caster removal are followed'() {
|
|
286
|
+
const side = setup();
|
|
287
|
+
side.step(WARMUP);
|
|
288
|
+
side.touch();
|
|
289
|
+
side.mesh.position.x += 0.4;
|
|
290
|
+
side.step();
|
|
291
|
+
assert.ok(!isFrozen(side.node));
|
|
292
|
+
assert.ok(shadowDraws(side).some(draw => draw.object === side.mesh && draw.target === side.world.nearShadows.shadow.map));
|
|
293
|
+
side.freeze();
|
|
294
|
+
side.step(STABLE_FRAMES + 1);
|
|
295
|
+
assert.ok(!shadowDraws(side).some(draw => draw.object === side.mesh));
|
|
296
|
+
side.mesh.morphTargetInfluences = [0.5];
|
|
297
|
+
side.step();
|
|
298
|
+
assert.ok(shadowDraws(side).some(draw => draw.object === side.mesh));
|
|
299
|
+
delete side.mesh.morphTargetInfluences;
|
|
300
|
+
side.step(STABLE_FRAMES);
|
|
301
|
+
side.mesh.visible = false;
|
|
302
|
+
side.step();
|
|
303
|
+
assert.equal(side.events.filter(draw => draw.copy).length, 0);
|
|
304
|
+
side.mesh.visible = true;
|
|
305
|
+
side.step(STABLE_FRAMES);
|
|
306
|
+
assert.equal(side.events.filter(draw => draw.copy).length, 1);
|
|
307
|
+
side.mesh.castShadow = false;
|
|
308
|
+
side.step();
|
|
309
|
+
assert.equal(side.events.filter(draw => draw.copy).length, 0);
|
|
310
|
+
side.mesh.castShadow = true;
|
|
311
|
+
const spawned = new THREE.Mesh(new THREE.BoxGeometry(), new THREE.MeshStandardMaterial());
|
|
312
|
+
spawned.castShadow = true;
|
|
313
|
+
spawned.position.z = -2;
|
|
314
|
+
side.world.scene.add(spawned);
|
|
315
|
+
side.step();
|
|
316
|
+
assert.ok(shadowDraws(side).some(draw => draw.object === spawned));
|
|
317
|
+
},
|
|
318
|
+
|
|
319
|
+
'view-slice selection changes rebuild even with the same snapped box'() {
|
|
320
|
+
const side = setup();
|
|
321
|
+
side.step(WARMUP);
|
|
322
|
+
const near = side.world.nearShadows.shadow;
|
|
323
|
+
const far = new THREE.Mesh(new THREE.SphereGeometry(0.001), new THREE.MeshStandardMaterial());
|
|
324
|
+
far.name = 'outside-slice';
|
|
325
|
+
far.castShadow = true;
|
|
326
|
+
side.node.add(far);
|
|
327
|
+
// Find a point inside the box but outside its narrowed view slice.
|
|
328
|
+
let outside = false;
|
|
329
|
+
for (const x of [-0.9, 0.9]) for (const y of [-0.9, 0.9]) {
|
|
330
|
+
if (outside) continue;
|
|
331
|
+
far.position.set(x, y, 0).unproject(near.camera);
|
|
332
|
+
side.node.computedFrom = null;
|
|
333
|
+
delete side.node.frozenAt;
|
|
334
|
+
side.freeze();
|
|
335
|
+
outside = !near.getFrustum().intersectsObject(far);
|
|
336
|
+
}
|
|
337
|
+
assert.ok(outside);
|
|
338
|
+
side.step(STABLE_FRAMES + 1);
|
|
339
|
+
const matrix = near.matrix.clone();
|
|
340
|
+
assert.ok(!shadowDraws(side).some(draw => draw.object === far));
|
|
341
|
+
far.frustumCulled = false;
|
|
342
|
+
side.step();
|
|
343
|
+
assert.deepEqual(near.matrix, matrix);
|
|
344
|
+
assert.ok(shadowDraws(side).some(draw => draw.object === far), 'the cached draw selection follows three\'s uncullable casters');
|
|
345
|
+
assert.equal(side.events.filter(draw => draw.copy).length, 0, 'the selection miss draws uncached');
|
|
346
|
+
side.step(STABLE_FRAMES - 1);
|
|
347
|
+
assert.ok(shadowDraws(side).some(draw => draw.object === side.mesh && draw.target === cacheOf(side).shadow.map), 'the stable selection rebuilds');
|
|
348
|
+
far.frustumCulled = true;
|
|
349
|
+
side.step();
|
|
350
|
+
assert.ok(!shadowDraws(side).some(draw => draw.object === far));
|
|
351
|
+
assert.ok(shadowDraws(side).some(draw => draw.object === side.mesh));
|
|
352
|
+
},
|
|
353
|
+
|
|
354
|
+
'frozenStatics nodes cache, and a disposed GPU target rebuilds'() {
|
|
355
|
+
const side = setup();
|
|
356
|
+
side.run.keepsStaticActors = false;
|
|
357
|
+
side.world.stillKeeper.adopted = null;
|
|
358
|
+
side.world.frozenStatics = { runtime: side.run };
|
|
359
|
+
side.node.frozenStatic = true;
|
|
360
|
+
side.step(WARMUP);
|
|
361
|
+
const cache = cacheOf(side);
|
|
362
|
+
assert.ok(cache.valid);
|
|
363
|
+
side.step();
|
|
364
|
+
assert.ok(!shadowDraws(side).some(draw => draw.object === side.mesh));
|
|
365
|
+
cache.shadow.map.dispose(); // Same lost renderer properties as a context restore.
|
|
366
|
+
side.step();
|
|
367
|
+
assert.equal(side.events.filter(draw => draw.copy).length, 0);
|
|
368
|
+
assert.equal(cache.valid, false);
|
|
369
|
+
side.step(STABLE_FRAMES - 1);
|
|
370
|
+
assert.ok(cache.valid);
|
|
371
|
+
assert.ok(shadowDraws(side).some(draw => draw.object === side.mesh));
|
|
372
|
+
side.node.frozenStatic = false;
|
|
373
|
+
side.step();
|
|
374
|
+
assert.equal(side.events.filter(draw => draw.copy).length, 0);
|
|
375
|
+
assert.ok(shadowDraws(side).some(draw => draw.object === side.mesh));
|
|
376
|
+
},
|
|
377
|
+
|
|
378
|
+
'other lights see all casters; fade still patches only the colour pass'() {
|
|
379
|
+
const side = setup({ orbit: true });
|
|
380
|
+
const other = new THREE.DirectionalLight();
|
|
381
|
+
other.position.set(6, 18, -6);
|
|
382
|
+
other.castShadow = true;
|
|
383
|
+
side.world.scene.add(other);
|
|
384
|
+
const pass = side.world.renderer.shadowMap.render;
|
|
385
|
+
side.step(WARMUP);
|
|
386
|
+
side.step();
|
|
387
|
+
assert.equal(shadowDraws(side).filter(draw => draw.object === side.mesh).length, 1, 'still caster drawn only for the other light');
|
|
388
|
+
assert.equal(shadowDraws(side).filter(draw => draw.object === side.mover).length, 2);
|
|
389
|
+
const color = side.world.draws.find(draw => draw.name === side.mesh.name && !draw.shadow);
|
|
390
|
+
assert.ok(color.material !== side.mesh.material && color.fade?.length === 2);
|
|
391
|
+
assert.ok(shadowDraws(side).every(draw => draw.material.uniforms?.nearShadowFade === undefined));
|
|
392
|
+
assert.equal(side.world.renderer.shadowMap.render, pass);
|
|
393
|
+
},
|
|
394
|
+
|
|
395
|
+
'no key, false, wrong type, unsupported callbacks, and unhookable pass stay uncached'() {
|
|
396
|
+
for (const key of [undefined, false, 'true']) {
|
|
397
|
+
const side = setup({ key });
|
|
398
|
+
side.step(WARMUP + 1);
|
|
399
|
+
assert.ok(!cacheOf(side));
|
|
400
|
+
assert.ok(shadowDraws(side).some(draw => draw.object === side.mesh));
|
|
401
|
+
assert.ok(!side.world.gl.sources.some(source => source.includes('cachedDepth')));
|
|
402
|
+
}
|
|
403
|
+
for (const change of [
|
|
404
|
+
side => { side.world.renderer.shadowMap.type = THREE.BasicShadowMap; },
|
|
405
|
+
side => { Object.defineProperty(side.world.renderer.shadowMap, 'render', { writable: false }); },
|
|
406
|
+
side => { side.mesh.onBeforeShadow = () => {}; },
|
|
407
|
+
side => { side.world.scene.onBeforeRender = () => {}; },
|
|
408
|
+
side => { Object.defineProperty(side.mover, 'castShadow', { writable: false }); },
|
|
409
|
+
side => { side.mover.customDepthMaterial = new THREE.MeshDepthMaterial({ depthWrite: false }); },
|
|
410
|
+
]) {
|
|
411
|
+
const side = setup();
|
|
412
|
+
change(side);
|
|
413
|
+
side.step(WARMUP + 1);
|
|
414
|
+
assert.equal(side.events.filter(draw => draw.copy).length, 0);
|
|
415
|
+
assert.ok(shadowDraws(side).some(draw => draw.object === side.mesh));
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
|
|
419
|
+
'exit, throws and re-entry restore flags/hooks and dispose all cache resources'() {
|
|
420
|
+
for (const kind of ['key', 'distance', 'throw', 'stillthrow', 'reenter', 'dispose', 'world', 'listener']) {
|
|
421
|
+
const side = setup({ orbit: true });
|
|
422
|
+
const pass = side.world.renderer.shadowMap.render;
|
|
423
|
+
side.step(WARMUP);
|
|
424
|
+
const cache = cacheOf(side);
|
|
425
|
+
const resources = [cache.shadow.map, cache.geometry, cache.material, side.world.nearShadows.shadow.map];
|
|
426
|
+
const disposed = resources.map(() => 0);
|
|
427
|
+
resources.forEach((resource, i) => resource.addEventListener('dispose', () => { disposed[i]++; }));
|
|
428
|
+
const own = side.world.sun.shadow;
|
|
429
|
+
if (kind === 'key') side.run.data.engine.shadows.cacheStill = false;
|
|
430
|
+
if (kind === 'distance') side.run.nearShadowDistance = 0;
|
|
431
|
+
if (kind === 'world') side.world.scene.onAfterRender = () => disposeWorld(side.world);
|
|
432
|
+
if (kind === 'listener') resources[0].addEventListener('dispose', () => {
|
|
433
|
+
assert.equal(side.world.sun.shadow, own);
|
|
434
|
+
assert.equal(cache.shadow.map, null);
|
|
435
|
+
assert.equal(cache.triangle, null);
|
|
436
|
+
throw new Error('listener');
|
|
437
|
+
});
|
|
438
|
+
if (['throw', 'stillthrow', 'reenter', 'dispose'].includes(kind)) {
|
|
439
|
+
const direct = side.world.renderer.renderBufferDirect;
|
|
440
|
+
let once = true;
|
|
441
|
+
if (kind === 'stillthrow') side.mesh.material.side = THREE.DoubleSide;
|
|
442
|
+
side.world.renderer.renderBufferDirect = function (...args) {
|
|
443
|
+
if (kind === 'stillthrow' && args[0] === cache.shadow.camera) throw new Error('still failed');
|
|
444
|
+
if (once && args[3] === cache.material) {
|
|
445
|
+
once = false;
|
|
446
|
+
if (kind === 'throw') throw new Error('copy failed');
|
|
447
|
+
if (kind === 'reenter') renderWorld(side.world, side.run);
|
|
448
|
+
if (kind === 'dispose') dropNearShadowsForTest(side.world);
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
return direct.apply(this, args);
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
if (kind === 'listener') side.run.nearShadowDistance = 0;
|
|
455
|
+
if (kind === 'stillthrow') side.step(STABLE_FRAMES - 1);
|
|
456
|
+
if (['throw', 'stillthrow', 'listener'].includes(kind)) assert.throws(() => side.step(), /copy failed|still failed|listener/);
|
|
457
|
+
else side.step();
|
|
458
|
+
assert.deepEqual(disposed, [1, 1, 1, 1], kind);
|
|
459
|
+
assert.equal(side.world.sun.shadow, own, kind);
|
|
460
|
+
assert.equal(side.world.renderer.shadowMap.render, pass, kind);
|
|
461
|
+
assert.ok(side.mesh.castShadow && side.mover.castShadow, kind);
|
|
462
|
+
assert.equal(side.world.nearShadows?.depth ?? 0, 0, kind);
|
|
463
|
+
assert.equal(cache.triangle, null, kind);
|
|
464
|
+
}
|
|
465
|
+
},
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
export async function run() {
|
|
469
|
+
let count = 0;
|
|
470
|
+
for (const [name, scenario] of Object.entries(scenarios)) {
|
|
471
|
+
if (process.env.ONLY && !name.includes(process.env.ONLY)) continue;
|
|
472
|
+
try { scenario(); count++; } catch (error) { error.message = `${name}: ${error.message}`; throw error; }
|
|
473
|
+
}
|
|
474
|
+
return count;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
if (process.argv[1] === new URL(import.meta.url).pathname) console.log(`still shadows: ${await run()} scenarios`);
|