@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
package/package.json
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pinkaphant/kolmo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "Low-overhead retro 3D game runtime: declarative React Three Fiber world & vehicle engine, C12 road/island/long-drive generator, PS1/Dreamcast/PS2 retro shader stack, and GLB import calibration gate.",
|
|
4
5
|
"license": "MIT",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"sideEffects": false,
|
|
7
|
-
"description": "Kolmo 3D Game Engine (ecctrl 2 + khr3) & Universal KHR3 GLB/USD Gate",
|
|
8
|
-
"main": "./dist/index.js",
|
|
9
|
-
"types": "./dist/index.d.ts",
|
|
10
8
|
"bin": {
|
|
11
9
|
"kolmo": "./bin/kolmo.mjs"
|
|
12
10
|
},
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"import": "./dist/index.js"
|
|
17
17
|
},
|
|
18
|
+
"./all": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js"
|
|
21
|
+
},
|
|
18
22
|
"./physics": {
|
|
19
23
|
"types": "./dist/physics/index.d.ts",
|
|
20
24
|
"import": "./dist/physics/index.js"
|
|
@@ -47,14 +51,15 @@
|
|
|
47
51
|
"types": "./dist/junk/index.d.ts",
|
|
48
52
|
"import": "./dist/junk/index.js"
|
|
49
53
|
},
|
|
50
|
-
"./
|
|
51
|
-
"types": "./dist/
|
|
52
|
-
"import": "./dist/
|
|
54
|
+
"./schema": {
|
|
55
|
+
"types": "./dist/schema/kolmoSchema.d.ts",
|
|
56
|
+
"import": "./dist/schema/kolmoSchema.js"
|
|
53
57
|
},
|
|
54
58
|
"./package.json": "./package.json"
|
|
55
59
|
},
|
|
56
60
|
"files": [
|
|
57
61
|
"dist",
|
|
62
|
+
"docs",
|
|
58
63
|
"bin",
|
|
59
64
|
"LICENSE",
|
|
60
65
|
"README.md"
|
|
@@ -64,57 +69,78 @@
|
|
|
64
69
|
},
|
|
65
70
|
"scripts": {
|
|
66
71
|
"dev": "vite",
|
|
72
|
+
"example": "tsx example/headless.ts",
|
|
67
73
|
"typecheck": "tsc --noEmit",
|
|
68
|
-
"
|
|
74
|
+
"test": "node --import tsx --test \"src/**/*.test.ts*\"",
|
|
69
75
|
"build:lib": "rm -rf dist && vite build -c vite.lib.config.ts && tsc -p tsconfig.lib.json",
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
"prepack": "npm run build:lib >&2",
|
|
77
|
+
"pack:dry": "npm pack --dry-run"
|
|
78
|
+
},
|
|
79
|
+
"dependencies": {
|
|
80
|
+
"@khr3/assets": "^0.2.4",
|
|
81
|
+
"@khr3/c12": "^0.3.4",
|
|
82
|
+
"@khr3/core": "^0.2.0",
|
|
83
|
+
"@khr3/launchers": "^0.2.5",
|
|
84
|
+
"@khr3/vehicles": "^0.2.0"
|
|
85
|
+
},
|
|
86
|
+
"overrides": {
|
|
87
|
+
"@dimforge/rapier3d-compat": "0.19.2",
|
|
88
|
+
"@pinkaphant/ecctrl": "2.0.4-beta.2"
|
|
74
89
|
},
|
|
75
90
|
"peerDependencies": {
|
|
76
91
|
"@dimforge/rapier3d-compat": "0.19.2",
|
|
77
92
|
"@pinkaphant/ecctrl": "2.0.4-beta.2",
|
|
78
|
-
"@react-three/drei": ">=10.7.0",
|
|
79
|
-
"@react-three/fiber": ">=9.6.0",
|
|
80
|
-
"@react-three/rapier": "^2.2.0",
|
|
81
|
-
"koota": ">=0.6.5",
|
|
82
|
-
"react": ">=19.0.0",
|
|
83
|
-
"react-dom": ">=19.0.0",
|
|
84
|
-
"three": ">=0.184.0"
|
|
85
|
-
},
|
|
86
|
-
"dependencies": {
|
|
87
|
-
"@khr3/assets": "^0.2.2",
|
|
88
|
-
"@khr3/c12": "^0.3.1",
|
|
89
|
-
"@khr3/core": "^0.1.4",
|
|
90
|
-
"@khr3/launchers": "^0.2.2",
|
|
91
|
-
"@khr3/vehicles": "^0.1.4",
|
|
92
93
|
"@pmndrs/uikit": "^1.0.78",
|
|
93
94
|
"@preact/signals-core": "^1.14.5",
|
|
95
|
+
"@react-three/drei": "^10.7.7",
|
|
96
|
+
"@react-three/fiber": "^9.0.0",
|
|
97
|
+
"@react-three/rapier": "^2.2.0",
|
|
94
98
|
"@react-three/uikit": "^1.0.78",
|
|
95
|
-
"
|
|
96
|
-
"
|
|
99
|
+
"koota": "^0.6.5",
|
|
100
|
+
"react": "^19.0.0",
|
|
101
|
+
"react-dom": "^19.0.0",
|
|
102
|
+
"three": ">=0.180.0",
|
|
103
|
+
"zustand": "^5.0.0"
|
|
97
104
|
},
|
|
98
105
|
"devDependencies": {
|
|
99
106
|
"@dimforge/rapier3d-compat": "0.19.2",
|
|
100
107
|
"@pinkaphant/ecctrl": "2.0.4-beta.2",
|
|
108
|
+
"@pmndrs/uikit": "^1.0.78",
|
|
109
|
+
"@preact/signals-core": "^1.14.5",
|
|
101
110
|
"@react-three/drei": "^10.7.7",
|
|
102
111
|
"@react-three/fiber": "^9.6.1",
|
|
103
112
|
"@react-three/rapier": "^2.2.0",
|
|
104
|
-
"@react-three/
|
|
113
|
+
"@react-three/uikit": "^1.0.78",
|
|
105
114
|
"@types/node": "^22.20.5",
|
|
106
115
|
"@types/react": "^19.2.16",
|
|
107
116
|
"@types/react-dom": "^19.2.3",
|
|
108
117
|
"@types/three": "^0.184.0",
|
|
109
118
|
"@vitejs/plugin-react": "^6.1.1",
|
|
110
119
|
"koota": "^0.6.5",
|
|
111
|
-
"partyserver": "^0.5.10",
|
|
112
|
-
"partysocket": "^1.3.0",
|
|
113
120
|
"react": "^19.2.7",
|
|
114
121
|
"react-dom": "^19.2.7",
|
|
115
122
|
"three": "^0.184.0",
|
|
116
123
|
"tsx": "^4.23.15",
|
|
117
124
|
"typescript": "^6.0.3",
|
|
118
|
-
"vite": "^8.3.8"
|
|
125
|
+
"vite": "^8.3.8",
|
|
126
|
+
"wrangler": "^4.164.0",
|
|
127
|
+
"zustand": "^5.0.14"
|
|
128
|
+
},
|
|
129
|
+
"keywords": [
|
|
130
|
+
"threejs",
|
|
131
|
+
"react-three-fiber",
|
|
132
|
+
"rapier",
|
|
133
|
+
"ecctrl",
|
|
134
|
+
"khr3",
|
|
135
|
+
"retro",
|
|
136
|
+
"game-engine"
|
|
137
|
+
],
|
|
138
|
+
"repository": {
|
|
139
|
+
"type": "git",
|
|
140
|
+
"url": "git+https://github.com/pinkAphant/kolmo.git"
|
|
141
|
+
},
|
|
142
|
+
"homepage": "https://github.com/pinkAphant/kolmo#readme",
|
|
143
|
+
"bugs": {
|
|
144
|
+
"url": "https://github.com/pinkAphant/kolmo/issues"
|
|
119
145
|
}
|
|
120
146
|
}
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
import { syncRetroUniforms as e } from "../shaders/retroShader.js";
|
|
2
|
-
import { useEffect as t, useReducer as n, useRef as r } from "react";
|
|
3
|
-
import * as i from "three";
|
|
4
|
-
import { useWorld as a } from "koota/react";
|
|
5
|
-
import { createActions as o, createWorld as s, relation as c, trait as l } from "koota";
|
|
6
|
-
// src/engine/kolmoStore.ts
|
|
7
|
-
var u = l(() => ({
|
|
8
|
-
id: "",
|
|
9
|
-
handle: null,
|
|
10
|
-
centerOfMass: [
|
|
11
|
-
0,
|
|
12
|
-
0,
|
|
13
|
-
0
|
|
14
|
-
],
|
|
15
|
-
seatOffset: [
|
|
16
|
-
0,
|
|
17
|
-
.55,
|
|
18
|
-
0
|
|
19
|
-
],
|
|
20
|
-
exitOffset: [
|
|
21
|
-
-1.5,
|
|
22
|
-
.45,
|
|
23
|
-
0
|
|
24
|
-
],
|
|
25
|
-
isFlight: !1
|
|
26
|
-
})), d = l(() => ({
|
|
27
|
-
id: "pilot",
|
|
28
|
-
handle: null,
|
|
29
|
-
exitSpawnPos: null,
|
|
30
|
-
exitSpawnYaw: 0,
|
|
31
|
-
exitLinVel: null
|
|
32
|
-
})), f = l({
|
|
33
|
-
id: "",
|
|
34
|
-
radius: 4,
|
|
35
|
-
kind: "vehicle"
|
|
36
|
-
}), p = l(() => ({
|
|
37
|
-
id: "",
|
|
38
|
-
getBody: () => null
|
|
39
|
-
})), m = c({ exclusive: !0 }), h = l({
|
|
40
|
-
activeVehicleId: "",
|
|
41
|
-
activeRetroPreset: "dreamcast"
|
|
42
|
-
}), g = s(h);
|
|
43
|
-
function _() {
|
|
44
|
-
try {
|
|
45
|
-
return a();
|
|
46
|
-
} catch {
|
|
47
|
-
return g;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
function v(e) {
|
|
51
|
-
e.has(h) || e.add(h);
|
|
52
|
-
}
|
|
53
|
-
function y(e, i) {
|
|
54
|
-
let [, a] = n((e) => e + 1, 0), o = r(e && e.has(i) ? e.get(i) : void 0);
|
|
55
|
-
return o.current = e && e.has(i) ? e.get(i) : void 0, t(() => {
|
|
56
|
-
if (!e) return;
|
|
57
|
-
let t = () => {
|
|
58
|
-
o.current = e.has(i) ? e.get(i) : void 0, a();
|
|
59
|
-
}, n = e.onAdd(i, () => t()), r = e.onChange(i, () => t()), s = e.onRemove(i, () => t());
|
|
60
|
-
return (e.has(i) ? e.get(i) : void 0) !== o.current && t(), () => {
|
|
61
|
-
n(), r(), s();
|
|
62
|
-
};
|
|
63
|
-
}, [e, i]), o.current;
|
|
64
|
-
}
|
|
65
|
-
function b(e, t) {
|
|
66
|
-
let n = e.has(h) ? e.get(h)?.activeVehicleId : "";
|
|
67
|
-
if (n) for (let t of e.query(u)) {
|
|
68
|
-
let e = t.get(u);
|
|
69
|
-
if (e?.id === n && e.handle?.body) {
|
|
70
|
-
let t = e.handle.body.translation();
|
|
71
|
-
return [t.x, t.z];
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
for (let t of e.query(d)) {
|
|
75
|
-
let e = t.get(d)?.handle?.body;
|
|
76
|
-
if (e) {
|
|
77
|
-
let t = e.translation();
|
|
78
|
-
return [t.x, t.z];
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
for (let t of e.query(u)) {
|
|
82
|
-
let e = t.get(u)?.handle?.body;
|
|
83
|
-
if (e) {
|
|
84
|
-
let t = e.translation();
|
|
85
|
-
return [t.x, t.z];
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return [t?.position.x ?? 0, t?.position.z ?? 0];
|
|
89
|
-
}
|
|
90
|
-
var x = new i.Vector3(), S = new i.Quaternion(), C = new i.Matrix4(), w = new i.Vector3(), T = new i.Quaternion(), E = new i.Vector3();
|
|
91
|
-
function D(e, t, n, r) {
|
|
92
|
-
let i = e.translation(), a = i.x - t, o = i.z - n;
|
|
93
|
-
if (e.setTranslation({
|
|
94
|
-
x: a,
|
|
95
|
-
y: i.y,
|
|
96
|
-
z: o
|
|
97
|
-
}, !0), !r?.rigidBodyStates || typeof e.handle != "number") return;
|
|
98
|
-
let s = r.rigidBodyStates.get(e.handle);
|
|
99
|
-
if (!s || s.meshType === "instancedMesh") return;
|
|
100
|
-
let c = typeof e.rotation == "function" ? e.rotation() : null;
|
|
101
|
-
x.set(a, i.y, o), c ? S.set(c.x, c.y, c.z, c.w) : S.identity(), C.compose(x, S, s.scale).premultiply(s.invertedWorldMatrix).decompose(w, T, E), s.object.position.copy(w), c && s.object.quaternion.copy(T), s.object.updateMatrixWorld(!0);
|
|
102
|
-
}
|
|
103
|
-
function O(e, t, n, r, i) {
|
|
104
|
-
t && (t.position.x -= n, t.position.z -= r);
|
|
105
|
-
for (let t of e.query(u)) {
|
|
106
|
-
let e = t.get(u), a = e?.handle?.body;
|
|
107
|
-
a && D(a, n, r, i), e?.onOriginShift?.(n, r);
|
|
108
|
-
}
|
|
109
|
-
for (let t of e.query(d)) {
|
|
110
|
-
let e = t.get(d), a = e?.handle?.body;
|
|
111
|
-
a && D(a, n, r, i), e?.exitSpawnPos && t.set(d, {
|
|
112
|
-
...e,
|
|
113
|
-
exitSpawnPos: [
|
|
114
|
-
e.exitSpawnPos[0] - n,
|
|
115
|
-
e.exitSpawnPos[1],
|
|
116
|
-
e.exitSpawnPos[2] - r
|
|
117
|
-
]
|
|
118
|
-
}), e?.onOriginShift?.(n, r);
|
|
119
|
-
}
|
|
120
|
-
for (let t of e.query(p)) {
|
|
121
|
-
let e = t.get(p)?.getBody();
|
|
122
|
-
e && D(e, n, r, i);
|
|
123
|
-
}
|
|
124
|
-
if (i?.world) {
|
|
125
|
-
let e = i.world;
|
|
126
|
-
e.propagateModifiedBodyPositionsToColliders();
|
|
127
|
-
let t = e.timestep;
|
|
128
|
-
e.timestep = 0, e.step(), e.timestep = t;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
var k = {
|
|
132
|
-
speedKmh: 0,
|
|
133
|
-
rpm: 0,
|
|
134
|
-
gear: 1,
|
|
135
|
-
throttle: 0,
|
|
136
|
-
boost: 0,
|
|
137
|
-
mode: "foot",
|
|
138
|
-
activeVehicleId: null,
|
|
139
|
-
activeRetroPreset: "dreamcast",
|
|
140
|
-
nearVehicleId: null
|
|
141
|
-
}, A = new i.Vector3(), j = new i.Vector3(), M = o((t) => ({
|
|
142
|
-
boardVehicle: (e) => {
|
|
143
|
-
v(t);
|
|
144
|
-
let n = t.queryFirst(d);
|
|
145
|
-
for (let r of t.query(u)) if (r.get(u)?.id === e) {
|
|
146
|
-
n && n.add(m(r));
|
|
147
|
-
break;
|
|
148
|
-
}
|
|
149
|
-
let r = t.get(h);
|
|
150
|
-
t.set(h, {
|
|
151
|
-
activeVehicleId: e,
|
|
152
|
-
activeRetroPreset: r?.activeRetroPreset ?? "dreamcast"
|
|
153
|
-
}), k.activeVehicleId = e, k.nearVehicleId = null;
|
|
154
|
-
},
|
|
155
|
-
exitVehicle: () => {
|
|
156
|
-
v(t);
|
|
157
|
-
let e = t.get(h), n = e?.activeVehicleId || "", r = t.queryFirst(d);
|
|
158
|
-
for (let e of t.query(u)) {
|
|
159
|
-
let t = e.get(u);
|
|
160
|
-
if (t && n && t.id === n) {
|
|
161
|
-
if (r && (r.has(m(e)) && r.remove(m(e)), t.handle)) {
|
|
162
|
-
A.set(t.exitOffset[0] - t.centerOfMass[0], t.exitOffset[1] - t.centerOfMass[1], t.exitOffset[2] - t.centerOfMass[2]).applyQuaternion(t.handle.currQuat).add(t.handle.currPos), j.copy(t.handle.bodyZAxis).projectOnPlane(t.handle.upAxis).normalize();
|
|
163
|
-
let e = j.lengthSq() > 1e-6 ? Math.atan2(j.x, j.z) : 0, n = t.handle.currLinVel, i = r.get(d);
|
|
164
|
-
r.set(d, {
|
|
165
|
-
id: i?.id ?? "pilot",
|
|
166
|
-
handle: null,
|
|
167
|
-
exitSpawnPos: [
|
|
168
|
-
A.x,
|
|
169
|
-
A.y,
|
|
170
|
-
A.z
|
|
171
|
-
],
|
|
172
|
-
exitSpawnYaw: e,
|
|
173
|
-
exitLinVel: [
|
|
174
|
-
n.x,
|
|
175
|
-
n.y,
|
|
176
|
-
n.z
|
|
177
|
-
],
|
|
178
|
-
onOriginShift: i?.onOriginShift
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
t.handle?.setMovement({
|
|
182
|
-
forward: !1,
|
|
183
|
-
backward: !1,
|
|
184
|
-
steerLeft: !1,
|
|
185
|
-
steerRight: !1,
|
|
186
|
-
brake: !t.isFlight
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
t.set(h, {
|
|
191
|
-
activeVehicleId: "",
|
|
192
|
-
activeRetroPreset: e?.activeRetroPreset ?? "dreamcast"
|
|
193
|
-
}), Object.assign(k, {
|
|
194
|
-
activeVehicleId: null,
|
|
195
|
-
mode: "foot",
|
|
196
|
-
speedKmh: 0,
|
|
197
|
-
rpm: 0,
|
|
198
|
-
throttle: 0,
|
|
199
|
-
boost: 0
|
|
200
|
-
});
|
|
201
|
-
},
|
|
202
|
-
setRetroPreset: (n) => {
|
|
203
|
-
v(t), e(n);
|
|
204
|
-
let r = t.get(h);
|
|
205
|
-
t.set(h, {
|
|
206
|
-
activeVehicleId: r?.activeVehicleId ?? "",
|
|
207
|
-
activeRetroPreset: n
|
|
208
|
-
}), k.activeRetroPreset = n;
|
|
209
|
-
}
|
|
210
|
-
}));
|
|
211
|
-
export { d as ActorTrait, p as FloatingBodyTrait, f as InteractableTrait, m as PilotLink, u as VehicleTrait, h as WorldSessionTrait, v as ensureWorldSession, M as kolmoActions, k as kolmoTelemetry, g as kolmoWorld, b as readFloatingOriginAnchorXZ, O as shiftFloatingOriginEntities, _ as useActiveKolmoWorld, y as useWorldTrait };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import * as THREE from "three";
|
|
3
|
-
import type { CalibrationMetrics, GateDomain } from "./gateStore.js";
|
|
4
|
-
import type { ChopPartRole } from "./surfaceCutter.js";
|
|
5
|
-
import type { MeshIsland } from "./meshIslands.js";
|
|
6
|
-
export declare function makeStarterDomainScene(domain: GateDomain): THREE.Group;
|
|
7
|
-
/**
|
|
8
|
-
* Spatial 3D `@react-three/uikit` tags floating directly inside the Step-1 Calibration Plinth:
|
|
9
|
-
* - SI Bounding-Box Dimension Tag (`W × H × L m · Y-floor`)
|
|
10
|
-
* - Interactive 3D Pills over tagged `Wheel` & `Door`/`Hood`/`Trunk` islands as you orbit around the model.
|
|
11
|
-
*/
|
|
12
|
-
export declare function ImporterPlinthUikitTags({ cal, islands, wheelColors, partPicks, explodeAmount, onClickIsland, }: {
|
|
13
|
-
readonly cal: CalibrationMetrics;
|
|
14
|
-
readonly islands: readonly MeshIsland[];
|
|
15
|
-
readonly wheelColors: ReadonlyMap<number, string>;
|
|
16
|
-
readonly partPicks: Readonly<Record<number, ChopPartRole>>;
|
|
17
|
-
readonly explodeAmount: number;
|
|
18
|
-
readonly onClickIsland: (id: number) => void;
|
|
19
|
-
}): React.JSX.Element;
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { useMemo as e, useRef as t } from "react";
|
|
2
|
-
import * as n from "three";
|
|
3
|
-
import { useFrame as r, useThree as i } from "@react-three/fiber";
|
|
4
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
-
import { Container as s, Root as c, Text as l } from "@react-three/uikit";
|
|
6
|
-
// src/importer/ImporterPlinthUikitTags.tsx
|
|
7
|
-
function u(e) {
|
|
8
|
-
let t = new n.Group();
|
|
9
|
-
t.name = `Starter_${e}`;
|
|
10
|
-
let r = e === "c12" ? new n.BoxGeometry(3, 3, 3) : e === "person" ? new n.CapsuleGeometry(.3, 1, 6, 12) : e === "launcher" ? new n.BoxGeometry(.14, .24, .92) : e === "junk" ? new n.CylinderGeometry(.32, .34, .85, 12) : new n.BoxGeometry(1.72, 1.25, 4.25), i = new n.Mesh(r, new n.MeshStandardMaterial({
|
|
11
|
-
color: "#38bdf8",
|
|
12
|
-
roughness: .55,
|
|
13
|
-
flatShading: !0
|
|
14
|
-
}));
|
|
15
|
-
return i.position.y = e === "c12" ? 1.5 : e === "person" ? .88 : .65, t.add(i), t;
|
|
16
|
-
}
|
|
17
|
-
new n.Vector3();
|
|
18
|
-
function d({ position: e, label: n, sub: u, accent: d, onClick: f }) {
|
|
19
|
-
let p = t(null), { camera: m } = i();
|
|
20
|
-
return r(() => {
|
|
21
|
-
p.current && p.current.quaternion.copy(m.quaternion);
|
|
22
|
-
}), /* @__PURE__ */ a("group", {
|
|
23
|
-
ref: p,
|
|
24
|
-
position: [
|
|
25
|
-
e[0],
|
|
26
|
-
e[1],
|
|
27
|
-
e[2]
|
|
28
|
-
],
|
|
29
|
-
children: /* @__PURE__ */ a(c, {
|
|
30
|
-
pixelSize: .0022,
|
|
31
|
-
children: /* @__PURE__ */ o(s, {
|
|
32
|
-
paddingX: 10,
|
|
33
|
-
paddingY: 4,
|
|
34
|
-
borderRadius: 999,
|
|
35
|
-
backgroundColor: "rgba(9, 13, 24, 0.88)",
|
|
36
|
-
borderWidth: 1.5,
|
|
37
|
-
borderColor: d,
|
|
38
|
-
flexDirection: "row",
|
|
39
|
-
alignItems: "center",
|
|
40
|
-
gap: 6,
|
|
41
|
-
hover: { backgroundColor: "#1e293b" },
|
|
42
|
-
onClick: f ? (e) => {
|
|
43
|
-
e.stopPropagation(), f();
|
|
44
|
-
} : void 0,
|
|
45
|
-
children: [/* @__PURE__ */ a(l, {
|
|
46
|
-
fontSize: 12,
|
|
47
|
-
fontWeight: "bold",
|
|
48
|
-
color: d,
|
|
49
|
-
children: n
|
|
50
|
-
}), /* @__PURE__ */ a(l, {
|
|
51
|
-
fontSize: 11,
|
|
52
|
-
color: "#cbd5e1",
|
|
53
|
-
children: u
|
|
54
|
-
})]
|
|
55
|
-
})
|
|
56
|
-
})
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
function f({ cal: t, islands: n, wheelColors: r, partPicks: i, explodeAmount: s, onClickIsland: c }) {
|
|
60
|
-
let l = e(() => `${t.aabbSize[0].toFixed(2)}m W × ${t.aabbSize[1].toFixed(2)}m H × ${t.aabbSize[2].toFixed(2)}m L`, [t.aabbSize]), u = e(() => `Ymin ${t.minY >= 0 ? "+" : ""}${t.minY.toFixed(3)}m`, [t.minY]), f = e(() => {
|
|
61
|
-
let e = [];
|
|
62
|
-
for (let t of n) {
|
|
63
|
-
let n = r.get(t.id), a = i[t.id];
|
|
64
|
-
if (!n && !a) continue;
|
|
65
|
-
let o = Math.sign(t.center[0] || 1) * s * .65, c = [
|
|
66
|
-
t.center[0] + o,
|
|
67
|
-
t.center[1] + t.size[1] * .5 + .16,
|
|
68
|
-
t.center[2]
|
|
69
|
-
];
|
|
70
|
-
if (n) {
|
|
71
|
-
let r = t.center[0] >= 0 ? "L" : "R", i = t.center[2] >= 0 ? "F" : "R";
|
|
72
|
-
e.push({
|
|
73
|
-
id: t.id,
|
|
74
|
-
pos: c,
|
|
75
|
-
label: `WHEEL ${i}${r}`,
|
|
76
|
-
sub: `R ${(t.size[1] * .5).toFixed(2)}m`,
|
|
77
|
-
accent: n
|
|
78
|
-
});
|
|
79
|
-
} else a && e.push({
|
|
80
|
-
id: t.id,
|
|
81
|
-
pos: c,
|
|
82
|
-
label: a.toUpperCase(),
|
|
83
|
-
sub: `${t.triangleIndices.length} tris`,
|
|
84
|
-
accent: "#38bdf8"
|
|
85
|
-
});
|
|
86
|
-
if (e.length >= 12) break;
|
|
87
|
-
}
|
|
88
|
-
return e;
|
|
89
|
-
}, [
|
|
90
|
-
n,
|
|
91
|
-
r,
|
|
92
|
-
i,
|
|
93
|
-
s
|
|
94
|
-
]);
|
|
95
|
-
return /* @__PURE__ */ o("group", { children: [/* @__PURE__ */ a(d, {
|
|
96
|
-
position: [
|
|
97
|
-
0,
|
|
98
|
-
t.aabbSize[1] + t.minY + .34,
|
|
99
|
-
0
|
|
100
|
-
],
|
|
101
|
-
label: "SI BOUNDS",
|
|
102
|
-
sub: `${l} · ${u}`,
|
|
103
|
-
accent: "#00e5ff"
|
|
104
|
-
}), f.map((e) => /* @__PURE__ */ a(d, {
|
|
105
|
-
position: e.pos,
|
|
106
|
-
label: e.label,
|
|
107
|
-
sub: e.sub,
|
|
108
|
-
accent: e.accent,
|
|
109
|
-
onClick: () => c(e.id)
|
|
110
|
-
}, `pill_${e.id}`))] });
|
|
111
|
-
}
|
|
112
|
-
export { f as ImporterPlinthUikitTags, u as makeStarterDomainScene };
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import * as e from "three";
|
|
2
|
-
// src/importer/vehiclePanelAnim.ts
|
|
3
|
-
var t = {
|
|
4
|
-
plume: [
|
|
5
|
-
.22,
|
|
6
|
-
.91,
|
|
7
|
-
1
|
|
8
|
-
],
|
|
9
|
-
sparkle: [
|
|
10
|
-
1,
|
|
11
|
-
.72,
|
|
12
|
-
.24
|
|
13
|
-
],
|
|
14
|
-
fume: [
|
|
15
|
-
.68,
|
|
16
|
-
.74,
|
|
17
|
-
.82
|
|
18
|
-
],
|
|
19
|
-
trail: [
|
|
20
|
-
.32,
|
|
21
|
-
.88,
|
|
22
|
-
1
|
|
23
|
-
],
|
|
24
|
-
flare: [
|
|
25
|
-
1,
|
|
26
|
-
.18,
|
|
27
|
-
.08
|
|
28
|
-
]
|
|
29
|
-
}, n = new e.Vector3(0, 0, 0), r = new e.Vector3(0, 1, 0), i = new e.Vector3(0, 0, 1), a = new e.Matrix4(), o = new e.Quaternion(), s = new e.Vector3(), c = (e) => Number(e.toFixed(4));
|
|
30
|
-
function l(e) {
|
|
31
|
-
let t = e.clone();
|
|
32
|
-
return t.lengthSq() < 1e-10 ? t.set(0, 0, -1) : t.normalize(), a.lookAt(n, t, Math.abs(t.y) > .98 ? i : r), o.setFromRotationMatrix(a).normalize(), [
|
|
33
|
-
Number(o.x.toFixed(5)),
|
|
34
|
-
Number(o.y.toFixed(5)),
|
|
35
|
-
Number(o.z.toFixed(5)),
|
|
36
|
-
Number(o.w.toFixed(5))
|
|
37
|
-
];
|
|
38
|
-
}
|
|
39
|
-
function u(n) {
|
|
40
|
-
let r = [];
|
|
41
|
-
for (let i of n) {
|
|
42
|
-
let n = i.extension.kind;
|
|
43
|
-
if (!n) continue;
|
|
44
|
-
let a = i.rotation ?? [
|
|
45
|
-
0,
|
|
46
|
-
0,
|
|
47
|
-
0,
|
|
48
|
-
1
|
|
49
|
-
], o = new e.Object3D();
|
|
50
|
-
o.name = i.nodeName, o.position.set(i.translation[0], i.translation[1], i.translation[2]), o.quaternion.set(a[0], a[1], a[2], a[3]);
|
|
51
|
-
let s = i.extension.drive ?? "always", c = i.extension.color ?? t[n];
|
|
52
|
-
r.push({
|
|
53
|
-
nodeName: i.nodeName,
|
|
54
|
-
object: o,
|
|
55
|
-
localPosition: i.translation,
|
|
56
|
-
localQuaternion: a,
|
|
57
|
-
kind: n,
|
|
58
|
-
drive: s,
|
|
59
|
-
color: c,
|
|
60
|
-
size: i.extension.size ?? 1
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
return r;
|
|
64
|
-
}
|
|
65
|
-
function d(e, t) {
|
|
66
|
-
let [n, r, i] = e.min, [a, o, s] = e.max, [l, u, d] = e.center;
|
|
67
|
-
if (t === "door") {
|
|
68
|
-
let e = l >= 0;
|
|
69
|
-
return {
|
|
70
|
-
anchor: [
|
|
71
|
-
c(e ? a - .02 : n + .02),
|
|
72
|
-
c(u),
|
|
73
|
-
c(s)
|
|
74
|
-
],
|
|
75
|
-
axis: [
|
|
76
|
-
0,
|
|
77
|
-
1,
|
|
78
|
-
0
|
|
79
|
-
],
|
|
80
|
-
limits: e ? [-1.15, 0] : [0, 1.15],
|
|
81
|
-
openAngle: e ? -1.15 : 1.15,
|
|
82
|
-
explodeDir: [
|
|
83
|
-
e ? 1 : -1,
|
|
84
|
-
.1,
|
|
85
|
-
0
|
|
86
|
-
]
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
if (t === "hood") return {
|
|
90
|
-
anchor: [
|
|
91
|
-
c(l),
|
|
92
|
-
c(o),
|
|
93
|
-
c(i)
|
|
94
|
-
],
|
|
95
|
-
axis: [
|
|
96
|
-
1,
|
|
97
|
-
0,
|
|
98
|
-
0
|
|
99
|
-
],
|
|
100
|
-
limits: [-1.05, 0],
|
|
101
|
-
openAngle: -1.05,
|
|
102
|
-
explodeDir: [
|
|
103
|
-
0,
|
|
104
|
-
.55,
|
|
105
|
-
.75
|
|
106
|
-
]
|
|
107
|
-
};
|
|
108
|
-
if (t === "trunk") return {
|
|
109
|
-
anchor: [
|
|
110
|
-
c(l),
|
|
111
|
-
c(o),
|
|
112
|
-
c(s)
|
|
113
|
-
],
|
|
114
|
-
axis: [
|
|
115
|
-
1,
|
|
116
|
-
0,
|
|
117
|
-
0
|
|
118
|
-
],
|
|
119
|
-
limits: [0, 1.15],
|
|
120
|
-
openAngle: 1.15,
|
|
121
|
-
explodeDir: [
|
|
122
|
-
0,
|
|
123
|
-
.55,
|
|
124
|
-
-.75
|
|
125
|
-
]
|
|
126
|
-
};
|
|
127
|
-
if (t === "fender") {
|
|
128
|
-
let e = l >= 0;
|
|
129
|
-
return {
|
|
130
|
-
anchor: [
|
|
131
|
-
c(e ? n : a),
|
|
132
|
-
c(o),
|
|
133
|
-
c(d)
|
|
134
|
-
],
|
|
135
|
-
axis: [
|
|
136
|
-
0,
|
|
137
|
-
0,
|
|
138
|
-
1
|
|
139
|
-
],
|
|
140
|
-
limits: e ? [0, .55] : [-.55, 0],
|
|
141
|
-
openAngle: e ? .55 : -.55,
|
|
142
|
-
explodeDir: [
|
|
143
|
-
e ? 1 : -1,
|
|
144
|
-
.25,
|
|
145
|
-
0
|
|
146
|
-
]
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
let f = d >= 0;
|
|
150
|
-
return {
|
|
151
|
-
anchor: [
|
|
152
|
-
c(l),
|
|
153
|
-
c(o),
|
|
154
|
-
c(f ? i : s)
|
|
155
|
-
],
|
|
156
|
-
axis: [
|
|
157
|
-
1,
|
|
158
|
-
0,
|
|
159
|
-
0
|
|
160
|
-
],
|
|
161
|
-
limits: f ? [-.55, 0] : [0, .55],
|
|
162
|
-
openAngle: f ? -.55 : .55,
|
|
163
|
-
explodeDir: [
|
|
164
|
-
0,
|
|
165
|
-
.15,
|
|
166
|
-
f ? 1 : -1
|
|
167
|
-
]
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
function f(t) {
|
|
171
|
-
let n = t.bodies.filter((e) => e.joint !== null && e.joint.kind === "revolute" && e.joint.limits !== null).map((e) => {
|
|
172
|
-
let t = e.joint.limits, n = Math.abs(t[0]) > Math.abs(t[1]) ? t[0] : t[1];
|
|
173
|
-
return {
|
|
174
|
-
nodeName: e.nodeName,
|
|
175
|
-
role: (e.role ?? e.nodeName).toLowerCase(),
|
|
176
|
-
object: e.object,
|
|
177
|
-
restQuat: e.object.quaternion.clone(),
|
|
178
|
-
axis: e.joint.axis,
|
|
179
|
-
openAngle: n,
|
|
180
|
-
open: !1,
|
|
181
|
-
angle: 0
|
|
182
|
-
};
|
|
183
|
-
}), r = new Map(n.map((e) => [e.object, e])), i = new e.Quaternion();
|
|
184
|
-
return {
|
|
185
|
-
hasPanels: n.length > 0,
|
|
186
|
-
panelNames: n.map((e) => e.nodeName),
|
|
187
|
-
toggleHitObject(e) {
|
|
188
|
-
for (let t = e; t; t = t.parent) {
|
|
189
|
-
let e = r.get(t);
|
|
190
|
-
if (e) return e.open = !e.open, !0;
|
|
191
|
-
}
|
|
192
|
-
return !1;
|
|
193
|
-
},
|
|
194
|
-
toggleRolePrefix(e) {
|
|
195
|
-
let t = e.toLowerCase(), r = n.filter((e) => e.role.startsWith(t) || e.nodeName.toLowerCase().startsWith(t));
|
|
196
|
-
if (r.length === 0) return;
|
|
197
|
-
let i = !r[0].open;
|
|
198
|
-
for (let e of r) e.open = i;
|
|
199
|
-
},
|
|
200
|
-
toggleAll() {
|
|
201
|
-
if (n.length === 0) return;
|
|
202
|
-
let e = !n.some((e) => e.open);
|
|
203
|
-
for (let t of n) t.open = e;
|
|
204
|
-
},
|
|
205
|
-
step(e) {
|
|
206
|
-
let t = 1 - Math.exp(-11 * Math.min(e, .05));
|
|
207
|
-
for (let e of n) {
|
|
208
|
-
let n = e.open ? e.openAngle : 0;
|
|
209
|
-
Math.abs(n - e.angle) < 1e-4 || (e.angle += (n - e.angle) * t, s.set(e.axis[0], e.axis[1], e.axis[2]).normalize(), i.setFromAxisAngle(s, e.angle), e.object.quaternion.copy(e.restQuat).multiply(i));
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
export { u as buildPatchPreviewEmitters, d as computeChopPartHinge, f as createVehiclePanelAnimator, l as normalToMinusZQuaternion };
|