@pinkaphant/kolmo 0.3.0 → 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 +11 -5
- 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 +241 -206
- 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 +139 -249
- 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 -101
- 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 -253
- 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 +8 -13
- package/dist/engine/kolmoVehicleDriver.js +116 -42
- 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 -136
- 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 +10 -32
- package/dist/importer/ChopShopPanel.js +320 -470
- 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 -3
- package/dist/importer/GateHudBar.js +289 -284
- package/dist/importer/GateHudBar.js.map +1 -0
- package/dist/importer/GlbImportGate.d.ts +2 -1
- package/dist/importer/GlbImportGate.js +252 -261
- 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 -15
- package/dist/importer/Step1CalibrationPlinth.js +180 -313
- 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 -14
- package/dist/importer/Step2UniversalPad.js +54 -197
- 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 -32
- package/dist/importer/chopShopActions.js +138 -238
- 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 +3 -6
- package/dist/importer/gateStore.js +36 -30
- package/dist/importer/gateStore.js.map +1 -0
- package/dist/importer/glbNormalizer.d.ts +1 -10
- package/dist/importer/glbNormalizer.js +120 -146
- package/dist/importer/glbNormalizer.js.map +1 -0
- package/dist/importer/importerWebMcp.d.ts +4 -3
- package/dist/importer/importerWebMcp.js +41 -339
- 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 +6 -4
- package/dist/importer/index.js +32 -25
- 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 -41
- package/dist/importer/khrCompiler.js +56 -673
- 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 -39
- package/dist/importer/launcherBake.js.map +1 -0
- package/dist/importer/meshIslands.d.ts +4 -50
- package/dist/importer/meshIslands.js +84 -288
- 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 +5 -25
- package/dist/importer/surfaceCutter.js +70 -334
- 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 +4 -19
- package/dist/importer/surfaceTopology.js +92 -160
- package/dist/importer/surfaceTopology.js.map +1 -0
- package/dist/importer/universalGateBake.d.ts +7 -9
- package/dist/importer/universalGateBake.js +104 -109
- 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 -292
- package/dist/importer/usdToGlb.js.map +1 -0
- package/dist/importer/useChopShopController.d.ts +51 -74
- package/dist/importer/useChopShopController.js +157 -453
- 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.d.ts +1 -3
- package/dist/importer/wheelAxlePairing.js +106 -119
- 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 -69
- 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 -8
- package/dist/physics/index.js +80 -85
- 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 -247
- package/dist/importer/CabinPreviewRig.d.ts +0 -13
- package/dist/importer/CabinPreviewRig.js +0 -138
- package/dist/importer/CabinStepSection.d.ts +0 -17
- package/dist/importer/CabinStepSection.js +0 -222
- package/dist/importer/ImporterPlinthUikitTags.d.ts +0 -20
- package/dist/importer/ImporterPlinthUikitTags.js +0 -119
- package/dist/importer/cabinMeshBuilders.d.ts +0 -13
- package/dist/importer/cabinMeshBuilders.js +0 -104
- package/dist/importer/cabinMixamoRig.d.ts +0 -53
- package/dist/importer/cabinMixamoRig.js +0 -150
- package/dist/importer/chopShopUiComponents.d.ts +0 -22
- package/dist/importer/chopShopUiComponents.js +0 -91
- package/dist/importer/vehiclePanelAnim.js +0 -214
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { CHOP_ROLES } from "./surfaceTopology.js";
|
|
2
|
+
import { computeChopPartHinge } from "./chopHingeHelpers.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import * as THREE from "three";
|
|
5
|
+
import { Line } from "@react-three/drei";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
// src/importer/Step1ExplodedIslands.tsx
|
|
8
|
+
var PART_COLORS = Object.fromEntries(CHOP_ROLES.filter((c) => c.role !== "wheel").map((c) => [c.role, c.color]));
|
|
9
|
+
function Step1ExplodedIslands(p) {
|
|
10
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11
|
+
p.islands.map((isl) => {
|
|
12
|
+
const wheelTint = p.wheelColors.get(isl.id);
|
|
13
|
+
const role = wheelTint ? void 0 : p.partPicks[isl.id];
|
|
14
|
+
const tint = wheelTint ?? (role ? PART_COLORS[role] : void 0);
|
|
15
|
+
if (wheelTint && p.wheelSource === "fleet12") return null;
|
|
16
|
+
let explode = [
|
|
17
|
+
0,
|
|
18
|
+
0,
|
|
19
|
+
0
|
|
20
|
+
];
|
|
21
|
+
let anchor = [
|
|
22
|
+
0,
|
|
23
|
+
0,
|
|
24
|
+
0
|
|
25
|
+
];
|
|
26
|
+
const quat = new THREE.Quaternion();
|
|
27
|
+
if (role && (p.hingeScrub > 0 || p.explodeAmount > 0)) {
|
|
28
|
+
const h = computeChopPartHinge(isl, role);
|
|
29
|
+
anchor = h.anchor;
|
|
30
|
+
if (p.hingeScrub > 0) quat.setFromAxisAngle(new THREE.Vector3(...h.axis).normalize(), h.openAngle * p.hingeScrub);
|
|
31
|
+
if (p.explodeAmount > 0) explode = [
|
|
32
|
+
h.explodeDir[0] * p.explodeAmount,
|
|
33
|
+
h.explodeDir[1] * p.explodeAmount,
|
|
34
|
+
h.explodeDir[2] * p.explodeAmount
|
|
35
|
+
];
|
|
36
|
+
} else if (wheelTint && p.explodeAmount > 0) explode = [
|
|
37
|
+
Math.sign(isl.center[0] || 1) * p.explodeAmount * .65,
|
|
38
|
+
0,
|
|
39
|
+
0
|
|
40
|
+
];
|
|
41
|
+
return /* @__PURE__ */ jsx("group", {
|
|
42
|
+
position: [
|
|
43
|
+
anchor[0] + explode[0],
|
|
44
|
+
anchor[1] + explode[1],
|
|
45
|
+
anchor[2] + explode[2]
|
|
46
|
+
],
|
|
47
|
+
quaternion: quat,
|
|
48
|
+
children: /* @__PURE__ */ jsxs("group", {
|
|
49
|
+
position: [
|
|
50
|
+
-anchor[0],
|
|
51
|
+
-anchor[1],
|
|
52
|
+
-anchor[2]
|
|
53
|
+
],
|
|
54
|
+
children: [/* @__PURE__ */ jsx("mesh", {
|
|
55
|
+
geometry: isl.geometry,
|
|
56
|
+
material: isl.material,
|
|
57
|
+
onClick: (e) => {
|
|
58
|
+
if (e.delta > 5) return;
|
|
59
|
+
if (p.surfaceMode === "island") {
|
|
60
|
+
e.stopPropagation();
|
|
61
|
+
p.onClickIsland(isl.id);
|
|
62
|
+
} else if (p.surfaceMode !== "triangle") p.onEmitPick(e, isl.id, false);
|
|
63
|
+
},
|
|
64
|
+
onContextMenu: (e) => {
|
|
65
|
+
if (p.surfaceMode !== "island") p.onEmitPick(e, isl.id, false);
|
|
66
|
+
},
|
|
67
|
+
onPointerDown: (e) => {
|
|
68
|
+
if (p.surfaceMode === "triangle" && (e.button === 0 || e.button === 2)) {
|
|
69
|
+
p.draggingRef.current = true;
|
|
70
|
+
p.onEmitPick(e, isl.id, false);
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
onPointerMove: (e) => {
|
|
74
|
+
if (p.surfaceMode === "triangle" && p.draggingRef.current) p.onEmitPick(e, isl.id, true);
|
|
75
|
+
}
|
|
76
|
+
}), tint && /* @__PURE__ */ jsx("mesh", {
|
|
77
|
+
geometry: isl.geometry,
|
|
78
|
+
raycast: () => null,
|
|
79
|
+
children: /* @__PURE__ */ jsx("meshBasicMaterial", {
|
|
80
|
+
color: tint,
|
|
81
|
+
transparent: true,
|
|
82
|
+
opacity: .38,
|
|
83
|
+
depthWrite: false
|
|
84
|
+
})
|
|
85
|
+
})]
|
|
86
|
+
})
|
|
87
|
+
}, isl.id);
|
|
88
|
+
}),
|
|
89
|
+
p.fleetWheels.map((fw) => /* @__PURE__ */ jsx("primitive", {
|
|
90
|
+
object: fw.group,
|
|
91
|
+
position: [
|
|
92
|
+
fw.pos[0] + Math.sign(fw.pos[0] || 1) * p.explodeAmount * .65,
|
|
93
|
+
fw.pos[1],
|
|
94
|
+
fw.pos[2]
|
|
95
|
+
]
|
|
96
|
+
}, fw.key)),
|
|
97
|
+
p.primaryOverlayGeo && /* @__PURE__ */ jsx("mesh", {
|
|
98
|
+
geometry: p.primaryOverlayGeo,
|
|
99
|
+
raycast: () => null,
|
|
100
|
+
children: /* @__PURE__ */ jsx("meshBasicMaterial", {
|
|
101
|
+
color: p.activeRoleColor,
|
|
102
|
+
transparent: true,
|
|
103
|
+
opacity: .62,
|
|
104
|
+
side: THREE.DoubleSide,
|
|
105
|
+
depthWrite: false
|
|
106
|
+
})
|
|
107
|
+
}),
|
|
108
|
+
p.mirrorOverlayGeo && /* @__PURE__ */ jsx("mesh", {
|
|
109
|
+
geometry: p.mirrorOverlayGeo,
|
|
110
|
+
raycast: () => null,
|
|
111
|
+
children: /* @__PURE__ */ jsx("meshBasicMaterial", {
|
|
112
|
+
color: "#00E5FF",
|
|
113
|
+
transparent: true,
|
|
114
|
+
opacity: .48,
|
|
115
|
+
side: THREE.DoubleSide,
|
|
116
|
+
depthWrite: false
|
|
117
|
+
})
|
|
118
|
+
}),
|
|
119
|
+
p.loopDots?.points.map((pt, idx) => /* @__PURE__ */ jsxs("mesh", {
|
|
120
|
+
position: [
|
|
121
|
+
pt[0],
|
|
122
|
+
pt[1],
|
|
123
|
+
pt[2]
|
|
124
|
+
],
|
|
125
|
+
raycast: () => null,
|
|
126
|
+
children: [/* @__PURE__ */ jsx("sphereGeometry", { args: [
|
|
127
|
+
.032,
|
|
128
|
+
10,
|
|
129
|
+
10
|
|
130
|
+
] }), /* @__PURE__ */ jsx("meshBasicMaterial", {
|
|
131
|
+
color: idx === 0 ? "#10B981" : "#FFB000",
|
|
132
|
+
depthTest: false
|
|
133
|
+
})]
|
|
134
|
+
}, `dot_${idx}`)),
|
|
135
|
+
p.loopPolyline && p.loopPolyline.length >= 2 && /* @__PURE__ */ jsx(Line, {
|
|
136
|
+
points: p.loopPolyline,
|
|
137
|
+
color: "#FFB000",
|
|
138
|
+
lineWidth: 2.5
|
|
139
|
+
})
|
|
140
|
+
] });
|
|
141
|
+
}
|
|
142
|
+
export { Step1ExplodedIslands };
|
|
143
|
+
|
|
144
|
+
//# sourceMappingURL=Step1ExplodedIslands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Step1ExplodedIslands.js","names":["_Fragment"],"sources":["../../src/importer/Step1ExplodedIslands.tsx"],"sourcesContent":["import React from \"react\";\nimport * as THREE from \"three\";\nimport { Line } from \"@react-three/drei\";\nimport type { ThreeEvent } from \"@react-three/fiber\";\nimport type { MeshIsland } from \"./meshIslands.js\";\nimport type { ChopPartRole, CutVec3, SurfaceSelectMode } from \"./surfaceCutter.js\";\nimport { CHOP_ROLES } from \"./surfaceTopology.js\";\nimport { computeChopPartHinge } from \"./chopHingeHelpers.js\";\n\nconst PART_COLORS: Record<string, string> = Object.fromEntries(\n CHOP_ROLES.filter((c) => c.role !== \"wheel\").map((c) => [c.role, c.color]),\n);\n\nexport interface Step1ExplodedIslandsProps {\n readonly islands: readonly MeshIsland[];\n readonly wheelColors: ReadonlyMap<number, string>;\n readonly partPicks: Readonly<Record<number, ChopPartRole>>;\n readonly wheelSource: \"imported\" | \"fleet12\";\n readonly surfaceMode: SurfaceSelectMode;\n readonly activeRoleColor: string;\n readonly hingeScrub: number;\n readonly explodeAmount: number;\n readonly fleetWheels: readonly { key: string; pos: [number, number, number]; group: THREE.Group }[];\n readonly primaryOverlayGeo: THREE.BufferGeometry | null;\n readonly mirrorOverlayGeo: THREE.BufferGeometry | null;\n readonly loopDots: { readonly islandId: number; readonly points: readonly CutVec3[] } | null;\n readonly loopPolyline: readonly [number, number, number][] | null;\n readonly draggingRef: React.MutableRefObject<boolean>;\n readonly onClickIsland: (id: number) => void;\n readonly onEmitPick: (ev: ThreeEvent<PointerEvent | MouseEvent>, islandId: number, isDrag: boolean) => void;\n}\n\nexport function Step1ExplodedIslands(p: Step1ExplodedIslandsProps): React.JSX.Element {\n return (\n <>\n {p.islands.map((isl) => {\n const wheelTint = p.wheelColors.get(isl.id);\n const role = wheelTint ? undefined : p.partPicks[isl.id];\n const tint = wheelTint ?? (role ? PART_COLORS[role] : undefined);\n if (wheelTint && p.wheelSource === \"fleet12\") return null;\n\n let explode: [number, number, number] = [0, 0, 0];\n let anchor: [number, number, number] = [0, 0, 0];\n const quat = new THREE.Quaternion();\n if (role && (p.hingeScrub > 0 || p.explodeAmount > 0)) {\n const h = computeChopPartHinge(isl, role);\n anchor = h.anchor;\n if (p.hingeScrub > 0) {\n quat.setFromAxisAngle(new THREE.Vector3(...h.axis).normalize(), h.openAngle * p.hingeScrub);\n }\n if (p.explodeAmount > 0) {\n explode = [\n h.explodeDir[0] * p.explodeAmount,\n h.explodeDir[1] * p.explodeAmount,\n h.explodeDir[2] * p.explodeAmount,\n ];\n }\n } else if (wheelTint && p.explodeAmount > 0) {\n explode = [Math.sign(isl.center[0] || 1) * p.explodeAmount * 0.65, 0, 0];\n }\n\n return (\n <group\n key={isl.id}\n position={[anchor[0] + explode[0], anchor[1] + explode[1], anchor[2] + explode[2]]}\n quaternion={quat}\n >\n <group position={[-anchor[0], -anchor[1], -anchor[2]]}>\n <mesh\n geometry={isl.geometry}\n material={isl.material}\n onClick={(e) => {\n if (e.delta > 5) return;\n if (p.surfaceMode === \"island\") {\n e.stopPropagation();\n p.onClickIsland(isl.id);\n } else if (p.surfaceMode !== \"triangle\") {\n p.onEmitPick(e, isl.id, false);\n }\n }}\n onContextMenu={(e) => {\n if (p.surfaceMode !== \"island\") p.onEmitPick(e, isl.id, false);\n }}\n onPointerDown={(e) => {\n if (p.surfaceMode === \"triangle\" && (e.button === 0 || e.button === 2)) {\n p.draggingRef.current = true;\n p.onEmitPick(e, isl.id, false);\n }\n }}\n onPointerMove={(e) => {\n if (p.surfaceMode === \"triangle\" && p.draggingRef.current) p.onEmitPick(e, isl.id, true);\n }}\n />\n {tint && (\n <mesh geometry={isl.geometry} raycast={() => null}>\n <meshBasicMaterial color={tint} transparent opacity={0.38} depthWrite={false} />\n </mesh>\n )}\n </group>\n </group>\n );\n })}\n\n {p.fleetWheels.map((fw) => (\n <primitive\n key={fw.key}\n object={fw.group}\n position={[fw.pos[0] + Math.sign(fw.pos[0] || 1) * p.explodeAmount * 0.65, fw.pos[1], fw.pos[2]]}\n />\n ))}\n\n {p.primaryOverlayGeo && (\n <mesh geometry={p.primaryOverlayGeo} raycast={() => null}>\n <meshBasicMaterial color={p.activeRoleColor} transparent opacity={0.62} side={THREE.DoubleSide} depthWrite={false} />\n </mesh>\n )}\n {p.mirrorOverlayGeo && (\n <mesh geometry={p.mirrorOverlayGeo} raycast={() => null}>\n <meshBasicMaterial color=\"#00E5FF\" transparent opacity={0.48} side={THREE.DoubleSide} depthWrite={false} />\n </mesh>\n )}\n\n {p.loopDots?.points.map((pt, idx) => (\n <mesh key={`dot_${idx}`} position={[pt[0], pt[1], pt[2]]} raycast={() => null}>\n <sphereGeometry args={[0.032, 10, 10]} />\n <meshBasicMaterial color={idx === 0 ? \"#10B981\" : \"#FFB000\"} depthTest={false} />\n </mesh>\n ))}\n {p.loopPolyline && p.loopPolyline.length >= 2 && <Line points={p.loopPolyline} color=\"#FFB000\" lineWidth={2.5} />}\n </>\n );\n}\n"],"mappings":";;;;;;;AASA,IAAM,cAAsC,OAAO,YAC/C,WAAW,QAAQ,MAAM,EAAE,SAAS,OAAO,CAAC,CAAC,KAAK,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,CAC7E;AAqBA,SAAgB,qBAAqB,GAAiD;CAClF,OACI,qBAAAA,UAAA,EAAA,UAAA;EACK,EAAE,QAAQ,KAAK,QAAQ;GACpB,MAAM,YAAY,EAAE,YAAY,IAAI,IAAI,EAAE;GAC1C,MAAM,OAAO,YAAY,KAAA,IAAY,EAAE,UAAU,IAAI;GACrD,MAAM,OAAO,cAAc,OAAO,YAAY,QAAQ,KAAA;GACtD,IAAI,aAAa,EAAE,gBAAgB,WAAW,OAAO;GAErD,IAAI,UAAoC;IAAC;IAAG;IAAG;GAAC;GAChD,IAAI,SAAmC;IAAC;IAAG;IAAG;GAAC;GAC/C,MAAM,OAAO,IAAI,MAAM,WAAW;GAClC,IAAI,SAAS,EAAE,aAAa,KAAK,EAAE,gBAAgB,IAAI;IACnD,MAAM,IAAI,qBAAqB,KAAK,IAAI;IACxC,SAAS,EAAE;IACX,IAAI,EAAE,aAAa,GACf,KAAK,iBAAiB,IAAI,MAAM,QAAQ,GAAG,EAAE,IAAI,CAAC,CAAC,UAAU,GAAG,EAAE,YAAY,EAAE,UAAU;IAE9F,IAAI,EAAE,gBAAgB,GAClB,UAAU;KACN,EAAE,WAAW,KAAK,EAAE;KACpB,EAAE,WAAW,KAAK,EAAE;KACpB,EAAE,WAAW,KAAK,EAAE;IACxB;GAER,OAAO,IAAI,aAAa,EAAE,gBAAgB,GACtC,UAAU;IAAC,KAAK,KAAK,IAAI,OAAO,MAAM,CAAC,IAAI,EAAE,gBAAgB;IAAM;IAAG;GAAC;GAG3E,OACI,oBAAC,SAAD;IAEI,UAAU;KAAC,OAAO,KAAK,QAAQ;KAAI,OAAO,KAAK,QAAQ;KAAI,OAAO,KAAK,QAAQ;IAAE;IACjF,YAAY;IAEZ,UAAA,qBAAC,SAAD;KAAO,UAAU;MAAC,CAAC,OAAO;MAAI,CAAC,OAAO;MAAI,CAAC,OAAO;KAAE;KAApD,UAAA,CACI,oBAAC,QAAD;MACI,UAAU,IAAI;MACd,UAAU,IAAI;MACd,UAAU,MAAM;OACZ,IAAI,EAAE,QAAQ,GAAG;OACjB,IAAI,EAAE,gBAAgB,UAAU;QAC5B,EAAE,gBAAgB;QAClB,EAAE,cAAc,IAAI,EAAE;OAC1B,OAAO,IAAI,EAAE,gBAAgB,YACzB,EAAE,WAAW,GAAG,IAAI,IAAI,KAAK;MAErC;MACA,gBAAgB,MAAM;OAClB,IAAI,EAAE,gBAAgB,UAAU,EAAE,WAAW,GAAG,IAAI,IAAI,KAAK;MACjE;MACA,gBAAgB,MAAM;OAClB,IAAI,EAAE,gBAAgB,eAAe,EAAE,WAAW,KAAK,EAAE,WAAW,IAAI;QACpE,EAAE,YAAY,UAAU;QACxB,EAAE,WAAW,GAAG,IAAI,IAAI,KAAK;OACjC;MACJ;MACA,gBAAgB,MAAM;OAClB,IAAI,EAAE,gBAAgB,cAAc,EAAE,YAAY,SAAS,EAAE,WAAW,GAAG,IAAI,IAAI,IAAI;MAC3F;KACH,CAAA,GACA,QACG,oBAAC,QAAD;MAAM,UAAU,IAAI;MAAU,eAAe;MACzC,UAAA,oBAAC,qBAAD;OAAmB,OAAO;OAAM,aAAA;OAAY,SAAS;OAAM,YAAY;MAAQ,CAAA;KAC7E,CAAA,CAEP;;GACJ,GApCE,IAAI,EAoCN;EAEf,CAAC;EAEA,EAAE,YAAY,KAAK,OAChB,oBAAC,aAAD;GAEI,QAAQ,GAAG;GACX,UAAU;IAAC,GAAG,IAAI,KAAK,KAAK,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,EAAE,gBAAgB;IAAM,GAAG,IAAI;IAAI,GAAG,IAAI;GAAE;EAClG,GAHQ,GAAG,GAGX,CACJ;EAEA,EAAE,qBACC,oBAAC,QAAD;GAAM,UAAU,EAAE;GAAmB,eAAe;GAChD,UAAA,oBAAC,qBAAD;IAAmB,OAAO,EAAE;IAAiB,aAAA;IAAY,SAAS;IAAM,MAAM,MAAM;IAAY,YAAY;GAAQ,CAAA;EAClH,CAAA;EAET,EAAE,oBACC,oBAAC,QAAD;GAAM,UAAU,EAAE;GAAkB,eAAe;GAC/C,UAAA,oBAAC,qBAAD;IAAmB,OAAM;IAAU,aAAA;IAAY,SAAS;IAAM,MAAM,MAAM;IAAY,YAAY;GAAQ,CAAA;EACxG,CAAA;EAGT,EAAE,UAAU,OAAO,KAAK,IAAI,QACzB,qBAAC,QAAD;GAAyB,UAAU;IAAC,GAAG;IAAI,GAAG;IAAI,GAAG;GAAE;GAAG,eAAe;GAAzE,UAAA,CACI,oBAAC,kBAAD,EAAgB,MAAM;IAAC;IAAO;IAAI;GAAE,EAAI,CAAA,GACxC,oBAAC,qBAAD;IAAmB,OAAO,QAAQ,IAAI,YAAY;IAAW,WAAW;GAAQ,CAAA,CAC9E;EAHK,GAAA,OAAO,KAGZ,CACT;EACA,EAAE,gBAAgB,EAAE,aAAa,UAAU,KAAK,oBAAC,MAAD;GAAM,QAAQ,EAAE;GAAc,OAAM;GAAU,WAAW;EAAM,CAAA;CAClH,EAAA,CAAA;AAEV"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type * as THREE from "three";
|
|
3
|
+
import type { ThreeEvent } from "@react-three/fiber";
|
|
2
4
|
import { type KhrAssetBundle } from "@khr3/core";
|
|
5
|
+
import type { KhrVehicleJointsHandle } from "@khr3/core/vehicle";
|
|
3
6
|
import type { PaperShellAssembly } from "@khr3/vehicles/paper-shell";
|
|
4
|
-
import
|
|
5
|
-
import * as THREE from "three";
|
|
6
|
-
import { type KolmoAuthoredNodePatch } from "../schema/kolmoSchema.js";
|
|
7
|
-
import type { CarCabinConfig } from "./cabinMixamoRig.js";
|
|
8
|
-
import { type VehiclePanelAnimator } from "./khrCompiler.js";
|
|
7
|
+
import type { KolmoAuthoredNodePatch } from "../schema/kolmoSchema.js";
|
|
9
8
|
export interface Step2UniversalPadProps {
|
|
10
9
|
readonly assembly: PaperShellAssembly;
|
|
11
10
|
readonly importedRoot: THREE.Object3D | null;
|
|
@@ -13,13 +12,7 @@ export interface Step2UniversalPadProps {
|
|
|
13
12
|
readonly liveBundle: KhrAssetBundle | null;
|
|
14
13
|
readonly patches: readonly KolmoAuthoredNodePatch[];
|
|
15
14
|
readonly stampActive: boolean;
|
|
16
|
-
readonly
|
|
17
|
-
readonly cabin?: CarCabinConfig;
|
|
18
|
-
readonly carBounds?: {
|
|
19
|
-
readonly min: readonly [number, number, number];
|
|
20
|
-
readonly max: readonly [number, number, number];
|
|
21
|
-
};
|
|
22
|
-
readonly showDriver?: boolean;
|
|
15
|
+
readonly panelJointsRef: React.MutableRefObject<KhrVehicleJointsHandle | null>;
|
|
23
16
|
readonly onStampSurface: (e: ThreeEvent<MouseEvent>) => void;
|
|
24
17
|
}
|
|
25
|
-
export declare function Step2UniversalPad({ assembly, importedRoot, rootObjRef, liveBundle, patches, stampActive,
|
|
18
|
+
export declare function Step2UniversalPad({ assembly, importedRoot, rootObjRef, liveBundle, patches, stampActive, panelJointsRef, onStampSurface, }: Step2UniversalPadProps): React.JSX.Element;
|
|
@@ -1,162 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { useEffect as l, useMemo as u, useRef as d } from "react";
|
|
9
|
-
import * as f from "three";
|
|
10
|
-
import { useFrame as p } from "@react-three/fiber";
|
|
11
|
-
import { KhrAssembly as m, PhysicsWorld as h, cloneKhrBundle as g } from "@khr3/core";
|
|
12
|
-
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
13
|
-
import { CuboidCollider as y, CylinderCollider as b, RigidBody as x } from "@react-three/rapier";
|
|
14
|
-
import { KhrVehicle as S } from "@khr3/core/vehicle";
|
|
15
|
-
import { easing as C } from "maath";
|
|
1
|
+
import { ImperativeVehicleRig } from "./ImperativeVehicleRig.js";
|
|
2
|
+
import { LiveAssemblyPad, LiveDriveVehiclePad } from "./LiveDrivePads.js";
|
|
3
|
+
import { useGateStore } from "./gateStore.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { PhysicsWorld } from "@khr3/core";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { CuboidCollider, RigidBody } from "@react-three/rapier";
|
|
16
8
|
// src/importer/Step2UniversalPad.tsx
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
a: !1,
|
|
23
|
-
d: !1,
|
|
24
|
-
space: !1,
|
|
25
|
-
shift: !1
|
|
26
|
-
}), P = d(new f.Vector3(0, 1, 4)), F = d({
|
|
27
|
-
...t(),
|
|
28
|
-
throttle: 0,
|
|
29
|
-
boost: 0,
|
|
30
|
-
brake: 0,
|
|
31
|
-
headlight: 1,
|
|
32
|
-
always: 1
|
|
33
|
-
}), I = u(() => g(e), [e]), L = u(() => s(m), [m]), R = u(() => c(I), [I]);
|
|
34
|
-
return l(() => (y.current = R, () => {
|
|
35
|
-
y.current === R && (y.current = null);
|
|
36
|
-
}), [R, y]), l(() => {
|
|
37
|
-
a.massKg = I.totalDynamicMass, a.com = [...I.centerOfMass];
|
|
38
|
-
let e = (e) => (t) => {
|
|
39
|
-
(t.code === "KeyW" || t.code === "ArrowUp") && (N.current.w = e), (t.code === "KeyS" || t.code === "ArrowDown") && (N.current.s = e), (t.code === "KeyA" || t.code === "ArrowLeft") && (N.current.a = e), (t.code === "KeyD" || t.code === "ArrowRight") && (N.current.d = e), t.code === "Space" && (N.current.space = e), (t.code === "ShiftLeft" || t.code === "ShiftRight") && (N.current.shift = e);
|
|
40
|
-
}, t = e(!0), n = e(!1);
|
|
41
|
-
return window.addEventListener("keydown", t), window.addEventListener("keyup", n), () => {
|
|
42
|
-
window.removeEventListener("keydown", t), window.removeEventListener("keyup", n);
|
|
43
|
-
};
|
|
44
|
-
}, [I]), p((e, t) => {
|
|
45
|
-
let n = Math.min(Math.max(t, 1e-4), .05);
|
|
46
|
-
R.step(n);
|
|
47
|
-
let r = A.current;
|
|
48
|
-
if (!r?.body) return;
|
|
49
|
-
let s = o.getState().dropTrigger;
|
|
50
|
-
s !== M.current && (M.current = s, r.body.setTranslation({
|
|
51
|
-
x: 0,
|
|
52
|
-
y: 1.35,
|
|
53
|
-
z: 0
|
|
54
|
-
}, !0), r.body.setRotation({
|
|
55
|
-
x: 0,
|
|
56
|
-
y: 0,
|
|
57
|
-
z: 0,
|
|
58
|
-
w: 1
|
|
59
|
-
}, !0), r.body.setLinvel({
|
|
60
|
-
x: 0,
|
|
61
|
-
y: 0,
|
|
62
|
-
z: 0
|
|
63
|
-
}, !0), r.body.setAngvel({
|
|
64
|
-
x: 0,
|
|
65
|
-
y: 0,
|
|
66
|
-
z: 0
|
|
67
|
-
}, !0));
|
|
68
|
-
let c = N.current;
|
|
69
|
-
i === "starcraft" || I.propellers.length > 0 && I.wheels.length === 0 ? r.setMovement({
|
|
70
|
-
pitchForward: c.w,
|
|
71
|
-
pitchBackward: c.s,
|
|
72
|
-
yawLeft: c.a,
|
|
73
|
-
yawRight: c.d,
|
|
74
|
-
throttleUp: c.space,
|
|
75
|
-
throttleDown: c.shift
|
|
76
|
-
}) : r.setMovement({
|
|
77
|
-
forward: c.w,
|
|
78
|
-
backward: c.s,
|
|
79
|
-
steerLeft: c.a,
|
|
80
|
-
steerRight: c.d,
|
|
81
|
-
brake: c.space,
|
|
82
|
-
...I.propellers.length > 0 ? { throttleUp: c.shift } : {}
|
|
83
|
-
});
|
|
84
|
-
let l = F.current;
|
|
85
|
-
l.throttle = +!!c.w, l.boost = c.w && c.shift ? 1 : 0, l.brake = c.space || c.s ? 1 : 0, a.speedKmh = r.currLinVel.length() * 3.6, a.rpm = Math.max(850, r.engineRPM), j && !h && (w.copy(r.bodyZAxis).projectOnPlane(T), w.lengthSq() < 1e-6 ? w.set(0, 0, 1) : w.normalize(), E.copy(r.currPos).addScaledVector(w, -6.8).addScaledVector(T, 2.25), D.copy(r.currPos).addScaledVector(w, 3.5).addScaledVector(T, .65), C.damp3(e.camera.position, E, .14, n), C.damp3(P.current, D, .08, n), e.camera.lookAt(P.current));
|
|
86
|
-
}), /* @__PURE__ */ _("group", {
|
|
87
|
-
onClick: (e) => {
|
|
88
|
-
h ? k(e) : e.delta <= 5 && R.toggleHitObject(e.object) && e.stopPropagation();
|
|
89
|
-
},
|
|
90
|
-
children: /* @__PURE__ */ v(S, {
|
|
91
|
-
ref: A,
|
|
92
|
-
bundle: I,
|
|
93
|
-
position: [
|
|
94
|
-
0,
|
|
95
|
-
i === "starcraft" ? 1.4 : .35,
|
|
96
|
-
0
|
|
97
|
-
],
|
|
98
|
-
children: [/* @__PURE__ */ _(n, {
|
|
99
|
-
emitters: L,
|
|
100
|
-
signalsRef: F
|
|
101
|
-
}), O && b?.enabled && x && /* @__PURE__ */ _(r, {
|
|
102
|
-
cabin: b,
|
|
103
|
-
carBounds: x,
|
|
104
|
-
showTub: !1,
|
|
105
|
-
showDummy: !0,
|
|
106
|
-
showSockets: !1
|
|
107
|
-
})]
|
|
108
|
-
})
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
function k({ bundle: r, domain: i, staticProp: c, patches: f, onStampSurface: p }) {
|
|
112
|
-
let h = d(null), y = d(!1), b = o((e) => e.dropTrigger), x = d({
|
|
113
|
-
...t(),
|
|
114
|
-
throttle: .9,
|
|
115
|
-
boost: 1,
|
|
116
|
-
brake: 1,
|
|
117
|
-
headlight: 1,
|
|
118
|
-
fire: 1,
|
|
119
|
-
always: 1
|
|
120
|
-
}), S = u(() => g(r), [r, b]), C = u(() => s(f), [f]), w = i === "c12" || i === "prop" && c;
|
|
121
|
-
return l(() => {
|
|
122
|
-
a.massKg = S.totalDynamicMass, a.com = [...S.centerOfMass], a.speedKmh = 0;
|
|
123
|
-
}, [S]), /* @__PURE__ */ v("group", {
|
|
124
|
-
onClick: (t) => {
|
|
125
|
-
p(t), y.current = e(h.current, S, y.current);
|
|
126
|
-
},
|
|
127
|
-
children: [/* @__PURE__ */ _(m, {
|
|
128
|
-
ref: h,
|
|
129
|
-
bundle: S,
|
|
130
|
-
position: [
|
|
131
|
-
0,
|
|
132
|
-
w ? 0 : 1.2,
|
|
133
|
-
0
|
|
134
|
-
],
|
|
135
|
-
fixedRoot: w
|
|
136
|
-
}, `asm_${b}`), /* @__PURE__ */ _(n, {
|
|
137
|
-
emitters: C,
|
|
138
|
-
signalsRef: x
|
|
139
|
-
})]
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
function A({ assembly: e, importedRoot: t, rootObjRef: n, liveBundle: r, patches: a, stampActive: s, panelAnimRef: c, cabin: l, carBounds: u, showDriver: d, onStampSurface: f }) {
|
|
143
|
-
let p = o((e) => e.domain), m = o((e) => e.vehicleArchetype), g = o((e) => e.usePaperShellProxy), S = o((e) => e.staticProp);
|
|
144
|
-
return /* @__PURE__ */ v(h, {
|
|
9
|
+
function Step2UniversalPad({ assembly, importedRoot, rootObjRef, liveBundle, patches, stampActive, panelJointsRef, onStampSurface }) {
|
|
10
|
+
const domain = useGateStore((s) => s.domain);
|
|
11
|
+
const usePaperShellProxy = useGateStore((s) => s.usePaperShellProxy);
|
|
12
|
+
const staticProp = useGateStore((s) => s.staticProp);
|
|
13
|
+
return /* @__PURE__ */ jsxs(PhysicsWorld, {
|
|
145
14
|
gravity: [
|
|
146
15
|
0,
|
|
147
16
|
-9.81,
|
|
148
17
|
0
|
|
149
18
|
],
|
|
150
19
|
children: [
|
|
151
|
-
/* @__PURE__ */
|
|
20
|
+
/* @__PURE__ */ jsx(RigidBody, {
|
|
152
21
|
type: "fixed",
|
|
153
22
|
position: [
|
|
154
23
|
0,
|
|
155
24
|
-.25,
|
|
156
25
|
0
|
|
157
26
|
],
|
|
158
|
-
colliders:
|
|
159
|
-
children: /* @__PURE__ */
|
|
27
|
+
colliders: false,
|
|
28
|
+
children: /* @__PURE__ */ jsx(CuboidCollider, {
|
|
160
29
|
args: [
|
|
161
30
|
180,
|
|
162
31
|
.25,
|
|
@@ -165,7 +34,7 @@ function A({ assembly: e, importedRoot: t, rootObjRef: n, liveBundle: r, patches
|
|
|
165
34
|
friction: .92
|
|
166
35
|
})
|
|
167
36
|
}),
|
|
168
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ jsxs("mesh", {
|
|
169
38
|
rotation: [
|
|
170
39
|
-Math.PI * .5,
|
|
171
40
|
0,
|
|
@@ -176,13 +45,13 @@ function A({ assembly: e, importedRoot: t, rootObjRef: n, liveBundle: r, patches
|
|
|
176
45
|
-.004,
|
|
177
46
|
0
|
|
178
47
|
],
|
|
179
|
-
receiveShadow:
|
|
180
|
-
children: [/* @__PURE__ */
|
|
48
|
+
receiveShadow: true,
|
|
49
|
+
children: [/* @__PURE__ */ jsx("planeGeometry", { args: [360, 360] }), /* @__PURE__ */ jsx("meshStandardMaterial", {
|
|
181
50
|
color: "#11161d",
|
|
182
51
|
roughness: .95
|
|
183
52
|
})]
|
|
184
53
|
}),
|
|
185
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ jsx(RigidBody, {
|
|
186
55
|
type: "fixed",
|
|
187
56
|
position: [
|
|
188
57
|
0,
|
|
@@ -195,17 +64,17 @@ function A({ assembly: e, importedRoot: t, rootObjRef: n, liveBundle: r, patches
|
|
|
195
64
|
0
|
|
196
65
|
],
|
|
197
66
|
colliders: "cuboid",
|
|
198
|
-
children: /* @__PURE__ */
|
|
67
|
+
children: /* @__PURE__ */ jsxs("mesh", { children: [/* @__PURE__ */ jsx("boxGeometry", { args: [
|
|
199
68
|
4.4,
|
|
200
69
|
.22,
|
|
201
70
|
6.2
|
|
202
|
-
] }), /* @__PURE__ */
|
|
71
|
+
] }), /* @__PURE__ */ jsx("meshStandardMaterial", {
|
|
203
72
|
color: "#f59e0b",
|
|
204
73
|
roughness: .75,
|
|
205
|
-
flatShading:
|
|
74
|
+
flatShading: true
|
|
206
75
|
})] })
|
|
207
76
|
}),
|
|
208
|
-
[-12, 12].flatMap((
|
|
77
|
+
[-12, 12].flatMap((x) => [
|
|
209
78
|
-24,
|
|
210
79
|
-12,
|
|
211
80
|
0,
|
|
@@ -213,54 +82,42 @@ function A({ assembly: e, importedRoot: t, rootObjRef: n, liveBundle: r, patches
|
|
|
213
82
|
24,
|
|
214
83
|
36,
|
|
215
84
|
48
|
|
216
|
-
].map((
|
|
217
|
-
type: "dynamic",
|
|
218
|
-
mass: 2.2,
|
|
85
|
+
].map((z) => /* @__PURE__ */ jsxs("mesh", {
|
|
219
86
|
position: [
|
|
220
|
-
|
|
87
|
+
x,
|
|
221
88
|
.35,
|
|
222
|
-
|
|
89
|
+
z
|
|
223
90
|
],
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
.28,
|
|
233
|
-
.7,
|
|
234
|
-
8
|
|
235
|
-
] }), /* @__PURE__ */ _("meshStandardMaterial", {
|
|
236
|
-
color: "#ff5a1f",
|
|
237
|
-
roughness: .6,
|
|
238
|
-
flatShading: !0
|
|
239
|
-
})]
|
|
91
|
+
children: [/* @__PURE__ */ jsx("coneGeometry", { args: [
|
|
92
|
+
.28,
|
|
93
|
+
.7,
|
|
94
|
+
8
|
|
95
|
+
] }), /* @__PURE__ */ jsx("meshStandardMaterial", {
|
|
96
|
+
color: "#ff5a1f",
|
|
97
|
+
roughness: .6,
|
|
98
|
+
flatShading: true
|
|
240
99
|
})]
|
|
241
|
-
}, `cone_${
|
|
242
|
-
|
|
243
|
-
assembly
|
|
244
|
-
importedRoot
|
|
245
|
-
chassisGroupRef:
|
|
246
|
-
}) :
|
|
247
|
-
bundle:
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
domain: p,
|
|
259
|
-
staticProp: S,
|
|
260
|
-
patches: a,
|
|
261
|
-
onStampSurface: f
|
|
100
|
+
}, `cone_${x}_${z}`))),
|
|
101
|
+
domain === "vehicle" && usePaperShellProxy ? /* @__PURE__ */ jsx(ImperativeVehicleRig, {
|
|
102
|
+
assembly,
|
|
103
|
+
importedRoot,
|
|
104
|
+
chassisGroupRef: rootObjRef
|
|
105
|
+
}) : liveBundle ? domain === "vehicle" ? /* @__PURE__ */ jsx(LiveDriveVehiclePad, {
|
|
106
|
+
bundle: liveBundle,
|
|
107
|
+
patches,
|
|
108
|
+
stampActive,
|
|
109
|
+
panelJointsRef,
|
|
110
|
+
onStampSurface
|
|
111
|
+
}) : /* @__PURE__ */ jsx(LiveAssemblyPad, {
|
|
112
|
+
bundle: liveBundle,
|
|
113
|
+
domain,
|
|
114
|
+
staticProp,
|
|
115
|
+
patches,
|
|
116
|
+
onStampSurface
|
|
262
117
|
}) : null
|
|
263
118
|
]
|
|
264
119
|
});
|
|
265
120
|
}
|
|
266
|
-
export {
|
|
121
|
+
export { Step2UniversalPad };
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=Step2UniversalPad.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Step2UniversalPad.js","names":[],"sources":["../../src/importer/Step2UniversalPad.tsx"],"sourcesContent":["import React from \"react\";\nimport type * as THREE from \"three\";\nimport type { ThreeEvent } from \"@react-three/fiber\";\nimport { CuboidCollider, RigidBody } from \"@react-three/rapier\";\nimport { PhysicsWorld, type KhrAssetBundle } from \"@khr3/core\";\nimport type { KhrVehicleJointsHandle } from \"@khr3/core/vehicle\";\nimport type { PaperShellAssembly } from \"@khr3/vehicles/paper-shell\";\nimport type { KolmoAuthoredNodePatch } from \"../schema/kolmoSchema.js\";\nimport { ImperativeVehicleRig } from \"./ImperativeVehicleRig.js\";\nimport { LiveAssemblyPad, LiveDriveVehiclePad } from \"./LiveDrivePads.js\";\nimport { useGateStore } from \"./gateStore.js\";\n\nexport interface Step2UniversalPadProps {\n readonly assembly: PaperShellAssembly;\n readonly importedRoot: THREE.Object3D | null;\n readonly rootObjRef: React.RefObject<THREE.Group | null>;\n readonly liveBundle: KhrAssetBundle | null;\n readonly patches: readonly KolmoAuthoredNodePatch[];\n readonly stampActive: boolean;\n readonly panelJointsRef: React.MutableRefObject<KhrVehicleJointsHandle | null>;\n readonly onStampSurface: (e: ThreeEvent<MouseEvent>) => void;\n}\n\nexport function Step2UniversalPad({\n assembly,\n importedRoot,\n rootObjRef,\n liveBundle,\n patches,\n stampActive,\n panelJointsRef,\n onStampSurface,\n}: Step2UniversalPadProps): React.JSX.Element {\n const domain = useGateStore((s) => s.domain);\n const usePaperShellProxy = useGateStore((s) => s.usePaperShellProxy);\n const staticProp = useGateStore((s) => s.staticProp);\n\n return (\n <PhysicsWorld gravity={[0, -9.81, 0]}>\n <RigidBody type=\"fixed\" position={[0, -0.25, 0]} colliders={false}>\n <CuboidCollider args={[180, 0.25, 180]} friction={0.92} />\n </RigidBody>\n <mesh rotation={[-Math.PI * 0.5, 0, 0]} position={[0, -0.004, 0]} receiveShadow>\n <planeGeometry args={[360, 360]} />\n <meshStandardMaterial color=\"#11161d\" roughness={0.95} />\n </mesh>\n <RigidBody type=\"fixed\" position={[0, 0.36, 18]} rotation={[-0.19, 0, 0]} colliders=\"cuboid\">\n <mesh>\n <boxGeometry args={[4.4, 0.22, 6.2]} />\n <meshStandardMaterial color=\"#f59e0b\" roughness={0.75} flatShading />\n </mesh>\n </RigidBody>\n {[-12, 12].flatMap((x) =>\n [-24, -12, 0, 12, 24, 36, 48].map((z) => (\n <mesh key={`cone_${x}_${z}`} position={[x, 0.35, z]}>\n <coneGeometry args={[0.28, 0.7, 8]} />\n <meshStandardMaterial color=\"#ff5a1f\" roughness={0.6} flatShading />\n </mesh>\n )),\n )}\n {domain === \"vehicle\" && usePaperShellProxy ? (\n <ImperativeVehicleRig assembly={assembly} importedRoot={importedRoot} chassisGroupRef={rootObjRef} />\n ) : liveBundle ? (\n domain === \"vehicle\" ? (\n <LiveDriveVehiclePad\n bundle={liveBundle}\n patches={patches}\n stampActive={stampActive}\n panelJointsRef={panelJointsRef}\n onStampSurface={onStampSurface}\n />\n ) : (\n <LiveAssemblyPad\n bundle={liveBundle}\n domain={domain}\n staticProp={staticProp}\n patches={patches}\n onStampSurface={onStampSurface}\n />\n )\n ) : null}\n </PhysicsWorld>\n );\n}\n"],"mappings":";;;;;;;;AAuBA,SAAgB,kBAAkB,EAC9B,UACA,cACA,YACA,YACA,SACA,aACA,gBACA,kBAC0C;CAC1C,MAAM,SAAS,cAAc,MAAM,EAAE,MAAM;CAC3C,MAAM,qBAAqB,cAAc,MAAM,EAAE,kBAAkB;CACnE,MAAM,aAAa,cAAc,MAAM,EAAE,UAAU;CAEnD,OACI,qBAAC,cAAD;EAAc,SAAS;GAAC;GAAG;GAAO;EAAC;EAAnC,UAAA;GACI,oBAAC,WAAD;IAAW,MAAK;IAAQ,UAAU;KAAC;KAAG;KAAO;IAAC;IAAG,WAAW;IACxD,UAAA,oBAAC,gBAAD;KAAgB,MAAM;MAAC;MAAK;MAAM;KAAG;KAAG,UAAU;IAAO,CAAA;GAClD,CAAA;GACX,qBAAC,QAAD;IAAM,UAAU;KAAC,CAAC,KAAK,KAAK;KAAK;KAAG;IAAC;IAAG,UAAU;KAAC;KAAG;KAAQ;IAAC;IAAG,eAAA;IAAlE,UAAA,CACI,oBAAC,iBAAD,EAAe,MAAM,CAAC,KAAK,GAAG,EAAI,CAAA,GAClC,oBAAC,wBAAD;KAAsB,OAAM;KAAU,WAAW;IAAO,CAAA,CACtD;;GACN,oBAAC,WAAD;IAAW,MAAK;IAAQ,UAAU;KAAC;KAAG;KAAM;IAAE;IAAG,UAAU;KAAC;KAAO;KAAG;IAAC;IAAG,WAAU;IAChF,UAAA,qBAAC,QAAD,EAAA,UAAA,CACI,oBAAC,eAAD,EAAa,MAAM;KAAC;KAAK;KAAM;IAAG,EAAI,CAAA,GACtC,oBAAC,wBAAD;KAAsB,OAAM;KAAU,WAAW;KAAM,aAAA;IAAa,CAAA,CAClE,EAAA,CAAA;GACC,CAAA;GACV,CAAC,KAAK,EAAE,CAAC,CAAC,SAAS,MAChB;IAAC;IAAK;IAAK;IAAG;IAAI;IAAI;IAAI;GAAE,CAAC,CAAC,KAAK,MAC/B,qBAAC,QAAD;IAA6B,UAAU;KAAC;KAAG;KAAM;IAAC;IAAlD,UAAA,CACI,oBAAC,gBAAD,EAAc,MAAM;KAAC;KAAM;KAAK;IAAC,EAAI,CAAA,GACrC,oBAAC,wBAAD;KAAsB,OAAM;KAAU,WAAW;KAAK,aAAA;IAAa,CAAA,CACjE;GAHK,GAAA,QAAQ,EAAE,GAAG,GAGlB,CACT,CACL;GACC,WAAW,aAAa,qBACrB,oBAAC,sBAAD;IAAgC;IAAwB;IAAc,iBAAiB;GAAa,CAAA,IACpG,aACA,WAAW,YACP,oBAAC,qBAAD;IACI,QAAQ;IACC;IACI;IACG;IACA;GACnB,CAAA,IAED,oBAAC,iBAAD;IACI,QAAQ;IACA;IACI;IACH;IACO;GACnB,CAAA,IAEL;EACM;;AAEtB"}
|