castle-web-cli 0.4.231 → 0.4.233
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/castle-host/host.d.ts +1 -0
- package/dist/castle-host/host.js +51 -3
- package/dist/castleJson.d.ts +4 -2
- package/dist/castleJson.js +2 -0
- package/dist/check.d.ts +3 -1
- package/dist/check.js +11 -1
- package/dist/devSessionStorage.js +47 -1
- 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 +5 -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 +5 -0
- package/dist/save-deck.js +37 -4
- package/dist/serve.js +3 -0
- package/dist/serverBundle.js +5 -3
- package/dist/shell/assets/{index-D2tWM896.js → index-BjOxR-lW.js} +4 -4
- 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/kits/base/castle.json +1 -1
- package/kits/base/package-lock.json +1 -1
- package/kits/base/sdk/README.md +79 -2
- package/kits/base/sdk/avatar.d.ts +6 -2
- package/kits/base/sdk/avatar.js +12 -4
- package/kits/base/sdk/castle.d.ts +1 -1
- package/kits/base/sdk/commands.d.ts +14 -0
- package/kits/base/sdk/hub.d.ts +6 -2
- package/kits/base/sdk/hub.js +13 -0
- package/kits/base/sdk/multiplayer.js +17 -1
- package/kits/base/sdk/save.js +2 -1
- package/kits/base/sdk/server/hub.d.ts +87 -0
- package/kits/base/sdk/server/hub.js +70 -0
- package/kits/base/sdk/server/platformHandle.d.ts +31 -1
- package/kits/base/sdk/server/storage.d.ts +13 -0
- package/kits/base/sdk/server/storage.js +46 -0
- package/kits/base/sdk/server/wrapper.d.ts +36 -5
- package/kits/base/sdk/server/wrapper.js +83 -8
- package/kits/hub-game/CLAUDE.md +352 -12
- 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/code/client/actorBudget.js +47 -0
- package/kits/hub-game/code/client/attention.js +11 -2
- package/kits/hub-game/code/client/avatar.js +345 -32
- 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 +251 -0
- package/kits/hub-game/code/client/ballot.js +467 -0
- package/kits/hub-game/code/client/build.js +22 -0
- package/kits/hub-game/code/client/chat.js +12 -0
- package/kits/hub-game/code/client/chrome.js +1334 -50
- 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/decor.js +509 -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/grab.js +363 -20
- package/kits/hub-game/code/client/hats.js +26 -0
- package/kits/hub-game/code/client/hookLayer.js +328 -15
- package/kits/hub-game/code/client/hudClear.js +126 -0
- package/kits/hub-game/code/client/idle.js +163 -22
- package/kits/hub-game/code/client/interestCap.js +81 -0
- package/kits/hub-game/code/client/keys.js +36 -0
- package/kits/hub-game/code/client/labelsNear.js +205 -0
- package/kits/hub-game/code/client/menuIcons.js +34 -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/rehello.js +167 -0
- package/kits/hub-game/code/client/shot.js +92 -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 +131 -1
- package/kits/hub-game/code/client/stuck.js +259 -0
- package/kits/hub-game/code/client/talk.js +538 -47
- package/kits/hub-game/code/client/tiers.js +541 -27
- package/kits/hub-game/code/client/toastBand.js +37 -0
- package/kits/hub-game/code/client/together.js +98 -1
- package/kits/hub-game/code/client/visibility.js +43 -0
- package/kits/hub-game/code/client/wear.js +470 -97
- package/kits/hub-game/code/client/yours.js +199 -0
- package/kits/hub-game/code/companionSpec.js +45 -0
- package/kits/hub-game/code/privateText.js +7 -0
- package/kits/hub-game/code/server/actions.js +133 -0
- package/kits/hub-game/code/server/actors.js +14 -1
- 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 +82 -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/earned.js +461 -0
- package/kits/hub-game/code/server/friendBests.js +166 -0
- package/kits/hub-game/code/server/friendsAmong.js +232 -0
- package/kits/hub-game/code/server/grab.js +296 -11
- package/kits/hub-game/code/server/history.js +5 -0
- package/kits/hub-game/code/server/hub.js +1317 -52
- package/kits/hub-game/code/server/idle.js +30 -11
- package/kits/hub-game/code/server/index.js +2 -2
- package/kits/hub-game/code/server/labels.js +28 -2
- package/kits/hub-game/code/server/manifest.js +424 -8
- package/kits/hub-game/code/server/menu.js +133 -0
- package/kits/hub-game/code/server/npcs.js +830 -80
- package/kits/hub-game/code/server/party.js +13 -2
- package/kits/hub-game/code/server/players.js +22 -0
- package/kits/hub-game/code/server/say.js +8 -2
- package/kits/hub-game/code/server/shot.js +110 -0
- package/kits/hub-game/code/server/standing.js +124 -0
- package/kits/hub-game/code/server/vis.js +113 -0
- package/kits/hub-game/code/server/wear.js +128 -11
- package/kits/hub-game/code/server/yours.js +59 -0
- package/kits/hub-game/code/shared/cues.js +9 -0
- package/kits/hub-game/code/shared/decor.js +41 -0
- package/kits/hub-game/code/shared/shot.js +19 -0
- package/kits/hub-game/code/shared/spin.js +57 -0
- package/kits/hub-game/code/systems/hub.js +1083 -85
- package/kits/hub-game/docs/content-pack.md +1 -1
- package/kits/hub-game/docs/contract.md +2440 -61
- package/kits/hub-game/docs/home-pieces.md +64 -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 +2 -0
- package/kits/hub-game/package.json +2 -1
- package/kits/hub-game/scripts/check.mjs +78 -11
- package/kits/hub-game/scripts/companion-follower-wire.json +1 -0
- package/kits/hub-game/scripts/fixtures/decor-keyless-draw.json +121 -0
- package/kits/hub-game/scripts/fixtures/decor-keyless.json +293 -0
- package/kits/hub-game/scripts/fixtures/engine-models-stub.mjs +23 -0
- package/kits/hub-game/scripts/fixtures/fake-dom.mjs +107 -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/soundscape-wave-analysis.mjs +125 -0
- package/kits/hub-game/scripts/test-actions-client.mjs +488 -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 +19 -17
- package/kits/hub-game/scripts/test-ask-client.mjs +358 -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 +753 -0
- package/kits/hub-game/scripts/test-avatar.mjs +540 -7
- package/kits/hub-game/scripts/test-ballot.mjs +1001 -0
- package/kits/hub-game/scripts/test-build.mjs +31 -0
- package/kits/hub-game/scripts/test-cells.mjs +71 -0
- package/kits/hub-game/scripts/test-chat.mjs +694 -0
- package/kits/hub-game/scripts/test-classic.mjs +2 -0
- package/kits/hub-game/scripts/test-companion-chat.mjs +198 -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-decor-client.mjs +303 -0
- package/kits/hub-game/scripts/test-decor.mjs +457 -0
- package/kits/hub-game/scripts/test-earned-client.mjs +459 -0
- package/kits/hub-game/scripts/test-earned.mjs +1194 -0
- package/kits/hub-game/scripts/test-emote-bubble.mjs +110 -0
- package/kits/hub-game/scripts/test-friend-bests.mjs +435 -0
- package/kits/hub-game/scripts/test-grab-client.mjs +186 -3
- package/kits/hub-game/scripts/test-grab-orbit.mjs +918 -0
- package/kits/hub-game/scripts/test-grab.mjs +864 -3
- package/kits/hub-game/scripts/test-hats.mjs +483 -0
- package/kits/hub-game/scripts/test-hub-leaving.mjs +203 -0
- package/kits/hub-game/scripts/test-hub-ops.mjs +439 -2
- package/kits/hub-game/scripts/test-hub-trip.mjs +1228 -1
- package/kits/hub-game/scripts/test-hud-clear.mjs +1000 -0
- package/kits/hub-game/scripts/test-idle.mjs +361 -1
- package/kits/hub-game/scripts/test-interest-cap.mjs +36 -0
- package/kits/hub-game/scripts/test-interest-cells.mjs +493 -0
- package/kits/hub-game/scripts/test-interest-client.mjs +118 -0
- package/kits/hub-game/scripts/test-keys.mjs +46 -1
- package/kits/hub-game/scripts/test-labels.mjs +596 -0
- package/kits/hub-game/scripts/test-manifest.mjs +282 -0
- package/kits/hub-game/scripts/test-menu-client.mjs +480 -0
- package/kits/hub-game/scripts/test-menu.mjs +296 -0
- package/kits/hub-game/scripts/test-npcs.mjs +1718 -12
- package/kits/hub-game/scripts/test-object-entry.mjs +76 -0
- package/kits/hub-game/scripts/test-pack.mjs +7 -0
- package/kits/hub-game/scripts/test-party.mjs +22 -1
- package/kits/hub-game/scripts/test-picker.mjs +314 -0
- package/kits/hub-game/scripts/test-rehello.mjs +1039 -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-say.mjs +59 -2
- package/kits/hub-game/scripts/test-shot.mjs +756 -0
- package/kits/hub-game/scripts/test-soundscape.mjs +5432 -0
- package/kits/hub-game/scripts/test-spin.mjs +314 -0
- package/kits/hub-game/scripts/test-standing.mjs +416 -0
- package/kits/hub-game/scripts/test-stuck.mjs +1903 -0
- package/kits/hub-game/scripts/test-tier-cells.mjs +706 -0
- package/kits/hub-game/scripts/test-tiers-render.mjs +339 -0
- package/kits/hub-game/scripts/test-tiers.mjs +666 -3
- package/kits/hub-game/scripts/test-toast-band.mjs +61 -0
- package/kits/hub-game/scripts/test-try-on.mjs +940 -0
- package/kits/hub-game/scripts/test-vis.mjs +343 -0
- package/kits/hub-game/scripts/test-visibility.mjs +134 -0
- package/kits/hub-game/scripts/test-yours-chrome.mjs +166 -0
- package/kits/hub-game/scripts/test-yours.mjs +372 -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/nameTags.js +59 -4
- 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 +74 -4
- package/kits/multiplayer-3d/package.json +2 -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-own-name-tag.mjs +247 -0
- package/kits/physics-2d/CLAUDE.md +9 -0
- package/kits/physics-2d/castle.json +2 -2
- package/kits/physics-2d/engine/scene.js +288 -1
- 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/scripts/test-skip-unchanged.mjs +370 -1
- package/kits/physics-3d/CLAUDE.md +1391 -0
- package/kits/physics-3d/behaviors/Player.jsx +921 -3
- package/kits/physics-3d/castle.json +3 -3
- package/kits/physics-3d/docs/pxmodel-format.md +12 -0
- package/kits/physics-3d/engine3d/Scene3DPlayer.jsx +98 -10
- package/kits/physics-3d/engine3d/actornode.js +86 -0
- package/kits/physics-3d/engine3d/animationBudget.js +23 -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 +96 -0
- package/kits/physics-3d/engine3d/gait.js +118 -0
- package/kits/physics-3d/engine3d/kithooks.js +47 -0
- package/kits/physics-3d/engine3d/look.js +507 -48
- package/kits/physics-3d/engine3d/lookbake.js +208 -0
- package/kits/physics-3d/engine3d/materialpresets.js +2 -0
- package/kits/physics-3d/engine3d/motion.js +39 -10
- package/kits/physics-3d/engine3d/nearshadows.js +37 -19
- package/kits/physics-3d/engine3d/optimize.js +58 -5
- package/kits/physics-3d/engine3d/orbitinput.js +755 -0
- package/kits/physics-3d/engine3d/orbitlens.js +48 -0
- package/kits/physics-3d/engine3d/ownmodel.js +213 -0
- package/kits/physics-3d/engine3d/pxmodel.js +42 -11
- package/kits/physics-3d/engine3d/shadowfade.js +882 -0
- package/kits/physics-3d/engine3d/sky.js +547 -0
- package/kits/physics-3d/engine3d/skylife.js +306 -0
- 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 +870 -87
- package/kits/physics-3d/main.jsx +5 -0
- package/kits/physics-3d/package.json +1 -1
- package/kits/physics-3d/scripts/Player.before-orbit.mjs +310 -0
- package/kits/physics-3d/scripts/Scene3DPlayer.before-orbit.jsx +337 -0
- package/kits/physics-3d/scripts/look-baseline.mjs +155 -0
- package/kits/physics-3d/scripts/test-camera-follow.mjs +12 -2
- package/kits/physics-3d/scripts/test-camera-orbit.mjs +4588 -0
- package/kits/physics-3d/scripts/test-drop-empty-parts.mjs +787 -0
- package/kits/physics-3d/scripts/test-frame-cap-bob.mjs +435 -0
- package/kits/physics-3d/scripts/test-frame-cap.mjs +452 -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 +3 -0
- package/kits/physics-3d/scripts/test-orbit-shadow-fade.mjs +1920 -0
- package/kits/physics-3d/scripts/test-orbit-shift-lock.mjs +545 -0
- package/kits/physics-3d/scripts/test-orbit-shot.mjs +583 -0
- package/kits/physics-3d/scripts/test-orbit-view.mjs +230 -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-static-actors.mjs +13 -1
- package/kits/physics-3d/scripts/test-static-passes.mjs +1 -1
- package/kits/physics-3d/scripts/test-static-scenery.mjs +2171 -0
- package/kits/physics-3d/scripts/test-steady-hover.mjs +635 -0
- package/kits/physics-3d/scripts/test-view-range.mjs +260 -0
- package/kits/physics-3d/systems/physics3d.js +474 -12
- package/kits/real-time/castle.json +2 -2
- package/kits/real-time/code/server/gameHooks.js +7 -0
- package/kits/real-time/code/server/session.js +97 -19
- package/package.json +2 -2
- package/dist/shell/assets/index-Cf61cNfT.css +0 -1
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
// The real SceneRuntime load -> syncActors -> renderWorld ordering. Only
|
|
2
|
+
// bundler-owned file discovery and system discovery are stood in for.
|
|
3
|
+
import assert from 'node:assert/strict';
|
|
4
|
+
import fs from 'node:fs';
|
|
5
|
+
import { register } from 'node:module';
|
|
6
|
+
import * as THREE from 'three';
|
|
7
|
+
import { makeTiers } from '../code/client/tiers.js';
|
|
8
|
+
import { deck } from '../code/client/state.js';
|
|
9
|
+
|
|
10
|
+
const stubs = {
|
|
11
|
+
'castle-web-sdk': `export const resolveDeckFile = (name) => String(name).replace(/^\\.\\//, '');
|
|
12
|
+
export const deckPrefixOf = () => ''; export const IMPORTS_DIR = 'imports'; export const IMPORTS_PREFIX = 'imports/';`,
|
|
13
|
+
'./files': `export const initialFiles = {}; export const parseJsonFile = (path, text) => ({ value: JSON.parse(text) });
|
|
14
|
+
export const formatJson = (value) => JSON.stringify(value);`,
|
|
15
|
+
'./systemRegistry': `export const systemInstallers = [];`,
|
|
16
|
+
'./fonts': `export const deckFontFamily = 'sans-serif';`,
|
|
17
|
+
};
|
|
18
|
+
register('data:text/javascript,' + encodeURIComponent(`
|
|
19
|
+
import { existsSync } from 'node:fs';
|
|
20
|
+
import { fileURLToPath } from 'node:url';
|
|
21
|
+
const stubs = ${JSON.stringify(stubs)};
|
|
22
|
+
export async function resolve(specifier, context, next) {
|
|
23
|
+
const parent = context.parentURL ?? '';
|
|
24
|
+
if (parent.includes('/physics-2d/engine/') && stubs[specifier]) {
|
|
25
|
+
return { url: 'data:text/javascript,' + encodeURIComponent(stubs[specifier]), shortCircuit: true };
|
|
26
|
+
}
|
|
27
|
+
if (specifier.startsWith('@imports/castle.physics-2d/')) {
|
|
28
|
+
specifier = parent.replace(/\\/kits\\/.*/, '/kits/physics-2d/') + specifier.slice(27);
|
|
29
|
+
}
|
|
30
|
+
if ((specifier.startsWith('.') || specifier.startsWith('file:')) && parent.includes('/kits/') && !/\\.(m?js|jsx|json)$/.test(specifier)) {
|
|
31
|
+
const base = new URL(specifier, parent).href;
|
|
32
|
+
if (existsSync(fileURLToPath(base + '.js'))) return next(base + '.js', context);
|
|
33
|
+
}
|
|
34
|
+
return next(specifier, context);
|
|
35
|
+
}
|
|
36
|
+
`));
|
|
37
|
+
|
|
38
|
+
const { SceneRuntime } = await import('../../physics-2d/engine/scene.js');
|
|
39
|
+
const { initialFiles } = await import('data:text/javascript,' + encodeURIComponent(stubs['./files']));
|
|
40
|
+
const { syncActors, renderWorld, disposeWorld } = await import('../../physics-3d/engine3d/world3d.js');
|
|
41
|
+
const SKY = { zones: [{ id: 'plain', color: '#bfe3f2', art: 'sky.webp' }] };
|
|
42
|
+
const MODEL = 'box.pxmodel';
|
|
43
|
+
const actor = (id, tier, cell, model = false) => ({
|
|
44
|
+
id, ...(tier ? { tier } : {}), ...(cell ? { cell } : {}),
|
|
45
|
+
components: {
|
|
46
|
+
Transform: { x: 0, y: 0, z: -5 },
|
|
47
|
+
...(model ? { Model: { file: MODEL } } : { Shape: { kind: 'box', width: 1, height: 1, depth: 1, color: '#8899aa' } }),
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
const data = (actors, engine = {}, cells) => ({ actors, engine, ...(cells ? { cells } : {}) });
|
|
51
|
+
// Execute the player's own requested-load boundary (the function has no JSX
|
|
52
|
+
// or imported dependencies), rather than substituting a preloaded runtime.
|
|
53
|
+
const player = fs.readFileSync(new URL('../../physics-3d/engine3d/Scene3DPlayer.jsx', import.meta.url), 'utf8');
|
|
54
|
+
const loadSource = player.slice(player.indexOf('function loadRequestedScene(runtime) {'), player.indexOf('\n// Behaviors write `scene.hud'));
|
|
55
|
+
const loadRequestedScene = new Function(`${loadSource}; return loadRequestedScene;`)();
|
|
56
|
+
|
|
57
|
+
function side(scenes, mode = 'high', instanced = false, withTiers = true) {
|
|
58
|
+
const files = Object.fromEntries(Object.entries(scenes).map(([name, scene]) => [name, JSON.stringify(scene)]));
|
|
59
|
+
files[MODEL] = JSON.stringify({ format: 'pxmodel', look: false, parts: [{ id: 'box', kind: 'box', size: [1, 1, 1], color: '#8899aa' }] });
|
|
60
|
+
Object.assign(initialFiles, files);
|
|
61
|
+
const path = Object.keys(scenes)[0];
|
|
62
|
+
const runtime = new SceneRuntime(scenes[path], [], {}, files, path);
|
|
63
|
+
const world = {
|
|
64
|
+
scene: new THREE.Scene(), camera: new THREE.PerspectiveCamera(50, 1, 0.1, 100),
|
|
65
|
+
renderer: { dispose() {}, initTexture() { uploads++; } },
|
|
66
|
+
nodes: new Map(), scenePath: undefined, parked: new Map(), models: new Map(),
|
|
67
|
+
skipping: { on: false }, modelSigs: new Map(), sigEpoch: 0, syncCount: 0,
|
|
68
|
+
syncDepth: 0, generation: 0, snapshots: new WeakMap(), instances: new Map(),
|
|
69
|
+
instanceModels: instanced, ground: new THREE.Mesh(new THREE.PlaneGeometry(1, 1), new THREE.MeshStandardMaterial()),
|
|
70
|
+
grid: new THREE.Object3D(), sky: null,
|
|
71
|
+
};
|
|
72
|
+
world.scene.add(world.ground, world.grid);
|
|
73
|
+
world.camera.updateMatrixWorld();
|
|
74
|
+
runtime.three = world;
|
|
75
|
+
runtime.sprites = { 'sky.webp': { kind: 'image', ready: true, failed: false, image: { width: 4, height: 4 } } };
|
|
76
|
+
let uploads = 0;
|
|
77
|
+
const draws = [];
|
|
78
|
+
world.composer = { render() {
|
|
79
|
+
const ids = [];
|
|
80
|
+
world.scene.traverseVisible((node) => {
|
|
81
|
+
if (node.userData.actorId && node.children.length) ids.push(node.userData.actorId);
|
|
82
|
+
});
|
|
83
|
+
draws.push({ ids, sky: world.scene.children.some((node) => node.name === 'engine.sky'),
|
|
84
|
+
off: Object.hasOwn(runtime, 'sky'), uploads,
|
|
85
|
+
instances: [...world.instances.values()].flatMap((i) => i.parts.map((p) => p.mesh.count)) });
|
|
86
|
+
} };
|
|
87
|
+
const tiers = makeTiers({ storage: null, deviceMemory: 8 });
|
|
88
|
+
tiers.set(mode);
|
|
89
|
+
if (withTiers) runtime.registerSystem({ afterBehaviors(s) { tiers.frame(s, true, s.time * 1000); } });
|
|
90
|
+
function frame(next) {
|
|
91
|
+
if (next) runtime.requestedScene = next;
|
|
92
|
+
runtime.update(1 / 60);
|
|
93
|
+
if (runtime.requestedScene) loadRequestedScene(runtime);
|
|
94
|
+
syncActors(world, runtime, runtime.sprites, 1 / 60);
|
|
95
|
+
renderWorld(world, runtime);
|
|
96
|
+
return draws.at(-1);
|
|
97
|
+
}
|
|
98
|
+
return { runtime, world, tiers, frame, draws };
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// A deck with tiers on High against the same deck without tiers: keyless,
|
|
102
|
+
// markless scenes give the same pictures, world fields and runtime fields,
|
|
103
|
+
// over a first build and two loads. Object UUIDs are deliberately omitted.
|
|
104
|
+
function picture(s) {
|
|
105
|
+
const tree = (node) => ({ type: node.type, actor: node.userData.actorId ?? null,
|
|
106
|
+
visible: node.visible, matrix: node.matrix.toArray(),
|
|
107
|
+
geometry: node.geometry?.attributes.position?.array ? [...node.geometry.attributes.position.array] : null,
|
|
108
|
+
color: node.material?.color?.getHexString() ?? null, children: node.children.map(tree) });
|
|
109
|
+
return JSON.stringify({ tree: tree(s.world.scene), draws: s.draws,
|
|
110
|
+
fields: Object.keys(s.world).sort(), runtime: Object.getOwnPropertyNames(s.runtime).sort(),
|
|
111
|
+
nodes: [...s.world.nodes.keys()] });
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
{
|
|
115
|
+
const scenes = {
|
|
116
|
+
'scenes/a.scene': data([actor('kept', 'keep'), actor('decor')]),
|
|
117
|
+
'scenes/b.scene': data([actor('next', 'keep')]),
|
|
118
|
+
};
|
|
119
|
+
const none = side(scenes, 'high', false, false);
|
|
120
|
+
const high = side(scenes, 'high');
|
|
121
|
+
for (const path of [undefined, 'scenes/b.scene', 'scenes/a.scene']) {
|
|
122
|
+
none.frame(path);
|
|
123
|
+
high.frame(path);
|
|
124
|
+
assert.equal(picture(high), picture(none), 'High: a keyless, low-markless world is the one a deck without tiers has');
|
|
125
|
+
}
|
|
126
|
+
disposeWorld(none.world);
|
|
127
|
+
disposeWorld(high.world);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// The ordering the notes in tiers.js rest on: tiers run in the update, the
|
|
131
|
+
// load and the node build come after, then the draw.
|
|
132
|
+
assert.match(player, /runtime\.update\(dt\);[\s\S]*if \(runtime\.requestedScene\)[\s\S]*syncActors\(world, runtime,[\s\S]*else renderWorld\(world, runtime\);/);
|
|
133
|
+
|
|
134
|
+
{
|
|
135
|
+
const s = side({ 'scenes/a.scene': data([actor('cone', 'low')]) });
|
|
136
|
+
assert.equal(s.world.nodes.size, 0);
|
|
137
|
+
assert.deepEqual(s.frame().ids, ['cone'], 'a Low-only node is drawn on High in the frame that built it');
|
|
138
|
+
assert.deepEqual(s.frame().ids, [], 'and never after');
|
|
139
|
+
for (let i = 0; i < 40; i++) assert.deepEqual(s.frame().ids, []);
|
|
140
|
+
s.tiers.set('low');
|
|
141
|
+
s.frame();
|
|
142
|
+
assert.deepEqual(s.frame().ids, ['cone']);
|
|
143
|
+
disposeWorld(s.world);
|
|
144
|
+
}
|
|
145
|
+
{
|
|
146
|
+
const s = side({
|
|
147
|
+
'scenes/plain.scene': data([actor('plain', 'keep')]),
|
|
148
|
+
'scenes/sky.scene': data([actor('cone', 'low')], { sky: SKY }),
|
|
149
|
+
}, 'low');
|
|
150
|
+
assert.equal(s.frame().sky, false);
|
|
151
|
+
assert.deepEqual(s.frame('scenes/sky.scene'), { ids: ['cone'], sky: false, off: true, uploads: 0, instances: [] },
|
|
152
|
+
'the frame a keyed scene is loaded in on Low draws no sky AND uploads nothing');
|
|
153
|
+
for (let i = 0; i < 5; i++) assert.deepEqual(s.frame(), { ids: ['cone'], sky: false, off: true, uploads: 0, instances: [] });
|
|
154
|
+
assert.equal(s.world.sky, null, 'no sky record on Low');
|
|
155
|
+
assert.deepEqual(s.frame('scenes/plain.scene'), { ids: ['plain'], sky: false, off: true, uploads: 0, instances: [] });
|
|
156
|
+
s.frame('scenes/sky.scene');
|
|
157
|
+
// Low to High in a keyed scene: the sky that frame, the cone out the next look.
|
|
158
|
+
s.tiers.set('high');
|
|
159
|
+
const high = s.frame();
|
|
160
|
+
assert.equal(high.off, false, 'High leaves the runtime as it was made');
|
|
161
|
+
assert.equal(high.sky, true);
|
|
162
|
+
assert.equal(high.uploads, 1);
|
|
163
|
+
assert.deepEqual(s.frame().ids, []);
|
|
164
|
+
assert.equal(s.runtime.sky.zones[0].id, 'plain', 'the scene key reads again');
|
|
165
|
+
// And back: the dome is released by the engine on its next frame.
|
|
166
|
+
s.tiers.set('low');
|
|
167
|
+
const low = s.frame();
|
|
168
|
+
assert.equal(low.sky, false);
|
|
169
|
+
assert.equal(s.world.sky, null, 'the engine let the record go');
|
|
170
|
+
assert.deepEqual(s.frame().ids, ['cone']);
|
|
171
|
+
disposeWorld(s.world);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
{
|
|
175
|
+
// A load reuses a node for the next scene's actor of the same id and look.
|
|
176
|
+
// What High took out for scene a's mark is back before that load, so the
|
|
177
|
+
// markless scene b draws its own `x` from its first frame.
|
|
178
|
+
const s = side({
|
|
179
|
+
'scenes/a.scene': data([actor('x', 'low'), actor('kept', 'keep')]),
|
|
180
|
+
'scenes/b.scene': data([actor('x'), actor('kept', 'keep')]),
|
|
181
|
+
});
|
|
182
|
+
s.frame();
|
|
183
|
+
assert.deepEqual(s.frame().ids, ['kept']);
|
|
184
|
+
const node = s.world.nodes.get('x').node;
|
|
185
|
+
assert.deepEqual(s.frame('scenes/b.scene').ids.sort(), ['kept', 'x'], 'the unmarked actor is drawn in the first frame of its scene');
|
|
186
|
+
assert.equal(s.world.nodes.get('x').node, node, 'the engine did reuse the node');
|
|
187
|
+
for (let i = 0; i < 40; i++) assert.deepEqual(s.frame().ids.sort(), ['kept', 'x']);
|
|
188
|
+
assert.deepEqual(s.frame('scenes/a.scene').ids.sort(), ['kept', 'x'], 'back: the frame that built it');
|
|
189
|
+
assert.deepEqual(s.frame().ids, ['kept']);
|
|
190
|
+
disposeWorld(s.world);
|
|
191
|
+
}
|
|
192
|
+
{
|
|
193
|
+
// A node the engine released (the actor rebuilt while out) is not put back
|
|
194
|
+
// by the load: nothing of scene a is left drawn in scene b.
|
|
195
|
+
const s = side({
|
|
196
|
+
'scenes/a.scene': data([actor('x', 'low'), actor('kept', 'keep')]),
|
|
197
|
+
'scenes/b.scene': data([actor('plain', 'keep')]),
|
|
198
|
+
});
|
|
199
|
+
s.frame();
|
|
200
|
+
assert.deepEqual(s.frame().ids, ['kept']);
|
|
201
|
+
const old = s.world.nodes.get('x');
|
|
202
|
+
s.runtime.getActor('x').components.Shape.color = '#ffffff';
|
|
203
|
+
s.frame(undefined, false);
|
|
204
|
+
assert.notEqual(s.world.nodes.get('x'), old, 'real sync rebuilt it');
|
|
205
|
+
s.frame('scenes/b.scene');
|
|
206
|
+
for (let i = 0; i < 5; i++) assert.deepEqual(s.frame().ids, ['plain']);
|
|
207
|
+
const orphans = [];
|
|
208
|
+
s.world.scene.traverse((node) => { if (node.userData.actorId === 'x') orphans.push(node); });
|
|
209
|
+
assert.equal(orphans.length, 0, 'no released node is back in the scene graph');
|
|
210
|
+
disposeWorld(s.world);
|
|
211
|
+
}
|
|
212
|
+
{
|
|
213
|
+
// High to Low in the very frame of a load: the key is not hidden until the
|
|
214
|
+
// next frame, so the load's own reset reads the key the sky was made by.
|
|
215
|
+
const s = side({
|
|
216
|
+
'scenes/sky.scene': data([actor('cone', 'low')], { sky: SKY }),
|
|
217
|
+
'scenes/plain.scene': data([actor('plain', 'keep')]),
|
|
218
|
+
});
|
|
219
|
+
s.frame();
|
|
220
|
+
assert.ok(s.world.sky, 'High made a sky record');
|
|
221
|
+
s.tiers.set('low');
|
|
222
|
+
s.runtime.requestedScene = 'scenes/plain.scene';
|
|
223
|
+
s.runtime.update(1 / 60);
|
|
224
|
+
assert.equal(Object.hasOwn(s.runtime, 'sky'), false, 'not hidden in the frame of the load');
|
|
225
|
+
assert.equal(s.runtime.sky.zones[0].id, 'plain');
|
|
226
|
+
s.frame(); // the load itself (this frame's update still sees the request)
|
|
227
|
+
assert.equal(s.world.sky, null, 'the engine let the record go');
|
|
228
|
+
assert.equal(s.frame().off, true, 'hidden from the next frame');
|
|
229
|
+
disposeWorld(s.world);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
console.log('test-tiers-render: real load/sync/render, the keyless trace and the sky switch passed');
|
|
233
|
+
|
|
234
|
+
// The cadence primitive through both real runtime loops, including static mode.
|
|
235
|
+
for (const staticActors of [false, true]) {
|
|
236
|
+
const ticks = [];
|
|
237
|
+
class Pulse {
|
|
238
|
+
static behaviorName = 'Pulse';
|
|
239
|
+
static defaultProps = {};
|
|
240
|
+
update(a, scene, dt) { ticks.push(dt); }
|
|
241
|
+
}
|
|
242
|
+
const runtime = new SceneRuntime(data([{ id: 'pulse', components: { Pulse: {} } }], { staticActors }), [Pulse], {}, {});
|
|
243
|
+
const a = runtime.getActor('pulse');
|
|
244
|
+
a.runtime.updateEvery = 0.1;
|
|
245
|
+
let systemTicks = 0;
|
|
246
|
+
runtime.registerSystem({ afterBehaviors() { systemTicks++; } });
|
|
247
|
+
for (let i = 0; i < 11; i++) runtime.update(0.02);
|
|
248
|
+
assert.equal(ticks.length, 3);
|
|
249
|
+
assert.ok(Math.abs(ticks.reduce((x, y) => x + y, 0) - 0.22) < 1e-9);
|
|
250
|
+
assert.equal(systemTicks, 11);
|
|
251
|
+
delete a.runtime.updateEvery;
|
|
252
|
+
runtime.update(0.02);
|
|
253
|
+
assert.equal(ticks.length, 4);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// Town distance metadata only takes effect with its separate deck opt-in.
|
|
257
|
+
for (const engine of [{}, { skipUnchangedActors: true }, { skipUnchangedActors: true, staticActors: true }]) {
|
|
258
|
+
const farActor = actor('far', null, null, true);
|
|
259
|
+
farActor.components.Solid = {};
|
|
260
|
+
farActor.components.Transform.z = -26;
|
|
261
|
+
farActor.lowDrawDistance = 12;
|
|
262
|
+
deck.lowActorDistance = false;
|
|
263
|
+
const s = side({ 'scenes/main.scene': data([farActor], engine) }, 'low');
|
|
264
|
+
s.frame(); s.frame();
|
|
265
|
+
assert.ok(s.world.nodes.get('far').node.parent, 'metadata alone keeps old distance');
|
|
266
|
+
deck.lowActorDistance = true;
|
|
267
|
+
s.runtime.time += 0.6;
|
|
268
|
+
s.frame();
|
|
269
|
+
const a = s.runtime.getActor('far'), node = s.world.nodes.get('far').node;
|
|
270
|
+
assert.equal(node.parent, null);
|
|
271
|
+
assert.equal(a.runtime.renderSleep, true);
|
|
272
|
+
a.components.Transform.z = -25;
|
|
273
|
+
s.runtime.touch(a);
|
|
274
|
+
s.frame();
|
|
275
|
+
assert.equal(node.position.z, -26, 'detached render synchronization sleeps');
|
|
276
|
+
a.components.Transform.z = -5;
|
|
277
|
+
s.runtime.touch(a);
|
|
278
|
+
s.runtime.time += 0.6;
|
|
279
|
+
s.frame();
|
|
280
|
+
assert.ok(node.parent, 'live Transform wakes an actor in range');
|
|
281
|
+
assert.equal(a.runtime.renderSleep, undefined);
|
|
282
|
+
assert.equal(node.position.z, -5);
|
|
283
|
+
a.components.Transform.z = -26;
|
|
284
|
+
s.runtime.touch(a);
|
|
285
|
+
s.runtime.time += 0.6;
|
|
286
|
+
s.frame();
|
|
287
|
+
s.tiers.set('high');
|
|
288
|
+
s.frame();
|
|
289
|
+
assert.ok(node.parent, 'High restores authored rendering');
|
|
290
|
+
assert.equal(a.runtime.renderSleep, undefined);
|
|
291
|
+
disposeWorld(s.world);
|
|
292
|
+
delete deck.lowActorDistance;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// The parent town's distances never apply to imported door content, even
|
|
296
|
+
// if the content reuses an authored town id.
|
|
297
|
+
{
|
|
298
|
+
deck.lowActorDistance = true;
|
|
299
|
+
const a = actor('shared-id', null, null, true);
|
|
300
|
+
a.components.Solid = {};
|
|
301
|
+
a.components.Transform.z = -26;
|
|
302
|
+
a.lowDrawDistance = 12;
|
|
303
|
+
const s = side({ 'scenes/main.scene': data([a]) }, 'low');
|
|
304
|
+
s.frame(); s.frame();
|
|
305
|
+
assert.equal(s.runtime.getActor('shared-id').runtime.renderSleep, true);
|
|
306
|
+
s.runtime.content = {};
|
|
307
|
+
s.frame();
|
|
308
|
+
assert.ok(s.world.nodes.get('shared-id').node.parent);
|
|
309
|
+
assert.equal(s.runtime.getActor('shared-id').runtime.renderSleep, undefined);
|
|
310
|
+
disposeWorld(s.world);
|
|
311
|
+
delete deck.lowActorDistance;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// Walk and authored motion share channels: skipped ticks preserve the entire
|
|
315
|
+
// composed pose, and returning to full rate advances all pending time.
|
|
316
|
+
{
|
|
317
|
+
const a = actor('rig', 'keep', null, true);
|
|
318
|
+
const s = side({ 'scenes/main.scene': data([a]) });
|
|
319
|
+
s.runtime.files[MODEL] = JSON.stringify({ format: 'pxmodel', look: false, parts: [{ id: 'legL', kind: 'box', size: [1, 1, 1], color: '#8899aa', motion: { rotate: [10, 0, 0] } }] });
|
|
320
|
+
s.frame(); s.frame();
|
|
321
|
+
const entry = s.world.nodes.get('rig');
|
|
322
|
+
entry.node.userData.animationEvery = 0.1;
|
|
323
|
+
const rigActor = s.runtime.getActor('rig');
|
|
324
|
+
rigActor.components.Transform.x = 0.05;
|
|
325
|
+
s.runtime.touch(rigActor);s.frame();
|
|
326
|
+
const leg = entry.node.userData.modelParts.get('legL');
|
|
327
|
+
const pose = leg.rotation.x, clock = entry.motionState.clock;
|
|
328
|
+
assert.ok(Math.abs(pose) > 0.001);
|
|
329
|
+
for (let i = 0; i < 3; i++) {
|
|
330
|
+
rigActor.components.Transform.x += 0.05;
|
|
331
|
+
s.runtime.touch(rigActor);s.frame();
|
|
332
|
+
assert.equal(leg.rotation.x, pose, 'composed pose held between ticks');
|
|
333
|
+
assert.equal(entry.motionState.clock, clock, 'motion waits with biped pass');
|
|
334
|
+
}
|
|
335
|
+
delete entry.node.userData.animationEvery;
|
|
336
|
+
s.frame();
|
|
337
|
+
assert.ok(Math.abs(entry.motionState.clock - clock - 4 / 60) < 1e-9, 'wake delivers pending animation time');
|
|
338
|
+
disposeWorld(s.world);
|
|
339
|
+
}
|