castle-web-cli 0.4.233 → 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/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 +17 -2
- package/dist/castle-host/host.js +793 -36
- package/dist/castleJson.d.ts +20 -1
- package/dist/castleJson.js +44 -2
- package/dist/check.js +9 -2
- 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 +3 -1
- 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/index.js +8 -2
- package/dist/init.js +1 -1
- package/dist/save-deck.d.ts +20 -1
- package/dist/save-deck.js +141 -5
- package/dist/serve.js +29 -11
- package/dist/shell/assets/{index-BjOxR-lW.js → index-DulbYIJm.js} +97 -97
- package/dist/shell/index.html +1 -1
- package/dist/vitePlugins.d.ts +2 -1
- package/dist/vitePlugins.js +13 -0
- package/kits/base/castle.json +1 -1
- package/kits/base/sdk/README.md +260 -3
- package/kits/base/sdk/castle.d.ts +7 -3
- package/kits/base/sdk/castle.js +2 -0
- package/kits/base/sdk/commands.d.ts +162 -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 +33 -6
- package/kits/base/sdk/hub.js +50 -4
- package/kits/base/sdk/multiplayer.d.ts +7 -1
- package/kits/base/sdk/multiplayer.js +140 -40
- 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 +79 -6
- package/kits/base/sdk/server/hub.d.ts +31 -1
- package/kits/base/sdk/server/hub.js +50 -3
- package/kits/base/sdk/server/platformHandle.d.ts +13 -1
- package/kits/base/sdk/server/storage.d.ts +4 -0
- package/kits/base/sdk/server/storage.js +19 -3
- package/kits/base/sdk/server/wrapper.d.ts +7 -1
- package/kits/base/sdk/server/wrapper.js +10 -1
- package/kits/base/sdk/social.d.ts +9 -0
- package/kits/base/sdk/social.js +5 -0
- package/kits/hub-game/CLAUDE.md +123 -3
- package/kits/hub-game/README.md +63 -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/arrivalCamera.js +50 -0
- package/kits/hub-game/code/client/askSlot.js +117 -0
- package/kits/hub-game/code/client/avatar.js +4 -2
- package/kits/hub-game/code/client/avatarShare.js +2 -0
- package/kits/hub-game/code/client/backVisibility.js +13 -0
- package/kits/hub-game/code/client/ballot.js +15 -10
- package/kits/hub-game/code/client/build.js +16 -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 +1148 -258
- package/kits/hub-game/code/client/crowdNames.js +241 -0
- package/kits/hub-game/code/client/decor.js +10 -4
- 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/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 +31 -11
- package/kits/hub-game/code/client/hookLayer.js +87 -8
- 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 +14 -2
- 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/labelsNear.js +31 -2
- 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/menuRows.js +43 -0
- package/kits/hub-game/code/client/modelReady.js +7 -0
- 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/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 +64 -10
- 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/state.js +53 -0
- package/kits/hub-game/code/client/talk.js +209 -45
- package/kits/hub-game/code/client/tiers.js +68 -66
- package/kits/hub-game/code/client/together.js +7 -2
- 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/worldLabels.js +241 -0
- package/kits/hub-game/code/client/yours.js +10 -9
- package/kits/hub-game/code/npcDisplayText.js +55 -0
- package/kits/hub-game/code/server/act.js +124 -0
- package/kits/hub-game/code/server/actions.js +6 -1
- package/kits/hub-game/code/server/actors.js +2 -1
- 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/companion.js +28 -3
- package/kits/hub-game/code/server/doorAnalytics.js +52 -0
- package/kits/hub-game/code/server/earned.js +22 -5
- package/kits/hub-game/code/server/frameBatch.js +183 -0
- package/kits/hub-game/code/server/friendsAmong.js +49 -9
- package/kits/hub-game/code/server/history.js +2 -0
- package/kits/hub-game/code/server/hub.js +1306 -95
- package/kits/hub-game/code/server/idle.js +30 -1
- package/kits/hub-game/code/server/index.js +26 -4
- package/kits/hub-game/code/server/invites.js +19 -0
- package/kits/hub-game/code/server/labels.js +9 -1
- package/kits/hub-game/code/server/loadAbandon.js +106 -0
- package/kits/hub-game/code/server/manifest.js +211 -3
- package/kits/hub-game/code/server/menu.js +31 -3
- package/kits/hub-game/code/server/npcs.js +226 -64
- 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/players.js +9 -1
- 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/standing.js +4 -5
- package/kits/hub-game/code/server/storageLimit.js +187 -0
- package/kits/hub-game/code/server/vis.js +67 -5
- package/kits/hub-game/code/shared/act.js +35 -0
- package/kits/hub-game/code/shared/danceIdle.js +28 -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 +35 -1
- package/kits/hub-game/code/systems/hub.js +970 -169
- package/kits/hub-game/docs/analytics.md +279 -0
- package/kits/hub-game/docs/contract.md +1257 -42
- package/kits/hub-game/docs/home-pieces.md +9 -2
- package/kits/hub-game/docs/observed-progress.md +252 -0
- package/kits/hub-game/main.jsx +2 -0
- package/kits/hub-game/package-lock.json +10 -3
- package/kits/hub-game/package.json +6 -3
- 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 +39 -5
- package/kits/hub-game/scripts/companion-follower-wire.json +1 -1
- package/kits/hub-game/scripts/fixtures/decor-keyless-draw.json +11 -0
- package/kits/hub-game/scripts/fixtures/decor-keyless.json +5 -5
- package/kits/hub-game/scripts/fixtures/engine-models-stub.mjs +3 -0
- package/kits/hub-game/scripts/fixtures/fake-dom.mjs +19 -3
- package/kits/hub-game/scripts/fixtures/interest-legacy.json +3 -3
- package/kits/hub-game/scripts/fixtures/vis-shared-wire.json +1 -1
- package/kits/hub-game/scripts/pose-storage-fixture.mjs +46 -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 +367 -2
- package/kits/hub-game/scripts/test-actors.mjs +20 -7
- 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-slot.mjs +85 -0
- package/kits/hub-game/scripts/test-avatar-wire.mjs +49 -10
- package/kits/hub-game/scripts/test-avatar.mjs +44 -0
- package/kits/hub-game/scripts/test-back-visibility.mjs +82 -0
- package/kits/hub-game/scripts/test-ballot.mjs +11 -4
- package/kits/hub-game/scripts/test-ban-join.mjs +121 -13
- package/kits/hub-game/scripts/test-build.mjs +20 -2
- package/kits/hub-game/scripts/test-chat.mjs +206 -5
- package/kits/hub-game/scripts/test-companion-chat.mjs +20 -2
- 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 +45 -4
- package/kits/hub-game/scripts/test-decor.mjs +7 -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.mjs +33 -3
- 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-grab-orbit.mjs +47 -4
- package/kits/hub-game/scripts/test-high-only.mjs +170 -0
- package/kits/hub-game/scripts/test-hub-ops.mjs +321 -2
- package/kits/hub-game/scripts/test-hub-trip.mjs +879 -11
- package/kits/hub-game/scripts/test-hud-clear.mjs +162 -59
- 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 +66 -0
- package/kits/hub-game/scripts/test-interest-cells.mjs +20 -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-labels.mjs +71 -3
- 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 +265 -0
- package/kits/hub-game/scripts/test-menu-client.mjs +105 -0
- package/kits/hub-game/scripts/test-menu.mjs +23 -0
- package/kits/hub-game/scripts/test-npcs.mjs +819 -10
- package/kits/hub-game/scripts/test-observed.mjs +745 -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 +234 -7
- 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 +699 -5
- 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 +145 -0
- package/kits/hub-game/scripts/test-signin-client.mjs +45 -0
- package/kits/hub-game/scripts/test-soundscape.mjs +22 -17
- package/kits/hub-game/scripts/test-standing.mjs +35 -2
- package/kits/hub-game/scripts/test-storage-limit.mjs +333 -0
- package/kits/hub-game/scripts/test-stuck.mjs +5 -4
- package/kits/hub-game/scripts/test-talk-overlay-dom.mjs +130 -0
- package/kits/hub-game/scripts/test-tiers-render.mjs +86 -13
- package/kits/hub-game/scripts/test-tiers.mjs +7 -8
- package/kits/hub-game/scripts/test-vis.mjs +433 -6
- 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 +50 -6
- package/kits/hub-game/scripts/test-yours.mjs +39 -8
- package/kits/multiplayer-3d/castle.json +5 -5
- package/kits/multiplayer-3d/code/client/joinFailure.js +27 -0
- package/kits/multiplayer-3d/code/client/resumeGate.js +139 -0
- package/kits/multiplayer-3d/code/systems/multiplayer.js +369 -30
- package/kits/multiplayer-3d/package-lock.json +8 -1
- package/kits/multiplayer-3d/package.json +2 -1
- package/kits/multiplayer-3d/scripts/test-join-watchdog.mjs +436 -0
- package/kits/multiplayer-3d/scripts/test-resume-gate.mjs +624 -0
- package/kits/physics-2d/CLAUDE.md +10 -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 +87 -5
- 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-3d/CLAUDE.md +25 -1651
- 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 +35 -18
- 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 +1 -1
- package/kits/physics-3d/engine3d/PlayOnly3D.jsx +5 -1
- package/kits/physics-3d/engine3d/Scene3DPlayer.jsx +19 -333
- package/kits/physics-3d/engine3d/actornode.js +1 -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/framecap.js +4 -1
- 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 +8 -0
- package/kits/physics-3d/engine3d/initialModelFiles.js +18 -0
- package/kits/physics-3d/engine3d/look.js +7 -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 +3 -3
- package/kits/physics-3d/engine3d/nearshadows.js +77 -10
- package/kits/physics-3d/engine3d/orbitinput.js +59 -25
- 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 +3 -3
- 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 +23 -15
- package/kits/physics-3d/engine3d/sky.js +1 -1
- 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/world3d.js +468 -18
- package/kits/physics-3d/eslint.config.js +2 -1
- package/kits/physics-3d/main.jsx +6 -3
- 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/test-camera-follow.mjs +5 -1
- package/kits/physics-3d/scripts/test-camera-orbit.mjs +52 -4
- package/kits/physics-3d/scripts/test-drop-empty-parts.mjs +1 -1
- package/kits/physics-3d/scripts/test-empty-gait-hints.mjs +89 -0
- package/kits/physics-3d/scripts/test-frame-cap-bob.mjs +6 -3
- package/kits/physics-3d/scripts/test-frame-cap.mjs +1 -1
- 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-look-bake.mjs +1 -1
- package/kits/physics-3d/scripts/test-near-shadows.mjs +2 -2
- package/kits/physics-3d/scripts/test-orbit-shadow-fade.mjs +88 -7
- package/kits/physics-3d/scripts/test-orbit-shift-lock.mjs +40 -3
- package/kits/physics-3d/scripts/test-orbit-shot.mjs +75 -1
- package/kits/physics-3d/scripts/test-rapier-gz.mjs +106 -0
- package/kits/physics-3d/scripts/test-sky.mjs +1 -1
- package/kits/physics-3d/scripts/test-square-first.mjs +921 -0
- package/kits/physics-3d/scripts/test-static-actors.mjs +3 -1
- package/kits/physics-3d/scripts/test-static-physics.mjs +4 -1
- package/kits/physics-3d/scripts/test-static-scenery.mjs +5 -2
- package/kits/physics-3d/scripts/test-steady-hover.mjs +5 -2
- package/kits/physics-3d/scripts/test-still-shadows.mjs +477 -0
- package/kits/physics-3d/systems/physics3d.js +37 -4
- 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/session.js +6 -4
- package/kits/real-time/package-lock.json +1 -1
- package/package.json +2 -2
|
@@ -24,11 +24,15 @@ import { artReady } from '@imports/castle.physics-2d/engine/art';
|
|
|
24
24
|
import { ActorNode, freezeWhenUnchanged, subtreeIsAsRecorded } from './actornode.js';
|
|
25
25
|
import { EMPTY_PASS_ABORTED, checkEmptyPass, updateEmptyNode, syncEmptyNodes, forgetEmptyNodes, releaseEmptyNode, watchEmptyNode, freezeEmptyNode } from './emptynodes.js';
|
|
26
26
|
import { remember, sameAs, recordReads, noteChangedStill } from './unchanged.js';
|
|
27
|
+
import { FrozenStatics, frozenNodeState, assertFrozenEqual } from './frozenstatics.js';
|
|
27
28
|
import { renderWithNearShadows, dropNearShadows } from './nearshadows.js';
|
|
28
29
|
import { fitOrbitLens, giveBackOrbitLens } from './orbitlens.js';
|
|
29
30
|
import { fitViewRange, giveBackViewRange } from './viewrange.js';
|
|
30
31
|
import { renderWithSky, leaveSky, skyHorizonColor } from './sky.js';
|
|
31
32
|
import { holdShadowFade, renderShadowFaded, dropShadowFade } from './shadowfade.js';
|
|
33
|
+
import { readLoadKey, actorMayWait, makeModelLoad, loadSummary, nearModelKeys,
|
|
34
|
+
consumerRegistryVersion, rememberModelConsumer, modelConsumerChanged } from './squarefirst.js';
|
|
35
|
+
export { ensureActorModel, prepareModelConsumers } from './modelready.js';
|
|
32
36
|
import {
|
|
33
37
|
takeModel,
|
|
34
38
|
releaseModel,
|
|
@@ -263,6 +267,7 @@ function ensureActorNode(world, actor, sprites, files, drops) {
|
|
|
263
267
|
entry = { node, sig };
|
|
264
268
|
if (model) {
|
|
265
269
|
addModelRig(world, entry, model, modelComponent, `${modelComponent.file}|${modelSig}`, {
|
|
270
|
+
actor,
|
|
266
271
|
sprites,
|
|
267
272
|
files,
|
|
268
273
|
drops,
|
|
@@ -292,24 +297,64 @@ function attachEmptyActor(world, id, entry) {
|
|
|
292
297
|
|
|
293
298
|
// The actor's model, from the shared build of it: a copy of its own, or,
|
|
294
299
|
// for a static model in the player, a place among that model's instances.
|
|
295
|
-
function addModelRig(world, entry, model, modelComponent, key, { sprites, files, drops }) {
|
|
300
|
+
function addModelRig(world, entry, model, modelComponent, key, { sprites, files, drops, actor, wait }) {
|
|
296
301
|
const file = modelComponent.file;
|
|
297
302
|
if (drops === true) key = `${key}|dropEmptyParts`;
|
|
298
303
|
entry.modelKey = key;
|
|
304
|
+
const load = world.modelLoadPass;
|
|
305
|
+
if (!wait && load && world.modelLoad === load && !load.restMarked && !world.instanceModels &&
|
|
306
|
+
!load.firstFiles.has(file) && actorMayWait(world, load.runtime, actor, load.inert) && !world.models.has(key)) {
|
|
307
|
+
const rig = new THREE.Group();
|
|
308
|
+
rig.position.y = modelComponent.yOffset ?? 0;
|
|
309
|
+
rig.scale.setScalar(modelComponent.scale ?? 1);
|
|
310
|
+
rig.userData.modelParts = new Map();
|
|
311
|
+
entry.node.userData.modelParts = rig.userData.modelParts;
|
|
312
|
+
const waiting = { load, key, entry, rig, actor, model, modelComponent, sprites, files, drops,
|
|
313
|
+
consumer: rememberModelConsumer(load, actor), horizonX: actor.components.Transform.x, horizonZ: actor.components.Transform.z };
|
|
314
|
+
entry.modelWait = waiting;
|
|
315
|
+
if (!load.pending.has(key)) load.pending.set(key, new Set());
|
|
316
|
+
load.pending.get(key).add(waiting);
|
|
317
|
+
load.pendingRevision++;
|
|
318
|
+
load.deferredKeys.add(key);
|
|
319
|
+
entry.node.add(rig);
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
299
322
|
const build = () => buildModelNode(model, sprites, files, file, [file], { optimize: true });
|
|
300
323
|
const template = takeModel(world.models, key, world.bakesLookLater ? () => buildBakingLater(world, key, build) : build);
|
|
324
|
+
if (wait) {
|
|
325
|
+
// Building may call consumer code. A cancelled wait never owns a user.
|
|
326
|
+
if (entry.modelWait !== wait || world.modelLoad !== wait.load || world.disposed) {
|
|
327
|
+
releaseModel(world.models, key, disposeNode);
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
forgetModelWait(wait);
|
|
331
|
+
}
|
|
332
|
+
const owner = wait?.load ?? (world.modelLoad === load ? load : null);
|
|
333
|
+
if (owner) {
|
|
334
|
+
owner.built.add(key);
|
|
335
|
+
if (!owner.synced && !wait) owner.firstKeys.add(key);
|
|
336
|
+
}
|
|
301
337
|
if (drops === true && withoutEmptyParts(template, model).children.length === 0) {
|
|
302
338
|
// A model that draws nothing has no rig; `modelParts` is there and empty.
|
|
303
|
-
entry.node.
|
|
339
|
+
if (wait) entry.node.remove(wait.rig);
|
|
340
|
+
else entry.node.userData.modelParts = new Map();
|
|
304
341
|
return;
|
|
305
342
|
}
|
|
306
343
|
const instanced = world.instanceModels && isStaticModel(template);
|
|
307
|
-
|
|
344
|
+
let rig = instanced ? new THREE.Group() : copyModel(template);
|
|
345
|
+
if (wait) {
|
|
346
|
+
const parts = entry.node.userData.modelParts;
|
|
347
|
+
for (const [id, part] of rig.userData.modelParts) parts.set(id, part);
|
|
348
|
+
wait.rig.copy(rig, false);
|
|
349
|
+
wait.rig.userData.modelParts = parts;
|
|
350
|
+
while (rig.children.length) wait.rig.add(rig.children[0]);
|
|
351
|
+
rig = wait.rig;
|
|
352
|
+
}
|
|
308
353
|
rig.position.y = modelComponent.yOffset ?? 0;
|
|
309
354
|
const scale = modelComponent.scale ?? 1;
|
|
310
355
|
rig.scale.set(scale, scale, scale);
|
|
311
356
|
entry.node.userData.modelParts = rig.userData.modelParts;
|
|
312
|
-
entry.node.add(rig);
|
|
357
|
+
if (!wait) entry.node.add(rig);
|
|
313
358
|
if (instanced) {
|
|
314
359
|
if (!world.instances.has(key)) {
|
|
315
360
|
world.instances.set(key, makeInstances(template, world.scene));
|
|
@@ -317,6 +362,245 @@ function addModelRig(world, entry, model, modelComponent, key, { sprites, files,
|
|
|
317
362
|
world.instances.get(key).rigs.add(rig);
|
|
318
363
|
entry.instancedRig = rig;
|
|
319
364
|
}
|
|
365
|
+
if (!wait && load?.pending.has(key)) fillWaitingModel(world, load, key);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// Waiting rigs hold no shared-build user. Only takeModel, above, acquires one.
|
|
369
|
+
function forgetModelWait(wait) {
|
|
370
|
+
const entries = wait.load.pending.get(wait.key);
|
|
371
|
+
if (entries?.delete(wait)) wait.load.pendingRevision++;
|
|
372
|
+
if (entries?.size === 0) wait.load.pending.delete(wait.key);
|
|
373
|
+
delete wait.entry.modelWait;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
const loadBindings = new WeakMap();
|
|
377
|
+
|
|
378
|
+
function clearModelLoad(world) {
|
|
379
|
+
const load = world.modelLoad;
|
|
380
|
+
if (!load) return;
|
|
381
|
+
delete world.modelLoad;
|
|
382
|
+
delete world.loadQueue;
|
|
383
|
+
if (load.beforeBehavior && load.runtime.beforeBehavior === load.beforeBehavior) {
|
|
384
|
+
if (load.hadBeforeBehavior) load.runtime.beforeBehavior = load.priorBeforeBehavior;
|
|
385
|
+
else delete load.runtime.beforeBehavior;
|
|
386
|
+
}
|
|
387
|
+
world.modelLoadClearing = true;
|
|
388
|
+
leavingTheEngine(world);
|
|
389
|
+
// Drop incomplete nodes before a swap can park/reuse one by signature.
|
|
390
|
+
let failed;
|
|
391
|
+
try {
|
|
392
|
+
for (const waits of [...load.pending.values()]) {
|
|
393
|
+
for (const wait of [...waits]) {
|
|
394
|
+
world.frozenStatics?.pending.dirty.add(wait.actor);
|
|
395
|
+
try { releaseActorNode(world, wait.entry); } catch (error) { failed ??= { error }; }
|
|
396
|
+
if (world.nodes.get(wait.actor.id) === wait.entry) world.nodes.delete(wait.actor.id);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
} finally {
|
|
400
|
+
load.pending.clear();
|
|
401
|
+
load.pendingRevision++;
|
|
402
|
+
delete world.modelLoadClearing;
|
|
403
|
+
}
|
|
404
|
+
if (failed) throw failed.error;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
function beginModelLoad(world, runtime, sprites) {
|
|
408
|
+
if (world.modelLoadClearing) return null;
|
|
409
|
+
// The editor owns/reads arbitrary actor subtrees and renders without a
|
|
410
|
+
// playing runtime. Like the other static optimizations, load is play-only.
|
|
411
|
+
const setting = world.staticActorsOff === true ? null : readLoadKey(runtime.data);
|
|
412
|
+
let load = world.modelLoad;
|
|
413
|
+
if (load && (load.runtime !== runtime || load.data !== runtime.data ||
|
|
414
|
+
load.sceneKey !== (runtime.sceneKey ?? runtime.scenePath) || load.setting !== JSON.stringify(setting))) {
|
|
415
|
+
clearModelLoad(world);
|
|
416
|
+
load = null;
|
|
417
|
+
}
|
|
418
|
+
if (!setting || world.disposed) return null;
|
|
419
|
+
if (!load) {
|
|
420
|
+
load = world.modelLoad = makeModelLoad(world, runtime, setting);
|
|
421
|
+
load.ensureActor = id => {
|
|
422
|
+
const wait = world.nodes.get(id)?.modelWait;
|
|
423
|
+
if (!wait || wait.load !== load || world.modelLoad !== load || world.disposed ||
|
|
424
|
+
runtime.data !== load.data || JSON.stringify(readLoadKey(runtime.data)) !== load.setting) return;
|
|
425
|
+
fillWaitingModel(world, load, wait.key);
|
|
426
|
+
finishModelLoad(world, load);
|
|
427
|
+
};
|
|
428
|
+
load.prepareConsumers = actorId => {
|
|
429
|
+
if (world.modelLoad !== load || runtime.data !== load.data || world.disposed) return;
|
|
430
|
+
if (actorId !== undefined) {
|
|
431
|
+
const wait = world.nodes.get(actorId)?.modelWait;
|
|
432
|
+
if (wait?.load === load) checkModelConsumer(world, load, wait);
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
for (const waits of load.pending.values()) for (const wait of waits) checkModelConsumer(world, load, wait);
|
|
436
|
+
};
|
|
437
|
+
if (runtime.callsBeforeBehavior === true) {
|
|
438
|
+
load.hadBeforeBehavior = Object.hasOwn(runtime, 'beforeBehavior');
|
|
439
|
+
load.priorBeforeBehavior = runtime.beforeBehavior;
|
|
440
|
+
load.beforeBehavior = (actor, name) => {
|
|
441
|
+
load.priorBeforeBehavior?.call(runtime, actor, name);
|
|
442
|
+
if (world.modelLoad === load && world.nodes.get(actor.id)?.modelWait &&
|
|
443
|
+
!actorMayWait(world, runtime, actor, load.inert)) load.ensureActor(actor.id);
|
|
444
|
+
};
|
|
445
|
+
runtime.beforeBehavior = load.beforeBehavior;
|
|
446
|
+
}
|
|
447
|
+
Object.defineProperty(world, 'loadQueue', { configurable: true, get: () => loadSummary(load, world) });
|
|
448
|
+
if (runtime.registerSystem && loadBindings.get(world) !== runtime) {
|
|
449
|
+
loadBindings.set(world, runtime);
|
|
450
|
+
const reset = () => { if (world.modelLoad?.runtime === runtime) clearModelLoad(world); };
|
|
451
|
+
runtime.registerSystem({ reset, dispose: reset });
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
// A sleeping/detached actor is skipped by ordinary placement. Validate its
|
|
455
|
+
// wait here too, so despawns/asset edits cannot fill an obsolete node.
|
|
456
|
+
for (const [key, waits] of [...load.pending]) {
|
|
457
|
+
let promote = false;
|
|
458
|
+
for (const wait of [...waits]) {
|
|
459
|
+
if (world.modelLoad !== load || wait.entry.modelWait !== wait) continue;
|
|
460
|
+
const actor = runtime.getActor?.(wait.actor.id) ?? runtime.getActors().find(a => a.id === wait.actor.id);
|
|
461
|
+
const t = actor?.components.Transform;
|
|
462
|
+
if (t && (t.x !== wait.horizonX || t.z !== wait.horizonZ)) {
|
|
463
|
+
wait.horizonX = t.x; wait.horizonZ = t.z; load.pendingRevision++;
|
|
464
|
+
}
|
|
465
|
+
const sig = waitingSignature(runtime, actor, sprites);
|
|
466
|
+
if (world.instanceModels || actor !== wait.actor || sig !== wait.entry.sig) {
|
|
467
|
+
replaceModelWait(world, load, wait, actor, sprites);
|
|
468
|
+
} else if (!actorMayWait(world, runtime, actor, load.inert)) {
|
|
469
|
+
load.firstFiles.add(actor.components.Model.file);
|
|
470
|
+
promote = true;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
if (promote && load.pending.has(key)) fillWaitingModel(world, load, key);
|
|
474
|
+
}
|
|
475
|
+
return load;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
function checkModelConsumer(world, load, wait) {
|
|
479
|
+
if (wait.entry.modelWait !== wait || world.modelLoad !== load) return;
|
|
480
|
+
// A previous fill can invoke a listener that registers another behaviour.
|
|
481
|
+
const revision = consumerRegistryVersion(load);
|
|
482
|
+
if (world.instanceModels || load.runtime.getActor(wait.actor.id) !== wait.actor || modelConsumerChanged(load, wait, revision)) {
|
|
483
|
+
load.ensureActor(wait.actor.id);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
function waitingSignature(runtime, actor, sprites) {
|
|
488
|
+
return actor?.components.Transform && builtAs(runtime.dropsEmptyParts === true,
|
|
489
|
+
nodeSignature(actor, sprites, actorModelSig(actor, sprites, runtime.files)));
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
// A stale captured model cannot be filled. Rebuild through ordinary placement
|
|
493
|
+
// now, including sleeping roots that normal sync skips. A replacement gets
|
|
494
|
+
// ordinary placement's fresh attachment so tier controllers can adopt it;
|
|
495
|
+
// retaining an unowned detached replacement would hide it permanently.
|
|
496
|
+
function replaceModelWait(world, load, wait, actor, sprites) {
|
|
497
|
+
const current = world.nodes.get(wait.actor.id) === wait.entry;
|
|
498
|
+
const parent = wait.entry.node.parent;
|
|
499
|
+
leavingTheEngine(world);
|
|
500
|
+
releaseActorNode(world, wait.entry);
|
|
501
|
+
if (!current || world.nodes.get(wait.actor.id) !== wait.entry) return;
|
|
502
|
+
world.nodes.delete(wait.actor.id);
|
|
503
|
+
world.frozenStatics?.pending.dirty.add(actor ?? wait.actor);
|
|
504
|
+
if (!actor?.components.Transform || world.modelLoad !== load || world.disposed) return;
|
|
505
|
+
load.firstFiles.add(actor.components.Model?.file);
|
|
506
|
+
const entry = placeActor(world, actor, actor.components.Transform, sprites, load.runtime.files,
|
|
507
|
+
undefined, load.runtime.dropsEmptyParts === true);
|
|
508
|
+
if (parent && parent !== world.scene) outsideCall(world, () => {
|
|
509
|
+
entry.node.removeFromParent();
|
|
510
|
+
parent?.add(entry.node);
|
|
511
|
+
});
|
|
512
|
+
entry.node.updateWorldMatrix(true, true);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
function markLoad(world, load, name) {
|
|
516
|
+
if (world.onStage) outsideCall(world, () => world.onStage(name, loadSummary(load, world)));
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
function finishModelLoad(world, load) {
|
|
520
|
+
if (load.restMarked || load.pending.size || !load.synced || world.modelLoad !== load) return;
|
|
521
|
+
load.restMarked = true;
|
|
522
|
+
markLoad(world, load, 'load:rest-built');
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
function fillWaitingModel(world, load, key) {
|
|
526
|
+
const waits = load.pending.get(key);
|
|
527
|
+
if (!waits) return;
|
|
528
|
+
// Invalidate static adoption before adding children, then explicitly update
|
|
529
|
+
// the filled subtree. FrozenStatics' event hooks rewatch it next sync.
|
|
530
|
+
leavingTheEngine(world);
|
|
531
|
+
for (const wait of [...waits]) {
|
|
532
|
+
if (world.modelLoad !== load || world.disposed) break;
|
|
533
|
+
if (wait.entry.modelWait !== wait) continue;
|
|
534
|
+
const actor = load.runtime.getActor ? load.runtime.getActor(wait.actor.id)
|
|
535
|
+
: load.runtime.getActors().find(actor => actor.id === wait.actor.id);
|
|
536
|
+
const sprites = load.runtime.sprites ?? wait.sprites;
|
|
537
|
+
if (world.nodes.get(wait.actor.id) !== wait.entry || actor !== wait.actor ||
|
|
538
|
+
waitingSignature(load.runtime, actor, sprites) !== wait.entry.sig) {
|
|
539
|
+
replaceModelWait(world, load, wait, actor, sprites);
|
|
540
|
+
continue;
|
|
541
|
+
}
|
|
542
|
+
world.frozenStatics?.thawActor(wait.actor);
|
|
543
|
+
const baseKey = wait.drops ? key.slice(0, -'|dropEmptyParts'.length) : key;
|
|
544
|
+
addModelRig(world, wait.entry, wait.model, wait.modelComponent, baseKey, { ...wait, wait });
|
|
545
|
+
if (world.modelLoad !== load || world.disposed) break;
|
|
546
|
+
// Preserve deliberate tier/decor detachment: only the empty-node keeper
|
|
547
|
+
// owns emptyDetached. Waiting rigs themselves prevent empty detachment.
|
|
548
|
+
wait.entry.node.updateWorldMatrix(true, true);
|
|
549
|
+
// Play-only engine.load notification, once per filled actor (including
|
|
550
|
+
// empty models). Consumers may invalidate bounds without owning the rig.
|
|
551
|
+
outsideCall(world, () => world.scene.dispatchEvent({
|
|
552
|
+
type: 'modelfilled', actorId: actor.id, node: wait.entry.node,
|
|
553
|
+
}));
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
// Compare against earlier intervals, so a single long frame does not raise
|
|
558
|
+
// its own threshold. Keep sampling even while all pending keys are far away.
|
|
559
|
+
function slowModelFrame(load, now) {
|
|
560
|
+
const interval = now - load.drawnAt;
|
|
561
|
+
load.drawnAt = now;
|
|
562
|
+
const sorted = [...load.frameIntervals].sort((a, b) => a - b);
|
|
563
|
+
const middle = sorted.length >> 1;
|
|
564
|
+
const median = sorted.length ? (sorted.length % 2 ? sorted[middle] : (sorted[middle - 1] + sorted[middle]) / 2) : 0;
|
|
565
|
+
if (!Number.isFinite(interval) || interval < 0) return false;
|
|
566
|
+
load.frameIntervals.push(interval);
|
|
567
|
+
if (load.frameIntervals.length > 9) load.frameIntervals.shift();
|
|
568
|
+
return interval > Math.max(2 * median, 50);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
function drainModelLoad(world, runtime, drawnAt) {
|
|
572
|
+
const load = world.modelLoad;
|
|
573
|
+
if (!load || load.runtime !== runtime || load.data !== runtime?.data || world.disposed || load.draining) return;
|
|
574
|
+
const start = load.now();
|
|
575
|
+
if (!load.drawn) { load.drawn = true; load.drawnAt = drawnAt; return; }
|
|
576
|
+
if (!load.pending.size) { finishModelLoad(world, load); return; }
|
|
577
|
+
const slow = slowModelFrame(load, drawnAt);
|
|
578
|
+
let near = nearModelKeys(world, load);
|
|
579
|
+
if (!near.size) { load.skippedFrames = 0; return; }
|
|
580
|
+
if (slow && load.skippedFrames < 3) { load.skippedFrames++; return; }
|
|
581
|
+
load.skippedFrames = 0;
|
|
582
|
+
const camera = new THREE.Vector3(), position = new THREE.Vector3();
|
|
583
|
+
let built = 0;
|
|
584
|
+
load.draining = true;
|
|
585
|
+
try {
|
|
586
|
+
while (load.pending.size && world.modelLoad === load && (!built || load.now() - start < load.sliceMs)) {
|
|
587
|
+
let nearestKey, nearest = Infinity;
|
|
588
|
+
world.camera.getWorldPosition(camera);
|
|
589
|
+
if (built) near = nearModelKeys(world, load);
|
|
590
|
+
for (const [key, waits] of load.pending) {
|
|
591
|
+
if (!near.has(key)) continue;
|
|
592
|
+
for (const wait of waits) {
|
|
593
|
+
wait.entry.node.getWorldPosition(position);
|
|
594
|
+
const distance = position.distanceToSquared(camera);
|
|
595
|
+
if (nearestKey === undefined || distance < nearest) { nearest = distance; nearestKey = key; }
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
if (nearestKey === undefined || (built && load.now() - start >= load.sliceMs)) break;
|
|
599
|
+
fillWaitingModel(world, load, nearestKey);
|
|
600
|
+
built++;
|
|
601
|
+
}
|
|
602
|
+
finishModelLoad(world, load);
|
|
603
|
+
} finally { load.draining = false; }
|
|
320
604
|
}
|
|
321
605
|
|
|
322
606
|
//
|
|
@@ -328,7 +612,7 @@ function addModelRig(world, entry, model, modelComponent, key, { sprites, files,
|
|
|
328
612
|
// frame. For a scene that asks, a placed model is built without the groups
|
|
329
613
|
// that draw nothing (optimize.js `dropEmptyGroups` has what goes and what
|
|
330
614
|
// always stays), and an actor whose model draws nothing at all gets no rig
|
|
331
|
-
// under its node.
|
|
615
|
+
// under its node. docs/engine-skip-work.md has the terms.
|
|
332
616
|
//
|
|
333
617
|
// With the key absent nothing here runs but the tests of `drops`: a node's
|
|
334
618
|
// signature, a shared build's key and the build are what they were. With it,
|
|
@@ -375,8 +659,16 @@ function buildBakingLater(world, key, build) {
|
|
|
375
659
|
// Removes an actor's node. A shared model build is given back rather than
|
|
376
660
|
// disposed, since other actors may still draw it.
|
|
377
661
|
function releaseActorNode(world, entry) {
|
|
662
|
+
const waiting = entry.modelWait;
|
|
663
|
+
if (waiting) forgetModelWait(waiting);
|
|
664
|
+
if (world.frozenStatics) {
|
|
665
|
+
for (const [actor, record] of world.frozenStatics.records) {
|
|
666
|
+
if (record.node === entry.node) { world.frozenStatics.forget(actor); break; }
|
|
667
|
+
}
|
|
668
|
+
}
|
|
378
669
|
if (world.emptyNodes) releaseEmptyNode(world, entry.node);
|
|
379
670
|
world.scene.remove(entry.node);
|
|
671
|
+
if (waiting) return;
|
|
380
672
|
if (!entry.modelKey) {
|
|
381
673
|
disposeNode(entry.node);
|
|
382
674
|
return;
|
|
@@ -400,7 +692,43 @@ const DEG = Math.PI / 180;
|
|
|
400
692
|
// degrees.
|
|
401
693
|
// Worlds that never asked do not enter any empty-node lifecycle helpers.
|
|
402
694
|
export function syncActors(world, runtime, sprites, dt = 0) {
|
|
695
|
+
if (world.modelLoadClearing) return;
|
|
696
|
+
// The empty-node lifecycle can deliberately reject a reentrant sync. It
|
|
697
|
+
// must not become the load queue's first completed actor pass either.
|
|
698
|
+
if ((runtime.data?.engine?.load || world.modelLoad) && world.emptyNodesOwned &&
|
|
699
|
+
(world.emptyNodesBlocked || world.emptyNodes?.dispatchDepth || world.emptyNodes?.draining)) {
|
|
700
|
+
return syncActorPass(world, runtime, sprites, dt);
|
|
701
|
+
}
|
|
702
|
+
const load = beginModelLoad(world, runtime, sprites);
|
|
703
|
+
if (!load && !world.modelLoadPass) return syncActorPass(world, runtime, sprites, dt);
|
|
704
|
+
const previous = world.modelLoadPass;
|
|
705
|
+
world.modelLoadPass = load;
|
|
706
|
+
try {
|
|
707
|
+
syncActorPass(world, runtime, sprites, dt);
|
|
708
|
+
if (load && world.modelLoad === load && !load.synced) {
|
|
709
|
+
// Resident nodes may already be complete without another takeModel.
|
|
710
|
+
for (const entry of world.nodes.values()) {
|
|
711
|
+
if (entry.modelKey && !entry.modelWait) {
|
|
712
|
+
load.built.add(entry.modelKey);
|
|
713
|
+
load.firstKeys.add(entry.modelKey);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
load.synced = true;
|
|
717
|
+
markLoad(world, load, 'load:first-built');
|
|
718
|
+
}
|
|
719
|
+
if (load) finishModelLoad(world, load);
|
|
720
|
+
} finally {
|
|
721
|
+
if (previous) world.modelLoadPass = previous;
|
|
722
|
+
else delete world.modelLoadPass;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
function syncActorPass(world, runtime, sprites, dt) {
|
|
403
727
|
try {
|
|
728
|
+
if (world.frozenStatics && (world.frozenStatics.owner !== runtime.frozenActors || world.disposed || world.staticActorsOff || world.instanceModels)) {
|
|
729
|
+
world.frozenStatics.dispose();
|
|
730
|
+
delete world.frozenStatics;
|
|
731
|
+
}
|
|
404
732
|
if (world.emptyNodesOwned) {
|
|
405
733
|
const state = world.emptyNodes;
|
|
406
734
|
if (world.disposed || world.emptyNodesBlocked || (world.emptyPass && state !== world.emptyPass)) return;
|
|
@@ -457,12 +785,16 @@ function syncActorsWithEmptyNodes(world, runtime, sprites, dt, state) {
|
|
|
457
785
|
}
|
|
458
786
|
|
|
459
787
|
// `syncActors` as it always was.
|
|
460
|
-
function
|
|
788
|
+
function skipEmptyGaitHints(world, runtime) {
|
|
789
|
+
return world.staticActorsOff !== true && runtime.data?.engine?.skipEmptyGaitHints === true;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
function animateActor(world, entry, dt, actor, skipEmptyHints) {
|
|
461
793
|
const elapsed = animationDt(entry, dt);
|
|
462
794
|
if (elapsed === null) return;
|
|
463
|
-
animateModelParts(entry, elapsed, world.emptyPass ? world : undefined);
|
|
795
|
+
animateModelParts(entry, elapsed, world.emptyPass ? world : undefined, skipEmptyHints);
|
|
464
796
|
if (world.emptyPass) checkEmptyPass(world);
|
|
465
|
-
animateMotion(entry, elapsed, actor, world.emptyPass ? world : undefined);
|
|
797
|
+
animateMotion(entry, elapsed, actor, world.emptyPass ? world : undefined, skipEmptyHints);
|
|
466
798
|
if (world.emptyPass) checkEmptyPass(world);
|
|
467
799
|
}
|
|
468
800
|
|
|
@@ -473,6 +805,7 @@ function renderActorSleeps(world, actor) {
|
|
|
473
805
|
}
|
|
474
806
|
|
|
475
807
|
function syncActorsAsEver(world, runtime, sprites, dt, place = placeActor) {
|
|
808
|
+
const skipEmptyHints = skipEmptyGaitHints(world, runtime);
|
|
476
809
|
const drops = runtime.dropsEmptyParts === true;
|
|
477
810
|
world.bakesLookLater = runtime.bakesLookLater === true;
|
|
478
811
|
if (runtime.skipsUnchangedActors === true && world.disposed !== true) {
|
|
@@ -497,7 +830,7 @@ function syncActorsAsEver(world, runtime, sprites, dt, place = placeActor) {
|
|
|
497
830
|
seen.add(actor.id);
|
|
498
831
|
if (renderActorSleeps(world, actor)) continue;
|
|
499
832
|
const entry = place(world, actor, t, sprites, runtime.files, undefined, drops);
|
|
500
|
-
animateActor(world, entry, dt, actor);
|
|
833
|
+
animateActor(world, entry, dt, actor, skipEmptyHints);
|
|
501
834
|
}
|
|
502
835
|
for (const [id, entry] of world.nodes) {
|
|
503
836
|
if (seen.has(id)) continue;
|
|
@@ -612,13 +945,17 @@ function drawFrame(world, runtime) {
|
|
|
612
945
|
if (!world.nearShadows && !(distance > 0 && world.disposed !== true)) {
|
|
613
946
|
drawWorld(world);
|
|
614
947
|
} else if (fade) {
|
|
615
|
-
renderShadowFaded(fade, () => drawNear(world, distance, fade));
|
|
948
|
+
renderShadowFaded(fade, () => drawNear(world, distance, fade, runtime));
|
|
616
949
|
} else {
|
|
617
|
-
drawNear(world, distance);
|
|
950
|
+
drawNear(world, distance, undefined, runtime);
|
|
618
951
|
}
|
|
952
|
+
// Sample actual draw times, before this frame's deferred bake can delay us.
|
|
953
|
+
const drawnLoad = world.modelLoad;
|
|
954
|
+
const drawnAt = drawnLoad?.now();
|
|
619
955
|
// Only a world that has built a model for a scene that set
|
|
620
956
|
// `"engine": { "look": { "bake": "deferred" } }` has anything here.
|
|
621
957
|
if (world.lookBake) bakeLooks(world);
|
|
958
|
+
if (drawnLoad && world.modelLoad === drawnLoad) drainModelLoad(world, runtime, drawnAt);
|
|
622
959
|
}
|
|
623
960
|
|
|
624
961
|
// A little of the baking such a scene's models are waiting for, now that the
|
|
@@ -670,7 +1007,7 @@ function orbitFrame(world, runtime) {
|
|
|
670
1007
|
}
|
|
671
1008
|
|
|
672
1009
|
// A frame through the near-shadow mode (nearshadows.js), faded or not.
|
|
673
|
-
function drawNear(world, distance, fade) {
|
|
1010
|
+
function drawNear(world, distance, fade, runtime) {
|
|
674
1011
|
renderWithNearShadows(
|
|
675
1012
|
world,
|
|
676
1013
|
distance,
|
|
@@ -678,7 +1015,8 @@ function drawNear(world, distance, fade) {
|
|
|
678
1015
|
() => world.composer.render(),
|
|
679
1016
|
// Made once per world; unchanged frames neither call nor allocate it.
|
|
680
1017
|
(world.nearShadowCall ??= (fn) => outsideCall(world, fn)),
|
|
681
|
-
fade
|
|
1018
|
+
fade,
|
|
1019
|
+
runtime
|
|
682
1020
|
);
|
|
683
1021
|
}
|
|
684
1022
|
|
|
@@ -717,6 +1055,10 @@ export function disposeWorld(world) {
|
|
|
717
1055
|
// such a sync writes nothing down; what was written down before goes now,
|
|
718
1056
|
// and again after the listeners have run, whether or not one throws.
|
|
719
1057
|
world.disposed = true;
|
|
1058
|
+
if (world.frozenStatics) {
|
|
1059
|
+
world.frozenStatics.dispose();
|
|
1060
|
+
delete world.frozenStatics;
|
|
1061
|
+
}
|
|
720
1062
|
// With no keeper this is counted by `unkept`, just like a plain sync.
|
|
721
1063
|
outsideCall(world, () => {
|
|
722
1064
|
// Every cleanup runs even when an earlier one throws. Keep the first
|
|
@@ -725,6 +1067,7 @@ export function disposeWorld(world) {
|
|
|
725
1067
|
const clean = (fn) => {
|
|
726
1068
|
try { fn(); } catch (err) { first ??= { err }; }
|
|
727
1069
|
};
|
|
1070
|
+
if (world.modelLoad) clean(() => clearModelLoad(world));
|
|
728
1071
|
try {
|
|
729
1072
|
clean(() => giveBackOrbitLens(world));
|
|
730
1073
|
if (world.viewRange) clean(() => giveBackViewRange(world));
|
|
@@ -830,7 +1173,7 @@ function disposeNodes(world) {
|
|
|
830
1173
|
// and `files` tables, `runtime.getActors`, three.js math, and building
|
|
831
1174
|
// signatures from plain data (`JSON.stringify` calls no one for those). A
|
|
832
1175
|
// scene whose components are not plain stored data is outside the key's terms
|
|
833
|
-
// (
|
|
1176
|
+
// (docs/engine-skip-work.md).
|
|
834
1177
|
//
|
|
835
1178
|
// What is written down, and where:
|
|
836
1179
|
// - `world.snapshots`, a WeakMap from a node entry to what the node was built
|
|
@@ -858,6 +1201,7 @@ const MODEL_SIGS_LIMIT = 512;
|
|
|
858
1201
|
// that is not the engine's. See the list above.
|
|
859
1202
|
function leavingTheEngine(world) {
|
|
860
1203
|
world.generation += 1;
|
|
1204
|
+
if (world.frozenStatics) world.frozenStatics.invalidate();
|
|
861
1205
|
// And nothing is frozen while code that is not the engine's runs inside a
|
|
862
1206
|
// pass (only a world that holds actors still has anything here).
|
|
863
1207
|
if (world.stillKeeper) dropStill(world);
|
|
@@ -909,6 +1253,7 @@ function syncActorsSkipping(world, runtime, sprites, dt, drops, place = placeAct
|
|
|
909
1253
|
// One pass. `started` is the generation it may trust its state at; a pass
|
|
910
1254
|
// entered inside another is given one that never matches.
|
|
911
1255
|
function skippingPass(world, runtime, sprites, dt, started, drops, pass, place = placeActor) {
|
|
1256
|
+
const skipEmptyHints = skipEmptyGaitHints(world, runtime);
|
|
912
1257
|
beginPass(world, runtime, sprites);
|
|
913
1258
|
if (world.emptyPass) checkEmptyPass(world);
|
|
914
1259
|
if (world.generation === started) {
|
|
@@ -926,7 +1271,7 @@ function skippingPass(world, runtime, sprites, dt, started, drops, pass, place =
|
|
|
926
1271
|
seen.add(actor.id);
|
|
927
1272
|
if (renderActorSleeps(world, actor)) continue;
|
|
928
1273
|
const entry = place(world, actor, t, sprites, runtime.files, started, drops);
|
|
929
|
-
animateActor(world, entry, dt, actor);
|
|
1274
|
+
animateActor(world, entry, dt, actor, skipEmptyHints);
|
|
930
1275
|
}
|
|
931
1276
|
// While the pass was alone every actor seen has its node and no node was
|
|
932
1277
|
// released, so as many nodes as actors seen means no node has lost its actor.
|
|
@@ -1163,6 +1508,9 @@ function buildNode(world, old, actor, sig, modelSig, sprites, files, drops) {
|
|
|
1163
1508
|
if (world.emptyPass) {
|
|
1164
1509
|
attachEmptyActor(world, actor.id, entry);
|
|
1165
1510
|
} else {
|
|
1511
|
+
// A frozen pass retries a failed batch. Own an attached node even when a
|
|
1512
|
+
// childadded listener throws, so retrying cannot leave a visible orphan.
|
|
1513
|
+
if (world.frozenStatics) world.nodes.set(actor.id, entry);
|
|
1166
1514
|
world.scene.add(entry.node);
|
|
1167
1515
|
world.nodes.set(actor.id, entry);
|
|
1168
1516
|
}
|
|
@@ -1173,7 +1521,7 @@ function fillNode(world, entry, actor, modelSig, sprites, files, drops) {
|
|
|
1173
1521
|
const { Model: placed, Shape: shape } = actor.components;
|
|
1174
1522
|
const model = placed?.file ? parseModelCached(files?.[placed.file]) : null;
|
|
1175
1523
|
if (model) {
|
|
1176
|
-
addModelRig(world, entry, model, placed, `${placed.file}|${modelSig}`, { sprites, files, drops });
|
|
1524
|
+
addModelRig(world, entry, model, placed, `${placed.file}|${modelSig}`, { sprites, files, drops, actor });
|
|
1177
1525
|
} else if (shape) {
|
|
1178
1526
|
entry.node.add(makeShapeMesh(shape, sprites));
|
|
1179
1527
|
}
|
|
@@ -1224,7 +1572,7 @@ function sameQuaternion(q, was) {
|
|
|
1224
1572
|
// such actors in its file (`"static": true` on the actor), its runtime holds
|
|
1225
1573
|
// them still (physics-2d engine/scene.js: `stillActors`, `stillVersion`,
|
|
1226
1574
|
// `touch`), and this world leaves them out of its pass and freezes their nodes
|
|
1227
|
-
// (actornode.js).
|
|
1575
|
+
// (actornode.js). docs/engine-static-actors.md has the terms. The rule:
|
|
1228
1576
|
//
|
|
1229
1577
|
// A pass is ORDINARY (every actor, as the skipping pass above runs it)
|
|
1230
1578
|
// unless the still set and the things its actors share read as they did
|
|
@@ -1371,6 +1719,10 @@ function outsideCall(world, fn) {
|
|
|
1371
1719
|
// from inside one (or with none running), and while the count is not zero
|
|
1372
1720
|
// no pass is settled and none adopts.
|
|
1373
1721
|
function syncActorsKept(world, runtime, sprites, dt, place = placeActor) {
|
|
1722
|
+
if (runtime.freezesStatics === true && !world.disposed && !world.staticActorsOff && !world.instanceModels) {
|
|
1723
|
+
syncFrozenActors(world, runtime, sprites, dt, place);
|
|
1724
|
+
return;
|
|
1725
|
+
}
|
|
1374
1726
|
const keeper = (world.stillKeeper ??= runtime.newStillKeeper());
|
|
1375
1727
|
if (runtime.keepsStaticActors === true && world.disposed !== true) {
|
|
1376
1728
|
world.bakesLookLater = runtime.bakesLookLater === true;
|
|
@@ -1386,6 +1738,103 @@ function syncActorsKept(world, runtime, sprites, dt, place = placeActor) {
|
|
|
1386
1738
|
}
|
|
1387
1739
|
}
|
|
1388
1740
|
|
|
1741
|
+
// The new opt-in never filters the full actor list on an unchanged frame.
|
|
1742
|
+
// Writes feed this world's queue; live/fallback actors retain the old checks.
|
|
1743
|
+
function syncFrozenActors(world, runtime, sprites, dt, place) {
|
|
1744
|
+
const state = world.frozenStatics ??= new FrozenStatics(world, runtime);
|
|
1745
|
+
if (world.syncDepth > 0) {
|
|
1746
|
+
state.invalidate();
|
|
1747
|
+
syncActorsSkipping(world, runtime, sprites, dt, runtime.dropsEmptyParts === true, place);
|
|
1748
|
+
return;
|
|
1749
|
+
}
|
|
1750
|
+
const drops = runtime.dropsEmptyParts === true;
|
|
1751
|
+
world.skipping.on = true;
|
|
1752
|
+
world.bakesLookLater = runtime.bakesLookLater === true;
|
|
1753
|
+
world.syncDepth++;
|
|
1754
|
+
let finished = false;
|
|
1755
|
+
let actors = [];
|
|
1756
|
+
try {
|
|
1757
|
+
beginPass(world, runtime, sprites);
|
|
1758
|
+
if (world.frozenStatics !== state) return;
|
|
1759
|
+
world.syncCount++;
|
|
1760
|
+
world.sigEpoch++;
|
|
1761
|
+
state.assets ??= new Map();
|
|
1762
|
+
state.arts ??= new Map();
|
|
1763
|
+
const shared = `${drops}|${lookIsEnabled()}`;
|
|
1764
|
+
let changed = shared !== state.shared;
|
|
1765
|
+
state.shared = shared;
|
|
1766
|
+
for (const [file, was] of state.assets) {
|
|
1767
|
+
const now = modelSigOf(world, file, sprites, runtime.files);
|
|
1768
|
+
if (now !== was) changed = true;
|
|
1769
|
+
state.assets.set(file, now);
|
|
1770
|
+
}
|
|
1771
|
+
for (const [art, was] of state.arts) {
|
|
1772
|
+
const now = artRefSignature(art, sprites);
|
|
1773
|
+
if (now !== was) changed = true;
|
|
1774
|
+
state.arts.set(art, now);
|
|
1775
|
+
}
|
|
1776
|
+
if (changed) state.invalidate();
|
|
1777
|
+
actors = state.take();
|
|
1778
|
+
const skipHints = skipEmptyGaitHints(world, runtime);
|
|
1779
|
+
const started = world.generation;
|
|
1780
|
+
for (const actor of actors) {
|
|
1781
|
+
if (world.frozenStatics !== state) return;
|
|
1782
|
+
const t = actor.components.Transform;
|
|
1783
|
+
if (runtime.getActor(actor.id) !== actor || runtime.isActorSleeping(actor) || !t) {
|
|
1784
|
+
if (runtime.getActor(actor.id) && runtime.getActor(actor.id) !== actor) { state.forget(actor); continue; }
|
|
1785
|
+
const entry = world.nodes.get(actor.id);
|
|
1786
|
+
if (entry) { releaseNode(world, entry); world.nodes.delete(actor.id); }
|
|
1787
|
+
state.forget(actor);
|
|
1788
|
+
continue;
|
|
1789
|
+
}
|
|
1790
|
+
if (renderActorSleeps(world, actor)) continue;
|
|
1791
|
+
state.thawActor(actor);
|
|
1792
|
+
const entry = place(world, actor, t, sprites, runtime.files, started, drops);
|
|
1793
|
+
animateActor(world, entry, dt, actor, skipHints);
|
|
1794
|
+
if (world.frozenStatics !== state) return;
|
|
1795
|
+
if (movesInside(world, entry) || typeof world.scene.userData.groundHeight === 'function') state.live.add(actor);
|
|
1796
|
+
else state.freeze(actor, entry);
|
|
1797
|
+
const file = actor.components.Model?.file;
|
|
1798
|
+
if (file) state.rememberAsset(actor, 'assets', file, world.generation === started ? modelSigOf(world, file, sprites, runtime.files) : actorModelSig(actor, sprites, runtime.files));
|
|
1799
|
+
const art = actor.components.Shape?.art;
|
|
1800
|
+
for (const ref of typeof art === 'string' ? [art] : Object.values(art ?? {})) {
|
|
1801
|
+
if (typeof ref === 'string') state.rememberAsset(actor, 'arts', ref, artRefSignature(ref, sprites));
|
|
1802
|
+
}
|
|
1803
|
+
if (world.frozenStaticVisits) world.frozenStaticVisits(actor);
|
|
1804
|
+
}
|
|
1805
|
+
// A new owner may reuse nodes at the same path, or inherit unparked nodes
|
|
1806
|
+
// from another scene. Reconcile that baseline once, as the full pass does.
|
|
1807
|
+
if (state.reconcileNodes) {
|
|
1808
|
+
const seen = new Set(runtime.getActors().filter(actor => actor.components.Transform).map(actor => actor.id));
|
|
1809
|
+
releaseUnseen(world, seen);
|
|
1810
|
+
if (world.frozenStatics !== state) return;
|
|
1811
|
+
state.reconcileNodes = false;
|
|
1812
|
+
}
|
|
1813
|
+
if (world.auditFrozenStatics === true) {
|
|
1814
|
+
world.scene.updateMatrixWorld();
|
|
1815
|
+
const before = frozenNodeState(world);
|
|
1816
|
+
state.invalidate();
|
|
1817
|
+
// QA only: perform the full old unchanged/signature/matrix walk, and
|
|
1818
|
+
// assert it cannot alter the frozen frame's node state.
|
|
1819
|
+
for (const actor of runtime.getActors()) {
|
|
1820
|
+
if (actor.components.Transform && !renderActorSleeps(world, actor)) {
|
|
1821
|
+
place(world, actor, actor.components.Transform, sprites, runtime.files, world.generation, drops);
|
|
1822
|
+
}
|
|
1823
|
+
}
|
|
1824
|
+
world.scene.updateMatrixWorld();
|
|
1825
|
+
assertFrozenEqual(before, frozenNodeState(world), 'node matrices/signatures');
|
|
1826
|
+
}
|
|
1827
|
+
finished = true;
|
|
1828
|
+
} finally {
|
|
1829
|
+
world.syncDepth--;
|
|
1830
|
+
if (!finished && world.frozenStatics === state) {
|
|
1831
|
+
for (const actor of actors) state.pending.dirty.add(actor);
|
|
1832
|
+
state.invalidate();
|
|
1833
|
+
forgetSnapshots(world);
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1389
1838
|
// The version a pass that holds nothing still begins with: no still set's.
|
|
1390
1839
|
const NOT_STILL = -1;
|
|
1391
1840
|
|
|
@@ -1487,6 +1936,7 @@ function sharedReadsTheSame(world, still, sprites, files) {
|
|
|
1487
1936
|
|
|
1488
1937
|
// A settled pass: `skippingPass` for the actors that are not still.
|
|
1489
1938
|
function settledPass(world, runtime, sprites, dt, started, drops, place) {
|
|
1939
|
+
const skipEmptyHints = skipEmptyGaitHints(world, runtime);
|
|
1490
1940
|
const still = runtime.stillActors;
|
|
1491
1941
|
const seen = new Set();
|
|
1492
1942
|
let skipped = 0;
|
|
@@ -1500,7 +1950,7 @@ function settledPass(world, runtime, sprites, dt, started, drops, place) {
|
|
|
1500
1950
|
seen.add(actor.id);
|
|
1501
1951
|
if (renderActorSleeps(world, actor)) continue;
|
|
1502
1952
|
const entry = place(world, actor, t, sprites, runtime.files, started, drops);
|
|
1503
|
-
animateActor(world, entry, dt, actor);
|
|
1953
|
+
animateActor(world, entry, dt, actor, skipEmptyHints);
|
|
1504
1954
|
}
|
|
1505
1955
|
if (world.generation !== started || seen.size + skipped !== world.nodes.size) {
|
|
1506
1956
|
// A still actor passed over is still the runtime's, and keeps its node.
|