@pinkaphant/kolmo 0.4.6 → 0.5.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/README.md +39 -100
- package/dist/engine/actor.d.ts +13 -0
- package/dist/engine/gltfLoader.d.ts +19 -0
- package/dist/engine/index.d.ts +8 -13
- package/dist/engine/index.js +1270 -22
- package/dist/engine/index.js.map +1 -1
- package/dist/engine/{kolmoInput.d.ts → input.d.ts} +7 -6
- package/dist/engine/surface.d.ts +19 -0
- package/dist/engine/{kolmoTraits.d.ts → traits.d.ts} +18 -47
- package/dist/engine/vehicle.d.ts +20 -0
- package/dist/engine/world.d.ts +76 -0
- package/dist/index.d.ts +12 -18
- package/dist/index.js +14 -104
- package/dist/physics/index.d.ts +4 -1
- package/dist/physics/index.js +1 -105
- package/dist/physics/nBodyGravity.d.ts +42 -0
- package/dist/physics-FhWvTBfH.js +424 -0
- package/dist/physics-FhWvTBfH.js.map +1 -0
- package/dist/vite/index.d.ts +2 -12
- package/dist/vite/index.js +8 -77
- package/dist/vite/index.js.map +1 -1
- package/package.json +33 -87
- package/AGENTS.md +0 -29
- package/CLAUDE.md +0 -8
- package/bin/kolmo.mjs +0 -560
- 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 -13
- package/dist/engine/kolmoActor.js +0 -263
- 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/kolmoFloatingOrigin.d.ts +0 -17
- package/dist/engine/kolmoFloatingOrigin.js +0 -98
- 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/kolmoHud.d.ts +0 -23
- package/dist/engine/kolmoHud.js +0 -214
- package/dist/engine/kolmoHud.js.map +0 -1
- package/dist/engine/kolmoInput.js +0 -163
- 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 -160
- package/dist/engine/kolmoLongDrive.js.map +0 -1
- package/dist/engine/kolmoPilotMesh.d.ts +0 -2
- package/dist/engine/kolmoPilotMesh.js +0 -205
- 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 -10
- package/dist/engine/kolmoVehicleAutoCompile.js +0 -78
- 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 -38
- package/dist/engine/kolmoVehicleDriver.js +0 -139
- package/dist/engine/kolmoVehicleDriver.js.map +0 -1
- package/dist/engine/kolmoVehicleInner.d.ts +0 -7
- package/dist/engine/kolmoVehicleInner.js +0 -291
- package/dist/engine/kolmoVehicleInner.js.map +0 -1
- package/dist/engine/kolmoWorld.d.ts +0 -45
- package/dist/engine/kolmoWorld.js +0 -161
- 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 -23
- package/dist/importer/DomainWorkshopPanel.js +0 -418
- 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 -291
- package/dist/importer/GlbImportGate.js.map +0 -1
- package/dist/importer/ImperativeVehicleRig.d.ts +0 -9
- package/dist/importer/ImperativeVehicleRig.js +0 -273
- package/dist/importer/ImperativeVehicleRig.js.map +0 -1
- package/dist/importer/LiveDrivePads.d.ts +0 -20
- package/dist/importer/LiveDrivePads.js +0 -171
- 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/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 -49
- package/dist/importer/importerWebMcp.js +0 -48
- package/dist/importer/importerWebMcp.js.map +0 -1
- package/dist/importer/importerWebMcpTools.d.ts +0 -2
- package/dist/importer/importerWebMcpTools.js +0 -341
- package/dist/importer/importerWebMcpTools.js.map +0 -1
- package/dist/importer/index.d.ts +0 -23
- package/dist/importer/index.js +0 -36
- package/dist/importer/index.js.map +0 -1
- package/dist/importer/khrCarGeometryMass.d.ts +0 -20
- package/dist/importer/khrCarGeometryMass.js +0 -125
- 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 -283
- 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 -108
- package/dist/importer/useChopShopController.js +0 -201
- 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/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 -13
- package/dist/junk/index.js +0 -12
- 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/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/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 -148
- package/skills/kolmo-engine/SKILL.md +0 -111
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { disposeImportedRoot, ensureMeshAttributes, isMeshNode } from "./junkImportSanitize.js";
|
|
2
|
-
import * as THREE from "three";
|
|
3
|
-
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
4
|
-
// src/junk/junkImporter.ts
|
|
5
|
-
var STATIC_ANCHOR_RE = /(base|stand|pedestal|mount|anchor|frame)/i;
|
|
6
|
-
var round4 = (v) => Math.round(v * 1e4) / 1e4;
|
|
7
|
-
function triCount(geo) {
|
|
8
|
-
if (geo.index) return Math.floor(geo.index.count / 3);
|
|
9
|
-
const pos = geo.attributes.position;
|
|
10
|
-
return pos ? Math.floor(pos.count / 3) : 0;
|
|
11
|
-
}
|
|
12
|
-
function applySegmentsToImportedRoot(root, segments) {
|
|
13
|
-
const map = new Map(segments.map((s) => [s.segmentId, s]));
|
|
14
|
-
root.traverse((obj) => {
|
|
15
|
-
if (!isMeshNode(obj)) return;
|
|
16
|
-
const id = obj.userData.segmentId;
|
|
17
|
-
if (!id) return;
|
|
18
|
-
const seg = map.get(id);
|
|
19
|
-
if (seg) {
|
|
20
|
-
obj.userData.destructible = seg.destructible;
|
|
21
|
-
obj.userData.customName = seg.customName;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
async function parseImportedGlbBuffer(buffer, fileName = "imported.glb") {
|
|
26
|
-
if (!buffer || buffer.byteLength === 0) throw new Error(`Cannot import "${fileName}": file is empty (0 bytes).`);
|
|
27
|
-
const loader = new GLTFLoader();
|
|
28
|
-
let gltfScene;
|
|
29
|
-
try {
|
|
30
|
-
gltfScene = (await loader.parseAsync(buffer.slice(0), "")).scene;
|
|
31
|
-
} catch (err) {
|
|
32
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
33
|
-
throw new Error(`Failed to parse GLB "${fileName}": ${msg}`);
|
|
34
|
-
}
|
|
35
|
-
const meshes = [];
|
|
36
|
-
try {
|
|
37
|
-
gltfScene.traverse((obj) => {
|
|
38
|
-
if (isMeshNode(obj) && obj.geometry?.attributes?.position) {
|
|
39
|
-
ensureMeshAttributes(obj, fileName);
|
|
40
|
-
meshes.push(obj);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
} catch (err) {
|
|
44
|
-
disposeImportedRoot(gltfScene);
|
|
45
|
-
throw err;
|
|
46
|
-
}
|
|
47
|
-
if (meshes.length === 0) {
|
|
48
|
-
disposeImportedRoot(gltfScene);
|
|
49
|
-
throw new Error(`GLB "${fileName}" contains no valid renderable meshes.`);
|
|
50
|
-
}
|
|
51
|
-
gltfScene.updateMatrixWorld(true);
|
|
52
|
-
const rawSize = new THREE.Box3().setFromObject(gltfScene).getSize(new THREE.Vector3());
|
|
53
|
-
const maxDim = Math.max(rawSize.x, rawSize.y, rawSize.z);
|
|
54
|
-
if (!Number.isFinite(maxDim) || maxDim <= 1e-6) {
|
|
55
|
-
disposeImportedRoot(gltfScene);
|
|
56
|
-
throw new Error(`GLB "${fileName}" has invalid or zero-size bounds.`);
|
|
57
|
-
}
|
|
58
|
-
let scale = maxDim > 1.2 || maxDim < .25 ? .55 / maxDim : 1;
|
|
59
|
-
const scaledDim = maxDim * scale;
|
|
60
|
-
if (scaledDim < .1) scale = .1 / maxDim;
|
|
61
|
-
if (scaledDim > 2.5) scale = 2.5 / maxDim;
|
|
62
|
-
gltfScene.scale.multiplyScalar(scale);
|
|
63
|
-
gltfScene.updateMatrixWorld(true);
|
|
64
|
-
const normBox = new THREE.Box3().setFromObject(gltfScene);
|
|
65
|
-
const center = normBox.getCenter(new THREE.Vector3());
|
|
66
|
-
const normSize = normBox.getSize(new THREE.Vector3());
|
|
67
|
-
gltfScene.position.sub(center);
|
|
68
|
-
const root = new THREE.Group();
|
|
69
|
-
root.name = fileName;
|
|
70
|
-
root.add(gltfScene);
|
|
71
|
-
root.updateMatrixWorld(true);
|
|
72
|
-
const anyNonStatic = meshes.some((m) => !STATIC_ANCHOR_RE.test(m.name || m.parent?.name || ""));
|
|
73
|
-
const segBox = new THREE.Box3();
|
|
74
|
-
const segSize = new THREE.Vector3();
|
|
75
|
-
const segments = meshes.map((m, idx) => {
|
|
76
|
-
const segmentId = `seg_${idx}`;
|
|
77
|
-
const originalName = m.name?.trim() || m.parent?.name?.trim() || `Segment ${idx + 1}`;
|
|
78
|
-
const destructible = !anyNonStatic || !STATIC_ANCHOR_RE.test(originalName);
|
|
79
|
-
segBox.setFromObject(m);
|
|
80
|
-
segBox.getSize(segSize);
|
|
81
|
-
m.userData.segmentId = segmentId;
|
|
82
|
-
m.userData.destructible = destructible;
|
|
83
|
-
m.userData.customName = originalName;
|
|
84
|
-
return {
|
|
85
|
-
segmentId,
|
|
86
|
-
originalName,
|
|
87
|
-
customName: originalName,
|
|
88
|
-
destructible,
|
|
89
|
-
triCount: triCount(m.geometry),
|
|
90
|
-
bboxSizeM: [
|
|
91
|
-
round4(Math.max(.002, segSize.x)),
|
|
92
|
-
round4(Math.max(.002, segSize.y)),
|
|
93
|
-
round4(Math.max(.002, segSize.z))
|
|
94
|
-
]
|
|
95
|
-
};
|
|
96
|
-
});
|
|
97
|
-
const bboxSizeM = [
|
|
98
|
-
round4(Math.max(.02, normSize.x)),
|
|
99
|
-
round4(Math.max(.02, normSize.y)),
|
|
100
|
-
round4(Math.max(.02, normSize.z))
|
|
101
|
-
];
|
|
102
|
-
return {
|
|
103
|
-
root,
|
|
104
|
-
fileName,
|
|
105
|
-
segments,
|
|
106
|
-
bboxSizeM,
|
|
107
|
-
normalizedExtent: round4(Math.max(...bboxSizeM)),
|
|
108
|
-
halfExtents: [
|
|
109
|
-
Math.max(.015, bboxSizeM[0] * .5),
|
|
110
|
-
Math.max(.015, bboxSizeM[1] * .5),
|
|
111
|
-
Math.max(.015, bboxSizeM[2] * .5)
|
|
112
|
-
],
|
|
113
|
-
dispose: () => disposeImportedRoot(root)
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
async function loadImportedGlbUrl(url, fileName = "imported.glb") {
|
|
117
|
-
if (!url) throw new Error("No GLB URL provided.");
|
|
118
|
-
const res = await fetch(url);
|
|
119
|
-
if (!res.ok) throw new Error(`Failed to fetch GLB "${fileName}" (${res.status}).`);
|
|
120
|
-
return parseImportedGlbBuffer(await res.arrayBuffer(), fileName);
|
|
121
|
-
}
|
|
122
|
-
export { applySegmentsToImportedRoot, loadImportedGlbUrl, parseImportedGlbBuffer };
|
|
123
|
-
|
|
124
|
-
//# sourceMappingURL=junkImporter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"junkImporter.js","names":[],"sources":["../../src/junk/junkImporter.ts"],"sourcesContent":["import * as THREE from \"three\";\nimport { GLTFLoader } from \"three/examples/jsm/loaders/GLTFLoader.js\";\nimport { disposeImportedRoot, ensureMeshAttributes, isMeshNode } from \"./junkImportSanitize.js\";\nimport type { ImportedJunkSegment } from \"./junkTypes.js\";\n\nconst STATIC_ANCHOR_RE = /(base|stand|pedestal|mount|anchor|frame)/i;\n\nconst round4 = (v: number): number => Math.round(v * 1e4) / 1e4;\n\nfunction triCount(geo: THREE.BufferGeometry): number {\n if (geo.index)\n return Math.floor(geo.index.count / 3);\n const pos = geo.attributes.position;\n return pos ? Math.floor(pos.count / 3) : 0;\n}\n\nexport interface ImportedGlbAsset {\n root: THREE.Group;\n fileName: string;\n segments: ImportedJunkSegment[];\n bboxSizeM: [number, number, number];\n normalizedExtent: number;\n halfExtents: [number, number, number];\n dispose: () => void;\n}\n\nexport function applySegmentsToImportedRoot(root: THREE.Object3D, segments: readonly ImportedJunkSegment[]): void {\n const map = new Map(segments.map((s) => [s.segmentId, s]));\n root.traverse((obj) => {\n if (!isMeshNode(obj))\n return;\n const id = obj.userData.segmentId as string | undefined;\n if (!id)\n return;\n const seg = map.get(id);\n if (seg) {\n obj.userData.destructible = seg.destructible;\n obj.userData.customName = seg.customName;\n }\n });\n}\n\nexport async function parseImportedGlbBuffer(buffer: ArrayBuffer, fileName = \"imported.glb\"): Promise<ImportedGlbAsset> {\n if (!buffer || buffer.byteLength === 0) {\n throw new Error(`Cannot import \"${fileName}\": file is empty (0 bytes).`);\n }\n const loader = new GLTFLoader();\n let gltfScene: THREE.Group;\n try {\n const gltf = await loader.parseAsync(buffer.slice(0), \"\");\n gltfScene = gltf.scene;\n }\n catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n throw new Error(`Failed to parse GLB \"${fileName}\": ${msg}`);\n }\n\n const meshes: THREE.Mesh[] = [];\n try {\n gltfScene.traverse((obj) => {\n if (isMeshNode(obj) && obj.geometry?.attributes?.position) {\n ensureMeshAttributes(obj, fileName);\n meshes.push(obj);\n }\n });\n }\n catch (err) {\n disposeImportedRoot(gltfScene);\n throw err;\n }\n\n if (meshes.length === 0) {\n disposeImportedRoot(gltfScene);\n throw new Error(`GLB \"${fileName}\" contains no valid renderable meshes.`);\n }\n\n gltfScene.updateMatrixWorld(true);\n const rawBox = new THREE.Box3().setFromObject(gltfScene);\n const rawSize = rawBox.getSize(new THREE.Vector3());\n const maxDim = Math.max(rawSize.x, rawSize.y, rawSize.z);\n if (!Number.isFinite(maxDim) || maxDim <= 1e-6) {\n disposeImportedRoot(gltfScene);\n throw new Error(`GLB \"${fileName}\" has invalid or zero-size bounds.`);\n }\n\n let scale = maxDim > 1.2 || maxDim < 0.25 ? 0.55 / maxDim : 1;\n const scaledDim = maxDim * scale;\n if (scaledDim < 0.1) scale = 0.1 / maxDim;\n if (scaledDim > 2.5) scale = 2.5 / maxDim;\n gltfScene.scale.multiplyScalar(scale);\n gltfScene.updateMatrixWorld(true);\n\n const normBox = new THREE.Box3().setFromObject(gltfScene);\n const center = normBox.getCenter(new THREE.Vector3());\n const normSize = normBox.getSize(new THREE.Vector3());\n gltfScene.position.sub(center);\n\n const root = new THREE.Group();\n root.name = fileName;\n root.add(gltfScene);\n root.updateMatrixWorld(true);\n\n const anyNonStatic = meshes.some((m) => !STATIC_ANCHOR_RE.test(m.name || m.parent?.name || \"\"));\n const segBox = new THREE.Box3();\n const segSize = new THREE.Vector3();\n const segments: ImportedJunkSegment[] = meshes.map((m, idx) => {\n const segmentId = `seg_${idx}`;\n const originalName = m.name?.trim() || m.parent?.name?.trim() || `Segment ${idx + 1}`;\n const destructible = !anyNonStatic || !STATIC_ANCHOR_RE.test(originalName);\n segBox.setFromObject(m);\n segBox.getSize(segSize);\n m.userData.segmentId = segmentId;\n m.userData.destructible = destructible;\n m.userData.customName = originalName;\n return {\n segmentId,\n originalName,\n customName: originalName,\n destructible,\n triCount: triCount(m.geometry),\n bboxSizeM: [round4(Math.max(0.002, segSize.x)), round4(Math.max(0.002, segSize.y)), round4(Math.max(0.002, segSize.z))],\n };\n });\n\n const bboxSizeM: [number, number, number] = [\n round4(Math.max(0.02, normSize.x)),\n round4(Math.max(0.02, normSize.y)),\n round4(Math.max(0.02, normSize.z)),\n ];\n return {\n root,\n fileName,\n segments,\n bboxSizeM,\n normalizedExtent: round4(Math.max(...bboxSizeM)),\n halfExtents: [Math.max(0.015, bboxSizeM[0] * 0.5), Math.max(0.015, bboxSizeM[1] * 0.5), Math.max(0.015, bboxSizeM[2] * 0.5)],\n dispose: () => disposeImportedRoot(root),\n };\n}\n\nexport async function loadImportedGlbUrl(url: string, fileName = \"imported.glb\"): Promise<ImportedGlbAsset> {\n if (!url)\n throw new Error(\"No GLB URL provided.\");\n const res = await fetch(url);\n if (!res.ok)\n throw new Error(`Failed to fetch GLB \"${fileName}\" (${res.status}).`);\n return parseImportedGlbBuffer(await res.arrayBuffer(), fileName);\n}\n"],"mappings":";;;;AAKA,IAAM,mBAAmB;AAEzB,IAAM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
|
1
|
-
// src/junk/junkLabelCanvas.ts
|
|
2
|
-
function drawTargetLabel(ctx, w, h) {
|
|
3
|
-
ctx.fillStyle = "#f8fafc";
|
|
4
|
-
ctx.fillRect(0, 0, w, h);
|
|
5
|
-
ctx.fillStyle = "#0f172a";
|
|
6
|
-
ctx.fillRect(0, 0, w * .14, h);
|
|
7
|
-
ctx.fillRect(w * .86, 0, w * .14, h);
|
|
8
|
-
const cx = w * .5;
|
|
9
|
-
const cy = h * .5;
|
|
10
|
-
for (const [r, col] of [
|
|
11
|
-
[108, "#0f172a"],
|
|
12
|
-
[86, "#f8fafc"],
|
|
13
|
-
[64, "#dc2626"],
|
|
14
|
-
[42, "#f8fafc"],
|
|
15
|
-
[22, "#ef4444"],
|
|
16
|
-
[9, "#facc15"]
|
|
17
|
-
]) {
|
|
18
|
-
ctx.beginPath();
|
|
19
|
-
ctx.arc(cx, cy, r, 0, Math.PI * 2);
|
|
20
|
-
ctx.fillStyle = col;
|
|
21
|
-
ctx.fill();
|
|
22
|
-
}
|
|
23
|
-
ctx.strokeStyle = "#0f172a";
|
|
24
|
-
ctx.lineWidth = 3;
|
|
25
|
-
ctx.beginPath();
|
|
26
|
-
ctx.moveTo(cx - 118, cy);
|
|
27
|
-
ctx.lineTo(cx - 90, cy);
|
|
28
|
-
ctx.moveTo(cx + 90, cy);
|
|
29
|
-
ctx.lineTo(cx + 118, cy);
|
|
30
|
-
ctx.moveTo(cx, cy - 118);
|
|
31
|
-
ctx.lineTo(cx, cy - 90);
|
|
32
|
-
ctx.moveTo(cx, cy + 90);
|
|
33
|
-
ctx.lineTo(cx, cy + 118);
|
|
34
|
-
ctx.stroke();
|
|
35
|
-
}
|
|
36
|
-
function drawGoofyEmojiLabel(ctx, w, h) {
|
|
37
|
-
ctx.fillStyle = "#facc15";
|
|
38
|
-
ctx.fillRect(0, 0, w, h);
|
|
39
|
-
ctx.fillStyle = "#eab308";
|
|
40
|
-
for (let x = 24; x < w; x += 48) for (let y = 24; y < h; y += 48) {
|
|
41
|
-
ctx.beginPath();
|
|
42
|
-
ctx.arc(x, y, 8, 0, Math.PI * 2);
|
|
43
|
-
ctx.fill();
|
|
44
|
-
}
|
|
45
|
-
const cx = w * .5;
|
|
46
|
-
const cy = h * .5;
|
|
47
|
-
ctx.beginPath();
|
|
48
|
-
ctx.arc(cx, cy, 96, 0, Math.PI * 2);
|
|
49
|
-
ctx.fillStyle = "#fde047";
|
|
50
|
-
ctx.fill();
|
|
51
|
-
ctx.lineWidth = 7;
|
|
52
|
-
ctx.strokeStyle = "#18181b";
|
|
53
|
-
ctx.stroke();
|
|
54
|
-
ctx.fillStyle = "#ffffff";
|
|
55
|
-
ctx.beginPath();
|
|
56
|
-
ctx.arc(cx - 34, cy - 22, 24, 0, Math.PI * 2);
|
|
57
|
-
ctx.arc(cx + 34, cy - 26, 17, 0, Math.PI * 2);
|
|
58
|
-
ctx.fill();
|
|
59
|
-
ctx.stroke();
|
|
60
|
-
ctx.fillStyle = "#18181b";
|
|
61
|
-
ctx.beginPath();
|
|
62
|
-
ctx.arc(cx - 26, cy - 18, 9, 0, Math.PI * 2);
|
|
63
|
-
ctx.arc(cx + 38, cy - 30, 8, 0, Math.PI * 2);
|
|
64
|
-
ctx.fill();
|
|
65
|
-
ctx.beginPath();
|
|
66
|
-
ctx.arc(cx, cy + 12, 52, .1 * Math.PI, .9 * Math.PI);
|
|
67
|
-
ctx.fillStyle = "#7f1d1d";
|
|
68
|
-
ctx.fill();
|
|
69
|
-
ctx.stroke();
|
|
70
|
-
ctx.fillStyle = "#fb7185";
|
|
71
|
-
ctx.beginPath();
|
|
72
|
-
ctx.ellipse(cx + 12, cy + 56, 20, 24, .12, 0, Math.PI * 2);
|
|
73
|
-
ctx.fill();
|
|
74
|
-
ctx.stroke();
|
|
75
|
-
ctx.fillStyle = "#ffffff";
|
|
76
|
-
ctx.fillRect(cx - 22, cy + 16, 16, 14);
|
|
77
|
-
ctx.fillRect(cx + 4, cy + 16, 16, 14);
|
|
78
|
-
}
|
|
79
|
-
function drawTrisSodaLabel(ctx, w, h) {
|
|
80
|
-
const grad = ctx.createLinearGradient(0, 0, w, h);
|
|
81
|
-
grad.addColorStop(0, "#0284c7");
|
|
82
|
-
grad.addColorStop(.5, "#06b6d4");
|
|
83
|
-
grad.addColorStop(1, "#2563eb");
|
|
84
|
-
ctx.fillStyle = grad;
|
|
85
|
-
ctx.fillRect(0, 0, w, h);
|
|
86
|
-
ctx.fillStyle = "#ec4899";
|
|
87
|
-
ctx.beginPath();
|
|
88
|
-
ctx.moveTo(0, h * .72);
|
|
89
|
-
ctx.lineTo(w, h * .25);
|
|
90
|
-
ctx.lineTo(w, h * .42);
|
|
91
|
-
ctx.lineTo(0, h * .89);
|
|
92
|
-
ctx.closePath();
|
|
93
|
-
ctx.fill();
|
|
94
|
-
ctx.fillStyle = "#fde047";
|
|
95
|
-
ctx.fillRect(0, 14, w, 14);
|
|
96
|
-
ctx.fillRect(0, h - 28, w, 14);
|
|
97
|
-
ctx.fillStyle = "rgba(255,255,255,0.45)";
|
|
98
|
-
for (const [x, y, r] of [
|
|
99
|
-
[
|
|
100
|
-
130,
|
|
101
|
-
70,
|
|
102
|
-
10
|
|
103
|
-
],
|
|
104
|
-
[
|
|
105
|
-
165,
|
|
106
|
-
190,
|
|
107
|
-
14
|
|
108
|
-
],
|
|
109
|
-
[
|
|
110
|
-
350,
|
|
111
|
-
62,
|
|
112
|
-
12
|
|
113
|
-
],
|
|
114
|
-
[
|
|
115
|
-
380,
|
|
116
|
-
185,
|
|
117
|
-
9
|
|
118
|
-
]
|
|
119
|
-
]) {
|
|
120
|
-
ctx.beginPath();
|
|
121
|
-
ctx.arc(x, y, r, 0, Math.PI * 2);
|
|
122
|
-
ctx.fill();
|
|
123
|
-
}
|
|
124
|
-
const cx = w * .5;
|
|
125
|
-
const cy = h * .5;
|
|
126
|
-
ctx.fillStyle = "#0f172a";
|
|
127
|
-
ctx.fillRect(cx - 122, cy - 48, 244, 96);
|
|
128
|
-
ctx.strokeStyle = "#fde047";
|
|
129
|
-
ctx.lineWidth = 5;
|
|
130
|
-
ctx.strokeRect(cx - 122, cy - 48, 244, 96);
|
|
131
|
-
ctx.textAlign = "center";
|
|
132
|
-
ctx.textBaseline = "middle";
|
|
133
|
-
ctx.fillStyle = "#fde047";
|
|
134
|
-
ctx.font = "bold 34px sans-serif";
|
|
135
|
-
ctx.fillText("TRIS' SODA", cx, cy - 12);
|
|
136
|
-
ctx.fillStyle = "#67e8f9";
|
|
137
|
-
ctx.font = "bold 18px monospace";
|
|
138
|
-
ctx.fillText("DREAMCAST FIZZ", cx, cy + 24);
|
|
139
|
-
}
|
|
140
|
-
function drawGarysBeansLabel(ctx, w, h) {
|
|
141
|
-
ctx.fillStyle = "#fef3c7";
|
|
142
|
-
ctx.fillRect(0, 0, w, h);
|
|
143
|
-
ctx.fillStyle = "#b91c1c";
|
|
144
|
-
ctx.fillRect(0, 0, w, h * .46);
|
|
145
|
-
ctx.fillStyle = "#1e3a8a";
|
|
146
|
-
ctx.fillRect(0, h * .8, w, h * .2);
|
|
147
|
-
ctx.fillStyle = "#f59e0b";
|
|
148
|
-
ctx.fillRect(0, h * .45, w, 10);
|
|
149
|
-
const cx = w * .5;
|
|
150
|
-
ctx.beginPath();
|
|
151
|
-
ctx.ellipse(cx, h * .62, 62, 34, 0, 0, Math.PI * 2);
|
|
152
|
-
ctx.fillStyle = "#78350f";
|
|
153
|
-
ctx.fill();
|
|
154
|
-
ctx.lineWidth = 4;
|
|
155
|
-
ctx.strokeStyle = "#f59e0b";
|
|
156
|
-
ctx.stroke();
|
|
157
|
-
ctx.textAlign = "center";
|
|
158
|
-
ctx.textBaseline = "middle";
|
|
159
|
-
ctx.fillStyle = "#fef3c7";
|
|
160
|
-
ctx.font = "bold 36px serif";
|
|
161
|
-
ctx.fillText("GARY'S", cx, 46);
|
|
162
|
-
ctx.fillStyle = "#fde047";
|
|
163
|
-
ctx.font = "bold 28px sans-serif";
|
|
164
|
-
ctx.fillText("BEANS", cx, 88);
|
|
165
|
-
ctx.fillStyle = "#fef3c7";
|
|
166
|
-
ctx.font = "bold 18px sans-serif";
|
|
167
|
-
ctx.fillText("BAKED IN SAUCE", cx, h * .62);
|
|
168
|
-
}
|
|
169
|
-
function renderProceduralLabelCanvas(ctx, id, w = 512, h = 256) {
|
|
170
|
-
switch (id) {
|
|
171
|
-
case "target":
|
|
172
|
-
drawTargetLabel(ctx, w, h);
|
|
173
|
-
break;
|
|
174
|
-
case "goofy-emoji":
|
|
175
|
-
drawGoofyEmojiLabel(ctx, w, h);
|
|
176
|
-
break;
|
|
177
|
-
case "tris-soda":
|
|
178
|
-
drawTrisSodaLabel(ctx, w, h);
|
|
179
|
-
break;
|
|
180
|
-
case "garys-beans": drawGarysBeansLabel(ctx, w, h);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
export { renderProceduralLabelCanvas };
|
|
184
|
-
|
|
185
|
-
//# sourceMappingURL=junkLabelCanvas.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"junkLabelCanvas.js","names":[],"sources":["../../src/junk/junkLabelCanvas.ts"],"sourcesContent":["import type { ProceduralLabelId } from \"./junkTypes.js\";\n\nfunction drawTargetLabel(ctx: CanvasRenderingContext2D, w: number, h: number): void {\n ctx.fillStyle = \"#f8fafc\";\n ctx.fillRect(0, 0, w, h);\n ctx.fillStyle = \"#0f172a\";\n ctx.fillRect(0, 0, w * 0.14, h);\n ctx.fillRect(w * 0.86, 0, w * 0.14, h);\n const cx = w * 0.5;\n const cy = h * 0.5;\n for (const [r, col] of [\n [108, \"#0f172a\"],\n [86, \"#f8fafc\"],\n [64, \"#dc2626\"],\n [42, \"#f8fafc\"],\n [22, \"#ef4444\"],\n [9, \"#facc15\"],\n ] as const) {\n ctx.beginPath();\n ctx.arc(cx, cy, r, 0, Math.PI * 2);\n ctx.fillStyle = col;\n ctx.fill();\n }\n ctx.strokeStyle = \"#0f172a\";\n ctx.lineWidth = 3;\n ctx.beginPath();\n ctx.moveTo(cx - 118, cy);\n ctx.lineTo(cx - 90, cy);\n ctx.moveTo(cx + 90, cy);\n ctx.lineTo(cx + 118, cy);\n ctx.moveTo(cx, cy - 118);\n ctx.lineTo(cx, cy - 90);\n ctx.moveTo(cx, cy + 90);\n ctx.lineTo(cx, cy + 118);\n ctx.stroke();\n}\n\nfunction drawGoofyEmojiLabel(ctx: CanvasRenderingContext2D, w: number, h: number): void {\n ctx.fillStyle = \"#facc15\";\n ctx.fillRect(0, 0, w, h);\n ctx.fillStyle = \"#eab308\";\n for (let x = 24; x < w; x += 48) {\n for (let y = 24; y < h; y += 48) {\n ctx.beginPath();\n ctx.arc(x, y, 8, 0, Math.PI * 2);\n ctx.fill();\n }\n }\n const cx = w * 0.5;\n const cy = h * 0.5;\n ctx.beginPath();\n ctx.arc(cx, cy, 96, 0, Math.PI * 2);\n ctx.fillStyle = \"#fde047\";\n ctx.fill();\n ctx.lineWidth = 7;\n ctx.strokeStyle = \"#18181b\";\n ctx.stroke();\n ctx.fillStyle = \"#ffffff\";\n ctx.beginPath();\n ctx.arc(cx - 34, cy - 22, 24, 0, Math.PI * 2);\n ctx.arc(cx + 34, cy - 26, 17, 0, Math.PI * 2);\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = \"#18181b\";\n ctx.beginPath();\n ctx.arc(cx - 26, cy - 18, 9, 0, Math.PI * 2);\n ctx.arc(cx + 38, cy - 30, 8, 0, Math.PI * 2);\n ctx.fill();\n ctx.beginPath();\n ctx.arc(cx, cy + 12, 52, 0.1 * Math.PI, 0.9 * Math.PI);\n ctx.fillStyle = \"#7f1d1d\";\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = \"#fb7185\";\n ctx.beginPath();\n ctx.ellipse(cx + 12, cy + 56, 20, 24, 0.12, 0, Math.PI * 2);\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = \"#ffffff\";\n ctx.fillRect(cx - 22, cy + 16, 16, 14);\n ctx.fillRect(cx + 4, cy + 16, 16, 14);\n}\n\nfunction drawTrisSodaLabel(ctx: CanvasRenderingContext2D, w: number, h: number): void {\n const grad = ctx.createLinearGradient(0, 0, w, h);\n grad.addColorStop(0, \"#0284c7\");\n grad.addColorStop(0.5, \"#06b6d4\");\n grad.addColorStop(1, \"#2563eb\");\n ctx.fillStyle = grad;\n ctx.fillRect(0, 0, w, h);\n ctx.fillStyle = \"#ec4899\";\n ctx.beginPath();\n ctx.moveTo(0, h * 0.72);\n ctx.lineTo(w, h * 0.25);\n ctx.lineTo(w, h * 0.42);\n ctx.lineTo(0, h * 0.89);\n ctx.closePath();\n ctx.fill();\n ctx.fillStyle = \"#fde047\";\n ctx.fillRect(0, 14, w, 14);\n ctx.fillRect(0, h - 28, w, 14);\n ctx.fillStyle = \"rgba(255,255,255,0.45)\";\n for (const [x, y, r] of [\n [130, 70, 10],\n [165, 190, 14],\n [350, 62, 12],\n [380, 185, 9],\n ] as const) {\n ctx.beginPath();\n ctx.arc(x, y, r, 0, Math.PI * 2);\n ctx.fill();\n }\n const cx = w * 0.5;\n const cy = h * 0.5;\n ctx.fillStyle = \"#0f172a\";\n ctx.fillRect(cx - 122, cy - 48, 244, 96);\n ctx.strokeStyle = \"#fde047\";\n ctx.lineWidth = 5;\n ctx.strokeRect(cx - 122, cy - 48, 244, 96);\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.fillStyle = \"#fde047\";\n ctx.font = \"bold 34px sans-serif\";\n ctx.fillText(\"TRIS' SODA\", cx, cy - 12);\n ctx.fillStyle = \"#67e8f9\";\n ctx.font = \"bold 18px monospace\";\n ctx.fillText(\"DREAMCAST FIZZ\", cx, cy + 24);\n}\n\nfunction drawGarysBeansLabel(ctx: CanvasRenderingContext2D, w: number, h: number): void {\n ctx.fillStyle = \"#fef3c7\";\n ctx.fillRect(0, 0, w, h);\n ctx.fillStyle = \"#b91c1c\";\n ctx.fillRect(0, 0, w, h * 0.46);\n ctx.fillStyle = \"#1e3a8a\";\n ctx.fillRect(0, h * 0.8, w, h * 0.2);\n ctx.fillStyle = \"#f59e0b\";\n ctx.fillRect(0, h * 0.45, w, 10);\n const cx = w * 0.5;\n ctx.beginPath();\n ctx.ellipse(cx, h * 0.62, 62, 34, 0, 0, Math.PI * 2);\n ctx.fillStyle = \"#78350f\";\n ctx.fill();\n ctx.lineWidth = 4;\n ctx.strokeStyle = \"#f59e0b\";\n ctx.stroke();\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.fillStyle = \"#fef3c7\";\n ctx.font = \"bold 36px serif\";\n ctx.fillText(\"GARY'S\", cx, 46);\n ctx.fillStyle = \"#fde047\";\n ctx.font = \"bold 28px sans-serif\";\n ctx.fillText(\"BEANS\", cx, 88);\n ctx.fillStyle = \"#fef3c7\";\n ctx.font = \"bold 18px sans-serif\";\n ctx.fillText(\"BAKED IN SAUCE\", cx, h * 0.62);\n}\n\nexport function renderProceduralLabelCanvas(\n ctx: CanvasRenderingContext2D,\n id: ProceduralLabelId,\n w = 512,\n h = 256,\n): void {\n switch (id) {\n case \"target\":\n drawTargetLabel(ctx, w, h);\n break;\n case \"goofy-emoji\":\n drawGoofyEmojiLabel(ctx, w, h);\n break;\n case \"tris-soda\":\n drawTrisSodaLabel(ctx, w, h);\n break;\n case \"garys-beans\":\n drawGarysBeansLabel(ctx, w, h);\n break;\n }\n}\n"],"mappings":";AAEA,SAAS,gBAAgB,KAA+B,GAAW,GAAiB;CAChF,IAAI,YAAY;CAChB,IAAI,SAAS,GAAG,GAAG,GAAG,CAAC;CACvB,IAAI,YAAY;CAChB,IAAI,SAAS,GAAG,GAAG,IAAI,KAAM,CAAC;CAC9B,IAAI,SAAS,IAAI,KAAM,GAAG,IAAI,KAAM,CAAC;CACrC,MAAM,KAAK,IAAI;CACf,MAAM,KAAK,IAAI;CACf,KAAK,MAAM,CAAC,GAAG,QAAQ;EACnB,CAAC,KAAK,SAAS;EACf,CAAC,IAAI,SAAS;EACd,CAAC,IAAI,SAAS;EACd,CAAC,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cAAc;CAClB,IAAI,OAAO;CACX,IAAI,YAAY;CAChB,IAAI,eAAe;CACnB,IAAI,YAAY;CAChB,IAAI,OAAO;CACX,IAAI,SAAS,UAAU,IAAI,EAAE;CAC7B,IAAI,YAAY;CAChB,IAAI,OAAO;CACX,IAAI,SAAS,SAAS,IAAI,EAAE;CAC5B,IAAI,YAAY;CAChB,IAAI,OAAO;CACX,IAAI,SAAS,kBAAkB,IAAI,IAAI,GAAI;AAC/C;AAEA,SAAgB,4BACZ,KACA,IACA,IAAI,KACJ,IAAI,KACA;CACJ,QAAQ,IAAR;EACI,KAAK;GACD,gBAAgB,KAAK,GAAG,CAAC;GACzB;EACJ,KAAK;GACD,oBAAoB,KAAK,GAAG,CAAC;GAC7B;EACJ,KAAK;GACD,kBAAkB,KAAK,GAAG,CAAC;GAC3B;EACJ,KAAK,eACD,oBAAoB,KAAK,GAAG,CAAC;CAErC;AACJ"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as THREE from "three";
|
|
2
|
-
import type { ProceduralLabelId } from "./junkTypes.js";
|
|
3
|
-
export declare function getProceduralLabelTexture(id: ProceduralLabelId, opts?: {
|
|
4
|
-
cache?: boolean;
|
|
5
|
-
}): THREE.CanvasTexture | null;
|
|
6
|
-
export declare function loadCustomLabelTexture(url: string): Promise<{
|
|
7
|
-
texture: THREE.Texture;
|
|
8
|
-
dispose: () => void;
|
|
9
|
-
}>;
|
package/dist/junk/junkLabels.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { renderProceduralLabelCanvas } from "./junkLabelCanvas.js";
|
|
2
|
-
import * as THREE from "three";
|
|
3
|
-
// src/junk/junkLabels.ts
|
|
4
|
-
var labelCache = /* @__PURE__ */ new Map();
|
|
5
|
-
function configureTex(tex) {
|
|
6
|
-
tex.colorSpace = THREE.SRGBColorSpace;
|
|
7
|
-
tex.wrapS = THREE.RepeatWrapping;
|
|
8
|
-
tex.wrapT = THREE.ClampToEdgeWrapping;
|
|
9
|
-
tex.flipY = true;
|
|
10
|
-
tex.anisotropy = 1;
|
|
11
|
-
tex.needsUpdate = true;
|
|
12
|
-
return tex;
|
|
13
|
-
}
|
|
14
|
-
function getProceduralLabelTexture(id, opts) {
|
|
15
|
-
if (typeof document === "undefined") return null;
|
|
16
|
-
const key = id === "custom" ? "target" : id;
|
|
17
|
-
const useCache = opts?.cache !== false;
|
|
18
|
-
if (useCache) {
|
|
19
|
-
const hit = labelCache.get(key);
|
|
20
|
-
if (hit) return hit;
|
|
21
|
-
}
|
|
22
|
-
const canvas = document.createElement("canvas");
|
|
23
|
-
canvas.width = 512;
|
|
24
|
-
canvas.height = 256;
|
|
25
|
-
const ctx = canvas.getContext("2d");
|
|
26
|
-
if (!ctx) return null;
|
|
27
|
-
renderProceduralLabelCanvas(ctx, key, canvas.width, canvas.height);
|
|
28
|
-
const tex = configureTex(new THREE.CanvasTexture(canvas));
|
|
29
|
-
if (useCache) labelCache.set(key, tex);
|
|
30
|
-
return tex;
|
|
31
|
-
}
|
|
32
|
-
function loadCustomLabelTexture(url) {
|
|
33
|
-
return new Promise((resolve, reject) => {
|
|
34
|
-
if (!url || typeof url !== "string") {
|
|
35
|
-
reject(/* @__PURE__ */ new Error("Invalid custom label URL."));
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
new THREE.TextureLoader().load(url, (tex) => {
|
|
39
|
-
configureTex(tex);
|
|
40
|
-
resolve({
|
|
41
|
-
texture: tex,
|
|
42
|
-
dispose: () => tex.dispose()
|
|
43
|
-
});
|
|
44
|
-
}, void 0, () => reject(/* @__PURE__ */ new Error("Failed to decode custom label image from URL.")));
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
export { getProceduralLabelTexture, loadCustomLabelTexture };
|
|
48
|
-
|
|
49
|
-
//# sourceMappingURL=junkLabels.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"junkLabels.js","names":[],"sources":["../../src/junk/junkLabels.ts"],"sourcesContent":["import * as THREE from \"three\";\nimport { renderProceduralLabelCanvas } from \"./junkLabelCanvas.js\";\nimport type { ProceduralLabelId } from \"./junkTypes.js\";\n\nconst labelCache = new Map<ProceduralLabelId, THREE.CanvasTexture>();\n\nfunction configureTex<T extends THREE.Texture>(tex: T): T {\n tex.colorSpace = THREE.SRGBColorSpace;\n tex.wrapS = THREE.RepeatWrapping;\n tex.wrapT = THREE.ClampToEdgeWrapping;\n tex.flipY = true;\n tex.anisotropy = 1;\n tex.needsUpdate = true;\n return tex;\n}\n\nexport function getProceduralLabelTexture(\n id: ProceduralLabelId,\n opts?: { cache?: boolean },\n): THREE.CanvasTexture | null {\n if (typeof document === \"undefined\")\n return null;\n const key: ProceduralLabelId = id === \"custom\" ? \"target\" : id;\n const useCache = opts?.cache !== false;\n if (useCache) {\n const hit = labelCache.get(key);\n if (hit)\n return hit;\n }\n const canvas = document.createElement(\"canvas\");\n canvas.width = 512;\n canvas.height = 256;\n const ctx = canvas.getContext(\"2d\");\n if (!ctx)\n return null;\n renderProceduralLabelCanvas(ctx, key, canvas.width, canvas.height);\n const tex = configureTex(new THREE.CanvasTexture(canvas));\n if (useCache)\n labelCache.set(key, tex);\n return tex;\n}\n\nexport function loadCustomLabelTexture(url: string): Promise<{ texture: THREE.Texture; dispose: () => void }> {\n return new Promise((resolve, reject) => {\n if (!url || typeof url !== \"string\") {\n reject(new Error(\"Invalid custom label URL.\"));\n return;\n }\n new THREE.TextureLoader().load(\n url,\n (tex) => {\n configureTex(tex);\n resolve({ texture: tex, dispose: () => tex.dispose() });\n },\n undefined,\n () => reject(new Error(\"Failed to decode custom label image from URL.\")),\n );\n });\n}\n"],"mappings":";;;AAIA,IAAM,6BAAa,IAAI,IAA4C;AAEnE,SAAS,aAAsC,KAAW;CACtD,IAAI,aAAa,MAAM;CACvB,IAAI,QAAQ,MAAM;CAClB,IAAI,QAAQ,MAAM;CAClB,IAAI,QAAQ;CACZ,IAAI,aAAa;CACjB,IAAI,cAAc;CAClB,OAAO;AACX;AAEA,SAAgB,0BACZ,IACA,MAC0B;CAC1B,IAAI,OAAO,aAAa,aACpB,OAAO;CACX,MAAM,MAAyB,OAAO,WAAW,WAAW;CAC5D,MAAM,WAAW,MAAM,UAAU;CACjC,IAAI,UAAU;EACV,MAAM,MAAM,WAAW,IAAI,GAAG;EAC9B,IAAI,KACA,OAAO;CACf;CACA,MAAM,SAAS,SAAS,cAAc,QAAQ;CAC9C,OAAO,QAAQ;CACf,OAAO,SAAS;CAChB,MAAM,MAAM,OAAO,WAAW,IAAI;CAClC,IAAI,CAAC,KACD,OAAO;CACX,4BAA4B,KAAK,KAAK,OAAO,OAAO,OAAO,MAAM;CACjE,MAAM,MAAM,aAAa,IAAI,MAAM,cAAc,MAAM,CAAC;CACxD,IAAI,UACA,WAAW,IAAI,KAAK,GAAG;CAC3B,OAAO;AACX;AAEA,SAAgB,uBAAuB,KAAuE;CAC1G,OAAO,IAAI,SAAS,SAAS,WAAW;EACpC,IAAI,CAAC,OAAO,OAAO,QAAQ,UAAU;GACjC,uBAAO,IAAI,MAAM,2BAA2B,CAAC;GAC7C;EACJ;EACA,IAAI,MAAM,cAAc,CAAC,CAAC,KACtB,MACC,QAAQ;GACL,aAAa,GAAG;GAChB,QAAQ;IAAE,SAAS;IAAK,eAAe,IAAI,QAAQ;GAAE,CAAC;EAC1D,GACA,KAAA,SACM,uBAAO,IAAI,MAAM,+CAA+C,CAAC,CAC3E;CACJ,CAAC;AACL"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as THREE from "three";
|
|
2
|
-
export type JunkProceduralRecipeId = "tin_can_cola" | "tin_can_oil" | "glass_bottle_amber" | "glass_bottle_emerald" | "wooden_supply_crate" | "hazard_fuel_drum";
|
|
3
|
-
export interface JunkProceduralRecipe {
|
|
4
|
-
readonly id: JunkProceduralRecipeId;
|
|
5
|
-
readonly label: string;
|
|
6
|
-
readonly domain: "junk";
|
|
7
|
-
readonly targetMeters: number;
|
|
8
|
-
readonly massKg: number;
|
|
9
|
-
readonly color: string;
|
|
10
|
-
}
|
|
11
|
-
export declare const JUNK_PROCEDURAL_RECIPES: readonly JunkProceduralRecipe[];
|
|
12
|
-
export declare function buildProceduralJunkScene(recipeOrId?: JunkProceduralRecipeId | JunkProceduralRecipe | string): THREE.Group;
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { BOTTLE_HEIGHT, TIN_CAN_HEIGHT, TIN_CAN_RADIUS, buildGlassBottleGeometry, buildTinCanGeometry, createGlassBottleMaterial, createTinCanMaterials } from "./junkGeometry.js";
|
|
2
|
-
import { getProceduralLabelTexture } from "./junkLabels.js";
|
|
3
|
-
import * as THREE from "three";
|
|
4
|
-
// src/junk/junkProceduralScenes.ts
|
|
5
|
-
var JUNK_PROCEDURAL_RECIPES = Object.freeze([
|
|
6
|
-
{
|
|
7
|
-
id: "tin_can_cola",
|
|
8
|
-
label: "Tin Can Cola",
|
|
9
|
-
domain: "junk",
|
|
10
|
-
targetMeters: .25,
|
|
11
|
-
massKg: .42,
|
|
12
|
-
color: "#06b6d4"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
id: "tin_can_oil",
|
|
16
|
-
label: "Tin Can Oil",
|
|
17
|
-
domain: "junk",
|
|
18
|
-
targetMeters: .28,
|
|
19
|
-
massKg: .68,
|
|
20
|
-
color: "#d97706"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
id: "glass_bottle_amber",
|
|
24
|
-
label: "Glass Bottle Amber",
|
|
25
|
-
domain: "junk",
|
|
26
|
-
targetMeters: .32,
|
|
27
|
-
massKg: .48,
|
|
28
|
-
color: "#f59e0b"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
id: "glass_bottle_emerald",
|
|
32
|
-
label: "Glass Bottle Emerald",
|
|
33
|
-
domain: "junk",
|
|
34
|
-
targetMeters: .32,
|
|
35
|
-
massKg: .48,
|
|
36
|
-
color: "#10b981"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
id: "wooden_supply_crate",
|
|
40
|
-
label: "Wooden Supply Crate",
|
|
41
|
-
domain: "junk",
|
|
42
|
-
targetMeters: .64,
|
|
43
|
-
massKg: 16,
|
|
44
|
-
color: "#b45309"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
id: "hazard_fuel_drum",
|
|
48
|
-
label: "Hazard Fuel Drum",
|
|
49
|
-
domain: "junk",
|
|
50
|
-
targetMeters: .88,
|
|
51
|
-
massKg: 24,
|
|
52
|
-
color: "#eab308"
|
|
53
|
-
}
|
|
54
|
-
]);
|
|
55
|
-
function flatMat(color, roughness = .52, metalness = .18) {
|
|
56
|
-
return new THREE.MeshStandardMaterial({
|
|
57
|
-
color,
|
|
58
|
-
roughness,
|
|
59
|
-
metalness,
|
|
60
|
-
flatShading: true
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
function addBox(parent, name, sx, sy, sz, x, y, z, mat) {
|
|
64
|
-
const mesh = new THREE.Mesh(new THREE.BoxGeometry(sx, sy, sz), mat);
|
|
65
|
-
mesh.name = name;
|
|
66
|
-
mesh.position.set(x, y, z);
|
|
67
|
-
parent.add(mesh);
|
|
68
|
-
return mesh;
|
|
69
|
-
}
|
|
70
|
-
function buildCanVariant(id, labelId, accentHex) {
|
|
71
|
-
const group = new THREE.Group();
|
|
72
|
-
group.name = id;
|
|
73
|
-
const tex = getProceduralLabelTexture(labelId);
|
|
74
|
-
const mats = createTinCanMaterials(tex);
|
|
75
|
-
for (const m of mats) m.flatShading = true;
|
|
76
|
-
if (!tex) mats[0].color.set(accentHex);
|
|
77
|
-
const body = new THREE.Mesh(buildTinCanGeometry("12-gon"), mats);
|
|
78
|
-
body.name = "CanBody";
|
|
79
|
-
body.position.y = TIN_CAN_HEIGHT * .5 + .004;
|
|
80
|
-
group.add(body);
|
|
81
|
-
const rimMat = flatMat("#cbd5e1", .32, .78);
|
|
82
|
-
for (const [nm, ry] of [["ChimeBottom", .006], ["ChimeTop", TIN_CAN_HEIGHT + .004]]) {
|
|
83
|
-
const ring = new THREE.Mesh(new THREE.TorusGeometry(TIN_CAN_RADIUS + .002, .005, 6, 12), rimMat);
|
|
84
|
-
ring.name = nm;
|
|
85
|
-
ring.rotation.x = Math.PI * .5;
|
|
86
|
-
ring.position.y = ry;
|
|
87
|
-
group.add(ring);
|
|
88
|
-
}
|
|
89
|
-
if (id === "tin_can_cola") addBox(group, "PullTab", .024, .004, .038, 0, TIN_CAN_HEIGHT + .008, .014, rimMat);
|
|
90
|
-
else {
|
|
91
|
-
const spout = new THREE.Mesh(new THREE.CylinderGeometry(.014, .018, .028, 8), flatMat("#f59e0b", .4, .3));
|
|
92
|
-
spout.name = "OilSpout";
|
|
93
|
-
spout.position.set(.038, TIN_CAN_HEIGHT + .018, 0);
|
|
94
|
-
group.add(spout);
|
|
95
|
-
addBox(group, "CarryHandle", .07, .012, .014, -.015, TIN_CAN_HEIGHT + .016, 0, rimMat);
|
|
96
|
-
}
|
|
97
|
-
return group;
|
|
98
|
-
}
|
|
99
|
-
function buildBottleVariant(id, labelId) {
|
|
100
|
-
const group = new THREE.Group();
|
|
101
|
-
group.name = id;
|
|
102
|
-
const glassMat = createGlassBottleMaterial();
|
|
103
|
-
glassMat.flatShading = true;
|
|
104
|
-
if (id === "glass_bottle_amber") {
|
|
105
|
-
glassMat.color.set("#d97706");
|
|
106
|
-
glassMat.opacity = .54;
|
|
107
|
-
}
|
|
108
|
-
const body = new THREE.Mesh(buildGlassBottleGeometry(), glassMat);
|
|
109
|
-
body.name = "BottleGlass";
|
|
110
|
-
body.position.y = BOTTLE_HEIGHT * .5;
|
|
111
|
-
group.add(body);
|
|
112
|
-
const tex = getProceduralLabelTexture(labelId);
|
|
113
|
-
const bandMat = new THREE.MeshStandardMaterial({
|
|
114
|
-
color: tex ? "#ffffff" : id === "glass_bottle_amber" ? "#fef3c7" : "#ecfccb",
|
|
115
|
-
map: tex ?? null,
|
|
116
|
-
roughness: .6,
|
|
117
|
-
metalness: .06,
|
|
118
|
-
flatShading: true
|
|
119
|
-
});
|
|
120
|
-
const labelBand = new THREE.Mesh(new THREE.CylinderGeometry(.0565, .0565, .095, 12, 1, true), bandMat);
|
|
121
|
-
labelBand.name = "BottleLabel";
|
|
122
|
-
labelBand.position.y = .115;
|
|
123
|
-
group.add(labelBand);
|
|
124
|
-
const capMat = flatMat(id === "glass_bottle_amber" ? "#fbbf24" : "#a16207", .42, id === "glass_bottle_amber" ? .68 : .12);
|
|
125
|
-
const cap = new THREE.Mesh(new THREE.CylinderGeometry(.025, .026, .022, 10), capMat);
|
|
126
|
-
cap.name = "BottleCap";
|
|
127
|
-
cap.position.y = BOTTLE_HEIGHT + .008;
|
|
128
|
-
group.add(cap);
|
|
129
|
-
return group;
|
|
130
|
-
}
|
|
131
|
-
function buildWoodenSupplyCrate() {
|
|
132
|
-
const group = new THREE.Group();
|
|
133
|
-
group.name = "wooden_supply_crate";
|
|
134
|
-
const S = .64, half = S * .5, post = .055;
|
|
135
|
-
const plankMat = flatMat("#b45309", .78, .06);
|
|
136
|
-
const frameMat = flatMat("#92400e", .82, .08);
|
|
137
|
-
const ironMat = flatMat("#3f3f46", .46, .62);
|
|
138
|
-
addBox(group, "CrateCore", .5800000000000001, .5800000000000001, .5800000000000001, 0, half, 0, plankMat);
|
|
139
|
-
for (const sx of [-1, 1]) for (const sz of [-1, 1]) {
|
|
140
|
-
const o = half - post * .5;
|
|
141
|
-
addBox(group, `CornerPost_${sx > 0 ? "R" : "L"}_${sz > 0 ? "F" : "B"}`, post, S, post, sx * o, half, sz * o, frameMat);
|
|
142
|
-
addBox(group, `CornerBracket_${sx > 0 ? "R" : "L"}_${sz > 0 ? "F" : "B"}`, .065, .05, .065, sx * o, .615, sz * o, ironMat);
|
|
143
|
-
}
|
|
144
|
-
for (let i = 0; i < 3; i++) {
|
|
145
|
-
const y = .14 + i * .18;
|
|
146
|
-
addBox(group, `SlatFront_${i}`, S - post * 1.6, .09, .024, 0, y, .308, frameMat);
|
|
147
|
-
addBox(group, `SlatBack_${i}`, S - post * 1.6, .09, .024, 0, y, -.308, frameMat);
|
|
148
|
-
addBox(group, `SlatLeft_${i}`, .024, .09, S - post * 1.6, -.308, y, 0, frameMat);
|
|
149
|
-
addBox(group, `SlatRight_${i}`, .024, .09, S - post * 1.6, .308, y, 0, frameMat);
|
|
150
|
-
}
|
|
151
|
-
for (const [nm, z] of [["BraceFront", .312], ["BraceBack", -.312]]) {
|
|
152
|
-
const brace = addBox(group, nm, S * .92, .055, .02, 0, half, z, frameMat);
|
|
153
|
-
brace.rotation.z = Math.PI * .25;
|
|
154
|
-
}
|
|
155
|
-
return group;
|
|
156
|
-
}
|
|
157
|
-
function buildHazardFuelDrum() {
|
|
158
|
-
const group = new THREE.Group();
|
|
159
|
-
group.name = "hazard_fuel_drum";
|
|
160
|
-
const H = .88, R = .285;
|
|
161
|
-
const shellMat = flatMat("#dc2626", .46, .42);
|
|
162
|
-
const bandMat = flatMat("#facc15", .48, .25);
|
|
163
|
-
const steelMat = flatMat("#94a3b8", .35, .72);
|
|
164
|
-
const drum = new THREE.Mesh(new THREE.CylinderGeometry(R, R, .86, 12), shellMat);
|
|
165
|
-
drum.name = "DrumShell";
|
|
166
|
-
drum.position.y = H * .5;
|
|
167
|
-
group.add(drum);
|
|
168
|
-
const stripe = new THREE.Mesh(new THREE.CylinderGeometry(.288, .288, .22, 12), bandMat);
|
|
169
|
-
stripe.name = "HazardBand";
|
|
170
|
-
stripe.position.y = H * .5;
|
|
171
|
-
group.add(stripe);
|
|
172
|
-
for (const [idx, cy] of [
|
|
173
|
-
[0, .018],
|
|
174
|
-
[1, H * .33],
|
|
175
|
-
[2, H * .67],
|
|
176
|
-
[3, .862]
|
|
177
|
-
]) {
|
|
178
|
-
const chime = new THREE.Mesh(new THREE.TorusGeometry(.293, .014, 6, 12), steelMat);
|
|
179
|
-
chime.name = `DrumChime_${idx}`;
|
|
180
|
-
chime.rotation.x = Math.PI * .5;
|
|
181
|
-
chime.position.y = cy;
|
|
182
|
-
group.add(chime);
|
|
183
|
-
}
|
|
184
|
-
const bungMain = new THREE.Mesh(new THREE.CylinderGeometry(.032, .032, .024, 8), steelMat);
|
|
185
|
-
bungMain.name = "BungFill";
|
|
186
|
-
bungMain.position.set(.13, H, .05);
|
|
187
|
-
const bungVent = new THREE.Mesh(new THREE.CylinderGeometry(.018, .018, .02, 8), steelMat);
|
|
188
|
-
bungVent.name = "BungVent";
|
|
189
|
-
bungVent.position.set(-.12, H, -.06);
|
|
190
|
-
group.add(bungMain, bungVent);
|
|
191
|
-
return group;
|
|
192
|
-
}
|
|
193
|
-
function buildProceduralJunkScene(recipeOrId = "hazard_fuel_drum") {
|
|
194
|
-
const id = typeof recipeOrId === "string" ? recipeOrId : recipeOrId.id;
|
|
195
|
-
let scene;
|
|
196
|
-
switch (id) {
|
|
197
|
-
case "tin_can_cola":
|
|
198
|
-
scene = buildCanVariant("tin_can_cola", "tris-soda", "#06b6d4");
|
|
199
|
-
break;
|
|
200
|
-
case "tin_can_oil":
|
|
201
|
-
scene = buildCanVariant("tin_can_oil", "garys-beans", "#d97706");
|
|
202
|
-
break;
|
|
203
|
-
case "glass_bottle_amber":
|
|
204
|
-
scene = buildBottleVariant("glass_bottle_amber", "target");
|
|
205
|
-
break;
|
|
206
|
-
case "glass_bottle_emerald":
|
|
207
|
-
scene = buildBottleVariant("glass_bottle_emerald", "goofy-emoji");
|
|
208
|
-
break;
|
|
209
|
-
case "wooden_supply_crate":
|
|
210
|
-
scene = buildWoodenSupplyCrate();
|
|
211
|
-
break;
|
|
212
|
-
default: scene = buildHazardFuelDrum();
|
|
213
|
-
}
|
|
214
|
-
scene.userData.proceduralDomain = "junk";
|
|
215
|
-
scene.userData.proceduralRecipeId = scene.name;
|
|
216
|
-
return scene;
|
|
217
|
-
}
|
|
218
|
-
export { JUNK_PROCEDURAL_RECIPES, buildProceduralJunkScene };
|
|
219
|
-
|
|
220
|
-
//# sourceMappingURL=junkProceduralScenes.js.map
|