iflow-engine-base-3d 3.11.3 → 3.11.4
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/dist/bim-engine-sdk.es.js +9 -50
- package/dist/bim-engine-sdk.umd.js +291 -18724
- package/dist/chunks/{engine-3d-Cq9w_B8R.js → engine-3d-9GJt1rzb.js} +490 -550
- package/dist/chunks/{sdk-assets-DseBGYv8.js → sdk-assets-BbXNfc5u.js} +11 -11
- package/dist/chunks/sdk-runtime-kyCuafGM.js +1174 -0
- package/dist/chunks/sdk-vendor-DYgn7sFs.js +22392 -0
- package/dist/chunks/{three-vendor-M4ZIGmaO.js → three-vendor-ox3_iXFc.js} +6604 -7305
- package/dist/iflow-engine-base.css +1 -1
- package/dist/index.d.ts +6 -7314
- package/package.json +2 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +0 -1
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +0 -1
- package/dist/Cesium/Assets/Images/bing_maps_credit.png +0 -0
- package/dist/Cesium/Assets/Images/cesium_credit.png +0 -0
- package/dist/Cesium/Assets/Images/google_earth_credit.png +0 -0
- package/dist/Cesium/Assets/Images/ion-credit.png +0 -0
- package/dist/Cesium/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/dist/Cesium/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml +0 -14
- package/dist/Cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/dist/Cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/dist/Cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/dist/Cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/dist/Cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/dist/Cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/dist/Cesium/Assets/Textures/maki/airfield.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/airport.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/america-football.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/art-gallery.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/bakery.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/bank.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/bar.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/baseball.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/basketball.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/beer.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/bicycle.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/building.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/bus.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/cafe.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/camera.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/campsite.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/car.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/cemetery.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/cesium.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/chemist.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/cinema.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/circle-stroked.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/circle.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/city.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/clothing-store.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/college.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/commercial.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/cricket.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/cross.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/dam.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/danger.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/disability.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/dog-park.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/embassy.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/entrance.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/farm.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/fast-food.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/ferry.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/fire-station.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/fuel.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/garden.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/gift.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/golf.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/grocery.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/hairdresser.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/harbor.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/heart.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/heliport.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/hospital.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/ice-cream.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/industrial.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/land-use.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/laundry.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/library.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/lighthouse.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/lodging.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/logging.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/london-underground.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/marker-stroked.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/marker.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/minefield.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/mobilephone.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/monument.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/museum.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/music.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/oil-well.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/park.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/park2.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/parking-garage.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/parking.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/pharmacy.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/pitch.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/place-of-worship.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/playground.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/police.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/polling-place.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/post.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/prison.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/rail-above.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/rail-light.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/rail-metro.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/rail-underground.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/rail.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/religious-christian.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/religious-jewish.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/religious-muslim.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/restaurant.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/roadblock.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/rocket.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/school.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/scooter.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/shop.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/skiing.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/soccer.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/square-stroked.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/square.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/star-stroked.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/star.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/suitcase.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/swimming.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/telephone.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/tennis.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/theatre.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/toilets.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/town-hall.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/town.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/triangle.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/village.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/warehouse.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/waste-basket.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/water.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/wetland.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/zoo.png +0 -0
- package/dist/Cesium/Assets/Textures/moonSmall.jpg +0 -0
- package/dist/Cesium/Assets/Textures/pin.svg +0 -1
- package/dist/Cesium/Assets/Textures/waterNormals.jpg +0 -0
- package/dist/Cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/dist/Cesium/Assets/approximateTerrainHeights.json +0 -1
- package/dist/Cesium/Cesium.js +0 -17946
- package/dist/Cesium/ThirdParty/Workers/package.json +0 -1
- package/dist/Cesium/ThirdParty/Workers/zip-web-worker.js +0 -1
- package/dist/Cesium/ThirdParty/basis_transcoder.wasm +0 -0
- package/dist/Cesium/ThirdParty/draco_decoder.wasm +0 -0
- package/dist/Cesium/ThirdParty/google-earth-dbroot-parser.js +0 -1
- package/dist/Cesium/ThirdParty/wasm_splats_bg.wasm +0 -0
- package/dist/Cesium/ThirdParty/zip-module.wasm +0 -0
- package/dist/Cesium/Widgets/Animation/Animation.css +0 -127
- package/dist/Cesium/Widgets/Animation/lighter.css +0 -70
- package/dist/Cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +0 -108
- package/dist/Cesium/Widgets/BaseLayerPicker/lighter.css +0 -22
- package/dist/Cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +0 -102
- package/dist/Cesium/Widgets/CesiumInspector/CesiumInspector.css +0 -113
- package/dist/Cesium/Widgets/CesiumWidget/CesiumWidget.css +0 -119
- package/dist/Cesium/Widgets/CesiumWidget/lighter.css +0 -14
- package/dist/Cesium/Widgets/FullscreenButton/FullscreenButton.css +0 -8
- package/dist/Cesium/Widgets/Geocoder/Geocoder.css +0 -70
- package/dist/Cesium/Widgets/Geocoder/lighter.css +0 -17
- package/dist/Cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +0 -27
- package/dist/Cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/azureAerial.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/azureRoads.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/googleContour.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/googleRoadmap.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/googleSatellite.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/googleSatelliteLabels.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
- package/dist/Cesium/Widgets/Images/NavigationHelp/Mouse.svg +0 -84
- package/dist/Cesium/Widgets/Images/NavigationHelp/MouseLeft.svg +0 -76
- package/dist/Cesium/Widgets/Images/NavigationHelp/MouseMiddle.svg +0 -76
- package/dist/Cesium/Widgets/Images/NavigationHelp/MouseRight.svg +0 -76
- package/dist/Cesium/Widgets/Images/NavigationHelp/Touch.svg +0 -120
- package/dist/Cesium/Widgets/Images/NavigationHelp/TouchDrag.svg +0 -129
- package/dist/Cesium/Widgets/Images/NavigationHelp/TouchRotate.svg +0 -76
- package/dist/Cesium/Widgets/Images/NavigationHelp/TouchTilt.svg +0 -135
- package/dist/Cesium/Widgets/Images/NavigationHelp/TouchZoom.svg +0 -74
- package/dist/Cesium/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
- package/dist/Cesium/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
- package/dist/Cesium/Widgets/Images/TimelineIcons.png +0 -0
- package/dist/Cesium/Widgets/Images/info-loading.gif +0 -0
- package/dist/Cesium/Widgets/InfoBox/InfoBox.css +0 -92
- package/dist/Cesium/Widgets/InfoBox/InfoBoxDescription.css +0 -178
- package/dist/Cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +0 -93
- package/dist/Cesium/Widgets/NavigationHelpButton/lighter.css +0 -38
- package/dist/Cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +0 -15
- package/dist/Cesium/Widgets/ProjectionPicker/ProjectionPicker.css +0 -38
- package/dist/Cesium/Widgets/SceneModePicker/SceneModePicker.css +0 -56
- package/dist/Cesium/Widgets/SelectionIndicator/SelectionIndicator.css +0 -20
- package/dist/Cesium/Widgets/Timeline/Timeline.css +0 -103
- package/dist/Cesium/Widgets/Timeline/lighter.css +0 -23
- package/dist/Cesium/Widgets/VRButton/VRButton.css +0 -8
- package/dist/Cesium/Widgets/Viewer/Viewer.css +0 -107
- package/dist/Cesium/Widgets/VoxelInspector/VoxelInspector.css +0 -16
- package/dist/Cesium/Widgets/lighter.css +0 -237
- package/dist/Cesium/Widgets/lighterShared.css +0 -46
- package/dist/Cesium/Widgets/shared.css +0 -103
- package/dist/Cesium/Widgets/widgets.css +0 -1342
- package/dist/Cesium/Workers/chunk-236YIEYT.js +0 -26
- package/dist/Cesium/Workers/chunk-2ZYB3DYT.js +0 -26
- package/dist/Cesium/Workers/chunk-4M56RRIL.js +0 -26
- package/dist/Cesium/Workers/chunk-5BC2Q3QW.js +0 -26
- package/dist/Cesium/Workers/chunk-5XHUDY37.js +0 -26
- package/dist/Cesium/Workers/chunk-6WMLAJJP.js +0 -26
- package/dist/Cesium/Workers/chunk-72KUXMWU.js +0 -26
- package/dist/Cesium/Workers/chunk-7NQYTTAU.js +0 -26
- package/dist/Cesium/Workers/chunk-A35GG5WJ.js +0 -26
- package/dist/Cesium/Workers/chunk-AXNBHUAG.js +0 -26
- package/dist/Cesium/Workers/chunk-DC3K7YTH.js +0 -26
- package/dist/Cesium/Workers/chunk-DRBPXGI7.js +0 -26
- package/dist/Cesium/Workers/chunk-EARRZPMO.js +0 -26
- package/dist/Cesium/Workers/chunk-EHC3BDVP.js +0 -26
- package/dist/Cesium/Workers/chunk-EYZUSGKM.js +0 -26
- package/dist/Cesium/Workers/chunk-EZSKHVA2.js +0 -26
- package/dist/Cesium/Workers/chunk-F3WJIFOO.js +0 -26
- package/dist/Cesium/Workers/chunk-FB7UV5BI.js +0 -26
- package/dist/Cesium/Workers/chunk-FC6IYMYF.js +0 -26
- package/dist/Cesium/Workers/chunk-GF67PEXE.js +0 -27
- package/dist/Cesium/Workers/chunk-GXEQRH2R.js +0 -26
- package/dist/Cesium/Workers/chunk-I5NKQIWE.js +0 -26
- package/dist/Cesium/Workers/chunk-IH7GXIUB.js +0 -26
- package/dist/Cesium/Workers/chunk-IPP3UFGH.js +0 -26
- package/dist/Cesium/Workers/chunk-IYRGNBSH.js +0 -26
- package/dist/Cesium/Workers/chunk-J6BM74AD.js +0 -26
- package/dist/Cesium/Workers/chunk-KG2GJUJT.js +0 -26
- package/dist/Cesium/Workers/chunk-L7UE5MMF.js +0 -26
- package/dist/Cesium/Workers/chunk-LBZ34MHQ.js +0 -26
- package/dist/Cesium/Workers/chunk-LOQDTQMX.js +0 -26
- package/dist/Cesium/Workers/chunk-LYLRYC4L.js +0 -29
- package/dist/Cesium/Workers/chunk-MGPRMLLW.js +0 -26
- package/dist/Cesium/Workers/chunk-NP26LKQA.js +0 -26
- package/dist/Cesium/Workers/chunk-OMUAZ3NM.js +0 -26
- package/dist/Cesium/Workers/chunk-PPFUDJN4.js +0 -26
- package/dist/Cesium/Workers/chunk-PQ3V63XF.js +0 -27
- package/dist/Cesium/Workers/chunk-PWBQN4GK.js +0 -26
- package/dist/Cesium/Workers/chunk-QOTMLO2T.js +0 -26
- package/dist/Cesium/Workers/chunk-SP35IT73.js +0 -26
- package/dist/Cesium/Workers/chunk-T3ZGSZKA.js +0 -26
- package/dist/Cesium/Workers/chunk-TM6SYYHO.js +0 -28
- package/dist/Cesium/Workers/chunk-TSGIJVWH.js +0 -26
- package/dist/Cesium/Workers/chunk-U3YGOX3C.js +0 -63
- package/dist/Cesium/Workers/chunk-VBYOXOSM.js +0 -26
- package/dist/Cesium/Workers/chunk-VCOHJNKB.js +0 -26
- package/dist/Cesium/Workers/chunk-VXAZXMUX.js +0 -26
- package/dist/Cesium/Workers/chunk-VXCJOT4W.js +0 -26
- package/dist/Cesium/Workers/chunk-WPD3MB6X.js +0 -26
- package/dist/Cesium/Workers/chunk-X4D5KUN5.js +0 -26
- package/dist/Cesium/Workers/chunk-XEC656IT.js +0 -26
- package/dist/Cesium/Workers/chunk-XR53QRQS.js +0 -26
- package/dist/Cesium/Workers/chunk-XR7MN4PJ.js +0 -28
- package/dist/Cesium/Workers/chunk-XU6O4MRS.js +0 -26
- package/dist/Cesium/Workers/chunk-XZBHEBLF.js +0 -29
- package/dist/Cesium/Workers/chunk-Z2M4BF4E.js +0 -26
- package/dist/Cesium/Workers/chunk-Z4ERBZFB.js +0 -26
- package/dist/Cesium/Workers/chunk-ZY2KCIWI.js +0 -26
- package/dist/Cesium/Workers/combineGeometry.js +0 -26
- package/dist/Cesium/Workers/createBoxGeometry.js +0 -26
- package/dist/Cesium/Workers/createBoxOutlineGeometry.js +0 -26
- package/dist/Cesium/Workers/createCircleGeometry.js +0 -26
- package/dist/Cesium/Workers/createCircleOutlineGeometry.js +0 -26
- package/dist/Cesium/Workers/createCoplanarPolygonGeometry.js +0 -26
- package/dist/Cesium/Workers/createCoplanarPolygonOutlineGeometry.js +0 -26
- package/dist/Cesium/Workers/createCorridorGeometry.js +0 -26
- package/dist/Cesium/Workers/createCorridorOutlineGeometry.js +0 -26
- package/dist/Cesium/Workers/createCylinderGeometry.js +0 -26
- package/dist/Cesium/Workers/createCylinderOutlineGeometry.js +0 -26
- package/dist/Cesium/Workers/createEllipseGeometry.js +0 -26
- package/dist/Cesium/Workers/createEllipseOutlineGeometry.js +0 -26
- package/dist/Cesium/Workers/createEllipsoidGeometry.js +0 -26
- package/dist/Cesium/Workers/createEllipsoidOutlineGeometry.js +0 -26
- package/dist/Cesium/Workers/createFrustumGeometry.js +0 -26
- package/dist/Cesium/Workers/createFrustumOutlineGeometry.js +0 -26
- package/dist/Cesium/Workers/createGeometry.js +0 -26
- package/dist/Cesium/Workers/createGroundPolylineGeometry.js +0 -26
- package/dist/Cesium/Workers/createPlaneGeometry.js +0 -26
- package/dist/Cesium/Workers/createPlaneOutlineGeometry.js +0 -26
- package/dist/Cesium/Workers/createPolygonGeometry.js +0 -26
- package/dist/Cesium/Workers/createPolygonOutlineGeometry.js +0 -26
- package/dist/Cesium/Workers/createPolylineGeometry.js +0 -26
- package/dist/Cesium/Workers/createPolylineVolumeGeometry.js +0 -26
- package/dist/Cesium/Workers/createPolylineVolumeOutlineGeometry.js +0 -26
- package/dist/Cesium/Workers/createRectangleGeometry.js +0 -26
- package/dist/Cesium/Workers/createRectangleOutlineGeometry.js +0 -26
- package/dist/Cesium/Workers/createSimplePolylineGeometry.js +0 -26
- package/dist/Cesium/Workers/createSphereGeometry.js +0 -26
- package/dist/Cesium/Workers/createSphereOutlineGeometry.js +0 -26
- package/dist/Cesium/Workers/createTaskProcessorWorker.js +0 -26
- package/dist/Cesium/Workers/createVectorTileClampedPolylines.js +0 -26
- package/dist/Cesium/Workers/createVectorTileGeometries.js +0 -26
- package/dist/Cesium/Workers/createVectorTilePoints.js +0 -26
- package/dist/Cesium/Workers/createVectorTilePolygons.js +0 -26
- package/dist/Cesium/Workers/createVectorTilePolylines.js +0 -26
- package/dist/Cesium/Workers/createVerticesFromCesium3DTilesTerrain.js +0 -26
- package/dist/Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -26
- package/dist/Cesium/Workers/createVerticesFromHeightmap.js +0 -26
- package/dist/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -26
- package/dist/Cesium/Workers/createWallGeometry.js +0 -26
- package/dist/Cesium/Workers/createWallOutlineGeometry.js +0 -26
- package/dist/Cesium/Workers/decodeDraco.js +0 -26
- package/dist/Cesium/Workers/decodeGoogleEarthEnterprisePacket.js +0 -26
- package/dist/Cesium/Workers/decodeI3S.js +0 -26
- package/dist/Cesium/Workers/gaussianSplatSorter.js +0 -26
- package/dist/Cesium/Workers/gaussianSplatTextureGenerator.js +0 -26
- package/dist/Cesium/Workers/incrementallyBuildTerrainPicker.js +0 -26
- package/dist/Cesium/Workers/transcodeKTX2.js +0 -56
- package/dist/Cesium/Workers/transferTypedArrayTest.js +0 -26
- package/dist/Cesium/Workers/upsampleQuantizedTerrainMesh.js +0 -26
- package/dist/Cesium/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +0 -26
- package/dist/Cesium/index.cjs +0 -17946
- package/dist/Cesium/index.js +0 -17946
- package/dist/chunks/sdk-runtime--Vql9ddn.js +0 -1408
- package/dist/chunks/sdk-vendor-DUEcGYjb.js +0 -36171
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { W as oe, C as _s,
|
|
3
|
-
import { r as G, g as Ls } from "./sdk-assets-
|
|
4
|
-
import { a as gn, J as Yt, c as ks, b as zs, P as zt, q as Bs, k as Rs, n as
|
|
5
|
-
|
|
6
|
-
class Ns {
|
|
1
|
+
import { S as ni, G as ce, P as it, O as ve, M as R, V as h, T as en, C as jn, W as si, a as Kn, b as Dt, N as oi, c as Yn, d as Ve, e as W, Q as De, E as tn, R as he, f as nn, g as sn, B as Y, h as on, A as Xn, i as U, j as O, I as X, k as Lt, l as kt, m as rn, n as an, L as wt, o as $n, p as Zn, q as Jn, r as fi, s as yi, t as Qn, F as es, u as Fe, v as ln, w as cn, x as ri, D as ge, y as ts, z as hn, H as Me, J as is, K as nt, U as ns, X as ss, Y as os, Z as rs, _ as Le, $ as xt, a0 as un, a1 as Z, a2 as me, a3 as as, a4 as $e, a5 as st, a6 as ls, a7 as bt, a8 as Ct, a9 as ke, aa as rt, ab as cs, ac as dn, ad as Wt, ae as St, af as hs, ag as qe, ah as us, ai as ds, aj as pn, ak as mn, al as Et, am as qt, an as ps, ao as vi, ap as jt, aq as Kt, ar as ot, as as ms, at as gs, au as Mi, av as fs, aw as wi, ax as ys, ay as vs, az as Ms, aA as ws, aB as xs, aC as bs, aD as Cs, aE as Ss, aF as Es, aG as Ps, aH as As, aI as xi } from "./three-vendor-ox3_iXFc.js";
|
|
2
|
+
import { W as oe, C as _s, L as Pt, B as bi, g as Ae, a as Ts, E as Ds, r as Is } from "./sdk-runtime-kyCuafGM.js";
|
|
3
|
+
import { r as G, g as Ls } from "./sdk-assets-BbXNfc5u.js";
|
|
4
|
+
import { a as gn, J as Yt, c as ks, b as zs, P as zt, q as Bs, k as Rs, n as Ci, E as Si, S as Fs } from "./sdk-vendor-DYgn7sFs.js";
|
|
5
|
+
class Os {
|
|
7
6
|
engine;
|
|
8
7
|
scene;
|
|
9
8
|
constructor(e) {
|
|
@@ -223,7 +222,7 @@ class le {
|
|
|
223
222
|
l && (i || (i = this.getStableCameraUp(n)), l.position.copy(r), l.up.copy(i), this.engine.controls?.target && this.engine.controls.target.copy(s), typeof this.engine.controls?.setScreenUp == "function" ? this.engine.controls.setScreenUp(i) : l.lookAt(s), this.engine.controls?.update && this.engine.controls.update(), l.updateMatrix(), l.updateMatrixWorld(!0));
|
|
224
223
|
}
|
|
225
224
|
}
|
|
226
|
-
class
|
|
225
|
+
class Ns {
|
|
227
226
|
engine;
|
|
228
227
|
deviceType;
|
|
229
228
|
constructor(e) {
|
|
@@ -287,13 +286,13 @@ class Hs {
|
|
|
287
286
|
};
|
|
288
287
|
}
|
|
289
288
|
}
|
|
290
|
-
const
|
|
291
|
-
class
|
|
289
|
+
const ai = 1.1;
|
|
290
|
+
class Hs {
|
|
292
291
|
engine;
|
|
293
292
|
renderer;
|
|
294
293
|
watermark;
|
|
295
294
|
constructor(e) {
|
|
296
|
-
this.engine = e, this.renderer = null, this.watermark = new _s(
|
|
295
|
+
this.engine = e, this.renderer = null, this.watermark = new _s(en);
|
|
297
296
|
}
|
|
298
297
|
createRenderer() {
|
|
299
298
|
const { width: e, height: t } = this.engine.deviceModule.getContainerSize();
|
|
@@ -305,7 +304,7 @@ class Vs {
|
|
|
305
304
|
stencil: !0,
|
|
306
305
|
// 移动端放大镜需要从当前画布直接取样,保留 drawing buffer 避免读到黑屏。
|
|
307
306
|
preserveDrawingBuffer: !0
|
|
308
|
-
}), this.renderer.setClearColor(0, 0), this.renderer.setSize(e, t), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.shadowMap.enabled = !0, this.renderer.shadowMap.type = Kn, this.renderer.localClippingEnabled = !0, this.renderer.outputColorSpace = Dt, this.renderer.toneMapping = oi, this.renderer.toneMappingExposure =
|
|
307
|
+
}), this.renderer.setClearColor(0, 0), this.renderer.setSize(e, t), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.shadowMap.enabled = !0, this.renderer.shadowMap.type = Kn, this.renderer.localClippingEnabled = !0, this.renderer.outputColorSpace = Dt, this.renderer.toneMapping = oi, this.renderer.toneMappingExposure = ai, this.engine.container.appendChild(this.renderer.domElement), this.renderer;
|
|
309
308
|
}
|
|
310
309
|
disposeRenderer() {
|
|
311
310
|
this.watermark.dispose(), this.renderer?.dispose();
|
|
@@ -317,14 +316,14 @@ class Vs {
|
|
|
317
316
|
this.renderer && this.watermark.render(this.renderer);
|
|
318
317
|
}
|
|
319
318
|
}
|
|
320
|
-
const
|
|
319
|
+
const Vs = { type: "change" }, Ei = { type: "start" }, Pi = { type: "end" }, K = 1e-6, Bt = Math.PI * 2, ie = {
|
|
321
320
|
NONE: -1,
|
|
322
321
|
ROTATE: 0,
|
|
323
322
|
PAN: 1,
|
|
324
323
|
DOLLY: 2,
|
|
325
324
|
TOUCH_ROTATE: 3,
|
|
326
325
|
TOUCH_DOLLY_PAN: 4
|
|
327
|
-
}, Rt = new h(1, 0, 0),
|
|
326
|
+
}, Rt = new h(1, 0, 0), Us = new h(0, 1, 0), Gs = new h(0, 0, 1), Ue = new h(), dt = new h(), pe = new h(), j = new h(), xe = new h(), se = new h(), be = new h(), Ws = new h(), pt = new De(), Ft = new De(), Ai = /* @__PURE__ */ new Set([
|
|
328
327
|
"KeyW",
|
|
329
328
|
"KeyA",
|
|
330
329
|
"KeyS",
|
|
@@ -341,7 +340,7 @@ const Us = { type: "change" }, Pi = { type: "start" }, Ai = { type: "end" }, K =
|
|
|
341
340
|
function mt(a, e, t) {
|
|
342
341
|
return Math.max(e, Math.min(t, a));
|
|
343
342
|
}
|
|
344
|
-
function
|
|
343
|
+
function _i(a) {
|
|
345
344
|
return {
|
|
346
345
|
width: Math.max(a?.clientWidth || 1, 1),
|
|
347
346
|
height: Math.max(a?.clientHeight || 1, 1)
|
|
@@ -350,7 +349,7 @@ function Ti(a) {
|
|
|
350
349
|
function Ge(a) {
|
|
351
350
|
return a && typeof a.x == "number" && typeof a.y == "number" && typeof a.z == "number";
|
|
352
351
|
}
|
|
353
|
-
function
|
|
352
|
+
function Ti(a) {
|
|
354
353
|
const e = a?.tagName?.toLowerCase?.();
|
|
355
354
|
return a?.isContentEditable === !0 || e === "input" || e === "textarea" || e === "select";
|
|
356
355
|
}
|
|
@@ -402,7 +401,7 @@ class fn extends Yn {
|
|
|
402
401
|
const i = typeof e == "number" ? e : null, n = typeof e == "boolean" ? e : !!t, s = this._applyPendingMotion(i);
|
|
403
402
|
this._alignCamera();
|
|
404
403
|
const o = n || s || this._hasCameraStateChanged();
|
|
405
|
-
return o && (this.dispatchEvent(
|
|
404
|
+
return o && (this.dispatchEvent(Vs), this._rememberState()), o;
|
|
406
405
|
}
|
|
407
406
|
_applyPendingMotion(e) {
|
|
408
407
|
let t = !1;
|
|
@@ -459,8 +458,8 @@ class fn extends Yn {
|
|
|
459
458
|
Ue.copy(n).sub(i), Ue.lengthSq() < K && Ue.set(0, 0, Math.max(this.minDistance, 1)), dt.copy(this.target).sub(i), se.copy(this.target).sub(n).normalize(), Math.abs(e) > K && (pt.setFromAxisAngle(this._referenceUp, -e), Ue.applyQuaternion(pt), dt.applyQuaternion(pt), se.applyQuaternion(pt).normalize()), j.copy(this._getStableRightAxis(se)), Math.abs(t) > K && j.lengthSq() > K && (Ft.setFromAxisAngle(j, -t), Ue.applyQuaternion(Ft), dt.applyQuaternion(Ft)), n.copy(i).add(Ue), this.target.copy(i).add(dt);
|
|
460
459
|
}
|
|
461
460
|
_applyPan(e, t) {
|
|
462
|
-
const { width: i, height: n } =
|
|
463
|
-
j.copy(Rt).applyQuaternion(this.object.quaternion).normalize(), xe.copy(
|
|
461
|
+
const { width: i, height: n } = _i(this.domElement);
|
|
462
|
+
j.copy(Rt).applyQuaternion(this.object.quaternion).normalize(), xe.copy(Us).applyQuaternion(this.object.quaternion).normalize();
|
|
464
463
|
let s = 0, o = 0;
|
|
465
464
|
if (this.object.isPerspectiveCamera) {
|
|
466
465
|
const l = 2 * Math.max(this.object.position.distanceTo(this.target), K) * Math.tan(R.degToRad(this.object.getEffectiveFOV() * 0.5)), c = l * this.object.aspect;
|
|
@@ -486,10 +485,10 @@ class fn extends Yn {
|
|
|
486
485
|
se.copy(this.target).sub(this.object.position), !(se.lengthSq() < K) && (se.normalize(), j.copy(this._getStableRightAxis(se)), xe.crossVectors(j, se).normalize(), xe.lengthSq() < K && xe.copy(this._referenceUp), this._viewRight.copy(j), this.object.up.copy(xe), this.object.lookAt(this.target), this.object.updateMatrixWorld());
|
|
487
486
|
}
|
|
488
487
|
_getStableRightAxis(e) {
|
|
489
|
-
return j.crossVectors(e, this._referenceUp), j.lengthSq() < K && (j.copy(this._viewRight), j.addScaledVector(e, -j.dot(e))), j.lengthSq() < K && (j.copy(Rt), j.addScaledVector(e, -j.dot(e))), j.lengthSq() < K && (j.copy(
|
|
488
|
+
return j.crossVectors(e, this._referenceUp), j.lengthSq() < K && (j.copy(this._viewRight), j.addScaledVector(e, -j.dot(e))), j.lengthSq() < K && (j.copy(Rt), j.addScaledVector(e, -j.dot(e))), j.lengthSq() < K && (j.copy(Gs), j.addScaledVector(e, -j.dot(e))), j.normalize(), this._viewRight.lengthSq() > K && j.dot(this._viewRight) < 0 && j.negate(), j;
|
|
490
489
|
}
|
|
491
490
|
_getRotatePivot() {
|
|
492
|
-
return Ge(this.origin) ? this.origin.distanceToSquared(this.target) < K ? this.target :
|
|
491
|
+
return Ge(this.origin) ? this.origin.distanceToSquared(this.target) < K ? this.target : Ws.copy(this.origin) : this.target;
|
|
493
492
|
}
|
|
494
493
|
_hasCameraStateChanged() {
|
|
495
494
|
const e = this.object.isOrthographicCamera && Math.abs(this.object.zoom - this._lastZoom) > K;
|
|
@@ -502,10 +501,10 @@ class fn extends Yn {
|
|
|
502
501
|
return e != null ? Bt / 60 * this.autoRotateSpeed * e : Bt / 3600 * this.autoRotateSpeed;
|
|
503
502
|
}
|
|
504
503
|
_beginInteraction(e) {
|
|
505
|
-
this._isInteracting || (this.dispatchEvent(
|
|
504
|
+
this._isInteracting || (this.dispatchEvent(Ei), this._isInteracting = !0), this.state = e;
|
|
506
505
|
}
|
|
507
506
|
_endInteraction() {
|
|
508
|
-
this._isInteracting && (this._isInteracting = !1, this.state = ie.NONE, this.dispatchEvent(
|
|
507
|
+
this._isInteracting && (this._isInteracting = !1, this.state = ie.NONE, this.dispatchEvent(Pi));
|
|
509
508
|
}
|
|
510
509
|
_handleContextMenu(e) {
|
|
511
510
|
e.preventDefault();
|
|
@@ -548,14 +547,14 @@ class fn extends Yn {
|
|
|
548
547
|
}
|
|
549
548
|
}
|
|
550
549
|
_handleWheel(e) {
|
|
551
|
-
!this.enabled || !this.enableZoom || (e.preventDefault(), this.dispatchEvent(
|
|
550
|
+
!this.enabled || !this.enableZoom || (e.preventDefault(), this.dispatchEvent(Ei), this._queueZoom(Math.sign(e.deltaY)), this.update(), this.dispatchEvent(Pi));
|
|
552
551
|
}
|
|
553
552
|
_handleKeyDown(e) {
|
|
554
553
|
if (!this.enabled)
|
|
555
554
|
return;
|
|
556
555
|
const t = e.code || e.key;
|
|
557
|
-
if (this.object?.isPerspectiveCamera &&
|
|
558
|
-
|
|
556
|
+
if (this.object?.isPerspectiveCamera && Ai.has(t)) {
|
|
557
|
+
Ti(e.target) || (this._pressedKeys.add(t), this._startKeyboardMoveLoop(), e.preventDefault());
|
|
559
558
|
return;
|
|
560
559
|
}
|
|
561
560
|
let i = !1;
|
|
@@ -577,7 +576,7 @@ class fn extends Yn {
|
|
|
577
576
|
}
|
|
578
577
|
_handleKeyUp(e) {
|
|
579
578
|
const t = e.code || e.key;
|
|
580
|
-
|
|
579
|
+
Ai.has(t) && (this._pressedKeys.delete(t), this._pressedKeys.size === 0 && this._stopKeyboardMoveLoop(), this.object?.isPerspectiveCamera && !Ti(e.target) && e.preventDefault());
|
|
581
580
|
}
|
|
582
581
|
_handleTouchStart() {
|
|
583
582
|
const e = Array.from(this._pointers.values());
|
|
@@ -626,7 +625,7 @@ class fn extends Yn {
|
|
|
626
625
|
_queueRotate(e, t) {
|
|
627
626
|
if (!this.enableRotate || !this.domElement)
|
|
628
627
|
return;
|
|
629
|
-
const { height: i } =
|
|
628
|
+
const { height: i } = _i(this.domElement), n = Bt / i;
|
|
630
629
|
this._rotateVelocity.x += e * n * this.rotateSpeed, this._rotateVelocity.y += t * n * this.rotateSpeed;
|
|
631
630
|
}
|
|
632
631
|
_queuePan(e, t) {
|
|
@@ -636,9 +635,9 @@ class fn extends Yn {
|
|
|
636
635
|
this.enableZoom && (this._zoomVelocity += e);
|
|
637
636
|
}
|
|
638
637
|
}
|
|
639
|
-
class
|
|
638
|
+
class Di extends tn {
|
|
640
639
|
constructor(e, t, i, n) {
|
|
641
|
-
super(), this._Engine = e, this.camera = t, this.object = t, this.domElement = i, this._isEnabled = !1, this._rayOriginOffset = new h(0, -1, 0), this._camerLocalDirection = new h(), this._tmpVector = new h(), this._lookDirection = new h(), this._rayCaster = new he(), this._fallingTime = 0, this._isMouseInElement = !1, this._euler = new
|
|
640
|
+
super(), this._Engine = e, this.camera = t, this.object = t, this.domElement = i, this._isEnabled = !1, this._rayOriginOffset = new h(0, -1, 0), this._camerLocalDirection = new h(), this._tmpVector = new h(), this._lookDirection = new h(), this._rayCaster = new he(), this._fallingTime = 0, this._isMouseInElement = !1, this._euler = new nn(0, 0, 0, "YZX"), this._prevMouseX = 0, this._prevMouseY = 0, this._pointerLookActive = !1, this._externalLookActive = !1, this._interactionActive = !1, this._sharedTargetDistance = 10, this.target = this.camera.position.clone().add(
|
|
642
641
|
new h(0, 0, -1).applyQuaternion(this.camera.quaternion).normalize().multiplyScalar(this._sharedTargetDistance)
|
|
643
642
|
), this.applyGravity = !1, this.gravityMinHeight = !0, this.applyCollision = !0, this.positionEasing = !0, this.lookflag = 1, this.lookSpeed = 3e-3, this.moveSpeed = 0.02, this.playerHeight = 1.6, this.jumpSpeed = 0.24, this.jumpGravity = 0.012, this.maxRotateX = Math.PI * 0.5 - 0.01, this.g = 9.8, this.bindmousedown = this._Engine && this._Engine.deviceType !== "PC" ? this.onTouchStart.bind(this) : this.onMouseDown.bind(this), this.bindmouseup = this._Engine && this._Engine.deviceType !== "PC" ? this.onTouchEnd.bind(this) : this.onMouseUp.bind(this), this.bindmousemove = this._Engine && this._Engine.deviceType !== "PC" ? this.onTouchMove.bind(this) : this.onMouseMove.bind(this), this.bindonKeyDown = this.onKeyDown.bind(this), this.bindonKeyUp = this.onKeyUp.bind(this), this.bindWindowBlur = this.onWindowBlur.bind(this), this.bindVisibilityChange = this.onVisibilityChange.bind(this), this.bindMousewheel = this.onMousewheel.bind(this), this.bindMouseEnter = this.onMouseEnter.bind(this), this.bindMouseLeave = this.onMouseLeave.bind(this), this.needMousewheel = !1, this.moveWheelRun = !0, this.moveWheelStop = !1, this.wheelClock, this.keydown = !1, this.shiftDown = !1, this._verticalVelocity = 0, this._isJumping = !1, this._isJumpKeyDown = !1, this._jumpStartHeight = this.camera.position.y, this.gravityTestCount = 5, this.catchTestCount = 10, this.GetEngine = () => e, this.syncRotationStateFromCamera(), this.sanitizeCameraOrientation(), this.syncSharedTargetFromCamera();
|
|
644
643
|
}
|
|
@@ -994,7 +993,7 @@ class Ii extends nn {
|
|
|
994
993
|
return r;
|
|
995
994
|
}
|
|
996
995
|
}
|
|
997
|
-
const
|
|
996
|
+
const qs = G("/assets/worker_walk.glb", import.meta.url), js = Math.PI, Ks = {
|
|
998
997
|
16: "ShiftLeft",
|
|
999
998
|
37: "ArrowLeft",
|
|
1000
999
|
38: "ArrowUp",
|
|
@@ -1018,9 +1017,9 @@ const js = G("/assets/worker_walk.glb", import.meta.url), Ks = Math.PI, Ys = {
|
|
|
1018
1017
|
jump: ["Space"],
|
|
1019
1018
|
boost: ["ShiftLeft", "ShiftRight"]
|
|
1020
1019
|
};
|
|
1021
|
-
class
|
|
1020
|
+
class Ii extends tn {
|
|
1022
1021
|
constructor(e, t, i, n = {}) {
|
|
1023
|
-
super(), this._Engine = e, this.camera = t, this.object = t, this.domElement = i, this._isEnabled = !1, this.target = new h(), this.auto = !1, this.applyGravity = n.applyGravity ?? !0, this.gravityMinHeight = !0, this.applyCollision = n.applyCollision ?? !0, this.positionEasing = !0, this.lookflag = 1, this.lookSpeed = n.lookSpeed ?? 3e-3, this.moveSpeed = n.moveSpeed ?? 0.02, this.playerHeight = n.playerHeight ?? 1.6, this.playerRadius = n.playerRadius ?? 0.3, this.cameraDistance = n.cameraDistance ?? 2, this.cameraHeight = n.cameraHeight ?? 0, this.targetHeight = n.targetHeight ?? this.playerHeight, this.cameraCollisionTargetHeight = n.cameraCollisionTargetHeight ?? this.playerHeight + 0.1, this.cameraCollisionInterval = Math.max(1, Math.floor(n.cameraCollisionInterval ?? 20)), this.cameraCollisionPadding = n.cameraCollisionPadding ?? 0.15, this.minCameraCollisionDistance = n.minCameraCollisionDistance ?? 0.35, this.jumpSpeed = n.jumpSpeed ?? 0.24, this.jumpGravity = n.jumpGravity ?? 0.012, this.maxRotateX = n.maxPitch ?? Math.PI * 0.45, this.minPitch = n.minPitch ?? -Math.PI * 0.38, this.g = 9.8, this._moveInput = new h(), this._moveDirection = new h(), this._rayCaster = new he(), this._cameraRayCaster = new he(), this._cameraCollisionFrame = 0, this._lastCameraSafeDistance = null, this._fallingTime = 0, this._isMouseInElement = !1, this._prevMouseX = 0, this._prevMouseY = 0, this._dragRotateThreshold = n.dragRotateThreshold ?? 2, this._pointerLookActive = !1, this._externalLookActive = !1, this._scriptedMotionActive = !1, this._interactionActive = !1, this._yaw = 0, this._pitch = n.initialPitch ?? 0, this._pressedKeys = /* @__PURE__ */ new Set(), this._verticalVelocity = 0, this._isJumping = !1, this._isJumpKeyDown = !1, this._jumpStartHeight = 0, this.avatarRoot = new ce(), this.avatarRoot.name = "ThirdPersonAvatarRoot", this.avatarRoot.visible = n.visible ?? !0, this.avatarMixer = null, this.avatarWalkAction = null, this._isWalkActionPlaying = !1, this._avatarAnimationClock = new sn(), this._avatarLoadRequestId = 0, this.defaultAvatarUrl = n.avatarUrl ??
|
|
1022
|
+
super(), this._Engine = e, this.camera = t, this.object = t, this.domElement = i, this._isEnabled = !1, this.target = new h(), this.auto = !1, this.applyGravity = n.applyGravity ?? !0, this.gravityMinHeight = !0, this.applyCollision = n.applyCollision ?? !0, this.positionEasing = !0, this.lookflag = 1, this.lookSpeed = n.lookSpeed ?? 3e-3, this.moveSpeed = n.moveSpeed ?? 0.02, this.playerHeight = n.playerHeight ?? 1.6, this.playerRadius = n.playerRadius ?? 0.3, this.cameraDistance = n.cameraDistance ?? 2, this.cameraHeight = n.cameraHeight ?? 0, this.targetHeight = n.targetHeight ?? this.playerHeight, this.cameraCollisionTargetHeight = n.cameraCollisionTargetHeight ?? this.playerHeight + 0.1, this.cameraCollisionInterval = Math.max(1, Math.floor(n.cameraCollisionInterval ?? 20)), this.cameraCollisionPadding = n.cameraCollisionPadding ?? 0.15, this.minCameraCollisionDistance = n.minCameraCollisionDistance ?? 0.35, this.jumpSpeed = n.jumpSpeed ?? 0.24, this.jumpGravity = n.jumpGravity ?? 0.012, this.maxRotateX = n.maxPitch ?? Math.PI * 0.45, this.minPitch = n.minPitch ?? -Math.PI * 0.38, this.g = 9.8, this._moveInput = new h(), this._moveDirection = new h(), this._rayCaster = new he(), this._cameraRayCaster = new he(), this._cameraCollisionFrame = 0, this._lastCameraSafeDistance = null, this._fallingTime = 0, this._isMouseInElement = !1, this._prevMouseX = 0, this._prevMouseY = 0, this._dragRotateThreshold = n.dragRotateThreshold ?? 2, this._pointerLookActive = !1, this._externalLookActive = !1, this._scriptedMotionActive = !1, this._interactionActive = !1, this._yaw = 0, this._pitch = n.initialPitch ?? 0, this._pressedKeys = /* @__PURE__ */ new Set(), this._verticalVelocity = 0, this._isJumping = !1, this._isJumpKeyDown = !1, this._jumpStartHeight = 0, this.avatarRoot = new ce(), this.avatarRoot.name = "ThirdPersonAvatarRoot", this.avatarRoot.visible = n.visible ?? !0, this.avatarMixer = null, this.avatarWalkAction = null, this._isWalkActionPlaying = !1, this._avatarAnimationClock = new sn(), this._avatarLoadRequestId = 0, this.defaultAvatarUrl = n.avatarUrl ?? qs, this._ownsAvatarResources = !n.avatar, this.avatar = n.avatar || this.createDefaultAvatar(), this.avatar.name = this.avatar.name || "ThirdPersonAvatar", this.avatarRoot.add(this.avatar), !n.avatar && this.defaultAvatarUrl && this.loadAvatarModel(this.defaultAvatarUrl, n.avatarOptions);
|
|
1024
1023
|
const s = this.isPcDevice();
|
|
1025
1024
|
this.bindmousedown = s ? this.onMouseDown.bind(this) : this.onTouchStart.bind(this), this.bindmouseup = s ? this.onMouseUp.bind(this) : this.onTouchEnd.bind(this), this.bindmousemove = s ? this.onMouseMove.bind(this) : this.onTouchMove.bind(this), this.bindonKeyDown = this.onKeyDown.bind(this), this.bindonKeyUp = this.onKeyUp.bind(this), this.bindWindowBlur = this.onWindowBlur.bind(this), this.bindVisibilityChange = this.onVisibilityChange.bind(this), this.bindMouseEnter = this.onMouseEnter.bind(this), this.bindMouseLeave = this.onMouseLeave.bind(this), this.initAvatarPoseFromCamera();
|
|
1026
1025
|
}
|
|
@@ -1081,7 +1080,7 @@ class Li extends nn {
|
|
|
1081
1080
|
alignToFeet: !0,
|
|
1082
1081
|
fitToPlayerHeight: !0,
|
|
1083
1082
|
ownsResources: !0,
|
|
1084
|
-
yawOffset:
|
|
1083
|
+
yawOffset: js,
|
|
1085
1084
|
...t
|
|
1086
1085
|
}), this.setupAvatarAnimation(o, s.animations || []);
|
|
1087
1086
|
},
|
|
@@ -1200,7 +1199,7 @@ class Li extends nn {
|
|
|
1200
1199
|
}
|
|
1201
1200
|
}
|
|
1202
1201
|
getEventCode(e) {
|
|
1203
|
-
return e.code ||
|
|
1202
|
+
return e.code || Ks[e.keyCode] || e.key || "";
|
|
1204
1203
|
}
|
|
1205
1204
|
hasPressed(e) {
|
|
1206
1205
|
return e.some((t) => this._pressedKeys.has(t));
|
|
@@ -1463,31 +1462,31 @@ function Mn(a) {
|
|
|
1463
1462
|
function $t(a, e) {
|
|
1464
1463
|
a.url = e, a.name = e, a.userData = a.userData ?? {}, a.userData[Xt] = !0;
|
|
1465
1464
|
}
|
|
1466
|
-
function
|
|
1465
|
+
function li(a, e) {
|
|
1467
1466
|
return a instanceof ce ? e == null ? a.userData?.[Xt] === !0 : a.userData?.[Xt] === !0 && a.url === e : !1;
|
|
1468
1467
|
}
|
|
1469
|
-
function
|
|
1468
|
+
function ci(a, e) {
|
|
1470
1469
|
return a?.models?.find?.((t) => t?.url === e);
|
|
1471
1470
|
}
|
|
1472
1471
|
function _t(a, e, t) {
|
|
1473
1472
|
if (typeof t != "string" || t.length === 0)
|
|
1474
1473
|
return;
|
|
1475
|
-
const i =
|
|
1474
|
+
const i = ci(a, e);
|
|
1476
1475
|
i != null && (Array.isArray(i.urls) || (i.urls = []), i.urls.includes(t) || i.urls.push(t));
|
|
1477
1476
|
}
|
|
1478
1477
|
function Oe(a, e) {
|
|
1479
1478
|
const t = vn(a), i = t.get(e);
|
|
1480
1479
|
if (i && i.parent != null)
|
|
1481
1480
|
return i;
|
|
1482
|
-
const n =
|
|
1481
|
+
const n = ci(a, e);
|
|
1483
1482
|
if (n?.group instanceof ce && n.group.parent != null)
|
|
1484
1483
|
return $t(n.group, e), t.set(e, n.group), n.group;
|
|
1485
|
-
const s = a?.scene?.children?.find?.((o) => o instanceof ce ?
|
|
1484
|
+
const s = a?.scene?.children?.find?.((o) => o instanceof ce ? li(o, e) ? !0 : o.name === e && o.url === e : !1);
|
|
1486
1485
|
return s != null ? ($t(s, e), t.set(e, s), n != null && (n.group = s), s) : null;
|
|
1487
1486
|
}
|
|
1488
1487
|
function Ne(a, e) {
|
|
1489
1488
|
const t = Oe(a, e);
|
|
1490
|
-
return t == null ? new
|
|
1489
|
+
return t == null ? new U() : (t.updateWorldMatrix(!0, !1), t.matrixWorld.clone());
|
|
1491
1490
|
}
|
|
1492
1491
|
function je(a, e) {
|
|
1493
1492
|
const t = Oe(a, e);
|
|
@@ -1495,10 +1494,10 @@ function je(a, e) {
|
|
|
1495
1494
|
return t;
|
|
1496
1495
|
const i = new ce();
|
|
1497
1496
|
$t(i, e), a.scene.add(i), vn(a).set(e, i);
|
|
1498
|
-
const s =
|
|
1497
|
+
const s = ci(a, e);
|
|
1499
1498
|
return s != null && (s.group = i), i;
|
|
1500
1499
|
}
|
|
1501
|
-
function
|
|
1500
|
+
function Ys(a) {
|
|
1502
1501
|
const e = [], t = /* @__PURE__ */ new Set();
|
|
1503
1502
|
return (Array.isArray(a?.models) ? a.models : []).forEach((n) => {
|
|
1504
1503
|
if (n?.url == null)
|
|
@@ -1506,12 +1505,12 @@ function Xs(a) {
|
|
|
1506
1505
|
const s = Oe(a, n.url);
|
|
1507
1506
|
s == null || t.has(s.uuid) || (t.add(s.uuid), e.push(s));
|
|
1508
1507
|
}), a?.scene?.children?.forEach?.((n) => {
|
|
1509
|
-
!
|
|
1508
|
+
!li(n) || t.has(n.uuid) || (t.add(n.uuid), e.push(n));
|
|
1510
1509
|
}), e;
|
|
1511
1510
|
}
|
|
1512
|
-
function
|
|
1511
|
+
function hi(a, e) {
|
|
1513
1512
|
const t = [], i = /* @__PURE__ */ new Set();
|
|
1514
|
-
return
|
|
1513
|
+
return Ys(a).forEach((s) => {
|
|
1515
1514
|
s.traverse((o) => {
|
|
1516
1515
|
o === s || i.has(o.uuid) || e(o) && (i.add(o.uuid), t.push(o));
|
|
1517
1516
|
});
|
|
@@ -1519,16 +1518,16 @@ function ui(a, e) {
|
|
|
1519
1518
|
if (s.name == "highlightModel")
|
|
1520
1519
|
i.add(s.uuid), t.push(s);
|
|
1521
1520
|
else {
|
|
1522
|
-
if (i.has(s.uuid) ||
|
|
1521
|
+
if (i.has(s.uuid) || li(s) || s.url == null)
|
|
1523
1522
|
return;
|
|
1524
1523
|
e(s) && (i.add(s.uuid), t.push(s));
|
|
1525
1524
|
}
|
|
1526
1525
|
}), t;
|
|
1527
1526
|
}
|
|
1528
|
-
function
|
|
1529
|
-
return
|
|
1527
|
+
function ui(a) {
|
|
1528
|
+
return hi(a, (e) => e instanceof O && !(e instanceof X));
|
|
1530
1529
|
}
|
|
1531
|
-
function
|
|
1530
|
+
function Xs(a) {
|
|
1532
1531
|
if (typeof a.__modelObjectIndexSeed == "number")
|
|
1533
1532
|
return;
|
|
1534
1533
|
let e = -1;
|
|
@@ -1536,23 +1535,23 @@ function $s(a) {
|
|
|
1536
1535
|
typeof t?.index == "number" && Number.isFinite(t.index) && (e = Math.max(e, t.index));
|
|
1537
1536
|
}), a.__modelObjectIndexSeed = e + 1;
|
|
1538
1537
|
}
|
|
1539
|
-
function
|
|
1540
|
-
|
|
1538
|
+
function $s(a) {
|
|
1539
|
+
Xs(a);
|
|
1541
1540
|
const e = a.__modelObjectIndexSeed;
|
|
1542
1541
|
return a.__modelObjectIndexSeed += 1, e;
|
|
1543
1542
|
}
|
|
1544
|
-
function
|
|
1545
|
-
const i = typeof t == "number" ? t :
|
|
1543
|
+
function di(a, e, t) {
|
|
1544
|
+
const i = typeof t == "number" ? t : $s(a);
|
|
1546
1545
|
return e.index = i, Mn(a).set(i, e), i;
|
|
1547
1546
|
}
|
|
1548
1547
|
function wn(a) {
|
|
1549
1548
|
return Array.isArray(a) ? a : a != null ? [a] : [];
|
|
1550
1549
|
}
|
|
1551
|
-
function
|
|
1550
|
+
function Zs(a) {
|
|
1552
1551
|
return 1 + (Number.isFinite(a) ? Math.abs(Math.floor(a)) : 0) % 16 * 0.125;
|
|
1553
1552
|
}
|
|
1554
|
-
function
|
|
1555
|
-
const t = typeof e == "number" ? e : a?.index, i =
|
|
1553
|
+
function pi(a, e) {
|
|
1554
|
+
const t = typeof e == "number" ? e : a?.index, i = Zs(t);
|
|
1556
1555
|
wn(a?.material).forEach((n) => {
|
|
1557
1556
|
n.userData = n.userData ?? {};
|
|
1558
1557
|
const s = n.userData[At] ?? {};
|
|
@@ -1564,7 +1563,7 @@ function mi(a, e) {
|
|
|
1564
1563
|
}, n.polygonOffset = !0, n.polygonOffsetFactor = 1, n.polygonOffsetUnits = i + (s.edgeActive ? yn : 0), n.needsUpdate = !0;
|
|
1565
1564
|
});
|
|
1566
1565
|
}
|
|
1567
|
-
function
|
|
1566
|
+
function Li(a, e) {
|
|
1568
1567
|
wn(a?.material).forEach((t) => {
|
|
1569
1568
|
t.userData = t.userData ?? {};
|
|
1570
1569
|
const i = t.userData[At] ?? {}, n = i.enabled ? i.units : t.polygonOffsetUnits ?? 0, s = i.enabled ? i.factor : t.polygonOffsetFactor ?? 1;
|
|
@@ -1581,10 +1580,10 @@ function It(a, e) {
|
|
|
1581
1580
|
if (i && i.parent != null)
|
|
1582
1581
|
return i;
|
|
1583
1582
|
i && i.parent == null && t.delete(e);
|
|
1584
|
-
const n =
|
|
1583
|
+
const n = hi(a, (s) => s.index === e)[0];
|
|
1585
1584
|
return n != null ? (t.set(e, n), n) : a?.scene?.children?.find?.((s) => s?.index === e);
|
|
1586
1585
|
}
|
|
1587
|
-
class
|
|
1586
|
+
class Js {
|
|
1588
1587
|
constructor(e) {
|
|
1589
1588
|
this.engine = e;
|
|
1590
1589
|
}
|
|
@@ -1598,12 +1597,12 @@ class Qs {
|
|
|
1598
1597
|
r || (r = [0, 0, []]);
|
|
1599
1598
|
const l = Ne(n, s), c = this.getModelSnapCache(s, o, r);
|
|
1600
1599
|
n.camera.updateMatrixWorld(!0);
|
|
1601
|
-
const u = new
|
|
1600
|
+
const u = new U().multiplyMatrices(n.camera.projectionMatrix, n.camera.matrixWorldInverse), d = n.renderer.domElement.clientWidth, g = n.renderer.domElement.clientHeight, m = new W(t.offsetX, t.offsetY), w = new Lt(), v = new h(), b = new h(), p = new W(), x = new W(), C = new h();
|
|
1602
1601
|
let _ = "face", E = null, k = null, B = 100;
|
|
1603
1602
|
if (i != null) {
|
|
1604
|
-
const I = e.point.clone(),
|
|
1605
|
-
if (
|
|
1606
|
-
const $ =
|
|
1603
|
+
const I = e.point.clone(), H = e.normal || (e.face ? e.face.normal : null);
|
|
1604
|
+
if (H && e.object?.matrixWorld?.elements) {
|
|
1605
|
+
const $ = H.clone().transformDirection(e.object.matrixWorld).normalize(), f = new h().subVectors(i, I).dot($), y = i.clone().sub($.clone().multiplyScalar(f)), P = this.projectWorldPointToScreen(y, u, d, g, p, w);
|
|
1607
1606
|
if (P != null) {
|
|
1608
1607
|
const T = this.getDistanceSq(P.x, P.y, m.x, m.y);
|
|
1609
1608
|
T < B * 4 && (B = T, E = {
|
|
@@ -1618,28 +1617,28 @@ class Qs {
|
|
|
1618
1617
|
for (let I = 0; I < c.localPoints.length; I += 3) {
|
|
1619
1618
|
if (v.set(c.localPoints[I], c.localPoints[I + 1], c.localPoints[I + 2]).applyMatrix4(l), n.clipping && !n.clipping.isPointInClippingRange(v))
|
|
1620
1619
|
continue;
|
|
1621
|
-
const
|
|
1622
|
-
if (
|
|
1620
|
+
const H = this.projectWorldPointToScreen(v, u, d, g, p, w);
|
|
1621
|
+
if (H == null)
|
|
1623
1622
|
continue;
|
|
1624
|
-
const $ = this.getDistanceSq(
|
|
1623
|
+
const $ = this.getDistanceSq(H.x, H.y, m.x, m.y);
|
|
1625
1624
|
$ < B && (B = $, E = {
|
|
1626
1625
|
point: v.clone(),
|
|
1627
1626
|
distanceSq: $,
|
|
1628
|
-
pointxy:
|
|
1627
|
+
pointxy: H.clone(),
|
|
1629
1628
|
style: "rect"
|
|
1630
1629
|
});
|
|
1631
1630
|
}
|
|
1632
1631
|
for (let I = 0; I < c.localCenters.length; I += 3) {
|
|
1633
1632
|
if (v.set(c.localCenters[I], c.localCenters[I + 1], c.localCenters[I + 2]).applyMatrix4(l), n.clipping && !n.clipping.isPointInClippingRange(v))
|
|
1634
1633
|
continue;
|
|
1635
|
-
const
|
|
1636
|
-
if (
|
|
1634
|
+
const H = this.projectWorldPointToScreen(v, u, d, g, p, w);
|
|
1635
|
+
if (H == null)
|
|
1637
1636
|
continue;
|
|
1638
|
-
const $ = this.getDistanceSq(
|
|
1637
|
+
const $ = this.getDistanceSq(H.x, H.y, m.x, m.y);
|
|
1639
1638
|
$ < B && (B = $, E = {
|
|
1640
1639
|
point: v.clone(),
|
|
1641
1640
|
distanceSq: $,
|
|
1642
|
-
pointxy:
|
|
1641
|
+
pointxy: H.clone(),
|
|
1643
1642
|
style: "default"
|
|
1644
1643
|
});
|
|
1645
1644
|
}
|
|
@@ -1648,10 +1647,10 @@ class Qs {
|
|
|
1648
1647
|
else {
|
|
1649
1648
|
for (let I = 0; I < c.localLines.length; I += 6) {
|
|
1650
1649
|
v.set(c.localLines[I], c.localLines[I + 1], c.localLines[I + 2]).applyMatrix4(l), b.set(c.localLines[I + 3], c.localLines[I + 4], c.localLines[I + 5]).applyMatrix4(l);
|
|
1651
|
-
const
|
|
1652
|
-
if (
|
|
1650
|
+
const H = this.projectWorldPointToScreen(v, u, d, g, p, w), $ = this.projectWorldPointToScreen(b, u, d, g, x, w);
|
|
1651
|
+
if (H == null || $ == null)
|
|
1653
1652
|
continue;
|
|
1654
|
-
const S = this.pointToLineProjection(m,
|
|
1653
|
+
const S = this.pointToLineProjection(m, H, $), f = this.pointToLineDistanceSq(m, H, $);
|
|
1655
1654
|
if (f < B) {
|
|
1656
1655
|
const y = this.pointToLineProjection3D(S, v, b, u, C);
|
|
1657
1656
|
if (n.clipping && !n.clipping.isPointInClippingRange(y))
|
|
@@ -1659,8 +1658,8 @@ class Qs {
|
|
|
1659
1658
|
k = {
|
|
1660
1659
|
distanceSq: f,
|
|
1661
1660
|
point: y.clone(),
|
|
1662
|
-
pointxy: this.projectWorldPointToScreen(y, u, d, g, p, w)?.clone() ??
|
|
1663
|
-
start:
|
|
1661
|
+
pointxy: this.projectWorldPointToScreen(y, u, d, g, p, w)?.clone() ?? H.clone(),
|
|
1662
|
+
start: H.clone(),
|
|
1664
1663
|
end: $.clone(),
|
|
1665
1664
|
style: "funnel"
|
|
1666
1665
|
}, B = f;
|
|
@@ -1784,7 +1783,7 @@ class Qs {
|
|
|
1784
1783
|
x.setAttribute("class", "catchFace"), x.setAttribute("points", p.map((C) => `${C.x + t.reactBoundingClientRect.left},${C.y + t.reactBoundingClientRect.top}`).join(" ")), x.setAttribute("fill", "rgba(1, 238, 255, 0.2)"), x.setAttribute("stroke", "rgb(0, 255, 247)"), x.setAttribute("stroke-width", "1"), t.catchSvg.appendChild(x);
|
|
1785
1784
|
}
|
|
1786
1785
|
}
|
|
1787
|
-
function
|
|
1786
|
+
function mi(a) {
|
|
1788
1787
|
const e = {
|
|
1789
1788
|
self: null,
|
|
1790
1789
|
// 当前激活的行为对象
|
|
@@ -1807,17 +1806,17 @@ function gi(a) {
|
|
|
1807
1806
|
touchControlsSnapshot: null,
|
|
1808
1807
|
mouseMoveFrame: null,
|
|
1809
1808
|
latestMouseMoveEvent: null
|
|
1810
|
-
}, t = 800, i = 28, n = 132, s = 44, o = 168, r = new
|
|
1809
|
+
}, t = 800, i = 28, n = 132, s = 44, o = 168, r = new Js(a);
|
|
1811
1810
|
e.handle_catch = function(M, A, z = !0, N = !0) {
|
|
1812
|
-
const
|
|
1811
|
+
const V = e.options;
|
|
1813
1812
|
e.options = {
|
|
1814
|
-
...
|
|
1813
|
+
...V ?? {},
|
|
1815
1814
|
showCatch: z
|
|
1816
1815
|
};
|
|
1817
1816
|
try {
|
|
1818
1817
|
return Xe(M, A, !0, N);
|
|
1819
1818
|
} finally {
|
|
1820
|
-
e.options =
|
|
1819
|
+
e.options = V;
|
|
1821
1820
|
}
|
|
1822
1821
|
}, e.init = function(M, A) {
|
|
1823
1822
|
e.self != null && e.self.disActive != null && e.self.type != M.type && e.self.disActive(), e.self = M, A == null && (A = {
|
|
@@ -1832,7 +1831,7 @@ function gi(a) {
|
|
|
1832
1831
|
e.active = function() {
|
|
1833
1832
|
a.renderer.domElement.addEventListener("mousedown", y), a.renderer.domElement.addEventListener("mouseup", T), a.renderer.domElement.addEventListener("mousemove", P), a.renderer.domElement.addEventListener("touchstart", Q, { capture: !0, passive: !1 }), a.renderer.domElement.addEventListener("touchend", J, { capture: !0, passive: !1 }), a.renderer.domElement.addEventListener("touchcancel", J, { capture: !0, passive: !1 }), a.renderer.domElement.addEventListener("touchmove", fe, { capture: !0, passive: !1 }), a.renderer.domElement.addEventListener("pointerdown", Ee, !0), a.renderer.domElement.addEventListener("pointermove", Ye, !0), a.renderer.domElement.addEventListener("pointerup", Be, !0), a.renderer.domElement.addEventListener("pointercancel", Be, !0), window.addEventListener("keydown", c), window.addEventListener("keyup", u);
|
|
1834
1833
|
}, e.disActive = function() {
|
|
1835
|
-
p(), l(),
|
|
1834
|
+
p(), l(), H(), a.renderer.domElement.removeEventListener("mousedown", y), a.renderer.domElement.removeEventListener("mouseup", T), a.renderer.domElement.removeEventListener("mousemove", P), a.renderer.domElement.removeEventListener("touchstart", Q, !0), a.renderer.domElement.removeEventListener("touchend", J, !0), a.renderer.domElement.removeEventListener("touchcancel", J, !0), a.renderer.domElement.removeEventListener("touchmove", fe, !0), a.renderer.domElement.removeEventListener("pointerdown", Ee, !0), a.renderer.domElement.removeEventListener("pointermove", Ye, !0), a.renderer.domElement.removeEventListener("pointerup", Be, !0), a.renderer.domElement.removeEventListener("pointercancel", Be, !0), window.removeEventListener("keydown", c), window.removeEventListener("keyup", u);
|
|
1836
1835
|
};
|
|
1837
1836
|
function c(M) {
|
|
1838
1837
|
(M.keyCode === 8 || M.keyCode === 46) && e.self && e.self.handelKeyDeleteDown != null && e.self.handelKeyDeleteDown(), M.keyCode === 27 && e.self && e.self.handelKeyEscDown != null && e.self.handelKeyEscDown(), M.keyCode === 13 && e.self && e.self.handelKeyEnterDown != null && e.self.handelKeyEnterDown(), M.keyCode === 32 && e.self && e.self.handelKeySpaceDown != null && e.self.handelKeySpaceDown(), M.key === "Control" && e.self && e.self.handelKeyCtrlDown != null && e.self.handelKeyCtrlDown(), M.key === "Delete" && e.self && e.self.handelKeyDeleteDown != null && e.self.handelKeyDeleteDown(), M.key === "Shift" && e.self && e.self.handelKeyShiftDown != null && e.self.handelKeyShiftDown(), M.key === "Meta" && e.self && e.self.handelKeyMetaDown != null && e.self.handelKeyMetaDown();
|
|
@@ -1895,15 +1894,15 @@ function gi(a) {
|
|
|
1895
1894
|
const M = e.touchMagnifierCanvas;
|
|
1896
1895
|
M && (M.style.display = "none");
|
|
1897
1896
|
}
|
|
1898
|
-
function
|
|
1897
|
+
function H() {
|
|
1899
1898
|
e.touchMagnifierCanvas?.remove?.(), e.touchMagnifierCanvas = null, e.touchMagnifierContext = null;
|
|
1900
1899
|
}
|
|
1901
|
-
function $(M, A, z, N,
|
|
1900
|
+
function $(M, A, z, N, V, ae) {
|
|
1902
1901
|
const ue = a?.catchSvg;
|
|
1903
1902
|
if (!ue?.childElementCount) return;
|
|
1904
1903
|
const de = a?.reactBoundingClientRect ?? A.getBoundingClientRect(), Re = (te) => {
|
|
1905
1904
|
const [_e, He] = te.split(",").map(Number);
|
|
1906
|
-
return Number.isFinite(_e) && Number.isFinite(He) ? [(_e - de.left - z) /
|
|
1905
|
+
return Number.isFinite(_e) && Number.isFinite(He) ? [(_e - de.left - z) / V * n * ae, (He - de.top - N) / V * n * ae] : null;
|
|
1907
1906
|
};
|
|
1908
1907
|
Array.from(ue.children).forEach((te) => {
|
|
1909
1908
|
const _e = te.tagName.toLowerCase(), we = (_e === "line" ? [`${te.getAttribute("x1")},${te.getAttribute("y1")}`, `${te.getAttribute("x2")},${te.getAttribute("y2")}`].map(Re) : (te.getAttribute("points") || "").trim().split(/\s+/).map(Re)).filter(Boolean);
|
|
@@ -1914,7 +1913,7 @@ function gi(a) {
|
|
|
1914
1913
|
const A = a?.renderer?.domElement, z = B(), N = e.touchMagnifierContext;
|
|
1915
1914
|
if (!A || !z || !N)
|
|
1916
1915
|
return;
|
|
1917
|
-
const
|
|
1916
|
+
const V = M?.catch?.point, ae = V && (a?.worldToScreen ?? new oe(a.camera, a.renderer, a.scene)), ue = ae?.worldToScreenIfVisible?.(V) ?? ae?.worldToScreen?.(V);
|
|
1918
1917
|
if (!ue || !Number.isFinite(ue.x) || !Number.isFinite(ue.y) || ue.x < 0 || ue.y < 0 || ue.x > A.clientWidth || ue.y > A.clientHeight) {
|
|
1919
1918
|
I();
|
|
1920
1919
|
return;
|
|
@@ -1938,9 +1937,9 @@ function gi(a) {
|
|
|
1938
1937
|
N.strokeStyle = "rgba(0, 255, 247, 0.9)", N.lineWidth = 1.5 * de, N.beginPath(), N.moveTo(z.width / 2 - 10 * de, z.height / 2), N.lineTo(z.width / 2 + 10 * de, z.height / 2), N.moveTo(z.width / 2, z.height / 2 - 10 * de), N.lineTo(z.width / 2, z.height / 2 + 10 * de), N.stroke(), N.restore();
|
|
1939
1938
|
}
|
|
1940
1939
|
function f(M, A = !1, z = !1, N = !0) {
|
|
1941
|
-
const
|
|
1942
|
-
if (M.raycaster =
|
|
1943
|
-
const ae = Xe(
|
|
1940
|
+
const V = g(M);
|
|
1941
|
+
if (M.raycaster = V, A) {
|
|
1942
|
+
const ae = Xe(V, M, z, N);
|
|
1944
1943
|
M.catch = ae;
|
|
1945
1944
|
}
|
|
1946
1945
|
}
|
|
@@ -1958,16 +1957,16 @@ function gi(a) {
|
|
|
1958
1957
|
return;
|
|
1959
1958
|
const A = Date.now(), z = A - e.mouseDownTime, N = new h(M.offsetX, M.offsetY, 0);
|
|
1960
1959
|
e.self && e.self.handleMouseUp != null && M.button == 0 && (f(M, !1, !1, !1), e.self.handleMouseUp(M));
|
|
1961
|
-
const
|
|
1962
|
-
(z < 100 ||
|
|
1960
|
+
const V = N.distanceTo(e.mouseDownPosition);
|
|
1961
|
+
(z < 100 || V == 0) && e.self && e.self.handleMouseClick != null && (f(M, !0, !0, !1), A - e.lastClickTime < 200 ? e.self.handleMouseDoubleClick != null && M.button == 0 && e.self.handleMouseDoubleClick(M) : e.self.handleMouseClick != null && M.button == 0 ? e.self.handleMouseClick(M) : e.self.handleRightMouseClick != null && M.button == 2 && e.self.handleRightMouseClick(M), e.lastClickTime = Date.now());
|
|
1963
1962
|
}
|
|
1964
1963
|
function D(M) {
|
|
1965
1964
|
const A = M.touches[0] || M.changedTouches[0];
|
|
1966
1965
|
if (!A)
|
|
1967
1966
|
return null;
|
|
1968
|
-
const N = a.renderer.domElement.getBoundingClientRect(),
|
|
1967
|
+
const N = a.renderer.domElement.getBoundingClientRect(), V = A.clientX - N.left, ae = A.clientY - N.top;
|
|
1969
1968
|
return {
|
|
1970
|
-
offsetX:
|
|
1969
|
+
offsetX: V,
|
|
1971
1970
|
offsetY: ae,
|
|
1972
1971
|
button: 0,
|
|
1973
1972
|
// 模拟左键
|
|
@@ -1994,8 +1993,8 @@ function gi(a) {
|
|
|
1994
1993
|
}
|
|
1995
1994
|
function F(M, A, z, N = null) {
|
|
1996
1995
|
p(), e.touchInputMode = z, e.touchPointerId = N, e.touchLatestEvent = M, e.touchStartPosition = A, e.touchLongPressTimer = window.setTimeout(() => {
|
|
1997
|
-
const
|
|
1998
|
-
|
|
1996
|
+
const V = e.touchLatestEvent;
|
|
1997
|
+
V && (e.touchLongPressActive = !0, C(), e.mouseDownTime = Date.now(), e.mouseDownPosition = new h(V.offsetX, V.offsetY, 0), e.self?.handleMouseMove != null && (f(V, !0, !0, e.isClickSimpleModel), e.self.handleMouseMove(V)), S(V));
|
|
1999
1998
|
}, t);
|
|
2000
1999
|
}
|
|
2001
2000
|
function q(M, A) {
|
|
@@ -2065,9 +2064,9 @@ function gi(a) {
|
|
|
2065
2064
|
if (a.engineStatus.editorMode == "simple")
|
|
2066
2065
|
return;
|
|
2067
2066
|
a.catchSvg.innerHTML = "";
|
|
2068
|
-
let
|
|
2069
|
-
if (
|
|
2070
|
-
return e.options.showCatch ? r.applySnapPreview(
|
|
2067
|
+
let V = a.octreeBox.rayInterationModel(M, z, N);
|
|
2068
|
+
if (V = a.clipping?.filterIntersectionsByClipping(V) ?? V, V.length !== 0)
|
|
2069
|
+
return e.options.showCatch ? r.applySnapPreview(V[0], A, e.lastPoint) : V[0];
|
|
2071
2070
|
}
|
|
2072
2071
|
return e.setLastPoint = function(M) {
|
|
2073
2072
|
e.lastPoint = M;
|
|
@@ -2075,7 +2074,7 @@ function gi(a) {
|
|
|
2075
2074
|
e.lastPoint = null;
|
|
2076
2075
|
}, e;
|
|
2077
2076
|
}
|
|
2078
|
-
class
|
|
2077
|
+
class Qs {
|
|
2079
2078
|
engine;
|
|
2080
2079
|
orbitControls;
|
|
2081
2080
|
firstPersonControls;
|
|
@@ -2096,10 +2095,10 @@ class eo {
|
|
|
2096
2095
|
isDown = !1;
|
|
2097
2096
|
containerOffset = { left: 0, top: 0 };
|
|
2098
2097
|
constructor(e) {
|
|
2099
|
-
this.engine = e, this.init(), this.handelBehaved =
|
|
2098
|
+
this.engine = e, this.init(), this.handelBehaved = mi(this.engine), this.handelBehaved.init(this, null), this.handelBehaved.active();
|
|
2100
2099
|
}
|
|
2101
2100
|
init() {
|
|
2102
|
-
this.orbitControls = new fn(this.engine, this.engine.camera, this.engine.renderer.domElement), this.orbitControls.showOriginIcon = !0, this.firstPersonControls = new
|
|
2101
|
+
this.orbitControls = new fn(this.engine, this.engine.camera, this.engine.renderer.domElement), this.orbitControls.showOriginIcon = !0, this.firstPersonControls = new Di(this.engine, this.engine.camera, this.engine.renderer.domElement), this.thirdPersonControls = new Ii(this.engine, this.engine.camera, this.engine.renderer.domElement);
|
|
2103
2102
|
const e = document.createElement("div");
|
|
2104
2103
|
this.originDiv = e, e.className = "originDiv", e.style.position = "absolute", e.style.top = "0px", e.style.left = "0px", e.style.width = "30px", e.style.height = "30px", e.style.borderRadius = "50%", e.style.pointerEvents = "none", e.style.backgroundImage = `url(${G("/assets/svg/rotate-orbit.svg", import.meta.url)})`, this.engine.container.appendChild(this.originDiv);
|
|
2105
2104
|
}
|
|
@@ -2146,7 +2145,7 @@ class eo {
|
|
|
2146
2145
|
}
|
|
2147
2146
|
// 切换第一人称漫游模式
|
|
2148
2147
|
switchFirstPersonMode() {
|
|
2149
|
-
this.engine.cameraModule.switchToPerspectiveCamera(), this.firstPersonControls && (this.firstPersonControls.sanitizeCameraOrientation?.(), this.firstPersonControls.enabled = !1), this.thirdPersonControls && (this.thirdPersonControls.enabled = !1), this.firstPersonControls = new
|
|
2148
|
+
this.engine.cameraModule.switchToPerspectiveCamera(), this.firstPersonControls && (this.firstPersonControls.sanitizeCameraOrientation?.(), this.firstPersonControls.enabled = !1), this.thirdPersonControls && (this.thirdPersonControls.enabled = !1), this.firstPersonControls = new Di(
|
|
2150
2149
|
this.engine,
|
|
2151
2150
|
this.engine.camera,
|
|
2152
2151
|
this.engine.renderer.domElement,
|
|
@@ -2163,7 +2162,7 @@ class eo {
|
|
|
2163
2162
|
applyCollision: t?.applyCollision,
|
|
2164
2163
|
applyGravity: t?.applyGravity
|
|
2165
2164
|
};
|
|
2166
|
-
return t?.dispose?.(), this.thirdPersonControls = new
|
|
2165
|
+
return t?.dispose?.(), this.thirdPersonControls = new Ii(
|
|
2167
2166
|
this.engine,
|
|
2168
2167
|
this.engine.camera,
|
|
2169
2168
|
this.engine.renderer.domElement,
|
|
@@ -2376,7 +2375,7 @@ class eo {
|
|
|
2376
2375
|
this.isActive = !1, this.handelBehaved?.disActive?.(), this.orbitControls?.dispose?.(), this.firstPersonControls?.dispose?.(), this.thirdPersonControls?.dispose?.(), this.removeMobileRoamControls(), this.originDiv?.remove(), this.originDiv = null, this.orbitControls = null, this.firstPersonControls = null, this.thirdPersonControls = null, this.handelBehaved = null;
|
|
2377
2376
|
}
|
|
2378
2377
|
}
|
|
2379
|
-
const
|
|
2378
|
+
const eo = {
|
|
2380
2379
|
uniforms: {
|
|
2381
2380
|
tDiffuse: { value: null },
|
|
2382
2381
|
saturation: { value: 1.2 },
|
|
@@ -2413,7 +2412,7 @@ const to = {
|
|
|
2413
2412
|
}
|
|
2414
2413
|
`
|
|
2415
2414
|
}, xn = 0.5, bn = 1.1, Cn = 1;
|
|
2416
|
-
class
|
|
2415
|
+
class to {
|
|
2417
2416
|
engine;
|
|
2418
2417
|
composer;
|
|
2419
2418
|
saturationPass;
|
|
@@ -2453,7 +2452,7 @@ class io {
|
|
|
2453
2452
|
});
|
|
2454
2453
|
r.texture.colorSpace = $n, this.composer = new Zn(s, r), this.composer.setPixelRatio(o), this.composer.setSize(e, t);
|
|
2455
2454
|
const l = new Jn(i, n);
|
|
2456
|
-
this.composer.addPass(l), this.gtaoPass = new
|
|
2455
|
+
this.composer.addPass(l), this.gtaoPass = new fi(i, n, e, t), this.gtaoPass.output = fi.OUTPUT.Default, this.gtaoPass.blendIntensity = xn, this.gtaoPass.enabled = !1, this.gtaoPass.updateGtaoMaterial && this.gtaoPass.updateGtaoMaterial({
|
|
2457
2456
|
// AO 采样半径。推荐范围:0.1 ~ 2.0。
|
|
2458
2457
|
// 越大遮蔽范围越广,但容易发灰、丢细节;对性能有轻到中等影响。
|
|
2459
2458
|
radius: 0.45,
|
|
@@ -2479,10 +2478,10 @@ class io {
|
|
|
2479
2478
|
samples: 32,
|
|
2480
2479
|
rings: 3,
|
|
2481
2480
|
radiusExponent: 2
|
|
2482
|
-
}), this.applyClippingToAmbientOcclusionPass(this.gtaoPass), this.composer.addPass(this.gtaoPass), this.ssaoPass = new
|
|
2481
|
+
}), this.applyClippingToAmbientOcclusionPass(this.gtaoPass), this.composer.addPass(this.gtaoPass), this.ssaoPass = new yi(i, n, e, t), this.ssaoPass.kernelRadius = 8, this.ssaoPass.minDistance = 5e-3, this.ssaoPass.maxDistance = 0.1, this.ssaoPass.output = yi.OUTPUT.Default, this.ssaoPass.enabled = !1, this.applyClippingToAmbientOcclusionPass(this.ssaoPass), this.composer.addPass(this.ssaoPass), this.saturationPass = new kt(eo), this.saturationPass.uniforms.saturation.value = bn, this.saturationPass.uniforms.contrast.value = Cn, this.saturationPass.enabled = !1, this.composer.addPass(this.saturationPass), this.outputPass = new Qn(), this.outputPass.enabled = !0, this.composer.addPass(this.outputPass), this.fxaaPass = new kt(es), this.fxaaPass.material.uniforms.resolution.value.x = 1 / (e * o), this.fxaaPass.material.uniforms.resolution.value.y = 1 / (t * o), this.fxaaPass.enabled = !1, this.composer.addPass(this.fxaaPass);
|
|
2483
2482
|
}
|
|
2484
2483
|
}
|
|
2485
|
-
function
|
|
2484
|
+
function io(a, e, t, i) {
|
|
2486
2485
|
const r = a.models.find((v) => v.url == t);
|
|
2487
2486
|
if (r == null)
|
|
2488
2487
|
return;
|
|
@@ -2493,14 +2492,14 @@ function no(a, e, t, i) {
|
|
|
2493
2492
|
}, v.rotation = { x: 0, y: 0, z: 0 }, v), w = (v, b) => {
|
|
2494
2493
|
if (!Array.isArray(b) || b.length === 0)
|
|
2495
2494
|
return;
|
|
2496
|
-
const p = b.map((C) => m(C)), x =
|
|
2495
|
+
const p = b.map((C) => m(C)), x = no(v, l, p, t, a);
|
|
2497
2496
|
x != null && p.forEach((C, _) => {
|
|
2498
2497
|
C.indexes = [[x, _, 0, 0]], r.nodesMap.set(Number(C.id), C);
|
|
2499
2498
|
});
|
|
2500
2499
|
};
|
|
2501
2500
|
w("Circle", c), w("Rect", u), w("Ellipse", g), w("Bridge", d);
|
|
2502
2501
|
}
|
|
2503
|
-
function
|
|
2502
|
+
function no(a, e, t, i, n) {
|
|
2504
2503
|
let s;
|
|
2505
2504
|
const o = {
|
|
2506
2505
|
width: 1,
|
|
@@ -2529,8 +2528,8 @@ function so(a, e, t, i, n) {
|
|
|
2529
2528
|
return null;
|
|
2530
2529
|
const r = new X(s.geometry, s.material, t.length);
|
|
2531
2530
|
r.url = i, e.add(r);
|
|
2532
|
-
const l =
|
|
2533
|
-
|
|
2531
|
+
const l = di(n, r);
|
|
2532
|
+
pi(r, l);
|
|
2534
2533
|
const c = [], u = [];
|
|
2535
2534
|
for (let g = 0; g < t.length; g++) {
|
|
2536
2535
|
const m = t[g], w = new h(m.startPoint.X, 0, -m.startPoint.Y), v = new h(m.endPoint.X, 0, -m.endPoint.Y), b = new h(m.startPoint.X, m.startPoint.Z, -m.startPoint.Y), p = new h(m.endPoint.X, m.endPoint.Z, -m.endPoint.Y);
|
|
@@ -2542,10 +2541,10 @@ function so(a, e, t, i, n) {
|
|
|
2542
2541
|
}
|
|
2543
2542
|
} else
|
|
2544
2543
|
C = (v.clone().sub(w.clone()).cross(new h(0, 0, 1)).y > 0 ? -1 : 1) * v.clone().sub(w.clone()).angleTo(new h(0, 0, 1)), x = (m.startPoint.Z > m.endPoint.Z ? 1 : -1) * v.clone().sub(w.clone()).angleTo(p.clone().sub(b.clone()));
|
|
2545
|
-
const E = new
|
|
2546
|
-
let I,
|
|
2547
|
-
a === "Circle" ? (I = m.diameter,
|
|
2548
|
-
const $ = E.clone().makeScale(I,
|
|
2544
|
+
const E = new U(), k = new nn(x, C, _, "YXZ"), B = E.clone().makeRotationFromEuler(k);
|
|
2545
|
+
let I, H;
|
|
2546
|
+
a === "Circle" ? (I = m.diameter, H = m.diameter) : (I = m.width, H = m.height);
|
|
2547
|
+
const $ = E.clone().makeScale(I, H, m.length);
|
|
2549
2548
|
E.multiplyMatrices(B, $), E.setPosition(m.position.x, m.position.y, m.position.z), r.setMatrixAt(g, E.clone()), r.setColorAt(g, m.color), r.geometry.computeBoundingBox();
|
|
2550
2549
|
const S = r.geometry.boundingBox.min.clone().applyMatrix4(E.clone()), f = r.geometry.boundingBox.max.clone().applyMatrix4(E.clone()), y = new h(Math.min(S.x, f.x), Math.min(S.y, f.y), Math.min(S.z, f.z)), P = new h(Math.max(S.x, f.x), Math.max(S.y, f.y), Math.max(S.z, f.z)), T = y.clone().add(P.clone()).multiplyScalar(0.5), D = {
|
|
2551
2550
|
name: m.name,
|
|
@@ -2596,7 +2595,7 @@ function gt(a, e) {
|
|
|
2596
2595
|
};
|
|
2597
2596
|
return n(t, i, e.color, e.position, e.rotation);
|
|
2598
2597
|
function n(s, o, r, l, c) {
|
|
2599
|
-
const u = new cn(s, o), d = new
|
|
2598
|
+
const u = new cn(s, o), d = new ri({
|
|
2600
2599
|
color: r,
|
|
2601
2600
|
side: ge
|
|
2602
2601
|
}), g = new O(u, d);
|
|
@@ -2604,18 +2603,18 @@ function gt(a, e) {
|
|
|
2604
2603
|
}
|
|
2605
2604
|
}
|
|
2606
2605
|
var ee = /* @__PURE__ */ ((a) => (a.ModelLoadStart = "model-load-start", a.ModelLoadProgress = "model-load-progress", a.ModelLoaded = "model-loaded", a.ModelError = "model-error", a.SelectionChanged = "selection-changed", a.HoverChanged = "hover-changed", a.Click = "click", a.MouseMove = "mouse-move", a.CameraChanged = "camera-changed", a.CameraIdle = "camera-idle", a.EngineFree = "engine-free", a.EngineBusy = "engine-busy", a.MeasureChanged = "measure-changed", a.MeasureClick = "measure-click", a.SectionMove = "section-move", a.LoadingCompleted = "loading_completed", a))(ee || {});
|
|
2607
|
-
const
|
|
2608
|
-
function
|
|
2606
|
+
const ki = "__bvhAccelerationInstalled", Sn = "__bvhBuildFailed", so = "__bvhBuilt", oo = "__bvhTriangleCount", En = 200, ro = 10;
|
|
2607
|
+
function ao() {
|
|
2609
2608
|
const a = globalThis;
|
|
2610
|
-
a[
|
|
2609
|
+
a[ki] !== !0 && (O.prototype.raycast = ts, Me.prototype.computeBoundsTree = hn, Me.prototype.disposeBoundsTree = is, a[ki] = !0);
|
|
2611
2610
|
}
|
|
2612
|
-
function
|
|
2611
|
+
function lo(a) {
|
|
2613
2612
|
a.firstHitOnly = !0;
|
|
2614
2613
|
}
|
|
2615
|
-
function
|
|
2614
|
+
function co(a) {
|
|
2616
2615
|
delete a.firstHitOnly;
|
|
2617
2616
|
}
|
|
2618
|
-
function
|
|
2617
|
+
function ho(a, e = En) {
|
|
2619
2618
|
if (a == null)
|
|
2620
2619
|
return !1;
|
|
2621
2620
|
const t = a;
|
|
@@ -2624,46 +2623,46 @@ function uo(a, e = En) {
|
|
|
2624
2623
|
const i = a.attributes.position?.count ?? 0;
|
|
2625
2624
|
return (a.index?.count ?? i) / 3 >= e;
|
|
2626
2625
|
}
|
|
2627
|
-
function
|
|
2626
|
+
function uo(a) {
|
|
2628
2627
|
if (a == null)
|
|
2629
2628
|
return 0;
|
|
2630
2629
|
const e = a.attributes.position?.count ?? 0;
|
|
2631
2630
|
return (a.index?.count ?? e) / 3;
|
|
2632
2631
|
}
|
|
2633
|
-
function
|
|
2632
|
+
function po(a, e = {}) {
|
|
2634
2633
|
if (a == null)
|
|
2635
2634
|
return;
|
|
2636
2635
|
const t = e.triangleThreshold ?? En;
|
|
2637
|
-
if (!
|
|
2636
|
+
if (!ho(a, t)) {
|
|
2638
2637
|
e.setBoundingBox === !0 && a.boundingBox == null && a.computeBoundingBox(), e.setBoundingSphere === !0 && a.boundingSphere == null && a.computeBoundingSphere();
|
|
2639
2638
|
return;
|
|
2640
2639
|
}
|
|
2641
2640
|
const i = a;
|
|
2642
2641
|
try {
|
|
2643
|
-
i.userData = i.userData ?? {}, i.userData[
|
|
2644
|
-
maxLeafTris: e.maxLeafTris ??
|
|
2645
|
-
}), i.userData[
|
|
2642
|
+
i.userData = i.userData ?? {}, i.userData[oo] = uo(a), e.setBoundingBox === !0 && a.boundingBox == null && a.computeBoundingBox(), e.setBoundingSphere === !0 && a.boundingSphere == null && a.computeBoundingSphere(), hn.call(i, {
|
|
2643
|
+
maxLeafTris: e.maxLeafTris ?? ro
|
|
2644
|
+
}), i.userData[so] = i.boundsTree != null;
|
|
2646
2645
|
} catch (n) {
|
|
2647
2646
|
i.userData = i.userData ?? {}, i.userData[Sn] = !0, console.warn("[raycastAcceleration] failed to build bounds tree", n);
|
|
2648
2647
|
}
|
|
2649
2648
|
}
|
|
2650
|
-
let Ze = null, Je = null,
|
|
2651
|
-
const
|
|
2649
|
+
let Ze = null, Je = null, zi = null;
|
|
2650
|
+
const mo = 8, Pn = 24, go = 24, fo = 64, yo = 240, vo = 2, Mo = 10;
|
|
2652
2651
|
function An() {
|
|
2653
2652
|
return G("draco/", import.meta.url);
|
|
2654
2653
|
}
|
|
2655
2654
|
function _n() {
|
|
2656
2655
|
return G("basis/", import.meta.url);
|
|
2657
2656
|
}
|
|
2658
|
-
function
|
|
2657
|
+
function wo() {
|
|
2659
2658
|
return Ze == null && (Ze = new os(), Ze.setDecoderPath(An()), Ze.preload()), Ze;
|
|
2660
2659
|
}
|
|
2661
|
-
function
|
|
2662
|
-
return Je == null && (Je = new rs(), Je.setTranscoderPath(_n())),
|
|
2660
|
+
function xo(a) {
|
|
2661
|
+
return Je == null && (Je = new rs(), Je.setTranscoderPath(_n())), zi !== a && (Je.detectSupport(a), zi = a), Je;
|
|
2663
2662
|
}
|
|
2664
|
-
function
|
|
2663
|
+
function bo(a) {
|
|
2665
2664
|
const e = new on();
|
|
2666
|
-
return e.setDRACOLoader(
|
|
2665
|
+
return e.setDRACOLoader(wo()), e.setMeshoptDecoder(ss), a?.renderer?.capabilities != null && typeof a.renderer.getContext == "function" && e.setKTX2Loader(xo(a.renderer)), e;
|
|
2667
2666
|
}
|
|
2668
2667
|
function Tn() {
|
|
2669
2668
|
return new Promise((a) => {
|
|
@@ -2674,20 +2673,20 @@ function Tn() {
|
|
|
2674
2673
|
setTimeout(a, 16);
|
|
2675
2674
|
});
|
|
2676
2675
|
}
|
|
2677
|
-
function
|
|
2676
|
+
function Co() {
|
|
2678
2677
|
const a = navigator?.scheduling;
|
|
2679
2678
|
return typeof a?.isInputPending == "function" ? a.isInputPending() : !1;
|
|
2680
2679
|
}
|
|
2681
|
-
function
|
|
2682
|
-
return a?.engineStatus?.isFree === !1 ||
|
|
2680
|
+
function So(a) {
|
|
2681
|
+
return a?.engineStatus?.isFree === !1 || Co();
|
|
2683
2682
|
}
|
|
2684
2683
|
async function ze(a, e, t) {
|
|
2685
2684
|
if (e)
|
|
2686
2685
|
return t;
|
|
2687
2686
|
const i = performance.now();
|
|
2688
|
-
return
|
|
2687
|
+
return So(a) || i - t >= mo ? (await Tn(), performance.now()) : t;
|
|
2689
2688
|
}
|
|
2690
|
-
function
|
|
2689
|
+
function Eo(a, e) {
|
|
2691
2690
|
return new Promise((t, i) => {
|
|
2692
2691
|
Pt(a, (n) => {
|
|
2693
2692
|
if (n == null) {
|
|
@@ -2700,42 +2699,42 @@ function Po(a, e) {
|
|
|
2700
2699
|
}, e);
|
|
2701
2700
|
});
|
|
2702
2701
|
}
|
|
2703
|
-
async function
|
|
2702
|
+
async function Po(a, e) {
|
|
2704
2703
|
const t = await gn({
|
|
2705
2704
|
method: "get",
|
|
2706
2705
|
responseType: "arraybuffer",
|
|
2707
2706
|
url: a
|
|
2708
2707
|
});
|
|
2709
2708
|
let i = t.data;
|
|
2710
|
-
return
|
|
2709
|
+
return bi.isEncrypted(t.data) && (i = await bi.decryptPzEnc(t.data, e)), Yt.loadAsync(i);
|
|
2711
2710
|
}
|
|
2712
|
-
function
|
|
2711
|
+
function Bi(a) {
|
|
2713
2712
|
return a.replace(/\\/g, "/").replace(/^\/+/, "");
|
|
2714
2713
|
}
|
|
2715
2714
|
function Dn(a, e) {
|
|
2716
|
-
const t = new Set(e.map((i) =>
|
|
2715
|
+
const t = new Set(e.map((i) => Bi(i)));
|
|
2717
2716
|
for (const i of Object.keys(a.files))
|
|
2718
|
-
if (t.has(
|
|
2717
|
+
if (t.has(Bi(i)))
|
|
2719
2718
|
return a.files[i];
|
|
2720
2719
|
return null;
|
|
2721
2720
|
}
|
|
2722
|
-
function
|
|
2721
|
+
function Ri(a, e) {
|
|
2723
2722
|
const t = Dn(a, e);
|
|
2724
2723
|
return t == null || t.dir ? Promise.resolve(null) : t.async("string");
|
|
2725
2724
|
}
|
|
2726
|
-
function
|
|
2725
|
+
function Ao(a) {
|
|
2727
2726
|
return a.charCodeAt(0) === 65279 ? a.slice(1) : a;
|
|
2728
2727
|
}
|
|
2729
2728
|
function Zt(a) {
|
|
2730
|
-
return JSON.parse(
|
|
2729
|
+
return JSON.parse(Ao(a));
|
|
2731
2730
|
}
|
|
2732
|
-
function
|
|
2731
|
+
function _o(a, e) {
|
|
2733
2732
|
const t = Dn(a, e);
|
|
2734
2733
|
return t == null || t.dir ? Promise.resolve(null) : t.async("arraybuffer");
|
|
2735
2734
|
}
|
|
2736
|
-
function
|
|
2735
|
+
function To(a, e) {
|
|
2737
2736
|
return new Promise((t, i) => {
|
|
2738
|
-
|
|
2737
|
+
bo(a).parse(e, Ls(import.meta.url), t, i);
|
|
2739
2738
|
});
|
|
2740
2739
|
}
|
|
2741
2740
|
function Ke(a, e) {
|
|
@@ -2749,27 +2748,27 @@ function In(a, e) {
|
|
|
2749
2748
|
function Ln(a) {
|
|
2750
2749
|
a.loadStatus == null && (a.loadStatus = {}), a.loadStatus.modelMep == null && (a.loadStatus.modelMep = !1), a.loadStatus.normal == null && (a.loadStatus.normal = !1);
|
|
2751
2750
|
}
|
|
2752
|
-
function
|
|
2751
|
+
function Do(a) {
|
|
2753
2752
|
return Ln(a), a.status === "loaded" && a.loadStatus.normal === !0 && a.loadStatus.modelMep === !0;
|
|
2754
2753
|
}
|
|
2755
2754
|
function kn(a) {
|
|
2756
2755
|
const e = a?.engineStatus?.models;
|
|
2757
|
-
!Array.isArray(e) || e.length === 0 || !e.every((i) =>
|
|
2756
|
+
!Array.isArray(e) || e.length === 0 || !e.every((i) => Do(i)) || a.__loadingCompletedTriggered === !0 || (a.__loadingCompletedTriggered = !0, a.events?.trigger?.(ee.LoadingCompleted, {}));
|
|
2758
2757
|
}
|
|
2759
2758
|
function zn(a) {
|
|
2760
2759
|
return a === !0 || a === "loading";
|
|
2761
2760
|
}
|
|
2762
|
-
function
|
|
2761
|
+
function Fi(a) {
|
|
2763
2762
|
return a.index != null ? a.index.count : a.attributes.position?.count ?? 0;
|
|
2764
2763
|
}
|
|
2765
|
-
async function
|
|
2764
|
+
async function Io(a, e, t) {
|
|
2766
2765
|
let i = performance.now();
|
|
2767
2766
|
for (let n = 0; n < e.length; n++) {
|
|
2768
2767
|
const s = e[n];
|
|
2769
|
-
s?.geometry != null && s.geometry.computeVertexNormals, (n + 1) %
|
|
2768
|
+
s?.geometry != null && s.geometry.computeVertexNormals, (n + 1) % go === 0 && (i = await ze(a, t, i));
|
|
2770
2769
|
}
|
|
2771
2770
|
}
|
|
2772
|
-
async function
|
|
2771
|
+
async function Lo(a, e, t) {
|
|
2773
2772
|
const i = [], n = [{ node: e.octreeBox, visited: !1 }];
|
|
2774
2773
|
let s = performance.now();
|
|
2775
2774
|
for (; n.length > 0; ) {
|
|
@@ -2790,11 +2789,11 @@ async function ko(a, e, t) {
|
|
|
2790
2789
|
}
|
|
2791
2790
|
return i;
|
|
2792
2791
|
}
|
|
2793
|
-
async function
|
|
2792
|
+
async function ko(a, e, t, i) {
|
|
2794
2793
|
const n = Ke(a, e.url);
|
|
2795
2794
|
if (n?.nodesMap == null)
|
|
2796
2795
|
return [];
|
|
2797
|
-
const s = await
|
|
2796
|
+
const s = await Lo(a, t, i);
|
|
2798
2797
|
console.log("[loadLightModel] pending mesh ids", t.path, s.length);
|
|
2799
2798
|
const o = [];
|
|
2800
2799
|
let r = performance.now(), l = 0;
|
|
@@ -2806,10 +2805,10 @@ async function zo(a, e, t, i) {
|
|
|
2806
2805
|
const m = t.glbs?.[g.glb]?.[g.mesh];
|
|
2807
2806
|
if (m?.geometry == null || m.material == null)
|
|
2808
2807
|
continue;
|
|
2809
|
-
const w = new
|
|
2808
|
+
const w = new U();
|
|
2810
2809
|
w.elements = g.matrix;
|
|
2811
2810
|
const v = m.geometry.clone();
|
|
2812
|
-
v.applyMatrix4(w), v.computeBoundingBox(), v.attributes.position.count > 2e4 &&
|
|
2811
|
+
v.applyMatrix4(w), v.computeBoundingBox(), v.attributes.position.count > 2e4 && po(v, {
|
|
2813
2812
|
setBoundingSphere: !0
|
|
2814
2813
|
});
|
|
2815
2814
|
const b = new O(v, m.material);
|
|
@@ -2822,33 +2821,33 @@ function Bn(a) {
|
|
|
2822
2821
|
const e = a.clone();
|
|
2823
2822
|
return e.clippingPlanes = a.clippingPlanes, e;
|
|
2824
2823
|
}
|
|
2825
|
-
function
|
|
2824
|
+
function zo(a) {
|
|
2826
2825
|
a.setRGB(a.r, a.g, a.b, Dt);
|
|
2827
2826
|
}
|
|
2828
|
-
function
|
|
2827
|
+
function Bo(a) {
|
|
2829
2828
|
const e = a;
|
|
2830
|
-
e.color == null || a.userData.__displayColorLinearized === !0 || (
|
|
2829
|
+
e.color == null || a.userData.__displayColorLinearized === !0 || (zo(e.color), a.userData.__displayColorLinearized = !0);
|
|
2831
2830
|
}
|
|
2832
|
-
function
|
|
2831
|
+
function Ro(a, e, t, i, n) {
|
|
2833
2832
|
const s = nt(
|
|
2834
2833
|
i.map((u) => u.geometry),
|
|
2835
2834
|
!1
|
|
2836
2835
|
), o = Bn(n), r = new O(s, o);
|
|
2837
2836
|
r.castShadow = !0, r.receiveShadow = !0, je(e, a).add(r);
|
|
2838
|
-
const c =
|
|
2839
|
-
return
|
|
2837
|
+
const c = di(e, r);
|
|
2838
|
+
return pi(r, c), r.url = a, r.glb = t, r.materialClone = o, r.geometrys = i.map((u) => u.geometry), r.geometry.computeVertexNormals(), r;
|
|
2840
2839
|
}
|
|
2841
|
-
function
|
|
2840
|
+
function Fo(a, e, t, i) {
|
|
2842
2841
|
return (Oe(a, e)?.children ?? a.scene.children).find((o) => {
|
|
2843
2842
|
const r = o;
|
|
2844
2843
|
return o instanceof O && r.url == e && r.glb == t && r.materialClone === i;
|
|
2845
2844
|
});
|
|
2846
2845
|
}
|
|
2847
|
-
function
|
|
2846
|
+
function Oo(a, e) {
|
|
2848
2847
|
const t = Array.isArray(a.geometrys) ? a.geometrys : [], i = e.map((o) => o.geometry), n = [...t, ...i], s = nt(n, !1);
|
|
2849
2848
|
a.geometry != null && a.geometry.dispose(), a.geometry = s, a.geometrys = n, a.castShadow = !0, a.receiveShadow = !0;
|
|
2850
2849
|
}
|
|
2851
|
-
async function
|
|
2850
|
+
async function No(a, e, t, i) {
|
|
2852
2851
|
const n = /* @__PURE__ */ new Map();
|
|
2853
2852
|
for (const r of t) {
|
|
2854
2853
|
const l = n.get(r.glb) ?? [];
|
|
@@ -2857,18 +2856,18 @@ async function Ho(a, e, t, i) {
|
|
|
2857
2856
|
const s = Ke(e, a);
|
|
2858
2857
|
let o = performance.now();
|
|
2859
2858
|
for (const [r, l] of n.entries()) {
|
|
2860
|
-
const c = i ? l.length :
|
|
2859
|
+
const c = i ? l.length : yo;
|
|
2861
2860
|
for (let u = 0; u < l.length; u += c) {
|
|
2862
2861
|
const d = l.slice(u, u + c);
|
|
2863
2862
|
if (d.length === 0)
|
|
2864
2863
|
continue;
|
|
2865
|
-
const g =
|
|
2866
|
-
let m =
|
|
2867
|
-
m = null, m != null ? (w = Array.isArray(m.geometrys) ? m.geometrys.length : 0, v =
|
|
2864
|
+
const g = $o(d[0].material, e);
|
|
2865
|
+
let m = Fo(e, a, r, g), w = 0, v = 0;
|
|
2866
|
+
m = null, m != null ? (w = Array.isArray(m.geometrys) ? m.geometrys.length : 0, v = Fi(m.geometry), Oo(m, d)) : m = Ro(a, e, r, d, g);
|
|
2868
2867
|
const b = /* @__PURE__ */ new Map();
|
|
2869
2868
|
let p = v;
|
|
2870
2869
|
d.forEach((x, C) => {
|
|
2871
|
-
const _ = Number(x.name), E =
|
|
2870
|
+
const _ = Number(x.name), E = Fi(x.geometry), k = b.get(_) ?? [];
|
|
2872
2871
|
if (k.push([p, p + E]), b.set(_, k), s?.nodesMap?.has(_)) {
|
|
2873
2872
|
const B = s.nodesMap.get(_);
|
|
2874
2873
|
B.indexes == null && (B.indexes = []), B.indexes.push([m.index, w + C, p, p + E]);
|
|
@@ -2881,11 +2880,11 @@ async function Ho(a, e, t, i) {
|
|
|
2881
2880
|
}
|
|
2882
2881
|
}
|
|
2883
2882
|
}
|
|
2884
|
-
function
|
|
2883
|
+
function Ho(a, e) {
|
|
2885
2884
|
const t = a?.geometry;
|
|
2886
2885
|
return t instanceof Me ? (t.boundingBox == null && t.computeBoundingBox(), t.boundingBox?.clone().applyMatrix4(e) ?? null) : null;
|
|
2887
2886
|
}
|
|
2888
|
-
async function
|
|
2887
|
+
async function Vo(a, e, t, i, n, s) {
|
|
2889
2888
|
if (i == null || n == null || n.length === 0)
|
|
2890
2889
|
return;
|
|
2891
2890
|
const o = Ke(t, a);
|
|
@@ -2893,8 +2892,8 @@ async function Uo(a, e, t, i, n, s) {
|
|
|
2893
2892
|
return;
|
|
2894
2893
|
const r = new X(i.geometry, Bn(i.material), n.length);
|
|
2895
2894
|
je(t, a).add(r);
|
|
2896
|
-
const c =
|
|
2897
|
-
|
|
2895
|
+
const c = di(t, r);
|
|
2896
|
+
pi(r, c);
|
|
2898
2897
|
const u = new Float32Array(n.length * 3);
|
|
2899
2898
|
for (let m = 0; m < n.length; m++)
|
|
2900
2899
|
u[m * 3] = 1, u[m * 3 + 1] = 1, u[m * 3 + 2] = 1;
|
|
@@ -2902,19 +2901,19 @@ async function Uo(a, e, t, i, n, s) {
|
|
|
2902
2901
|
let d = performance.now();
|
|
2903
2902
|
const g = [];
|
|
2904
2903
|
for (let m = 0; m < n.length; m++) {
|
|
2905
|
-
const w = n[m], v = new
|
|
2904
|
+
const w = n[m], v = new U();
|
|
2906
2905
|
v.elements = w.matrix;
|
|
2907
|
-
const b =
|
|
2906
|
+
const b = Ho(i, v);
|
|
2908
2907
|
if (b != null && (w.box = b.clone()), r.setMatrixAt(m, v), r.matrixs || (r.matrixs = []), r.matrixs.push(v.clone()), g.push(v.clone()), o.nodesMap.has(w.id)) {
|
|
2909
2908
|
const p = o.nodesMap.get(w.id);
|
|
2910
2909
|
p.indexes == null && (p.indexes = []), p.indexes.push([c, m, 0, 0]), b != null && p?.info != null && (p.info.box instanceof Y ? p.info.box.union(b) : p.info.box = b.clone());
|
|
2911
2910
|
} else
|
|
2912
2911
|
o.nodesMap.set(w.id, { instance: !0, info: w, indexes: [[c, m, 0, 0]] });
|
|
2913
|
-
(m + 1) %
|
|
2912
|
+
(m + 1) % fo === 0 && (d = await ze(t, s, d));
|
|
2914
2913
|
}
|
|
2915
2914
|
r.instanceMatrix.needsUpdate = !0, r.instanceColor != null && (r.instanceColor.needsUpdate = !0), r.materialClone = r.material, r.url = a, r.glb = i.glb, r.ids = n.map((m) => m.id), r.matrixsClone = g, r.meshIndex = e, t.requestComposerRender?.();
|
|
2916
2915
|
}
|
|
2917
|
-
async function
|
|
2916
|
+
async function Uo(a, e, t, i) {
|
|
2918
2917
|
const n = e.instanceNodes;
|
|
2919
2918
|
if (n == null)
|
|
2920
2919
|
return;
|
|
@@ -2924,25 +2923,25 @@ async function Go(a, e, t, i) {
|
|
|
2924
2923
|
n[o].isLoaded = !0;
|
|
2925
2924
|
for (const r of n[o]) {
|
|
2926
2925
|
const l = e.glbs?.[o]?.[r.mesh];
|
|
2927
|
-
l != null && await
|
|
2926
|
+
l != null && await Vo(a.url, r.mesh, t, l, r.children, i);
|
|
2928
2927
|
}
|
|
2929
2928
|
s = await ze(t, i, s);
|
|
2930
2929
|
}
|
|
2931
2930
|
}
|
|
2932
|
-
async function
|
|
2931
|
+
async function Go(a, e, t, i) {
|
|
2933
2932
|
if (t.status === !0 || t.meshPromise != null) {
|
|
2934
2933
|
await t.meshPromise;
|
|
2935
2934
|
return;
|
|
2936
2935
|
}
|
|
2937
2936
|
t.meshPromise = (async () => {
|
|
2938
2937
|
console.log(`[loadLightModel] start build lod meshes ${Date.now() - window.startTime}ms`);
|
|
2939
|
-
const n = await
|
|
2940
|
-
await
|
|
2938
|
+
const n = await ko(a, e, t, i);
|
|
2939
|
+
await No(e.url, a, n, i), await Uo(e, t, a, i), t.instanceNodes = null, t.status = !0, console.log(`[loadLightModel] *****************************************************finish build lod meshes ${Date.now() - window.startTime}ms`);
|
|
2941
2940
|
})().finally(() => {
|
|
2942
2941
|
t.meshPromise = null;
|
|
2943
2942
|
}), await t.meshPromise;
|
|
2944
2943
|
}
|
|
2945
|
-
async function
|
|
2944
|
+
async function Wo(a, e, t, i) {
|
|
2946
2945
|
if (t.loadSuccess !== !0) {
|
|
2947
2946
|
if (t.preparePromise != null) {
|
|
2948
2947
|
await t.preparePromise;
|
|
@@ -2952,9 +2951,9 @@ async function qo(a, e, t, i) {
|
|
|
2952
2951
|
console.log("[loadLightModel] loading GLB bundle", t.path), t.glbs = t.glbs ?? {};
|
|
2953
2952
|
const n = e.url + t.path;
|
|
2954
2953
|
_t(a, e.url, n), console.log(`[loadLightModel] ZIP 解压开始 ${Date.now() - window.startTime}ms`);
|
|
2955
|
-
const s = await
|
|
2954
|
+
const s = await Po(n, e.key);
|
|
2956
2955
|
console.log(`[loadLightModel] ZIP 解压完成 ${Date.now() - window.startTime}ms`);
|
|
2957
|
-
const o = await
|
|
2956
|
+
const o = await Ri(s, ["/nodes.json", "nodes.json"]);
|
|
2958
2957
|
if (o == null)
|
|
2959
2958
|
return;
|
|
2960
2959
|
const r = Zt(o), l = Ke(a, e.url);
|
|
@@ -2978,7 +2977,7 @@ async function qo(a, e, t, i) {
|
|
|
2978
2977
|
}
|
|
2979
2978
|
}
|
|
2980
2979
|
const d = async (v) => {
|
|
2981
|
-
let b = await
|
|
2980
|
+
let b = await _o(s, [`/${v}.glb`, `${v}.glb`, v + ".glb"]);
|
|
2982
2981
|
if (b == null) {
|
|
2983
2982
|
console.error("[loadLightModel] glb not found in zip", {
|
|
2984
2983
|
modelUrl: e.url,
|
|
@@ -2989,10 +2988,10 @@ async function qo(a, e, t, i) {
|
|
|
2989
2988
|
return;
|
|
2990
2989
|
}
|
|
2991
2990
|
try {
|
|
2992
|
-
const p = await
|
|
2991
|
+
const p = await To(a, b);
|
|
2993
2992
|
b = null, t.glbs[v] = p.scene.children, t.glbs[v].forEach((x) => {
|
|
2994
2993
|
x.matrixWorld;
|
|
2995
|
-
}), await
|
|
2994
|
+
}), await Io(a, t.glbs[v], i);
|
|
2996
2995
|
} catch (p) {
|
|
2997
2996
|
console.error("[loadLightModel] failed to load glb", {
|
|
2998
2997
|
modelUrl: e.url,
|
|
@@ -3007,21 +3006,21 @@ async function qo(a, e, t, i) {
|
|
|
3007
3006
|
}
|
|
3008
3007
|
};
|
|
3009
3008
|
let g = 0;
|
|
3010
|
-
const m = Math.min(
|
|
3009
|
+
const m = Math.min(vo, u.length);
|
|
3011
3010
|
await Promise.all(Array.from({ length: m }, async () => {
|
|
3012
3011
|
for (; g < u.length; ) {
|
|
3013
3012
|
const v = u[g++];
|
|
3014
3013
|
await d(v);
|
|
3015
3014
|
}
|
|
3016
3015
|
})), console.log(`[loadLightModel] 所有 GLB 加载完成 ${Date.now() - window.startTime}ms`);
|
|
3017
|
-
const w = await
|
|
3016
|
+
const w = await Ri(s, ["/instances.json", "instances.json"]);
|
|
3018
3017
|
t.instanceNodes = w != null ? Zt(w) : null, t.loadSuccess = !0;
|
|
3019
3018
|
})().finally(() => {
|
|
3020
3019
|
t.preparePromise = null;
|
|
3021
3020
|
}), await t.preparePromise;
|
|
3022
3021
|
}
|
|
3023
3022
|
}
|
|
3024
|
-
function
|
|
3023
|
+
function qo(a, e, t) {
|
|
3025
3024
|
if (t.boundingBox || (t.boundingBox = new Y(), t.boundingBox.min = new h(t.octreeBox.min.X, t.octreeBox.min.Z, -t.octreeBox.min.Y), t.boundingBox.max = new h(t.octreeBox.max.X, t.octreeBox.max.Z, -t.octreeBox.max.Y)), !t.maxSize)
|
|
3026
3025
|
return 1e3;
|
|
3027
3026
|
const i = t.boundingBox, n = i.min, s = i.max, o = n.clone().add(s.clone()).multiplyScalar(0.5), r = n.distanceTo(s), l = new h(), c = new h(), u = new h(), d = new h();
|
|
@@ -3037,26 +3036,26 @@ function jo(a, e, t) {
|
|
|
3037
3036
|
const m = d.clone().add(u.multiplyScalar(Math.max(g, r))), w = m.clone().add(l.setLength(t.maxSize)), v = new oe(e, a.renderer, a.scene).worldToScreen(m), b = new oe(e, a.renderer, a.scene).worldToScreen(w);
|
|
3038
3037
|
return v.distanceTo(b);
|
|
3039
3038
|
}
|
|
3040
|
-
async function
|
|
3041
|
-
t.maxSize < 1e6 && t.path != "/lod0" && (!(
|
|
3039
|
+
async function jo(a, e, t, i) {
|
|
3040
|
+
t.maxSize < 1e6 && t.path != "/lod0" && (!(qo(a, a.camera, t) >= Mo) || t.status === !0) || (await Wo(a, e, t, i), t.loadSuccess === !0 && await Go(a, e, t, i));
|
|
3042
3041
|
}
|
|
3043
|
-
function
|
|
3042
|
+
function Ko(a, e, t) {
|
|
3044
3043
|
if (zn(e.loadStatus.modelMep))
|
|
3045
3044
|
return;
|
|
3046
3045
|
const i = Ke(a, e.url);
|
|
3047
3046
|
if (i == null)
|
|
3048
3047
|
return;
|
|
3049
3048
|
e.loadStatus.modelMep = "loading", i.modelMep == null && (i.modelMep = {}), (async () => {
|
|
3050
|
-
t || await Tn(),
|
|
3049
|
+
t || await Tn(), io(a, i.modelMep, e.url), e.loadStatus.modelMep = !0, kn(a);
|
|
3051
3050
|
})().catch((s) => {
|
|
3052
3051
|
e.loadStatus.modelMep = !1, console.error("[loadLightModel] failed to load mep model", s);
|
|
3053
3052
|
});
|
|
3054
3053
|
}
|
|
3055
|
-
function
|
|
3054
|
+
function Yo(a, e, t, i) {
|
|
3056
3055
|
const n = je(a, e);
|
|
3057
3056
|
a.models || (a.models = []), window.startTime = Date.now();
|
|
3058
3057
|
let s = "WDDsBNtzVz6aSh/bCFh3CmjjANEDRryoXF1XCJvJjeE=";
|
|
3059
|
-
|
|
3058
|
+
Eo(e + "/info", s).then((o) => {
|
|
3060
3059
|
const r = Zt(o), l = r?.baseInfo ?? {}, c = typeof l?.name == "string" ? l.name : "";
|
|
3061
3060
|
a.__loadingCompletedTriggered = !1, a.engineStatus.models.push({
|
|
3062
3061
|
type: "light",
|
|
@@ -3098,27 +3097,27 @@ function Xo(a, e, t, i) {
|
|
|
3098
3097
|
async function Rn(a, e, t = !1) {
|
|
3099
3098
|
const i = a.engineStatus.models.filter((n) => e == null || n.url == e);
|
|
3100
3099
|
for (const n of i)
|
|
3101
|
-
if (Ln(n), !(n.status !== "loading" || n.type !== "light") && (
|
|
3100
|
+
if (Ln(n), !(n.status !== "loading" || n.type !== "light") && (Ko(a, n, t), !zn(n.loadStatus.normal))) {
|
|
3102
3101
|
n.loadStatus.normal = "loading";
|
|
3103
3102
|
try {
|
|
3104
|
-
await
|
|
3103
|
+
await Xo(a, n, t);
|
|
3105
3104
|
} finally {
|
|
3106
3105
|
const s = In(a, n.url), o = s.length > 0 && s.every((r) => r.status === !0);
|
|
3107
3106
|
n.loadStatus.normal = o, o && (n.status = "loaded"), kn(a);
|
|
3108
3107
|
}
|
|
3109
3108
|
}
|
|
3110
3109
|
}
|
|
3111
|
-
async function
|
|
3110
|
+
async function Xo(a, e, t = !1) {
|
|
3112
3111
|
console.log(`[loadLightModel] start loadNode ${Date.now() - window.startTime}ms`);
|
|
3113
3112
|
const i = In(a, e.url);
|
|
3114
3113
|
if (i.length !== 0)
|
|
3115
3114
|
for (const n of i)
|
|
3116
|
-
await
|
|
3115
|
+
await jo(a, e, n, t);
|
|
3117
3116
|
}
|
|
3118
|
-
function
|
|
3119
|
-
return
|
|
3117
|
+
function $o(a, e) {
|
|
3118
|
+
return Bo(a), a.map != null && (a.map.colorSpace = Dt, a.map.needsUpdate = !0), a.side = ge, a.shadowSide = ge, a.clipShadows = !0, e?.sectionPlane && (a.clippingPlanes = e.sectionPlane), a;
|
|
3120
3119
|
}
|
|
3121
|
-
const
|
|
3120
|
+
const Zo = "/__local_model__", Jo = /^(info|property|edge|lod\d+)(?:\.zip)?$/i, Qo = /^(info|property|edge|lod\d+)(?:~)?$/i;
|
|
3122
3121
|
class Ce {
|
|
3123
3122
|
static localRequestMap = /* @__PURE__ */ new Map();
|
|
3124
3123
|
static localObjectUrls = /* @__PURE__ */ new Set();
|
|
@@ -3133,7 +3132,7 @@ class Ce {
|
|
|
3133
3132
|
async loadModels(e, t) {
|
|
3134
3133
|
console.log("待加载模型", e);
|
|
3135
3134
|
for (const n of e)
|
|
3136
|
-
i(n) === "light" &&
|
|
3135
|
+
i(n) === "light" && Yo(this.engine, n, t, e.length);
|
|
3137
3136
|
function i(n) {
|
|
3138
3137
|
const s = n.split(".").pop();
|
|
3139
3138
|
return s === "glb" || s === "gltf" ? "gltf" : "light";
|
|
@@ -3170,13 +3169,13 @@ class Ce {
|
|
|
3170
3169
|
for (const l of t) {
|
|
3171
3170
|
const c = this.parseDirectPackageEntry(l.path);
|
|
3172
3171
|
if (c != null) {
|
|
3173
|
-
|
|
3172
|
+
Ni(i, c.modelKey).set(c.packageName, l.blob);
|
|
3174
3173
|
continue;
|
|
3175
3174
|
}
|
|
3176
3175
|
const u = this.parseExtractedPackageEntry(l.path);
|
|
3177
3176
|
if (u == null)
|
|
3178
3177
|
continue;
|
|
3179
|
-
const d =
|
|
3178
|
+
const d = Ni(n, u.modelKey), g = d.get(u.packageName) ?? [];
|
|
3180
3179
|
g.push({
|
|
3181
3180
|
path: u.innerPath,
|
|
3182
3181
|
blob: l.blob
|
|
@@ -3200,7 +3199,7 @@ class Ce {
|
|
|
3200
3199
|
blob: await this.packEntriesAsZip(m)
|
|
3201
3200
|
});
|
|
3202
3201
|
c.some((g) => g.packageName === "info") && (r += 1, o.push({
|
|
3203
|
-
rootUrl: `${
|
|
3202
|
+
rootUrl: `${Zo}/${Ce.createLocalModelId(l, r)}`,
|
|
3204
3203
|
packages: c
|
|
3205
3204
|
}));
|
|
3206
3205
|
}
|
|
@@ -3214,15 +3213,15 @@ class Ce {
|
|
|
3214
3213
|
const t = [];
|
|
3215
3214
|
for (const i of e) {
|
|
3216
3215
|
const n = Pe(i.webkitRelativePath || i.name), s = Ot(n);
|
|
3217
|
-
if (
|
|
3216
|
+
if (Oi(s)) {
|
|
3218
3217
|
t.push({ path: n, blob: i });
|
|
3219
3218
|
continue;
|
|
3220
3219
|
}
|
|
3221
|
-
if (await
|
|
3220
|
+
if (await nr(i)) {
|
|
3222
3221
|
const o = await Yt.loadAsync(i), r = Nt(n), l = Object.values(o.files);
|
|
3223
3222
|
for (const c of l)
|
|
3224
3223
|
c.dir || t.push({
|
|
3225
|
-
path:
|
|
3224
|
+
path: er(r, Pe(c.name)),
|
|
3226
3225
|
blob: await c.async("blob")
|
|
3227
3226
|
});
|
|
3228
3227
|
continue;
|
|
@@ -3236,9 +3235,9 @@ class Ce {
|
|
|
3236
3235
|
*/
|
|
3237
3236
|
parseDirectPackageEntry(e) {
|
|
3238
3237
|
const t = Nt(e), i = Ot(e);
|
|
3239
|
-
return
|
|
3238
|
+
return Oi(i) ? {
|
|
3240
3239
|
modelKey: t,
|
|
3241
|
-
packageName:
|
|
3240
|
+
packageName: tr(i)
|
|
3242
3241
|
} : null;
|
|
3243
3242
|
}
|
|
3244
3243
|
/**
|
|
@@ -3247,7 +3246,7 @@ class Ce {
|
|
|
3247
3246
|
parseExtractedPackageEntry(e) {
|
|
3248
3247
|
const t = Pe(e).split("/").filter(Boolean);
|
|
3249
3248
|
for (let n = 0; n < t.length; n++) {
|
|
3250
|
-
const s =
|
|
3249
|
+
const s = ir(t[n]);
|
|
3251
3250
|
if (s == null)
|
|
3252
3251
|
continue;
|
|
3253
3252
|
const o = t.slice(n + 1);
|
|
@@ -3322,29 +3321,29 @@ function Nt(a) {
|
|
|
3322
3321
|
const e = Pe(a), t = e.lastIndexOf("/");
|
|
3323
3322
|
return t >= 0 ? e.slice(0, t) : "";
|
|
3324
3323
|
}
|
|
3325
|
-
function
|
|
3324
|
+
function er(a, e) {
|
|
3326
3325
|
return Pe(a ? e ? `${a}/${e}` : a : e);
|
|
3327
3326
|
}
|
|
3328
|
-
function
|
|
3329
|
-
return
|
|
3327
|
+
function Oi(a) {
|
|
3328
|
+
return Jo.test(a);
|
|
3330
3329
|
}
|
|
3331
|
-
function
|
|
3330
|
+
function tr(a) {
|
|
3332
3331
|
return a.replace(/\.zip$/i, "").toLowerCase();
|
|
3333
3332
|
}
|
|
3334
|
-
function
|
|
3335
|
-
const e =
|
|
3333
|
+
function ir(a) {
|
|
3334
|
+
const e = Qo.exec(a);
|
|
3336
3335
|
return e == null ? null : e[1].toLowerCase();
|
|
3337
3336
|
}
|
|
3338
|
-
async function
|
|
3337
|
+
async function nr(a) {
|
|
3339
3338
|
const e = await a.slice(0, 4).arrayBuffer(), t = new Uint8Array(e);
|
|
3340
3339
|
return t.length >= 4 && t[0] === 80 && t[1] === 75 && t[2] === 3 && t[3] === 4;
|
|
3341
3340
|
}
|
|
3342
|
-
function
|
|
3341
|
+
function Ni(a, e) {
|
|
3343
3342
|
let t = a.get(e);
|
|
3344
3343
|
return t == null && (t = /* @__PURE__ */ new Map(), a.set(e, t)), t;
|
|
3345
3344
|
}
|
|
3346
3345
|
var Se = /* @__PURE__ */ ((a) => (a.ModelLoadStart = "model-load-start", a.ModelLoadProgress = "model-load-progress", a.ModelLoaded = "model-loaded", a.ModelError = "model-error", a.SelectionChanged = "selection-changed", a.HoverChanged = "hover-changed", a.Click = "click", a.MouseMove = "mouse-move", a.CameraChanged = "camera-changed", a.CameraIdle = "camera-idle", a.ViewportResize = "viewport-resize", a.EngineFree = "engine-free", a.EngineBusy = "engine-busy", a.MeasureChanged = "measure-changed", a.SectionMove = "section-move", a.LoadingCompleted = "loading_completed", a))(Se || {});
|
|
3347
|
-
class
|
|
3346
|
+
class sr {
|
|
3348
3347
|
engine;
|
|
3349
3348
|
isFree;
|
|
3350
3349
|
// 是否是编辑模式
|
|
@@ -3385,7 +3384,7 @@ class or {
|
|
|
3385
3384
|
closeAllFunction = () => {
|
|
3386
3385
|
};
|
|
3387
3386
|
}
|
|
3388
|
-
class
|
|
3387
|
+
class or {
|
|
3389
3388
|
// 使用字符串作为键,以确保不同来源的 EventType 枚举值能够正确匹配
|
|
3390
3389
|
listeners = /* @__PURE__ */ new Map();
|
|
3391
3390
|
// 是否启用调试模式(可以通过外部设置)
|
|
@@ -3441,8 +3440,8 @@ class rr {
|
|
|
3441
3440
|
});
|
|
3442
3441
|
}
|
|
3443
3442
|
}
|
|
3444
|
-
const et = 1, Ht = 20,
|
|
3445
|
-
class
|
|
3443
|
+
const et = 1, Ht = 20, rr = 1800, Hi = 1024, ar = 1.35, lr = 3, cr = 1200, Vt = 0.5, hr = 10, ur = 0.08, Ut = 500, Vi = 5e4, Ui = 120, dr = 5e4, Gi = 0.12, pr = 8, mr = 0.75, Wi = 5e-5, gr = 15e-4, fr = 2.5, yr = 2.4, vr = 4.5, Mr = 0.94, wr = 0.995, xr = 80, br = 0.06, Cr = 8, Sr = new h(-1, 4, 2).normalize();
|
|
3444
|
+
class Er {
|
|
3446
3445
|
// 引擎实例,要求至少提供 scene、controls、octreeBox 等运行时对象。
|
|
3447
3446
|
engine;
|
|
3448
3447
|
// 上一次应用到阴影相机的半边长,用于跳过无意义的小幅更新。
|
|
@@ -3473,7 +3472,7 @@ class Pr {
|
|
|
3473
3472
|
*/
|
|
3474
3473
|
init() {
|
|
3475
3474
|
const e = new Le(16774630, 5);
|
|
3476
|
-
e.name = "directionalShadowLight", e.castShadow = !0, e.shadow.mapSize.width =
|
|
3475
|
+
e.name = "directionalShadowLight", e.castShadow = !0, e.shadow.mapSize.width = Hi, e.shadow.mapSize.height = Hi, e.shadow.camera.near = Vt, e.shadow.camera.far = Ut, e.shadow.bias = -Wi, e.shadow.normalBias = Gi;
|
|
3477
3476
|
const t = Ht;
|
|
3478
3477
|
e.shadow.camera.left = -t, e.shadow.camera.right = t, e.shadow.camera.top = t, e.shadow.camera.bottom = -t, e.shadow.radius = 2, e.shadow.intensity = et, e.target.name = "directionalShadowLightTarget";
|
|
3479
3478
|
const i = new Le(16777215, 0.5);
|
|
@@ -3505,16 +3504,16 @@ class Pr {
|
|
|
3505
3504
|
}
|
|
3506
3505
|
const l = this.resolveShadowTarget(e, r), c = this.getCameraHalfExtent(e, l), u = this.getSceneShadowHalfSize(s, c), d = R.clamp(
|
|
3507
3506
|
Math.max(
|
|
3508
|
-
c *
|
|
3507
|
+
c * ar,
|
|
3509
3508
|
u,
|
|
3510
3509
|
Ht
|
|
3511
3510
|
),
|
|
3512
3511
|
Ht,
|
|
3513
|
-
|
|
3512
|
+
rr
|
|
3514
3513
|
), g = R.clamp(
|
|
3515
|
-
Math.max(d * 2.5, o * 0.75,
|
|
3516
|
-
|
|
3517
|
-
|
|
3514
|
+
Math.max(d * 2.5, o * 0.75, Ui),
|
|
3515
|
+
Ui,
|
|
3516
|
+
dr
|
|
3518
3517
|
), m = this.getLightOffsetDirection(), w = this.snapShadowTargetToTexel(
|
|
3519
3518
|
l,
|
|
3520
3519
|
m,
|
|
@@ -3547,7 +3546,7 @@ class Pr {
|
|
|
3547
3546
|
return 0;
|
|
3548
3547
|
if (t <= 0)
|
|
3549
3548
|
return e * 0.75;
|
|
3550
|
-
const i = t *
|
|
3549
|
+
const i = t * lr;
|
|
3551
3550
|
return Math.min(e * 0.75, i);
|
|
3552
3551
|
}
|
|
3553
3552
|
/**
|
|
@@ -3559,15 +3558,15 @@ class Pr {
|
|
|
3559
3558
|
updateShadowBias(e, t, i) {
|
|
3560
3559
|
const n = Math.max(e.shadow.mapSize.width, 1), s = t * 2 / n, o = Math.max(i.far - i.near, 1);
|
|
3561
3560
|
e.shadow.normalBias = R.clamp(
|
|
3562
|
-
s *
|
|
3563
|
-
|
|
3564
|
-
|
|
3561
|
+
s * mr,
|
|
3562
|
+
Gi,
|
|
3563
|
+
pr
|
|
3565
3564
|
);
|
|
3566
|
-
const r = s / o *
|
|
3565
|
+
const r = s / o * fr;
|
|
3567
3566
|
e.shadow.bias = -R.clamp(
|
|
3568
3567
|
r,
|
|
3569
|
-
|
|
3570
|
-
|
|
3568
|
+
Wi,
|
|
3569
|
+
gr
|
|
3571
3570
|
);
|
|
3572
3571
|
}
|
|
3573
3572
|
/**
|
|
@@ -3590,12 +3589,12 @@ class Pr {
|
|
|
3590
3589
|
}
|
|
3591
3590
|
if (Number.isFinite(c) && Number.isFinite(u)) {
|
|
3592
3591
|
const d = Math.max(
|
|
3593
|
-
(u - c) *
|
|
3594
|
-
|
|
3592
|
+
(u - c) * ur,
|
|
3593
|
+
hr
|
|
3595
3594
|
), g = Math.max(Vt, c - d), m = R.clamp(
|
|
3596
3595
|
Math.max(g + 1, u + d),
|
|
3597
3596
|
g + 1,
|
|
3598
|
-
|
|
3597
|
+
Vi
|
|
3599
3598
|
);
|
|
3600
3599
|
return { near: g, far: m };
|
|
3601
3600
|
}
|
|
@@ -3603,7 +3602,7 @@ class Pr {
|
|
|
3603
3602
|
const r = R.clamp(
|
|
3604
3603
|
Math.max(n * 1.5, s * 4, Ut),
|
|
3605
3604
|
Ut,
|
|
3606
|
-
|
|
3605
|
+
Vi
|
|
3607
3606
|
);
|
|
3608
3607
|
return { near: Vt, far: r };
|
|
3609
3608
|
}
|
|
@@ -3707,7 +3706,7 @@ class Pr {
|
|
|
3707
3706
|
}
|
|
3708
3707
|
if (e instanceof it) {
|
|
3709
3708
|
const i = this.resolveShadowTarget(e, t), n = Math.max(e.position.distanceTo(i), 1), s = R.degToRad(e.getEffectiveFOV() * 0.5), o = Math.max(Math.tan(s) * n, 1), r = o * Math.max(e.aspect, 1e-6);
|
|
3710
|
-
return Math.min(Math.max(r, o),
|
|
3709
|
+
return Math.min(Math.max(r, o), cr);
|
|
3711
3710
|
}
|
|
3712
3711
|
return 0;
|
|
3713
3712
|
}
|
|
@@ -3734,7 +3733,7 @@ class Pr {
|
|
|
3734
3733
|
* @returns 标准化后的世界空间光源偏移方向。
|
|
3735
3734
|
*/
|
|
3736
3735
|
getLightOffsetDirection() {
|
|
3737
|
-
return
|
|
3736
|
+
return Sr.clone();
|
|
3738
3737
|
}
|
|
3739
3738
|
/**
|
|
3740
3739
|
* 根据当前视角和阴影贴图密度计算最终显示强度。
|
|
@@ -3747,8 +3746,8 @@ class Pr {
|
|
|
3747
3746
|
getShadowDisplayIntensity(e, t, i, n) {
|
|
3748
3747
|
const s = i * 2 / Math.max(n, 1), o = 1 - R.smoothstep(
|
|
3749
3748
|
s,
|
|
3750
|
-
|
|
3751
|
-
|
|
3749
|
+
yr,
|
|
3750
|
+
vr
|
|
3752
3751
|
);
|
|
3753
3752
|
let r = 1;
|
|
3754
3753
|
if (e) {
|
|
@@ -3757,8 +3756,8 @@ class Pr {
|
|
|
3757
3756
|
const c = Math.abs(l.dot(t.clone().normalize()));
|
|
3758
3757
|
r = 1 - R.smoothstep(
|
|
3759
3758
|
c,
|
|
3760
|
-
|
|
3761
|
-
|
|
3759
|
+
Mr,
|
|
3760
|
+
wr
|
|
3762
3761
|
);
|
|
3763
3762
|
}
|
|
3764
3763
|
return et * Math.min(o, r);
|
|
@@ -3803,10 +3802,10 @@ class Pr {
|
|
|
3803
3802
|
if (i.isEmpty())
|
|
3804
3803
|
return;
|
|
3805
3804
|
const n = i.getSize(new h()), s = Math.max(n.x, n.z), o = Math.max(
|
|
3806
|
-
|
|
3807
|
-
s *
|
|
3805
|
+
Cr,
|
|
3806
|
+
s * br
|
|
3808
3807
|
);
|
|
3809
|
-
if (s >=
|
|
3808
|
+
if (s >= xr && n.y <= o) {
|
|
3810
3809
|
e.castShadow = !1, t.__lightModuleReceiverOnlyShadow = !0;
|
|
3811
3810
|
return;
|
|
3812
3811
|
}
|
|
@@ -3822,7 +3821,7 @@ class Pr {
|
|
|
3822
3821
|
i && (i.shadowSide = un);
|
|
3823
3822
|
}
|
|
3824
3823
|
}
|
|
3825
|
-
class
|
|
3824
|
+
class Pr {
|
|
3826
3825
|
engine;
|
|
3827
3826
|
behavior;
|
|
3828
3827
|
isCtrlDown = !1;
|
|
@@ -3835,7 +3834,7 @@ class Ar {
|
|
|
3835
3834
|
selectionEnd = new W();
|
|
3836
3835
|
suppressClickOnce = !1;
|
|
3837
3836
|
selectionThreshold = 5;
|
|
3838
|
-
tempInstanceMatrix = new
|
|
3837
|
+
tempInstanceMatrix = new U();
|
|
3839
3838
|
tempScale = new h();
|
|
3840
3839
|
constructor(e) {
|
|
3841
3840
|
this.engine = e;
|
|
@@ -4221,7 +4220,7 @@ class Ar {
|
|
|
4221
4220
|
return It(this.engine, e);
|
|
4222
4221
|
}
|
|
4223
4222
|
}
|
|
4224
|
-
class
|
|
4223
|
+
class Ar {
|
|
4225
4224
|
engine;
|
|
4226
4225
|
highlightMaterial;
|
|
4227
4226
|
translucentMaterial;
|
|
@@ -4304,7 +4303,7 @@ class _r {
|
|
|
4304
4303
|
restoreSplitModelsOnIdle() {
|
|
4305
4304
|
if (!this.engine?.scene)
|
|
4306
4305
|
return;
|
|
4307
|
-
|
|
4306
|
+
hi(this.engine, (t) => t instanceof O && !(t instanceof X)).forEach((t) => {
|
|
4308
4307
|
t instanceof O && (t.isSplit === !0 && (t.visible = !this.areAllGroupsHidden(t)), t.isSplit === !0 && this.un_split_merge_model(t));
|
|
4309
4308
|
});
|
|
4310
4309
|
}
|
|
@@ -4379,7 +4378,7 @@ class _r {
|
|
|
4379
4378
|
const c = this.getSceneModel(l[0]);
|
|
4380
4379
|
c instanceof X ? n.has(l[0]) ? n.get(l[0])?.push(l[1]) : n.set(l[0], [l[1]]) : (this.split_merge_model(c), c.geometry.groups[l[1]].materialIndex = 1);
|
|
4381
4380
|
});
|
|
4382
|
-
}),
|
|
4381
|
+
}), _r(n, this.engine);
|
|
4383
4382
|
let s = this.engine.engineStatus.highlightModels.find((o) => o.url == t.url);
|
|
4384
4383
|
s != null ? s.ids.push(...t.ids) : this.engine.engineStatus.highlightModels.push(t);
|
|
4385
4384
|
}), this.updateMaterial(), this.syncHighlightModelEdges();
|
|
@@ -4397,7 +4396,7 @@ class _r {
|
|
|
4397
4396
|
const l = this.getSceneModel(r[0]);
|
|
4398
4397
|
l instanceof X ? n.has(r[0]) ? n.get(r[0])?.push(r[1]) : n.set(r[0], [r[1]]) : l.geometry.groups.length != 0 && (l.geometry.groups[r[1]].materialIndex = this.getCustomSimpleMaterialIndex(r[0], r[1]) ?? 0);
|
|
4399
4398
|
});
|
|
4400
|
-
}),
|
|
4399
|
+
}), qi(n, this.engine, "highlightModel");
|
|
4401
4400
|
}), this.updateMaterial(), this.syncHighlightModelEdges(this.getHighlightModelsAfterRemove(e));
|
|
4402
4401
|
}
|
|
4403
4402
|
// 取消所有模型高亮
|
|
@@ -4421,7 +4420,7 @@ class _r {
|
|
|
4421
4420
|
const c = this.getSceneModel(l[0]);
|
|
4422
4421
|
c instanceof X ? n.has(l[0]) ? n.get(l[0])?.push(l[1]) : n.set(l[0], [l[1]]) : (this.split_merge_model(c), c.geometry.groups[l[1]].materialIndex = -1, c.geometry.groups[l[1]].visible = !1);
|
|
4423
4422
|
});
|
|
4424
|
-
}), n.size > 0 &&
|
|
4423
|
+
}), n.size > 0 && Dr(n, this.engine);
|
|
4425
4424
|
let s = this.engine.engineStatus.hideModels.find((o) => o.url == t.url);
|
|
4426
4425
|
s != null ? this.appendUniqueIds(s.ids, t.ids) : this.engine.engineStatus.hideModels.push({
|
|
4427
4426
|
url: t.url,
|
|
@@ -4442,7 +4441,7 @@ class _r {
|
|
|
4442
4441
|
const u = this.getSceneModel(c[0]);
|
|
4443
4442
|
u instanceof X ? s.has(c[0]) ? s.get(c[0])?.push(c[1]) : s.set(c[0], [c[1]]) : (u.visible = !0, u.geometry.groups[c[1]].materialIndex = this.getCustomSimpleMaterialIndex(c[0], c[1]) ?? 0, u.geometry.groups[c[1]].visible = !0);
|
|
4444
4443
|
});
|
|
4445
|
-
}), s.size > 0 &&
|
|
4444
|
+
}), s.size > 0 && ji(s, this.engine), t)
|
|
4446
4445
|
return;
|
|
4447
4446
|
let o = this.engine.engineStatus.hideModels.find((r) => r.url == i.url);
|
|
4448
4447
|
o && (i.ids.forEach((r) => {
|
|
@@ -4665,14 +4664,14 @@ class _r {
|
|
|
4665
4664
|
return e.__customColorMaterialIndexes.set(n, l), l;
|
|
4666
4665
|
}
|
|
4667
4666
|
hideOriginalInstance(e, t) {
|
|
4668
|
-
const i = new
|
|
4667
|
+
const i = new U();
|
|
4669
4668
|
i.makeScale(0, 0, 0), e.setMatrixAt(t, i), e.instanceMatrix.needsUpdate = !0;
|
|
4670
4669
|
}
|
|
4671
4670
|
getOriginalInstanceMatrix(e, t) {
|
|
4672
4671
|
const i = e.matrixs?.[t] ?? e.matrixsClone?.[t];
|
|
4673
|
-
if (i instanceof
|
|
4672
|
+
if (i instanceof U)
|
|
4674
4673
|
return i.clone();
|
|
4675
|
-
const n = new
|
|
4674
|
+
const n = new U();
|
|
4676
4675
|
return e.getMatrixAt(t, n), n;
|
|
4677
4676
|
}
|
|
4678
4677
|
isModelHighlighted(e, t) {
|
|
@@ -4733,7 +4732,7 @@ class _r {
|
|
|
4733
4732
|
const c = this.getSceneModel(l[0]);
|
|
4734
4733
|
c instanceof X ? n.has(l[0]) ? n.get(l[0])?.push(l[1]) : n.set(l[0], [l[1]]) : (this.split_merge_model(c), c.geometry.groups[l[1]].materialIndex = 2);
|
|
4735
4734
|
});
|
|
4736
|
-
}),
|
|
4735
|
+
}), Tr(n, this.engine);
|
|
4737
4736
|
let s = this.engine.engineStatus.translucentModels.find((o) => o.url == t.url);
|
|
4738
4737
|
s != null ? s.ids.push(...t.ids) : this.engine.engineStatus.translucentModels.push({
|
|
4739
4738
|
url: t.url,
|
|
@@ -4754,7 +4753,7 @@ class _r {
|
|
|
4754
4753
|
const l = this.getSceneModel(r[0]);
|
|
4755
4754
|
l instanceof X ? n.has(r[0]) ? n.get(r[0])?.push(r[1]) : n.set(r[0], [r[1]]) : (this.split_merge_model(l), l.geometry.groups[r[1]].materialIndex = this.getCustomSimpleMaterialIndex(r[0], r[1]) ?? 0);
|
|
4756
4755
|
});
|
|
4757
|
-
}), n.size > 0 &&
|
|
4756
|
+
}), n.size > 0 && ji(n, this.engine), qi(n, this.engine, "translucentModel");
|
|
4758
4757
|
}), this.engine.engineStatus.translucentModels = [];
|
|
4759
4758
|
}
|
|
4760
4759
|
// ***************************************************** 设置模型半透明 ***************************************************** //
|
|
@@ -4802,7 +4801,7 @@ class _r {
|
|
|
4802
4801
|
}
|
|
4803
4802
|
// ***************************************************** 设置模型颜色 ***************************************************** //
|
|
4804
4803
|
}
|
|
4805
|
-
function
|
|
4804
|
+
function _r(a, e) {
|
|
4806
4805
|
a.forEach((t, i) => {
|
|
4807
4806
|
const n = ct(e, i);
|
|
4808
4807
|
if (!(n instanceof X))
|
|
@@ -4826,16 +4825,16 @@ function Tr(a, e) {
|
|
|
4826
4825
|
r.name = "highlightModel", r.key = i, r.ids = [], r.matrixs = [], r.url = n.url, t.forEach((d) => {
|
|
4827
4826
|
r.ids.push(n.ids[d]), r.matrixs.push(n.matrixs[d]);
|
|
4828
4827
|
});
|
|
4829
|
-
const l = /* @__PURE__ */ new Map(), c = new
|
|
4828
|
+
const l = /* @__PURE__ */ new Map(), c = new U(), u = new U();
|
|
4830
4829
|
u.makeScale(0, 0, 0), t.forEach((d, g) => {
|
|
4831
4830
|
const m = at(e, i, d);
|
|
4832
4831
|
lt(m, !1);
|
|
4833
4832
|
const w = m?.matrix ?? n.matrixs?.[d] ?? n.matrixsClone?.[d];
|
|
4834
|
-
w instanceof
|
|
4833
|
+
w instanceof U ? c.copy(w) : n.getMatrixAt(d, c), l.set(d, c.clone()), n.setMatrixAt(d, u), r.setMatrixAt(g, c);
|
|
4835
4834
|
}), n.instanceMatrix.needsUpdate = !0, r.instanceMatrix.needsUpdate = !0, (n.parent ?? e.scene).add(r);
|
|
4836
4835
|
});
|
|
4837
4836
|
}
|
|
4838
|
-
function
|
|
4837
|
+
function qi(a, e, t) {
|
|
4839
4838
|
a.forEach((i, n) => {
|
|
4840
4839
|
const s = ct(e, n);
|
|
4841
4840
|
if (!(s instanceof X))
|
|
@@ -4843,7 +4842,7 @@ function ji(a, e, t) {
|
|
|
4843
4842
|
i.forEach((r) => {
|
|
4844
4843
|
const l = at(e, n, r);
|
|
4845
4844
|
if (l != null) {
|
|
4846
|
-
s.setMatrixAt(r, new
|
|
4845
|
+
s.setMatrixAt(r, new U().makeScale(0, 0, 0)), lt(l, !0);
|
|
4847
4846
|
return;
|
|
4848
4847
|
}
|
|
4849
4848
|
const c = s.matrixsClone[r];
|
|
@@ -4857,7 +4856,7 @@ function ji(a, e, t) {
|
|
|
4857
4856
|
});
|
|
4858
4857
|
});
|
|
4859
4858
|
}
|
|
4860
|
-
function
|
|
4859
|
+
function Tr(a, e) {
|
|
4861
4860
|
a.forEach((t, i) => {
|
|
4862
4861
|
const n = ct(e, i);
|
|
4863
4862
|
if (!(n instanceof X))
|
|
@@ -4875,16 +4874,16 @@ function Dr(a, e) {
|
|
|
4875
4874
|
o.clippingPlanes = e.sectionPlane;
|
|
4876
4875
|
const r = new X(s, o, t.length);
|
|
4877
4876
|
r.name = "translucentModel", r.key = i;
|
|
4878
|
-
const l = /* @__PURE__ */ new Map(), c = new
|
|
4877
|
+
const l = /* @__PURE__ */ new Map(), c = new U(), u = new U();
|
|
4879
4878
|
u.makeScale(0, 0, 0), t.forEach((d, g) => {
|
|
4880
4879
|
const m = at(e, i, d);
|
|
4881
4880
|
lt(m, !1);
|
|
4882
4881
|
const w = m?.matrix ?? n.matrixs?.[d] ?? n.matrixsClone?.[d];
|
|
4883
|
-
w instanceof
|
|
4882
|
+
w instanceof U ? c.copy(w) : n.getMatrixAt(d, c), l.set(d, c.clone()), n.setMatrixAt(d, u), r.setMatrixAt(g, c);
|
|
4884
4883
|
}), n.instanceMatrix.needsUpdate = !0, r.instanceMatrix.needsUpdate = !0, (n.parent ?? e.scene).add(r);
|
|
4885
4884
|
});
|
|
4886
4885
|
}
|
|
4887
|
-
function
|
|
4886
|
+
function Dr(a, e) {
|
|
4888
4887
|
const t = [];
|
|
4889
4888
|
e.scene.traverse((i) => {
|
|
4890
4889
|
i.name == "highlightModel" && t.push(i);
|
|
@@ -4894,22 +4893,22 @@ function Ir(a, e) {
|
|
|
4894
4893
|
const s = ct(e, n);
|
|
4895
4894
|
if (!(s instanceof X))
|
|
4896
4895
|
return;
|
|
4897
|
-
const o = /* @__PURE__ */ new Map(), r = new
|
|
4896
|
+
const o = /* @__PURE__ */ new Map(), r = new U(), l = new U();
|
|
4898
4897
|
l.makeScale(0, 0, 0), i.forEach((c) => {
|
|
4899
4898
|
const u = at(e, n, c);
|
|
4900
4899
|
lt(u, !1);
|
|
4901
4900
|
const d = u?.matrix ?? s.matrixs?.[c] ?? s.matrixsClone?.[c];
|
|
4902
|
-
d instanceof
|
|
4901
|
+
d instanceof U ? r.copy(d) : s.getMatrixAt(c, r), o.set(c, r.clone()), s.setMatrixAt(c, l);
|
|
4903
4902
|
}), s.instanceMatrix.needsUpdate = !0;
|
|
4904
4903
|
});
|
|
4905
4904
|
}
|
|
4906
|
-
function
|
|
4905
|
+
function ji(a, e) {
|
|
4907
4906
|
a.forEach((t, i) => {
|
|
4908
4907
|
const n = ct(e, i);
|
|
4909
4908
|
n instanceof X && (t.forEach((s) => {
|
|
4910
4909
|
const o = at(e, i, s);
|
|
4911
4910
|
if (o != null) {
|
|
4912
|
-
n.setMatrixAt(s, new
|
|
4911
|
+
n.setMatrixAt(s, new U().makeScale(0, 0, 0)), lt(o, !0);
|
|
4913
4912
|
return;
|
|
4914
4913
|
}
|
|
4915
4914
|
const r = n.matrixs[s];
|
|
@@ -4934,7 +4933,7 @@ function ct(a, e) {
|
|
|
4934
4933
|
return It(a, e);
|
|
4935
4934
|
}
|
|
4936
4935
|
const On = "advanced";
|
|
4937
|
-
class
|
|
4936
|
+
class Ir {
|
|
4938
4937
|
engine;
|
|
4939
4938
|
currentMode = "";
|
|
4940
4939
|
// 是否为手动设置(手动设置时,自动适配不再生效)
|
|
@@ -5219,18 +5218,18 @@ class Tt {
|
|
|
5219
5218
|
this.removeOverlayMeshes(), this.overlayMaterial.dispose(), this.tagDiv?.remove?.(), this.tagDiv = null, this.animState = "idle";
|
|
5220
5219
|
}
|
|
5221
5220
|
}
|
|
5222
|
-
function
|
|
5221
|
+
function Lr() {
|
|
5223
5222
|
return new ni();
|
|
5224
5223
|
}
|
|
5225
|
-
function
|
|
5224
|
+
function kr(a, e) {
|
|
5226
5225
|
a.appendChild(e.domElement);
|
|
5227
5226
|
}
|
|
5228
|
-
function
|
|
5227
|
+
function zr(a, e, t) {
|
|
5229
5228
|
var i = new Object();
|
|
5230
5229
|
i.visible = !0;
|
|
5231
5230
|
let n = null, s = 0, o, r, l = [];
|
|
5232
5231
|
i.init = function() {
|
|
5233
|
-
o || (C(), _(),
|
|
5232
|
+
o || (C(), _(), H());
|
|
5234
5233
|
}, i.Hide = function() {
|
|
5235
5234
|
o.style.display = "none", i.visible = !1;
|
|
5236
5235
|
}, i.Show = function() {
|
|
@@ -5361,10 +5360,10 @@ function Br(a, e, t) {
|
|
|
5361
5360
|
}
|
|
5362
5361
|
var M = (fe - Q) / 2, A = (Ee - J) / 2, z = (e.camera.right - e.camera.left) / 2, N = (e.camera.top - e.camera.bottom) / 2;
|
|
5363
5362
|
L = Math.min(z / M, N / A) * 0.75;
|
|
5364
|
-
var
|
|
5365
|
-
x1:
|
|
5366
|
-
y1:
|
|
5367
|
-
z1:
|
|
5363
|
+
var V = e.camera.position.clone(), ae = a.controls.target.clone(), ue = e.camera.zoom, de = new $e.Tween({
|
|
5364
|
+
x1: V.x,
|
|
5365
|
+
y1: V.y,
|
|
5366
|
+
z1: V.z,
|
|
5368
5367
|
x2: ae.x,
|
|
5369
5368
|
y2: ae.y,
|
|
5370
5369
|
z2: ae.z,
|
|
@@ -5503,7 +5502,7 @@ function Br(a, e, t) {
|
|
|
5503
5502
|
}
|
|
5504
5503
|
}
|
|
5505
5504
|
function _() {
|
|
5506
|
-
i.sceneOrtho =
|
|
5505
|
+
i.sceneOrtho = Lr();
|
|
5507
5506
|
var P = t.clientWidth, T = t.clientWidth, f = P > T ? P / T : T / P, y = 300;
|
|
5508
5507
|
i.camera = new ve(
|
|
5509
5508
|
y * f / -2,
|
|
@@ -5518,7 +5517,7 @@ function Br(a, e, t) {
|
|
|
5518
5517
|
});
|
|
5519
5518
|
D.setSize(P, T), D.setClearAlpha(0), i.sceneOrtho.renderer = D;
|
|
5520
5519
|
let L = new xt(16777215, 0.8);
|
|
5521
|
-
i.sceneOrtho.add(L),
|
|
5520
|
+
i.sceneOrtho.add(L), kr(o, D), i.orbitControls = new fn(a, i.camera, o), i.orbitControls.enableZoom = !1, i.orbitControls.enablePan = !1, i.orbitControls.enableDamping = !0, i.orbitControls.dampingFactor = 0.1, i.orbitControls.rotateSpeed = 0.5, i.orbitControls.addEventListener("start", k), i.orbitControls.addEventListener("change", B), i.orbitControls.addEventListener("end", I);
|
|
5522
5521
|
}
|
|
5523
5522
|
let E = !1;
|
|
5524
5523
|
function k() {
|
|
@@ -5536,7 +5535,7 @@ function Br(a, e, t) {
|
|
|
5536
5535
|
function I() {
|
|
5537
5536
|
E = !1, i._mainTarget = null, i._mainDistance = null, u();
|
|
5538
5537
|
}
|
|
5539
|
-
function
|
|
5538
|
+
function H() {
|
|
5540
5539
|
let f = [
|
|
5541
5540
|
{
|
|
5542
5541
|
label: "右",
|
|
@@ -5798,7 +5797,7 @@ function Br(a, e, t) {
|
|
|
5798
5797
|
color: "blue",
|
|
5799
5798
|
transparent: !0,
|
|
5800
5799
|
opacity: 0.01
|
|
5801
|
-
}), T = new
|
|
5800
|
+
}), T = new U().makeTranslation(f.point.x, f.point.y, f.point.z);
|
|
5802
5801
|
let D = y.applyMatrix4(T), L = new O(D, P);
|
|
5803
5802
|
return L.name = f.name, i.sceneOrtho.add(L), L;
|
|
5804
5803
|
}
|
|
@@ -5821,7 +5820,7 @@ function Br(a, e, t) {
|
|
|
5821
5820
|
!document.fullscreenElement && !document.webkitFullscreenElement && !document.mozFullScreenElement && !document.msFullscreenElement ? (f.requestFullscreen ? f.requestFullscreen() : f.webkitRequestFullscreen ? f.webkitRequestFullscreen() : f.mozRequestFullScreen ? f.mozRequestFullScreen() : f.msRequestFullscreen && f.msRequestFullscreen(), console.log("已进入全屏模式")) : (document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.msExitFullscreen && document.msExitFullscreen(), console.log("已退出全屏模式"));
|
|
5822
5821
|
}, i;
|
|
5823
5822
|
}
|
|
5824
|
-
class
|
|
5823
|
+
class Br {
|
|
5825
5824
|
engine;
|
|
5826
5825
|
cubeTool;
|
|
5827
5826
|
mainViewPort;
|
|
@@ -5829,7 +5828,7 @@ class Rr {
|
|
|
5829
5828
|
this.engine = e;
|
|
5830
5829
|
}
|
|
5831
5830
|
init() {
|
|
5832
|
-
this.cubeTool =
|
|
5831
|
+
this.cubeTool = zr(this.engine, this.engine.scene, this.engine.container), this.cubeTool.init();
|
|
5833
5832
|
}
|
|
5834
5833
|
// 隐藏视图立方体,供 showViewCube=false 的初始化配置调用。
|
|
5835
5834
|
hide() {
|
|
@@ -5949,7 +5948,7 @@ class Rr {
|
|
|
5949
5948
|
this.cubeTool.TakeScreenshot();
|
|
5950
5949
|
}
|
|
5951
5950
|
}
|
|
5952
|
-
function
|
|
5951
|
+
function Rr(a) {
|
|
5953
5952
|
let e = new Object();
|
|
5954
5953
|
return e.getBoundingBox = function() {
|
|
5955
5954
|
let t = a.models, i = new h(1e8, 1e9, 1e10), n = new h(-1e8, -1e9, -1e10);
|
|
@@ -5983,9 +5982,9 @@ function Fr(a) {
|
|
|
5983
5982
|
});
|
|
5984
5983
|
});
|
|
5985
5984
|
const w = o.map((S) => _(S)).filter((S) => S instanceof O);
|
|
5986
|
-
|
|
5985
|
+
lo(t);
|
|
5987
5986
|
const v = t.intersectObjects(w, !1).map(B);
|
|
5988
|
-
return
|
|
5987
|
+
return co(t), v;
|
|
5989
5988
|
function b(S, f, y, P, T) {
|
|
5990
5989
|
if (f == null)
|
|
5991
5990
|
return;
|
|
@@ -6008,7 +6007,7 @@ function Fr(a) {
|
|
|
6008
6007
|
}
|
|
6009
6008
|
}
|
|
6010
6009
|
function p(S, f, y, P) {
|
|
6011
|
-
if (!a.engineStatus.isFree && i == !1 ||
|
|
6010
|
+
if (!a.engineStatus.isFree && i == !1 || H(f.url, S))
|
|
6012
6011
|
return;
|
|
6013
6012
|
const T = y.nodesMap.get(S);
|
|
6014
6013
|
if (T != null) {
|
|
@@ -6069,10 +6068,10 @@ function Fr(a) {
|
|
|
6069
6068
|
}, q;
|
|
6070
6069
|
}
|
|
6071
6070
|
function k(S, f) {
|
|
6072
|
-
const y = new
|
|
6071
|
+
const y = new U();
|
|
6073
6072
|
if (typeof S.getMatrixAt == "function")
|
|
6074
6073
|
S.getMatrixAt(f, y);
|
|
6075
|
-
else if (S.matrixs?.[f] instanceof
|
|
6074
|
+
else if (S.matrixs?.[f] instanceof U)
|
|
6076
6075
|
y.copy(S.matrixs[f]);
|
|
6077
6076
|
else
|
|
6078
6077
|
return null;
|
|
@@ -6095,7 +6094,7 @@ function Fr(a) {
|
|
|
6095
6094
|
function I(S, f) {
|
|
6096
6095
|
return S.box instanceof Y ? S.box : S.geometry == null || (S.geometry.boundingBox == null && S.geometry.computeBoundingBox(), S.geometry.boundingBox == null) ? null : (S.box = S.geometry.boundingBox.clone().applyMatrix4(f), S.box);
|
|
6097
6096
|
}
|
|
6098
|
-
function
|
|
6097
|
+
function H(S, f) {
|
|
6099
6098
|
return g.get(S)?.has(f) || m.get(S)?.has(f);
|
|
6100
6099
|
}
|
|
6101
6100
|
function $(S) {
|
|
@@ -6106,7 +6105,7 @@ function Fr(a) {
|
|
|
6106
6105
|
}
|
|
6107
6106
|
}, e;
|
|
6108
6107
|
}
|
|
6109
|
-
class
|
|
6108
|
+
class Fr {
|
|
6110
6109
|
engine;
|
|
6111
6110
|
// 绘制状态
|
|
6112
6111
|
isDrawing = !1;
|
|
@@ -6284,8 +6283,8 @@ class Or {
|
|
|
6284
6283
|
this.disActive(), this.selectionBox?.remove(), this.selectionBox = null, this.worldToScreen = null, this.isDrawing = !1;
|
|
6285
6284
|
}
|
|
6286
6285
|
}
|
|
6287
|
-
const
|
|
6288
|
-
class
|
|
6286
|
+
const Or = R.degToRad(10), Ki = 1e-3, Jt = !1, Nr = [];
|
|
6287
|
+
class Hr {
|
|
6289
6288
|
engine;
|
|
6290
6289
|
rootGroup = null;
|
|
6291
6290
|
isVisible = Jt;
|
|
@@ -6299,7 +6298,7 @@ class Vr {
|
|
|
6299
6298
|
}
|
|
6300
6299
|
setMockData() {
|
|
6301
6300
|
const e = this.engine.models?.[0]?.grids;
|
|
6302
|
-
this.setData(Array.isArray(e) && e.length > 0 ? e :
|
|
6301
|
+
this.setData(Array.isArray(e) && e.length > 0 ? e : Nr);
|
|
6303
6302
|
}
|
|
6304
6303
|
show() {
|
|
6305
6304
|
this.isVisible = !0, this.rootGroup && (this.rootGroup.visible = !0);
|
|
@@ -6438,7 +6437,7 @@ class Vr {
|
|
|
6438
6437
|
const n = this.createProjection(i);
|
|
6439
6438
|
if (!n)
|
|
6440
6439
|
return;
|
|
6441
|
-
const s = t.find((o) => o.direction.angleTo(n.direction) <=
|
|
6440
|
+
const s = t.find((o) => o.direction.angleTo(n.direction) <= Or);
|
|
6442
6441
|
if (s) {
|
|
6443
6442
|
s.axes.push(n);
|
|
6444
6443
|
return;
|
|
@@ -6468,13 +6467,13 @@ class Vr {
|
|
|
6468
6467
|
}
|
|
6469
6468
|
normalizeDirection(e) {
|
|
6470
6469
|
const t = e.clone().normalize();
|
|
6471
|
-
return (t.x < 0 || Math.abs(t.x) <=
|
|
6470
|
+
return (t.x < 0 || Math.abs(t.x) <= Ki && t.y < 0) && t.multiplyScalar(-1), t;
|
|
6472
6471
|
}
|
|
6473
6472
|
/**
|
|
6474
6473
|
* 在单个轴族内优先返回点位所属的最近轴网区间,避免落在线上时出现空描述。
|
|
6475
6474
|
*/
|
|
6476
6475
|
resolveFamilyLocation(e, t) {
|
|
6477
|
-
const i = t.dot(e.normal), n = e.axes.find((c) => Math.abs(c.offset - i) <=
|
|
6476
|
+
const i = t.dot(e.normal), n = e.axes.find((c) => Math.abs(c.offset - i) <= Ki) ?? null;
|
|
6478
6477
|
if (n) {
|
|
6479
6478
|
const c = e.axes.findIndex((d) => d.data.Id === n.data.Id), u = this.pickAxisPairAroundIndex(e.axes, c);
|
|
6480
6479
|
return {
|
|
@@ -6574,7 +6573,7 @@ class Vr {
|
|
|
6574
6573
|
}
|
|
6575
6574
|
}
|
|
6576
6575
|
const Nn = "0", Hn = 0, Vn = !1;
|
|
6577
|
-
class
|
|
6576
|
+
class gi {
|
|
6578
6577
|
engine;
|
|
6579
6578
|
currentId = Nn;
|
|
6580
6579
|
groundGroup;
|
|
@@ -6620,7 +6619,7 @@ class fi {
|
|
|
6620
6619
|
if (!i) return;
|
|
6621
6620
|
const n = t?.size ?? 3e4;
|
|
6622
6621
|
if (i.water) {
|
|
6623
|
-
const s = new Wt(n, n), o = t?.waterNormalsUrl ?? G(
|
|
6622
|
+
const s = new Wt(n, n), o = t?.waterNormalsUrl ?? G(gi.DEFAULT_WATER_NORMALS, import.meta.url), r = new st().load(o, (m) => {
|
|
6624
6623
|
m.wrapS = m.wrapT = St;
|
|
6625
6624
|
}), l = t?.sunDirection ?? new h(0.5, 0.8, 0.5).normalize(), c = t?.distortionScale ?? i.distortionScale ?? 3.7, u = t?.waterSize ?? i.size ?? 1, d = t?.opacity ?? 0.92, g = new hs(s, {
|
|
6626
6625
|
textureWidth: 512,
|
|
@@ -6637,7 +6636,7 @@ class fi {
|
|
|
6637
6636
|
} else {
|
|
6638
6637
|
const s = new Wt(n, n, 1, 1);
|
|
6639
6638
|
s.rotateX(-Math.PI / 2);
|
|
6640
|
-
const o = new
|
|
6639
|
+
const o = new ri({
|
|
6641
6640
|
color: i.color,
|
|
6642
6641
|
roughness: i.roughness,
|
|
6643
6642
|
metalness: i.metalness
|
|
@@ -6714,11 +6713,11 @@ class fi {
|
|
|
6714
6713
|
Array.isArray(e) ? e.forEach((t) => t.dispose()) : e.dispose(), this.groundGroup.remove(this.groundMesh), this.groundMesh = null, this.isWaterAddon = !1;
|
|
6715
6714
|
}
|
|
6716
6715
|
}
|
|
6717
|
-
const Te = "0",
|
|
6718
|
-
class
|
|
6716
|
+
const Te = "0", Vr = !0, Un = 0.2, Ur = 0.35;
|
|
6717
|
+
class Gr {
|
|
6719
6718
|
engine;
|
|
6720
6719
|
currentHdrId = Te;
|
|
6721
|
-
isVisible =
|
|
6720
|
+
isVisible = Vr;
|
|
6722
6721
|
currentIntensity = Un;
|
|
6723
6722
|
currentTexture = null;
|
|
6724
6723
|
currentEnvironmentTexture = null;
|
|
@@ -6818,7 +6817,7 @@ class Wr {
|
|
|
6818
6817
|
if (this.currentTexture = e, !this.engine.scene || !this.engine.renderer) return;
|
|
6819
6818
|
this._captureSceneState(), this.currentEnvironmentTexture?.dispose();
|
|
6820
6819
|
const t = new pn(this.engine.renderer), i = t.fromEquirectangular(e).texture;
|
|
6821
|
-
t.dispose(), this.currentEnvironmentTexture = i, this.engine.scene.background = null, this.engine.scene.environment = i, this.engine.scene.environmentIntensity = this.currentIntensity, this.engine.renderer.toneMapping = oi, this.engine.renderer.toneMappingExposure = this.previousToneMappingExposure > 0 ? this.previousToneMappingExposure :
|
|
6820
|
+
t.dispose(), this.currentEnvironmentTexture = i, this.engine.scene.background = null, this.engine.scene.environment = i, this.engine.scene.environmentIntensity = this.currentIntensity, this.engine.renderer.toneMapping = oi, this.engine.renderer.toneMappingExposure = this.previousToneMappingExposure > 0 ? this.previousToneMappingExposure : ai, this._removeSkybox(), this._createSkybox(e), this._setAmbientLightIntensity(this._getHdrAmbientLightIntensity());
|
|
6822
6821
|
}
|
|
6823
6822
|
_captureSceneState() {
|
|
6824
6823
|
this.currentHdrId !== Te || !this.engine.scene || (this.previousBackground = this.engine.scene.background, this.previousEnvironment = this.engine.scene.environment, this.previousBackgroundIntensity = this.engine.scene.backgroundIntensity ?? 1, this.previousEnvironmentIntensity = this.engine.scene.environmentIntensity ?? 1, this.previousAmbientLightIntensity = this._getAmbientLightIntensity(), this.previousToneMapping = this.engine.renderer?.toneMapping ?? qe, this.previousToneMappingExposure = this.engine.renderer?.toneMappingExposure ?? 1);
|
|
@@ -6859,18 +6858,18 @@ class Wr {
|
|
|
6859
6858
|
t && (t.intensity = e);
|
|
6860
6859
|
}
|
|
6861
6860
|
_getHdrAmbientLightIntensity() {
|
|
6862
|
-
return Math.max(this.previousAmbientLightIntensity *
|
|
6861
|
+
return Math.max(this.previousAmbientLightIntensity * Ur, 0);
|
|
6863
6862
|
}
|
|
6864
6863
|
_requestRender() {
|
|
6865
6864
|
this.engine?.requestComposerRender?.();
|
|
6866
6865
|
}
|
|
6867
6866
|
}
|
|
6868
|
-
const
|
|
6867
|
+
const Wr = 1e-3, Gn = !1, qr = [
|
|
6869
6868
|
{ Id: "339", Name: "L1", Elevation: -0.32808398950131235 },
|
|
6870
6869
|
{ Id: "2787", Name: "L2", Elevation: 16.896325459317584 },
|
|
6871
6870
|
{ Id: "236633", Name: "L3", Elevation: 36.745406824146976 }
|
|
6872
6871
|
];
|
|
6873
|
-
class
|
|
6872
|
+
class jr {
|
|
6874
6873
|
engine;
|
|
6875
6874
|
isVisible = Gn;
|
|
6876
6875
|
levels = [];
|
|
@@ -6890,7 +6889,7 @@ class Kr {
|
|
|
6890
6889
|
}
|
|
6891
6890
|
setMockData() {
|
|
6892
6891
|
const e = this.engine.models?.[0]?.levels, t = this.engine.models?.[0]?.boundingBox;
|
|
6893
|
-
this.setData(Array.isArray(e) && e.length > 0 ? e :
|
|
6892
|
+
this.setData(Array.isArray(e) && e.length > 0 ? e : qr, t);
|
|
6894
6893
|
}
|
|
6895
6894
|
show() {
|
|
6896
6895
|
this.isVisible = !0, this.svgContainer && (this.svgContainer.style.display = "block"), this.levels.forEach((e) => {
|
|
@@ -6923,7 +6922,7 @@ class Kr {
|
|
|
6923
6922
|
const { url: i, targetPoint: n } = this.resolvePointLookupArgs(e, t), s = this.getLevelData(i).slice().sort((m, w) => m.Elevation - w.Elevation);
|
|
6924
6923
|
if (s.length === 0)
|
|
6925
6924
|
return null;
|
|
6926
|
-
const o = (n instanceof h, n.y), r = s.find((m) => Math.abs(m.Elevation - o) <=
|
|
6925
|
+
const o = (n instanceof h, n.y), r = s.find((m) => Math.abs(m.Elevation - o) <= Wr) ?? null;
|
|
6927
6926
|
if (r)
|
|
6928
6927
|
return {
|
|
6929
6928
|
pointY: o,
|
|
@@ -7097,33 +7096,33 @@ class Kr {
|
|
|
7097
7096
|
};
|
|
7098
7097
|
}
|
|
7099
7098
|
}
|
|
7100
|
-
const Qt = !0, ei = 0.5,
|
|
7101
|
-
function
|
|
7099
|
+
const Qt = !0, ei = 0.5, Kr = 32, Yr = 0.3, Wn = 0.05, Xr = 0.04, $r = 0.18, Zr = 0.01;
|
|
7100
|
+
function Jr(a) {
|
|
7102
7101
|
return !a?.min || !a?.max ? 0 : a.min.distanceTo(a.max);
|
|
7103
7102
|
}
|
|
7104
|
-
function
|
|
7103
|
+
function Qr(a, e) {
|
|
7105
7104
|
return a instanceof h ? a.clone() : e?.min && e?.max ? e.min.clone().add(e.max).multiplyScalar(0.5) : new h();
|
|
7106
7105
|
}
|
|
7107
|
-
function
|
|
7106
|
+
function ea(a, e, t) {
|
|
7108
7107
|
if (a instanceof ve)
|
|
7109
7108
|
return Math.max((a.top - a.bottom) / Math.max(a.zoom, 1e-6), 1);
|
|
7110
|
-
const i = a, n =
|
|
7109
|
+
const i = a, n = Qr(e, t), s = i.position.distanceTo(n), o = typeof i.getEffectiveFOV == "function" ? i.getEffectiveFOV() : i.fov, r = R.degToRad(o * 0.5);
|
|
7111
7110
|
return Math.max(2 * s * Math.tan(r), 1);
|
|
7112
7111
|
}
|
|
7113
|
-
function
|
|
7112
|
+
function ta(a, e, t, i) {
|
|
7114
7113
|
if (a == null)
|
|
7115
7114
|
return i;
|
|
7116
|
-
const n =
|
|
7115
|
+
const n = Jr(t);
|
|
7117
7116
|
if (n <= 0)
|
|
7118
7117
|
return i;
|
|
7119
|
-
const s =
|
|
7118
|
+
const s = ea(a, e, t), o = Math.max(n * Xr, 1), r = Math.max(n * $r, o + 1), l = R.clamp(
|
|
7120
7119
|
(s - o) / (r - o),
|
|
7121
7120
|
0,
|
|
7122
7121
|
1
|
|
7123
|
-
), c = Math.max(i *
|
|
7122
|
+
), c = Math.max(i * Yr, Wn);
|
|
7124
7123
|
return R.lerp(i, c, l);
|
|
7125
7124
|
}
|
|
7126
|
-
class
|
|
7125
|
+
class ia {
|
|
7127
7126
|
engine;
|
|
7128
7127
|
isActive = Qt;
|
|
7129
7128
|
groupEdge;
|
|
@@ -7196,13 +7195,13 @@ class na {
|
|
|
7196
7195
|
// 启动
|
|
7197
7196
|
active() {
|
|
7198
7197
|
this.isActive = !0, this.groupEdge.visible = !0, this.engine.scene.traverse((e) => {
|
|
7199
|
-
e.isMesh && e.material &&
|
|
7198
|
+
e.isMesh && e.material && Li(e, !0);
|
|
7200
7199
|
}), this.update(), this.show();
|
|
7201
7200
|
}
|
|
7202
7201
|
// 关闭
|
|
7203
7202
|
disActive() {
|
|
7204
7203
|
this.isActive = !1, this.groupEdge.visible = !1, this.engine.scene.traverse((e) => {
|
|
7205
|
-
e.isMesh && e.material &&
|
|
7204
|
+
e.isMesh && e.material && Li(e, !1);
|
|
7206
7205
|
});
|
|
7207
7206
|
}
|
|
7208
7207
|
isEnabled() {
|
|
@@ -7214,13 +7213,13 @@ class na {
|
|
|
7214
7213
|
update() {
|
|
7215
7214
|
if (!this.isActive || !this.material)
|
|
7216
7215
|
return;
|
|
7217
|
-
const e =
|
|
7216
|
+
const e = ta(
|
|
7218
7217
|
this.engine?.camera,
|
|
7219
7218
|
this.engine?.controls?.target,
|
|
7220
7219
|
this.engine?.octreeBox?.getBoundingBox?.(),
|
|
7221
7220
|
this.baseOpacity
|
|
7222
7221
|
);
|
|
7223
|
-
Math.abs(this.material.opacity - e) <=
|
|
7222
|
+
Math.abs(this.material.opacity - e) <= Zr || (this.material.opacity = e, this.material.needsUpdate = !0);
|
|
7224
7223
|
}
|
|
7225
7224
|
hasPendingModelEdges() {
|
|
7226
7225
|
return (this.engine?.models ?? []).some((t) => !Array.isArray(t?.modelEdge));
|
|
@@ -7337,7 +7336,7 @@ class na {
|
|
|
7337
7336
|
if (i.ids.forEach((l) => {
|
|
7338
7337
|
const c = n?.get(Number(l)), u = typeof c == "number" ? this.getEdgePointsByIndex(i.url, c) : null;
|
|
7339
7338
|
if (Array.isArray(u)) {
|
|
7340
|
-
if (u.length >
|
|
7339
|
+
if (u.length > Kr)
|
|
7341
7340
|
return;
|
|
7342
7341
|
this.appendEdgePositions(s, u);
|
|
7343
7342
|
}
|
|
@@ -7421,7 +7420,7 @@ class na {
|
|
|
7421
7420
|
this.releaseIndexes(e);
|
|
7422
7421
|
}
|
|
7423
7422
|
}
|
|
7424
|
-
const
|
|
7423
|
+
const Yi = {
|
|
7425
7424
|
turbidity: 10,
|
|
7426
7425
|
rayleigh: 3,
|
|
7427
7426
|
mieCoefficient: 5e-3,
|
|
@@ -7605,15 +7604,15 @@ const Xi = {
|
|
|
7605
7604
|
showSunDisc: !1
|
|
7606
7605
|
}
|
|
7607
7606
|
}
|
|
7608
|
-
],
|
|
7607
|
+
], Xi = ii.reduce(
|
|
7609
7608
|
(a, e) => (a[e.id] = e, a),
|
|
7610
7609
|
{}
|
|
7611
|
-
),
|
|
7612
|
-
class
|
|
7610
|
+
), $i = 2e6;
|
|
7611
|
+
class na {
|
|
7613
7612
|
engine;
|
|
7614
7613
|
sky = null;
|
|
7615
7614
|
sun = new h();
|
|
7616
|
-
params = { ...
|
|
7615
|
+
params = { ...Yi, ...Xi[ti].params };
|
|
7617
7616
|
currentPreset = ti;
|
|
7618
7617
|
currentIntensity = qn;
|
|
7619
7618
|
currentEnvironmentTarget = null;
|
|
@@ -7637,7 +7636,7 @@ class sa {
|
|
|
7637
7636
|
return;
|
|
7638
7637
|
}
|
|
7639
7638
|
const e = new ps();
|
|
7640
|
-
e.scale.setScalar(this.skyScale), e.name = this.skyName, this.sky = e, this.engine.scene.add(e), this._captureSceneState(), this._expandCameraFarForSky(), this.engine.renderer && (this.engine.renderer.toneMapping =
|
|
7639
|
+
e.scale.setScalar(this.skyScale), e.name = this.skyName, this.sky = e, this.engine.scene.add(e), this._captureSceneState(), this._expandCameraFarForSky(), this.engine.renderer && (this.engine.renderer.toneMapping = vi, this.engine.scene.background = null), this._applyParamsToSky();
|
|
7641
7640
|
}
|
|
7642
7641
|
close(e = !0) {
|
|
7643
7642
|
this.sky && (this._restoreCameraFar(), this._restoreSceneState(e), e ? (this.engine?.scene?.remove(this.sky), this.sky.material.dispose(), this.sky.geometry.dispose(), this.sky = null) : this.sky.visible = !1);
|
|
@@ -7652,8 +7651,8 @@ class sa {
|
|
|
7652
7651
|
Object.assign(this.params, e), this._applyParamsToSky(), this.engine?.renderer && (e.exposure !== void 0 || e.orthoExposureScale !== void 0) && (this.engine.renderer.toneMappingExposure = this._getEffectiveExposure());
|
|
7653
7652
|
}
|
|
7654
7653
|
setPreset(e) {
|
|
7655
|
-
const t =
|
|
7656
|
-
t && (this.currentPreset = e, this.params = { ...
|
|
7654
|
+
const t = Xi[e];
|
|
7655
|
+
t && (this.currentPreset = e, this.params = { ...Yi, ...t.params }, this._applyParamsToSky(), this.engine?.renderer && (this.engine.renderer.toneMappingExposure = this._getEffectiveExposure()));
|
|
7657
7656
|
}
|
|
7658
7657
|
getCurrentPreset() {
|
|
7659
7658
|
return this.currentPreset;
|
|
@@ -7697,7 +7696,7 @@ class sa {
|
|
|
7697
7696
|
const e = this.engine?.camera;
|
|
7698
7697
|
if (!e || typeof e.far != "number") return;
|
|
7699
7698
|
const t = e.far;
|
|
7700
|
-
t >=
|
|
7699
|
+
t >= $i || (this.savedCameraFar == null && (this.savedCameraFar = t), e.far = $i, typeof e.updateProjectionMatrix == "function" && e.updateProjectionMatrix());
|
|
7701
7700
|
}
|
|
7702
7701
|
_restoreCameraFar() {
|
|
7703
7702
|
if (this.savedCameraFar == null || !this.engine?.camera) return;
|
|
@@ -7709,7 +7708,7 @@ class sa {
|
|
|
7709
7708
|
const e = this.sky.material.uniforms;
|
|
7710
7709
|
this._setUniformValue(e, "turbidity", this.params.turbidity), this._setUniformValue(e, "rayleigh", this.params.rayleigh), this._setUniformValue(e, "mieCoefficient", this.params.mieCoefficient), this._setUniformValue(e, "mieDirectionalG", this.params.mieDirectionalG), this._setUniformValue(e, "cloudCoverage", this.params.cloudCoverage), this._setUniformValue(e, "cloudDensity", this.params.cloudDensity), this._setUniformValue(e, "cloudElevation", this.params.cloudElevation), this._setUniformValue(e, "showSunDisc", this.params.showSunDisc ? 1 : 0);
|
|
7711
7710
|
const t = R.degToRad(90 - this.params.elevation), i = R.degToRad(this.params.azimuth);
|
|
7712
|
-
this.sun.setFromSphericalCoords(1, t, i), this._setUniformValue(e, "sunPosition", this.sun), this.engine?.renderer && (this.engine.renderer.toneMapping =
|
|
7711
|
+
this.sun.setFromSphericalCoords(1, t, i), this._setUniformValue(e, "sunPosition", this.sun), this.engine?.renderer && (this.engine.renderer.toneMapping = vi, this.engine.renderer.toneMappingExposure = this._getEffectiveExposure(), this.sky.visible && this._refreshEnvironmentMap());
|
|
7713
7712
|
}
|
|
7714
7713
|
_captureSceneState() {
|
|
7715
7714
|
this.hasCapturedSceneState || !this.engine?.scene || (this.previousBackground = this.engine.scene.background, this.previousEnvironment = this.engine.scene.environment, this.previousBackgroundIntensity = this.engine.scene.backgroundIntensity ?? 1, this.previousEnvironmentIntensity = this.engine.scene.environmentIntensity ?? 1, this.previousToneMapping = this.engine.renderer?.toneMapping ?? qe, this.previousToneMappingExposure = this.engine.renderer?.toneMappingExposure ?? 1, this.hasCapturedSceneState = !0);
|
|
@@ -7733,7 +7732,7 @@ class sa {
|
|
|
7733
7732
|
n && (i instanceof h && typeof n.value?.copy == "function" ? n.value.copy(i) : n.value = i);
|
|
7734
7733
|
}
|
|
7735
7734
|
}
|
|
7736
|
-
class
|
|
7735
|
+
class sa {
|
|
7737
7736
|
/** 寮曟搸瀹炰緥寮曠敤 */
|
|
7738
7737
|
engine;
|
|
7739
7738
|
defaultSettings;
|
|
@@ -7868,7 +7867,7 @@ class oa {
|
|
|
7868
7867
|
contrast: this._uniformToPercent(t, Cn),
|
|
7869
7868
|
saturation: this._uniformToPercent(e, bn),
|
|
7870
7869
|
shadowIntensity: this._shadowToPercent(this._getDirectionalLightShadowIntensity(), et),
|
|
7871
|
-
lightIntensity: this._exposureToPercent(n,
|
|
7870
|
+
lightIntensity: this._exposureToPercent(n, ai),
|
|
7872
7871
|
gtaoIntensity: this._unitToPercent(i, xn)
|
|
7873
7872
|
},
|
|
7874
7873
|
display: {
|
|
@@ -8006,7 +8005,7 @@ class Ie {
|
|
|
8006
8005
|
handelBehaved;
|
|
8007
8006
|
setting;
|
|
8008
8007
|
constructor(e) {
|
|
8009
|
-
this.engine = e, this.handelBehaved =
|
|
8008
|
+
this.engine = e, this.handelBehaved = mi(e), this.handelBehaved.init(this, null), this.setting = {
|
|
8010
8009
|
// 单位
|
|
8011
8010
|
unit: "m",
|
|
8012
8011
|
// 保留几位小数,ui上还是显示0.001这样
|
|
@@ -8158,8 +8157,8 @@ class Ie {
|
|
|
8158
8157
|
x.length >= 3 && k.push(x[0]);
|
|
8159
8158
|
let B = k.map((S) => S.x + "," + S.y).join(" "), I = p.container;
|
|
8160
8159
|
I.getElementsByTagName("polygon")[0].setAttribute("points", x.length >= 3 ? E : ""), I.getElementsByTagName("polyline")[0].setAttribute("points", B);
|
|
8161
|
-
let
|
|
8162
|
-
I.getElementsByTagName("rect")[0].setAttribute("x",
|
|
8160
|
+
let H = C, $ = _;
|
|
8161
|
+
I.getElementsByTagName("rect")[0].setAttribute("x", H - 40), I.getElementsByTagName("rect")[0].setAttribute("y", $ - 12.5), I.getElementsByTagName("text")[0].setAttribute("x", H + 10), I.getElementsByTagName("text")[0].setAttribute("y", $ + 4), I.getElementsByTagName("text")[0].innerHTML = e.getMeasureText(p.text, 2), I.style.top = "0px", I.style.left = "0px";
|
|
8163
8162
|
}
|
|
8164
8163
|
function m(p) {
|
|
8165
8164
|
if (p.container == null) {
|
|
@@ -8270,7 +8269,7 @@ class Ie {
|
|
|
8270
8269
|
}
|
|
8271
8270
|
}
|
|
8272
8271
|
}
|
|
8273
|
-
class
|
|
8272
|
+
class oa {
|
|
8274
8273
|
engine;
|
|
8275
8274
|
isActive = !1;
|
|
8276
8275
|
tools;
|
|
@@ -8369,7 +8368,7 @@ class ra {
|
|
|
8369
8368
|
}
|
|
8370
8369
|
}
|
|
8371
8370
|
}
|
|
8372
|
-
class
|
|
8371
|
+
class ra {
|
|
8373
8372
|
engine;
|
|
8374
8373
|
tools;
|
|
8375
8374
|
isActive = !1;
|
|
@@ -8425,7 +8424,7 @@ class aa {
|
|
|
8425
8424
|
}
|
|
8426
8425
|
// 按下esc
|
|
8427
8426
|
}
|
|
8428
|
-
class
|
|
8427
|
+
class aa {
|
|
8429
8428
|
engine;
|
|
8430
8429
|
isActive = !1;
|
|
8431
8430
|
tools;
|
|
@@ -8480,7 +8479,7 @@ class la {
|
|
|
8480
8479
|
t.point1 = s.point, t.point2 = n[0].point, t.text = t.point1.clone().distanceTo(t.point2.clone()), this.engine.events.trigger(ee.MeasureChanged, t);
|
|
8481
8480
|
}
|
|
8482
8481
|
}
|
|
8483
|
-
class
|
|
8482
|
+
class la {
|
|
8484
8483
|
engine;
|
|
8485
8484
|
isActive = !1;
|
|
8486
8485
|
tools;
|
|
@@ -8525,7 +8524,7 @@ class ca {
|
|
|
8525
8524
|
t.point = e.catch.point.clone(), t.text = e.catch.point.y, t.isSelect = !1, this.engine.events.trigger(ee.MeasureChanged, t);
|
|
8526
8525
|
}
|
|
8527
8526
|
}
|
|
8528
|
-
class
|
|
8527
|
+
class ca {
|
|
8529
8528
|
engine;
|
|
8530
8529
|
isActive = !1;
|
|
8531
8530
|
tools;
|
|
@@ -8577,7 +8576,7 @@ class ha {
|
|
|
8577
8576
|
e != null && (e.isSelect = !1, this.engine.events.trigger(ee.MeasureChanged, e));
|
|
8578
8577
|
}
|
|
8579
8578
|
}
|
|
8580
|
-
class
|
|
8579
|
+
class ha {
|
|
8581
8580
|
engine;
|
|
8582
8581
|
tools;
|
|
8583
8582
|
// 存储三个点:起点、顶点(中间点)、终点
|
|
@@ -8645,7 +8644,7 @@ class ua {
|
|
|
8645
8644
|
}
|
|
8646
8645
|
}
|
|
8647
8646
|
}
|
|
8648
|
-
class
|
|
8647
|
+
class ua {
|
|
8649
8648
|
engine;
|
|
8650
8649
|
tools;
|
|
8651
8650
|
points = [];
|
|
@@ -8872,7 +8871,7 @@ class tt {
|
|
|
8872
8871
|
}
|
|
8873
8872
|
}
|
|
8874
8873
|
}
|
|
8875
|
-
class
|
|
8874
|
+
class da {
|
|
8876
8875
|
engine;
|
|
8877
8876
|
isActive = !1;
|
|
8878
8877
|
points = [];
|
|
@@ -8953,7 +8952,7 @@ class pa {
|
|
|
8953
8952
|
};
|
|
8954
8953
|
}
|
|
8955
8954
|
}
|
|
8956
|
-
class
|
|
8955
|
+
class pa {
|
|
8957
8956
|
isActive = !1;
|
|
8958
8957
|
engine;
|
|
8959
8958
|
clearHeightMeasure;
|
|
@@ -8979,7 +8978,7 @@ class ma {
|
|
|
8979
8978
|
volumeAnnotation: []
|
|
8980
8979
|
};
|
|
8981
8980
|
constructor(e) {
|
|
8982
|
-
this.engine = e, this.clearHeightMeasure = new
|
|
8981
|
+
this.engine = e, this.clearHeightMeasure = new oa(e), this.distanceMeasure = new ra(e), this.clearDistanceMeasure = new aa(e), this.elevationMeasure = new la(e), this.pointMeasure = new ca(e), this.angleMeasure = new ha(e), this.areaMeasure = new ua(e), this.slopeMeasure = new tt(e), this.faceDistanceMeasure = new da(e), this.tools = new Ie(e), this.annotationContainer = document.createElement("div"), this.annotationContainer.className = "annotation-container", e.container.appendChild(this.annotationContainer);
|
|
8983
8982
|
}
|
|
8984
8983
|
setContextMenuDisabled(e) {
|
|
8985
8984
|
this.engine?.engineStatus != null && (this.engine.engineStatus.isDisableContextMenu = e);
|
|
@@ -9027,7 +9026,7 @@ class ma {
|
|
|
9027
9026
|
this.setContextMenuDisabled(!1), this.tools.disActive(), this.clearHeightMeasure.disActive(), this.distanceMeasure.disActive(), this.clearDistanceMeasure.disActive(), this.elevationMeasure.disActive(), this.pointMeasure.disActive(), this.angleMeasure.disActive(), this.areaMeasure.disActive(), this.slopeMeasure.disActive(), this.faceDistanceMeasure.disActive(), this.clearAll(), this.annotationContainer.remove(), this.isActive = !1;
|
|
9028
9027
|
}
|
|
9029
9028
|
}
|
|
9030
|
-
class
|
|
9029
|
+
class ma {
|
|
9031
9030
|
engine;
|
|
9032
9031
|
isActive = !1;
|
|
9033
9032
|
isCtrlDown = !1;
|
|
@@ -9480,7 +9479,7 @@ class ga {
|
|
|
9480
9479
|
}
|
|
9481
9480
|
].forEach((n) => {
|
|
9482
9481
|
this.createFace(t, n.vertices, n.normal, n.name, n.isMinFace, n.planePoint);
|
|
9483
|
-
}),
|
|
9482
|
+
}), ui(this.engine).forEach((n) => {
|
|
9484
9483
|
n.material && Array.isArray(n.material) ? n.material.forEach((s) => {
|
|
9485
9484
|
s.clippingPlanes = this.engine.sectionPlane;
|
|
9486
9485
|
}) : n.material.clippingPlanes = this.engine.sectionPlane;
|
|
@@ -9544,7 +9543,7 @@ class ga {
|
|
|
9544
9543
|
b && b.setFromNormalAndCoplanarPoint(i.clone().setLength(-1), o);
|
|
9545
9544
|
}
|
|
9546
9545
|
}
|
|
9547
|
-
class
|
|
9546
|
+
class ga {
|
|
9548
9547
|
engine;
|
|
9549
9548
|
isActive = !1;
|
|
9550
9549
|
isDrag = !1;
|
|
@@ -9832,7 +9831,7 @@ class fa {
|
|
|
9832
9831
|
}
|
|
9833
9832
|
applyClippingToModelMeshes() {
|
|
9834
9833
|
const e = this.engine.sectionPlane?.find?.((t) => t.name === "face");
|
|
9835
|
-
|
|
9834
|
+
ui(this.engine).forEach((t) => {
|
|
9836
9835
|
this.applyClippingToMaterial(t.material), this.engine.clipping.clippingStencil?.addMesh(e, t);
|
|
9837
9836
|
}), this.requestShadowRefresh();
|
|
9838
9837
|
}
|
|
@@ -9917,7 +9916,7 @@ class fa {
|
|
|
9917
9916
|
return Math.max(e * 0.015, 0.06);
|
|
9918
9917
|
}
|
|
9919
9918
|
getPlaneQuaternion(e) {
|
|
9920
|
-
const { tangent: t, bitangent: i } = this.getPlaneBasis(e), n = new
|
|
9919
|
+
const { tangent: t, bitangent: i } = this.getPlaneBasis(e), n = new U().makeBasis(
|
|
9921
9920
|
t,
|
|
9922
9921
|
i,
|
|
9923
9922
|
e.clone().normalize()
|
|
@@ -10099,7 +10098,7 @@ class fa {
|
|
|
10099
10098
|
}
|
|
10100
10099
|
}
|
|
10101
10100
|
}
|
|
10102
|
-
class
|
|
10101
|
+
class fa {
|
|
10103
10102
|
engine;
|
|
10104
10103
|
callback_;
|
|
10105
10104
|
isActive;
|
|
@@ -10130,7 +10129,7 @@ class ya {
|
|
|
10130
10129
|
});
|
|
10131
10130
|
}
|
|
10132
10131
|
}
|
|
10133
|
-
class
|
|
10132
|
+
class ya {
|
|
10134
10133
|
/** 引擎实例(包含 scene / models / engineStatus / octreeBox 等) */
|
|
10135
10134
|
engine;
|
|
10136
10135
|
/** three-bvh-csg 计算器,负责执行布尔操作 */
|
|
@@ -10154,7 +10153,7 @@ class va {
|
|
|
10154
10153
|
constructor(e) {
|
|
10155
10154
|
this.engine = e, this.evaluator = new ms();
|
|
10156
10155
|
const t = G("/texture/fill.png", import.meta.url), i = new st().load(t);
|
|
10157
|
-
i.wrapS = St, i.wrapT = St, i.center.set(0.5, 0.5), i.rotation = this.fillTextureRotation, this.fillMaterial = new
|
|
10156
|
+
i.wrapS = St, i.wrapT = St, i.center.set(0.5, 0.5), i.rotation = this.fillTextureRotation, this.fillMaterial = new ri({
|
|
10158
10157
|
color: 14079687,
|
|
10159
10158
|
map: i,
|
|
10160
10159
|
side: ge,
|
|
@@ -10358,10 +10357,10 @@ class va {
|
|
|
10358
10357
|
const n = new bt(t, t, i), s = e.coplanarPoint(new h()), o = new De().setFromUnitVectors(
|
|
10359
10358
|
new h(0, 0, 1),
|
|
10360
10359
|
e.normal.clone().normalize()
|
|
10361
|
-
), r = new
|
|
10360
|
+
), r = new U().compose(s, o, new h(1, 1, 1));
|
|
10362
10361
|
n.applyMatrix4(r);
|
|
10363
10362
|
const l = this.toCsgReadyGeometry(n);
|
|
10364
|
-
return n.dispose(), new
|
|
10363
|
+
return n.dispose(), new Mi(l);
|
|
10365
10364
|
}
|
|
10366
10365
|
/**
|
|
10367
10366
|
* 将场景 mesh 转为世界坐标 Brush。
|
|
@@ -10374,7 +10373,7 @@ class va {
|
|
|
10374
10373
|
const i = t.clone();
|
|
10375
10374
|
i.applyMatrix4(e.matrixWorld);
|
|
10376
10375
|
const n = this.toCsgReadyGeometry(i);
|
|
10377
|
-
return i.dispose(), new
|
|
10376
|
+
return i.dispose(), new Mi(n);
|
|
10378
10377
|
}
|
|
10379
10378
|
/**
|
|
10380
10379
|
* 统一 CSG 输入属性,避免属性不一致报错(例如 uv 缺失)。
|
|
@@ -10446,7 +10445,7 @@ class va {
|
|
|
10446
10445
|
return { tangent: l, bitangent: c };
|
|
10447
10446
|
}
|
|
10448
10447
|
}
|
|
10449
|
-
class
|
|
10448
|
+
class va {
|
|
10450
10449
|
engine;
|
|
10451
10450
|
clippingTolerance = 1e-4;
|
|
10452
10451
|
sectionBox;
|
|
@@ -10458,7 +10457,7 @@ class Ma {
|
|
|
10458
10457
|
fillCutFace = !0;
|
|
10459
10458
|
viewRangePlanes = null;
|
|
10460
10459
|
constructor(e) {
|
|
10461
|
-
this.engine = e, this.sectionCatchFace = new
|
|
10460
|
+
this.engine = e, this.sectionCatchFace = new fa(this.engine);
|
|
10462
10461
|
let t = new Z(new h(0, 0, 1), 1e5);
|
|
10463
10462
|
t.name = "前";
|
|
10464
10463
|
let i = new Z(new h(0, 0, 1), 1e5);
|
|
@@ -10475,7 +10474,7 @@ class Ma {
|
|
|
10475
10474
|
l.name = "face", this.engine.sectionPlane = [t, i, n, s, o, r, l];
|
|
10476
10475
|
}
|
|
10477
10476
|
init() {
|
|
10478
|
-
this.sectionBox = new
|
|
10477
|
+
this.sectionBox = new ma(this.engine), this.sectionFace = new ga(this.engine), this.clippingCSGSimple = new ya(this.engine);
|
|
10479
10478
|
}
|
|
10480
10479
|
// 自动缩放适用的视图比例
|
|
10481
10480
|
scaleBox() {
|
|
@@ -10670,7 +10669,7 @@ class Ma {
|
|
|
10670
10669
|
t instanceof Z && (t.constant = 1e5), this.applySectionPlanesToModelMeshes(), this.clippingCSGSimple?.updataFaces?.(e.slice(0, 6));
|
|
10671
10670
|
}
|
|
10672
10671
|
applySectionPlanesToModelMeshes() {
|
|
10673
|
-
|
|
10672
|
+
ui(this.engine).forEach((e) => {
|
|
10674
10673
|
e.material && Array.isArray(e.material) ? e.material.forEach((t) => {
|
|
10675
10674
|
t.clippingPlanes = this.engine.sectionPlane, t.clipShadows = !0;
|
|
10676
10675
|
}) : e.material && (e.material.clippingPlanes = this.engine.sectionPlane, e.material.clipShadows = !0);
|
|
@@ -10682,7 +10681,7 @@ class Ma {
|
|
|
10682
10681
|
});
|
|
10683
10682
|
}
|
|
10684
10683
|
}
|
|
10685
|
-
class
|
|
10684
|
+
class Ma {
|
|
10686
10685
|
engine;
|
|
10687
10686
|
constructor(e) {
|
|
10688
10687
|
this.engine = e;
|
|
@@ -10721,7 +10720,7 @@ class wa {
|
|
|
10721
10720
|
}), e;
|
|
10722
10721
|
}
|
|
10723
10722
|
}
|
|
10724
|
-
class
|
|
10723
|
+
class wa {
|
|
10725
10724
|
engine;
|
|
10726
10725
|
constructor(e) {
|
|
10727
10726
|
this.engine = e;
|
|
@@ -10759,7 +10758,7 @@ class xa {
|
|
|
10759
10758
|
});
|
|
10760
10759
|
}
|
|
10761
10760
|
}
|
|
10762
|
-
class
|
|
10761
|
+
class xa {
|
|
10763
10762
|
engine;
|
|
10764
10763
|
// 扩展属性
|
|
10765
10764
|
extended = /* @__PURE__ */ new Map();
|
|
@@ -10868,8 +10867,8 @@ class ba {
|
|
|
10868
10867
|
}
|
|
10869
10868
|
}
|
|
10870
10869
|
}
|
|
10871
|
-
const
|
|
10872
|
-
class
|
|
10870
|
+
const ba = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" aria-hidden="true"><circle cx="10.8" cy="10.8" r="6.5" stroke="currentColor" stroke-width="2"/><path d="m16 16 4.3 4.3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>';
|
|
10871
|
+
class Ca {
|
|
10873
10872
|
manager;
|
|
10874
10873
|
wrapper;
|
|
10875
10874
|
input;
|
|
@@ -10885,7 +10884,7 @@ class Sa {
|
|
|
10885
10884
|
this.manager = t, this.wrapper = document.createElement("div"), this.wrapper.className = "engine-3d-search", this.wrapper.innerHTML = `
|
|
10886
10885
|
<section class="engine-3d-search__box" role="dialog" aria-label="模型检索">
|
|
10887
10886
|
<div class="engine-3d-search__input-row">
|
|
10888
|
-
<span class="engine-3d-search__icon">${
|
|
10887
|
+
<span class="engine-3d-search__icon">${ba}</span>
|
|
10889
10888
|
<input class="engine-3d-search__input" type="search" placeholder="检索模型名称、构件 ID、房间" autocomplete="off" spellcheck="false" />
|
|
10890
10889
|
<button class="engine-3d-search__clear" type="button" aria-label="关闭检索框">×</button>
|
|
10891
10890
|
</div>
|
|
@@ -10988,13 +10987,13 @@ class Sa {
|
|
|
10988
10987
|
this.input.removeEventListener("input", this.onInput), this.input.removeEventListener("keydown", this.onKeyDown), this.wrapper.querySelector(".engine-3d-search__clear")?.removeEventListener("click", this.onCloseClick), this.pagination.removeEventListener("click", this.onPageClick), document.removeEventListener("mousedown", this.onDocumentMouseDown), document.removeEventListener("keydown", this.onDocumentKeyDown), this.debounceTimer !== null && clearTimeout(this.debounceTimer), this.wrapper.remove();
|
|
10989
10988
|
}
|
|
10990
10989
|
}
|
|
10991
|
-
class
|
|
10990
|
+
class Sa {
|
|
10992
10991
|
engine;
|
|
10993
10992
|
searchUI = null;
|
|
10994
10993
|
constructor(e) {
|
|
10995
10994
|
this.engine = e;
|
|
10996
10995
|
const t = e?.container;
|
|
10997
|
-
t && (this.searchUI = new
|
|
10996
|
+
t && (this.searchUI = new Ca(t, this), this.setTheme(e?.options?.searchTheme === "light" ? "light" : "dark"));
|
|
10998
10997
|
}
|
|
10999
10998
|
/** 按名称、ID、房间名称/编号检索已加载模型。 */
|
|
11000
10999
|
search(e, t = {}) {
|
|
@@ -11132,7 +11131,7 @@ class Ea {
|
|
|
11132
11131
|
return s < 0 ? null : (s === 0 ? 1e3 : 500) - s - Math.max(0, n.length - t.length) * 0.01;
|
|
11133
11132
|
}
|
|
11134
11133
|
}
|
|
11135
|
-
class
|
|
11134
|
+
class Ea {
|
|
11136
11135
|
engine;
|
|
11137
11136
|
constructor(e) {
|
|
11138
11137
|
this.engine = e;
|
|
@@ -11225,7 +11224,7 @@ class Pa {
|
|
|
11225
11224
|
}), t && t(i), i;
|
|
11226
11225
|
}
|
|
11227
11226
|
}
|
|
11228
|
-
class
|
|
11227
|
+
class Pa {
|
|
11229
11228
|
engine;
|
|
11230
11229
|
/** 点位列表 */
|
|
11231
11230
|
points = [];
|
|
@@ -11465,7 +11464,7 @@ class Aa {
|
|
|
11465
11464
|
this.stop(), this.points = [], this.playOptions = {};
|
|
11466
11465
|
}
|
|
11467
11466
|
}
|
|
11468
|
-
class
|
|
11467
|
+
class Aa {
|
|
11469
11468
|
engine;
|
|
11470
11469
|
miniMapCamera = null;
|
|
11471
11470
|
miniMapRenderer = null;
|
|
@@ -11926,7 +11925,7 @@ class _a {
|
|
|
11926
11925
|
this.miniMapContainer && (this.miniMapContainer.removeEventListener("wheel", this.onWheel), this.miniMapContainer.removeEventListener("mousedown", this.onMouseDown), this.miniMapContainer.removeEventListener("mousemove", this.onMouseMove), this.miniMapContainer.removeEventListener("mouseup", this.onMouseUp), this.miniMapContainer.removeEventListener("pointerdown", this.onMouseDown), this.miniMapContainer.removeEventListener("pointermove", this.onMouseMove), this.miniMapContainer.removeEventListener("pointerup", this.onMouseUp), this.miniMapContainer.removeEventListener("pointercancel", this.onMouseUp), this.miniMapContainer.removeEventListener("mouseenter", this.onMouseEnter), this.miniMapContainer.removeEventListener("mouseleave", this.onMouseLeave)), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("pointermove", this.onMouseMove), window.removeEventListener("pointerup", this.onMouseUp), window.removeEventListener("pointercancel", this.onMouseUp), window.removeEventListener("resize", this.onWindowResize), this.sizeToggleButton?.removeEventListener("click", this.onSizeToggleClick), this.resizeHandle?.removeEventListener("mousedown", this.onResizeHandleMouseDown), this.resizeHandle?.removeEventListener("pointerdown", this.onResizeHandleMouseDown), this.modelSelect?.removeEventListener("change", this.onModelChange), this.levelSelect?.removeEventListener("change", this.onLevelChange), this.engine.events?.off?.(this.loadingCompletedEventName, this.onLoadingCompleted), this.miniMapRenderer && (this.miniMapRenderer.dispose(), this.miniMapRenderer = null), this.miniMapContainer && (this.miniMapContainer.remove(), this.miniMapContainer = null), this.miniMapCamera = null, this.overlayCtx = null, this.overlayCanvas = null, this.levelToolbar = null, this.sizeToggleButton = null, this.resizeHandle = null, this.modelSelect = null, this.levelSelect = null, this.levelModels = [], this.levelDataSignature = "", this.selectedModelUrl = null;
|
|
11927
11926
|
}
|
|
11928
11927
|
}
|
|
11929
|
-
class
|
|
11928
|
+
class _a {
|
|
11930
11929
|
engine;
|
|
11931
11930
|
constructor(e) {
|
|
11932
11931
|
this.engine = e;
|
|
@@ -12223,14 +12222,14 @@ class Ta {
|
|
|
12223
12222
|
return Math.abs(s.dot(e)) < 0.999 ? s : new h(1, 0, 0);
|
|
12224
12223
|
}
|
|
12225
12224
|
}
|
|
12226
|
-
class
|
|
12225
|
+
class Ta {
|
|
12227
12226
|
engine;
|
|
12228
12227
|
constructor(e) {
|
|
12229
12228
|
}
|
|
12230
12229
|
update() {
|
|
12231
12230
|
}
|
|
12232
12231
|
}
|
|
12233
|
-
class
|
|
12232
|
+
class Da {
|
|
12234
12233
|
engine;
|
|
12235
12234
|
constructor(e) {
|
|
12236
12235
|
this.engine = e, this.active();
|
|
@@ -12259,7 +12258,7 @@ class Ia {
|
|
|
12259
12258
|
}), (Number(e.detail.id) == -1 || t) && this.engine.modelToolModule.unhighlightAllModels();
|
|
12260
12259
|
};
|
|
12261
12260
|
}
|
|
12262
|
-
class
|
|
12261
|
+
class Ia {
|
|
12263
12262
|
engine;
|
|
12264
12263
|
constructor(e) {
|
|
12265
12264
|
this.engine = e, this.active();
|
|
@@ -12313,7 +12312,7 @@ const We = {
|
|
|
12313
12312
|
EncodingComplete: "encoding-complete",
|
|
12314
12313
|
EncodingError: "encoding-error"
|
|
12315
12314
|
};
|
|
12316
|
-
class
|
|
12315
|
+
class La {
|
|
12317
12316
|
engine;
|
|
12318
12317
|
apiKey;
|
|
12319
12318
|
baseURL = "https://api.deepseek.com";
|
|
@@ -12501,7 +12500,7 @@ class ka {
|
|
|
12501
12500
|
}
|
|
12502
12501
|
}
|
|
12503
12502
|
}
|
|
12504
|
-
class
|
|
12503
|
+
class ka {
|
|
12505
12504
|
engine;
|
|
12506
12505
|
constructor(e) {
|
|
12507
12506
|
this.engine = e;
|
|
@@ -12624,86 +12623,27 @@ class za {
|
|
|
12624
12623
|
!e || e.isEmpty?.() || this.engine.viewCube?.zoomToModel?.(e);
|
|
12625
12624
|
}
|
|
12626
12625
|
}
|
|
12627
|
-
class
|
|
12628
|
-
engine;
|
|
12629
|
-
sectionPlaneGroup = null;
|
|
12630
|
-
loaderModule2d;
|
|
12626
|
+
class za {
|
|
12631
12627
|
constructor(e) {
|
|
12632
|
-
this.engine = e, this.loaderModule2d = new Os(this.engine);
|
|
12633
12628
|
}
|
|
12634
|
-
/**
|
|
12635
|
-
|
|
12636
|
-
|
|
12637
|
-
* @param viewDirection 视线方向 {x, y, z},剖切面法向取反后指向相机侧
|
|
12638
|
-
*/
|
|
12639
|
-
async attachSectionPlane(e, t, i, n) {
|
|
12640
|
-
await this.loaderModule2d.loadModel(e + "/" + t, {
|
|
12641
|
-
chunkSize: 1e3,
|
|
12642
|
-
enableChunkedLoading: !0,
|
|
12643
|
-
enableValidation: !0
|
|
12644
|
-
});
|
|
12645
|
-
let s = new h(i.x, i.y, i.z), o = new h(n.x, n.y, n.z);
|
|
12646
|
-
const r = new h().copy(o);
|
|
12647
|
-
let l = s.clone().sub(this.engine.modelGroup.position.clone()).dot(o);
|
|
12648
|
-
this.engine.modelGroup.lookAt(r);
|
|
12649
|
-
let c = this.engine.modelGroup.position.clone().add(o.setLength(l));
|
|
12650
|
-
this.engine.modelGroup.position.set(c.x, c.y, c.z), console.log("绘制完成");
|
|
12629
|
+
/** 3D 独立包不支持加载 2D 视图。 */
|
|
12630
|
+
async attachSectionPlane() {
|
|
12631
|
+
throw new Error("The standalone 3D package does not include 2D view merging.");
|
|
12651
12632
|
}
|
|
12652
|
-
/**
|
|
12653
|
-
* 移除由 attachSectionPlane 添加的剖切面平面
|
|
12654
|
-
*/
|
|
12633
|
+
/** 3D 独立包没有可移除的 2D 剖面。 */
|
|
12655
12634
|
removeSectionPlane() {
|
|
12656
|
-
this.engine.scene.remove(this.engine.modelGroup);
|
|
12657
|
-
}
|
|
12658
|
-
getMatrix(e, t) {
|
|
12659
|
-
const i = new h(e.x, e.y, e.z), n = new ri(t.x, t.y, t.z), s = new h(1, 1, 1), o = new De();
|
|
12660
|
-
o.setFromEuler(n);
|
|
12661
|
-
const r = new H();
|
|
12662
|
-
return r.compose(i, o, s), r;
|
|
12663
|
-
}
|
|
12664
|
-
// 计算Matrix
|
|
12665
|
-
computeMatrixFromOriginAndDirection(e, t) {
|
|
12666
|
-
const i = new H(), n = t.clone().normalize();
|
|
12667
|
-
if (n.length() === 0)
|
|
12668
|
-
return console.warn("方向向量长度为零,返回单位矩阵"), i.identity();
|
|
12669
|
-
const s = new h(0, 1, 0);
|
|
12670
|
-
let o = new h().crossVectors(s, n);
|
|
12671
|
-
if (o.length() < 1e-4) {
|
|
12672
|
-
const c = new h(0, 0, 1);
|
|
12673
|
-
o = new h().crossVectors(c, n).normalize();
|
|
12674
|
-
} else
|
|
12675
|
-
o.normalize();
|
|
12676
|
-
const r = new h().crossVectors(o, n).normalize(), l = new H();
|
|
12677
|
-
return l.set(
|
|
12678
|
-
o.x,
|
|
12679
|
-
n.x,
|
|
12680
|
-
r.x,
|
|
12681
|
-
0,
|
|
12682
|
-
o.y,
|
|
12683
|
-
n.y,
|
|
12684
|
-
r.y,
|
|
12685
|
-
0,
|
|
12686
|
-
o.z,
|
|
12687
|
-
n.z,
|
|
12688
|
-
r.z,
|
|
12689
|
-
0,
|
|
12690
|
-
0,
|
|
12691
|
-
0,
|
|
12692
|
-
0,
|
|
12693
|
-
1
|
|
12694
|
-
), l.setPosition(e), l;
|
|
12695
12635
|
}
|
|
12696
12636
|
}
|
|
12697
|
-
function
|
|
12637
|
+
function Ba(a, e, t = "bim-snapshot.png") {
|
|
12698
12638
|
const i = a?.renderer, n = i?.domElement;
|
|
12699
12639
|
if (!i || !n || !e)
|
|
12700
12640
|
return null;
|
|
12701
12641
|
const s = n.width || n.clientWidth, o = n.height || n.clientHeight;
|
|
12702
12642
|
if (s <= 0 || o <= 0)
|
|
12703
12643
|
return null;
|
|
12704
|
-
let r =
|
|
12705
|
-
if (!
|
|
12706
|
-
const g =
|
|
12644
|
+
let r = Ra(n, s, o);
|
|
12645
|
+
if (!Fa(r)) {
|
|
12646
|
+
const g = Oa(a, s, o);
|
|
12707
12647
|
g && (r = g);
|
|
12708
12648
|
}
|
|
12709
12649
|
const l = document.createElement("canvas");
|
|
@@ -12715,13 +12655,13 @@ function Ra(a, e, t = "bim-snapshot.png") {
|
|
|
12715
12655
|
const u = l.toDataURL("image/png"), d = document.createElement("a");
|
|
12716
12656
|
return d.href = u, d.download = t.toLowerCase().endsWith(".png") ? t : `${t}.png`, d.click(), u;
|
|
12717
12657
|
}
|
|
12718
|
-
function
|
|
12658
|
+
function Ra(a, e, t) {
|
|
12719
12659
|
const i = document.createElement("canvas");
|
|
12720
12660
|
i.width = e, i.height = t;
|
|
12721
12661
|
const n = i.getContext("2d");
|
|
12722
12662
|
return n && n.drawImage(a, 0, 0, e, t), i;
|
|
12723
12663
|
}
|
|
12724
|
-
function
|
|
12664
|
+
function Fa(a) {
|
|
12725
12665
|
const e = a.getContext("2d");
|
|
12726
12666
|
if (!e || a.width <= 0 || a.height <= 0)
|
|
12727
12667
|
return !1;
|
|
@@ -12734,7 +12674,7 @@ function Oa(a) {
|
|
|
12734
12674
|
}
|
|
12735
12675
|
return !1;
|
|
12736
12676
|
}
|
|
12737
|
-
function
|
|
12677
|
+
function Oa(a, e, t) {
|
|
12738
12678
|
const i = a?.renderer, n = a?.scene, s = a?.camera;
|
|
12739
12679
|
if (!i || !n || !s)
|
|
12740
12680
|
return null;
|
|
@@ -12748,14 +12688,14 @@ function Na(a, e, t) {
|
|
|
12748
12688
|
try {
|
|
12749
12689
|
i.xr && (i.xr.enabled = !1), i.autoClear = !0, i.setRenderTarget(o), i.clear(!0, !0, !0), i.render(n, s);
|
|
12750
12690
|
const u = new Uint8Array(e * t * 4);
|
|
12751
|
-
return i.readRenderTargetPixels(o, 0, 0, e, t, u),
|
|
12691
|
+
return i.readRenderTargetPixels(o, 0, 0, e, t, u), Na(u, e, t);
|
|
12752
12692
|
} catch {
|
|
12753
12693
|
return null;
|
|
12754
12694
|
} finally {
|
|
12755
12695
|
i.setRenderTarget(r), i.autoClear = l, i.xr && (i.xr.enabled = c), o.dispose();
|
|
12756
12696
|
}
|
|
12757
12697
|
}
|
|
12758
|
-
function
|
|
12698
|
+
function Na(a, e, t) {
|
|
12759
12699
|
const i = document.createElement("canvas");
|
|
12760
12700
|
i.width = e, i.height = t;
|
|
12761
12701
|
const n = i.getContext("2d");
|
|
@@ -12769,7 +12709,7 @@ function Ha(a, e, t) {
|
|
|
12769
12709
|
}
|
|
12770
12710
|
return n.putImageData(s, 0, 0), i;
|
|
12771
12711
|
}
|
|
12772
|
-
const
|
|
12712
|
+
const Ha = [
|
|
12773
12713
|
"#ffffff",
|
|
12774
12714
|
"#000000",
|
|
12775
12715
|
"#ff4d4f",
|
|
@@ -12780,7 +12720,7 @@ const Va = [
|
|
|
12780
12720
|
"#1677ff",
|
|
12781
12721
|
"#722ed1",
|
|
12782
12722
|
"#eb2f96"
|
|
12783
|
-
],
|
|
12723
|
+
], Va = {
|
|
12784
12724
|
none: G("/assets/icon/选择.svg", import.meta.url),
|
|
12785
12725
|
line: G("/assets/icon/线.svg", import.meta.url),
|
|
12786
12726
|
arrow: G("/assets/icon/箭头.svg", import.meta.url),
|
|
@@ -12788,7 +12728,7 @@ const Va = [
|
|
|
12788
12728
|
circle: G("/assets/icon/圆形.svg", import.meta.url),
|
|
12789
12729
|
text: G("/assets/icon/文字.svg", import.meta.url),
|
|
12790
12730
|
cloudline: G("/assets/icon/云线.svg", import.meta.url)
|
|
12791
|
-
},
|
|
12731
|
+
}, Ua = G("/assets/icon/测距.svg", import.meta.url), Ga = G("/assets/icon/截图.svg", import.meta.url), Wa = G("/assets/icon/线宽.svg", import.meta.url), qa = G("/assets/icon/字号.svg", import.meta.url), ja = `data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2l4 8-4 12-4-12 4-8z" fill="#1677ff"/><circle cx="12" cy="10" r="2.5" fill="#fff"/></svg>')}`, Ka = [
|
|
12792
12732
|
{ type: "distance", label: "距离" },
|
|
12793
12733
|
{ type: "clearDistance", label: "净距" },
|
|
12794
12734
|
{ type: "clearHeight", label: "净高" },
|
|
@@ -12797,7 +12737,7 @@ const Va = [
|
|
|
12797
12737
|
{ type: "angle", label: "角度" },
|
|
12798
12738
|
{ type: "area", label: "面积" },
|
|
12799
12739
|
{ type: "slope", label: "坡度" }
|
|
12800
|
-
],
|
|
12740
|
+
], Ya = {
|
|
12801
12741
|
distance: G("/assets/icon/距离.svg", import.meta.url),
|
|
12802
12742
|
clearDistance: G("/assets/icon/净距.svg", import.meta.url),
|
|
12803
12743
|
clearHeight: G("/assets/icon/净高.svg", import.meta.url),
|
|
@@ -12807,7 +12747,7 @@ const Va = [
|
|
|
12807
12747
|
area: G("/assets/icon/面积.svg", import.meta.url),
|
|
12808
12748
|
slope: G("/assets/icon/坡度.svg", import.meta.url)
|
|
12809
12749
|
};
|
|
12810
|
-
class
|
|
12750
|
+
class Xa {
|
|
12811
12751
|
constructor(e, t) {
|
|
12812
12752
|
this.handlers = e, this.root = document.createElement("div"), this.root.style.position = "absolute", this.root.style.top = "8px", this.root.style.left = "50%", this.root.style.transform = "translateX(-50%)", this.root.style.display = "none", this.root.style.padding = "6px", this.root.style.background = "#ffffff", this.root.style.border = "1px solid #d9d9d9", this.root.style.borderRadius = "8px", this.root.style.pointerEvents = "auto", this.root.style.userSelect = "none", this.root.style.boxShadow = "0 4px 14px rgba(0, 0, 0, 0.12)", this.root.style.zIndex = "1300", this.root.style.overflow = "visible", this.editPanel = document.createElement("div"), this.editPanel.style.display = "flex", this.editPanel.style.flexDirection = "column", this.editPanel.style.gap = "6px", this.viewPanel = document.createElement("div"), this.viewPanel.style.display = "none", this.viewPanel.style.alignItems = "center", this.viewPanel.style.gap = "6px";
|
|
12813
12753
|
const i = document.createElement("div");
|
|
@@ -12820,7 +12760,7 @@ class $a {
|
|
|
12820
12760
|
{ type: "text", label: "文字" },
|
|
12821
12761
|
{ type: "cloudline", label: "云线" }
|
|
12822
12762
|
].forEach((w) => {
|
|
12823
|
-
const v = this.createIconButton(w.label,
|
|
12763
|
+
const v = this.createIconButton(w.label, Va[w.type]);
|
|
12824
12764
|
v.onclick = () => this.handlers.onDrawTypeChange(w.type), this.drawButtons[w.type] = v, i.appendChild(v);
|
|
12825
12765
|
});
|
|
12826
12766
|
const s = document.createElement("div");
|
|
@@ -12830,23 +12770,23 @@ class $a {
|
|
|
12830
12770
|
this.updateColorControl(this.colorInput.value), this.handlers.onColorChange(this.colorInput.value), this.setColorPresetVisible(!1);
|
|
12831
12771
|
}, s.appendChild(this.colorInput), this.colorPresetPanel = document.createElement("div"), this.colorPresetPanel.style.position = "absolute", this.colorPresetPanel.style.top = "30px", this.colorPresetPanel.style.left = "0", this.colorPresetPanel.style.display = "none", this.colorPresetPanel.style.padding = "8px", this.colorPresetPanel.style.background = "#ffffff", this.colorPresetPanel.style.border = "1px solid #d9d9d9", this.colorPresetPanel.style.borderRadius = "6px", this.colorPresetPanel.style.boxShadow = "0 6px 18px rgba(0, 0, 0, 0.14)", this.colorPresetPanel.style.zIndex = "20", this.colorPresetPanel.style.width = "152px";
|
|
12832
12772
|
const r = document.createElement("div");
|
|
12833
|
-
r.style.display = "grid", r.style.gridTemplateColumns = "repeat(5, 1fr)", r.style.gap = "6px",
|
|
12773
|
+
r.style.display = "grid", r.style.gridTemplateColumns = "repeat(5, 1fr)", r.style.gap = "6px", Ha.forEach((w) => {
|
|
12834
12774
|
const v = document.createElement("button");
|
|
12835
12775
|
v.type = "button", v.title = w, v.style.width = "22px", v.style.height = "22px", v.style.padding = "0", v.style.border = "1px solid #d9d9d9", v.style.borderRadius = "4px", v.style.background = w, v.style.cursor = "pointer", v.onclick = () => {
|
|
12836
12776
|
this.updateColorControl(w), this.handlers.onColorChange(w), this.setColorPresetVisible(!1);
|
|
12837
12777
|
}, r.appendChild(v);
|
|
12838
12778
|
}), this.colorPresetPanel.appendChild(r);
|
|
12839
12779
|
const l = document.createElement("button");
|
|
12840
|
-
l.type = "button", l.textContent = "自定义", l.style.marginTop = "8px", l.style.width = "100%", l.style.height = "26px", l.style.border = "1px solid #d9d9d9", l.style.borderRadius = "4px", l.style.background = "#ffffff", l.style.color = "#333333", l.style.cursor = "pointer", l.onclick = () => this.openNativeColorPicker(), this.colorPresetPanel.appendChild(l), s.appendChild(this.colorPresetPanel), this.updateColorControl(t.stroke), i.appendChild(this.createField("", s)), this.strokeWidthInput = document.createElement("input"), this.strokeWidthInput.type = "number", this.strokeWidthInput.min = "1", this.strokeWidthInput.max = "20", this.strokeWidthInput.step = "1", this.strokeWidthInput.value = String(t.strokeWidth), this.strokeWidthInput.style.width = "46px", this.strokeWidthInput.oninput = () => this.handlers.onStrokeWidthChange(this.strokeWidthInput.value), i.appendChild(this.createField("", this.strokeWidthInput,
|
|
12841
|
-
const c = this.createIconButton("截图",
|
|
12780
|
+
l.type = "button", l.textContent = "自定义", l.style.marginTop = "8px", l.style.width = "100%", l.style.height = "26px", l.style.border = "1px solid #d9d9d9", l.style.borderRadius = "4px", l.style.background = "#ffffff", l.style.color = "#333333", l.style.cursor = "pointer", l.onclick = () => this.openNativeColorPicker(), this.colorPresetPanel.appendChild(l), s.appendChild(this.colorPresetPanel), this.updateColorControl(t.stroke), i.appendChild(this.createField("", s)), this.strokeWidthInput = document.createElement("input"), this.strokeWidthInput.type = "number", this.strokeWidthInput.min = "1", this.strokeWidthInput.max = "20", this.strokeWidthInput.step = "1", this.strokeWidthInput.value = String(t.strokeWidth), this.strokeWidthInput.style.width = "46px", this.strokeWidthInput.oninput = () => this.handlers.onStrokeWidthChange(this.strokeWidthInput.value), i.appendChild(this.createField("", this.strokeWidthInput, Wa, "线宽")), this.fontSizeInput = document.createElement("input"), this.fontSizeInput.type = "number", this.fontSizeInput.min = "10", this.fontSizeInput.max = "96", this.fontSizeInput.step = "1", this.fontSizeInput.value = String(t.fontSize), this.fontSizeInput.style.width = "46px", this.fontSizeInput.oninput = () => this.handlers.onFontSizeChange(this.fontSizeInput.value), i.appendChild(this.createField("", this.fontSizeInput, qa, "字号")), this.distanceButton = this.createIconButton("测量", Ua), this.distanceButton.onclick = () => this.handlers.onMeasureToggle(), i.appendChild(this.distanceButton);
|
|
12781
|
+
const c = this.createIconButton("截图", Ga);
|
|
12842
12782
|
c.onclick = () => this.handlers.onScreenshot(), i.appendChild(c);
|
|
12843
|
-
const u = this.createIconButton("捕捉点",
|
|
12783
|
+
const u = this.createIconButton("捕捉点", ja);
|
|
12844
12784
|
u.onclick = () => this.handlers.onPickPoint(), i.appendChild(u);
|
|
12845
12785
|
const d = this.createTextButton("×", "取消");
|
|
12846
12786
|
d.onclick = () => this.handlers.onCancel(), d.style.background = "#ff4d4f", d.style.borderColor = "#ff4d4f", d.style.color = "#ffffff", i.appendChild(d);
|
|
12847
12787
|
const g = this.createTextButton("✔", "确定");
|
|
12848
|
-
g.onclick = () => this.handlers.onConfirm(), g.style.background = "#52c41a", g.style.borderColor = "#52c41a", g.style.color = "#ffffff", i.appendChild(g), this.measureSubPanel = document.createElement("div"), this.measureSubPanel.style.display = "none", this.measureSubPanel.style.alignItems = "center", this.measureSubPanel.style.gap = "6px", this.measureSubPanel.style.flexWrap = "wrap", this.measureSubPanel.style.paddingTop = "2px",
|
|
12849
|
-
const v = this.createSmallIconButton(w.label,
|
|
12788
|
+
g.onclick = () => this.handlers.onConfirm(), g.style.background = "#52c41a", g.style.borderColor = "#52c41a", g.style.color = "#ffffff", i.appendChild(g), this.measureSubPanel = document.createElement("div"), this.measureSubPanel.style.display = "none", this.measureSubPanel.style.alignItems = "center", this.measureSubPanel.style.gap = "6px", this.measureSubPanel.style.flexWrap = "wrap", this.measureSubPanel.style.paddingTop = "2px", Ka.forEach((w) => {
|
|
12789
|
+
const v = this.createSmallIconButton(w.label, Ya[w.type]);
|
|
12850
12790
|
v.onclick = () => this.handlers.onMeasureTypeChange(w.type), this.measureTypeButtons[w.type] = v, this.measureSubPanel.appendChild(v);
|
|
12851
12791
|
}), this.editPanel.appendChild(i), this.editPanel.appendChild(this.measureSubPanel);
|
|
12852
12792
|
const m = this.createTextButton("关闭", "关闭");
|
|
@@ -12971,7 +12911,7 @@ class $a {
|
|
|
12971
12911
|
return i.type = "button", i.title = t, i.textContent = e, i.style.width = "28px", i.style.height = "28px", i.style.padding = "0 10px", i.style.border = "1px solid #d9d9d9", i.style.borderRadius = "4px", i.style.background = "#ffffff", i.style.color = "#333333", i.style.fontSize = "13px", i.style.lineHeight = "1", i.style.cursor = "pointer", i;
|
|
12972
12912
|
}
|
|
12973
12913
|
}
|
|
12974
|
-
class
|
|
12914
|
+
class $a {
|
|
12975
12915
|
engine;
|
|
12976
12916
|
wrapper;
|
|
12977
12917
|
canvasEl;
|
|
@@ -13010,7 +12950,7 @@ class Za {
|
|
|
13010
12950
|
const t = this.engine.container;
|
|
13011
12951
|
if (!t)
|
|
13012
12952
|
throw new Error("FabricDraw: engine container not found.");
|
|
13013
|
-
this.wrapper = document.createElement("div"), this.wrapper.className = "fabric-draw-layer", this.wrapper.style.position = "absolute", this.wrapper.style.left = "0", this.wrapper.style.top = "0", this.wrapper.style.right = "0", this.wrapper.style.bottom = "0", this.wrapper.style.pointerEvents = "none", this.canvasEl = document.createElement("canvas"), this.canvasEl.style.width = "100%", this.canvasEl.style.height = "100%", this.wrapper.appendChild(this.canvasEl), this.toolbar = new
|
|
12953
|
+
this.wrapper = document.createElement("div"), this.wrapper.className = "fabric-draw-layer", this.wrapper.style.position = "absolute", this.wrapper.style.left = "0", this.wrapper.style.top = "0", this.wrapper.style.right = "0", this.wrapper.style.bottom = "0", this.wrapper.style.pointerEvents = "none", this.canvasEl = document.createElement("canvas"), this.canvasEl.style.width = "100%", this.canvasEl.style.height = "100%", this.wrapper.appendChild(this.canvasEl), this.toolbar = new Xa({
|
|
13014
12954
|
onDrawTypeChange: (n) => this.setDrawType(n),
|
|
13015
12955
|
onMeasureToggle: () => this.toggleMeasurePanel(),
|
|
13016
12956
|
onMeasureTypeChange: (n) => this.activateDistanceMeasure(n),
|
|
@@ -13159,7 +13099,7 @@ class Za {
|
|
|
13159
13099
|
* 鎴浘淇濆瓨锛堟ā鍨?Fabric鎵规敞鍚堟垚锛夈€? */
|
|
13160
13100
|
saveScreenshot(e = "bim-snapshot.png") {
|
|
13161
13101
|
const t = this.canvas.lowerCanvasEl;
|
|
13162
|
-
return t ?
|
|
13102
|
+
return t ? Ba(this.engine, t, e) : null;
|
|
13163
13103
|
}
|
|
13164
13104
|
/**
|
|
13165
13105
|
* 鍚屾鐢诲竷灏哄銆? */
|
|
@@ -13358,12 +13298,12 @@ class Za {
|
|
|
13358
13298
|
fill: "",
|
|
13359
13299
|
selectable: n,
|
|
13360
13300
|
evented: n
|
|
13361
|
-
}),
|
|
13301
|
+
}), H = new Ci([I], {
|
|
13362
13302
|
selectable: n,
|
|
13363
13303
|
evented: n,
|
|
13364
13304
|
objectCaching: !1
|
|
13365
13305
|
});
|
|
13366
|
-
return
|
|
13306
|
+
return H.annotationType = "arrow", H;
|
|
13367
13307
|
}
|
|
13368
13308
|
const l = s / r, c = o / r, u = -c, d = l, g = Math.max(10, i.strokeWidth * 6), m = g * 0.72, w = t.x - l * g, v = t.y - c * g, b = w + u * (m * 0.5), p = v + d * (m * 0.5), x = w - u * (m * 0.5), C = v - d * (m * 0.5), _ = new zt([e.x, e.y, t.x, t.y], {
|
|
13369
13309
|
stroke: i.stroke,
|
|
@@ -13372,14 +13312,14 @@ class Za {
|
|
|
13372
13312
|
strokeLineCap: "round",
|
|
13373
13313
|
selectable: !1,
|
|
13374
13314
|
evented: !1
|
|
13375
|
-
}), E = `M ${t.x} ${t.y} L ${b} ${p} L ${x} ${C} Z`, k = new
|
|
13315
|
+
}), E = `M ${t.x} ${t.y} L ${b} ${p} L ${x} ${C} Z`, k = new Si(E, {
|
|
13376
13316
|
fill: i.stroke,
|
|
13377
13317
|
stroke: i.stroke,
|
|
13378
13318
|
strokeWidth: 1,
|
|
13379
13319
|
selectable: !1,
|
|
13380
13320
|
evented: !1,
|
|
13381
13321
|
objectCaching: !1
|
|
13382
|
-
}), B = new
|
|
13322
|
+
}), B = new Ci([_, k], {
|
|
13383
13323
|
selectable: n,
|
|
13384
13324
|
evented: n,
|
|
13385
13325
|
objectCaching: !1
|
|
@@ -13390,7 +13330,7 @@ class Za {
|
|
|
13390
13330
|
const n = this.buildCloudPath(e, t.cloudRadius);
|
|
13391
13331
|
if (!n)
|
|
13392
13332
|
return null;
|
|
13393
|
-
const s = new
|
|
13333
|
+
const s = new Si(n, {
|
|
13394
13334
|
stroke: t.stroke,
|
|
13395
13335
|
strokeWidth: t.strokeWidth,
|
|
13396
13336
|
fill: "",
|
|
@@ -13643,7 +13583,7 @@ class Za {
|
|
|
13643
13583
|
return JSON.parse(JSON.stringify(e));
|
|
13644
13584
|
}
|
|
13645
13585
|
}
|
|
13646
|
-
class
|
|
13586
|
+
class Za {
|
|
13647
13587
|
engine;
|
|
13648
13588
|
capturePoint = null;
|
|
13649
13589
|
labelPrefix = "drawing-pin-label-";
|
|
@@ -14039,7 +13979,7 @@ class Ja {
|
|
|
14039
13979
|
return e;
|
|
14040
13980
|
}
|
|
14041
13981
|
}
|
|
14042
|
-
const Gt = "bim-engine:model-link-3d",
|
|
13982
|
+
const Gt = "bim-engine:model-link-3d", Ja = "default-model-link-3d-group", Zi = {
|
|
14043
13983
|
enabled: !1,
|
|
14044
13984
|
highlight: !0,
|
|
14045
13985
|
visibility: !0,
|
|
@@ -14048,7 +13988,7 @@ const Gt = "bim-engine:model-link-3d", Qa = "default-model-link-3d-group", Ji =
|
|
|
14048
13988
|
cameraMode: "onStop",
|
|
14049
13989
|
cameraThrottleMs: 50
|
|
14050
13990
|
};
|
|
14051
|
-
class
|
|
13991
|
+
class Qa {
|
|
14052
13992
|
viewerGuid;
|
|
14053
13993
|
engine;
|
|
14054
13994
|
options;
|
|
@@ -14110,9 +14050,9 @@ class el {
|
|
|
14110
14050
|
}
|
|
14111
14051
|
normalizeOptions(e) {
|
|
14112
14052
|
return {
|
|
14113
|
-
...
|
|
14053
|
+
...Zi,
|
|
14114
14054
|
...e,
|
|
14115
|
-
groupId: e.groupId ?? this.engine?.options?.linkGroupId ??
|
|
14055
|
+
groupId: e.groupId ?? this.engine?.options?.linkGroupId ?? Ja,
|
|
14116
14056
|
modelId: e.modelId ?? this.engine?.options?.modelLinkId
|
|
14117
14057
|
};
|
|
14118
14058
|
}
|
|
@@ -14204,7 +14144,7 @@ class el {
|
|
|
14204
14144
|
return this.engine?.controlModule?.firstPersonControls?.enabled === !0 && this.engine?.movefirst === !0;
|
|
14205
14145
|
}
|
|
14206
14146
|
emitCameraThrottled() {
|
|
14207
|
-
const e = Date.now(), t = Math.max(0, (this.options.cameraThrottleMs ??
|
|
14147
|
+
const e = Date.now(), t = Math.max(0, (this.options.cameraThrottleMs ?? Zi.cameraThrottleMs) - (e - this.lastCameraEmitTime));
|
|
14208
14148
|
if (t === 0) {
|
|
14209
14149
|
this.emitCamera();
|
|
14210
14150
|
return;
|
|
@@ -14343,7 +14283,7 @@ class el {
|
|
|
14343
14283
|
})).filter((n) => n.ids.length > 0);
|
|
14344
14284
|
}
|
|
14345
14285
|
}
|
|
14346
|
-
class
|
|
14286
|
+
class el {
|
|
14347
14287
|
engine;
|
|
14348
14288
|
manager;
|
|
14349
14289
|
worldToScreen;
|
|
@@ -14421,7 +14361,7 @@ function ft(a) {
|
|
|
14421
14361
|
const e = new h();
|
|
14422
14362
|
return a.length === 0 ? e : (a.forEach((t) => e.add(ye(t))), e.multiplyScalar(1 / a.length));
|
|
14423
14363
|
}
|
|
14424
|
-
function
|
|
14364
|
+
function tl(a) {
|
|
14425
14365
|
const e = new h();
|
|
14426
14366
|
for (let t = 0; t < a.length; t += 1) {
|
|
14427
14367
|
const i = a[t], n = a[(t + 1) % a.length];
|
|
@@ -14429,14 +14369,14 @@ function il(a) {
|
|
|
14429
14369
|
}
|
|
14430
14370
|
return e.normalize();
|
|
14431
14371
|
}
|
|
14432
|
-
function
|
|
14372
|
+
function Ji(a) {
|
|
14433
14373
|
const e = a.map((c) => ye(c)), t = e[0].clone(), i = e.length > 1 ? e[1].clone().sub(t).normalize() : new h(1, 0, 0);
|
|
14434
|
-
let n =
|
|
14374
|
+
let n = tl(e);
|
|
14435
14375
|
n.lengthSq() < 1e-8 && (n = new h(0, 1, 0));
|
|
14436
14376
|
const s = new h().crossVectors(n, i).normalize(), o = new h().crossVectors(s, n).normalize(), r = e.map((c) => {
|
|
14437
14377
|
const u = c.clone().sub(t);
|
|
14438
14378
|
return new W(u.dot(o), u.dot(s));
|
|
14439
|
-
}), l = new
|
|
14379
|
+
}), l = new U().makeBasis(o, s, n).setPosition(t);
|
|
14440
14380
|
return {
|
|
14441
14381
|
origin: t,
|
|
14442
14382
|
normal: n,
|
|
@@ -14444,7 +14384,7 @@ function Qi(a) {
|
|
|
14444
14384
|
localPoints: r
|
|
14445
14385
|
};
|
|
14446
14386
|
}
|
|
14447
|
-
function
|
|
14387
|
+
function Qi(a) {
|
|
14448
14388
|
const e = new ln();
|
|
14449
14389
|
return a.forEach((t, i) => {
|
|
14450
14390
|
if (i === 0) {
|
|
@@ -14454,12 +14394,12 @@ function en(a) {
|
|
|
14454
14394
|
e.lineTo(t.x, t.y);
|
|
14455
14395
|
}), e.closePath(), e;
|
|
14456
14396
|
}
|
|
14457
|
-
function
|
|
14397
|
+
function il(a, e) {
|
|
14458
14398
|
a.traverse((t) => {
|
|
14459
14399
|
t.userData = t.userData ?? {}, t.userData.annotationId = e;
|
|
14460
14400
|
});
|
|
14461
14401
|
}
|
|
14462
|
-
function
|
|
14402
|
+
function nl(a) {
|
|
14463
14403
|
a.traverse((e) => {
|
|
14464
14404
|
const t = e;
|
|
14465
14405
|
t.geometry?.dispose?.();
|
|
@@ -14471,13 +14411,13 @@ function sl(a) {
|
|
|
14471
14411
|
i?.dispose?.();
|
|
14472
14412
|
});
|
|
14473
14413
|
}
|
|
14474
|
-
function
|
|
14414
|
+
function sl(a) {
|
|
14475
14415
|
return a.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
14476
14416
|
}
|
|
14477
|
-
function
|
|
14417
|
+
function ol(a) {
|
|
14478
14418
|
return a === "polyline" ? "center" : a === "polygon" ? "centroid" : "top";
|
|
14479
14419
|
}
|
|
14480
|
-
class
|
|
14420
|
+
class rl {
|
|
14481
14421
|
constructor(e, t, i) {
|
|
14482
14422
|
this.engine = e, this.textureLoader = t, this.materialFactory = i;
|
|
14483
14423
|
}
|
|
@@ -14529,14 +14469,14 @@ class al {
|
|
|
14529
14469
|
}
|
|
14530
14470
|
const o = new Fe(i.color ?? "#7ffcff");
|
|
14531
14471
|
if (n.baseRing?.enabled) {
|
|
14532
|
-
const r = n.baseRing.radius ?? 3, l = new
|
|
14472
|
+
const r = n.baseRing.radius ?? 3, l = new wi(r * 0.84, r, 48), c = this.materialFactory.createPulseMaterial(o, 0.85, i, n, "uvx", 0, 1), u = new O(l, c);
|
|
14533
14473
|
u.rotation.x = -Math.PI / 2, u.renderOrder = i.alwaysOnTop ? 1300 : 0, e.instance.root.add(u), e.baseRingMeshes.push(u), e.pulseMaterials.push(c);
|
|
14534
14474
|
}
|
|
14535
14475
|
if (n.ripple?.enabled) {
|
|
14536
14476
|
const r = n.ripple.count ?? 2, l = n.ripple.maxRadius ?? 12;
|
|
14537
14477
|
for (let c = 0; c < r; c += 1) {
|
|
14538
14478
|
const u = new O(
|
|
14539
|
-
new
|
|
14479
|
+
new wi(0.86, 1, 40),
|
|
14540
14480
|
new me({
|
|
14541
14481
|
color: o,
|
|
14542
14482
|
transparent: !0,
|
|
@@ -14592,7 +14532,7 @@ class al {
|
|
|
14592
14532
|
}
|
|
14593
14533
|
/** 任意平面多边形先投影到局部二维,再恢复到原始空间。 */
|
|
14594
14534
|
buildPolygon(e) {
|
|
14595
|
-
const t =
|
|
14535
|
+
const t = Ji(e.instance.points), i = Qi(t.localPoints), n = new xs(i);
|
|
14596
14536
|
n.computeBoundingBox();
|
|
14597
14537
|
const s = n.boundingBox ?? new Y(new h(0, 0, 0), new h(1, 1, 1)), o = this.materialFactory.createSurfaceMaterial({
|
|
14598
14538
|
color: e.instance.style.fillColor ?? e.instance.style.color ?? "#7ffcff",
|
|
@@ -14615,7 +14555,7 @@ class al {
|
|
|
14615
14555
|
}
|
|
14616
14556
|
/** 拉伸体支持围栏类视觉效果,并记录法线供面板挂到顶部。 */
|
|
14617
14557
|
buildExtrudePolygon(e) {
|
|
14618
|
-
const t =
|
|
14558
|
+
const t = Ji(e.instance.points), i = Qi(t.localPoints), n = e.instance.style.volume?.height ?? 10, s = new cn(i, {
|
|
14619
14559
|
depth: n,
|
|
14620
14560
|
bevelEnabled: !1,
|
|
14621
14561
|
steps: 1,
|
|
@@ -14698,7 +14638,7 @@ class al {
|
|
|
14698
14638
|
return o.renderOrder = 998, o;
|
|
14699
14639
|
}
|
|
14700
14640
|
}
|
|
14701
|
-
class
|
|
14641
|
+
class al {
|
|
14702
14642
|
constructor(e) {
|
|
14703
14643
|
this.engine = e;
|
|
14704
14644
|
}
|
|
@@ -14743,7 +14683,7 @@ class ll {
|
|
|
14743
14683
|
t.scale.set(o, o, 1);
|
|
14744
14684
|
}
|
|
14745
14685
|
}
|
|
14746
|
-
class
|
|
14686
|
+
class ll {
|
|
14747
14687
|
constructor(e) {
|
|
14748
14688
|
this.engine = e;
|
|
14749
14689
|
}
|
|
@@ -14934,7 +14874,7 @@ const Qe = {
|
|
|
14934
14874
|
showBottom: !1,
|
|
14935
14875
|
edgeColor: "#d9ffff"
|
|
14936
14876
|
}
|
|
14937
|
-
},
|
|
14877
|
+
}, cl = {
|
|
14938
14878
|
background: "rgba(10, 18, 28, 0.92)",
|
|
14939
14879
|
color: "#ffffff",
|
|
14940
14880
|
border: "1px solid rgba(127, 252, 255, 0.72)",
|
|
@@ -14943,8 +14883,8 @@ const Qe = {
|
|
|
14943
14883
|
boxShadow: "0 10px 30px rgba(0, 0, 0, 0.32)",
|
|
14944
14884
|
minWidth: "120px",
|
|
14945
14885
|
pointerEvents: "auto"
|
|
14946
|
-
},
|
|
14947
|
-
class
|
|
14886
|
+
}, hl = "bim-engine-annotation3d-panels";
|
|
14887
|
+
class ul {
|
|
14948
14888
|
/** 新增或恢复数据前先做标准化,保证后续模块只处理完整结构。 */
|
|
14949
14889
|
normalizeData(e) {
|
|
14950
14890
|
return {
|
|
@@ -15089,7 +15029,7 @@ class dl {
|
|
|
15089
15029
|
screenOffset: { ...e.screenOffset ?? {} },
|
|
15090
15030
|
className: e.className,
|
|
15091
15031
|
style: {
|
|
15092
|
-
...
|
|
15032
|
+
...cl,
|
|
15093
15033
|
...e.style ?? {}
|
|
15094
15034
|
},
|
|
15095
15035
|
interactive: e.interactive ?? !0,
|
|
@@ -15098,7 +15038,7 @@ class dl {
|
|
|
15098
15038
|
};
|
|
15099
15039
|
}
|
|
15100
15040
|
}
|
|
15101
|
-
function
|
|
15041
|
+
function dl(a, e, t) {
|
|
15102
15042
|
const i = a.camera;
|
|
15103
15043
|
if (!i)
|
|
15104
15044
|
return !1;
|
|
@@ -15111,9 +15051,9 @@ function pl(a, e, t) {
|
|
|
15111
15051
|
const r = o.sort((l, c) => l.distance - c.distance)[0];
|
|
15112
15052
|
return !!(r && r.distance < s - 0.05);
|
|
15113
15053
|
}
|
|
15114
|
-
class
|
|
15054
|
+
class pl {
|
|
15115
15055
|
constructor(e, t) {
|
|
15116
|
-
this.engine = e, this.isAnchorOccluded = t, this.container = document.createElement("div"), this.container.className =
|
|
15056
|
+
this.engine = e, this.isAnchorOccluded = t, this.container = document.createElement("div"), this.container.className = hl, this.container.style.cssText = [
|
|
15117
15057
|
"position:absolute",
|
|
15118
15058
|
"left:0",
|
|
15119
15059
|
"top:0",
|
|
@@ -15141,7 +15081,7 @@ class ml {
|
|
|
15141
15081
|
"display:none",
|
|
15142
15082
|
t.interactive === !1 ? "pointer-events:none" : "pointer-events:auto"
|
|
15143
15083
|
].join(";"), t.mode === "html" ? i.innerHTML = t.html ?? "" : i.textContent = t.text ?? "", Object.entries(t.style ?? {}).forEach(([n, s]) => {
|
|
15144
|
-
i.style.setProperty(
|
|
15084
|
+
i.style.setProperty(sl(n), s);
|
|
15145
15085
|
}), i;
|
|
15146
15086
|
}
|
|
15147
15087
|
/** 根据标记状态刷新面板位置、遮挡逻辑和显示方式。 */
|
|
@@ -15176,7 +15116,7 @@ class ml {
|
|
|
15176
15116
|
}
|
|
15177
15117
|
/** 不同几何类型的面板锚点算法不同,这里统一做收口。 */
|
|
15178
15118
|
getPanelAnchorPoint(e) {
|
|
15179
|
-
const t = e.instance.panel?.anchor ??
|
|
15119
|
+
const t = e.instance.panel?.anchor ?? ol(e.instance.type), i = e.instance.panel?.offset ?? {};
|
|
15180
15120
|
let n = new h();
|
|
15181
15121
|
if (e.instance.type === "point")
|
|
15182
15122
|
n.copy(ye(e.instance.points[0])), t === "top" && (n.y += e.volumeHeight ?? e.instance.style.point?.anchorY ?? 0);
|
|
@@ -15193,7 +15133,7 @@ class ml {
|
|
|
15193
15133
|
return n.add(new h(i.x ?? 0, i.y ?? 0, i.z ?? 0)), n;
|
|
15194
15134
|
}
|
|
15195
15135
|
}
|
|
15196
|
-
class
|
|
15136
|
+
class ml {
|
|
15197
15137
|
engine;
|
|
15198
15138
|
rootGroup;
|
|
15199
15139
|
records;
|
|
@@ -15308,11 +15248,11 @@ class gl {
|
|
|
15308
15248
|
};
|
|
15309
15249
|
}
|
|
15310
15250
|
}
|
|
15311
|
-
function
|
|
15251
|
+
function gl(a) {
|
|
15312
15252
|
const { actions: e, ...t } = a;
|
|
15313
15253
|
return t;
|
|
15314
15254
|
}
|
|
15315
|
-
function
|
|
15255
|
+
function fl(a) {
|
|
15316
15256
|
return {
|
|
15317
15257
|
id: a.instance.id,
|
|
15318
15258
|
type: a.instance.type,
|
|
@@ -15328,13 +15268,13 @@ function yl(a) {
|
|
|
15328
15268
|
function yt(a) {
|
|
15329
15269
|
return a === void 0 ? a : JSON.parse(JSON.stringify(a));
|
|
15330
15270
|
}
|
|
15331
|
-
class
|
|
15271
|
+
class yl {
|
|
15332
15272
|
engine;
|
|
15333
15273
|
rootGroup;
|
|
15334
15274
|
records = /* @__PURE__ */ new Map();
|
|
15335
15275
|
textureLoader = new st();
|
|
15336
15276
|
occlusionRaycaster = new he();
|
|
15337
|
-
normalizer = new
|
|
15277
|
+
normalizer = new ul();
|
|
15338
15278
|
materialFactory;
|
|
15339
15279
|
geometryBuilder;
|
|
15340
15280
|
effectsController;
|
|
@@ -15343,10 +15283,10 @@ class vl {
|
|
|
15343
15283
|
currentTime = 0;
|
|
15344
15284
|
/** 初始化标记根节点、DOM 面板层以及交互控制器。 */
|
|
15345
15285
|
constructor(e) {
|
|
15346
|
-
this.engine = e, this.rootGroup = new ce(), this.rootGroup.name = "Annotation3dRoot", this.engine.scene.add(this.rootGroup), this.materialFactory = new
|
|
15286
|
+
this.engine = e, this.rootGroup = new ce(), this.rootGroup.name = "Annotation3dRoot", this.engine.scene.add(this.rootGroup), this.materialFactory = new ll(this.engine), this.geometryBuilder = new rl(this.engine, this.textureLoader, this.materialFactory), this.effectsController = new al(this.engine), this.panelLayer = new pl(
|
|
15347
15287
|
this.engine,
|
|
15348
|
-
(t) =>
|
|
15349
|
-
), this.interaction = new
|
|
15288
|
+
(t) => dl(this.engine, this.occlusionRaycaster, t)
|
|
15289
|
+
), this.interaction = new ml({
|
|
15350
15290
|
engine: this.engine,
|
|
15351
15291
|
rootGroup: this.rootGroup,
|
|
15352
15292
|
records: this.records,
|
|
@@ -15445,7 +15385,7 @@ class vl {
|
|
|
15445
15385
|
}
|
|
15446
15386
|
/** 导出纯数据快照,供保存和恢复。 */
|
|
15447
15387
|
getData() {
|
|
15448
|
-
return Array.from(this.records.values()).map((e) =>
|
|
15388
|
+
return Array.from(this.records.values()).map((e) => fl(e));
|
|
15449
15389
|
}
|
|
15450
15390
|
/** 从纯数据快照恢复整套标记。 */
|
|
15451
15391
|
restoreData(e) {
|
|
@@ -15473,7 +15413,7 @@ class vl {
|
|
|
15473
15413
|
selectable: e.selectable ?? !0,
|
|
15474
15414
|
style: e.style,
|
|
15475
15415
|
effect: e.effect ?? {},
|
|
15476
|
-
panel: e.panel ?
|
|
15416
|
+
panel: e.panel ? gl(e.panel) : void 0,
|
|
15477
15417
|
data: e.data,
|
|
15478
15418
|
panelVisible: e.panel?.trigger === "always",
|
|
15479
15419
|
hovered: !1,
|
|
@@ -15488,7 +15428,7 @@ class vl {
|
|
|
15488
15428
|
baseRingMeshes: [],
|
|
15489
15429
|
animatedMaterials: []
|
|
15490
15430
|
};
|
|
15491
|
-
return this.geometryBuilder.build(n),
|
|
15431
|
+
return this.geometryBuilder.build(n), il(t, i.id), n;
|
|
15492
15432
|
}
|
|
15493
15433
|
/** 新记录统一走同一挂载流程,减少 add / update 重复代码。 */
|
|
15494
15434
|
attachRecord(e) {
|
|
@@ -15497,7 +15437,7 @@ class vl {
|
|
|
15497
15437
|
/** 内部删除会负责资源回收和 hover 状态清理。 */
|
|
15498
15438
|
removeInternal(e, t) {
|
|
15499
15439
|
const i = this.records.get(e);
|
|
15500
|
-
return i ? (this.interaction.handleRecordRemoved(e),
|
|
15440
|
+
return i ? (this.interaction.handleRecordRemoved(e), nl(i.instance.root), i.instance.root.removeFromParent(), i.panelElement?.remove(), this.records.delete(e), t && this.emit("annotation3d-removed", { id: e }), !0) : !1;
|
|
15501
15441
|
}
|
|
15502
15442
|
/** 标记显隐变化时,同时同步渲染顺序和面板显示。 */
|
|
15503
15443
|
applyVisibility(e) {
|
|
@@ -15518,7 +15458,7 @@ class vl {
|
|
|
15518
15458
|
this.engine.events?.trigger?.(e, t);
|
|
15519
15459
|
}
|
|
15520
15460
|
}
|
|
15521
|
-
class
|
|
15461
|
+
class vl {
|
|
15522
15462
|
constructor(e) {
|
|
15523
15463
|
this.engine = e;
|
|
15524
15464
|
}
|
|
@@ -15550,9 +15490,9 @@ class Ml {
|
|
|
15550
15490
|
if (o.lengthSq() < 1e-10 || r.lengthSq() < 1e-10)
|
|
15551
15491
|
throw new Error("[Calibration] source and target segments must have valid length");
|
|
15552
15492
|
o.normalize(), r.normalize();
|
|
15553
|
-
const l = new
|
|
15493
|
+
const l = new U().makeRotationFromQuaternion(
|
|
15554
15494
|
new De().setFromUnitVectors(o, r)
|
|
15555
|
-
), c = new
|
|
15495
|
+
), c = new U().makeTranslation(n.x, n.y, n.z).multiply(l).multiply(new U().makeTranslation(-t.x, -t.y, -t.z)), u = this.getMatrix(e.url);
|
|
15556
15496
|
return this.apply({
|
|
15557
15497
|
url: e.url,
|
|
15558
15498
|
matrix: c.multiply(u)
|
|
@@ -15566,14 +15506,14 @@ class Ml {
|
|
|
15566
15506
|
if (t != null)
|
|
15567
15507
|
return t.clone();
|
|
15568
15508
|
const i = Oe(this.engine, e);
|
|
15569
|
-
return i == null ? new
|
|
15509
|
+
return i == null ? new U() : i.matrix.clone();
|
|
15570
15510
|
}
|
|
15571
15511
|
/**
|
|
15572
15512
|
* 清除指定模型的校准。
|
|
15573
15513
|
*/
|
|
15574
15514
|
clear(e) {
|
|
15575
15515
|
const t = Oe(this.engine, e);
|
|
15576
|
-
return t == null ? !1 : (t.matrixAutoUpdate = !1, t.matrix.identity(), t.matrixWorldNeedsUpdate = !0, t.updateMatrixWorld(!0), this.clearRuntimeWorldBoxCache(t), this.matrices.delete(e), this.updateCachedModelBox(e, t), this.engine.modelEdge?.setModelEdgeTransform?.(e, new
|
|
15516
|
+
return t == null ? !1 : (t.matrixAutoUpdate = !1, t.matrix.identity(), t.matrixWorldNeedsUpdate = !0, t.updateMatrixWorld(!0), this.clearRuntimeWorldBoxCache(t), this.matrices.delete(e), this.updateCachedModelBox(e, t), this.engine.modelEdge?.setModelEdgeTransform?.(e, new U()), !0);
|
|
15577
15517
|
}
|
|
15578
15518
|
updateCachedModelBox(e, t) {
|
|
15579
15519
|
const i = this.engine.models?.find?.((s) => s.url === e);
|
|
@@ -15598,13 +15538,13 @@ class Ml {
|
|
|
15598
15538
|
});
|
|
15599
15539
|
}
|
|
15600
15540
|
toThreeMatrix(e) {
|
|
15601
|
-
if (e instanceof
|
|
15541
|
+
if (e instanceof U)
|
|
15602
15542
|
return e.clone();
|
|
15603
15543
|
if (Array.isArray(e) && Array.isArray(e[0])) {
|
|
15604
15544
|
const i = e;
|
|
15605
15545
|
if (i.length !== 4 || i.some((n) => !Array.isArray(n) || n.length !== 4))
|
|
15606
15546
|
throw new Error("[Calibration] matrix must be a 4x4 array");
|
|
15607
|
-
return new
|
|
15547
|
+
return new U().set(
|
|
15608
15548
|
i[0][0],
|
|
15609
15549
|
i[0][1],
|
|
15610
15550
|
i[0][2],
|
|
@@ -15626,7 +15566,7 @@ class Ml {
|
|
|
15626
15566
|
const t = Array.from(e);
|
|
15627
15567
|
if (t.length !== 16)
|
|
15628
15568
|
throw new Error("[Calibration] matrix must contain 16 numbers");
|
|
15629
|
-
return new
|
|
15569
|
+
return new U().fromArray(t);
|
|
15630
15570
|
}
|
|
15631
15571
|
toVector3(e) {
|
|
15632
15572
|
if (e instanceof h)
|
|
@@ -15639,7 +15579,7 @@ class Ml {
|
|
|
15639
15579
|
return "x" in e ? new h(e.x, e.y, e.z) : new h(e.X, e.Y, e.Z);
|
|
15640
15580
|
}
|
|
15641
15581
|
}
|
|
15642
|
-
class
|
|
15582
|
+
class Sl {
|
|
15643
15583
|
// 引擎参数
|
|
15644
15584
|
options;
|
|
15645
15585
|
deviceType;
|
|
@@ -15742,17 +15682,17 @@ class Pl {
|
|
|
15742
15682
|
// 引擎容器
|
|
15743
15683
|
container;
|
|
15744
15684
|
constructor(e) {
|
|
15745
|
-
if (window.THREE =
|
|
15685
|
+
if (window.THREE = en, ao(), this.options = e, this.container = document.getElementById(e.containerId), !this.container)
|
|
15746
15686
|
throw new Error(`Container ${e.containerId} not found`);
|
|
15747
|
-
if (this.engineModelModule = new
|
|
15687
|
+
if (this.engineModelModule = new Ir(this), this.engineModelModule.init(), this.deviceModule = new Ns(this), this.deviceType = this.deviceModule.getDeviceType(), this.cameraModule = new le(this), this.sceneModule = new Os(this), this.scene = this.sceneModule.scene, this.renderModule = new Hs(this), this.renderer = this.renderModule.createRenderer(), this.camera = this.cameraModule.orthographicCamera, this.scene.camera = this.camera, this.renderer) {
|
|
15748
15688
|
const o = this.renderer;
|
|
15749
15689
|
o.interactionCullingEnabled = !0, o.interactionActive = !1, o.interactionRenderScene = this.scene, o.interactionFrameBudgetMs = this.options.interactionFrameBudgetMs ?? 6, o.interactionSkipShadows = this.options.interactionSkipShadows ?? !0;
|
|
15750
15690
|
}
|
|
15751
|
-
this.controlModule = new
|
|
15691
|
+
this.controlModule = new Qs(this), this.controlModule.switchDefaultMode(), this.controls = this.controlModule.orbitControls, this.clipping = new va(this), this.clipping.init(), this.composerModule = new to(this), this.composerModule.init(), this.events = new or();
|
|
15752
15692
|
const t = this.events.trigger.bind(this.events);
|
|
15753
15693
|
this.events.trigger = ((o, r) => {
|
|
15754
15694
|
t(o, r), String(o) !== String(Se.EngineBusy) && this.requestComposerRender();
|
|
15755
|
-
}), this.engineStatus = new
|
|
15695
|
+
}), this.engineStatus = new sr(this), this.engineStatus.init(), this.loaderModule = new Ce(this), this.lightModule = new Er(this), this.lightModule.init(), this.viewCube = new Br(this), this.viewCube.init(), this.options.showViewCube == !1 && this.viewCube.hide(), this.octreeBox = Rr(this), this.rangeScale = new Fr(this), this.rangeScale.init(), this.setting = new sa(this), this.engineModelModule.init(), this.handelBehaved = mi(this), this.modelMapperBatch = new Ea(this), this.measure = new pa(this), this.modelToolModule = new Ar(this), this.modelLink3d = new Qa(this, this.options.linkOptions ?? {}), this.modelLink3d.init(), this.modelProperties = new xa(this), this.search = new Sa(this), this.interactionModule = new Pr(this), this.interactionModule.init(), this.interactionModule.active(), this.hoverHighLight = new Tt(this), this.modelEdge = new ia(this), this.modelTree = new Ma(this), this.viewTree = new ka(this), this.merge2d = new za(this), this.engineInfo = new wa(this), this.pathRoaming = new Pa(this), this.pathRoaming.init(), this.oneClickEncoding = new La(this), this.minMap = new Aa(this), this.linkElement2d3d = new Da(this), this.linkView2d3d = new Ia(this), this.grid = new Hr(this), this.level = new jr(this), this.issueReport = new _a(this), this.fabricDraw = new $a(this), this.drawingPin = new Za(this), this.label = new el(this), this.annotation3d = new yl(this), this.calibration = new vl(this), this.text = new Ta(this), this.hdr = new Gr(this), this.ground = new gi(this), this.ground.init(), this.skyManager = new na(this), this.setting.init(), this.worldToScreen = new oe(this.camera, this.renderer, this.scene), this.options.showStats && (this.stats = new Fs(), this.stats.showPanel(0), this.stats.dom.style.position = "absolute", this.stats.dom.style.top = "0px", this.stats.dom.style.left = "0px", this.stats.dom.style.zIndex = "1000", this.container.appendChild(this.stats.dom));
|
|
15756
15696
|
let i = document.createElement("div");
|
|
15757
15697
|
i.className = "versionText", this.versionEl = i, this.updateVersionDisplay(), this.container.appendChild(i);
|
|
15758
15698
|
let n = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
@@ -16005,7 +15945,7 @@ class Pl {
|
|
|
16005
15945
|
}), e.background = null, e.environment = null, e.overrideMaterial = null, e.dirLight = null, e.camera = null;
|
|
16006
15946
|
}
|
|
16007
15947
|
disposeSceneAttachment(e) {
|
|
16008
|
-
e && (e instanceof As || e instanceof
|
|
15948
|
+
e && (e instanceof As || e instanceof xi) && e.dispose?.();
|
|
16009
15949
|
}
|
|
16010
15950
|
disposeMaterial(e) {
|
|
16011
15951
|
if (!e) return;
|
|
@@ -16036,10 +15976,10 @@ class Pl {
|
|
|
16036
15976
|
"iridescenceThicknessMap"
|
|
16037
15977
|
].forEach((i) => {
|
|
16038
15978
|
const n = e[i];
|
|
16039
|
-
n && n instanceof
|
|
15979
|
+
n && n instanceof xi && n.dispose();
|
|
16040
15980
|
}), e.dispose();
|
|
16041
15981
|
}
|
|
16042
15982
|
}
|
|
16043
15983
|
export {
|
|
16044
|
-
|
|
15984
|
+
Sl as E
|
|
16045
15985
|
};
|