@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,275 +1,204 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
1
|
+
import { Step1ExplodedIslands } from "./Step1ExplodedIslands.js";
|
|
2
|
+
import { WheelRingHandles3D } from "./WheelRingHandles3D.js";
|
|
3
|
+
import { useGateStore } from "./gateStore.js";
|
|
4
|
+
import { makeStarterDomainScene } from "./starterScene.js";
|
|
5
|
+
import { previewLoopPolyline } from "./surfaceCutter.js";
|
|
6
|
+
import { buildSelectionOverlayGeometry, createFleet12GonWheelGroup } from "./surfacePeel.js";
|
|
7
|
+
import { measureSelection } from "./wheelAxlePairing.js";
|
|
8
|
+
import { useEffect, useMemo, useRef } from "react";
|
|
9
|
+
import * as THREE from "three";
|
|
10
|
+
import { Bounds, Bvh } from "@react-three/drei";
|
|
11
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
12
|
// src/importer/Step1CalibrationPlinth.tsx
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
function makeBufferGeo(pos, norm) {
|
|
14
|
+
const geo = new THREE.BufferGeometry();
|
|
15
|
+
geo.setAttribute("position", new THREE.BufferAttribute(pos, 3));
|
|
16
|
+
geo.setAttribute("normal", new THREE.BufferAttribute(norm, 3));
|
|
17
|
+
return geo;
|
|
15
18
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
function shouldShowWheelRings(opts) {
|
|
20
|
+
return opts.domain === "vehicle" && !opts.useProxy && opts.wheelSource !== "fleet12" && opts.wheelCuttersCount > 0 && opts.hasOnChangeCutter && !opts.hasPostCoreEdits;
|
|
21
|
+
}
|
|
22
|
+
function Step1CalibrationPlinth(p) {
|
|
23
|
+
const cal = useGateStore((s) => s.calibration);
|
|
24
|
+
const storeDomain = useGateStore((s) => s.domain);
|
|
25
|
+
const draggingRef = useRef(false);
|
|
26
|
+
const panelGeos = useMemo(() => p.assembly.panels.map((pan) => makeBufferGeo(pan.localPositions, pan.localNormals)), [p.assembly]);
|
|
27
|
+
const wheelGeo = useMemo(() => makeBufferGeo(p.assembly.wheels[0].positions, p.assembly.wheels[0].normals), [p.assembly]);
|
|
28
|
+
useEffect(() => () => {
|
|
29
|
+
for (const g of panelGeos) g.dispose();
|
|
30
|
+
wheelGeo.dispose();
|
|
31
|
+
}, [panelGeos, wheelGeo]);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
const up = () => {
|
|
34
|
+
draggingRef.current = false;
|
|
25
35
|
};
|
|
26
|
-
|
|
36
|
+
window.addEventListener("pointerup", up);
|
|
37
|
+
return () => window.removeEventListener("pointerup", up);
|
|
27
38
|
}, []);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
for (
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
key: `f12_${
|
|
47
|
-
pos:
|
|
48
|
-
group:
|
|
39
|
+
const selIsland = useMemo(() => p.faceSelection ? p.islands.find((isl) => isl.id === p.faceSelection.islandId) ?? null : null, [p.faceSelection, p.islands]);
|
|
40
|
+
const primaryOverlayGeo = useMemo(() => selIsland && p.faceSelection && p.faceSelection.triangles.length > 0 ? buildSelectionOverlayGeometry(selIsland.geometry, p.faceSelection.triangles, .0045) : null, [selIsland, p.faceSelection]);
|
|
41
|
+
const mirrorOverlayGeo = useMemo(() => selIsland && p.faceSelection && p.faceSelection.mirrored.length > 0 ? buildSelectionOverlayGeometry(selIsland.geometry, p.faceSelection.mirrored, .0045) : null, [selIsland, p.faceSelection]);
|
|
42
|
+
useEffect(() => () => primaryOverlayGeo?.dispose(), [primaryOverlayGeo]);
|
|
43
|
+
useEffect(() => () => mirrorOverlayGeo?.dispose(), [mirrorOverlayGeo]);
|
|
44
|
+
const loopPolyline = useMemo(() => {
|
|
45
|
+
if (!p.loopDots || p.loopDots.points.length < 2) return null;
|
|
46
|
+
const isl = p.islands.find((i) => i.id === p.loopDots.islandId);
|
|
47
|
+
return isl ? previewLoopPolyline(isl, p.loopDots.points) : null;
|
|
48
|
+
}, [p.loopDots, p.islands]);
|
|
49
|
+
const fleetWheels = useMemo(() => {
|
|
50
|
+
if (p.wheelSource !== "fleet12" || p.islands.length === 0) return [];
|
|
51
|
+
const items = [];
|
|
52
|
+
p.axles.forEach((ax, idx) => {
|
|
53
|
+
for (const [side, ids] of [["L", ax.left], ["R", ax.right]]) {
|
|
54
|
+
if (ids.length === 0) continue;
|
|
55
|
+
const bounds = measureSelection(p.islands, ids);
|
|
56
|
+
items.push({
|
|
57
|
+
key: `f12_${idx}_${side}`,
|
|
58
|
+
pos: bounds.center,
|
|
59
|
+
group: createFleet12GonWheelGroup(Math.max(.14, bounds.radius), Math.max(.1, bounds.halfWidth * 2))
|
|
49
60
|
});
|
|
50
61
|
}
|
|
51
|
-
})
|
|
62
|
+
});
|
|
63
|
+
return items;
|
|
52
64
|
}, [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
p.wheelSource,
|
|
66
|
+
p.axles,
|
|
67
|
+
p.islands
|
|
56
68
|
]);
|
|
57
|
-
|
|
58
|
-
for (
|
|
59
|
-
|
|
60
|
-
|
|
69
|
+
useEffect(() => () => {
|
|
70
|
+
for (const fw of fleetWheels) fw.group.traverse((obj) => {
|
|
71
|
+
const m = obj;
|
|
72
|
+
m.geometry?.dispose();
|
|
73
|
+
if (m.material) for (const mat of Array.isArray(m.material) ? m.material : [m.material]) mat.dispose();
|
|
61
74
|
});
|
|
62
|
-
}, [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
75
|
+
}, [fleetWheels]);
|
|
76
|
+
const emitPick = (ev, islandId, isDrag) => {
|
|
77
|
+
if (ev.faceIndex == null) return;
|
|
78
|
+
ev.stopPropagation();
|
|
79
|
+
p.onPickFace({
|
|
80
|
+
islandId,
|
|
81
|
+
faceIndex: ev.faceIndex,
|
|
67
82
|
point: [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
83
|
+
ev.point.x,
|
|
84
|
+
ev.point.y,
|
|
85
|
+
ev.point.z
|
|
71
86
|
],
|
|
72
|
-
erase: !!(
|
|
73
|
-
isDrag
|
|
74
|
-
})
|
|
87
|
+
erase: !!(ev.altKey || ev.button === 2),
|
|
88
|
+
isDrag
|
|
89
|
+
});
|
|
75
90
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
91
|
+
const showRings = shouldShowWheelRings({
|
|
92
|
+
domain: p.domain ?? storeDomain,
|
|
93
|
+
useProxy: p.useProxy,
|
|
94
|
+
wheelSource: p.wheelSource,
|
|
95
|
+
wheelCuttersCount: p.wheelCutters?.length ?? 0,
|
|
96
|
+
hasOnChangeCutter: !!p.onChangeCutter,
|
|
97
|
+
hasPostCoreEdits: p.hasPostCoreEdits
|
|
98
|
+
});
|
|
99
|
+
return /* @__PURE__ */ jsxs(Bounds, {
|
|
100
|
+
fit: true,
|
|
101
|
+
clip: true,
|
|
79
102
|
margin: 1.38,
|
|
80
|
-
children: /* @__PURE__ */
|
|
81
|
-
|
|
82
|
-
children: [
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}, e.partId)),
|
|
98
|
-
n.assembly.wheels.map((e) => /* @__PURE__ */ _("group", {
|
|
99
|
-
position: e.position,
|
|
100
|
-
children: /* @__PURE__ */ _("mesh", {
|
|
101
|
-
geometry: C,
|
|
102
|
-
children: /* @__PURE__ */ _("meshStandardMaterial", {
|
|
103
|
-
color: 1843753,
|
|
104
|
-
roughness: .9,
|
|
105
|
-
flatShading: !0
|
|
103
|
+
children: [/* @__PURE__ */ jsxs("group", {
|
|
104
|
+
ref: p.rootObjRef,
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ jsx(Bvh, {
|
|
107
|
+
firstHitOnly: true,
|
|
108
|
+
children: p.useProxy ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
109
|
+
p.previewScene && /* @__PURE__ */ jsx("primitive", { object: p.previewScene }),
|
|
110
|
+
p.assembly.panels.map((pan, idx) => /* @__PURE__ */ jsx("mesh", {
|
|
111
|
+
position: pan.anchorChassis,
|
|
112
|
+
geometry: panelGeos[idx],
|
|
113
|
+
children: /* @__PURE__ */ jsx("meshStandardMaterial", {
|
|
114
|
+
color: pan.colorHex,
|
|
115
|
+
roughness: pan.isGlass ? .15 : .88,
|
|
116
|
+
transparent: pan.isGlass || !!p.previewScene,
|
|
117
|
+
opacity: p.previewScene ? .28 : pan.isGlass ? .32 : 1,
|
|
118
|
+
wireframe: !!p.previewScene,
|
|
119
|
+
flatShading: p.assembly.shadingMode === "psx-flat"
|
|
106
120
|
})
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
], s = [
|
|
118
|
-
0,
|
|
119
|
-
0,
|
|
120
|
-
0
|
|
121
|
-
], c = new f.Quaternion();
|
|
122
|
-
if (r && (n.hingeScrub > 0 || n.explodeAmount > 0)) {
|
|
123
|
-
let t = i(e, r);
|
|
124
|
-
s = t.anchor, n.hingeScrub > 0 && c.setFromAxisAngle(new f.Vector3(...t.axis).normalize(), t.openAngle * n.hingeScrub), n.explodeAmount > 0 && (o = [
|
|
125
|
-
t.explodeDir[0] * n.explodeAmount,
|
|
126
|
-
t.explodeDir[1] * n.explodeAmount,
|
|
127
|
-
t.explodeDir[2] * n.explodeAmount
|
|
128
|
-
]);
|
|
129
|
-
} else t && n.explodeAmount > 0 && (o = [
|
|
130
|
-
Math.sign(e.center[0] || 1) * n.explodeAmount * .65,
|
|
131
|
-
0,
|
|
132
|
-
0
|
|
133
|
-
]);
|
|
134
|
-
return /* @__PURE__ */ _("group", {
|
|
135
|
-
position: [
|
|
136
|
-
s[0] + o[0],
|
|
137
|
-
s[1] + o[1],
|
|
138
|
-
s[2] + o[2]
|
|
139
|
-
],
|
|
140
|
-
quaternion: c,
|
|
141
|
-
children: /* @__PURE__ */ v("group", {
|
|
142
|
-
position: [
|
|
143
|
-
-s[0],
|
|
144
|
-
-s[1],
|
|
145
|
-
-s[2]
|
|
146
|
-
],
|
|
147
|
-
children: [/* @__PURE__ */ _("mesh", {
|
|
148
|
-
geometry: e.geometry,
|
|
149
|
-
material: e.material,
|
|
150
|
-
onClick: (t) => {
|
|
151
|
-
t.delta > 5 || (n.surfaceMode === "island" ? (t.stopPropagation(), n.onClickIsland(e.id)) : n.surfaceMode !== "triangle" && k(t, e.id, !1));
|
|
152
|
-
},
|
|
153
|
-
onContextMenu: (t) => {
|
|
154
|
-
n.surfaceMode !== "island" && k(t, e.id, !1);
|
|
155
|
-
},
|
|
156
|
-
onPointerDown: (t) => {
|
|
157
|
-
n.surfaceMode === "triangle" && (t.button === 0 || t.button === 2) && (x.current = !0, k(t, e.id, !1));
|
|
158
|
-
},
|
|
159
|
-
onPointerMove: (t) => {
|
|
160
|
-
n.surfaceMode === "triangle" && x.current && k(t, e.id, !0);
|
|
161
|
-
}
|
|
162
|
-
}), a && /* @__PURE__ */ _("mesh", {
|
|
163
|
-
geometry: e.geometry,
|
|
164
|
-
raycast: () => null,
|
|
165
|
-
children: /* @__PURE__ */ _("meshBasicMaterial", {
|
|
166
|
-
color: a,
|
|
167
|
-
transparent: !0,
|
|
168
|
-
opacity: .38,
|
|
169
|
-
depthWrite: !1
|
|
170
|
-
})
|
|
171
|
-
})]
|
|
121
|
+
}, pan.partId)),
|
|
122
|
+
p.assembly.wheels.map((w) => /* @__PURE__ */ jsx("group", {
|
|
123
|
+
position: w.position,
|
|
124
|
+
children: /* @__PURE__ */ jsx("mesh", {
|
|
125
|
+
geometry: wheelGeo,
|
|
126
|
+
children: /* @__PURE__ */ jsx("meshStandardMaterial", {
|
|
127
|
+
color: 1843497,
|
|
128
|
+
roughness: .9,
|
|
129
|
+
flatShading: true
|
|
130
|
+
})
|
|
172
131
|
})
|
|
173
|
-
},
|
|
174
|
-
}),
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
depthWrite: !1
|
|
203
|
-
})
|
|
204
|
-
}),
|
|
205
|
-
n.loopDots?.points.map((e, t) => /* @__PURE__ */ v("mesh", {
|
|
206
|
-
position: [
|
|
207
|
-
e[0],
|
|
208
|
-
e[1],
|
|
209
|
-
e[2]
|
|
210
|
-
],
|
|
211
|
-
raycast: () => null,
|
|
212
|
-
children: [/* @__PURE__ */ _("sphereGeometry", { args: [
|
|
213
|
-
.032,
|
|
214
|
-
10,
|
|
215
|
-
10
|
|
216
|
-
] }), /* @__PURE__ */ _("meshBasicMaterial", {
|
|
217
|
-
color: t === 0 ? "#10B981" : "#FFB000",
|
|
218
|
-
depthTest: !1
|
|
219
|
-
})]
|
|
220
|
-
}, `dot_${t}`)),
|
|
221
|
-
D && D.length >= 2 && /* @__PURE__ */ _(h, {
|
|
222
|
-
points: D,
|
|
223
|
-
color: "#FFB000",
|
|
224
|
-
lineWidth: 2.5
|
|
225
|
-
})
|
|
226
|
-
] }) : n.previewScene && /* @__PURE__ */ _("primitive", { object: n.previewScene }), /* @__PURE__ */ v("mesh", {
|
|
132
|
+
}, w.slotId))
|
|
133
|
+
] }) : p.islands.length > 0 ? /* @__PURE__ */ jsx(Step1ExplodedIslands, {
|
|
134
|
+
islands: p.islands,
|
|
135
|
+
wheelColors: p.wheelColors,
|
|
136
|
+
partPicks: p.partPicks,
|
|
137
|
+
wheelSource: p.wheelSource,
|
|
138
|
+
surfaceMode: p.surfaceMode,
|
|
139
|
+
activeRoleColor: p.activeRoleColor,
|
|
140
|
+
hingeScrub: p.hingeScrub,
|
|
141
|
+
explodeAmount: p.explodeAmount,
|
|
142
|
+
fleetWheels,
|
|
143
|
+
primaryOverlayGeo,
|
|
144
|
+
mirrorOverlayGeo,
|
|
145
|
+
loopDots: p.loopDots,
|
|
146
|
+
loopPolyline,
|
|
147
|
+
draggingRef,
|
|
148
|
+
onClickIsland: p.onClickIsland,
|
|
149
|
+
onEmitPick: emitPick
|
|
150
|
+
}) : p.previewScene && /* @__PURE__ */ jsx("primitive", { object: p.previewScene })
|
|
151
|
+
}),
|
|
152
|
+
showRings && /* @__PURE__ */ jsx(WheelRingHandles3D, {
|
|
153
|
+
cutters: p.wheelCutters,
|
|
154
|
+
mirrorX: p.mirrorX ?? true,
|
|
155
|
+
snapAxles: p.snapAxles ?? true,
|
|
156
|
+
onChangeCutter: p.onChangeCutter,
|
|
157
|
+
onCommitCutter: p.onCommitCutter,
|
|
158
|
+
onDragChange: p.onRingDragChange
|
|
159
|
+
}),
|
|
160
|
+
/* @__PURE__ */ jsxs("mesh", {
|
|
227
161
|
position: [
|
|
228
162
|
0,
|
|
229
|
-
|
|
163
|
+
cal.aabbSize[1] * .5 + cal.minY,
|
|
230
164
|
0
|
|
231
165
|
],
|
|
232
166
|
raycast: () => null,
|
|
233
|
-
children: [/* @__PURE__ */
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
] }), /* @__PURE__ */
|
|
167
|
+
children: [/* @__PURE__ */ jsx("boxGeometry", { args: [
|
|
168
|
+
cal.aabbSize[0],
|
|
169
|
+
cal.aabbSize[1],
|
|
170
|
+
cal.aabbSize[2]
|
|
171
|
+
] }), /* @__PURE__ */ jsx("meshBasicMaterial", {
|
|
238
172
|
color: 58879,
|
|
239
|
-
wireframe:
|
|
240
|
-
transparent:
|
|
241
|
-
opacity: .
|
|
173
|
+
wireframe: true,
|
|
174
|
+
transparent: true,
|
|
175
|
+
opacity: .22
|
|
242
176
|
})]
|
|
243
|
-
})
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
]
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
177
|
+
})
|
|
178
|
+
]
|
|
179
|
+
}), /* @__PURE__ */ jsxs("mesh", {
|
|
180
|
+
position: [
|
|
181
|
+
0,
|
|
182
|
+
.01,
|
|
183
|
+
Math.max(2.6, cal.aabbSize[2] * .6)
|
|
184
|
+
],
|
|
185
|
+
rotation: [
|
|
186
|
+
-Math.PI * .5,
|
|
187
|
+
0,
|
|
188
|
+
0
|
|
189
|
+
],
|
|
190
|
+
raycast: () => null,
|
|
191
|
+
children: [/* @__PURE__ */ jsx("coneGeometry", { args: [
|
|
192
|
+
.25,
|
|
193
|
+
.6,
|
|
194
|
+
3
|
|
195
|
+
] }), /* @__PURE__ */ jsx("meshBasicMaterial", {
|
|
196
|
+
color: 58879,
|
|
197
|
+
wireframe: true
|
|
264
198
|
})]
|
|
265
|
-
})
|
|
266
|
-
})
|
|
267
|
-
cal: r,
|
|
268
|
-
islands: n.islands,
|
|
269
|
-
wheelColors: n.wheelColors,
|
|
270
|
-
partPicks: n.partPicks,
|
|
271
|
-
explodeAmount: n.explodeAmount,
|
|
272
|
-
onClickIsland: n.onClickIsland
|
|
273
|
-
})] });
|
|
199
|
+
})]
|
|
200
|
+
});
|
|
274
201
|
}
|
|
275
|
-
export {
|
|
202
|
+
export { Step1CalibrationPlinth, makeStarterDomainScene, shouldShowWheelRings };
|
|
203
|
+
|
|
204
|
+
//# sourceMappingURL=Step1CalibrationPlinth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Step1CalibrationPlinth.js","names":["_Fragment"],"sources":["../../src/importer/Step1CalibrationPlinth.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useRef } from \"react\";\nimport * as THREE from \"three\";\nimport { Bounds, Bvh } from \"@react-three/drei\";\nimport type { ThreeEvent } from \"@react-three/fiber\";\nimport type { PaperShellAssembly } from \"@khr3/vehicles/paper-shell\";\nimport { Step1ExplodedIslands } from \"./Step1ExplodedIslands.js\";\nimport { WheelRingHandles3D } from \"./WheelRingHandles3D.js\";\nimport { useGateStore, type GateDomain } from \"./gateStore.js\";\nimport type { WheelVisualSource } from \"./khrCompiler.js\";\nimport type { MeshIsland, WheelAxle } from \"./meshIslands.js\";\nimport { makeStarterDomainScene } from \"./starterScene.js\";\nimport {\n buildSelectionOverlayGeometry,\n createFleet12GonWheelGroup,\n previewLoopPolyline,\n type ChopPartRole,\n type CutVec3,\n type FaceSelection,\n type SurfaceSelectMode,\n} from \"./surfaceCutter.js\";\nimport { measureSelection } from \"./wheelAxlePairing.js\";\nimport type { WheelCutterId, WheelCutterSpec } from \"./wheelCutterHelpers.js\";\n\nexport { makeStarterDomainScene };\n\nexport interface Step1FaceHit {\n readonly islandId: number;\n readonly faceIndex: number;\n readonly point: [number, number, number];\n readonly erase: boolean;\n readonly isDrag: boolean;\n}\n\nexport interface Step1CalibrationPlinthProps {\n readonly domain?: GateDomain;\n readonly assembly: PaperShellAssembly;\n readonly useProxy: boolean;\n readonly previewScene: THREE.Group | null;\n readonly islands: readonly MeshIsland[];\n readonly axles: readonly WheelAxle[];\n readonly wheelColors: ReadonlyMap<number, string>;\n readonly partPicks: Readonly<Record<number, ChopPartRole>>;\n readonly wheelSource: WheelVisualSource;\n readonly surfaceMode: SurfaceSelectMode;\n readonly activeRoleColor: string;\n readonly faceSelection: FaceSelection | null;\n readonly loopDots: {\n readonly islandId: number;\n readonly points: readonly CutVec3[];\n } | null;\n readonly hingeScrub: number;\n readonly explodeAmount: number;\n readonly onClickIsland: (id: number) => void;\n readonly onPickFace: (hit: Step1FaceHit) => void;\n readonly rootObjRef: React.RefObject<THREE.Group | null>;\n readonly wheelCutters?: readonly WheelCutterSpec[];\n readonly mirrorX?: boolean;\n readonly snapAxles?: boolean;\n readonly onChangeCutter?: (id: WheelCutterId, next: WheelCutterSpec) => void;\n readonly onCommitCutter?: (id: WheelCutterId, next: WheelCutterSpec) => void;\n readonly onRingDragChange?: (dragging: boolean) => void;\n readonly hasPostCoreEdits?: boolean;\n}\n\nfunction makeBufferGeo(pos: Float32Array, norm: Float32Array): THREE.BufferGeometry {\n const geo = new THREE.BufferGeometry();\n geo.setAttribute(\"position\", new THREE.BufferAttribute(pos, 3));\n geo.setAttribute(\"normal\", new THREE.BufferAttribute(norm, 3));\n return geo;\n}\n\nexport function shouldShowWheelRings(opts: {\n readonly domain: GateDomain; readonly useProxy: boolean;\n readonly wheelSource: WheelVisualSource; readonly wheelCuttersCount: number; readonly hasOnChangeCutter: boolean; readonly hasPostCoreEdits?: boolean;\n}): boolean {\n return opts.domain === \"vehicle\" && !opts.useProxy && opts.wheelSource !== \"fleet12\" && opts.wheelCuttersCount > 0 && opts.hasOnChangeCutter && !opts.hasPostCoreEdits;\n}\n\nexport function Step1CalibrationPlinth(p: Step1CalibrationPlinthProps): React.JSX.Element {\n const cal = useGateStore((s) => s.calibration);\n const storeDomain = useGateStore((s) => s.domain);\n const draggingRef = useRef(false);\n\n const panelGeos = useMemo(\n () => p.assembly.panels.map((pan) => makeBufferGeo(pan.localPositions, pan.localNormals)),\n [p.assembly],\n );\n const wheelGeo = useMemo(\n () => makeBufferGeo(p.assembly.wheels[0].positions, p.assembly.wheels[0].normals),\n [p.assembly],\n );\n\n useEffect(() => () => {\n for (const g of panelGeos) g.dispose();\n wheelGeo.dispose();\n }, [panelGeos, wheelGeo]);\n\n useEffect(() => {\n const up = (): void => { draggingRef.current = false; };\n window.addEventListener(\"pointerup\", up);\n return () => window.removeEventListener(\"pointerup\", up);\n }, []);\n\n const selIsland = useMemo(\n () => (p.faceSelection ? p.islands.find((isl) => isl.id === p.faceSelection!.islandId) ?? null : null),\n [p.faceSelection, p.islands],\n );\n const primaryOverlayGeo = useMemo(\n () => selIsland && p.faceSelection && p.faceSelection.triangles.length > 0\n ? buildSelectionOverlayGeometry(selIsland.geometry, p.faceSelection.triangles, 0.0045)\n : null,\n [selIsland, p.faceSelection],\n );\n const mirrorOverlayGeo = useMemo(\n () => selIsland && p.faceSelection && p.faceSelection.mirrored.length > 0\n ? buildSelectionOverlayGeometry(selIsland.geometry, p.faceSelection.mirrored, 0.0045)\n : null,\n [selIsland, p.faceSelection],\n );\n\n useEffect(() => () => primaryOverlayGeo?.dispose(), [primaryOverlayGeo]);\n useEffect(() => () => mirrorOverlayGeo?.dispose(), [mirrorOverlayGeo]);\n\n const loopPolyline = useMemo(() => {\n if (!p.loopDots || p.loopDots.points.length < 2) return null;\n const isl = p.islands.find((i) => i.id === p.loopDots!.islandId);\n return isl ? previewLoopPolyline(isl, p.loopDots.points) : null;\n }, [p.loopDots, p.islands]);\n\n const fleetWheels = useMemo(() => {\n if (p.wheelSource !== \"fleet12\" || p.islands.length === 0) return [];\n const items: { key: string; pos: [number, number, number]; group: THREE.Group }[] = [];\n p.axles.forEach((ax, idx) => {\n for (const [side, ids] of [[\"L\", ax.left], [\"R\", ax.right]] as const) {\n if (ids.length === 0) continue;\n const bounds = measureSelection(p.islands, ids);\n items.push({\n key: `f12_${idx}_${side}`,\n pos: bounds.center,\n group: createFleet12GonWheelGroup(Math.max(0.14, bounds.radius), Math.max(0.1, bounds.halfWidth * 2)),\n });\n }\n });\n return items;\n }, [p.wheelSource, p.axles, p.islands]);\n\n useEffect(() => () => {\n for (const fw of fleetWheels) {\n fw.group.traverse((obj) => {\n const m = obj as THREE.Mesh;\n m.geometry?.dispose();\n if (m.material) for (const mat of Array.isArray(m.material) ? m.material : [m.material]) mat.dispose();\n });\n }\n }, [fleetWheels]);\n\n const emitPick = (ev: ThreeEvent<PointerEvent | MouseEvent>, islandId: number, isDrag: boolean): void => {\n if (ev.faceIndex == null) return;\n ev.stopPropagation();\n p.onPickFace({\n islandId,\n faceIndex: ev.faceIndex,\n point: [ev.point.x, ev.point.y, ev.point.z],\n erase: !!(ev.altKey || ev.button === 2),\n isDrag,\n });\n };\n\n const showRings = shouldShowWheelRings({ domain: p.domain ?? storeDomain, useProxy: p.useProxy, wheelSource: p.wheelSource, wheelCuttersCount: p.wheelCutters?.length ?? 0, hasOnChangeCutter: !!p.onChangeCutter, hasPostCoreEdits: p.hasPostCoreEdits });\n\n return (\n <Bounds fit clip margin={1.38}>\n <group ref={p.rootObjRef}>\n <Bvh firstHitOnly>\n {p.useProxy ? (\n <>\n {p.previewScene && <primitive object={p.previewScene} />}\n {p.assembly.panels.map((pan, idx) => (\n <mesh key={pan.partId} position={pan.anchorChassis} geometry={panelGeos[idx]}>\n <meshStandardMaterial\n color={pan.colorHex}\n roughness={pan.isGlass ? 0.15 : 0.88}\n transparent={pan.isGlass || !!p.previewScene}\n opacity={p.previewScene ? 0.28 : pan.isGlass ? 0.32 : 1}\n wireframe={!!p.previewScene}\n flatShading={p.assembly.shadingMode === \"psx-flat\"}\n />\n </mesh>\n ))}\n {p.assembly.wheels.map((w) => (\n <group key={w.slotId} position={w.position}>\n <mesh geometry={wheelGeo}><meshStandardMaterial color={0x1c2129} roughness={0.9} flatShading /></mesh>\n </group>\n ))}\n </>\n ) : p.islands.length > 0 ? (\n <Step1ExplodedIslands\n islands={p.islands}\n wheelColors={p.wheelColors}\n partPicks={p.partPicks}\n wheelSource={p.wheelSource}\n surfaceMode={p.surfaceMode}\n activeRoleColor={p.activeRoleColor}\n hingeScrub={p.hingeScrub}\n explodeAmount={p.explodeAmount}\n fleetWheels={fleetWheels}\n primaryOverlayGeo={primaryOverlayGeo}\n mirrorOverlayGeo={mirrorOverlayGeo}\n loopDots={p.loopDots}\n loopPolyline={loopPolyline}\n draggingRef={draggingRef}\n onClickIsland={p.onClickIsland}\n onEmitPick={emitPick}\n />\n ) : (\n p.previewScene && <primitive object={p.previewScene} />\n )}\n </Bvh>\n\n {showRings && (\n <WheelRingHandles3D\n cutters={p.wheelCutters!}\n mirrorX={p.mirrorX ?? true}\n snapAxles={p.snapAxles ?? true}\n onChangeCutter={p.onChangeCutter!}\n onCommitCutter={p.onCommitCutter}\n onDragChange={p.onRingDragChange}\n />\n )}\n\n <mesh position={[0, cal.aabbSize[1] * 0.5 + cal.minY, 0]} raycast={() => null}>\n <boxGeometry args={[cal.aabbSize[0], cal.aabbSize[1], cal.aabbSize[2]]} />\n <meshBasicMaterial color={0x00e5ff} wireframe transparent opacity={0.22} />\n </mesh>\n </group>\n\n <mesh position={[0, 0.01, Math.max(2.6, cal.aabbSize[2] * 0.6)]} rotation={[-Math.PI * 0.5, 0, 0]} raycast={() => null}>\n <coneGeometry args={[0.25, 0.6, 3]} />\n <meshBasicMaterial color={0x00e5ff} wireframe />\n </mesh>\n </Bounds>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAgEA,SAAS,cAAc,KAAmB,MAA0C;CAChF,MAAM,MAAM,IAAI,MAAM,eAAe;CACrC,IAAI,aAAa,YAAY,IAAI,MAAM,gBAAgB,KAAK,CAAC,CAAC;CAC9D,IAAI,aAAa,UAAU,IAAI,MAAM,gBAAgB,MAAM,CAAC,CAAC;CAC7D,OAAO;AACX;AAEA,SAAgB,qBAAqB,MAGzB;CACR,OAAO,KAAK,WAAW,aAAa,CAAC,KAAK,YAAY,KAAK,gBAAgB,aAAa,KAAK,oBAAoB,KAAK,KAAK,qBAAqB,CAAC,KAAK;AAC1J;AAEA,SAAgB,uBAAuB,GAAmD;CACtF,MAAM,MAAM,cAAc,MAAM,EAAE,WAAW;CAC7C,MAAM,cAAc,cAAc,MAAM,EAAE,MAAM;CAChD,MAAM,cAAc,OAAO,KAAK;CAEhC,MAAM,YAAY,cACR,EAAE,SAAS,OAAO,KAAK,QAAQ,cAAc,IAAI,gBAAgB,IAAI,YAAY,CAAC,GACxF,CAAC,EAAE,QAAQ,CACf;CACA,MAAM,WAAW,cACP,cAAc,EAAE,SA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,IAED,EAAE,gBAAgB,oBAAC,aAAD,EAAW,QAAQ,EAAE,aAAe,CAAA;IAEzD,CAAA;IAEJ,aACG,oBAAC,oBAAD;KACI,SAAS,EAAE;KACX,SAAS,EAAE,WAAW;KACtB,WAAW,EAAE,aAAa;KAC1B,gBAAgB,EAAE;KAClB,gBAAgB,EAAE;KAClB,cAAc,EAAE;IACnB,CAAA;IAGL,qBAAC,QAAD;KAAM,UAAU;MAAC;MAAG,IAAI,SAAS,KAAK,KAAM,IAAI;MAAM;KAAC;KAAG,eAAe;KAAzE,UAAA,CACI,oBAAC,eAAD,EAAa,MAAM;MAAC,IAAI,SAAS;MAAI,IAAI,SAAS;MAAI,IAAI,SAAS;KAAE,EAAI,CAAA,GACzE,oBAAC,qBAAD;MAAmB,OAAO;MAAU,WAAA;MAAU,aAAA;MAAY,SAAS;KAAO,CAAA,CACxE;;GACH;EAEP,CAAA,GAAA,qBAAC,QAAD;GAAM,UAAU;IAAC;IAAG;IAAM,KAAK,IAAI,KAAK,IAAI,SAAS,KAAK,EAAG;GAAC;GAAG,UAAU;IAAC,CAAC,KAAK,KAAK;IAAK;IAAG;GAAC;GAAG,eAAe;GAAlH,UAAA,CACI,oBAAC,gBAAD,EAAc,MAAM;IAAC;IAAM;IAAK;GAAC,EAAI,CAAA,GACrC,oBAAC,qBAAD;IAAmB,OAAO;IAAU,WAAA;GAAW,CAAA,CAC7C;EACF,CAAA,CAAA;;AAEhB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
import type { ThreeEvent } from "@react-three/fiber";
|
|
4
|
+
import type { MeshIsland } from "./meshIslands.js";
|
|
5
|
+
import type { ChopPartRole, CutVec3, SurfaceSelectMode } from "./surfaceCutter.js";
|
|
6
|
+
export interface Step1ExplodedIslandsProps {
|
|
7
|
+
readonly islands: readonly MeshIsland[];
|
|
8
|
+
readonly wheelColors: ReadonlyMap<number, string>;
|
|
9
|
+
readonly partPicks: Readonly<Record<number, ChopPartRole>>;
|
|
10
|
+
readonly wheelSource: "imported" | "fleet12";
|
|
11
|
+
readonly surfaceMode: SurfaceSelectMode;
|
|
12
|
+
readonly activeRoleColor: string;
|
|
13
|
+
readonly hingeScrub: number;
|
|
14
|
+
readonly explodeAmount: number;
|
|
15
|
+
readonly fleetWheels: readonly {
|
|
16
|
+
key: string;
|
|
17
|
+
pos: [number, number, number];
|
|
18
|
+
group: THREE.Group;
|
|
19
|
+
}[];
|
|
20
|
+
readonly primaryOverlayGeo: THREE.BufferGeometry | null;
|
|
21
|
+
readonly mirrorOverlayGeo: THREE.BufferGeometry | null;
|
|
22
|
+
readonly loopDots: {
|
|
23
|
+
readonly islandId: number;
|
|
24
|
+
readonly points: readonly CutVec3[];
|
|
25
|
+
} | null;
|
|
26
|
+
readonly loopPolyline: readonly [number, number, number][] | null;
|
|
27
|
+
readonly draggingRef: React.MutableRefObject<boolean>;
|
|
28
|
+
readonly onClickIsland: (id: number) => void;
|
|
29
|
+
readonly onEmitPick: (ev: ThreeEvent<PointerEvent | MouseEvent>, islandId: number, isDrag: boolean) => void;
|
|
30
|
+
}
|
|
31
|
+
export declare function Step1ExplodedIslands(p: Step1ExplodedIslandsProps): React.JSX.Element;
|