@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/dist/engine/kolmoRigs.js
CHANGED
|
@@ -1,59 +1,100 @@
|
|
|
1
|
-
import { syncRetroViewport
|
|
2
|
-
import { useEffect
|
|
3
|
-
import * as
|
|
4
|
-
import { useFrame
|
|
5
|
-
import { RoomEnvironment
|
|
1
|
+
import { syncRetroViewport } from "../shaders/retroUniforms.js";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
import * as THREE from "three";
|
|
4
|
+
import { useFrame, useThree } from "@react-three/fiber";
|
|
5
|
+
import { RoomEnvironment } from "three/examples/jsm/environments/RoomEnvironment.js";
|
|
6
6
|
// src/engine/kolmoRigs.tsx
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
function RoomEnvRig({ intensity = .65 }) {
|
|
8
|
+
const { gl, scene } = useThree();
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const pmrem = new THREE.PMREMGenerator(gl);
|
|
11
|
+
const room = new RoomEnvironment();
|
|
12
|
+
const rt = pmrem.fromScene(room, .04);
|
|
13
|
+
const prevEnv = scene.environment;
|
|
14
|
+
const prevInt = scene.environmentIntensity;
|
|
15
|
+
scene.environment = rt.texture;
|
|
16
|
+
scene.environmentIntensity = intensity;
|
|
17
|
+
room.dispose();
|
|
18
|
+
pmrem.dispose();
|
|
19
|
+
return () => {
|
|
20
|
+
scene.environment = prevEnv;
|
|
21
|
+
scene.environmentIntensity = prevInt;
|
|
22
|
+
rt.dispose();
|
|
13
23
|
};
|
|
14
24
|
}, [
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
])
|
|
25
|
+
gl,
|
|
26
|
+
scene,
|
|
27
|
+
intensity
|
|
28
|
+
]);
|
|
29
|
+
return null;
|
|
19
30
|
}
|
|
20
|
-
var
|
|
21
|
-
function
|
|
22
|
-
|
|
31
|
+
var _fbSize = new THREE.Vector2();
|
|
32
|
+
function RetroViewportSync({ onViewportChange } = {}) {
|
|
33
|
+
const { gl } = useThree();
|
|
34
|
+
const lastRef = useRef({
|
|
23
35
|
w: 0,
|
|
24
36
|
h: 0,
|
|
25
37
|
dpr: 0
|
|
26
38
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
w:
|
|
32
|
-
h:
|
|
33
|
-
dpr
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
gl.getDrawingBufferSize(_fbSize);
|
|
41
|
+
const dpr = gl.getPixelRatio();
|
|
42
|
+
lastRef.current = {
|
|
43
|
+
w: _fbSize.x,
|
|
44
|
+
h: _fbSize.y,
|
|
45
|
+
dpr
|
|
46
|
+
};
|
|
47
|
+
syncRetroViewport(_fbSize.x, _fbSize.y, dpr);
|
|
48
|
+
onViewportChange?.(_fbSize.x, _fbSize.y, dpr);
|
|
49
|
+
}, [gl, onViewportChange]);
|
|
50
|
+
useFrame(() => {
|
|
51
|
+
gl.getDrawingBufferSize(_fbSize);
|
|
52
|
+
const dpr = gl.getPixelRatio();
|
|
53
|
+
const last = lastRef.current;
|
|
54
|
+
if (_fbSize.x !== last.w || _fbSize.y !== last.h || dpr !== last.dpr) {
|
|
55
|
+
last.w = _fbSize.x;
|
|
56
|
+
last.h = _fbSize.y;
|
|
57
|
+
last.dpr = dpr;
|
|
58
|
+
syncRetroViewport(_fbSize.x, _fbSize.y, dpr);
|
|
59
|
+
onViewportChange?.(_fbSize.x, _fbSize.y, dpr);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
return null;
|
|
40
63
|
}
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
64
|
+
var _sunOff = new THREE.Vector3(-120, 85, -120);
|
|
65
|
+
var _origin = new THREE.Vector3(0, 0, 0);
|
|
66
|
+
var _up = new THREE.Vector3(0, 1, 0);
|
|
67
|
+
var _bx = new THREE.Vector3();
|
|
68
|
+
var _by = new THREE.Vector3();
|
|
69
|
+
var _bz = new THREE.Vector3();
|
|
70
|
+
new THREE.Matrix4().lookAt(_sunOff, _origin, _up).extractBasis(_bx, _by, _bz);
|
|
71
|
+
function ShadowSnapRig({ sunLightRef }) {
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
const sun = sunLightRef.current;
|
|
74
|
+
if (!sun) return;
|
|
75
|
+
const shadow = sun.shadow;
|
|
76
|
+
const origUpdate = shadow.updateMatrices;
|
|
77
|
+
shadow.updateMatrices = function(light) {
|
|
78
|
+
if (light === sun && sun.castShadow) {
|
|
79
|
+
const cam = shadow.camera;
|
|
80
|
+
const mapSize = shadow.mapSize.x || 1024;
|
|
81
|
+
const texel = Math.max(1, cam.right - cam.left) / mapSize;
|
|
82
|
+
const sx = Math.round(sun.target.position.dot(_bx) / texel) * texel;
|
|
83
|
+
const sy = Math.round(sun.target.position.dot(_by) / texel) * texel;
|
|
84
|
+
const sz = sun.target.position.dot(_bz);
|
|
85
|
+
sun.target.position.set(0, 0, 0).addScaledVector(_bx, sx).addScaledVector(_by, sy).addScaledVector(_bz, sz);
|
|
86
|
+
sun.position.copy(sun.target.position).add(_sunOff);
|
|
87
|
+
sun.updateMatrixWorld();
|
|
88
|
+
sun.target.updateMatrixWorld();
|
|
52
89
|
}
|
|
53
|
-
return
|
|
54
|
-
}
|
|
55
|
-
|
|
90
|
+
return origUpdate.call(this, light);
|
|
91
|
+
};
|
|
92
|
+
return () => {
|
|
93
|
+
shadow.updateMatrices = origUpdate;
|
|
56
94
|
};
|
|
57
|
-
}, [
|
|
95
|
+
}, [sunLightRef]);
|
|
96
|
+
return null;
|
|
58
97
|
}
|
|
59
|
-
export {
|
|
98
|
+
export { RetroViewportSync, RoomEnvRig, ShadowSnapRig };
|
|
99
|
+
|
|
100
|
+
//# sourceMappingURL=kolmoRigs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kolmoRigs.js","names":[],"sources":["../../src/engine/kolmoRigs.tsx"],"sourcesContent":["import { syncRetroViewport } from \"../shaders/retroShader.js\";\nimport React, { useEffect, useRef } from \"react\";\nimport * as THREE from \"three\";\nimport { useFrame, useThree } from \"@react-three/fiber\";\nimport { RoomEnvironment } from \"three/examples/jsm/environments/RoomEnvironment.js\";\n\nexport interface RoomEnvRigProps {\n intensity?: number;\n}\n\nexport function RoomEnvRig({ intensity = 0.65 }: RoomEnvRigProps): null {\n const { gl, scene } = useThree();\n useEffect(() => {\n const pmrem = new THREE.PMREMGenerator(gl);\n const room = new RoomEnvironment();\n const rt = pmrem.fromScene(room, 0.04);\n const prevEnv = scene.environment;\n const prevInt = scene.environmentIntensity;\n scene.environment = rt.texture;\n scene.environmentIntensity = intensity;\n room.dispose();\n pmrem.dispose();\n return () => {\n scene.environment = prevEnv;\n scene.environmentIntensity = prevInt;\n rt.dispose();\n };\n }, [gl, scene, intensity]);\n return null;\n}\n\nexport interface RetroViewportSyncProps {\n onViewportChange?: (w: number, h: number, dpr: number) => void;\n}\n\nconst _fbSize = new THREE.Vector2();\n\nexport function RetroViewportSync({ onViewportChange }: RetroViewportSyncProps = {}): null {\n const { gl } = useThree();\n const lastRef = useRef({ w: 0, h: 0, dpr: 0 });\n useEffect(() => {\n gl.getDrawingBufferSize(_fbSize);\n const dpr = gl.getPixelRatio();\n lastRef.current = { w: _fbSize.x, h: _fbSize.y, dpr };\n syncRetroViewport(_fbSize.x, _fbSize.y, dpr);\n onViewportChange?.(_fbSize.x, _fbSize.y, dpr);\n }, [gl, onViewportChange]);\n\n useFrame(() => {\n gl.getDrawingBufferSize(_fbSize);\n const dpr = gl.getPixelRatio();\n const last = lastRef.current;\n if (_fbSize.x !== last.w || _fbSize.y !== last.h || dpr !== last.dpr) {\n last.w = _fbSize.x;\n last.h = _fbSize.y;\n last.dpr = dpr;\n syncRetroViewport(_fbSize.x, _fbSize.y, dpr);\n onViewportChange?.(_fbSize.x, _fbSize.y, dpr);\n }\n });\n return null;\n}\n\nconst _sunOff = new THREE.Vector3(-120, 85, -120);\nconst _origin = new THREE.Vector3(0, 0, 0);\nconst _up = new THREE.Vector3(0, 1, 0);\nconst _bx = new THREE.Vector3();\nconst _by = new THREE.Vector3();\nconst _bz = new THREE.Vector3();\nnew THREE.Matrix4().lookAt(_sunOff, _origin, _up).extractBasis(_bx, _by, _bz);\n\nexport function ShadowSnapRig({ sunLightRef }: { sunLightRef: React.RefObject<THREE.DirectionalLight | null> }): null {\n useEffect(() => {\n const sun = sunLightRef.current;\n if (!sun)\n return;\n const shadow = sun.shadow;\n const origUpdate = shadow.updateMatrices;\n shadow.updateMatrices = function (this: THREE.DirectionalLightShadow, light: THREE.Light) {\n if (light === sun && sun.castShadow) {\n const cam = shadow.camera;\n const mapSize = shadow.mapSize.x || 1024;\n const texel = Math.max(1, cam.right - cam.left) / mapSize;\n const sx = Math.round(sun.target.position.dot(_bx) / texel) * texel;\n const sy = Math.round(sun.target.position.dot(_by) / texel) * texel;\n const sz = sun.target.position.dot(_bz);\n sun.target.position.set(0, 0, 0).addScaledVector(_bx, sx).addScaledVector(_by, sy).addScaledVector(_bz, sz);\n sun.position.copy(sun.target.position).add(_sunOff);\n sun.updateMatrixWorld();\n sun.target.updateMatrixWorld();\n }\n return origUpdate.call(this, light);\n };\n return () => {\n shadow.updateMatrices = origUpdate;\n };\n }, [sunLightRef]);\n return null;\n}\n"],"mappings":";;;;;;AAUA,SAAgB,WAAW,EAAE,YAAY,OAA+B;CACpE,MAAM,EAAE,IAAI,UAAU,SAAS;CAC/B,gBAAgB;EACZ,MAAM,QAAQ,IAAI,MAAM,eAAe,EAAE;EACzC,MAAM,OAAO,IAAI,gBAAgB;EACjC,MAAM,KAAK,MAAM,UAAU,MAAM,GAAI;EACrC,MAAM,UAAU,MAAM;EACtB,MAAM,UAAU,MAAM;EACtB,MAAM,cAAc,GAAG;EACvB,MAAM,uBAAuB;EAC7B,KAAK,QAAQ;EACb,MAAM,QAAQ;EACd,aAAa;GACT,MAAM,cAAc;GACpB,MAAM,uBAAuB;GAC7B,GAAG,QAAQ;EACf;CACJ,GAAG;EAAC;EAAI;EAAO;CAAS,CAAC;CACzB,OAAO;AACX;AAMA,IAAM,UAAU,IAAI,MAAM,QAAQ;AAElC,SAAgB,kBAAkB,EAAE,qBAA6C,CAAC,GAAS;CACvF,MAAM,EAAE,OAAO,SAAS;CACxB,MAAM,UAAU,OAAO;EAAE,GAAG;EAAG,GAAG;EAAG,KAAK;CAAE,CAAC;CAC7C,gBAAgB;EACZ,GAAG,qBA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,OAAO;IACnB,MAAM,UAAU,OAAO,QAAQ,KAAK;IACpC,MAAM,QAAQ,KAAK,IAAI,GAAG,IAAI,QAAQ,IAAI,IAAI,IAAI;IAClD,MAAM,KAAK,KAAK,MAAM,IAAI,OAAO,SAAS,IAAI,GAAG,IAAI,KAAK,IAAI;IAC9D,MAAM,KAAK,KAAK,MAAM,IAAI,OAAO,SAAS,IAAI,GAAG,IAAI,KAAK,IAAI;IAC9D,MAAM,KAAK,IAAI,OAAO,SAAS,IAAI,GAAG;IACtC,IAAI,OAAO,SAAS,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,gBAAgB,KAAK,EAAE,CAAC,CAAC,gBAAgB,KAAK,EAAE,CAAC,CAAC,gBAAgB,KAAK,EAAE;IAC1G,IAAI,SAAS,KAAK,IAAI,OAAO,QAAQ,CAAC,CAAC,IAAI,OAAO;IAClD,IAAI,kBAAkB;IACtB,IAAI,OAAO,kBAAkB;GACjC;GACA,OAAO,WAAW,KAAK,MAAM,KAAK;EACtC;EACA,aAAa;GACT,OAAO,iBAAiB;EAC5B;CACJ,GAAG,CAAC,WAAW,CAAC;CAChB,OAAO;AACX"}
|
|
@@ -1,100 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import type { EcctrlVehicleHandle } from "@pinkaphant/ecctrl/vehicle";
|
|
5
|
-
import { type RetroPresetId } from "../shaders/retroShader.js";
|
|
6
|
-
export type KolmoControlMode = "foot" | "car" | "flight";
|
|
7
|
-
export interface VehicleTraitData {
|
|
8
|
-
id: string;
|
|
9
|
-
handle: EcctrlVehicleHandle | null;
|
|
10
|
-
centerOfMass: [number, number, number];
|
|
11
|
-
seatOffset: [number, number, number];
|
|
12
|
-
exitOffset: [number, number, number];
|
|
13
|
-
isFlight: boolean;
|
|
14
|
-
onOriginShift?: (dx: number, dz: number) => void;
|
|
15
|
-
}
|
|
16
|
-
export interface ActorTraitData {
|
|
17
|
-
id: string;
|
|
18
|
-
handle: EcctrlHandle | null;
|
|
19
|
-
exitSpawnPos: [number, number, number] | null;
|
|
20
|
-
exitSpawnYaw: number;
|
|
21
|
-
exitLinVel: [number, number, number] | null;
|
|
22
|
-
onOriginShift?: (dx: number, dz: number) => void;
|
|
23
|
-
}
|
|
24
|
-
export declare const VehicleTrait: Trait<() => VehicleTraitData>;
|
|
25
|
-
export declare const ActorTrait: Trait<() => ActorTraitData>;
|
|
26
|
-
export declare const InteractableTrait: Trait<{
|
|
27
|
-
id: string;
|
|
28
|
-
radius: number;
|
|
29
|
-
kind: "vehicle" | "prop";
|
|
30
|
-
}>;
|
|
31
|
-
export interface FloatingOriginRapierSync {
|
|
32
|
-
world: {
|
|
33
|
-
timestep: number;
|
|
34
|
-
propagateModifiedBodyPositionsToColliders(): void;
|
|
35
|
-
step(): void;
|
|
36
|
-
};
|
|
37
|
-
rigidBodyStates?: Map<number, {
|
|
38
|
-
object: THREE.Object3D;
|
|
39
|
-
invertedWorldMatrix: THREE.Matrix4;
|
|
40
|
-
scale: THREE.Vector3;
|
|
41
|
-
meshType?: string;
|
|
42
|
-
}>;
|
|
43
|
-
}
|
|
44
|
-
type ShiftableBody = {
|
|
45
|
-
handle?: number;
|
|
46
|
-
translation(): {
|
|
47
|
-
x: number;
|
|
48
|
-
y: number;
|
|
49
|
-
z: number;
|
|
50
|
-
};
|
|
51
|
-
rotation?(): {
|
|
52
|
-
x: number;
|
|
53
|
-
y: number;
|
|
54
|
-
z: number;
|
|
55
|
-
w: number;
|
|
56
|
-
};
|
|
57
|
-
setTranslation(t: {
|
|
58
|
-
x: number;
|
|
59
|
-
y: number;
|
|
60
|
-
z: number;
|
|
61
|
-
}, wake: boolean): void;
|
|
62
|
-
};
|
|
63
|
-
export interface FloatingBodyTraitData {
|
|
64
|
-
id: string;
|
|
65
|
-
getBody: () => ShiftableBody | null;
|
|
66
|
-
}
|
|
67
|
-
export declare const FloatingBodyTrait: Trait<() => FloatingBodyTraitData>;
|
|
68
|
-
export declare const PilotLink: import("koota").Relation<Trait<Record<string, never>>>;
|
|
69
|
-
export declare const WorldSessionTrait: Trait<{
|
|
70
|
-
activeVehicleId: string;
|
|
71
|
-
activeRetroPreset: RetroPresetId;
|
|
72
|
-
}>;
|
|
73
|
-
export declare const kolmoWorld: World;
|
|
74
|
-
export declare function useActiveKolmoWorld(): World;
|
|
75
|
-
export declare function ensureWorldSession(w: World): void;
|
|
76
|
-
/**
|
|
77
|
-
* Subscribes to a world-level Koota trait directly on `world` without calling `useWorld()`,
|
|
78
|
-
* so `<KolmoWorld world={null}>` and standalone `<KolmoPhysics>` never throw without `<WorldProvider>`.
|
|
79
|
-
*/
|
|
80
|
-
export declare function useWorldTrait<T extends Trait>(world: World | null | undefined, t: T): TraitRecord<T> | undefined;
|
|
81
|
-
export declare function readFloatingOriginAnchorXZ(world: World, camera: THREE.Camera | null): [number, number];
|
|
82
|
-
export declare function shiftFloatingOriginEntities(world: World, camera: THREE.Camera | null, dx: number, dz: number, rapier?: FloatingOriginRapierSync | null): void;
|
|
83
|
-
export interface KolmoTelemetryState {
|
|
84
|
-
speedKmh: number;
|
|
85
|
-
rpm: number;
|
|
86
|
-
gear: number;
|
|
87
|
-
throttle: number;
|
|
88
|
-
boost: number;
|
|
89
|
-
mode: KolmoControlMode;
|
|
90
|
-
activeVehicleId: string | null;
|
|
91
|
-
activeRetroPreset: RetroPresetId;
|
|
92
|
-
nearVehicleId: string | null;
|
|
93
|
-
}
|
|
94
|
-
export declare const kolmoTelemetry: KolmoTelemetryState;
|
|
95
|
-
export declare const kolmoActions: import("koota").Actions<{
|
|
96
|
-
boardVehicle: (vehicleId: string) => void;
|
|
97
|
-
exitVehicle: () => void;
|
|
98
|
-
setRetroPreset: (preset: RetroPresetId) => void;
|
|
99
|
-
}>;
|
|
100
|
-
export {};
|
|
1
|
+
export { flipVehicleBodyUpright, kolmoActions, kolmoTelemetry, type KolmoTelemetryState, } from "./kolmoActions.js";
|
|
2
|
+
export { readFloatingOriginAnchorXZ, shiftFloatingOriginEntities, type FloatingOriginRapierSync, } from "./kolmoFloatingOrigin.js";
|
|
3
|
+
export { ActorTrait, FloatingBodyTrait, InteractableTrait, PilotLink, PilotedTag, TransformTrait, VehicleTelemetryTrait, VehicleTrait, VelocityTrait, WorldSessionTrait, WorldSpawnTrait, ensureWorldSession, kolmoWorld, pilotedVehicleQuery, publishWorldSpawn, useActiveKolmoWorld, vehicleSimQuery, writeEntityKinematics, writeVehicleTelemetry, type ActorTraitData, type FloatingBodyTraitData, type KolmoControlMode, type ShiftableBody, type VehicleTraitData, type WorldSpawnData, } from "./kolmoTraits.js";
|
|
@@ -7,7 +7,7 @@ export interface KolmoSurfaceProps {
|
|
|
7
7
|
size?: number;
|
|
8
8
|
position?: [number, number, number];
|
|
9
9
|
}
|
|
10
|
-
export declare function KolmoSurface({ src, bundle, size, position }: KolmoSurfaceProps): React.JSX.Element;
|
|
10
|
+
export declare function KolmoSurface({ src, bundle, size, position, }: KolmoSurfaceProps): React.JSX.Element;
|
|
11
11
|
export declare function togglePropJoint(handle: KhrAssemblyHandle | null, bundle: KhrAssetBundle, openState: boolean, clickedObj?: THREE.Object3D | null, perBodyOpen?: Map<string, boolean>): boolean;
|
|
12
12
|
export interface KolmoPropProps {
|
|
13
13
|
src?: string;
|
|
@@ -15,4 +15,4 @@ export interface KolmoPropProps {
|
|
|
15
15
|
position?: [number, number, number];
|
|
16
16
|
fixed?: boolean;
|
|
17
17
|
}
|
|
18
|
-
export declare function KolmoProp({ src, bundle, position, fixed }: KolmoPropProps): React.JSX.Element | null;
|
|
18
|
+
export declare function KolmoProp({ src, bundle, position, fixed, }: KolmoPropProps): React.JSX.Element | null;
|
|
@@ -1,182 +1,198 @@
|
|
|
1
|
-
import { applyRetroMaterial
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { applyRetroMaterial } from "../shaders/retroShader.js";
|
|
2
|
+
import { isolateSceneMaterials } from "./kolmoVehicleConfig.js";
|
|
3
|
+
import { ShiftedFixedBody } from "./shiftedFixedBody.js";
|
|
4
|
+
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from "react";
|
|
5
|
+
import * as THREE from "three";
|
|
6
|
+
import { KhrAssembly, cloneKhrBundle, useKhrGlb } from "@khr3/core";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { CuboidCollider } from "@react-three/rapier";
|
|
8
9
|
// src/engine/kolmoSurface.tsx
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
for (let
|
|
12
|
-
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
function createArenaGridTex(repeatCount) {
|
|
11
|
+
const data = /* @__PURE__ */ new Uint8Array(16384);
|
|
12
|
+
for (let y = 0; y < 64; y++) for (let x = 0; x < 64; x++) {
|
|
13
|
+
const idx = (y * 64 + x) * 4;
|
|
14
|
+
if (x === 0 || y === 0) {
|
|
15
|
+
data[idx] = 56;
|
|
16
|
+
data[idx + 1] = 178;
|
|
17
|
+
data[idx + 2] = 216;
|
|
18
|
+
} else if (x === 32 || y === 32) {
|
|
19
|
+
data[idx] = 44;
|
|
20
|
+
data[idx + 1] = 58;
|
|
21
|
+
data[idx + 2] = 78;
|
|
22
|
+
} else {
|
|
23
|
+
const c = (x >> 4) + (y >> 4) & 1 ? 30 : 35;
|
|
24
|
+
data[idx] = c;
|
|
25
|
+
data[idx + 1] = c + 3;
|
|
26
|
+
data[idx + 2] = c + 9;
|
|
18
27
|
}
|
|
19
|
-
|
|
28
|
+
data[idx + 3] = 255;
|
|
20
29
|
}
|
|
21
|
-
|
|
22
|
-
|
|
30
|
+
const tex = new THREE.DataTexture(data, 64, 64, THREE.RGBAFormat);
|
|
31
|
+
tex.colorSpace = THREE.SRGBColorSpace;
|
|
32
|
+
tex.wrapS = THREE.RepeatWrapping;
|
|
33
|
+
tex.wrapT = THREE.RepeatWrapping;
|
|
34
|
+
tex.magFilter = THREE.NearestFilter;
|
|
35
|
+
tex.minFilter = THREE.NearestFilter;
|
|
36
|
+
tex.repeat.set(repeatCount, repeatCount);
|
|
37
|
+
tex.needsUpdate = true;
|
|
38
|
+
return tex;
|
|
23
39
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
|
|
40
|
+
function ArenaSlab({ size, position }) {
|
|
41
|
+
const res = useMemo(() => {
|
|
42
|
+
const tex = createArenaGridTex(Math.max(4, Math.round(size / 8)));
|
|
27
43
|
return {
|
|
28
|
-
tex
|
|
29
|
-
geo: new
|
|
30
|
-
mat:
|
|
31
|
-
map:
|
|
44
|
+
tex,
|
|
45
|
+
geo: new THREE.BoxGeometry(size, 1, size),
|
|
46
|
+
mat: applyRetroMaterial(new THREE.MeshStandardMaterial({
|
|
47
|
+
map: tex,
|
|
32
48
|
roughness: .92,
|
|
33
49
|
metalness: .06
|
|
34
|
-
}), { flatShading:
|
|
50
|
+
}), { flatShading: false })
|
|
35
51
|
};
|
|
36
|
-
}, [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
52
|
+
}, [size]);
|
|
53
|
+
useEffect(() => () => {
|
|
54
|
+
res.geo.dispose();
|
|
55
|
+
res.mat.dispose();
|
|
56
|
+
res.tex.dispose();
|
|
57
|
+
}, [res]);
|
|
58
|
+
return /* @__PURE__ */ jsxs(ShiftedFixedBody, {
|
|
59
|
+
x: position[0],
|
|
60
|
+
y: position[1] - .5,
|
|
61
|
+
z: position[2],
|
|
43
62
|
friction: .95,
|
|
44
|
-
children: [/* @__PURE__ */
|
|
63
|
+
children: [/* @__PURE__ */ jsx(CuboidCollider, {
|
|
45
64
|
args: [
|
|
46
|
-
|
|
65
|
+
size * .5,
|
|
47
66
|
.5,
|
|
48
|
-
|
|
67
|
+
size * .5
|
|
49
68
|
],
|
|
50
69
|
restitution: .04
|
|
51
|
-
}), /* @__PURE__ */
|
|
70
|
+
}), /* @__PURE__ */ jsx("mesh", {
|
|
52
71
|
name: "KolmoArenaSlab",
|
|
53
|
-
geometry:
|
|
54
|
-
material:
|
|
55
|
-
receiveShadow:
|
|
72
|
+
geometry: res.geo,
|
|
73
|
+
material: res.mat,
|
|
74
|
+
receiveShadow: true
|
|
56
75
|
})]
|
|
57
76
|
});
|
|
58
77
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
61
|
-
return
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (t.material) {
|
|
65
|
-
if (Array.isArray(t.material)) t.material = t.material.map((e) => {
|
|
66
|
-
let t = e.clone();
|
|
67
|
-
return i.push(t), t;
|
|
68
|
-
});
|
|
69
|
-
else {
|
|
70
|
-
let e = t.material.clone();
|
|
71
|
-
i.push(e), t.material = e;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
})(r.scene), t(r.scene, n === void 0 ? void 0 : { flatShading: n }), {
|
|
76
|
-
cloned: r,
|
|
77
|
-
disposeMats: () => {
|
|
78
|
-
for (let e of i) e.dispose();
|
|
79
|
-
}
|
|
78
|
+
function cloneRetroBundle(src, flatShading) {
|
|
79
|
+
const cloned = cloneKhrBundle(src);
|
|
80
|
+
return {
|
|
81
|
+
cloned,
|
|
82
|
+
disposeMats: isolateSceneMaterials([cloned.scene], flatShading)
|
|
80
83
|
};
|
|
81
84
|
}
|
|
82
|
-
function
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
function BundleSurface({ bundle, position }) {
|
|
86
|
+
const { cloned, disposeMats } = useMemo(() => cloneRetroBundle(bundle, false), [bundle]);
|
|
87
|
+
useLayoutEffect(() => () => disposeMats(), [disposeMats]);
|
|
88
|
+
return /* @__PURE__ */ jsx(KhrAssembly, {
|
|
89
|
+
bundle: cloned,
|
|
90
|
+
position,
|
|
91
|
+
fixedRoot: true
|
|
88
92
|
});
|
|
89
93
|
}
|
|
90
|
-
function
|
|
91
|
-
return /* @__PURE__ */
|
|
92
|
-
bundle:
|
|
93
|
-
position
|
|
94
|
+
function UrlSurface({ src, position }) {
|
|
95
|
+
return /* @__PURE__ */ jsx(BundleSurface, {
|
|
96
|
+
bundle: useKhrGlb(src),
|
|
97
|
+
position
|
|
94
98
|
});
|
|
95
99
|
}
|
|
96
|
-
function
|
|
100
|
+
function KolmoSurface({ src, bundle, size = 200, position = [
|
|
97
101
|
0,
|
|
98
102
|
0,
|
|
99
103
|
0
|
|
100
104
|
] }) {
|
|
101
|
-
|
|
102
|
-
bundle
|
|
103
|
-
position
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
105
|
+
if (bundle) return /* @__PURE__ */ jsx(BundleSurface, {
|
|
106
|
+
bundle,
|
|
107
|
+
position
|
|
108
|
+
});
|
|
109
|
+
if (src) return /* @__PURE__ */ jsx(UrlSurface, {
|
|
110
|
+
src,
|
|
111
|
+
position
|
|
112
|
+
});
|
|
113
|
+
return /* @__PURE__ */ jsx(ArenaSlab, {
|
|
114
|
+
size,
|
|
115
|
+
position
|
|
110
116
|
});
|
|
111
117
|
}
|
|
112
|
-
function
|
|
113
|
-
if (!
|
|
118
|
+
function resolveJointTargets(limits) {
|
|
119
|
+
if (!limits) return {
|
|
114
120
|
open: 1.35,
|
|
115
121
|
closed: 0
|
|
116
122
|
};
|
|
117
|
-
|
|
123
|
+
const [lo, hi] = limits;
|
|
118
124
|
return {
|
|
119
|
-
open: Math.abs(
|
|
120
|
-
closed: Math.min(
|
|
125
|
+
open: Math.abs(hi) >= Math.abs(lo) ? hi : lo,
|
|
126
|
+
closed: Math.min(hi, Math.max(lo, 0))
|
|
121
127
|
};
|
|
122
128
|
}
|
|
123
|
-
function
|
|
124
|
-
if (!
|
|
125
|
-
if (
|
|
126
|
-
let
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
if (
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
function togglePropJoint(handle, bundle, openState, clickedObj, perBodyOpen) {
|
|
130
|
+
if (!handle) return openState;
|
|
131
|
+
if (clickedObj && perBodyOpen) {
|
|
132
|
+
let cur = clickedObj;
|
|
133
|
+
while (cur) {
|
|
134
|
+
const hit = bundle.bodies.find((b) => b.object === cur && b.joint?.drive?.stiffness !== void 0);
|
|
135
|
+
if (hit) {
|
|
136
|
+
const nextOpen = !(perBodyOpen.get(hit.nodeName) ?? false);
|
|
137
|
+
perBodyOpen.set(hit.nodeName, nextOpen);
|
|
138
|
+
const { open, closed } = resolveJointTargets(hit.joint?.limits ?? null);
|
|
139
|
+
handle.setJointTarget(hit.nodeName, nextOpen ? open : closed);
|
|
140
|
+
return nextOpen;
|
|
134
141
|
}
|
|
135
|
-
|
|
142
|
+
cur = cur.parent;
|
|
136
143
|
}
|
|
137
144
|
}
|
|
138
|
-
|
|
139
|
-
for (
|
|
140
|
-
if (!
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
const nextAll = !openState;
|
|
146
|
+
for (const b of bundle.bodies) {
|
|
147
|
+
if (!b.joint?.drive || b.joint.drive.stiffness === void 0) continue;
|
|
148
|
+
const { open, closed } = resolveJointTargets(b.joint.limits);
|
|
149
|
+
perBodyOpen?.set(b.nodeName, nextAll);
|
|
150
|
+
handle.setJointTarget(b.nodeName, nextAll ? open : closed);
|
|
143
151
|
}
|
|
144
|
-
return
|
|
152
|
+
return nextAll;
|
|
145
153
|
}
|
|
146
|
-
function
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
154
|
+
function BundleProp({ bundle, position, fixed }) {
|
|
155
|
+
const asmRef = useRef(null);
|
|
156
|
+
const openRef = useRef(false);
|
|
157
|
+
const perBodyRef = useRef(/* @__PURE__ */ new Map());
|
|
158
|
+
const { cloned, disposeMats } = useMemo(() => cloneRetroBundle(bundle), [bundle]);
|
|
159
|
+
useLayoutEffect(() => () => disposeMats(), [disposeMats]);
|
|
160
|
+
const onClick = useCallback((e) => {
|
|
161
|
+
e?.stopPropagation?.();
|
|
162
|
+
openRef.current = togglePropJoint(asmRef.current, cloned, openRef.current, e?.object ?? null, perBodyRef.current);
|
|
163
|
+
}, [cloned]);
|
|
164
|
+
return /* @__PURE__ */ jsx(KhrAssembly, {
|
|
165
|
+
ref: asmRef,
|
|
166
|
+
bundle: cloned,
|
|
167
|
+
position,
|
|
168
|
+
fixedRoot: fixed,
|
|
169
|
+
onClick
|
|
158
170
|
});
|
|
159
171
|
}
|
|
160
|
-
function
|
|
161
|
-
return /* @__PURE__ */
|
|
162
|
-
bundle:
|
|
163
|
-
position
|
|
164
|
-
fixed
|
|
172
|
+
function UrlProp({ src, position, fixed }) {
|
|
173
|
+
return /* @__PURE__ */ jsx(BundleProp, {
|
|
174
|
+
bundle: useKhrGlb(src),
|
|
175
|
+
position,
|
|
176
|
+
fixed
|
|
165
177
|
});
|
|
166
178
|
}
|
|
167
|
-
function
|
|
179
|
+
function KolmoProp({ src, bundle, position = [
|
|
168
180
|
0,
|
|
169
181
|
0,
|
|
170
182
|
0
|
|
171
|
-
], fixed
|
|
172
|
-
|
|
173
|
-
bundle
|
|
174
|
-
position
|
|
175
|
-
fixed
|
|
176
|
-
})
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
183
|
+
], fixed = false }) {
|
|
184
|
+
if (bundle) return /* @__PURE__ */ jsx(BundleProp, {
|
|
185
|
+
bundle,
|
|
186
|
+
position,
|
|
187
|
+
fixed
|
|
188
|
+
});
|
|
189
|
+
if (src) return /* @__PURE__ */ jsx(UrlProp, {
|
|
190
|
+
src,
|
|
191
|
+
position,
|
|
192
|
+
fixed
|
|
193
|
+
});
|
|
194
|
+
return null;
|
|
181
195
|
}
|
|
182
|
-
export {
|
|
196
|
+
export { KolmoProp, KolmoSurface, togglePropJoint };
|
|
197
|
+
|
|
198
|
+
//# sourceMappingURL=kolmoSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kolmoSurface.js","names":[],"sources":["../../src/engine/kolmoSurface.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from \"react\";\nimport * as THREE from \"three\";\nimport { CuboidCollider } from \"@react-three/rapier\";\nimport { KhrAssembly, cloneKhrBundle, useKhrGlb, type KhrAssemblyHandle, type KhrAssetBundle } from \"@khr3/core\";\nimport { applyRetroMaterial } from \"../shaders/retroShader.js\";\nimport { isolateSceneMaterials } from \"./kolmoVehicleConfig.js\";\nimport { ShiftedFixedBody } from \"./shiftedFixedBody.js\";\n\nfunction createArenaGridTex(repeatCount: number): THREE.DataTexture {\n const data = new Uint8Array(64 * 64 * 4);\n for (let y = 0; y < 64; y++) {\n for (let x = 0; x < 64; x++) {\n const idx = (y * 64 + x) * 4;\n if (x === 0 || y === 0) {\n data[idx] = 56;\n data[idx + 1] = 178;\n data[idx + 2] = 216;\n }\n else if (x === 32 || y === 32) {\n data[idx] = 44;\n data[idx + 1] = 58;\n data[idx + 2] = 78;\n }\n else {\n const c = (((x >> 4) + (y >> 4)) & 1) ? 30 : 35;\n data[idx] = c;\n data[idx + 1] = c + 3;\n data[idx + 2] = c + 9;\n }\n data[idx + 3] = 255;\n }\n }\n const tex = new THREE.DataTexture(data, 64, 64, THREE.RGBAFormat);\n tex.colorSpace = THREE.SRGBColorSpace;\n tex.wrapS = THREE.RepeatWrapping;\n tex.wrapT = THREE.RepeatWrapping;\n tex.magFilter = THREE.NearestFilter;\n tex.minFilter = THREE.NearestFilter;\n tex.repeat.set(repeatCount, repeatCount);\n tex.needsUpdate = true;\n return tex;\n}\n\nfunction ArenaSlab({ size, position }: { size: number; position: [number, number, number] }): React.JSX.Element {\n const res = useMemo(() => {\n const tex = createArenaGridTex(Math.max(4, Math.round(size / 8)));\n return {\n tex,\n geo: new THREE.BoxGeometry(size, 1, size),\n mat: applyRetroMaterial(new THREE.MeshStandardMaterial({ map: tex, roughness: 0.92, metalness: 0.06 }), {\n flatShading: false,\n }),\n };\n }, [size]);\n\n useEffect(\n () => () => {\n res.geo.dispose();\n res.mat.dispose();\n res.tex.dispose();\n },\n [res],\n );\n\n return (\n <ShiftedFixedBody x={position[0]} y={position[1] - 0.5} z={position[2]} friction={0.95}>\n <CuboidCollider args={[size * 0.5, 0.5, size * 0.5]} restitution={0.04} />\n <mesh name=\"KolmoArenaSlab\" geometry={res.geo} material={res.mat} receiveShadow />\n </ShiftedFixedBody>\n );\n}\n\nfunction cloneRetroBundle(src: KhrAssetBundle, flatShading?: boolean): { cloned: KhrAssetBundle; disposeMats: () => void } {\n const cloned = cloneKhrBundle(src);\n const disposeMats = isolateSceneMaterials([cloned.scene], flatShading);\n return { cloned, disposeMats };\n}\n\nfunction BundleSurface({ bundle, position }: { bundle: KhrAssetBundle; position: [number, number, number] }): React.JSX.Element {\n const { cloned, disposeMats } = useMemo(() => cloneRetroBundle(bundle, false), [bundle]);\n useLayoutEffect(() => () => disposeMats(), [disposeMats]);\n return <KhrAssembly bundle={cloned} position={position} fixedRoot />;\n}\n\nfunction UrlSurface({ src, position }: { src: string; position: [number, number, number] }): React.JSX.Element {\n return <BundleSurface bundle={useKhrGlb(src)} position={position} />;\n}\n\nexport interface KolmoSurfaceProps {\n src?: string;\n bundle?: KhrAssetBundle;\n size?: number;\n position?: [number, number, number];\n}\n\nexport function KolmoSurface({\n src,\n bundle,\n size = 200,\n position = [0, 0, 0],\n}: KolmoSurfaceProps): React.JSX.Element {\n if (bundle)\n return <BundleSurface bundle={bundle} position={position} />;\n if (src)\n return <UrlSurface src={src} position={position} />;\n return <ArenaSlab size={size} position={position} />;\n}\n\nfunction resolveJointTargets(limits: [number, number] | null): { open: number; closed: number } {\n if (!limits)\n return { open: 1.35, closed: 0 };\n const [lo, hi] = limits;\n return {\n open: Math.abs(hi) >= Math.abs(lo) ? hi : lo,\n closed: Math.min(hi, Math.max(lo, 0)),\n };\n}\n\nexport function togglePropJoint(\n handle: KhrAssemblyHandle | null,\n bundle: KhrAssetBundle,\n openState: boolean,\n clickedObj?: THREE.Object3D | null,\n perBodyOpen?: Map<string, boolean>,\n): boolean {\n if (!handle)\n return openState;\n if (clickedObj && perBodyOpen) {\n let cur: THREE.Object3D | null = clickedObj;\n while (cur) {\n const hit = bundle.bodies.find((b) => b.object === cur && b.joint?.drive?.stiffness !== undefined);\n if (hit) {\n const nextOpen = !(perBodyOpen.get(hit.nodeName) ?? false);\n perBodyOpen.set(hit.nodeName, nextOpen);\n const { open, closed } = resolveJointTargets(hit.joint?.limits ?? null);\n handle.setJointTarget(hit.nodeName, nextOpen ? open : closed);\n return nextOpen;\n }\n cur = cur.parent;\n }\n }\n const nextAll = !openState;\n for (const b of bundle.bodies) {\n if (!b.joint?.drive || b.joint.drive.stiffness === undefined)\n continue;\n const { open, closed } = resolveJointTargets(b.joint.limits);\n perBodyOpen?.set(b.nodeName, nextAll);\n handle.setJointTarget(b.nodeName, nextAll ? open : closed);\n }\n return nextAll;\n}\n\nfunction BundleProp({\n bundle,\n position,\n fixed,\n}: {\n bundle: KhrAssetBundle;\n position: [number, number, number];\n fixed: boolean;\n}): React.JSX.Element {\n const asmRef = useRef<KhrAssemblyHandle | null>(null);\n const openRef = useRef(false);\n const perBodyRef = useRef(new Map<string, boolean>());\n const { cloned, disposeMats } = useMemo(() => cloneRetroBundle(bundle), [bundle]);\n useLayoutEffect(() => () => disposeMats(), [disposeMats]);\n\n const onClick = useCallback(\n (e: { stopPropagation?: () => void; object?: THREE.Object3D }) => {\n e?.stopPropagation?.();\n openRef.current = togglePropJoint(asmRef.current, cloned, openRef.current, e?.object ?? null, perBodyRef.current);\n },\n [cloned],\n );\n\n return <KhrAssembly ref={asmRef} bundle={cloned} position={position} fixedRoot={fixed} onClick={onClick} />;\n}\n\nfunction UrlProp({\n src,\n position,\n fixed,\n}: {\n src: string;\n position: [number, number, number];\n fixed: boolean;\n}): React.JSX.Element {\n return <BundleProp bundle={useKhrGlb(src)} position={position} fixed={fixed} />;\n}\n\nexport interface KolmoPropProps {\n src?: string;\n bundle?: KhrAssetBundle;\n position?: [number, number, number];\n fixed?: boolean;\n}\n\nexport function KolmoProp({\n src,\n bundle,\n position = [0, 0, 0],\n fixed = false,\n}: KolmoPropProps): React.JSX.Element | null {\n if (bundle)\n return <BundleProp bundle={bundle} position={position} fixed={fixed} />;\n if (src)\n return <UrlProp src={src} position={position} fixed={fixed} />;\n return null;\n}\n"],"mappings":";;;;;;;;;AAQA,SAAS,mBAAmB,aAAwC;CAChE,MAAM,uBAAO,IAAI,WAAW,KAAW;CACvC,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI,KACpB,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI,KAAK;EACzB,MAAM,OAAO,IAAI,KAAK,KAAK;EAC3B,IAAI,MAAM,KAAK,MAAM,GAAG;GACpB,KAAK,OAAO;GACZ,KAAK,MAAM,KAAK;GAChB,KAAK,MAAM,KAAK;EACpB,OACK,IAAI,MAAM,MAAM,MAAM,IAAI;GAC3B,KAAK,OAAO;GACZ,KAAK,MAAM,KAAK;GAChB,KAAK,MAAM,KAAK;EACpB,OACK;GACD,MAAM,KAAO,KAAK,MAAM,KAAK,KAAM,IAAK,KAAK;GAC7C,KAAK,OAAO;GACZ,KAAK,MAAM,KAAK,IAAI;GACpB,KAAK,MAAM,KAAK,IAAI;EACxB;EACA,KAAK,MAAM,KAAK;CACpB;CAEJ,MAAM,MAAM,IAAI,MAAM,YAAY,MAAM,IAAI,IAAI,MAAM,UAAU;CAChE,IAAI,aAAa,MAAM;CACvB,IAAI,QAAQ,MAAM;CAClB,IAAI,QAAQ,MAAM;CAClB,IAAI,YAAY,MAAM;CACtB,IAAI,YAAY,MAAM;CACtB,IAAI,OAAO,IAAI,aAAa,WAAW;CACvC,IAAI,cAAc;CAClB,OAAO;AACX;AAEA,SAAS,UAAU,EA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