@jgengine/core 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -3
- package/LICENSE +203 -661
- package/README.md +1 -1
- package/dist/ai/crowd.d.ts +55 -0
- package/dist/ai/crowd.js +114 -0
- package/dist/ai/flock.d.ts +5 -2
- package/dist/ai/flock.js +5 -2
- package/dist/ai/groupAssist.d.ts +1 -0
- package/dist/ai/groupAssist.js +1 -0
- package/dist/ai/heatSystem.d.ts +76 -0
- package/dist/ai/heatSystem.js +97 -0
- package/dist/ai/interestScheduler.d.ts +107 -0
- package/dist/ai/interestScheduler.js +118 -0
- package/dist/ai/jobBoard.d.ts +1 -0
- package/dist/ai/jobBoard.js +1 -0
- package/dist/ai/laneSelect.d.ts +5 -2
- package/dist/ai/laneSelect.js +5 -2
- package/dist/ai/mobBrain.d.ts +1 -0
- package/dist/ai/mobBrain.js +1 -0
- package/dist/ai/spawnDirector.d.ts +19 -1
- package/dist/ai/spawnDirector.js +53 -26
- package/dist/ai/spawnPoint.d.ts +7 -0
- package/dist/ai/spawnPoint.js +7 -0
- package/dist/ai/targetAcquisition.d.ts +84 -0
- package/dist/ai/targetAcquisition.js +92 -0
- package/dist/anim/easing.d.ts +19 -0
- package/dist/anim/easing.js +19 -0
- package/dist/anim/oscillator.d.ts +12 -0
- package/dist/anim/oscillator.js +25 -0
- package/dist/area/areaEffectField.d.ts +127 -0
- package/dist/area/areaEffectField.js +175 -0
- package/dist/area/stackPolicy.d.ts +47 -0
- package/dist/area/stackPolicy.js +99 -0
- package/dist/audio/audioFalloff.d.ts +5 -2
- package/dist/audio/music.d.ts +53 -0
- package/dist/audio/music.js +34 -0
- package/dist/audio/synth.d.ts +60 -0
- package/dist/audio/synth.js +8 -0
- package/dist/authoring.d.ts +15 -0
- package/dist/authoring.js +15 -0
- package/dist/board/laneBoard.d.ts +13 -0
- package/dist/board/laneBoard.js +13 -0
- package/dist/board/timelineBoard.d.ts +10 -0
- package/dist/board/timelineBoard.js +10 -0
- package/dist/combat/abilityKit.d.ts +18 -0
- package/dist/combat/abilityKit.js +24 -9
- package/dist/combat/animationState.d.ts +5 -0
- package/dist/combat/animationState.js +5 -0
- package/dist/combat/breakMeters.d.ts +10 -0
- package/dist/combat/breakMeters.js +10 -0
- package/dist/combat/castRunner.d.ts +5 -0
- package/dist/combat/castRunner.js +5 -0
- package/dist/combat/comboPoints.d.ts +5 -0
- package/dist/combat/comboPoints.js +5 -0
- package/dist/combat/comboString.d.ts +5 -0
- package/dist/combat/comboString.js +5 -0
- package/dist/combat/damageInterceptors.d.ts +192 -0
- package/dist/combat/damageInterceptors.js +251 -0
- package/dist/combat/damageMatchup.d.ts +68 -0
- package/dist/combat/damageMatchup.js +42 -0
- package/dist/combat/damageResolution.d.ts +63 -0
- package/dist/combat/damageResolution.js +50 -0
- package/dist/combat/death.d.ts +7 -1
- package/dist/combat/death.js +5 -0
- package/dist/combat/deathReason.d.ts +14 -0
- package/dist/combat/deathReason.js +1 -0
- package/dist/combat/defensiveWindow.d.ts +5 -0
- package/dist/combat/defensiveWindow.js +5 -0
- package/dist/combat/dotField.d.ts +47 -0
- package/dist/combat/dotField.js +52 -0
- package/dist/combat/downed.d.ts +5 -0
- package/dist/combat/downed.js +5 -0
- package/dist/combat/effects.d.ts +5 -0
- package/dist/combat/effects.js +5 -0
- package/dist/combat/encounterSequence.d.ts +258 -0
- package/dist/combat/encounterSequence.js +426 -0
- package/dist/combat/hitReaction.d.ts +57 -1
- package/dist/combat/hitReaction.js +45 -5
- package/dist/combat/magazine.d.ts +54 -0
- package/dist/combat/magazine.js +96 -0
- package/dist/combat/projectiles.d.ts +7 -2
- package/dist/combat/projectiles.js +48 -17
- package/dist/combat/receivedDamage.d.ts +117 -0
- package/dist/combat/receivedDamage.js +92 -0
- package/dist/combat/regenShield.d.ts +39 -0
- package/dist/combat/regenShield.js +49 -0
- package/dist/combat/renderCues.d.ts +51 -0
- package/dist/combat/renderCues.js +44 -0
- package/dist/combat/resourcePool.d.ts +5 -0
- package/dist/combat/resourcePool.js +5 -0
- package/dist/combat/rewardAllocation.d.ts +121 -0
- package/dist/combat/rewardAllocation.js +251 -0
- package/dist/combat/shotOrigin.d.ts +30 -1
- package/dist/combat/shotOrigin.js +70 -2
- package/dist/combat/statusApplication.d.ts +96 -0
- package/dist/combat/statusApplication.js +81 -0
- package/dist/combat/telegraph.d.ts +11 -2
- package/dist/combat/telegraph.js +11 -2
- package/dist/combat/thresholdCrossings.d.ts +85 -0
- package/dist/combat/thresholdCrossings.js +116 -0
- package/dist/combat.d.ts +34 -0
- package/dist/combat.js +34 -0
- package/dist/commands/commandRegistry.d.ts +11 -0
- package/dist/commands/commandRegistry.js +9 -2
- package/dist/crafting/crop.d.ts +18 -0
- package/dist/crafting/crop.js +18 -0
- package/dist/crafting/production.d.ts +5 -0
- package/dist/crafting/production.js +5 -0
- package/dist/devtools/rewriteTunables.d.ts +17 -0
- package/dist/devtools/rewriteTunables.js +276 -0
- package/dist/devtools/saveEndpoint.d.ts +46 -0
- package/dist/devtools/saveEndpoint.js +48 -0
- package/dist/devtools/transformTunables.d.ts +3 -0
- package/dist/devtools/transformTunables.js +3 -0
- package/dist/devtools/tunableSchema.d.ts +31 -0
- package/dist/devtools/tunableSchema.js +31 -0
- package/dist/economy/currency.d.ts +12 -1
- package/dist/economy/currency.js +12 -1
- package/dist/economy/listingBook.d.ts +91 -0
- package/dist/economy/listingBook.js +144 -0
- package/dist/economy/resourceLedger.d.ts +222 -0
- package/dist/economy/resourceLedger.js +353 -0
- package/dist/economy/sharedWallet.d.ts +14 -0
- package/dist/economy/sharedWallet.js +14 -0
- package/dist/economy/techTree.d.ts +12 -0
- package/dist/economy/techTree.js +12 -0
- package/dist/economy/wallet.d.ts +26 -2
- package/dist/economy/wallet.js +35 -6
- package/dist/editor/commands.d.ts +248 -0
- package/dist/editor/commands.js +865 -0
- package/dist/editor/document.d.ts +186 -0
- package/dist/editor/document.js +884 -0
- package/dist/editor/grid.d.ts +229 -0
- package/dist/editor/grid.js +366 -0
- package/dist/editor/gridAdapters.d.ts +80 -0
- package/dist/editor/gridAdapters.js +134 -0
- package/dist/editor/index.d.ts +97 -0
- package/dist/editor/index.js +10 -0
- package/dist/editor/liveSync.d.ts +127 -0
- package/dist/editor/liveSync.js +249 -0
- package/dist/editor/runtimeInspector.d.ts +88 -0
- package/dist/editor/runtimeInspector.js +239 -0
- package/dist/editor/types.d.ts +175 -0
- package/dist/editor/types.js +29 -0
- package/dist/faction/reputation.d.ts +5 -0
- package/dist/faction/reputation.js +5 -0
- package/dist/format/distance.d.ts +17 -0
- package/dist/format/distance.js +18 -0
- package/dist/format/duration.d.ts +27 -0
- package/dist/format/duration.js +45 -0
- package/dist/format/speed.d.ts +17 -0
- package/dist/format/speed.js +25 -0
- package/dist/game/connectedPlayers.d.ts +30 -0
- package/dist/game/connectedPlayers.js +21 -0
- package/dist/game/cosmetics.d.ts +9 -0
- package/dist/game/cosmetics.js +16 -0
- package/dist/game/defineGame.d.ts +141 -2
- package/dist/game/defineGame.js +39 -1
- package/dist/game/defineSystem.d.ts +88 -0
- package/dist/game/defineSystem.js +45 -0
- package/dist/game/dialogue.d.ts +33 -0
- package/dist/game/dialogue.js +21 -0
- package/dist/game/events.d.ts +50 -13
- package/dist/game/events.js +5 -0
- package/dist/game/feed.d.ts +33 -0
- package/dist/game/feed.js +35 -2
- package/dist/game/gamePhase.d.ts +11 -0
- package/dist/game/gamePhase.js +16 -0
- package/dist/game/keyValueStore.d.ts +25 -0
- package/dist/game/keyValueStore.js +61 -0
- package/dist/game/leaderboard.d.ts +5 -0
- package/dist/game/leaderboard.js +5 -0
- package/dist/game/levelSequence.d.ts +24 -2
- package/dist/game/levelSequence.js +51 -2
- package/dist/game/loadout.d.ts +5 -0
- package/dist/game/loadout.js +5 -0
- package/dist/game/lootFilter.d.ts +2 -0
- package/dist/game/lootFilter.js +2 -0
- package/dist/game/lootPipeline.d.ts +164 -0
- package/dist/game/lootPipeline.js +216 -0
- package/dist/game/lootTable.d.ts +21 -0
- package/dist/game/lootTable.js +15 -4
- package/dist/game/modelAnimation.d.ts +8 -0
- package/dist/game/modelAnimation.js +18 -0
- package/dist/game/objectives.d.ts +43 -0
- package/dist/game/objectives.js +36 -0
- package/dist/game/paramLayers.d.ts +148 -0
- package/dist/game/paramLayers.js +185 -0
- package/dist/game/ping.d.ts +5 -0
- package/dist/game/ping.js +5 -0
- package/dist/game/playableGame.d.ts +160 -12
- package/dist/game/quest.d.ts +8 -0
- package/dist/game/quest.js +29 -0
- package/dist/game/race.d.ts +141 -0
- package/dist/game/race.js +169 -0
- package/dist/game/recordBook.d.ts +5 -5
- package/dist/game/recordBook.js +4 -1
- package/dist/game/ruleSelection.d.ts +75 -0
- package/dist/game/ruleSelection.js +127 -0
- package/dist/game/runDraft.d.ts +5 -0
- package/dist/game/runDraft.js +5 -0
- package/dist/game/saveStore.d.ts +111 -0
- package/dist/game/saveStore.js +312 -0
- package/dist/game/snapshotHistory.d.ts +67 -0
- package/dist/game/snapshotHistory.js +95 -0
- package/dist/game/social.d.ts +38 -1
- package/dist/game/social.js +71 -0
- package/dist/game/spawnPoints.d.ts +5 -0
- package/dist/game/spawnPoints.js +5 -0
- package/dist/game/systemRuntime.d.ts +50 -0
- package/dist/game/systemRuntime.js +157 -0
- package/dist/game/systemSchedule.d.ts +72 -0
- package/dist/game/systemSchedule.js +242 -0
- package/dist/game/toasts.d.ts +43 -0
- package/dist/game/toasts.js +44 -0
- package/dist/game/trade.d.ts +10 -0
- package/dist/game/trade.js +10 -0
- package/dist/game/unlocks.d.ts +8 -0
- package/dist/game/unlocks.js +16 -0
- package/dist/game/vfxInstance.d.ts +138 -0
- package/dist/game/vfxInstance.js +96 -0
- package/dist/game/worldItem.d.ts +17 -4
- package/dist/game/worldItem.js +17 -4
- package/dist/gameplay.d.ts +91 -0
- package/dist/gameplay.js +91 -0
- package/dist/index.d.ts +5 -7
- package/dist/index.js +5 -7
- package/dist/input/actionBindings.d.ts +24 -5
- package/dist/input/actionBindings.js +23 -5
- package/dist/input/axisInput.d.ts +13 -1
- package/dist/input/axisInput.js +22 -1
- package/dist/input/controlGroups.d.ts +67 -0
- package/dist/input/controlGroups.js +41 -0
- package/dist/input/touchScheme.d.ts +82 -6
- package/dist/input/touchScheme.js +123 -10
- package/dist/interaction/contextMenu.d.ts +1 -0
- package/dist/interaction/contextMenu.js +1 -0
- package/dist/interaction/lockpick.d.ts +61 -0
- package/dist/interaction/lockpick.js +168 -0
- package/dist/interaction/proximityPrompt.d.ts +5 -1
- package/dist/interaction/proximityPrompt.js +5 -3
- package/dist/interaction/qte.d.ts +5 -0
- package/dist/interaction/qte.js +5 -0
- package/dist/interaction/skillCheck.d.ts +5 -0
- package/dist/interaction/skillCheck.js +5 -0
- package/dist/inventory/inventoryModel.d.ts +12 -0
- package/dist/inventory/inventoryModel.js +12 -0
- package/dist/inventory/shapedGrid.d.ts +16 -0
- package/dist/inventory/shapedGrid.js +16 -0
- package/dist/inventory/slotModel.d.ts +10 -0
- package/dist/inventory/slotModel.js +10 -0
- package/dist/item/durability.d.ts +5 -0
- package/dist/item/durability.js +5 -0
- package/dist/item/itemIdentity.d.ts +171 -0
- package/dist/item/itemIdentity.js +138 -0
- package/dist/item/itemInstanceRegistry.d.ts +32 -0
- package/dist/item/itemInstanceRegistry.js +34 -0
- package/dist/item/itemgen.d.ts +163 -0
- package/dist/item/itemgen.js +151 -0
- package/dist/item/modularItem.d.ts +5 -0
- package/dist/item/modularItem.js +5 -0
- package/dist/item/use.d.ts +5 -0
- package/dist/item/use.js +5 -0
- package/dist/item/useBehavior.d.ts +142 -0
- package/dist/item/useBehavior.js +105 -0
- package/dist/item/weapon.d.ts +5 -0
- package/dist/item/weapon.js +5 -0
- package/dist/math/scalar.d.ts +25 -0
- package/dist/math/scalar.js +47 -0
- package/dist/meta/changelog.d.ts +4 -1
- package/dist/meta/changelog.js +36 -1
- package/dist/movement/avoidance.d.ts +45 -0
- package/dist/movement/avoidance.js +123 -0
- package/dist/movement/cameraRig.d.ts +8 -0
- package/dist/movement/cameraRig.js +8 -0
- package/dist/movement/dash.d.ts +11 -0
- package/dist/movement/dash.js +11 -0
- package/dist/movement/formation.d.ts +135 -0
- package/dist/movement/formation.js +194 -0
- package/dist/movement/glideModel.d.ts +5 -0
- package/dist/movement/glideModel.js +5 -0
- package/dist/movement/grappleSwing.d.ts +5 -0
- package/dist/movement/grappleSwing.js +5 -0
- package/dist/movement/leaderTrail.d.ts +5 -0
- package/dist/movement/leaderTrail.js +5 -0
- package/dist/movement/movementModel.d.ts +38 -7
- package/dist/movement/movementModel.js +54 -13
- package/dist/movement/playerMovement.d.ts +41 -0
- package/dist/movement/playerMovement.js +236 -0
- package/dist/movement/poseState.d.ts +13 -0
- package/dist/movement/poseState.js +16 -0
- package/dist/movement/steering.d.ts +8 -0
- package/dist/movement/steering.js +18 -0
- package/dist/multiplayer/combatSnapshot.d.ts +3 -0
- package/dist/multiplayer/combatSnapshot.js +3 -0
- package/dist/multiplayer/lagCompensation.d.ts +5 -0
- package/dist/multiplayer/lagCompensation.js +5 -0
- package/dist/multiplayer/presenceModel.d.ts +9 -1
- package/dist/multiplayer/presenceModel.js +9 -1
- package/dist/multiplayer/simultaneousCommit.d.ts +3 -0
- package/dist/multiplayer/simultaneousCommit.js +3 -0
- package/dist/multiplayer.d.ts +11 -0
- package/dist/multiplayer.js +11 -0
- package/dist/nav/pathFollow.d.ts +57 -0
- package/dist/nav/pathFollow.js +109 -0
- package/dist/orders/orderKinds.d.ts +156 -0
- package/dist/orders/orderKinds.js +197 -0
- package/dist/orders/orderQueue.d.ts +208 -0
- package/dist/orders/orderQueue.js +211 -0
- package/dist/physics/drivableVehicle.d.ts +29 -0
- package/dist/physics/drivableVehicle.js +16 -0
- package/dist/physics/kinematicVehicle.d.ts +21 -1
- package/dist/physics/kinematicVehicle.js +23 -8
- package/dist/physics/physicsWorld.d.ts +24 -12
- package/dist/physics/physicsWorld.js +11 -5
- package/dist/physics/radialImpulse.d.ts +25 -0
- package/dist/physics/radialImpulse.js +27 -0
- package/dist/procedural.d.ts +3 -0
- package/dist/procedural.js +3 -0
- package/dist/progression/statGraph.d.ts +116 -0
- package/dist/progression/statGraph.js +318 -0
- package/dist/puzzle/cellGrid.d.ts +9 -0
- package/dist/puzzle/cellGrid.js +9 -0
- package/dist/puzzle/fallingPiece.d.ts +9 -0
- package/dist/puzzle/fallingPiece.js +9 -0
- package/dist/puzzle/nonogram.d.ts +39 -0
- package/dist/puzzle/nonogram.js +136 -0
- package/dist/random/nameGen.d.ts +5 -0
- package/dist/random/nameGen.js +5 -0
- package/dist/random/pick.d.ts +8 -0
- package/dist/random/pick.js +31 -0
- package/dist/random/rng.d.ts +24 -0
- package/dist/random/rng.js +30 -8
- package/dist/random/seedLink.d.ts +4 -0
- package/dist/random/seedLink.js +4 -0
- package/dist/relation/keyedValues.d.ts +54 -0
- package/dist/relation/keyedValues.js +115 -0
- package/dist/relation/thresholds.d.ts +62 -0
- package/dist/relation/thresholds.js +62 -0
- package/dist/render/color.d.ts +12 -0
- package/dist/render/color.js +26 -0
- package/dist/render/lookPreset.d.ts +41 -0
- package/dist/render/lookPreset.js +29 -0
- package/dist/render/postProcessing.d.ts +76 -0
- package/dist/render/postProcessing.js +21 -0
- package/dist/rules/predicate.d.ts +53 -0
- package/dist/rules/predicate.js +64 -0
- package/dist/rules/ruleEffects.d.ts +38 -0
- package/dist/rules/ruleEffects.js +37 -0
- package/dist/rules/triggeredRules.d.ts +160 -0
- package/dist/rules/triggeredRules.js +241 -0
- package/dist/runtime/adapter.d.ts +58 -0
- package/dist/runtime/adapter.js +54 -5
- package/dist/runtime/cameraDirector.d.ts +1 -0
- package/dist/runtime/cameraDirector.js +1 -0
- package/dist/runtime/commandRunner.d.ts +1 -0
- package/dist/runtime/commandRunner.js +1 -0
- package/dist/runtime/context/combatFx.d.ts +23 -0
- package/dist/runtime/context/combatFx.js +161 -0
- package/dist/runtime/context/registries.d.ts +13 -0
- package/dist/runtime/context/registries.js +84 -0
- package/dist/runtime/context/worldItems.d.ts +21 -0
- package/dist/runtime/context/worldItems.js +37 -0
- package/dist/runtime/descriptors/baseline.d.ts +48 -0
- package/dist/runtime/descriptors/baseline.js +134 -0
- package/dist/runtime/descriptors/features.d.ts +74 -0
- package/dist/runtime/descriptors/features.js +281 -0
- package/dist/runtime/gameContext.d.ts +163 -19
- package/dist/runtime/gameContext.js +385 -339
- package/dist/runtime/gameRuntime.d.ts +1 -0
- package/dist/runtime/gameRuntime.js +1 -0
- package/dist/runtime/headlessRunner.d.ts +60 -0
- package/dist/runtime/headlessRunner.js +44 -0
- package/dist/runtime/hostPersistence.d.ts +12 -0
- package/dist/runtime/hostPersistence.js +12 -0
- package/dist/runtime/hostedGameRunner.d.ts +54 -0
- package/dist/runtime/hostedGameRunner.js +85 -0
- package/dist/runtime/hostedWorldSession.d.ts +73 -0
- package/dist/runtime/hostedWorldSession.js +64 -0
- package/dist/runtime/inputSnapshot.d.ts +21 -3
- package/dist/runtime/inputSnapshot.js +8 -2
- package/dist/runtime/motionIntents.d.ts +12 -1
- package/dist/runtime/motionIntents.js +26 -1
- package/dist/runtime/perContext.d.ts +15 -0
- package/dist/runtime/perContext.js +21 -0
- package/dist/runtime/runtimeSave.d.ts +79 -0
- package/dist/runtime/runtimeSave.js +105 -0
- package/dist/runtime/save.d.ts +4 -0
- package/dist/runtime/save.js +4 -0
- package/dist/runtime/snapshot.d.ts +7 -0
- package/dist/runtime/snapshot.js +7 -0
- package/dist/runtime/visibility.d.ts +2 -1
- package/dist/runtime/visibility.js +2 -1
- package/dist/runtime/worldChannel.d.ts +62 -0
- package/dist/runtime/worldChannel.js +114 -0
- package/dist/runtime/worldMirror.d.ts +36 -0
- package/dist/runtime/worldMirror.js +44 -0
- package/dist/runtime/worldProjection.d.ts +47 -0
- package/dist/runtime/worldProjection.js +52 -0
- package/dist/runtime/worldReplication.d.ts +69 -0
- package/dist/runtime/worldReplication.js +217 -0
- package/dist/runtime/worldSnapshot.d.ts +44 -0
- package/dist/runtime/worldSnapshot.js +30 -0
- package/dist/scene/assetCatalog.d.ts +22 -0
- package/dist/scene/assetCatalog.js +4 -0
- package/dist/scene/assetDiagnostics.d.ts +69 -0
- package/dist/scene/assetDiagnostics.js +110 -0
- package/dist/scene/assetGenerator.d.ts +65 -0
- package/dist/scene/assetGenerator.js +64 -0
- package/dist/scene/assetSpace.d.ts +137 -0
- package/dist/scene/assetSpace.js +259 -0
- package/dist/scene/authoredTriggers.d.ts +169 -0
- package/dist/scene/authoredTriggers.js +340 -0
- package/dist/scene/behaviorRuntime.d.ts +75 -0
- package/dist/scene/behaviorRuntime.js +217 -0
- package/dist/scene/behaviors.d.ts +14 -2
- package/dist/scene/behaviors.js +7 -2
- package/dist/scene/bodyBind.d.ts +60 -0
- package/dist/scene/bodyBind.js +51 -0
- package/dist/scene/builtinSceneKinds.d.ts +5 -0
- package/dist/scene/builtinSceneKinds.js +62 -0
- package/dist/scene/colliders.d.ts +18 -0
- package/dist/scene/colliders.js +61 -1
- package/dist/scene/entityStats.d.ts +13 -0
- package/dist/scene/entityStats.js +30 -0
- package/dist/scene/entityStore.d.ts +41 -1
- package/dist/scene/entityStore.js +75 -0
- package/dist/scene/facing.d.ts +18 -0
- package/dist/scene/facing.js +26 -0
- package/dist/scene/modelSockets.d.ts +33 -0
- package/dist/scene/modelSockets.js +29 -0
- package/dist/scene/objectQuery.d.ts +2 -0
- package/dist/scene/objectQuery.js +2 -0
- package/dist/scene/objectStore.d.ts +4 -0
- package/dist/scene/objectStore.js +6 -0
- package/dist/scene/possession.d.ts +8 -0
- package/dist/scene/possession.js +14 -0
- package/dist/scene/roster.d.ts +3 -0
- package/dist/scene/roster.js +12 -0
- package/dist/scene/sceneKinds.d.ts +240 -0
- package/dist/scene/sceneKinds.js +214 -0
- package/dist/scene/sceneOwnership.d.ts +169 -0
- package/dist/scene/sceneOwnership.js +179 -0
- package/dist/scene/selectionBookmarks.d.ts +93 -0
- package/dist/scene/selectionBookmarks.js +122 -0
- package/dist/scene/vehicleSeat.d.ts +68 -0
- package/dist/scene/vehicleSeat.js +59 -0
- package/dist/sensor/concealment.d.ts +3 -0
- package/dist/sensor/concealment.js +3 -0
- package/dist/sensor/freezeMonitor.d.ts +1 -0
- package/dist/sensor/freezeMonitor.js +1 -0
- package/dist/sensor/frustumSensor.d.ts +7 -3
- package/dist/sensor/frustumSensor.js +7 -3
- package/dist/sensor/hiddenStateProbe.d.ts +5 -2
- package/dist/sensor/hiddenStateProbe.js +5 -2
- package/dist/sensor/recordingBuffer.d.ts +2 -1
- package/dist/sensor/recordingBuffer.js +2 -1
- package/dist/sensor/replayLoop.d.ts +6 -2
- package/dist/sensor/replayLoop.js +6 -2
- package/dist/sensor/revealQuery.d.ts +2 -1
- package/dist/sensor/revealQuery.js +2 -1
- package/dist/sensor/visionCone.d.ts +10 -3
- package/dist/sensor/visionCone.js +10 -3
- package/dist/session/contestedChannel.d.ts +1 -0
- package/dist/session/contestedChannel.js +1 -0
- package/dist/session/extraction.d.ts +1 -0
- package/dist/session/extraction.js +1 -0
- package/dist/session/roles.d.ts +6 -0
- package/dist/session/roles.js +6 -0
- package/dist/session/roundState.d.ts +8 -0
- package/dist/session/roundState.js +2 -0
- package/dist/settings/settingsModel.d.ts +1 -0
- package/dist/settings/settingsModel.js +1 -0
- package/dist/stats/accumulatorMeter.d.ts +6 -0
- package/dist/stats/accumulatorMeter.js +6 -0
- package/dist/stats/eventMeter.d.ts +5 -0
- package/dist/stats/eventMeter.js +5 -0
- package/dist/stats/rollCheck.d.ts +5 -0
- package/dist/stats/rollCheck.js +5 -0
- package/dist/stats/statModifiers.d.ts +5 -0
- package/dist/stats/statModifiers.js +5 -0
- package/dist/store/defineKeyedStore.d.ts +38 -0
- package/dist/store/defineKeyedStore.js +42 -0
- package/dist/store/defineStore.d.ts +33 -0
- package/dist/store/defineStore.js +35 -0
- package/dist/store/observableKeyedStore.d.ts +9 -0
- package/dist/store/observableKeyedStore.js +43 -2
- package/dist/survival/decayMeter.d.ts +55 -0
- package/dist/survival/decayMeter.js +130 -55
- package/dist/survival/moodle.d.ts +2 -0
- package/dist/survival/regionHealth.d.ts +6 -0
- package/dist/survival/regionHealth.js +5 -0
- package/dist/tactics/fallingGrid.d.ts +6 -4
- package/dist/tactics/fallingGrid.js +6 -4
- package/dist/tactics/predictiveQuery.d.ts +3 -0
- package/dist/tactics/predictiveQuery.js +3 -0
- package/dist/tactics/snapshot.d.ts +2 -0
- package/dist/tactics/snapshot.js +2 -0
- package/dist/tactics/surface.d.ts +1 -0
- package/dist/tactics/surface.js +1 -0
- package/dist/tactics/tacticalGrid.d.ts +1 -0
- package/dist/tactics/tacticalGrid.js +1 -0
- package/dist/time/beatClock.d.ts +14 -4
- package/dist/time/beatClock.js +14 -4
- package/dist/time/calendarClock.d.ts +3 -0
- package/dist/time/calendarClock.js +3 -0
- package/dist/time/idleProgress.d.ts +4 -0
- package/dist/time/idleProgress.js +4 -0
- package/dist/time/simClock.d.ts +2 -0
- package/dist/time/simClock.js +20 -5
- package/dist/ui/actionModel.d.ts +110 -0
- package/dist/ui/actionModel.js +159 -0
- package/dist/ui/gameLayout.d.ts +144 -0
- package/dist/ui/gameLayout.js +148 -0
- package/dist/ui/hudDocument.d.ts +114 -0
- package/dist/ui/hudDocument.js +220 -0
- package/dist/ui/hudLayout.d.ts +33 -1
- package/dist/ui/hudLayout.js +204 -17
- package/dist/ui/orientation.d.ts +39 -0
- package/dist/ui/orientation.js +49 -0
- package/dist/ui/selectionModel.d.ts +92 -0
- package/dist/ui/selectionModel.js +88 -0
- package/dist/ui/swingTimer.d.ts +42 -0
- package/dist/ui/swingTimer.js +38 -0
- package/dist/ui/tooltipModel.d.ts +63 -0
- package/dist/ui/tooltipModel.js +82 -0
- package/dist/ui.d.ts +15 -0
- package/dist/ui.js +15 -0
- package/dist/visibility/bounds.d.ts +8 -1
- package/dist/visibility/bounds.js +8 -1
- package/dist/visibility/frustum.d.ts +12 -3
- package/dist/visibility/frustum.js +12 -3
- package/dist/visibility/spatialIndex.js +34 -20
- package/dist/work/jobQueue.d.ts +201 -0
- package/dist/work/jobQueue.js +253 -0
- package/dist/work/unitTraining.d.ts +58 -0
- package/dist/work/unitTraining.js +52 -0
- package/dist/world/authoredObjects.d.ts +58 -0
- package/dist/world/authoredObjects.js +69 -0
- package/dist/world/buildingGenerator.d.ts +18 -0
- package/dist/world/buildingGenerator.js +62 -0
- package/dist/world/buildings.d.ts +5 -0
- package/dist/world/buildings.js +5 -0
- package/dist/world/catenary.d.ts +22 -0
- package/dist/world/catenary.js +69 -0
- package/dist/world/environmentSummary.d.ts +11 -2
- package/dist/world/environmentSummary.js +11 -1
- package/dist/world/features.d.ts +244 -7
- package/dist/world/features.js +92 -4
- package/dist/world/footprintGrid.d.ts +59 -0
- package/dist/world/footprintGrid.js +141 -0
- package/dist/world/geometry.d.ts +64 -0
- package/dist/world/geometry.js +94 -0
- package/dist/world/grassKind.d.ts +51 -0
- package/dist/world/grassKind.js +101 -0
- package/dist/world/pathInstances.d.ts +27 -0
- package/dist/world/pathInstances.js +27 -0
- package/dist/world/pathTerrain.d.ts +80 -0
- package/dist/world/pathTerrain.js +142 -0
- package/dist/world/placeAsset.d.ts +81 -0
- package/dist/world/placeAsset.js +77 -0
- package/dist/world/placement.d.ts +4 -0
- package/dist/world/placement.js +4 -0
- package/dist/world/placementController.d.ts +6 -0
- package/dist/world/placementController.js +6 -0
- package/dist/world/polyline.d.ts +34 -0
- package/dist/world/polyline.js +81 -0
- package/dist/world/roads.d.ts +55 -0
- package/dist/world/roads.js +184 -0
- package/dist/world/scatterRegion.d.ts +164 -0
- package/dist/world/scatterRegion.js +409 -0
- package/dist/world/sceneShapes.d.ts +43 -0
- package/dist/world/sceneShapes.js +1 -0
- package/dist/world/segment.d.ts +27 -0
- package/dist/world/segment.js +43 -0
- package/dist/world/soilKind.d.ts +48 -0
- package/dist/world/soilKind.js +92 -0
- package/dist/world/spatialSample.d.ts +241 -0
- package/dist/world/spatialSample.js +465 -0
- package/dist/world/streets.d.ts +80 -0
- package/dist/world/streets.js +144 -0
- package/dist/world/terraform.d.ts +213 -1
- package/dist/world/terraform.js +655 -20
- package/dist/world/terrain.d.ts +138 -12
- package/dist/world/terrain.js +346 -28
- package/dist/world/terrainGuides.d.ts +182 -0
- package/dist/world/terrainGuides.js +343 -0
- package/dist/world/vec2.d.ts +81 -0
- package/dist/world/vec2.js +128 -0
- package/dist/world/vec3.d.ts +49 -0
- package/dist/world/vec3.js +76 -0
- package/dist/world/vegetation.d.ts +71 -0
- package/dist/world/vegetation.js +151 -0
- package/dist/world/visibilityField.d.ts +154 -0
- package/dist/world/visibilityField.js +271 -0
- package/dist/world/volumetricClouds.d.ts +52 -0
- package/dist/world/volumetricClouds.js +43 -0
- package/dist/world/walls.d.ts +9 -0
- package/dist/world/walls.js +9 -0
- package/dist/world/waterKind.d.ts +55 -0
- package/dist/world/waterKind.js +99 -0
- package/dist/world.d.ts +132 -0
- package/dist/world.js +132 -0
- package/package.json +32 -8
- package/skills/jgengine/SKILL.md +51 -0
- package/skills/jgengine/api.md +434 -0
- package/skills/jgengine/capabilities.md +29 -0
- package/skills/jgengine/reference-cartridge.md +72 -0
- package/skills/jgengine-combat/SKILL.md +34 -0
- package/skills/jgengine-combat/api.md +549 -0
- package/skills/jgengine-combat/capabilities.md +169 -0
- package/skills/jgengine-combat/reference.md +98 -0
- package/skills/jgengine-gameplay/SKILL.md +39 -0
- package/skills/jgengine-gameplay/api.md +1794 -0
- package/skills/jgengine-gameplay/capabilities.md +378 -0
- package/skills/jgengine-gameplay/reference-systems.md +60 -0
- package/skills/jgengine-world/SKILL.md +38 -0
- package/skills/jgengine-world/api.md +2652 -0
- package/skills/jgengine-world/capabilities.md +370 -0
- package/skills/jgengine-world/reference.md +222 -0
- package/dist/cartridge/runtime.d.ts +0 -15
- package/dist/cartridge/runtime.js +0 -556
- package/dist/cartridge/spec.d.ts +0 -188
- package/dist/cartridge/spec.js +0 -19
- package/dist/cartridge/validate.d.ts +0 -2
- package/dist/cartridge/validate.js +0 -78
- package/dist/store/engineStore.d.ts +0 -22
- package/dist/store/engineStore.js +0 -50
- package/dist/store/features.d.ts +0 -10
- package/dist/store/features.js +0 -23
- package/llms.txt +0 -4983
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
/** Numeric code for a cell no group member has seen, or has fully forgotten. */
|
|
2
|
+
export const VISIBILITY_HIDDEN = 0;
|
|
3
|
+
/** Numeric code for a cell seen before but not currently in view (last-known). */
|
|
4
|
+
export const VISIBILITY_REMEMBERED = 1;
|
|
5
|
+
/** Numeric code for a cell a group currently observes. */
|
|
6
|
+
export const VISIBILITY_OBSERVED = 2;
|
|
7
|
+
function clampInt(value, min, max) {
|
|
8
|
+
const rounded = Math.floor(value);
|
|
9
|
+
return rounded < min ? min : rounded > max ? max : rounded;
|
|
10
|
+
}
|
|
11
|
+
function stateOf(code) {
|
|
12
|
+
return code === VISIBILITY_OBSERVED
|
|
13
|
+
? "observed"
|
|
14
|
+
: code === VISIBILITY_REMEMBERED
|
|
15
|
+
? "remembered"
|
|
16
|
+
: "hidden";
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Build a per-group gameplay visibility field. First adopters: an RTS/stealth
|
|
20
|
+
* team whose scout observes terrain (which stays remembered after it leaves)
|
|
21
|
+
* while enemy units re-hide once no scout observes their cell, and any
|
|
22
|
+
* authoritative host that must filter hidden entities out of a client's replica.
|
|
23
|
+
*
|
|
24
|
+
* @capability visibility-field per-viewer-group observed/remembered/hidden fog-of-war knowledge with terrain memory and authoritative entity disclosure
|
|
25
|
+
*/
|
|
26
|
+
export function createVisibilityField(config) {
|
|
27
|
+
const cellSize = config.cellSize;
|
|
28
|
+
if (cellSize <= 0)
|
|
29
|
+
throw new Error("createVisibilityField: cellSize must be positive");
|
|
30
|
+
const restore = config.restore;
|
|
31
|
+
const minX = restore?.minX ?? config.bounds.minX;
|
|
32
|
+
const minZ = restore?.minZ ?? config.bounds.minZ;
|
|
33
|
+
const cols = restore?.cols ?? Math.max(1, Math.ceil((config.bounds.maxX - config.bounds.minX) / cellSize));
|
|
34
|
+
const rows = restore?.rows ?? Math.max(1, Math.ceil((config.bounds.maxZ - config.bounds.minZ) / cellSize));
|
|
35
|
+
const total = cols * rows;
|
|
36
|
+
const defaultMemory = restore?.memory ?? config.memory ?? { kind: "permanent" };
|
|
37
|
+
const groups = new Map();
|
|
38
|
+
function makeGroup(memory) {
|
|
39
|
+
return {
|
|
40
|
+
codes: new Uint8Array(total),
|
|
41
|
+
observed: new Set(),
|
|
42
|
+
remembered: new Map(),
|
|
43
|
+
tick: 0,
|
|
44
|
+
memory,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function getGroup(group) {
|
|
48
|
+
let data = groups.get(group);
|
|
49
|
+
if (data === undefined) {
|
|
50
|
+
data = makeGroup(defaultMemory);
|
|
51
|
+
groups.set(group, data);
|
|
52
|
+
}
|
|
53
|
+
return data;
|
|
54
|
+
}
|
|
55
|
+
if (restore !== undefined) {
|
|
56
|
+
for (const [name, state] of Object.entries(restore.groups)) {
|
|
57
|
+
const data = makeGroup(state.memory ?? defaultMemory);
|
|
58
|
+
data.tick = state.tick;
|
|
59
|
+
for (const cell of state.observed) {
|
|
60
|
+
if (cell >= 0 && cell < total) {
|
|
61
|
+
data.codes[cell] = VISIBILITY_OBSERVED;
|
|
62
|
+
data.observed.add(cell);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
for (const [cell, tick] of state.remembered) {
|
|
66
|
+
if (cell >= 0 && cell < total && data.codes[cell] === VISIBILITY_HIDDEN) {
|
|
67
|
+
data.codes[cell] = VISIBILITY_REMEMBERED;
|
|
68
|
+
data.remembered.set(cell, tick);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
groups.set(name, data);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function colOf(x) {
|
|
75
|
+
return clampInt((x - minX) / cellSize, 0, cols - 1);
|
|
76
|
+
}
|
|
77
|
+
function rowOf(z) {
|
|
78
|
+
return clampInt((z - minZ) / cellSize, 0, rows - 1);
|
|
79
|
+
}
|
|
80
|
+
function cellIndex(x, z) {
|
|
81
|
+
return rowOf(z) * cols + colOf(x);
|
|
82
|
+
}
|
|
83
|
+
function cellsInRadius(x, z, radius, out = []) {
|
|
84
|
+
const centerCol = colOf(x);
|
|
85
|
+
const centerRow = rowOf(z);
|
|
86
|
+
if (radius <= 0) {
|
|
87
|
+
out.push(centerRow * cols + centerCol);
|
|
88
|
+
return out;
|
|
89
|
+
}
|
|
90
|
+
const span = Math.ceil(radius / cellSize);
|
|
91
|
+
const radiusSq = radius * radius;
|
|
92
|
+
for (let dr = -span; dr <= span; dr += 1) {
|
|
93
|
+
const row = centerRow + dr;
|
|
94
|
+
if (row < 0 || row >= rows)
|
|
95
|
+
continue;
|
|
96
|
+
for (let dc = -span; dc <= span; dc += 1) {
|
|
97
|
+
const col = centerCol + dc;
|
|
98
|
+
if (col < 0 || col >= cols)
|
|
99
|
+
continue;
|
|
100
|
+
const cellX = minX + (col + 0.5) * cellSize;
|
|
101
|
+
const cellZ = minZ + (row + 0.5) * cellSize;
|
|
102
|
+
const dx = cellX - x;
|
|
103
|
+
const dz = cellZ - z;
|
|
104
|
+
if (dx * dx + dz * dz > radiusSq)
|
|
105
|
+
continue;
|
|
106
|
+
out.push(row * cols + col);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return out;
|
|
110
|
+
}
|
|
111
|
+
function observe(group, cells) {
|
|
112
|
+
const data = getGroup(group);
|
|
113
|
+
data.tick += 1;
|
|
114
|
+
const now = data.tick;
|
|
115
|
+
const remembering = data.memory.kind !== "none";
|
|
116
|
+
const next = new Set();
|
|
117
|
+
const observedDelta = [];
|
|
118
|
+
for (const cell of cells) {
|
|
119
|
+
if (cell < 0 || cell >= total || next.has(cell))
|
|
120
|
+
continue;
|
|
121
|
+
next.add(cell);
|
|
122
|
+
if (data.codes[cell] !== VISIBILITY_OBSERVED) {
|
|
123
|
+
data.codes[cell] = VISIBILITY_OBSERVED;
|
|
124
|
+
data.remembered.delete(cell);
|
|
125
|
+
observedDelta.push(cell);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const rememberedDelta = [];
|
|
129
|
+
const hiddenDelta = [];
|
|
130
|
+
for (const cell of data.observed) {
|
|
131
|
+
if (next.has(cell))
|
|
132
|
+
continue;
|
|
133
|
+
if (remembering) {
|
|
134
|
+
data.codes[cell] = VISIBILITY_REMEMBERED;
|
|
135
|
+
data.remembered.set(cell, now);
|
|
136
|
+
rememberedDelta.push(cell);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
data.codes[cell] = VISIBILITY_HIDDEN;
|
|
140
|
+
hiddenDelta.push(cell);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
data.observed = next;
|
|
144
|
+
if (data.memory.kind === "decay") {
|
|
145
|
+
const maxAge = data.memory.updates;
|
|
146
|
+
for (const [cell, seen] of data.remembered) {
|
|
147
|
+
if (now - seen >= maxAge) {
|
|
148
|
+
data.codes[cell] = VISIBILITY_HIDDEN;
|
|
149
|
+
data.remembered.delete(cell);
|
|
150
|
+
hiddenDelta.push(cell);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return { group, observed: observedDelta, remembered: rememberedDelta, hidden: hiddenDelta };
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
cols,
|
|
158
|
+
rows,
|
|
159
|
+
cellCount() {
|
|
160
|
+
return total;
|
|
161
|
+
},
|
|
162
|
+
colOf,
|
|
163
|
+
rowOf,
|
|
164
|
+
cellIndex,
|
|
165
|
+
ensureGroup(group, memory) {
|
|
166
|
+
const existing = groups.get(group);
|
|
167
|
+
if (existing === undefined) {
|
|
168
|
+
groups.set(group, makeGroup(memory ?? defaultMemory));
|
|
169
|
+
}
|
|
170
|
+
else if (memory !== undefined) {
|
|
171
|
+
existing.memory = memory;
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
hasGroup(group) {
|
|
175
|
+
return groups.has(group);
|
|
176
|
+
},
|
|
177
|
+
groups() {
|
|
178
|
+
return Array.from(groups.keys());
|
|
179
|
+
},
|
|
180
|
+
removeGroup(group) {
|
|
181
|
+
groups.delete(group);
|
|
182
|
+
},
|
|
183
|
+
cellsInRadius,
|
|
184
|
+
observe,
|
|
185
|
+
observeCircle(group, x, z, radius) {
|
|
186
|
+
return observe(group, cellsInRadius(x, z, radius));
|
|
187
|
+
},
|
|
188
|
+
stateAtCell(group, cell) {
|
|
189
|
+
const data = groups.get(group);
|
|
190
|
+
if (data === undefined || cell < 0 || cell >= total)
|
|
191
|
+
return "hidden";
|
|
192
|
+
return stateOf(data.codes[cell]);
|
|
193
|
+
},
|
|
194
|
+
stateAt(group, x, z) {
|
|
195
|
+
const data = groups.get(group);
|
|
196
|
+
if (data === undefined)
|
|
197
|
+
return "hidden";
|
|
198
|
+
return stateOf(data.codes[cellIndex(x, z)]);
|
|
199
|
+
},
|
|
200
|
+
isObserved(group, x, z) {
|
|
201
|
+
const data = groups.get(group);
|
|
202
|
+
return data !== undefined && data.codes[cellIndex(x, z)] === VISIBILITY_OBSERVED;
|
|
203
|
+
},
|
|
204
|
+
isRemembered(group, x, z) {
|
|
205
|
+
const data = groups.get(group);
|
|
206
|
+
return data !== undefined && data.codes[cellIndex(x, z)] === VISIBILITY_REMEMBERED;
|
|
207
|
+
},
|
|
208
|
+
isKnown(group, x, z) {
|
|
209
|
+
const data = groups.get(group);
|
|
210
|
+
return data !== undefined && data.codes[cellIndex(x, z)] !== VISIBILITY_HIDDEN;
|
|
211
|
+
},
|
|
212
|
+
observedCount(group) {
|
|
213
|
+
return groups.get(group)?.observed.size ?? 0;
|
|
214
|
+
},
|
|
215
|
+
knownCount(group) {
|
|
216
|
+
const data = groups.get(group);
|
|
217
|
+
if (data === undefined)
|
|
218
|
+
return 0;
|
|
219
|
+
return data.observed.size + data.remembered.size;
|
|
220
|
+
},
|
|
221
|
+
visibleTo(group, entities, positionOf) {
|
|
222
|
+
const data = groups.get(group);
|
|
223
|
+
if (data === undefined)
|
|
224
|
+
return [];
|
|
225
|
+
const result = [];
|
|
226
|
+
for (const entity of entities) {
|
|
227
|
+
const position = positionOf(entity);
|
|
228
|
+
if (data.codes[cellIndex(position.x, position.z)] === VISIBILITY_OBSERVED) {
|
|
229
|
+
result.push(entity);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return result;
|
|
233
|
+
},
|
|
234
|
+
cells(group) {
|
|
235
|
+
const data = groups.get(group);
|
|
236
|
+
const codes = data === undefined ? new Uint8Array(total) : data.codes.slice();
|
|
237
|
+
return { cols, rows, minX, minZ, cellSize, codes };
|
|
238
|
+
},
|
|
239
|
+
toState() {
|
|
240
|
+
const out = {};
|
|
241
|
+
for (const [name, data] of groups) {
|
|
242
|
+
const remembered = Array.from(data.remembered.entries()).sort((a, b) => a[0] - b[0]);
|
|
243
|
+
out[name] = {
|
|
244
|
+
observed: Array.from(data.observed).sort((a, b) => a - b),
|
|
245
|
+
remembered,
|
|
246
|
+
tick: data.tick,
|
|
247
|
+
memory: data.memory,
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
return { cols, rows, minX, minZ, cellSize, memory: defaultMemory, groups: out };
|
|
251
|
+
},
|
|
252
|
+
reset(group) {
|
|
253
|
+
if (group === undefined) {
|
|
254
|
+
for (const data of groups.values()) {
|
|
255
|
+
data.codes.fill(VISIBILITY_HIDDEN);
|
|
256
|
+
data.observed.clear();
|
|
257
|
+
data.remembered.clear();
|
|
258
|
+
data.tick = 0;
|
|
259
|
+
}
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
const data = groups.get(group);
|
|
263
|
+
if (data === undefined)
|
|
264
|
+
return;
|
|
265
|
+
data.codes.fill(VISIBILITY_HIDDEN);
|
|
266
|
+
data.observed.clear();
|
|
267
|
+
data.remembered.clear();
|
|
268
|
+
data.tick = 0;
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Volumetric cloud layer config for `sky()` — a raymarched cloud slab mounted from the environment
|
|
3
|
+
* `sky` seam. Pure config + defaulting here; the raymarch shader lives in the `shell` renderer
|
|
4
|
+
* (`environment/VolumetricClouds.tsx`), mounted alongside `SkyDome` whenever a sky descriptor carries
|
|
5
|
+
* this field. Off by default — omit `volumetricClouds` on `sky({...})` and no layer mounts.
|
|
6
|
+
*
|
|
7
|
+
* @capability volumetric-clouds raymarched cloud layer sky option
|
|
8
|
+
*/
|
|
9
|
+
/** Volumetric cloud layer params, as authored on `sky({ volumetricClouds })`. All fields optional. */
|
|
10
|
+
export interface VolumetricCloudsConfig {
|
|
11
|
+
/** Fraction of the sky covered by cloud mass, 0..1. Higher = more overcast. Default 0.42. */
|
|
12
|
+
coverage?: number;
|
|
13
|
+
/** Raymarch density multiplier — thicker, more opaque cloud bodies at higher values. Default 1.5. */
|
|
14
|
+
density?: number;
|
|
15
|
+
/** Cloud layer base altitude in world units. Default 90. */
|
|
16
|
+
height?: number;
|
|
17
|
+
/** Cloud layer vertical thickness in world units. Default 55. */
|
|
18
|
+
thickness?: number;
|
|
19
|
+
/** Horizontal drift speed, world units/second. Default 1.1. */
|
|
20
|
+
speed?: number;
|
|
21
|
+
/** Noise feature scale — world units per cloud puff; larger = bigger, fewer puffs. Default 140. */
|
|
22
|
+
scale?: number;
|
|
23
|
+
/** Cloud body base color (shadowed side). Default "#c9d3de". */
|
|
24
|
+
color?: string;
|
|
25
|
+
/** Sun-facing lit edge color (silver-lining / forward scatter). Default "#fff6e0". */
|
|
26
|
+
sunColor?: string;
|
|
27
|
+
/** Forward sun-scatter strength, 0..1 — brighter, more luminous edges toward the sun. Default 0.9. */
|
|
28
|
+
sunScatter?: number;
|
|
29
|
+
/** Seed string; same seed reproduces the same cloud layout. */
|
|
30
|
+
seed?: string;
|
|
31
|
+
}
|
|
32
|
+
/** Fully-defaulted volumetric cloud params, resolved from a `VolumetricCloudsConfig`. */
|
|
33
|
+
export interface VolumetricCloudsRules {
|
|
34
|
+
coverage: number;
|
|
35
|
+
density: number;
|
|
36
|
+
height: number;
|
|
37
|
+
thickness: number;
|
|
38
|
+
speed: number;
|
|
39
|
+
scale: number;
|
|
40
|
+
color: string;
|
|
41
|
+
sunColor: string;
|
|
42
|
+
sunScatter: number;
|
|
43
|
+
seed: string;
|
|
44
|
+
}
|
|
45
|
+
/** Volumetric cloud defaults: a moderate, drifting cumulus layer. */
|
|
46
|
+
export declare const VOLUMETRIC_CLOUDS_DEFAULTS: VolumetricCloudsRules;
|
|
47
|
+
/**
|
|
48
|
+
* Resolve a `VolumetricCloudsConfig` into fully-defaulted, clamped rules — pure, no shader/DOM
|
|
49
|
+
* involved, so the defaulting logic is unit-testable without a renderer.
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
export declare function resolveVolumetricClouds(config?: VolumetricCloudsConfig): VolumetricCloudsRules;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Volumetric cloud layer config for `sky()` — a raymarched cloud slab mounted from the environment
|
|
3
|
+
* `sky` seam. Pure config + defaulting here; the raymarch shader lives in the `shell` renderer
|
|
4
|
+
* (`environment/VolumetricClouds.tsx`), mounted alongside `SkyDome` whenever a sky descriptor carries
|
|
5
|
+
* this field. Off by default — omit `volumetricClouds` on `sky({...})` and no layer mounts.
|
|
6
|
+
*
|
|
7
|
+
* @capability volumetric-clouds raymarched cloud layer sky option
|
|
8
|
+
*/
|
|
9
|
+
/** Volumetric cloud defaults: a moderate, drifting cumulus layer. */
|
|
10
|
+
export const VOLUMETRIC_CLOUDS_DEFAULTS = {
|
|
11
|
+
coverage: 0.42,
|
|
12
|
+
density: 1.5,
|
|
13
|
+
height: 90,
|
|
14
|
+
thickness: 55,
|
|
15
|
+
speed: 1.1,
|
|
16
|
+
scale: 140,
|
|
17
|
+
color: "#c9d3de",
|
|
18
|
+
sunColor: "#fff6e0",
|
|
19
|
+
sunScatter: 0.9,
|
|
20
|
+
seed: "",
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Resolve a `VolumetricCloudsConfig` into fully-defaulted, clamped rules — pure, no shader/DOM
|
|
24
|
+
* involved, so the defaulting logic is unit-testable without a renderer.
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
export function resolveVolumetricClouds(config = {}) {
|
|
28
|
+
return {
|
|
29
|
+
coverage: clamp01(config.coverage ?? VOLUMETRIC_CLOUDS_DEFAULTS.coverage),
|
|
30
|
+
density: Math.max(0, config.density ?? VOLUMETRIC_CLOUDS_DEFAULTS.density),
|
|
31
|
+
height: config.height ?? VOLUMETRIC_CLOUDS_DEFAULTS.height,
|
|
32
|
+
thickness: Math.max(1, config.thickness ?? VOLUMETRIC_CLOUDS_DEFAULTS.thickness),
|
|
33
|
+
speed: config.speed ?? VOLUMETRIC_CLOUDS_DEFAULTS.speed,
|
|
34
|
+
scale: Math.max(1, config.scale ?? VOLUMETRIC_CLOUDS_DEFAULTS.scale),
|
|
35
|
+
color: config.color ?? VOLUMETRIC_CLOUDS_DEFAULTS.color,
|
|
36
|
+
sunColor: config.sunColor ?? VOLUMETRIC_CLOUDS_DEFAULTS.sunColor,
|
|
37
|
+
sunScatter: clamp01(config.sunScatter ?? VOLUMETRIC_CLOUDS_DEFAULTS.sunScatter),
|
|
38
|
+
seed: config.seed ?? VOLUMETRIC_CLOUDS_DEFAULTS.seed,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function clamp01(value) {
|
|
42
|
+
return Math.min(1, Math.max(0, value));
|
|
43
|
+
}
|
package/dist/world/walls.d.ts
CHANGED
|
@@ -27,11 +27,17 @@ export interface RoofConfig {
|
|
|
27
27
|
pitch?: number;
|
|
28
28
|
overhang?: number;
|
|
29
29
|
}
|
|
30
|
+
/** @internal */
|
|
30
31
|
export declare function wallSegments(points: readonly Vec2[], closed: boolean): WallSegment[];
|
|
32
|
+
/** @internal */
|
|
31
33
|
export declare function isEnclosed(points: readonly Vec2[], tolerance?: number): boolean;
|
|
34
|
+
/** @internal */
|
|
32
35
|
export declare function enclosePath(points: readonly Vec2[], tolerance?: number): readonly Vec2[];
|
|
36
|
+
/** @internal */
|
|
33
37
|
export declare function polygonArea(polygon: readonly Vec2[]): number;
|
|
38
|
+
/** @internal */
|
|
34
39
|
export declare function footprintFromWalls(points: readonly Vec2[], tolerance?: number): EnclosedFootprint | null;
|
|
40
|
+
/** @internal */
|
|
35
41
|
export declare function autoRoof(footprint: EnclosedFootprint, config?: RoofConfig): RoofPlan;
|
|
36
42
|
export type PaintTarget = "floor" | "wall";
|
|
37
43
|
export interface SurfacePaintStore {
|
|
@@ -42,6 +48,7 @@ export interface SurfacePaintStore {
|
|
|
42
48
|
snapshot(): Record<PaintTarget, Record<string, string>>;
|
|
43
49
|
restore(snapshot: Record<PaintTarget, Record<string, string>>): void;
|
|
44
50
|
}
|
|
51
|
+
/** @internal */
|
|
45
52
|
export declare function createSurfacePaint(): SurfacePaintStore;
|
|
46
53
|
export interface WallDrawTool {
|
|
47
54
|
addPoint(point: Vec2, snap?: number): Vec2;
|
|
@@ -54,8 +61,10 @@ export interface WallDrawTool {
|
|
|
54
61
|
footprint(): EnclosedFootprint | null;
|
|
55
62
|
roof(config?: RoofConfig): RoofPlan | null;
|
|
56
63
|
}
|
|
64
|
+
/** @internal */
|
|
57
65
|
export declare function createWallDrawTool(config?: {
|
|
58
66
|
snap?: number;
|
|
59
67
|
closeTolerance?: number;
|
|
60
68
|
}): WallDrawTool;
|
|
69
|
+
/** @internal */
|
|
61
70
|
export declare function wallSegmentBounds(segment: WallSegment, thickness: number): Aabb;
|
package/dist/world/walls.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { footprintAabb } from "./geometry.js";
|
|
2
|
+
/** @internal */
|
|
2
3
|
export function wallSegments(points, closed) {
|
|
3
4
|
const segments = [];
|
|
4
5
|
const count = closed ? points.length : points.length - 1;
|
|
@@ -11,6 +12,7 @@ export function wallSegments(points, closed) {
|
|
|
11
12
|
}
|
|
12
13
|
return segments;
|
|
13
14
|
}
|
|
15
|
+
/** @internal */
|
|
14
16
|
export function isEnclosed(points, tolerance = 0.5) {
|
|
15
17
|
if (points.length < 3)
|
|
16
18
|
return false;
|
|
@@ -18,6 +20,7 @@ export function isEnclosed(points, tolerance = 0.5) {
|
|
|
18
20
|
const last = points[points.length - 1];
|
|
19
21
|
return Math.hypot(first[0] - last[0], first[1] - last[1]) <= tolerance;
|
|
20
22
|
}
|
|
23
|
+
/** @internal */
|
|
21
24
|
export function enclosePath(points, tolerance = 0.5) {
|
|
22
25
|
if (points.length < 3)
|
|
23
26
|
return points;
|
|
@@ -25,6 +28,7 @@ export function enclosePath(points, tolerance = 0.5) {
|
|
|
25
28
|
return points;
|
|
26
29
|
return points.slice(0, points.length - 1);
|
|
27
30
|
}
|
|
31
|
+
/** @internal */
|
|
28
32
|
export function polygonArea(polygon) {
|
|
29
33
|
let sum = 0;
|
|
30
34
|
for (let index = 0; index < polygon.length; index += 1) {
|
|
@@ -34,6 +38,7 @@ export function polygonArea(polygon) {
|
|
|
34
38
|
}
|
|
35
39
|
return Math.abs(sum) / 2;
|
|
36
40
|
}
|
|
41
|
+
/** @internal */
|
|
37
42
|
export function footprintFromWalls(points, tolerance = 0.5) {
|
|
38
43
|
const closed = isEnclosed(points, tolerance);
|
|
39
44
|
const polygon = enclosePath(points, tolerance);
|
|
@@ -65,6 +70,7 @@ export function footprintFromWalls(points, tolerance = 0.5) {
|
|
|
65
70
|
closed,
|
|
66
71
|
};
|
|
67
72
|
}
|
|
73
|
+
/** @internal */
|
|
68
74
|
export function autoRoof(footprint, config = {}) {
|
|
69
75
|
const style = config.style ?? "hip";
|
|
70
76
|
const eaveHeight = config.eaveHeight ?? 3;
|
|
@@ -131,6 +137,7 @@ export function autoRoof(footprint, config = {}) {
|
|
|
131
137
|
}
|
|
132
138
|
return { style, ridge, apexHeight, eaveHeight, faces };
|
|
133
139
|
}
|
|
140
|
+
/** @internal */
|
|
134
141
|
export function createSurfacePaint() {
|
|
135
142
|
const maps = {
|
|
136
143
|
floor: new Map(),
|
|
@@ -166,6 +173,7 @@ function snapPoint(point, grid) {
|
|
|
166
173
|
return point;
|
|
167
174
|
return [Math.round(point[0] / grid) * grid, Math.round(point[1] / grid) * grid];
|
|
168
175
|
}
|
|
176
|
+
/** @internal */
|
|
169
177
|
export function createWallDrawTool(config = {}) {
|
|
170
178
|
const defaultSnap = config.snap ?? 0;
|
|
171
179
|
const closeTolerance = config.closeTolerance ?? 0.5;
|
|
@@ -214,6 +222,7 @@ export function createWallDrawTool(config = {}) {
|
|
|
214
222
|
},
|
|
215
223
|
};
|
|
216
224
|
}
|
|
225
|
+
/** @internal */
|
|
217
226
|
export function wallSegmentBounds(segment, thickness) {
|
|
218
227
|
const center = [(segment.from[0] + segment.to[0]) / 2, (segment.from[1] + segment.to[1]) / 2];
|
|
219
228
|
const quarterTurns = Math.abs(Math.round(segment.angle / (Math.PI / 2))) % 2;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `water` studio: a parametric water surface authored as a box volume — its XZ footprint becomes the
|
|
3
|
+
* water plane, its top face the water height. Pure config here (color/wave/foam/opacity params + a
|
|
4
|
+
* footprint resolver); the animated shader plane lives in the `shell` renderer, which maps these
|
|
5
|
+
* params onto the existing Ocean material. A scene kind so a pond or moat is dragged in the editor and
|
|
6
|
+
* tuned with sliders, persisted in `editor.scene.json`. Distinct from the infinite `waterSurface`
|
|
7
|
+
* ocean primitive (`./water`) — this is a bounded, editor-authored patch.
|
|
8
|
+
*
|
|
9
|
+
* @capability water parametric water surface volume
|
|
10
|
+
*/
|
|
11
|
+
import { type ParamSchema, type SceneKindObject } from "../scene/sceneKinds.js";
|
|
12
|
+
/** The editor volume kind marking a box as a water surface. */
|
|
13
|
+
export declare const WATER_VOLUME_KIND = "water";
|
|
14
|
+
/** Fully-defaulted water surface params parsed from a volume's `meta`. */
|
|
15
|
+
export interface WaterRules {
|
|
16
|
+
/** Deep-water base color (hex). */
|
|
17
|
+
color: string;
|
|
18
|
+
/** Shallow/edge tint blended toward the shore (hex). */
|
|
19
|
+
shallowColor: string;
|
|
20
|
+
/** Wave amplitude in meters. */
|
|
21
|
+
waveHeight: number;
|
|
22
|
+
/** Wave scroll speed multiplier. */
|
|
23
|
+
waveSpeed: number;
|
|
24
|
+
/** Spatial wave frequency (waves per meter). */
|
|
25
|
+
waveScale: number;
|
|
26
|
+
/** Foam band width at the shoreline, meters. */
|
|
27
|
+
foam: number;
|
|
28
|
+
/** Surface opacity, 0..1. */
|
|
29
|
+
opacity: number;
|
|
30
|
+
/** Reflection/metalness strength, 0..1. */
|
|
31
|
+
reflectivity: number;
|
|
32
|
+
}
|
|
33
|
+
/** Water defaults: a calm blue-green pond with a soft foam edge. */
|
|
34
|
+
export declare const WATER_DEFAULTS: WaterRules;
|
|
35
|
+
/** The water parameter schema — drives the inspector and `meta` parse via the studio seam. */
|
|
36
|
+
export declare const WATER_SCHEMA: ParamSchema;
|
|
37
|
+
/** Parse a volume's `meta` into fully-defaulted water rules. @internal */
|
|
38
|
+
export declare function readWaterRules(meta: Record<string, unknown> | undefined): WaterRules;
|
|
39
|
+
/** A resolved water surface: world-space plane center/size (XZ) at surface height `y`, plus its params. */
|
|
40
|
+
export interface ResolvedWater {
|
|
41
|
+
center: readonly [number, number, number];
|
|
42
|
+
/** Full width (X) and depth (Z) of the water plane in meters. */
|
|
43
|
+
size: readonly [number, number];
|
|
44
|
+
rules: WaterRules;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Resolve a water volume into a flat surface: the box footprint (`halfExtents`, else `radius`) becomes
|
|
48
|
+
* the plane size, the box top (`center.y + halfExtents.y`) the water height. Returns null for a
|
|
49
|
+
* degenerate footprint. Reads footprint from the object's `halfExtents`/`radius` meta mirror written
|
|
50
|
+
* by the volume, falling back to a 20 m square.
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export declare function resolveWaterObject(object: SceneKindObject): ResolvedWater | null;
|
|
54
|
+
/** Registers the `water` scene kind (schema + resolver). Called by {@link registerBuiltinSceneKinds}. @internal */
|
|
55
|
+
export declare function registerWaterKind(): void;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `water` studio: a parametric water surface authored as a box volume — its XZ footprint becomes the
|
|
3
|
+
* water plane, its top face the water height. Pure config here (color/wave/foam/opacity params + a
|
|
4
|
+
* footprint resolver); the animated shader plane lives in the `shell` renderer, which maps these
|
|
5
|
+
* params onto the existing Ocean material. A scene kind so a pond or moat is dragged in the editor and
|
|
6
|
+
* tuned with sliders, persisted in `editor.scene.json`. Distinct from the infinite `waterSurface`
|
|
7
|
+
* ocean primitive (`./water`) — this is a bounded, editor-authored patch.
|
|
8
|
+
*
|
|
9
|
+
* @capability water parametric water surface volume
|
|
10
|
+
*/
|
|
11
|
+
import { registerSceneKind } from "../scene/sceneKinds.js";
|
|
12
|
+
/** The editor volume kind marking a box as a water surface. */
|
|
13
|
+
export const WATER_VOLUME_KIND = "water";
|
|
14
|
+
/** Water defaults: a calm blue-green pond with a soft foam edge. */
|
|
15
|
+
export const WATER_DEFAULTS = {
|
|
16
|
+
color: "#1c6c86",
|
|
17
|
+
shallowColor: "#4bb6bf",
|
|
18
|
+
waveHeight: 0.12,
|
|
19
|
+
waveSpeed: 0.6,
|
|
20
|
+
waveScale: 0.35,
|
|
21
|
+
foam: 1.2,
|
|
22
|
+
opacity: 0.86,
|
|
23
|
+
reflectivity: 0.4,
|
|
24
|
+
};
|
|
25
|
+
/** The water parameter schema — drives the inspector and `meta` parse via the studio seam. */
|
|
26
|
+
export const WATER_SCHEMA = {
|
|
27
|
+
fields: [
|
|
28
|
+
{ type: "color", key: "color", label: "deep color", default: WATER_DEFAULTS.color },
|
|
29
|
+
{ type: "color", key: "shallowColor", label: "shallow color", default: WATER_DEFAULTS.shallowColor },
|
|
30
|
+
{ type: "range", key: "waveHeight", label: "wave height", min: 0, max: 1, step: 0.01, default: WATER_DEFAULTS.waveHeight, unit: "m" },
|
|
31
|
+
{ type: "range", key: "waveSpeed", label: "wave speed", min: 0, max: 3, step: 0.05, default: WATER_DEFAULTS.waveSpeed },
|
|
32
|
+
{ type: "range", key: "waveScale", label: "wave scale", min: 0.02, max: 2, step: 0.02, default: WATER_DEFAULTS.waveScale },
|
|
33
|
+
{ type: "range", key: "foam", label: "foam edge", min: 0, max: 6, step: 0.1, default: WATER_DEFAULTS.foam, unit: "m" },
|
|
34
|
+
{ type: "range", key: "opacity", label: "opacity", min: 0.1, max: 1, step: 0.01, default: WATER_DEFAULTS.opacity },
|
|
35
|
+
{ type: "range", key: "reflectivity", label: "reflectivity", min: 0, max: 1, step: 0.01, default: WATER_DEFAULTS.reflectivity },
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
function metaNumber(meta, key, fallback) {
|
|
39
|
+
const value = meta?.[key];
|
|
40
|
+
return typeof value === "number" && Number.isFinite(value) ? value : fallback;
|
|
41
|
+
}
|
|
42
|
+
function metaString(meta, key, fallback) {
|
|
43
|
+
const value = meta?.[key];
|
|
44
|
+
return typeof value === "string" ? value : fallback;
|
|
45
|
+
}
|
|
46
|
+
/** Parse a volume's `meta` into fully-defaulted water rules. @internal */
|
|
47
|
+
export function readWaterRules(meta) {
|
|
48
|
+
return {
|
|
49
|
+
color: metaString(meta, "color", WATER_DEFAULTS.color),
|
|
50
|
+
shallowColor: metaString(meta, "shallowColor", WATER_DEFAULTS.shallowColor),
|
|
51
|
+
waveHeight: Math.max(0, metaNumber(meta, "waveHeight", WATER_DEFAULTS.waveHeight)),
|
|
52
|
+
waveSpeed: Math.max(0, metaNumber(meta, "waveSpeed", WATER_DEFAULTS.waveSpeed)),
|
|
53
|
+
waveScale: Math.max(0.01, metaNumber(meta, "waveScale", WATER_DEFAULTS.waveScale)),
|
|
54
|
+
foam: Math.max(0, metaNumber(meta, "foam", WATER_DEFAULTS.foam)),
|
|
55
|
+
opacity: Math.min(1, Math.max(0, metaNumber(meta, "opacity", WATER_DEFAULTS.opacity))),
|
|
56
|
+
reflectivity: Math.min(1, Math.max(0, metaNumber(meta, "reflectivity", WATER_DEFAULTS.reflectivity))),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/** Reads a numeric field off a possibly-untyped `{x,y,z}`-ish object. */
|
|
60
|
+
function axis(value) {
|
|
61
|
+
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Resolve a water volume into a flat surface: the box footprint (`halfExtents`, else `radius`) becomes
|
|
65
|
+
* the plane size, the box top (`center.y + halfExtents.y`) the water height. Returns null for a
|
|
66
|
+
* degenerate footprint. Reads footprint from the object's `halfExtents`/`radius` meta mirror written
|
|
67
|
+
* by the volume, falling back to a 20 m square.
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
export function resolveWaterObject(object) {
|
|
71
|
+
const center = object.center ?? object.position;
|
|
72
|
+
if (center === undefined)
|
|
73
|
+
return null;
|
|
74
|
+
const meta = object.meta;
|
|
75
|
+
const he = object.halfExtents;
|
|
76
|
+
const radius = object.radius ?? axis(meta?.["radius"]);
|
|
77
|
+
const halfX = axis(he?.x) ?? radius ?? 10;
|
|
78
|
+
const halfZ = axis(he?.z) ?? radius ?? 10;
|
|
79
|
+
const halfY = axis(he?.y) ?? 0;
|
|
80
|
+
const width = Math.max(0.1, halfX * 2);
|
|
81
|
+
const depth = Math.max(0.1, halfZ * 2);
|
|
82
|
+
return { center: [center.x, center.y + halfY, center.z], size: [width, depth], rules: readWaterRules(meta) };
|
|
83
|
+
}
|
|
84
|
+
/** Registers the `water` scene kind (schema + resolver). Called by {@link registerBuiltinSceneKinds}. @internal */
|
|
85
|
+
export function registerWaterKind() {
|
|
86
|
+
registerSceneKind({
|
|
87
|
+
kind: WATER_VOLUME_KIND,
|
|
88
|
+
target: "volume",
|
|
89
|
+
label: "Water surface",
|
|
90
|
+
addCategory: "Studios",
|
|
91
|
+
accent: "#38bdf8",
|
|
92
|
+
schema: WATER_SCHEMA,
|
|
93
|
+
resolve: (object) => resolveWaterObject(object),
|
|
94
|
+
note: (object) => {
|
|
95
|
+
const resolved = resolveWaterObject(object);
|
|
96
|
+
return resolved === null ? "Give the volume a box footprint." : `${Math.round(resolved.size[0])}×${Math.round(resolved.size[1])} m surface`;
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
}
|