@pinkaphant/kolmo 0.4.7 → 0.5.1
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/README.md +25 -94
- package/dist/engine/actor.d.ts +13 -0
- package/dist/engine/gltfLoader.d.ts +18 -0
- package/dist/engine/index.d.ts +8 -17
- package/dist/engine/index.js +667 -27
- package/dist/engine/index.js.map +1 -1
- package/dist/engine/{kolmoInput.d.ts → input.d.ts} +8 -6
- package/dist/engine/surface.d.ts +17 -0
- package/dist/engine/{kolmoTraits.d.ts → traits.d.ts} +24 -48
- package/dist/engine/vehicle.d.ts +20 -0
- package/dist/engine/world.d.ts +76 -0
- package/dist/index.d.ts +14 -18
- package/dist/index.js +16 -116
- package/dist/physics/index.d.ts +3 -3
- package/dist/physics/index.js +1 -131
- package/dist/physics/nBodyGravity.d.ts +14 -7
- package/dist/physics-ZDFXaCli.js +475 -0
- package/dist/physics-ZDFXaCli.js.map +1 -0
- package/dist/surface-DUol_5ml.js +610 -0
- package/dist/surface-DUol_5ml.js.map +1 -0
- package/dist/toolgun/Toolgun.d.ts +33 -0
- package/dist/toolgun/index.d.ts +2 -0
- package/dist/toolgun/index.js +1 -0
- package/dist/toolgun/store.d.ts +198 -0
- package/dist/toolgun-BfcCIAQx.js +1582 -0
- package/dist/toolgun-BfcCIAQx.js.map +1 -0
- package/dist/vite/index.d.ts +0 -4
- package/dist/vite/index.js +1 -9
- package/dist/vite/index.js.map +1 -1
- package/package.json +32 -89
- package/AGENTS.md +0 -29
- package/CLAUDE.md +0 -8
- package/bin/kolmo.mjs +0 -561
- package/dist/engine/causewayBridge.d.ts +0 -14
- package/dist/engine/causewayBridge.js +0 -166
- package/dist/engine/causewayBridge.js.map +0 -1
- package/dist/engine/islandSettlementMesh.d.ts +0 -26
- package/dist/engine/islandSettlementMesh.js +0 -166
- package/dist/engine/islandSettlementMesh.js.map +0 -1
- package/dist/engine/kolmoActions.d.ts +0 -23
- package/dist/engine/kolmoActions.js +0 -179
- package/dist/engine/kolmoActions.js.map +0 -1
- package/dist/engine/kolmoActor.d.ts +0 -21
- package/dist/engine/kolmoActor.js +0 -273
- package/dist/engine/kolmoActor.js.map +0 -1
- package/dist/engine/kolmoActorHelpers.d.ts +0 -24
- package/dist/engine/kolmoActorHelpers.js +0 -64
- package/dist/engine/kolmoActorHelpers.js.map +0 -1
- package/dist/engine/kolmoBotControl.d.ts +0 -44
- package/dist/engine/kolmoBotControl.js +0 -194
- package/dist/engine/kolmoBotControl.js.map +0 -1
- package/dist/engine/kolmoBotJournal.d.ts +0 -23
- package/dist/engine/kolmoBotJournal.js +0 -138
- package/dist/engine/kolmoBotJournal.js.map +0 -1
- package/dist/engine/kolmoFloatingOrigin.d.ts +0 -17
- package/dist/engine/kolmoFloatingOrigin.js +0 -91
- package/dist/engine/kolmoFloatingOrigin.js.map +0 -1
- package/dist/engine/kolmoGame.d.ts +0 -27
- package/dist/engine/kolmoGame.js +0 -83
- package/dist/engine/kolmoGame.js.map +0 -1
- package/dist/engine/kolmoGltfLoader.d.ts +0 -16
- package/dist/engine/kolmoGltfLoader.js +0 -46
- package/dist/engine/kolmoGltfLoader.js.map +0 -1
- package/dist/engine/kolmoHud.d.ts +0 -23
- package/dist/engine/kolmoHud.js +0 -219
- package/dist/engine/kolmoHud.js.map +0 -1
- package/dist/engine/kolmoInput.js +0 -165
- package/dist/engine/kolmoInput.js.map +0 -1
- package/dist/engine/kolmoIsland.d.ts +0 -14
- package/dist/engine/kolmoIsland.js +0 -243
- package/dist/engine/kolmoIsland.js.map +0 -1
- package/dist/engine/kolmoLongDrive.d.ts +0 -12
- package/dist/engine/kolmoLongDrive.js +0 -178
- package/dist/engine/kolmoLongDrive.js.map +0 -1
- package/dist/engine/kolmoPilotMesh.d.ts +0 -6
- package/dist/engine/kolmoPilotMesh.js +0 -377
- package/dist/engine/kolmoPilotMesh.js.map +0 -1
- package/dist/engine/kolmoProcedural.d.ts +0 -13
- package/dist/engine/kolmoProcedural.js +0 -101
- package/dist/engine/kolmoProcedural.js.map +0 -1
- package/dist/engine/kolmoRigs.d.ts +0 -13
- package/dist/engine/kolmoRigs.js +0 -100
- package/dist/engine/kolmoRigs.js.map +0 -1
- package/dist/engine/kolmoStore.d.ts +0 -3
- package/dist/engine/kolmoStore.js +0 -4
- package/dist/engine/kolmoStore.js.map +0 -1
- package/dist/engine/kolmoSurface.d.ts +0 -18
- package/dist/engine/kolmoSurface.js +0 -198
- package/dist/engine/kolmoSurface.js.map +0 -1
- package/dist/engine/kolmoTouchOverlay.d.ts +0 -21
- package/dist/engine/kolmoTouchOverlay.js +0 -326
- package/dist/engine/kolmoTouchOverlay.js.map +0 -1
- package/dist/engine/kolmoTouchState.d.ts +0 -50
- package/dist/engine/kolmoTouchState.js +0 -210
- package/dist/engine/kolmoTouchState.js.map +0 -1
- package/dist/engine/kolmoTraits.js +0 -140
- package/dist/engine/kolmoTraits.js.map +0 -1
- package/dist/engine/kolmoVehicle.d.ts +0 -4
- package/dist/engine/kolmoVehicle.js +0 -80
- package/dist/engine/kolmoVehicle.js.map +0 -1
- package/dist/engine/kolmoVehicleAutoCompile.d.ts +0 -11
- package/dist/engine/kolmoVehicleAutoCompile.js +0 -94
- package/dist/engine/kolmoVehicleAutoCompile.js.map +0 -1
- package/dist/engine/kolmoVehicleConfig.d.ts +0 -56
- package/dist/engine/kolmoVehicleConfig.js +0 -84
- package/dist/engine/kolmoVehicleConfig.js.map +0 -1
- package/dist/engine/kolmoVehicleDriver.d.ts +0 -39
- package/dist/engine/kolmoVehicleDriver.js +0 -147
- package/dist/engine/kolmoVehicleDriver.js.map +0 -1
- package/dist/engine/kolmoVehicleInner.d.ts +0 -7
- package/dist/engine/kolmoVehicleInner.js +0 -307
- package/dist/engine/kolmoVehicleInner.js.map +0 -1
- package/dist/engine/kolmoWardrobeRig.d.ts +0 -22
- package/dist/engine/kolmoWardrobeRig.js +0 -146
- package/dist/engine/kolmoWardrobeRig.js.map +0 -1
- package/dist/engine/kolmoWorld.d.ts +0 -45
- package/dist/engine/kolmoWorld.js +0 -164
- package/dist/engine/kolmoWorld.js.map +0 -1
- package/dist/engine/longDriveKit.d.ts +0 -19
- package/dist/engine/longDriveKit.js +0 -145
- package/dist/engine/longDriveKit.js.map +0 -1
- package/dist/engine/longDriveRoadside.d.ts +0 -16
- package/dist/engine/longDriveRoadside.js +0 -171
- package/dist/engine/longDriveRoadside.js.map +0 -1
- package/dist/engine/macroCellBuilder.d.ts +0 -44
- package/dist/engine/macroCellBuilder.js +0 -228
- package/dist/engine/macroCellBuilder.js.map +0 -1
- package/dist/engine/mainlandMacroCell.d.ts +0 -15
- package/dist/engine/mainlandMacroCell.js +0 -168
- package/dist/engine/mainlandMacroCell.js.map +0 -1
- package/dist/engine/shiftedFixedBody.d.ts +0 -13
- package/dist/engine/shiftedFixedBody.js +0 -75
- package/dist/engine/shiftedFixedBody.js.map +0 -1
- package/dist/importer/ChopShopPanel.d.ts +0 -52
- package/dist/importer/ChopShopPanel.js +0 -409
- package/dist/importer/ChopShopPanel.js.map +0 -1
- package/dist/importer/DomainWorkshopPanel.d.ts +0 -25
- package/dist/importer/DomainWorkshopPanel.js +0 -385
- package/dist/importer/DomainWorkshopPanel.js.map +0 -1
- package/dist/importer/GateHudBar.d.ts +0 -39
- package/dist/importer/GateHudBar.js +0 -401
- package/dist/importer/GateHudBar.js.map +0 -1
- package/dist/importer/GlbImportGate.d.ts +0 -8
- package/dist/importer/GlbImportGate.js +0 -300
- package/dist/importer/GlbImportGate.js.map +0 -1
- package/dist/importer/ImperativeVehicleRig.d.ts +0 -9
- package/dist/importer/ImperativeVehicleRig.js +0 -274
- package/dist/importer/ImperativeVehicleRig.js.map +0 -1
- package/dist/importer/LiveDrivePads.d.ts +0 -20
- package/dist/importer/LiveDrivePads.js +0 -195
- package/dist/importer/LiveDrivePads.js.map +0 -1
- package/dist/importer/PaperShellDebrisRig.d.ts +0 -25
- package/dist/importer/PaperShellDebrisRig.js +0 -143
- package/dist/importer/PaperShellDebrisRig.js.map +0 -1
- package/dist/importer/R2VaultDrawer.d.ts +0 -12
- package/dist/importer/R2VaultDrawer.js +0 -90
- package/dist/importer/R2VaultDrawer.js.map +0 -1
- package/dist/importer/Step1CalibrationPlinth.d.ts +0 -56
- package/dist/importer/Step1CalibrationPlinth.js +0 -204
- package/dist/importer/Step1CalibrationPlinth.js.map +0 -1
- package/dist/importer/Step1ExplodedIslands.d.ts +0 -31
- package/dist/importer/Step1ExplodedIslands.js +0 -144
- package/dist/importer/Step1ExplodedIslands.js.map +0 -1
- package/dist/importer/Step2UniversalPad.d.ts +0 -18
- package/dist/importer/Step2UniversalPad.js +0 -123
- package/dist/importer/Step2UniversalPad.js.map +0 -1
- package/dist/importer/VfxEmitterPool.d.ts +0 -8
- package/dist/importer/VfxEmitterPool.js +0 -64
- package/dist/importer/VfxEmitterPool.js.map +0 -1
- package/dist/importer/WardrobeWorkshopPanel.d.ts +0 -15
- package/dist/importer/WardrobeWorkshopPanel.js +0 -529
- package/dist/importer/WardrobeWorkshopPanel.js.map +0 -1
- package/dist/importer/WheelRingHandles3D.d.ts +0 -11
- package/dist/importer/WheelRingHandles3D.js +0 -319
- package/dist/importer/WheelRingHandles3D.js.map +0 -1
- package/dist/importer/archLinerGeom.d.ts +0 -2
- package/dist/importer/archLinerGeom.js +0 -51
- package/dist/importer/archLinerGeom.js.map +0 -1
- package/dist/importer/chopHingeHelpers.d.ts +0 -15
- package/dist/importer/chopHingeHelpers.js +0 -193
- package/dist/importer/chopHingeHelpers.js.map +0 -1
- package/dist/importer/chopShopActions.d.ts +0 -58
- package/dist/importer/chopShopActions.js +0 -165
- package/dist/importer/chopShopActions.js.map +0 -1
- package/dist/importer/chopShopHandlers.d.ts +0 -26
- package/dist/importer/chopShopHandlers.js +0 -283
- package/dist/importer/chopShopHandlers.js.map +0 -1
- package/dist/importer/chopShopIoActions.d.ts +0 -20
- package/dist/importer/chopShopIoActions.js +0 -192
- package/dist/importer/chopShopIoActions.js.map +0 -1
- package/dist/importer/chopShopMcpAction.d.ts +0 -18
- package/dist/importer/chopShopMcpAction.js +0 -58
- package/dist/importer/chopShopMcpAction.js.map +0 -1
- package/dist/importer/cylinderBooleanSlice.d.ts +0 -14
- package/dist/importer/cylinderBooleanSlice.js +0 -110
- package/dist/importer/cylinderBooleanSlice.js.map +0 -1
- package/dist/importer/cylinderSliceMath.d.ts +0 -14
- package/dist/importer/cylinderSliceMath.js +0 -251
- package/dist/importer/cylinderSliceMath.js.map +0 -1
- package/dist/importer/fusedWheelDetect.d.ts +0 -4
- package/dist/importer/fusedWheelDetect.js +0 -297
- package/dist/importer/fusedWheelDetect.js.map +0 -1
- package/dist/importer/fusedWheelFit.d.ts +0 -19
- package/dist/importer/fusedWheelFit.js +0 -219
- package/dist/importer/fusedWheelFit.js.map +0 -1
- package/dist/importer/gateStore.d.ts +0 -73
- package/dist/importer/gateStore.js +0 -102
- package/dist/importer/gateStore.js.map +0 -1
- package/dist/importer/glbNormalizer.d.ts +0 -22
- package/dist/importer/glbNormalizer.js +0 -177
- package/dist/importer/glbNormalizer.js.map +0 -1
- package/dist/importer/importerWebMcp.d.ts +0 -51
- package/dist/importer/importerWebMcp.js +0 -50
- package/dist/importer/importerWebMcp.js.map +0 -1
- package/dist/importer/importerWebMcpTools.d.ts +0 -2
- package/dist/importer/importerWebMcpTools.js +0 -368
- package/dist/importer/importerWebMcpTools.js.map +0 -1
- package/dist/importer/index.d.ts +0 -29
- package/dist/importer/index.js +0 -42
- package/dist/importer/index.js.map +0 -1
- package/dist/importer/khrCarGeometryMass.d.ts +0 -20
- package/dist/importer/khrCarGeometryMass.js +0 -131
- package/dist/importer/khrCarGeometryMass.js.map +0 -1
- package/dist/importer/khrCarPlanHelpers.d.ts +0 -39
- package/dist/importer/khrCarPlanHelpers.js +0 -300
- package/dist/importer/khrCarPlanHelpers.js.map +0 -1
- package/dist/importer/khrCarPlanner.d.ts +0 -8
- package/dist/importer/khrCarPlanner.js +0 -289
- package/dist/importer/khrCarPlanner.js.map +0 -1
- package/dist/importer/khrCompiler.d.ts +0 -5
- package/dist/importer/khrCompiler.js +0 -87
- package/dist/importer/khrCompiler.js.map +0 -1
- package/dist/importer/khrCraftPropCompiler.d.ts +0 -45
- package/dist/importer/khrCraftPropCompiler.js +0 -263
- package/dist/importer/khrCraftPropCompiler.js.map +0 -1
- package/dist/importer/khrNodeNameGuard.d.ts +0 -20
- package/dist/importer/khrNodeNameGuard.js +0 -139
- package/dist/importer/khrNodeNameGuard.js.map +0 -1
- package/dist/importer/launcherBake.d.ts +0 -15
- package/dist/importer/launcherBake.js +0 -117
- package/dist/importer/launcherBake.js.map +0 -1
- package/dist/importer/launcherCadGeometry.d.ts +0 -22
- package/dist/importer/launcherCadGeometry.js +0 -185
- package/dist/importer/launcherCadGeometry.js.map +0 -1
- package/dist/importer/meshIslands.d.ts +0 -17
- package/dist/importer/meshIslands.js +0 -102
- package/dist/importer/meshIslands.js.map +0 -1
- package/dist/importer/meshSliceBuffers.d.ts +0 -15
- package/dist/importer/meshSliceBuffers.js +0 -159
- package/dist/importer/meshSliceBuffers.js.map +0 -1
- package/dist/importer/polygonEarClipYZ.d.ts +0 -3
- package/dist/importer/polygonEarClipYZ.js +0 -67
- package/dist/importer/polygonEarClipYZ.js.map +0 -1
- package/dist/importer/proceduralC12AndCraft.d.ts +0 -18
- package/dist/importer/proceduralC12AndCraft.js +0 -302
- package/dist/importer/proceduralC12AndCraft.js.map +0 -1
- package/dist/importer/proceduralDomainBuilders.d.ts +0 -10
- package/dist/importer/proceduralDomainBuilders.js +0 -346
- package/dist/importer/proceduralDomainBuilders.js.map +0 -1
- package/dist/importer/proceduralPersonAndProp.d.ts +0 -8
- package/dist/importer/proceduralPersonAndProp.js +0 -303
- package/dist/importer/proceduralPersonAndProp.js.map +0 -1
- package/dist/importer/sceneSiNormalize.d.ts +0 -19
- package/dist/importer/sceneSiNormalize.js +0 -145
- package/dist/importer/sceneSiNormalize.js.map +0 -1
- package/dist/importer/starterScene.d.ts +0 -5
- package/dist/importer/starterScene.js +0 -139
- package/dist/importer/starterScene.js.map +0 -1
- package/dist/importer/surfaceCutter.d.ts +0 -16
- package/dist/importer/surfaceCutter.js +0 -83
- package/dist/importer/surfaceCutter.js.map +0 -1
- package/dist/importer/surfaceGeodesic.d.ts +0 -7
- package/dist/importer/surfaceGeodesic.js +0 -130
- package/dist/importer/surfaceGeodesic.js.map +0 -1
- package/dist/importer/surfaceLoopRefine.d.ts +0 -6
- package/dist/importer/surfaceLoopRefine.js +0 -171
- package/dist/importer/surfaceLoopRefine.js.map +0 -1
- package/dist/importer/surfacePeel.d.ts +0 -11
- package/dist/importer/surfacePeel.js +0 -119
- package/dist/importer/surfacePeel.js.map +0 -1
- package/dist/importer/surfaceTopology.d.ts +0 -36
- package/dist/importer/surfaceTopology.js +0 -143
- package/dist/importer/surfaceTopology.js.map +0 -1
- package/dist/importer/universalGateBake.d.ts +0 -45
- package/dist/importer/universalGateBake.js +0 -203
- package/dist/importer/universalGateBake.js.map +0 -1
- package/dist/importer/usdPhysicsSpecs.d.ts +0 -3
- package/dist/importer/usdPhysicsSpecs.js +0 -245
- package/dist/importer/usdPhysicsSpecs.js.map +0 -1
- package/dist/importer/usdTextParse.d.ts +0 -12
- package/dist/importer/usdTextParse.js +0 -118
- package/dist/importer/usdTextParse.js.map +0 -1
- package/dist/importer/usdToGlb.d.ts +0 -12
- package/dist/importer/usdToGlb.js +0 -94
- package/dist/importer/usdToGlb.js.map +0 -1
- package/dist/importer/useChopShopController.d.ts +0 -110
- package/dist/importer/useChopShopController.js +0 -219
- package/dist/importer/useChopShopController.js.map +0 -1
- package/dist/importer/useChopShopState.d.ts +0 -103
- package/dist/importer/useChopShopState.js +0 -350
- package/dist/importer/useChopShopState.js.map +0 -1
- package/dist/importer/useWasdKeyRef.d.ts +0 -9
- package/dist/importer/useWasdKeyRef.js +0 -35
- package/dist/importer/useWasdKeyRef.js.map +0 -1
- package/dist/importer/vehiclePartSplit.d.ts +0 -33
- package/dist/importer/vehiclePartSplit.js +0 -183
- package/dist/importer/vehiclePartSplit.js.map +0 -1
- package/dist/importer/wardrobeAutoFit.d.ts +0 -16
- package/dist/importer/wardrobeAutoFit.js +0 -410
- package/dist/importer/wardrobeAutoFit.js.map +0 -1
- package/dist/importer/wardrobeCatalog.d.ts +0 -16
- package/dist/importer/wardrobeCatalog.js +0 -409
- package/dist/importer/wardrobeCatalog.js.map +0 -1
- package/dist/importer/wardrobeController.d.ts +0 -49
- package/dist/importer/wardrobeController.js +0 -181
- package/dist/importer/wardrobeController.js.map +0 -1
- package/dist/importer/wardrobeFitter.d.ts +0 -27
- package/dist/importer/wardrobeFitter.js +0 -269
- package/dist/importer/wardrobeFitter.js.map +0 -1
- package/dist/importer/wardrobeWebMcpTools.d.ts +0 -2
- package/dist/importer/wardrobeWebMcpTools.js +0 -198
- package/dist/importer/wardrobeWebMcpTools.js.map +0 -1
- package/dist/importer/wheelAxlePairing.d.ts +0 -21
- package/dist/importer/wheelAxlePairing.js +0 -157
- package/dist/importer/wheelAxlePairing.js.map +0 -1
- package/dist/importer/wheelCutterHelpers.d.ts +0 -45
- package/dist/importer/wheelCutterHelpers.js +0 -208
- package/dist/importer/wheelCutterHelpers.js.map +0 -1
- package/dist/importer/wheelRingHandleMath.d.ts +0 -20
- package/dist/importer/wheelRingHandleMath.js +0 -66
- package/dist/importer/wheelRingHandleMath.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/junk/DestructibleTarget.d.ts +0 -18
- package/dist/junk/DestructibleTarget.js +0 -223
- package/dist/junk/DestructibleTarget.js.map +0 -1
- package/dist/junk/KolmoJunk.d.ts +0 -14
- package/dist/junk/KolmoJunk.js +0 -76
- package/dist/junk/KolmoJunk.js.map +0 -1
- package/dist/junk/ShardPieces.d.ts +0 -13
- package/dist/junk/ShardPieces.js +0 -101
- package/dist/junk/ShardPieces.js.map +0 -1
- package/dist/junk/TargetDecals.d.ts +0 -9
- package/dist/junk/TargetDecals.js +0 -77
- package/dist/junk/TargetDecals.js.map +0 -1
- package/dist/junk/bvhShatter.d.ts +0 -3
- package/dist/junk/bvhShatter.js +0 -101
- package/dist/junk/bvhShatter.js.map +0 -1
- package/dist/junk/bvhTriCollector.d.ts +0 -16
- package/dist/junk/bvhTriCollector.js +0 -127
- package/dist/junk/bvhTriCollector.js.map +0 -1
- package/dist/junk/index.d.ts +0 -14
- package/dist/junk/index.js +0 -13
- package/dist/junk/index.js.map +0 -1
- package/dist/junk/junkGeometry.d.ts +0 -13
- package/dist/junk/junkGeometry.js +0 -87
- package/dist/junk/junkGeometry.js.map +0 -1
- package/dist/junk/junkImportSanitize.d.ts +0 -5
- package/dist/junk/junkImportSanitize.js +0 -74
- package/dist/junk/junkImportSanitize.js.map +0 -1
- package/dist/junk/junkImporter.d.ts +0 -14
- package/dist/junk/junkImporter.js +0 -124
- package/dist/junk/junkImporter.js.map +0 -1
- package/dist/junk/junkLabelCanvas.d.ts +0 -2
- package/dist/junk/junkLabelCanvas.js +0 -185
- package/dist/junk/junkLabelCanvas.js.map +0 -1
- package/dist/junk/junkLabels.d.ts +0 -9
- package/dist/junk/junkLabels.js +0 -49
- package/dist/junk/junkLabels.js.map +0 -1
- package/dist/junk/junkProceduralScenes.d.ts +0 -12
- package/dist/junk/junkProceduralScenes.js +0 -220
- package/dist/junk/junkProceduralScenes.js.map +0 -1
- package/dist/junk/junkSheetSplitter.d.ts +0 -38
- package/dist/junk/junkSheetSplitter.js +0 -104
- package/dist/junk/junkSheetSplitter.js.map +0 -1
- package/dist/junk/junkTypes.d.ts +0 -48
- package/dist/junk/junkTypes.js +0 -0
- package/dist/junk/junkTypes.js.map +0 -1
- package/dist/junk/targetHelpers.d.ts +0 -55
- package/dist/junk/targetHelpers.js +0 -157
- package/dist/junk/targetHelpers.js.map +0 -1
- package/dist/junk/targetHitLogic.d.ts +0 -30
- package/dist/junk/targetHitLogic.js +0 -163
- package/dist/junk/targetHitLogic.js.map +0 -1
- package/dist/junk/useTargetAssets.d.ts +0 -19
- package/dist/junk/useTargetAssets.js +0 -130
- package/dist/junk/useTargetAssets.js.map +0 -1
- package/dist/physics/index.js.map +0 -1
- package/dist/physics/nBodyGravity.js +0 -70
- package/dist/physics/nBodyGravity.js.map +0 -1
- package/dist/sand3d/KolmoSand3D.d.ts +0 -19
- package/dist/sand3d/KolmoSand3D.js +0 -92
- package/dist/sand3d/KolmoSand3D.js.map +0 -1
- package/dist/sand3d/Sand3dWorkshopSection.d.ts +0 -8
- package/dist/sand3d/Sand3dWorkshopSection.js +0 -117
- package/dist/sand3d/Sand3dWorkshopSection.js.map +0 -1
- package/dist/sand3d/gateBakeHelpers.d.ts +0 -21
- package/dist/sand3d/gateBakeHelpers.js +0 -225
- package/dist/sand3d/gateBakeHelpers.js.map +0 -1
- package/dist/sand3d/gateDoorwayBake.d.ts +0 -12
- package/dist/sand3d/gateDoorwayBake.js +0 -203
- package/dist/sand3d/gateDoorwayBake.js.map +0 -1
- package/dist/sand3d/index.d.ts +0 -3
- package/dist/sand3d/index.js +0 -4
- package/dist/sand3d/index.js.map +0 -1
- package/dist/sand3d/sand3dAssetLoader.d.ts +0 -28
- package/dist/sand3d/sand3dAssetLoader.js +0 -177
- package/dist/sand3d/sand3dAssetLoader.js.map +0 -1
- package/dist/schema/kolmoSchema.d.ts +0 -9
- package/dist/schema/kolmoSchema.js +0 -110
- package/dist/schema/kolmoSchema.js.map +0 -1
- package/dist/schema/kolmoStamp.d.ts +0 -11
- package/dist/schema/kolmoStamp.js +0 -119
- package/dist/schema/kolmoStamp.js.map +0 -1
- package/dist/schema/kolmoTypes.d.ts +0 -63
- package/dist/schema/kolmoTypes.js +0 -66
- package/dist/schema/kolmoTypes.js.map +0 -1
- package/dist/shaders/celestialBackdrop.d.ts +0 -14
- package/dist/shaders/celestialBackdrop.js +0 -181
- package/dist/shaders/celestialBackdrop.js.map +0 -1
- package/dist/shaders/emitterShaders.d.ts +0 -9
- package/dist/shaders/emitterShaders.js +0 -114
- package/dist/shaders/emitterShaders.js.map +0 -1
- package/dist/shaders/index.d.ts +0 -5
- package/dist/shaders/index.js +0 -12
- package/dist/shaders/index.js.map +0 -1
- package/dist/shaders/plumeAndSparkle.d.ts +0 -12
- package/dist/shaders/plumeAndSparkle.js +0 -233
- package/dist/shaders/plumeAndSparkle.js.map +0 -1
- package/dist/shaders/ps2GlslShared.d.ts +0 -20
- package/dist/shaders/ps2GlslShared.js +0 -30
- package/dist/shaders/ps2GlslShared.js.map +0 -1
- package/dist/shaders/ps2MaterialsTSL.d.ts +0 -23
- package/dist/shaders/ps2MaterialsTSL.js +0 -146
- package/dist/shaders/ps2MaterialsTSL.js.map +0 -1
- package/dist/shaders/ps2MaterialsWebGL.d.ts +0 -15
- package/dist/shaders/ps2MaterialsWebGL.js +0 -57
- package/dist/shaders/ps2MaterialsWebGL.js.map +0 -1
- package/dist/shaders/ps2RoadWebGL.d.ts +0 -7
- package/dist/shaders/ps2RoadWebGL.js +0 -138
- package/dist/shaders/ps2RoadWebGL.js.map +0 -1
- package/dist/shaders/ps2TerrainWebGL.d.ts +0 -8
- package/dist/shaders/ps2TerrainWebGL.js +0 -131
- package/dist/shaders/ps2TerrainWebGL.js.map +0 -1
- package/dist/shaders/ps2Textures.d.ts +0 -22
- package/dist/shaders/ps2Textures.js +0 -299
- package/dist/shaders/ps2Textures.js.map +0 -1
- package/dist/shaders/retroPalettes.d.ts +0 -24
- package/dist/shaders/retroPalettes.js +0 -221
- package/dist/shaders/retroPalettes.js.map +0 -1
- package/dist/shaders/retroShader.d.ts +0 -13
- package/dist/shaders/retroShader.js +0 -110
- package/dist/shaders/retroShader.js.map +0 -1
- package/dist/shaders/retroUniforms.d.ts +0 -60
- package/dist/shaders/retroUniforms.js +0 -215
- package/dist/shaders/retroUniforms.js.map +0 -1
- package/dist/shaders/skyboxShaders.d.ts +0 -16
- package/dist/shaders/skyboxShaders.js +0 -266
- package/dist/shaders/skyboxShaders.js.map +0 -1
- package/dist/shaders/tsl.d.ts +0 -1
- package/dist/shaders/tsl.js +0 -1
- package/dist/shaders/tsl.js.map +0 -1
- package/dist/suika/KolmoSuikaOrb.d.ts +0 -33
- package/dist/suika/KolmoSuikaOrb.js +0 -375
- package/dist/suika/KolmoSuikaOrb.js.map +0 -1
- package/dist/suika/index.d.ts +0 -4
- package/dist/suika/index.js +0 -5
- package/dist/suika/index.js.map +0 -1
- package/dist/suika/suikaArbiter.d.ts +0 -60
- package/dist/suika/suikaArbiter.js +0 -265
- package/dist/suika/suikaArbiter.js.map +0 -1
- package/dist/suika/suikaGeometry.d.ts +0 -10
- package/dist/suika/suikaGeometry.js +0 -251
- package/dist/suika/suikaGeometry.js.map +0 -1
- package/dist/suika/suikaTypes.d.ts +0 -74
- package/dist/suika/suikaTypes.js +0 -196
- package/dist/suika/suikaTypes.js.map +0 -1
- package/dist/world/frontage.d.ts +0 -26
- package/dist/world/frontage.js +0 -36
- package/dist/world/frontage.js.map +0 -1
- package/dist/world/index.d.ts +0 -9
- package/dist/world/index.js +0 -12
- package/dist/world/index.js.map +0 -1
- package/dist/world/infiniteWorld2D.d.ts +0 -19
- package/dist/world/infiniteWorld2D.js +0 -219
- package/dist/world/infiniteWorld2D.js.map +0 -1
- package/dist/world/island.d.ts +0 -29
- package/dist/world/island.js +0 -116
- package/dist/world/island.js.map +0 -1
- package/dist/world/islandPathing.d.ts +0 -6
- package/dist/world/islandPathing.js +0 -166
- package/dist/world/islandPathing.js.map +0 -1
- package/dist/world/macroCellSchema.d.ts +0 -72
- package/dist/world/macroCellSchema.js +0 -34
- package/dist/world/macroCellSchema.js.map +0 -1
- package/dist/world/macroKnightAStar.d.ts +0 -11
- package/dist/world/macroKnightAStar.js +0 -240
- package/dist/world/macroKnightAStar.js.map +0 -1
- package/dist/world/macroSettlementZones.d.ts +0 -9
- package/dist/world/macroSettlementZones.js +0 -108
- package/dist/world/macroSettlementZones.js.map +0 -1
- package/dist/world/random.d.ts +0 -23
- package/dist/world/random.js +0 -59
- package/dist/world/random.js.map +0 -1
- package/dist/world/road.d.ts +0 -37
- package/dist/world/road.js +0 -198
- package/dist/world/road.js.map +0 -1
- package/dist/world/roadRibbon.d.ts +0 -29
- package/dist/world/roadRibbon.js +0 -166
- package/dist/world/roadRibbon.js.map +0 -1
- package/dist/world/terrain.d.ts +0 -62
- package/dist/world/terrain.js +0 -133
- package/dist/world/terrain.js.map +0 -1
- package/dist/world/terrainGeometry.d.ts +0 -14
- package/dist/world/terrainGeometry.js +0 -76
- package/dist/world/terrainGeometry.js.map +0 -1
- package/dist/world/worldTypes.d.ts +0 -43
- package/dist/world/worldTypes.js +0 -197
- package/dist/world/worldTypes.js.map +0 -1
- package/docs/api-reference.md +0 -728
- package/skills/kolmo-engine/SKILL.md +0 -109
package/dist/world/island.js
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { astarRingSegment, pickRingWaypoints } from "./islandPathing.js";
|
|
2
|
-
import { childSeed, fbm2 } from "./random.js";
|
|
3
|
-
import { closedRoadFromPoints } from "./road.js";
|
|
4
|
-
import { makeTerrain } from "./terrain.js";
|
|
5
|
-
// src/world/island.ts
|
|
6
|
-
function makeIslandHeightfn(seed, size, peakHeight) {
|
|
7
|
-
const coastSeed = childSeed(seed, "island-coast");
|
|
8
|
-
const hillsSeed = childSeed(seed, "island-hills");
|
|
9
|
-
const ridgeSeed = childSeed(seed, "island-ridge");
|
|
10
|
-
const radius = size * .41;
|
|
11
|
-
return (x, z) => {
|
|
12
|
-
const coastVar = fbm2(coastSeed, x, z, {
|
|
13
|
-
wavelength: size * .34,
|
|
14
|
-
octaves: 3,
|
|
15
|
-
gain: .5,
|
|
16
|
-
lacunarity: 2
|
|
17
|
-
});
|
|
18
|
-
const effRadius = radius * (1 + .16 * coastVar);
|
|
19
|
-
const norm = Math.hypot(x, z) / Math.max(1, effRadius);
|
|
20
|
-
if (norm >= 1) return -12 * Math.min(1, (norm - 1) * 3);
|
|
21
|
-
const falloff = (1 - norm * norm) ** 1.35;
|
|
22
|
-
const hills = .5 + .5 * fbm2(hillsSeed, x, z, {
|
|
23
|
-
wavelength: size * .22,
|
|
24
|
-
octaves: 4,
|
|
25
|
-
gain: .5,
|
|
26
|
-
lacunarity: 2.05
|
|
27
|
-
});
|
|
28
|
-
const ridge = 1 - Math.abs(fbm2(ridgeSeed, x, z, {
|
|
29
|
-
wavelength: size * .28,
|
|
30
|
-
octaves: 3,
|
|
31
|
-
gain: .5,
|
|
32
|
-
lacunarity: 2.1
|
|
33
|
-
}));
|
|
34
|
-
return 1.8 * Math.min(1, (1 - norm) * 5) + peakHeight * falloff * (.45 * hills + .55 * ridge * ridge);
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function planIslandWorld(seed, opts = {}) {
|
|
38
|
-
const size = opts.size ?? 960;
|
|
39
|
-
const peakHeight = opts.peakHeight ?? 56;
|
|
40
|
-
const waterLevel = opts.waterLevel ?? 0;
|
|
41
|
-
const halfWidth = opts.halfWidth ?? 4.5;
|
|
42
|
-
const waypointCount = Math.max(5, opts.waypointCount ?? 8);
|
|
43
|
-
const res = Math.max(48, opts.pathGrid ?? 96);
|
|
44
|
-
const maxRoadGrade = opts.maxGrade ?? .08;
|
|
45
|
-
const baseHeight = makeIslandHeightfn(seed, size, peakHeight);
|
|
46
|
-
const half = size * .5, cellM = size / (res - 1);
|
|
47
|
-
const grid = new Float32Array(res * res);
|
|
48
|
-
for (let row = 0; row < res; row++) for (let col = 0; col < res; col++) grid[row * res + col] = baseHeight(-half + col * cellM, -half + row * cellM);
|
|
49
|
-
const { waypointIds, waypoints } = pickRingWaypoints(grid, res, size, cellM, waterLevel, waypointCount);
|
|
50
|
-
const ringNodes = [];
|
|
51
|
-
for (let i = 0; i < waypointCount; i++) {
|
|
52
|
-
const seg = astarRingSegment(grid, res, cellM, waterLevel, waypointIds[i], waypointIds[(i + 1) % waypointCount]);
|
|
53
|
-
for (let k = 0; k < seg.length - 1; k++) ringNodes.push(seg[k]);
|
|
54
|
-
}
|
|
55
|
-
const sampleStride = Math.max(2, Math.round(22 / cellM));
|
|
56
|
-
let pts = [];
|
|
57
|
-
for (let i = 0; i < ringNodes.length; i += sampleStride) {
|
|
58
|
-
const id = ringNodes[i], gx = id % res, gz = id / res | 0;
|
|
59
|
-
const wx = -half + gx * cellM, wz = -half + gz * cellM;
|
|
60
|
-
pts.push([
|
|
61
|
-
wx,
|
|
62
|
-
Math.max(waterLevel + 1.5, baseHeight(wx, wz) + .2),
|
|
63
|
-
wz
|
|
64
|
-
]);
|
|
65
|
-
}
|
|
66
|
-
if (pts.length < 6) pts = [...waypoints];
|
|
67
|
-
const nPts = pts.length;
|
|
68
|
-
for (let pass = 0; pass < 4; pass++) pts = pts.map((p, i) => {
|
|
69
|
-
const prev = pts[(i - 1 + nPts) % nPts], next = pts[(i + 1) % nPts];
|
|
70
|
-
const x = .5 * p[0] + .25 * (prev[0] + next[0]), z = .5 * p[2] + .25 * (prev[2] + next[2]);
|
|
71
|
-
return [
|
|
72
|
-
x,
|
|
73
|
-
Math.max(waterLevel + 1.5, baseHeight(x, z) + .2),
|
|
74
|
-
z
|
|
75
|
-
];
|
|
76
|
-
});
|
|
77
|
-
for (let pass = 0; pass < 8; pass++) {
|
|
78
|
-
const smoothedY = pts.map((p, i) => .4 * p[1] + .3 * (pts[(i - 1 + nPts) % nPts][1] + pts[(i + 1) % nPts][1]));
|
|
79
|
-
for (let i = 0; i < nPts; i++) {
|
|
80
|
-
const prev = pts[(i - 1 + nPts) % nPts], cur = pts[i];
|
|
81
|
-
const maxDy = maxRoadGrade * Math.max(1, Math.hypot(cur[0] - prev[0], cur[2] - prev[2]));
|
|
82
|
-
const clampedY = Math.max(waterLevel + 1.4, Math.max(prev[1] - maxDy, Math.min(prev[1] + maxDy, smoothedY[i])));
|
|
83
|
-
pts[i] = [
|
|
84
|
-
cur[0],
|
|
85
|
-
clampedY,
|
|
86
|
-
cur[2]
|
|
87
|
-
];
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
const road = closedRoadFromPoints(pts, halfWidth, 2);
|
|
91
|
-
return {
|
|
92
|
-
seed,
|
|
93
|
-
size,
|
|
94
|
-
waterLevel,
|
|
95
|
-
baseHeight,
|
|
96
|
-
waypoints,
|
|
97
|
-
road,
|
|
98
|
-
terrain: makeTerrain(seed, road, {
|
|
99
|
-
amplitude: peakHeight,
|
|
100
|
-
noise: {
|
|
101
|
-
wavelength: size * .25,
|
|
102
|
-
octaves: 4,
|
|
103
|
-
gain: .5,
|
|
104
|
-
lacunarity: 2
|
|
105
|
-
},
|
|
106
|
-
maxSlope: .56,
|
|
107
|
-
minShoulder: 7.5,
|
|
108
|
-
verge: 3.5,
|
|
109
|
-
baseHeight,
|
|
110
|
-
maxCutFill: 14
|
|
111
|
-
})
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
export { makeIslandHeightfn, planIslandWorld };
|
|
115
|
-
|
|
116
|
-
//# sourceMappingURL=island.js.map
|
package/dist/world/island.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"island.js","names":[],"sources":["../../src/world/island.ts"],"sourcesContent":["import { astarRingSegment, pickRingWaypoints } from \"./islandPathing.js\";\nimport { childSeed, fbm2 } from \"./random.js\";\nimport { closedRoadFromPoints, type Road, type V3 } from \"./road.js\";\nimport { makeTerrain, type Terrain } from \"./terrain.js\";\n\nexport interface IslandOptions {\n /** Square world extent in metres (default `960`, supports `512..4096`). */\n readonly size?: number;\n /** Peak interior mountain elevation in metres (default `56`). */\n readonly peakHeight?: number;\n /** Sea level in metres (default `0`). */\n readonly waterLevel?: number;\n /** Road half-width in metres (default `4.5` -> `9 m` two-lane highway). */\n readonly halfWidth?: number;\n /** Number of ring A* waypoints around the island (default `8`). */\n readonly waypointCount?: number;\n /** Coarse pathfinding grid resolution per side (default `96`). */\n readonly pathGrid?: number;\n /** Maximum target longitudinal grade after smoothing (default `0.08`). */\n readonly maxGrade?: number;\n}\n\nexport interface IslandWorldPlan {\n readonly seed: number;\n readonly size: number;\n readonly waterLevel: number;\n readonly baseHeight: (x: number, z: number) => number;\n readonly waypoints: readonly V3[];\n readonly road: Road;\n readonly terrain: Terrain;\n}\n\nexport function makeIslandHeightfn(seed: number, size: number, peakHeight: number): (x: number, z: number) => number {\n const coastSeed = childSeed(seed, \"island-coast\");\n const hillsSeed = childSeed(seed, \"island-hills\");\n const ridgeSeed = childSeed(seed, \"island-ridge\");\n const radius = size * 0.41;\n\n return (x: number, z: number): number => {\n const coastVar = fbm2(coastSeed, x, z, { wavelength: size * 0.34, octaves: 3, gain: 0.5, lacunarity: 2 });\n const effRadius = radius * (1 + 0.16 * coastVar);\n const norm = Math.hypot(x, z) / Math.max(1, effRadius);\n if (norm >= 1) return -12 * Math.min(1, (norm - 1) * 3);\n const falloff = (1 - norm * norm) ** 1.35;\n const hills = 0.5 + 0.5 * fbm2(hillsSeed, x, z, { wavelength: size * 0.22, octaves: 4, gain: 0.5, lacunarity: 2.05 });\n const ridge = 1 - Math.abs(fbm2(ridgeSeed, x, z, { wavelength: size * 0.28, octaves: 3, gain: 0.5, lacunarity: 2.1 }));\n return 1.8 * Math.min(1, (1 - norm) * 5) + peakHeight * falloff * (0.45 * hills + 0.55 * ridge * ridge);\n };\n}\n\nexport function planIslandWorld(seed: number, opts: IslandOptions = {}): IslandWorldPlan {\n const size = opts.size ?? 960;\n const peakHeight = opts.peakHeight ?? 56;\n const waterLevel = opts.waterLevel ?? 0;\n const halfWidth = opts.halfWidth ?? 4.5;\n const waypointCount = Math.max(5, opts.waypointCount ?? 8);\n const res = Math.max(48, opts.pathGrid ?? 96);\n const maxRoadGrade = opts.maxGrade ?? 0.08;\n\n const baseHeight = makeIslandHeightfn(seed, size, peakHeight);\n const half = size * 0.5, cellM = size / (res - 1);\n const grid = new Float32Array(res * res);\n for (let row = 0; row < res; row++) {\n for (let col = 0; col < res; col++) grid[row * res + col] = baseHeight(-half + col * cellM, -half + row * cellM);\n }\n\n const { waypointIds, waypoints } = pickRingWaypoints(grid, res, size, cellM, waterLevel, waypointCount);\n const ringNodes: number[] = [];\n for (let i = 0; i < waypointCount; i++) {\n const seg = astarRingSegment(grid, res, cellM, waterLevel, waypointIds[i], waypointIds[(i + 1) % waypointCount]);\n for (let k = 0; k < seg.length - 1; k++) ringNodes.push(seg[k]);\n }\n\n const sampleStride = Math.max(2, Math.round(22 / cellM));\n let pts: V3[] = [];\n for (let i = 0; i < ringNodes.length; i += sampleStride) {\n const id = ringNodes[i], gx = id % res, gz = (id / res) | 0;\n const wx = -half + gx * cellM, wz = -half + gz * cellM;\n pts.push([wx, Math.max(waterLevel + 1.5, baseHeight(wx, wz) + 0.2), wz]);\n }\n if (pts.length < 6) pts = [...waypoints];\n\n const nPts = pts.length;\n for (let pass = 0; pass < 4; pass++) {\n pts = pts.map((p, i) => {\n const prev = pts[(i - 1 + nPts) % nPts], next = pts[(i + 1) % nPts];\n const x = 0.5 * p[0] + 0.25 * (prev[0] + next[0]), z = 0.5 * p[2] + 0.25 * (prev[2] + next[2]);\n return [x, Math.max(waterLevel + 1.5, baseHeight(x, z) + 0.2), z];\n });\n }\n\n for (let pass = 0; pass < 8; pass++) {\n const smoothedY = pts.map((p, i) => 0.4 * p[1] + 0.3 * (pts[(i - 1 + nPts) % nPts][1] + pts[(i + 1) % nPts][1]));\n for (let i = 0; i < nPts; i++) {\n const prev = pts[(i - 1 + nPts) % nPts], cur = pts[i];\n const maxDy = maxRoadGrade * Math.max(1, Math.hypot(cur[0] - prev[0], cur[2] - prev[2]));\n const clampedY = Math.max(waterLevel + 1.4, Math.max(prev[1] - maxDy, Math.min(prev[1] + maxDy, smoothedY[i])));\n pts[i] = [cur[0], clampedY, cur[2]];\n }\n }\n\n const road = closedRoadFromPoints(pts, halfWidth, 2);\n return {\n seed, size, waterLevel, baseHeight, waypoints, road,\n terrain: makeTerrain(seed, road, {\n amplitude: peakHeight,\n noise: { wavelength: size * 0.25, octaves: 4, gain: 0.5, lacunarity: 2 },\n maxSlope: 0.56, minShoulder: 7.5, verge: 3.5, baseHeight, maxCutFill: 14,\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ingSegment(grid: Float32Array, res: number, cellM: number, waterLevel: number, startIdx: number, goalIdx: number): number[];
|
|
3
|
-
export declare function pickRingWaypoints(grid: Float32Array, res: number, size: number, cellM: number, waterLevel: number, waypointCount: number): {
|
|
4
|
-
waypointIds: number[];
|
|
5
|
-
waypoints: V3[];
|
|
6
|
-
};
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
// src/world/islandPathing.ts
|
|
2
|
-
function astarRingSegment(grid, res, cellM, waterLevel, startIdx, goalIdx) {
|
|
3
|
-
const total = res * res;
|
|
4
|
-
const gScore = new Float64Array(total).fill(Infinity);
|
|
5
|
-
const parent = new Int32Array(total).fill(-1);
|
|
6
|
-
const closed = new Uint8Array(total);
|
|
7
|
-
const heapNodes = [startIdx], heapScores = [0];
|
|
8
|
-
gScore[startIdx] = 0;
|
|
9
|
-
const goalX = goalIdx % res, goalZ = goalIdx / res | 0;
|
|
10
|
-
const push = (node, score) => {
|
|
11
|
-
let i = heapNodes.length;
|
|
12
|
-
heapNodes.push(node);
|
|
13
|
-
heapScores.push(score);
|
|
14
|
-
while (i > 0) {
|
|
15
|
-
const p = i - 1 >> 1;
|
|
16
|
-
if (heapScores[p] <= score) break;
|
|
17
|
-
heapNodes[i] = heapNodes[p];
|
|
18
|
-
heapScores[i] = heapScores[p];
|
|
19
|
-
i = p;
|
|
20
|
-
}
|
|
21
|
-
heapNodes[i] = node;
|
|
22
|
-
heapScores[i] = score;
|
|
23
|
-
};
|
|
24
|
-
const pop = () => {
|
|
25
|
-
const top = heapNodes[0];
|
|
26
|
-
const lastNode = heapNodes.pop();
|
|
27
|
-
const lastScore = heapScores.pop();
|
|
28
|
-
if (heapNodes.length > 0) {
|
|
29
|
-
let idx = 0;
|
|
30
|
-
const len = heapNodes.length;
|
|
31
|
-
for (;;) {
|
|
32
|
-
let smallest = idx, smallestScore = lastScore;
|
|
33
|
-
const l = idx * 2 + 1, r = l + 1;
|
|
34
|
-
if (l < len && heapScores[l] < smallestScore) {
|
|
35
|
-
smallest = l;
|
|
36
|
-
smallestScore = heapScores[l];
|
|
37
|
-
}
|
|
38
|
-
if (r < len && heapScores[r] < smallestScore) {
|
|
39
|
-
smallest = r;
|
|
40
|
-
smallestScore = heapScores[r];
|
|
41
|
-
}
|
|
42
|
-
if (smallest === idx) break;
|
|
43
|
-
heapNodes[idx] = heapNodes[smallest];
|
|
44
|
-
heapScores[idx] = heapScores[smallest];
|
|
45
|
-
idx = smallest;
|
|
46
|
-
}
|
|
47
|
-
heapNodes[idx] = lastNode;
|
|
48
|
-
heapScores[idx] = lastScore;
|
|
49
|
-
}
|
|
50
|
-
return top;
|
|
51
|
-
};
|
|
52
|
-
const dirs = [
|
|
53
|
-
[
|
|
54
|
-
1,
|
|
55
|
-
0,
|
|
56
|
-
1
|
|
57
|
-
],
|
|
58
|
-
[
|
|
59
|
-
-1,
|
|
60
|
-
0,
|
|
61
|
-
1
|
|
62
|
-
],
|
|
63
|
-
[
|
|
64
|
-
0,
|
|
65
|
-
1,
|
|
66
|
-
1
|
|
67
|
-
],
|
|
68
|
-
[
|
|
69
|
-
0,
|
|
70
|
-
-1,
|
|
71
|
-
1
|
|
72
|
-
],
|
|
73
|
-
[
|
|
74
|
-
1,
|
|
75
|
-
1,
|
|
76
|
-
Math.SQRT2
|
|
77
|
-
],
|
|
78
|
-
[
|
|
79
|
-
1,
|
|
80
|
-
-1,
|
|
81
|
-
Math.SQRT2
|
|
82
|
-
],
|
|
83
|
-
[
|
|
84
|
-
-1,
|
|
85
|
-
1,
|
|
86
|
-
Math.SQRT2
|
|
87
|
-
],
|
|
88
|
-
[
|
|
89
|
-
-1,
|
|
90
|
-
-1,
|
|
91
|
-
Math.SQRT2
|
|
92
|
-
]
|
|
93
|
-
];
|
|
94
|
-
while (heapNodes.length > 0) {
|
|
95
|
-
const cur = pop();
|
|
96
|
-
if (cur === goalIdx) break;
|
|
97
|
-
if (closed[cur]) continue;
|
|
98
|
-
closed[cur] = 1;
|
|
99
|
-
const cx = cur % res, cz = cur / res | 0, hCur = grid[cur];
|
|
100
|
-
for (const [dx, dz, stepMult] of dirs) {
|
|
101
|
-
const nx = cx + dx, nz = cz + dz;
|
|
102
|
-
if (nx < 1 || nx >= res - 1 || nz < 1 || nz >= res - 1) continue;
|
|
103
|
-
const next = nz * res + nx;
|
|
104
|
-
if (closed[next]) continue;
|
|
105
|
-
const hNext = grid[next], dist = stepMult * cellM, grade = Math.abs(hNext - hCur) / dist;
|
|
106
|
-
const waterPenalty = hNext < waterLevel + .8 ? 55 * (waterLevel + 1.2 - hNext) : 0;
|
|
107
|
-
const altPenalty = Math.max(0, hNext - 22) * .35;
|
|
108
|
-
const steepPenalty = grade > .32 ? 260 * (grade - .32) : 0;
|
|
109
|
-
const gCand = gScore[cur] + dist * (1 + 52 * grade * grade + waterPenalty + altPenalty + steepPenalty);
|
|
110
|
-
if (gCand < gScore[next]) {
|
|
111
|
-
gScore[next] = gCand;
|
|
112
|
-
parent[next] = cur;
|
|
113
|
-
push(next, gCand + Math.hypot(nx - goalX, nz - goalZ) * cellM);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
const path = [];
|
|
118
|
-
for (let cur = goalIdx; cur !== -1 && cur !== startIdx; cur = parent[cur]) path.push(cur);
|
|
119
|
-
path.push(startIdx);
|
|
120
|
-
path.reverse();
|
|
121
|
-
return path;
|
|
122
|
-
}
|
|
123
|
-
function pickRingWaypoints(grid, res, size, cellM, waterLevel, waypointCount) {
|
|
124
|
-
const half = size * .5;
|
|
125
|
-
const waypointIds = [];
|
|
126
|
-
const waypoints = [];
|
|
127
|
-
for (let i = 0; i < waypointCount; i++) {
|
|
128
|
-
const theta0 = i / waypointCount * Math.PI * 2;
|
|
129
|
-
let bestIdx = (res >> 1) * res + (res >> 1), bestCost = Infinity;
|
|
130
|
-
for (const dTheta of [
|
|
131
|
-
0,
|
|
132
|
-
-.1,
|
|
133
|
-
.1,
|
|
134
|
-
-.2,
|
|
135
|
-
.2
|
|
136
|
-
]) {
|
|
137
|
-
const ang = theta0 + dTheta;
|
|
138
|
-
for (let frac = .22; frac <= .37; frac += .025) {
|
|
139
|
-
const wx = Math.cos(ang) * size * frac, wz = Math.sin(ang) * size * frac;
|
|
140
|
-
const gx = Math.min(res - 3, Math.max(2, Math.round((wx + half) / cellM)));
|
|
141
|
-
const idx = Math.min(res - 3, Math.max(2, Math.round((wz + half) / cellM))) * res + gx, h = grid[idx];
|
|
142
|
-
if (h < waterLevel + 1.4) continue;
|
|
143
|
-
const slope = Math.hypot(grid[idx + 1] - grid[idx - 1], grid[idx + res] - grid[idx - res]) / (2 * cellM);
|
|
144
|
-
const cost = h * .9 + slope * 40 + Math.abs(frac - .29) * 35;
|
|
145
|
-
if (cost < bestCost) {
|
|
146
|
-
bestCost = cost;
|
|
147
|
-
bestIdx = idx;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
waypointIds.push(bestIdx);
|
|
152
|
-
const ix = bestIdx % res, iz = bestIdx / res | 0;
|
|
153
|
-
waypoints.push([
|
|
154
|
-
-half + ix * cellM,
|
|
155
|
-
grid[bestIdx],
|
|
156
|
-
-half + iz * cellM
|
|
157
|
-
]);
|
|
158
|
-
}
|
|
159
|
-
return {
|
|
160
|
-
waypointIds,
|
|
161
|
-
waypoints
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
export { astarRingSegment, pickRingWaypoints };
|
|
165
|
-
|
|
166
|
-
//# sourceMappingURL=islandPathing.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"islandPathing.js","names":[],"sources":["../../src/world/islandPathing.ts"],"sourcesContent":["import type { V3 } from \"./road.js\";\n\nexport function astarRingSegment(\n grid: Float32Array,\n res: number,\n cellM: number,\n waterLevel: number,\n startIdx: number,\n goalIdx: number,\n): number[] {\n const total = res * res;\n const gScore = new Float64Array(total).fill(Infinity);\n const parent = new Int32Array(total).fill(-1);\n const closed = new Uint8Array(total);\n const heapNodes = [startIdx], heapScores = [0];\n gScore[startIdx] = 0;\n const goalX = goalIdx % res, goalZ = (goalIdx / res) | 0;\n\n const push = (node: number, score: number): void => {\n let i = heapNodes.length;\n heapNodes.push(node);\n heapScores.push(score);\n while (i > 0) {\n const p = (i - 1) >> 1;\n if (heapScores[p] <= score) break;\n heapNodes[i] = heapNodes[p];\n heapScores[i] = heapScores[p];\n i = p;\n }\n heapNodes[i] = node;\n heapScores[i] = score;\n };\n\n const pop = (): number => {\n const top = heapNodes[0];\n const lastNode = heapNodes.pop()!;\n const lastScore = heapScores.pop()!;\n if (heapNodes.length > 0) {\n let idx = 0;\n const len = heapNodes.length;\n for (;;) {\n let smallest = idx, smallestScore = lastScore;\n const l = idx * 2 + 1, r = l + 1;\n if (l < len && heapScores[l] < smallestScore) { smallest = l; smallestScore = heapScores[l]; }\n if (r < len && heapScores[r] < smallestScore) { smallest = r; smallestScore = heapScores[r]; }\n if (smallest === idx) break;\n heapNodes[idx] = heapNodes[smallest];\n heapScores[idx] = heapScores[smallest];\n idx = smallest;\n }\n heapNodes[idx] = lastNode;\n heapScores[idx] = lastScore;\n }\n return top;\n };\n\n const dirs: ReadonlyArray<[number, number, number]> = [\n [1, 0, 1], [-1, 0, 1], [0, 1, 1], [0, -1, 1],\n [1, 1, Math.SQRT2], [1, -1, Math.SQRT2], [-1, 1, Math.SQRT2], [-1, -1, Math.SQRT2],\n ];\n\n while (heapNodes.length > 0) {\n const cur = pop();\n if (cur === goalIdx) break;\n if (closed[cur]) continue;\n closed[cur] = 1;\n const cx = cur % res, cz = (cur / res) | 0, hCur = grid[cur];\n\n for (const [dx, dz, stepMult] of dirs) {\n const nx = cx + dx, nz = cz + dz;\n if (nx < 1 || nx >= res - 1 || nz < 1 || nz >= res - 1) continue;\n const next = nz * res + nx;\n if (closed[next]) continue;\n const hNext = grid[next], dist = stepMult * cellM, grade = Math.abs(hNext - hCur) / dist;\n const waterPenalty = hNext < waterLevel + 0.8 ? 55 * (waterLevel + 1.2 - hNext) : 0;\n const altPenalty = Math.max(0, hNext - 22) * 0.35;\n const steepPenalty = grade > 0.32 ? 260 * (grade - 0.32) : 0;\n const gCand = gScore[cur] + dist * (1 + 52 * grade * grade + waterPenalty + altPenalty + steepPenalty);\n if (gCand < gScore[next]) {\n gScore[next] = gCand;\n parent[next] = cur;\n push(next, gCand + Math.hypot(nx - goalX, nz - goalZ) * cellM);\n }\n }\n }\n\n const path: number[] = [];\n for (let cur = goalIdx; cur !== -1 && cur !== startIdx; cur = parent[cur]) path.push(cur);\n path.push(startIdx);\n path.reverse();\n return path;\n}\n\nexport function pickRingWaypoints(\n grid: Float32Array,\n res: number,\n size: number,\n cellM: number,\n waterLevel: number,\n waypointCount: number,\n): { waypointIds: number[]; waypoints: V3[] } {\n const half = size * 0.5;\n const waypointIds: number[] = [];\n const waypoints: V3[] = [];\n for (let i = 0; i < waypointCount; i++) {\n const theta0 = (i / waypointCount) * Math.PI * 2;\n let bestIdx = (res >> 1) * res + (res >> 1), bestCost = Infinity;\n for (const dTheta of [0, -0.1, 0.1, -0.2, 0.2]) {\n const ang = theta0 + dTheta;\n for (let frac = 0.22; frac <= 0.37; frac += 0.025) {\n const wx = Math.cos(ang) * size * frac, wz = Math.sin(ang) * size * frac;\n const gx = Math.min(res - 3, Math.max(2, Math.round((wx + half) / cellM)));\n const gz = Math.min(res - 3, Math.max(2, Math.round((wz + half) / cellM)));\n const idx = gz * res + gx, h = grid[idx];\n if (h < waterLevel + 1.4) continue;\n const slope = Math.hypot(grid[idx + 1] - grid[idx - 1], grid[idx + res] - grid[idx - res]) / (2 * cellM);\n const cost = h * 0.9 + slope * 40 + Math.abs(frac - 0.29) * 35;\n if (cost < bestCost) { bestCost = cost; bestIdx = idx; }\n }\n }\n waypointIds.push(bestIdx);\n const ix = bestIdx % res, iz = (bestIdx / res) | 0;\n waypoints.push([-half + ix * cellM, grid[bestIdx], -half + iz * cellM]);\n }\n return { waypointIds, waypoints };\n}\n"],"mappings":";AAEA,SAAgB,iBACZ,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ACjD,UAAU,KAAK;GAAC,CAAC,OAAO,KAAK;GAAO,KAAK;GAAU,CAAC,OAAO,KAAK;EAAK,CAAC;CAC1E;CACA,OAAO;EAAE;EAAa;CAAU;AACpC"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import type { InstanceBatch } from "@khr3/c12";
|
|
2
|
-
export declare const MACRO_SIZE_M = 2304;
|
|
3
|
-
export declare const C12_TILE_M = 3;
|
|
4
|
-
export declare const TILES_PER_MACRO = 768;
|
|
5
|
-
export declare const FLOATING_ORIGIN_STEP_M = 192;
|
|
6
|
-
export type MacroSettlementTier = "ISLAND_RING" | "NONE_HIGHWAY" | "VILLAGE" | "SMALL_TOWN" | "SUBURBS_BIG_TOWN" | "CITY" | "METROPOLIS";
|
|
7
|
-
export type RoadsideStopKind = "GAS_STATION" | "REST_STOP";
|
|
8
|
-
export declare const C12TileKind: {
|
|
9
|
-
readonly EMPTY: 0;
|
|
10
|
-
readonly ROAD_LANE: 1;
|
|
11
|
-
readonly CROSSWALK: 2;
|
|
12
|
-
readonly INTERSECTION_BOX: 3;
|
|
13
|
-
readonly CURB_STRAIGHT: 4;
|
|
14
|
-
readonly CURB_RAMP_CORNER: 5;
|
|
15
|
-
readonly CURB_DRIVEWAY: 6;
|
|
16
|
-
readonly BOULEVARD_MEDIAN: 7;
|
|
17
|
-
readonly C12_BOULEVARD_30: 8;
|
|
18
|
-
readonly C12_PLAZA_HUB: 9;
|
|
19
|
-
readonly ZONE_RESIDENTIAL: 10;
|
|
20
|
-
readonly ZONE_COMMERCIAL: 11;
|
|
21
|
-
readonly ZONE_INDUSTRIAL: 12;
|
|
22
|
-
readonly ZONE_ROADSIDE_STOP: 13;
|
|
23
|
-
};
|
|
24
|
-
export type C12TileKind = (typeof C12TileKind)[keyof typeof C12TileKind];
|
|
25
|
-
export interface SharedBorderPortal {
|
|
26
|
-
readonly exists: boolean;
|
|
27
|
-
readonly isBridgeCauseway: boolean;
|
|
28
|
-
readonly offsetMeters: number;
|
|
29
|
-
}
|
|
30
|
-
export interface RoadsideStop2D {
|
|
31
|
-
readonly kind: RoadsideStopKind;
|
|
32
|
-
readonly worldX: number;
|
|
33
|
-
readonly worldZ: number;
|
|
34
|
-
readonly yaw: number;
|
|
35
|
-
readonly widthMeters: number;
|
|
36
|
-
readonly depthMeters: number;
|
|
37
|
-
}
|
|
38
|
-
export interface ZonedParcel2D {
|
|
39
|
-
readonly zone: "RESIDENTIAL" | "COMMERCIAL" | "INDUSTRIAL";
|
|
40
|
-
readonly minX: number;
|
|
41
|
-
readonly minZ: number;
|
|
42
|
-
readonly width: number;
|
|
43
|
-
readonly depth: number;
|
|
44
|
-
readonly yaw: number;
|
|
45
|
-
}
|
|
46
|
-
export interface MacroCellPlan2D {
|
|
47
|
-
readonly mx: number;
|
|
48
|
-
readonly mz: number;
|
|
49
|
-
readonly originWorldX: number;
|
|
50
|
-
readonly originWorldZ: number;
|
|
51
|
-
readonly tier: MacroSettlementTier;
|
|
52
|
-
readonly hubX: number;
|
|
53
|
-
readonly hubZ: number;
|
|
54
|
-
readonly settlementRadiusM: number;
|
|
55
|
-
readonly portals: {
|
|
56
|
-
readonly north: SharedBorderPortal;
|
|
57
|
-
readonly south: SharedBorderPortal;
|
|
58
|
-
readonly west: SharedBorderPortal;
|
|
59
|
-
readonly east: SharedBorderPortal;
|
|
60
|
-
};
|
|
61
|
-
readonly highwayPolylines: ReadonlyArray<ReadonlyArray<readonly [number, number]>>;
|
|
62
|
-
readonly roadsideStops: readonly RoadsideStop2D[];
|
|
63
|
-
readonly parcels: readonly ZonedParcel2D[];
|
|
64
|
-
readonly civicHubBatches: readonly InstanceBatch[];
|
|
65
|
-
}
|
|
66
|
-
export interface FloatingOriginFrame {
|
|
67
|
-
readonly chunkOriginX: number;
|
|
68
|
-
readonly chunkOriginZ: number;
|
|
69
|
-
readonly localX: number;
|
|
70
|
-
readonly localZ: number;
|
|
71
|
-
}
|
|
72
|
-
export declare function quantizeFloatingOrigin192(worldX: number, worldZ: number): FloatingOriginFrame;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// src/world/macroCellSchema.ts
|
|
2
|
-
var MACRO_SIZE_M = 2304;
|
|
3
|
-
var C12_TILE_M = 3;
|
|
4
|
-
var TILES_PER_MACRO = 768;
|
|
5
|
-
var FLOATING_ORIGIN_STEP_M = 192;
|
|
6
|
-
var C12TileKind = {
|
|
7
|
-
EMPTY: 0,
|
|
8
|
-
ROAD_LANE: 1,
|
|
9
|
-
CROSSWALK: 2,
|
|
10
|
-
INTERSECTION_BOX: 3,
|
|
11
|
-
CURB_STRAIGHT: 4,
|
|
12
|
-
CURB_RAMP_CORNER: 5,
|
|
13
|
-
CURB_DRIVEWAY: 6,
|
|
14
|
-
BOULEVARD_MEDIAN: 7,
|
|
15
|
-
C12_BOULEVARD_30: 8,
|
|
16
|
-
C12_PLAZA_HUB: 9,
|
|
17
|
-
ZONE_RESIDENTIAL: 10,
|
|
18
|
-
ZONE_COMMERCIAL: 11,
|
|
19
|
-
ZONE_INDUSTRIAL: 12,
|
|
20
|
-
ZONE_ROADSIDE_STOP: 13
|
|
21
|
-
};
|
|
22
|
-
function quantizeFloatingOrigin192(worldX, worldZ) {
|
|
23
|
-
const chunkOriginX = Math.round(worldX / 192) * 192;
|
|
24
|
-
const chunkOriginZ = Math.round(worldZ / 192) * 192;
|
|
25
|
-
return {
|
|
26
|
-
chunkOriginX,
|
|
27
|
-
chunkOriginZ,
|
|
28
|
-
localX: worldX - chunkOriginX,
|
|
29
|
-
localZ: worldZ - chunkOriginZ
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export { C12TileKind, C12_TILE_M, FLOATING_ORIGIN_STEP_M, MACRO_SIZE_M, TILES_PER_MACRO, quantizeFloatingOrigin192 };
|
|
33
|
-
|
|
34
|
-
//# sourceMappingURL=macroCellSchema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"macroCellSchema.js","names":[],"sources":["../../src/world/macroCellSchema.ts"],"sourcesContent":["import type { InstanceBatch } from \"@khr3/c12\";\n\nexport const MACRO_SIZE_M = 2304;\nexport const C12_TILE_M = 3;\nexport const TILES_PER_MACRO = 768;\nexport const FLOATING_ORIGIN_STEP_M = 192;\n\nexport type MacroSettlementTier =\n | \"ISLAND_RING\"\n | \"NONE_HIGHWAY\"\n | \"VILLAGE\"\n | \"SMALL_TOWN\"\n | \"SUBURBS_BIG_TOWN\"\n | \"CITY\"\n | \"METROPOLIS\";\n\nexport type RoadsideStopKind = \"GAS_STATION\" | \"REST_STOP\";\n\nexport const C12TileKind = {\n EMPTY: 0,\n ROAD_LANE: 1,\n CROSSWALK: 2,\n INTERSECTION_BOX: 3,\n CURB_STRAIGHT: 4,\n CURB_RAMP_CORNER: 5,\n CURB_DRIVEWAY: 6,\n BOULEVARD_MEDIAN: 7,\n C12_BOULEVARD_30: 8,\n C12_PLAZA_HUB: 9,\n ZONE_RESIDENTIAL: 10,\n ZONE_COMMERCIAL: 11,\n ZONE_INDUSTRIAL: 12,\n ZONE_ROADSIDE_STOP: 13,\n} as const;\n\nexport type C12TileKind = (typeof C12TileKind)[keyof typeof C12TileKind];\n\nexport interface SharedBorderPortal {\n readonly exists: boolean;\n readonly isBridgeCauseway: boolean;\n readonly offsetMeters: number;\n}\n\nexport interface RoadsideStop2D {\n readonly kind: RoadsideStopKind;\n readonly worldX: number;\n readonly worldZ: number;\n readonly yaw: number;\n readonly widthMeters: number;\n readonly depthMeters: number;\n}\n\nexport interface ZonedParcel2D {\n readonly zone: \"RESIDENTIAL\" | \"COMMERCIAL\" | \"INDUSTRIAL\";\n readonly minX: number;\n readonly minZ: number;\n readonly width: number;\n readonly depth: number;\n readonly yaw: number;\n}\n\nexport interface MacroCellPlan2D {\n readonly mx: number;\n readonly mz: number;\n readonly originWorldX: number;\n readonly originWorldZ: number;\n readonly tier: MacroSettlementTier;\n readonly hubX: number;\n readonly hubZ: number;\n readonly settlementRadiusM: number;\n readonly portals: {\n readonly north: SharedBorderPortal;\n readonly south: SharedBorderPortal;\n readonly west: SharedBorderPortal;\n readonly east: SharedBorderPortal;\n };\n readonly highwayPolylines: ReadonlyArray<ReadonlyArray<readonly [number, number]>>;\n readonly roadsideStops: readonly RoadsideStop2D[];\n readonly parcels: readonly ZonedParcel2D[];\n readonly civicHubBatches: readonly InstanceBatch[];\n}\n\nexport interface FloatingOriginFrame {\n readonly chunkOriginX: number;\n readonly chunkOriginZ: number;\n readonly localX: number;\n readonly localZ: number;\n}\n\nexport function quantizeFloatingOrigin192(worldX: number, worldZ: number): FloatingOriginFrame {\n const chunkOriginX = Math.round(worldX / FLOATING_ORIGIN_STEP_M) * FLOATING_ORIGIN_STEP_M;\n const chunkOriginZ = Math.round(worldZ / FLOATING_ORIGIN_STEP_M) * FLOATING_ORIGIN_STEP_M;\n return {\n chunkOriginX,\n chunkOriginZ,\n localX: worldX - chunkOriginX,\n localZ: worldZ - chunkOriginZ,\n };\n}\n"],"mappings":";AAEA,IAAa,eAAe;AAC5B,IAAa,aAAa;AAC1B,IAAa,kBAAkB;AAC/B,IAAa,yBAAyB;AAatC,IAAa,cAAc;CACvB,OAAO;CACP,WAAW;CACX,WAAW;CACX,kBAAkB;CAClB,eAAe;CACf,kBAAkB;CAClB,eAAe;CACf,kBAAkB;CAClB,kBAAkB;CAClB,eAAe;CACf,kBAAkB;CAClB,iBAAiB;CACjB,iBAAiB;CACjB,oBAAoB;AACxB;AAwDA,SAAgB,0BAA0B,QAAgB,QAAqC;CAC3F,MAAM,eAAe,KAAK,MAAM,SAAA,GAA+B,IAAA;CAC/D,MAAM,eAAe,KAAK,MAAM,SAAA,GAA+B,IAAA;CAC/D,OAAO;EACH;EACA;EACA,QAAQ,SAAS;EACjB,QAAQ,SAAS;CACrB;AACJ"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type InstanceBatch } from "@khr3/c12";
|
|
2
|
-
/**
|
|
3
|
-
* Stateless bounded 16-way Knight A* pathfinder strictly inside one 2304m x 2304m Macro-Cell.
|
|
4
|
-
* Routes from `[startX, startZ]` (border portal) to `[goalX, goalZ]` (settlement gate) while avoiding steep grades.
|
|
5
|
-
*/
|
|
6
|
-
export declare function routeMacroKnightAStar(originWorldX: number, originWorldZ: number, startX: number, startZ: number, goalX: number, goalZ: number, sampleHeight: (wx: number, wz: number) => number): Array<[number, number]>;
|
|
7
|
-
/**
|
|
8
|
-
* Exact `@khr3/c12` Dodecagonal Civic Hub ring built from alternating `3 m` `FoundationSquare`
|
|
9
|
-
* and `60°` `FoundationTriangle` pieces over $\mathbb{Z}[1/2, \sqrt{3}]$, returned as `InstancedMesh` batches.
|
|
10
|
-
*/
|
|
11
|
-
export declare function buildDodecagonalCivicHub(hubX: number, hubZ: number, groundY: number): InstanceBatch[];
|