@pinkaphant/kolmo 0.2.3 → 0.4.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/LICENSE +1 -1
- package/README.md +36 -36
- package/bin/kolmo.mjs +12 -6
- package/dist/engine/causewayBridge.d.ts +14 -0
- package/dist/engine/causewayBridge.js +166 -0
- package/dist/engine/causewayBridge.js.map +1 -0
- package/dist/engine/index.d.ts +6 -4
- package/dist/engine/index.js +19 -12
- package/dist/engine/index.js.map +1 -0
- package/dist/engine/islandSettlementMesh.d.ts +26 -0
- package/dist/engine/islandSettlementMesh.js +166 -0
- package/dist/engine/islandSettlementMesh.js.map +1 -0
- package/dist/engine/kolmoActions.d.ts +23 -0
- package/dist/engine/kolmoActions.js +164 -0
- package/dist/engine/kolmoActions.js.map +1 -0
- package/dist/engine/kolmoActor.js +242 -165
- package/dist/engine/kolmoActor.js.map +1 -0
- package/dist/engine/kolmoFloatingOrigin.d.ts +17 -0
- package/dist/engine/kolmoFloatingOrigin.js +98 -0
- package/dist/engine/kolmoFloatingOrigin.js.map +1 -0
- package/dist/engine/kolmoGame.d.ts +27 -0
- package/dist/engine/kolmoGame.js +80 -0
- package/dist/engine/kolmoGame.js.map +1 -0
- package/dist/engine/kolmoHud.d.ts +23 -0
- package/dist/engine/kolmoHud.js +195 -0
- package/dist/engine/kolmoHud.js.map +1 -0
- package/dist/engine/kolmoInput.d.ts +1 -1
- package/dist/engine/kolmoInput.js +57 -30
- package/dist/engine/kolmoInput.js.map +1 -0
- package/dist/engine/kolmoIsland.d.ts +5 -10
- package/dist/engine/kolmoIsland.js +182 -250
- package/dist/engine/kolmoIsland.js.map +1 -0
- package/dist/engine/kolmoLongDrive.d.ts +3 -4
- package/dist/engine/kolmoLongDrive.js +140 -205
- package/dist/engine/kolmoLongDrive.js.map +1 -0
- package/dist/engine/kolmoPilotMesh.d.ts +2 -0
- package/dist/engine/kolmoPilotMesh.js +64 -0
- package/dist/engine/kolmoPilotMesh.js.map +1 -0
- package/dist/engine/kolmoProcedural.d.ts +13 -0
- package/dist/engine/kolmoProcedural.js +101 -0
- package/dist/engine/kolmoProcedural.js.map +1 -0
- package/dist/engine/kolmoRigs.d.ts +1 -1
- package/dist/engine/kolmoRigs.js +88 -47
- package/dist/engine/kolmoRigs.js.map +1 -0
- package/dist/engine/kolmoStore.d.ts +3 -100
- package/dist/engine/kolmoSurface.d.ts +2 -2
- package/dist/engine/kolmoSurface.js +150 -134
- package/dist/engine/kolmoSurface.js.map +1 -0
- package/dist/engine/kolmoTraits.d.ts +128 -0
- package/dist/engine/kolmoTraits.js +140 -0
- package/dist/engine/kolmoTraits.js.map +1 -0
- package/dist/engine/kolmoVehicle.d.ts +3 -33
- package/dist/engine/kolmoVehicle.js +66 -240
- package/dist/engine/kolmoVehicle.js.map +1 -0
- package/dist/engine/kolmoVehicleConfig.d.ts +54 -0
- package/dist/engine/kolmoVehicleConfig.js +80 -0
- package/dist/engine/kolmoVehicleConfig.js.map +1 -0
- package/dist/engine/kolmoVehicleDriver.d.ts +4 -1
- package/dist/engine/kolmoVehicleDriver.js +116 -22
- package/dist/engine/kolmoVehicleDriver.js.map +1 -0
- package/dist/engine/kolmoVehicleInner.d.ts +7 -0
- package/dist/engine/kolmoVehicleInner.js +261 -0
- package/dist/engine/kolmoVehicleInner.js.map +1 -0
- package/dist/engine/kolmoWorld.d.ts +6 -4
- package/dist/engine/kolmoWorld.js +134 -116
- package/dist/engine/kolmoWorld.js.map +1 -0
- package/dist/engine/longDriveKit.d.ts +5 -12
- package/dist/engine/longDriveKit.js +121 -233
- package/dist/engine/longDriveKit.js.map +1 -0
- package/dist/engine/longDriveRoadside.d.ts +16 -0
- package/dist/engine/longDriveRoadside.js +171 -0
- package/dist/engine/longDriveRoadside.js.map +1 -0
- package/dist/engine/macroCellBuilder.d.ts +34 -0
- package/dist/engine/macroCellBuilder.js +145 -0
- package/dist/engine/macroCellBuilder.js.map +1 -0
- package/dist/engine/mainlandMacroCell.d.ts +2 -2
- package/dist/engine/mainlandMacroCell.js +77 -165
- package/dist/engine/mainlandMacroCell.js.map +1 -0
- package/dist/engine/shiftedFixedBody.d.ts +1 -1
- package/dist/engine/shiftedFixedBody.js +55 -28
- package/dist/engine/shiftedFixedBody.js.map +1 -0
- package/dist/importer/ChopShopPanel.d.ts +9 -1
- package/dist/importer/ChopShopPanel.js +303 -359
- package/dist/importer/ChopShopPanel.js.map +1 -0
- package/dist/importer/DomainWorkshopPanel.d.ts +2 -1
- package/dist/importer/DomainWorkshopPanel.js +172 -242
- package/dist/importer/DomainWorkshopPanel.js.map +1 -0
- package/dist/importer/GateHudBar.d.ts +8 -0
- package/dist/importer/GateHudBar.js +290 -279
- package/dist/importer/GateHudBar.js.map +1 -0
- package/dist/importer/GlbImportGate.d.ts +2 -1
- package/dist/importer/GlbImportGate.js +252 -225
- package/dist/importer/GlbImportGate.js.map +1 -0
- package/dist/importer/ImperativeVehicleRig.d.ts +2 -2
- package/dist/importer/ImperativeVehicleRig.js +223 -284
- package/dist/importer/ImperativeVehicleRig.js.map +1 -0
- package/dist/importer/LiveDrivePads.d.ts +20 -0
- package/dist/importer/LiveDrivePads.js +169 -0
- package/dist/importer/LiveDrivePads.js.map +1 -0
- package/dist/importer/PaperShellDebrisRig.d.ts +25 -0
- package/dist/importer/PaperShellDebrisRig.js +143 -0
- package/dist/importer/PaperShellDebrisRig.js.map +1 -0
- package/dist/importer/R2VaultDrawer.d.ts +12 -0
- package/dist/importer/R2VaultDrawer.js +90 -0
- package/dist/importer/R2VaultDrawer.js.map +1 -0
- package/dist/importer/Step1CalibrationPlinth.d.ts +23 -5
- package/dist/importer/Step1CalibrationPlinth.js +180 -251
- package/dist/importer/Step1CalibrationPlinth.js.map +1 -0
- package/dist/importer/Step1ExplodedIslands.d.ts +31 -0
- package/dist/importer/Step1ExplodedIslands.js +144 -0
- package/dist/importer/Step1ExplodedIslands.js.map +1 -0
- package/dist/importer/Step2UniversalPad.d.ts +7 -7
- package/dist/importer/Step2UniversalPad.js +49 -170
- package/dist/importer/Step2UniversalPad.js.map +1 -0
- package/dist/importer/VfxEmitterPool.js +59 -86
- package/dist/importer/VfxEmitterPool.js.map +1 -0
- package/dist/importer/WheelRingHandles3D.d.ts +11 -0
- package/dist/importer/WheelRingHandles3D.js +318 -0
- package/dist/importer/WheelRingHandles3D.js.map +1 -0
- package/dist/importer/archLinerGeom.d.ts +2 -0
- package/dist/importer/archLinerGeom.js +51 -0
- package/dist/importer/archLinerGeom.js.map +1 -0
- package/dist/importer/{vehiclePanelAnim.d.ts → chopHingeHelpers.d.ts} +0 -10
- package/dist/importer/chopHingeHelpers.js +193 -0
- package/dist/importer/chopHingeHelpers.js.map +1 -0
- package/dist/importer/chopShopActions.d.ts +20 -26
- package/dist/importer/chopShopActions.js +135 -210
- package/dist/importer/chopShopActions.js.map +1 -0
- package/dist/importer/chopShopHandlers.d.ts +26 -0
- package/dist/importer/chopShopHandlers.js +276 -0
- package/dist/importer/chopShopHandlers.js.map +1 -0
- package/dist/importer/chopShopIoActions.d.ts +15 -0
- package/dist/importer/chopShopIoActions.js +137 -0
- package/dist/importer/chopShopIoActions.js.map +1 -0
- package/dist/importer/chopShopMcpAction.d.ts +18 -0
- package/dist/importer/chopShopMcpAction.js +58 -0
- package/dist/importer/chopShopMcpAction.js.map +1 -0
- package/dist/importer/cylinderBooleanSlice.d.ts +14 -0
- package/dist/importer/cylinderBooleanSlice.js +110 -0
- package/dist/importer/cylinderBooleanSlice.js.map +1 -0
- package/dist/importer/cylinderSliceMath.d.ts +14 -0
- package/dist/importer/cylinderSliceMath.js +251 -0
- package/dist/importer/cylinderSliceMath.js.map +1 -0
- package/dist/importer/fusedWheelDetect.d.ts +4 -0
- package/dist/importer/fusedWheelDetect.js +175 -0
- package/dist/importer/fusedWheelDetect.js.map +1 -0
- package/dist/importer/fusedWheelFit.d.ts +13 -0
- package/dist/importer/fusedWheelFit.js +138 -0
- package/dist/importer/fusedWheelFit.js.map +1 -0
- package/dist/importer/gateStore.d.ts +1 -1
- package/dist/importer/gateStore.js +36 -27
- package/dist/importer/gateStore.js.map +1 -0
- package/dist/importer/glbNormalizer.js +118 -79
- package/dist/importer/glbNormalizer.js.map +1 -0
- package/dist/importer/importerWebMcp.d.ts +4 -3
- package/dist/importer/importerWebMcp.js +41 -336
- package/dist/importer/importerWebMcp.js.map +1 -0
- package/dist/importer/importerWebMcpTools.d.ts +2 -0
- package/dist/importer/importerWebMcpTools.js +340 -0
- package/dist/importer/importerWebMcpTools.js.map +1 -0
- package/dist/importer/index.d.ts +4 -0
- package/dist/importer/index.js +32 -22
- package/dist/importer/index.js.map +1 -0
- package/dist/importer/khrCarPlanHelpers.d.ts +28 -0
- package/dist/importer/khrCarPlanHelpers.js +221 -0
- package/dist/importer/khrCarPlanHelpers.js.map +1 -0
- package/dist/importer/khrCarPlanner.d.ts +7 -0
- package/dist/importer/khrCarPlanner.js +279 -0
- package/dist/importer/khrCarPlanner.js.map +1 -0
- package/dist/importer/khrCompiler.d.ts +4 -22
- package/dist/importer/khrCompiler.js +56 -424
- package/dist/importer/khrCompiler.js.map +1 -0
- package/dist/importer/khrCraftPropCompiler.d.ts +40 -0
- package/dist/importer/khrCraftPropCompiler.js +250 -0
- package/dist/importer/khrCraftPropCompiler.js.map +1 -0
- package/dist/importer/launcherBake.js +76 -35
- package/dist/importer/launcherBake.js.map +1 -0
- package/dist/importer/meshIslands.d.ts +4 -46
- package/dist/importer/meshIslands.js +84 -283
- package/dist/importer/meshIslands.js.map +1 -0
- package/dist/importer/meshSliceBuffers.d.ts +15 -0
- package/dist/importer/meshSliceBuffers.js +159 -0
- package/dist/importer/meshSliceBuffers.js.map +1 -0
- package/dist/importer/polygonEarClipYZ.d.ts +3 -0
- package/dist/importer/polygonEarClipYZ.js +67 -0
- package/dist/importer/polygonEarClipYZ.js.map +1 -0
- package/dist/importer/sceneSiNormalize.d.ts +19 -0
- package/dist/importer/sceneSiNormalize.js +138 -0
- package/dist/importer/sceneSiNormalize.js.map +1 -0
- package/dist/importer/starterScene.d.ts +3 -0
- package/dist/importer/starterScene.js +76 -0
- package/dist/importer/starterScene.js.map +1 -0
- package/dist/importer/surfaceCutter.d.ts +4 -15
- package/dist/importer/surfaceCutter.js +69 -240
- package/dist/importer/surfaceCutter.js.map +1 -0
- package/dist/importer/surfaceGeodesic.d.ts +7 -0
- package/dist/importer/surfaceGeodesic.js +130 -0
- package/dist/importer/surfaceGeodesic.js.map +1 -0
- package/dist/importer/surfaceLoopRefine.d.ts +6 -0
- package/dist/importer/surfaceLoopRefine.js +171 -0
- package/dist/importer/surfaceLoopRefine.js.map +1 -0
- package/dist/importer/surfacePeel.d.ts +11 -0
- package/dist/importer/surfacePeel.js +119 -0
- package/dist/importer/surfacePeel.js.map +1 -0
- package/dist/importer/surfaceTopology.d.ts +2 -6
- package/dist/importer/surfaceTopology.js +93 -133
- package/dist/importer/surfaceTopology.js.map +1 -0
- package/dist/importer/universalGateBake.d.ts +7 -3
- package/dist/importer/universalGateBake.js +104 -106
- package/dist/importer/universalGateBake.js.map +1 -0
- package/dist/importer/usdPhysicsSpecs.d.ts +3 -0
- package/dist/importer/usdPhysicsSpecs.js +245 -0
- package/dist/importer/usdPhysicsSpecs.js.map +1 -0
- package/dist/importer/usdTextParse.d.ts +12 -0
- package/dist/importer/usdTextParse.js +118 -0
- package/dist/importer/usdTextParse.js.map +1 -0
- package/dist/importer/usdToGlb.d.ts +3 -2
- package/dist/importer/usdToGlb.js +80 -280
- package/dist/importer/usdToGlb.js.map +1 -0
- package/dist/importer/useChopShopController.d.ts +50 -47
- package/dist/importer/useChopShopController.js +156 -338
- package/dist/importer/useChopShopController.js.map +1 -0
- package/dist/importer/useChopShopState.d.ts +103 -0
- package/dist/importer/useChopShopState.js +319 -0
- package/dist/importer/useChopShopState.js.map +1 -0
- package/dist/importer/useWasdKeyRef.d.ts +9 -0
- package/dist/importer/useWasdKeyRef.js +35 -0
- package/dist/importer/useWasdKeyRef.js.map +1 -0
- package/dist/importer/vehiclePartSplit.d.ts +33 -0
- package/dist/importer/vehiclePartSplit.js +178 -0
- package/dist/importer/vehiclePartSplit.js.map +1 -0
- package/dist/importer/wheelAxlePairing.js +106 -70
- package/dist/importer/wheelAxlePairing.js.map +1 -0
- package/dist/importer/wheelCutterHelpers.d.ts +42 -0
- package/dist/importer/wheelCutterHelpers.js +178 -0
- package/dist/importer/wheelCutterHelpers.js.map +1 -0
- package/dist/importer/wheelRingHandleMath.d.ts +20 -0
- package/dist/importer/wheelRingHandleMath.js +66 -0
- package/dist/importer/wheelRingHandleMath.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +90 -66
- package/dist/index.js.map +1 -0
- package/dist/junk/DestructibleTarget.d.ts +3 -3
- package/dist/junk/DestructibleTarget.js +177 -114
- package/dist/junk/DestructibleTarget.js.map +1 -0
- package/dist/junk/KolmoJunk.js +55 -44
- package/dist/junk/KolmoJunk.js.map +1 -0
- package/dist/junk/ShardPieces.d.ts +2 -1
- package/dist/junk/ShardPieces.js +80 -61
- package/dist/junk/ShardPieces.js.map +1 -0
- package/dist/junk/TargetDecals.d.ts +6 -15
- package/dist/junk/TargetDecals.js +66 -40
- package/dist/junk/TargetDecals.js.map +1 -0
- package/dist/junk/bvhShatter.d.ts +2 -6
- package/dist/junk/bvhShatter.js +89 -43
- package/dist/junk/bvhShatter.js.map +1 -0
- package/dist/junk/bvhTriCollector.d.ts +2 -6
- package/dist/junk/bvhTriCollector.js +111 -62
- package/dist/junk/bvhTriCollector.js.map +1 -0
- package/dist/junk/index.d.ts +2 -2
- package/dist/junk/index.js +11 -11
- package/dist/junk/index.js.map +1 -0
- package/dist/junk/junkGeometry.d.ts +5 -26
- package/dist/junk/junkGeometry.js +61 -43
- package/dist/junk/junkGeometry.js.map +1 -0
- package/dist/junk/junkImportSanitize.d.ts +4 -5
- package/dist/junk/junkImportSanitize.js +57 -37
- package/dist/junk/junkImportSanitize.js.map +1 -0
- package/dist/junk/junkImporter.d.ts +2 -13
- package/dist/junk/junkImporter.js +105 -76
- package/dist/junk/junkImporter.js.map +1 -0
- package/dist/junk/junkLabelCanvas.d.ts +1 -6
- package/dist/junk/junkLabelCanvas.js +147 -29
- package/dist/junk/junkLabelCanvas.js.map +1 -0
- package/dist/junk/junkLabels.d.ts +4 -26
- package/dist/junk/junkLabels.js +42 -28
- package/dist/junk/junkLabels.js.map +1 -0
- package/dist/junk/targetHelpers.d.ts +3 -4
- package/dist/junk/targetHelpers.js +121 -67
- package/dist/junk/targetHelpers.js.map +1 -0
- package/dist/junk/targetHitLogic.d.ts +8 -8
- package/dist/junk/targetHitLogic.js +131 -95
- package/dist/junk/targetHitLogic.js.map +1 -0
- package/dist/junk/useTargetAssets.d.ts +9 -14
- package/dist/junk/useTargetAssets.js +113 -85
- package/dist/junk/useTargetAssets.js.map +1 -0
- package/dist/physics/index.d.ts +1 -1
- package/dist/physics/index.js +79 -58
- package/dist/physics/index.js.map +1 -0
- package/dist/schema/kolmoSchema.d.ts +3 -64
- package/dist/schema/kolmoSchema.js +75 -149
- package/dist/schema/kolmoSchema.js.map +1 -0
- package/dist/schema/kolmoStamp.d.ts +6 -0
- package/dist/schema/kolmoStamp.js +71 -0
- package/dist/schema/kolmoStamp.js.map +1 -0
- package/dist/schema/kolmoTypes.d.ts +63 -0
- package/dist/schema/kolmoTypes.js +66 -0
- package/dist/schema/kolmoTypes.js.map +1 -0
- package/dist/shaders/celestialBackdrop.d.ts +2 -10
- package/dist/shaders/celestialBackdrop.js +128 -291
- package/dist/shaders/celestialBackdrop.js.map +1 -0
- package/dist/shaders/emitterShaders.d.ts +9 -0
- package/dist/shaders/emitterShaders.js +114 -0
- package/dist/shaders/emitterShaders.js.map +1 -0
- package/dist/shaders/index.d.ts +1 -1
- package/dist/shaders/index.js +12 -9
- package/dist/shaders/index.js.map +1 -0
- package/dist/shaders/plumeAndSparkle.d.ts +2 -4
- package/dist/shaders/plumeAndSparkle.js +152 -191
- package/dist/shaders/plumeAndSparkle.js.map +1 -0
- package/dist/shaders/ps2GlslShared.js +29 -2
- package/dist/shaders/ps2GlslShared.js.map +1 -0
- package/dist/shaders/ps2MaterialsTSL.js +132 -51
- package/dist/shaders/ps2MaterialsTSL.js.map +1 -0
- package/dist/shaders/ps2MaterialsWebGL.js +45 -28
- package/dist/shaders/ps2MaterialsWebGL.js.map +1 -0
- package/dist/shaders/ps2RoadWebGL.js +69 -32
- package/dist/shaders/ps2RoadWebGL.js.map +1 -0
- package/dist/shaders/ps2TerrainWebGL.js +107 -30
- package/dist/shaders/ps2TerrainWebGL.js.map +1 -0
- package/dist/shaders/ps2Textures.d.ts +1 -1
- package/dist/shaders/ps2Textures.js +116 -41
- package/dist/shaders/ps2Textures.js.map +1 -0
- package/dist/shaders/retroPalettes.d.ts +1 -1
- package/dist/shaders/retroPalettes.js +90 -57
- package/dist/shaders/retroPalettes.js.map +1 -0
- package/dist/shaders/retroShader.d.ts +2 -86
- package/dist/shaders/retroShader.js +65 -196
- package/dist/shaders/retroShader.js.map +1 -0
- package/dist/shaders/retroUniforms.d.ts +60 -0
- package/dist/shaders/retroUniforms.js +215 -0
- package/dist/shaders/retroUniforms.js.map +1 -0
- package/dist/shaders/skyboxShaders.d.ts +16 -0
- package/dist/shaders/skyboxShaders.js +266 -0
- package/dist/shaders/skyboxShaders.js.map +1 -0
- package/dist/shaders/tsl.d.ts +1 -1
- package/dist/shaders/tsl.js.map +1 -0
- package/dist/vite/index.js +39 -23
- package/dist/vite/index.js.map +1 -0
- package/dist/world/frontage.js +25 -21
- package/dist/world/frontage.js.map +1 -0
- package/dist/world/index.d.ts +4 -4
- package/dist/world/index.js +12 -11
- package/dist/world/index.js.map +1 -0
- package/dist/world/infiniteWorld2D.d.ts +0 -5
- package/dist/world/infiniteWorld2D.js +175 -200
- package/dist/world/infiniteWorld2D.js.map +1 -0
- package/dist/world/island.js +81 -166
- package/dist/world/island.js.map +1 -0
- package/dist/world/islandPathing.d.ts +6 -0
- package/dist/world/islandPathing.js +166 -0
- package/dist/world/islandPathing.js.map +1 -0
- package/dist/world/macroCellSchema.js +15 -8
- package/dist/world/macroCellSchema.js.map +1 -0
- package/dist/world/macroKnightAStar.js +140 -71
- package/dist/world/macroKnightAStar.js.map +1 -0
- package/dist/world/macroSettlementZones.d.ts +9 -0
- package/dist/world/macroSettlementZones.js +108 -0
- package/dist/world/macroSettlementZones.js.map +1 -0
- package/dist/world/random.js +50 -24
- package/dist/world/random.js.map +1 -0
- package/dist/world/road.js +152 -90
- package/dist/world/road.js.map +1 -0
- package/dist/world/roadRibbon.d.ts +4 -19
- package/dist/world/roadRibbon.js +129 -124
- package/dist/world/roadRibbon.js.map +1 -0
- package/dist/world/terrain.d.ts +1 -1
- package/dist/world/terrain.js +111 -65
- package/dist/world/terrain.js.map +1 -0
- package/dist/world/terrainGeometry.d.ts +14 -0
- package/dist/world/terrainGeometry.js +76 -0
- package/dist/world/terrainGeometry.js.map +1 -0
- package/dist/world/worldTypes.d.ts +3 -3
- package/dist/world/worldTypes.js +133 -67
- package/dist/world/worldTypes.js.map +1 -0
- package/docs/api-reference.md +187 -0
- package/package.json +58 -32
- package/dist/engine/kolmoStore.js +0 -211
- package/dist/importer/ImporterPlinthUikitTags.d.ts +0 -19
- package/dist/importer/ImporterPlinthUikitTags.js +0 -112
- package/dist/importer/vehiclePanelAnim.js +0 -214
|
@@ -1,21 +1,7 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import
|
|
3
|
-
import { type PaperShellAssembly } from "@khr3/vehicles/paper-shell";
|
|
4
|
-
import * as THREE from "three";
|
|
5
|
-
import type { KolmoAuthoredNodePatch } from "../schema/kolmoSchema.js";
|
|
6
|
-
import type { StampToolId } from "./GateHudBar.js";
|
|
1
|
+
import type * as THREE from "three";
|
|
2
|
+
import { buildSurfaceStampPatch } from "./chopShopActions.js";
|
|
7
3
|
import type { CutPartMcpRequest } from "./importerWebMcp.js";
|
|
8
|
-
import {
|
|
9
|
-
import { type GateDomain, type VehicleSubArchetype } from "./gateStore.js";
|
|
10
|
-
import type { VehiclePanelAnimator, WheelVisualSource } from "./khrCompiler.js";
|
|
11
|
-
import { type MeshIsland, type OrientTurns, type WheelAxle } from "./meshIslands.js";
|
|
12
|
-
import { type ActiveChopRole, type ChopPartRole, type CutVec3, type FaceSelection, type SurfaceSelectMode } from "./surfaceCutter.js";
|
|
13
|
-
import { type GateWorldPayload } from "./universalGateBake.js";
|
|
14
|
-
interface CutUndoEntry {
|
|
15
|
-
readonly undo: () => void;
|
|
16
|
-
readonly axles: WheelAxle[];
|
|
17
|
-
readonly picks: Record<number, ChopPartRole>;
|
|
18
|
-
}
|
|
4
|
+
import type { GateWorldPayload } from "./universalGateBake.js";
|
|
19
5
|
export declare function useChopShopController(onSpawnInWorld?: (asset: GateWorldPayload) => void): {
|
|
20
6
|
st: import("./gateStore.js").GateState;
|
|
21
7
|
assetName: string;
|
|
@@ -24,58 +10,75 @@ export declare function useChopShopController(onSpawnInWorld?: (asset: GateWorld
|
|
|
24
10
|
targetMeters: number;
|
|
25
11
|
setTargetMeters: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
26
12
|
setYOffset: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
27
|
-
setTurns: import("react").Dispatch<import("react").SetStateAction<OrientTurns>>;
|
|
28
|
-
axles: WheelAxle[];
|
|
29
|
-
setAxles: import("react").Dispatch<import("react").SetStateAction<WheelAxle[]>>;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
13
|
+
setTurns: import("react").Dispatch<import("react").SetStateAction<import("./sceneSiNormalize.js").OrientTurns>>;
|
|
14
|
+
axles: import("./wheelAxlePairing.js").WheelAxle[];
|
|
15
|
+
setAxles: import("react").Dispatch<import("react").SetStateAction<import("./wheelAxlePairing.js").WheelAxle[]>>;
|
|
16
|
+
wheelCutters: import("./wheelCutterHelpers.js").WheelCutterSpec[];
|
|
17
|
+
setWheelCutters: import("react").Dispatch<import("react").SetStateAction<import("./wheelCutterHelpers.js").WheelCutterSpec[]>>;
|
|
18
|
+
partPicks: Record<number, import("./surfaceTopology.js").ChopPartRole>;
|
|
19
|
+
setPartPicks: import("react").Dispatch<import("react").SetStateAction<Record<number, import("./surfaceTopology.js").ChopPartRole>>>;
|
|
20
|
+
wheelSource: import("./khrCraftPropCompiler.js").WheelVisualSource;
|
|
21
|
+
setWheelSource: import("react").Dispatch<import("react").SetStateAction<import("./khrCraftPropCompiler.js").WheelVisualSource>>;
|
|
22
|
+
activeRole: import("./surfaceTopology.js").ActiveChopRole;
|
|
23
|
+
setActiveRole: import("react").Dispatch<import("react").SetStateAction<import("./surfaceTopology.js").ActiveChopRole>>;
|
|
24
|
+
surfaceMode: import("./surfaceTopology.js").SurfaceSelectMode;
|
|
25
|
+
setSurfaceMode: import("react").Dispatch<import("react").SetStateAction<import("./surfaceTopology.js").SurfaceSelectMode>>;
|
|
38
26
|
creaseDeg: number;
|
|
39
27
|
setCreaseDeg: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
40
28
|
mirrorX: boolean;
|
|
41
|
-
setMirrorX:
|
|
29
|
+
setMirrorX: (next?: boolean) => void;
|
|
30
|
+
toggleMirrorX: (next?: boolean) => void;
|
|
31
|
+
snapAxles: boolean;
|
|
32
|
+
setSnapAxles: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
33
|
+
toggleSnapAxles: (next?: boolean) => void;
|
|
34
|
+
sealArchLiner: boolean;
|
|
35
|
+
setSealArchLiner: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
36
|
+
toggleSealArchLiner: (next?: boolean) => void;
|
|
37
|
+
isCored: boolean;
|
|
38
|
+
hasPostCorePeels: boolean;
|
|
42
39
|
splitCoarse: boolean;
|
|
43
40
|
setSplitCoarse: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
44
|
-
faceSelection: FaceSelection | null;
|
|
45
|
-
setFaceSelection: import("react").Dispatch<import("react").SetStateAction<FaceSelection | null>>;
|
|
41
|
+
faceSelection: import("./surfaceTopology.js").FaceSelection | null;
|
|
42
|
+
setFaceSelection: import("react").Dispatch<import("react").SetStateAction<import("./surfaceTopology.js").FaceSelection | null>>;
|
|
46
43
|
loopDots: {
|
|
47
44
|
islandId: number;
|
|
48
|
-
points: CutVec3[];
|
|
45
|
+
points: import("./surfaceTopology.js").CutVec3[];
|
|
49
46
|
} | null;
|
|
50
47
|
setLoopDots: import("react").Dispatch<import("react").SetStateAction<{
|
|
51
48
|
islandId: number;
|
|
52
|
-
points: CutVec3[];
|
|
49
|
+
points: import("./surfaceTopology.js").CutVec3[];
|
|
53
50
|
} | null>>;
|
|
54
51
|
hingeScrub: number;
|
|
55
52
|
setHingeScrub: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
56
53
|
explodeAmount: number;
|
|
57
54
|
setExplodeAmount: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
58
|
-
undoStack: CutUndoEntry[];
|
|
55
|
+
undoStack: import("./useChopShopState.js").CutUndoEntry[];
|
|
59
56
|
statusNote: string | null;
|
|
60
|
-
stampTool: StampToolId;
|
|
61
|
-
setStampTool: import("react").Dispatch<import("react").SetStateAction<StampToolId>>;
|
|
62
|
-
patches: KolmoAuthoredNodePatch[];
|
|
63
|
-
setPatches: import("react").Dispatch<import("react").SetStateAction<KolmoAuthoredNodePatch[]>>;
|
|
64
|
-
liveBundle: KhrAssetBundle | null;
|
|
57
|
+
stampTool: import("./GateHudBar.js").StampToolId;
|
|
58
|
+
setStampTool: import("react").Dispatch<import("react").SetStateAction<import("./GateHudBar.js").StampToolId>>;
|
|
59
|
+
patches: import("../index.js").KolmoAuthoredNodePatch[];
|
|
60
|
+
setPatches: import("react").Dispatch<import("react").SetStateAction<import("../index.js").KolmoAuthoredNodePatch[]>>;
|
|
61
|
+
liveBundle: import("@khr3/core").KhrAssetBundle | null;
|
|
65
62
|
busy: boolean;
|
|
66
63
|
fileRef: import("react").RefObject<HTMLInputElement | null>;
|
|
67
64
|
rootObjRef: import("react").RefObject<THREE.Group<THREE.Object3DEventMap> | null>;
|
|
68
|
-
|
|
65
|
+
panelJointsRef: import("react").RefObject<import("@khr3/core/vehicle").KhrVehicleJointsHandle | null>;
|
|
69
66
|
workingScene: THREE.Group<THREE.Object3DEventMap> | null;
|
|
70
|
-
assembly: PaperShellAssembly;
|
|
71
|
-
setProxyAssembly: import("react").Dispatch<import("react").SetStateAction<PaperShellAssembly | null>>;
|
|
72
|
-
islands: MeshIsland[];
|
|
67
|
+
assembly: import("@khr3/vehicles/paper-shell").PaperShellAssembly;
|
|
68
|
+
setProxyAssembly: import("react").Dispatch<import("react").SetStateAction<import("@khr3/vehicles/paper-shell").PaperShellAssembly | null>>;
|
|
69
|
+
islands: import("./meshIslands.js").MeshIsland[];
|
|
73
70
|
wheelColors: Map<number, string>;
|
|
74
71
|
loadStarterCar: (url: string, label: string) => Promise<void>;
|
|
75
72
|
ingestFile: (file: File) => Promise<void>;
|
|
76
|
-
applyDomainDefaults: (d: GateDomain, sub: VehicleSubArchetype, proxy: boolean) => void;
|
|
73
|
+
applyDomainDefaults: (d: import("./gateStore.js").GateDomain, sub: import("./gateStore.js").VehicleSubArchetype, proxy: boolean) => void;
|
|
77
74
|
handleBucketIsland: (id: number) => void;
|
|
78
|
-
handlePickFace: (hit: Step1FaceHit) => void;
|
|
75
|
+
handlePickFace: (hit: import("./Step1CalibrationPlinth.js").Step1FaceHit) => void;
|
|
76
|
+
updateWheelCutter: (id: import("./wheelCutterHelpers.js").WheelCutterId, patch: import("./wheelCutterHelpers.js").WheelCutterPatch) => void;
|
|
77
|
+
commitWheelCutter: (id: import("./wheelCutterHelpers.js").WheelCutterId, next: import("./wheelCutterHelpers.js").WheelCutterSpec) => void;
|
|
78
|
+
applyWheelCutters: (overrideCutters?: readonly import("./wheelCutterHelpers.js").WheelCutterSpec[], opts?: {
|
|
79
|
+
sealArchLiner?: boolean;
|
|
80
|
+
mirrorX?: boolean;
|
|
81
|
+
}) => void;
|
|
79
82
|
forgeScene: (label: string, sc: THREE.Group, lenM: number) => void;
|
|
80
83
|
handleCloseLoop: () => void;
|
|
81
84
|
handlePeelSelection: () => void;
|
|
@@ -89,7 +92,7 @@ export declare function useChopShopController(onSpawnInWorld?: (asset: GateWorld
|
|
|
89
92
|
key: string;
|
|
90
93
|
url: string;
|
|
91
94
|
}>;
|
|
92
|
-
handleStampSurface: (e:
|
|
95
|
+
handleStampSurface: (e: Parameters<typeof buildSurfaceStampPatch>[0]) => void;
|
|
93
96
|
wheelCount: number;
|
|
94
97
|
choppedCount: number;
|
|
95
98
|
unlocked: boolean;
|
|
@@ -100,4 +103,4 @@ export declare function useChopShopController(onSpawnInWorld?: (asset: GateWorld
|
|
|
100
103
|
autoScaleSi: () => void;
|
|
101
104
|
snapC12: () => void;
|
|
102
105
|
};
|
|
103
|
-
export
|
|
106
|
+
export type ChopShopController = ReturnType<typeof useChopShopController>;
|
|
@@ -1,364 +1,182 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { bakeUniversalGateGlb as me } from "./universalGateBake.js";
|
|
10
|
-
import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
11
|
-
import { GLTFLoader as he } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
12
|
-
import { buildPaperShellAssembly as ge } from "@khr3/vehicles/paper-shell";
|
|
1
|
+
import { hasPostCoreUndoEntries } from "./chopShopActions.js";
|
|
2
|
+
import { createChopShopHandlers } from "./chopShopHandlers.js";
|
|
3
|
+
import { defaultTargetMeters, snapMetersToC12 } from "./glbNormalizer.js";
|
|
4
|
+
import { executeCutPartMcp } from "./chopShopMcpAction.js";
|
|
5
|
+
import { buildSurfaceStampPatch, downloadBlobGlb, putAuthenticatedVaultGlb } from "./chopShopIoActions.js";
|
|
6
|
+
import { isGateStep1Unlocked } from "./gateStore.js";
|
|
7
|
+
import { CHOP_ROLES } from "./surfaceTopology.js";
|
|
8
|
+
import { useChopShopState } from "./useChopShopState.js";
|
|
13
9
|
// src/importer/useChopShopController.ts
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
]), [x, S] = f(4.65), [C, xe] = f(0), [Se, w] = f(null), [T, E] = f(0), [D, O] = f([]), [k, A] = f({}), [j, Ce] = f("imported"), [M, we] = f("door"), [N, Te] = f("crease"), [P, Ee] = f(32), [F, De] = f(!0), [I, Oe] = f(!1), [L, R] = f(null), [z, B] = f(null), [V, H] = f(0), [ke, Ae] = f(0), [U, W] = f([]), [je, G] = f("Click a door/hood face with Crease Flood or Tape Lasso, then Peel!"), [Me, Ne] = f("none"), [K, q] = f([]), [Pe, Fe] = f(null), [Ie, J] = f(!1), Le = d(null), Re = d(null), ze = d(null), Be = d(0), Y = c((e, t) => (J(!0), new Promise((n, r) => {
|
|
20
|
-
new he().load(e, (e) => {
|
|
21
|
-
g(t), y(e.scene), b([
|
|
22
|
-
0,
|
|
23
|
-
0,
|
|
24
|
-
0
|
|
25
|
-
]), S(t.includes("pickup") ? 4.65 : 4.2), A({}), R(null), B(null), W([]), H(0), G(`Loaded ${t} — chop doors/hood/trunk or pop tires!`), J(!1), n();
|
|
26
|
-
}, void 0, (n) => {
|
|
27
|
-
J(!1), G(`Failed to load ${t}`), r(n instanceof Error ? n : /* @__PURE__ */ Error(`Failed to load ${e}`));
|
|
28
|
-
});
|
|
29
|
-
})), []);
|
|
30
|
-
l(() => {
|
|
31
|
-
Y("/models/pickup-truck.glb", "pickup_truck").catch(() => {});
|
|
32
|
-
}, [Y]);
|
|
33
|
-
let X = u(() => {
|
|
34
|
-
let e = !v && !(m.domain === "vehicle" && m.usePaperShellProxy) ? re(m.domain) : null, t = v ?? e;
|
|
35
|
-
if (!t) return null;
|
|
36
|
-
try {
|
|
37
|
-
return de(t, {
|
|
38
|
-
turns: be,
|
|
39
|
-
targetMeters: Math.max(.05, x),
|
|
40
|
-
axis: "lengthZ"
|
|
41
|
-
}).scene;
|
|
42
|
-
} catch {
|
|
43
|
-
return null;
|
|
44
|
-
} finally {
|
|
45
|
-
e?.traverse((e) => {
|
|
46
|
-
let t = e;
|
|
47
|
-
t.geometry?.dispose(), t.material?.dispose();
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}, [
|
|
51
|
-
v,
|
|
52
|
-
m.domain,
|
|
53
|
-
m.usePaperShellProxy,
|
|
54
|
-
be,
|
|
55
|
-
x
|
|
56
|
-
]), Z = u(() => Se ?? ge(m.presetId, m.shadingMode), [
|
|
57
|
-
Se,
|
|
58
|
-
m.presetId,
|
|
59
|
-
m.shadingMode
|
|
60
|
-
]);
|
|
61
|
-
l(() => {
|
|
62
|
-
m.domain === "vehicle" && m.usePaperShellProxy ? oe(Z, 1, C, !!v, X) : X && se(X, C);
|
|
63
|
-
}, [
|
|
64
|
-
m.domain,
|
|
65
|
-
m.usePaperShellProxy,
|
|
66
|
-
Z,
|
|
67
|
-
X,
|
|
68
|
-
C,
|
|
69
|
-
v,
|
|
70
|
-
T
|
|
71
|
-
]);
|
|
72
|
-
let Q = u(() => X && m.domain === "vehicle" && !m.usePaperShellProxy && m.vehicleArchetype !== "starcraft" ? ue(X) : [], [
|
|
73
|
-
X,
|
|
74
|
-
m.domain,
|
|
75
|
-
m.usePaperShellProxy,
|
|
76
|
-
m.vehicleArchetype,
|
|
77
|
-
T
|
|
78
|
-
]);
|
|
79
|
-
l(() => () => {
|
|
80
|
-
for (let e of Q) e.geometry.dispose();
|
|
81
|
-
}, [Q]), l(() => {
|
|
82
|
-
if (!X) return;
|
|
83
|
-
let t = ue(X);
|
|
84
|
-
O(m.vehicleArchetype === "car" ? e(t) : []);
|
|
85
|
-
for (let e of t) e.geometry.dispose();
|
|
86
|
-
A({}), R(null), B(null), W([]);
|
|
87
|
-
}, [X, m.vehicleArchetype]);
|
|
88
|
-
let Ve = u(() => new Set(D.flatMap((e) => [...e.left, ...e.right])), [D]), He = u(() => {
|
|
89
|
-
let e = /* @__PURE__ */ new Map();
|
|
90
|
-
return D.forEach((t, n) => {
|
|
91
|
-
for (let r of [...t.left, ...t.right]) e.set(r, n === 0 ? "#00E5FF" : "#10B981");
|
|
92
|
-
}), e;
|
|
93
|
-
}, [D]), $ = c(() => me({
|
|
94
|
-
name: h,
|
|
95
|
-
domain: m.domain,
|
|
96
|
-
vehicleArchetype: m.vehicleArchetype,
|
|
97
|
-
usePaperShellProxy: m.usePaperShellProxy,
|
|
98
|
-
assembly: Z,
|
|
99
|
-
attachedMask: m.attachedMask,
|
|
100
|
-
fuelLiters: m.fuelLiters,
|
|
101
|
-
normalizedScene: X,
|
|
102
|
-
massKg: m.massKg,
|
|
103
|
-
powerOrThrust: m.powerOrThrust,
|
|
104
|
-
driveType: m.driveType,
|
|
105
|
-
staticProp: m.staticProp,
|
|
106
|
-
axles: D,
|
|
107
|
-
islands: Q,
|
|
108
|
-
partPicks: k,
|
|
109
|
-
wheelSource: j,
|
|
110
|
-
patches: K
|
|
111
|
-
}), [
|
|
112
|
-
h,
|
|
113
|
-
m.domain,
|
|
114
|
-
m.vehicleArchetype,
|
|
115
|
-
m.usePaperShellProxy,
|
|
116
|
-
Z,
|
|
117
|
-
m.attachedMask,
|
|
118
|
-
m.fuelLiters,
|
|
119
|
-
X,
|
|
120
|
-
m.massKg,
|
|
121
|
-
m.powerOrThrust,
|
|
122
|
-
m.driveType,
|
|
123
|
-
m.staticProp,
|
|
124
|
-
D,
|
|
125
|
-
Q,
|
|
126
|
-
k,
|
|
127
|
-
j,
|
|
128
|
-
K
|
|
129
|
-
]);
|
|
130
|
-
l(() => {
|
|
131
|
-
if (m.step !== 2 || m.domain === "vehicle" && m.usePaperShellProxy) return;
|
|
132
|
-
let e = !0;
|
|
133
|
-
return $().then((t) => {
|
|
134
|
-
e && Fe(t.bundle);
|
|
135
|
-
}).catch(() => {
|
|
136
|
-
e && Fe(null);
|
|
137
|
-
}), () => {
|
|
138
|
-
e = !1;
|
|
139
|
-
};
|
|
140
|
-
}, [
|
|
141
|
-
m.step,
|
|
142
|
-
m.domain,
|
|
143
|
-
m.usePaperShellProxy,
|
|
144
|
-
$
|
|
145
|
-
]);
|
|
146
|
-
let Ue = async (e) => {
|
|
147
|
-
J(!0);
|
|
148
|
-
try {
|
|
149
|
-
let { baseName: t, scene: n, usdInfo: r } = await ee(e);
|
|
150
|
-
g(t), _(!0), b([
|
|
151
|
-
0,
|
|
152
|
-
0,
|
|
153
|
-
0
|
|
154
|
-
]), xe(0), q([]), m.setField("step", 1), y(n), ye(r), r ? m.setField("usePaperShellProxy", !1) : m.domain === "vehicle" && m.usePaperShellProxy && w(le(n, m.presetId, m.shadingMode)), G(`Imported "${t}" — orient/scale, pop wheels, and chop doors/hood!`);
|
|
155
|
-
} finally {
|
|
156
|
-
J(!1);
|
|
157
|
-
}
|
|
158
|
-
}, We = (e, t, n) => {
|
|
159
|
-
let r = t === "starcraft" ? "starcraft" : "car", i = s(e, r);
|
|
160
|
-
m.setField("domain", e), m.setField("vehicleArchetype", r), m.setField("usePaperShellProxy", n), m.setField("massKg", i.massKg), m.setField("powerOrThrust", i.power), m.setField("step", 1), S(e === "c12" ? ce(i.len) : i.len);
|
|
161
|
-
}, Ge = (e, n) => {
|
|
162
|
-
let r = n ?? M;
|
|
163
|
-
if (m.vehicleArchetype === "starcraft") return;
|
|
164
|
-
if (r === "wheel") {
|
|
165
|
-
O((n) => t(Q, n, e, "car"));
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
if (Ve.has(e)) {
|
|
169
|
-
G("That island is already paired as a wheel.");
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
let i = Q.reduce((e, t) => t.triangleIndices.length > e.triangleIndices.length ? t : e, Q[0]);
|
|
173
|
-
if (Q.length > 1 && e === i.id) {
|
|
174
|
-
G("Main body shell — switch to Crease Flood or Tape Lasso to cut a panel!");
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
let a = F && (r === "door" || r === "fender") ? fe(Q, e, Ve) : null, o = a === null ? [e] : [e, a];
|
|
178
|
-
A((t) => {
|
|
179
|
-
let n = { ...t }, i = t[e] === r;
|
|
180
|
-
for (let e of o) i ? delete n[e] : n[e] = r;
|
|
181
|
-
return G(i ? `Cleared ${r} tag.` : `Tagged ${o.length} piece(s) as ${r} — drag Hinges to test!`), n;
|
|
182
|
-
});
|
|
183
|
-
}, Ke = (e) => {
|
|
184
|
-
let t = Q.find((t) => t.id === e.islandId);
|
|
185
|
-
t && (N === "loop" ? (R(null), B((n) => e.erase ? n && n.points.length > 1 ? {
|
|
186
|
-
...n,
|
|
187
|
-
points: n.points.slice(0, -1)
|
|
188
|
-
} : null : n?.islandId === t.id ? {
|
|
189
|
-
islandId: t.id,
|
|
190
|
-
points: [...n.points, e.point]
|
|
191
|
-
} : {
|
|
192
|
-
islandId: t.id,
|
|
193
|
-
points: [e.point]
|
|
194
|
-
})) : (N === "crease" && !e.isDrag || N === "triangle") && R((n) => pe(t, e.faceIndex, N, {
|
|
195
|
-
creaseDeg: P,
|
|
196
|
-
mirrorX: F,
|
|
197
|
-
current: n,
|
|
198
|
-
remove: e.erase
|
|
199
|
-
})));
|
|
200
|
-
}, qe = () => {
|
|
201
|
-
if (X && z) try {
|
|
202
|
-
let e = i({
|
|
203
|
-
workingScene: X,
|
|
204
|
-
islands: Q,
|
|
205
|
-
loopDots: z,
|
|
206
|
-
splitCoarse: I,
|
|
207
|
-
mirrorX: F,
|
|
208
|
-
axles: D
|
|
209
|
-
});
|
|
210
|
-
e.refinedUndo && e.nextAxles && (W((t) => [...t, {
|
|
211
|
-
undo: e.refinedUndo,
|
|
212
|
-
axles: D,
|
|
213
|
-
picks: k
|
|
214
|
-
}]), O(e.nextAxles), E((e) => e + 1)), R(e.selection), B(null), G("Loop closed — click PEEL to slice those faces into a real part!");
|
|
215
|
-
} catch (e) {
|
|
216
|
-
G(e instanceof Error ? e.message : "Could not close loop.");
|
|
217
|
-
}
|
|
218
|
-
}, Je = (e, t) => {
|
|
219
|
-
if (!X || !e || e.triangles.length === 0) return null;
|
|
220
|
-
let n = o({
|
|
221
|
-
workingScene: X,
|
|
222
|
-
islands: Q,
|
|
223
|
-
faceSelection: e,
|
|
224
|
-
activeRole: t,
|
|
225
|
-
cutName: `${t}_chop_${++Be.current}`,
|
|
226
|
-
prevAxles: D,
|
|
227
|
-
prevPicks: k,
|
|
228
|
-
mode: "car"
|
|
229
|
-
});
|
|
230
|
-
return n.bumpHinge && V === 0 && H(.48), W((e) => [...e, {
|
|
231
|
-
undo: n.undo,
|
|
232
|
-
axles: D,
|
|
233
|
-
picks: k
|
|
234
|
-
}]), O(n.nextAxles), A(n.nextPicks), R(null), B(null), E((e) => e + 1), G(n.status), n;
|
|
235
|
-
};
|
|
10
|
+
function useChopShopController(onSpawnInWorld) {
|
|
11
|
+
const s = useChopShopState();
|
|
12
|
+
const h = createChopShopHandlers(s);
|
|
13
|
+
const axleWheelCount = s.axles.reduce((sum, a) => sum + +(a.left.length > 0) + +(a.right.length > 0), 0);
|
|
14
|
+
const wheelCount = axleWheelCount > 0 ? axleWheelCount : s.wheelCutters.length;
|
|
236
15
|
return {
|
|
237
|
-
st:
|
|
238
|
-
assetName:
|
|
239
|
-
hasCustomFile:
|
|
240
|
-
usdInfo:
|
|
241
|
-
targetMeters:
|
|
242
|
-
setTargetMeters:
|
|
243
|
-
setYOffset:
|
|
244
|
-
setTurns:
|
|
245
|
-
axles:
|
|
246
|
-
setAxles:
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
16
|
+
st: s.st,
|
|
17
|
+
assetName: s.assetName,
|
|
18
|
+
hasCustomFile: s.hasCustomFile,
|
|
19
|
+
usdInfo: s.usdInfo,
|
|
20
|
+
targetMeters: s.targetMeters,
|
|
21
|
+
setTargetMeters: s.setTargetMeters,
|
|
22
|
+
setYOffset: s.setYOffset,
|
|
23
|
+
setTurns: s.setTurns,
|
|
24
|
+
axles: s.axles,
|
|
25
|
+
setAxles: s.setAxles,
|
|
26
|
+
wheelCutters: s.wheelCutters,
|
|
27
|
+
setWheelCutters: s.setWheelCutters,
|
|
28
|
+
partPicks: s.partPicks,
|
|
29
|
+
setPartPicks: s.setPartPicks,
|
|
30
|
+
wheelSource: s.wheelSource,
|
|
31
|
+
setWheelSource: s.setWheelSource,
|
|
32
|
+
activeRole: s.activeRole,
|
|
33
|
+
setActiveRole: s.setActiveRole,
|
|
34
|
+
surfaceMode: s.surfaceMode,
|
|
35
|
+
setSurfaceMode: s.setSurfaceMode,
|
|
36
|
+
creaseDeg: s.creaseDeg,
|
|
37
|
+
setCreaseDeg: s.setCreaseDeg,
|
|
38
|
+
mirrorX: s.mirrorX,
|
|
39
|
+
setMirrorX: h.toggleMirrorX,
|
|
40
|
+
toggleMirrorX: h.toggleMirrorX,
|
|
41
|
+
snapAxles: s.snapAxles,
|
|
42
|
+
setSnapAxles: s.setSnapAxles,
|
|
43
|
+
toggleSnapAxles: h.toggleSnapAxles,
|
|
44
|
+
sealArchLiner: s.sealArchLiner,
|
|
45
|
+
setSealArchLiner: s.setSealArchLiner,
|
|
46
|
+
toggleSealArchLiner: h.toggleSealArchLiner,
|
|
47
|
+
isCored: s.isCored,
|
|
48
|
+
hasPostCorePeels: s.isCored && hasPostCoreUndoEntries(s.undoStack),
|
|
49
|
+
splitCoarse: s.splitCoarse,
|
|
50
|
+
setSplitCoarse: s.setSplitCoarse,
|
|
51
|
+
faceSelection: s.faceSelection,
|
|
52
|
+
setFaceSelection: s.setFaceSelection,
|
|
53
|
+
loopDots: s.loopDots,
|
|
54
|
+
setLoopDots: s.setLoopDots,
|
|
55
|
+
hingeScrub: s.hingeScrub,
|
|
56
|
+
setHingeScrub: s.setHingeScrub,
|
|
57
|
+
explodeAmount: s.explodeAmount,
|
|
58
|
+
setExplodeAmount: s.setExplodeAmount,
|
|
59
|
+
undoStack: s.undoStack,
|
|
60
|
+
statusNote: s.statusNote,
|
|
61
|
+
stampTool: s.stampTool,
|
|
62
|
+
setStampTool: s.setStampTool,
|
|
63
|
+
patches: s.patches,
|
|
64
|
+
setPatches: s.setPatches,
|
|
65
|
+
liveBundle: s.liveBundle,
|
|
66
|
+
busy: s.busy,
|
|
67
|
+
fileRef: s.fileRef,
|
|
68
|
+
rootObjRef: s.rootObjRef,
|
|
69
|
+
panelJointsRef: s.panelJointsRef,
|
|
70
|
+
workingScene: s.workingScene,
|
|
71
|
+
assembly: s.assembly,
|
|
72
|
+
setProxyAssembly: s.setProxyAssembly,
|
|
73
|
+
islands: s.islands,
|
|
74
|
+
wheelColors: s.wheelColors,
|
|
75
|
+
loadStarterCar: s.loadStarterCar,
|
|
76
|
+
ingestFile: h.ingestFile,
|
|
77
|
+
applyDomainDefaults: h.applyDomainDefaults,
|
|
78
|
+
handleBucketIsland: (id) => h.applyBucketIsland(id),
|
|
79
|
+
handlePickFace: h.handlePickFace,
|
|
80
|
+
updateWheelCutter: h.updateWheelCutter,
|
|
81
|
+
commitWheelCutter: h.commitWheelCutter,
|
|
82
|
+
applyWheelCutters: h.applyWheelCutters,
|
|
83
|
+
forgeScene: (label, sc, lenM) => {
|
|
84
|
+
sc.userData.isProceduralLauncher = true;
|
|
85
|
+
s.setAssetName(label);
|
|
86
|
+
s.setRawScene(sc);
|
|
87
|
+
s.setTurns([
|
|
292
88
|
0,
|
|
293
89
|
0,
|
|
294
90
|
0
|
|
295
|
-
])
|
|
91
|
+
]);
|
|
92
|
+
s.setTargetMeters(lenM);
|
|
93
|
+
s.setHasCustomFile(false);
|
|
296
94
|
},
|
|
297
|
-
handleCloseLoop:
|
|
95
|
+
handleCloseLoop: h.handleCloseLoop,
|
|
298
96
|
handlePeelSelection: () => {
|
|
299
97
|
try {
|
|
300
|
-
|
|
301
|
-
} catch (
|
|
302
|
-
|
|
98
|
+
h.peelSelection(s.faceSelection, s.activeRole);
|
|
99
|
+
} catch (err) {
|
|
100
|
+
s.setStatusNote(err instanceof Error ? err.message : "Peel failed.");
|
|
303
101
|
}
|
|
304
102
|
},
|
|
305
|
-
cutPart: (
|
|
306
|
-
req
|
|
307
|
-
workingScene:
|
|
308
|
-
islands:
|
|
309
|
-
creaseDeg:
|
|
310
|
-
mirrorX:
|
|
311
|
-
onPeel:
|
|
312
|
-
|
|
103
|
+
cutPart: (req) => executeCutPartMcp({
|
|
104
|
+
req,
|
|
105
|
+
workingScene: s.workingScene,
|
|
106
|
+
islands: s.islands,
|
|
107
|
+
creaseDeg: s.creaseDeg,
|
|
108
|
+
mirrorX: s.mirrorX,
|
|
109
|
+
onPeel: (sel, role) => {
|
|
110
|
+
const res = h.peelSelection(sel, role);
|
|
111
|
+
return res ? { status: res.status } : null;
|
|
112
|
+
},
|
|
113
|
+
onBucket: h.applyBucketIsland
|
|
313
114
|
}),
|
|
314
115
|
handleUndoCut: () => {
|
|
315
|
-
|
|
316
|
-
|
|
116
|
+
const top = s.undoStack[s.undoStack.length - 1];
|
|
117
|
+
if (!top) return;
|
|
118
|
+
top.undo();
|
|
119
|
+
s.setUndoStack((prev) => prev.slice(0, -1));
|
|
120
|
+
s.setAxles(top.axles);
|
|
121
|
+
s.setPartPicks(top.picks);
|
|
122
|
+
if (top.cutters !== void 0) {
|
|
123
|
+
s.setWheelCutters(top.cutters);
|
|
124
|
+
s.setIsCored(false);
|
|
125
|
+
}
|
|
126
|
+
s.setFaceSelection(null);
|
|
127
|
+
s.setLoopDots(null);
|
|
128
|
+
s.setCutVersion((v) => v + 1);
|
|
129
|
+
s.setStatusNote("Undid last cut.");
|
|
317
130
|
},
|
|
318
|
-
sealAndExport: async (
|
|
319
|
-
|
|
131
|
+
sealAndExport: async (spawnInWorld) => {
|
|
132
|
+
s.setBusy(true);
|
|
320
133
|
try {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
id: `${
|
|
324
|
-
label:
|
|
325
|
-
kind:
|
|
326
|
-
domain:
|
|
327
|
-
glbBytes:
|
|
328
|
-
bundle:
|
|
329
|
-
})
|
|
134
|
+
const baked = await s.runBake();
|
|
135
|
+
if (spawnInWorld && onSpawnInWorld) onSpawnInWorld({
|
|
136
|
+
id: `${s.assetName.toLowerCase().replace(/[^a-z0-9]+/g, "_")}_${Date.now().toString(36)}`,
|
|
137
|
+
label: s.assetName,
|
|
138
|
+
kind: baked.worldKind,
|
|
139
|
+
domain: s.st.domain,
|
|
140
|
+
glbBytes: baked.glbBytes,
|
|
141
|
+
bundle: baked.bundle
|
|
142
|
+
});
|
|
143
|
+
else downloadBlobGlb(s.assetName, baked.glbBytes);
|
|
330
144
|
} finally {
|
|
331
|
-
|
|
145
|
+
s.setBusy(false);
|
|
332
146
|
}
|
|
333
147
|
},
|
|
334
|
-
uploadToVault: async (
|
|
335
|
-
|
|
148
|
+
uploadToVault: async (category, token) => {
|
|
149
|
+
s.setBusy(true);
|
|
336
150
|
try {
|
|
337
|
-
|
|
338
|
-
return await
|
|
151
|
+
const baked = await s.runBake();
|
|
152
|
+
return await putAuthenticatedVaultGlb(category, s.assetName, baked.glbBytes, token);
|
|
339
153
|
} finally {
|
|
340
|
-
|
|
154
|
+
s.setBusy(false);
|
|
341
155
|
}
|
|
342
156
|
},
|
|
343
157
|
handleStampSurface: (e) => {
|
|
344
|
-
|
|
345
|
-
|
|
158
|
+
const patch = buildSurfaceStampPatch(e, s.stampTool, s.patches.length + 1);
|
|
159
|
+
if (patch) s.setPatches((prev) => [...prev, patch]);
|
|
346
160
|
},
|
|
347
|
-
wheelCount
|
|
348
|
-
choppedCount: Object.keys(
|
|
349
|
-
unlocked:
|
|
350
|
-
activeRoleColor:
|
|
351
|
-
bumpTurn: (
|
|
352
|
-
|
|
353
|
-
|
|
161
|
+
wheelCount,
|
|
162
|
+
choppedCount: Object.keys(s.partPicks).length,
|
|
163
|
+
unlocked: isGateStep1Unlocked(s.st.calibration, s.st.domain, s.st.vehicleArchetype, s.st.usePaperShellProxy),
|
|
164
|
+
activeRoleColor: CHOP_ROLES.find((r) => r.role === s.activeRole)?.color ?? "#FFB000",
|
|
165
|
+
bumpTurn: (ax) => s.setTurns((prev) => {
|
|
166
|
+
const next = [
|
|
167
|
+
prev[0],
|
|
168
|
+
prev[1],
|
|
169
|
+
prev[2]
|
|
170
|
+
];
|
|
171
|
+
next[ax] = (next[ax] + 1) % 4;
|
|
172
|
+
return next;
|
|
354
173
|
}),
|
|
355
|
-
wrapProxy:
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
autoPopWheels: () => O(e(Q)),
|
|
360
|
-
autoScaleSi: () => S(s(m.domain, m.vehicleArchetype).len),
|
|
361
|
-
snapC12: () => S((e) => ce(e))
|
|
174
|
+
wrapProxy: h.wrapProxy,
|
|
175
|
+
autoPopWheels: h.autoPopWheels,
|
|
176
|
+
autoScaleSi: () => s.setTargetMeters(defaultTargetMeters(s.st.domain, s.st.vehicleArchetype).len),
|
|
177
|
+
snapC12: () => s.setTargetMeters((m) => snapMetersToC12(m))
|
|
362
178
|
};
|
|
363
179
|
}
|
|
364
|
-
export {
|
|
180
|
+
export { useChopShopController };
|
|
181
|
+
|
|
182
|
+
//# sourceMappingURL=useChopShopController.js.map
|