@babylonjs/viewer 7.41.0 → 7.41.1-alpha
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/assets/photoStudio.env +0 -0
- package/dist/babylon-viewer.esm.js +2 -0
- package/dist/babylon-viewer.esm.js.map +1 -0
- package/dist/babylon-viewer.esm.min.js +2 -0
- package/dist/babylon-viewer.esm.min.js.map +1 -0
- package/dist/chunks/EXT_lights_ies-BS2USlck.esm.min.js +2 -0
- package/dist/chunks/EXT_lights_ies-BS2USlck.esm.min.js.map +1 -0
- package/dist/chunks/EXT_lights_ies-C-joQ5O4.esm.js +84 -0
- package/dist/chunks/EXT_lights_ies-C-joQ5O4.esm.js.map +1 -0
- package/dist/chunks/EXT_lights_image_based-C3wbbb5Z.esm.js +171 -0
- package/dist/chunks/EXT_lights_image_based-C3wbbb5Z.esm.js.map +1 -0
- package/dist/chunks/EXT_lights_image_based-DDdRDnM2.esm.min.js +2 -0
- package/dist/chunks/EXT_lights_image_based-DDdRDnM2.esm.min.js.map +1 -0
- package/dist/chunks/EXT_mesh_gpu_instancing-AXAnRQN7.esm.js +86 -0
- package/dist/chunks/EXT_mesh_gpu_instancing-AXAnRQN7.esm.js.map +1 -0
- package/dist/chunks/EXT_mesh_gpu_instancing-BcjPo6uC.esm.min.js +2 -0
- package/dist/chunks/EXT_mesh_gpu_instancing-BcjPo6uC.esm.min.js.map +1 -0
- package/dist/chunks/EXT_meshopt_compression-DlUkQB2P.esm.js +134 -0
- package/dist/chunks/EXT_meshopt_compression-DlUkQB2P.esm.js.map +1 -0
- package/dist/chunks/EXT_meshopt_compression-yJ4OpORd.esm.min.js +2 -0
- package/dist/chunks/EXT_meshopt_compression-yJ4OpORd.esm.min.js.map +1 -0
- package/dist/chunks/EXT_texture_avif-BQWbvJfK.esm.min.js +2 -0
- package/dist/chunks/EXT_texture_avif-BQWbvJfK.esm.min.js.map +1 -0
- package/dist/chunks/EXT_texture_avif-C0pGpnGv.esm.js +44 -0
- package/dist/chunks/EXT_texture_avif-C0pGpnGv.esm.js.map +1 -0
- package/dist/chunks/EXT_texture_webp-Dd7Uqtmh.esm.min.js +2 -0
- package/dist/chunks/EXT_texture_webp-Dd7Uqtmh.esm.min.js.map +1 -0
- package/dist/chunks/EXT_texture_webp-DehlrnW-.esm.js +43 -0
- package/dist/chunks/EXT_texture_webp-DehlrnW-.esm.js.map +1 -0
- package/dist/chunks/ExtrasAsMetadata-C5NMuDj4.esm.js +64 -0
- package/dist/chunks/ExtrasAsMetadata-C5NMuDj4.esm.js.map +1 -0
- package/dist/chunks/ExtrasAsMetadata-Cp3LHdoG.esm.min.js +2 -0
- package/dist/chunks/ExtrasAsMetadata-Cp3LHdoG.esm.min.js.map +1 -0
- package/dist/chunks/KHR_animation_pointer-DEBOwDXh.esm.min.js +2 -0
- package/dist/chunks/KHR_animation_pointer-DEBOwDXh.esm.min.js.map +1 -0
- package/dist/chunks/KHR_animation_pointer-Dx1OeG2b.esm.js +352 -0
- package/dist/chunks/KHR_animation_pointer-Dx1OeG2b.esm.js.map +1 -0
- package/dist/chunks/KHR_draco_mesh_compression-Ch0QOlBL.esm.min.js +2 -0
- package/dist/chunks/KHR_draco_mesh_compression-Ch0QOlBL.esm.min.js.map +1 -0
- package/dist/chunks/KHR_draco_mesh_compression-D59SFLyo.esm.js +610 -0
- package/dist/chunks/KHR_draco_mesh_compression-D59SFLyo.esm.js.map +1 -0
- package/dist/chunks/KHR_interactivity-Blj_9jts.esm.min.js +2 -0
- package/dist/chunks/KHR_interactivity-Blj_9jts.esm.min.js.map +1 -0
- package/dist/chunks/KHR_interactivity-CR0LYUa7.esm.js +4033 -0
- package/dist/chunks/KHR_interactivity-CR0LYUa7.esm.js.map +1 -0
- package/dist/chunks/KHR_lights_punctual--w0a62AP.esm.js +581 -0
- package/dist/chunks/KHR_lights_punctual--w0a62AP.esm.js.map +1 -0
- package/dist/chunks/KHR_lights_punctual-BojffBbG.esm.min.js +2 -0
- package/dist/chunks/KHR_lights_punctual-BojffBbG.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_anisotropy-BPtHWkOQ.esm.js +65 -0
- package/dist/chunks/KHR_materials_anisotropy-BPtHWkOQ.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_anisotropy-DU5_bnCL.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_anisotropy-DU5_bnCL.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_clearcoat-BBuRlPhc.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_clearcoat-BBuRlPhc.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_clearcoat-Eg0xbuWN.esm.js +96 -0
- package/dist/chunks/KHR_materials_clearcoat-Eg0xbuWN.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_diffuse_transmission-Bkzk60Y5.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_diffuse_transmission-Bkzk60Y5.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_diffuse_transmission-C3DaLgRY.esm.js +97 -0
- package/dist/chunks/KHR_materials_diffuse_transmission-C3DaLgRY.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_dispersion-DL_XFhxj.esm.js +62 -0
- package/dist/chunks/KHR_materials_dispersion-DL_XFhxj.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_dispersion-DbMQPBgM.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_dispersion-DbMQPBgM.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_emissive_strength-BuHyjtBD.esm.js +55 -0
- package/dist/chunks/KHR_materials_emissive_strength-BuHyjtBD.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_emissive_strength-Djlr_ul3.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_emissive_strength-Djlr_ul3.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_ior-BIe6qBOo.esm.js +64 -0
- package/dist/chunks/KHR_materials_ior-BIe6qBOo.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_ior-DOfaAmNY.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_ior-DOfaAmNY.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_iridescence-BgElZgUu.esm.js +72 -0
- package/dist/chunks/KHR_materials_iridescence-BgElZgUu.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_iridescence-lUeo07SZ.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_iridescence-lUeo07SZ.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-9ShQyhJ6.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-9ShQyhJ6.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DE5LjLg6.esm.js +81 -0
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DE5LjLg6.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_sheen-BfZe6ZFu.esm.js +85 -0
- package/dist/chunks/KHR_materials_sheen-BfZe6ZFu.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_sheen-OWjuK2V4.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_sheen-OWjuK2V4.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_specular-dowPxbW3.esm.js +75 -0
- package/dist/chunks/KHR_materials_specular-dowPxbW3.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_specular-nWeBZu0R.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_specular-nWeBZu0R.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_transmission-BPNQkK0O.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_transmission-BPNQkK0O.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_transmission-CHr_yLLX.esm.js +307 -0
- package/dist/chunks/KHR_materials_transmission-CHr_yLLX.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_unlit-BYXpcsdj.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_unlit-BYXpcsdj.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_unlit-Cr7YsDHT.esm.js +74 -0
- package/dist/chunks/KHR_materials_unlit-Cr7YsDHT.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_variants-BCVX3sJa.esm.js +262 -0
- package/dist/chunks/KHR_materials_variants-BCVX3sJa.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_variants-BXzl6KpJ.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_variants-BXzl6KpJ.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_volume-BD9KEaJz.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_volume-BD9KEaJz.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_volume-DrqGUGW6.esm.js +87 -0
- package/dist/chunks/KHR_materials_volume-DrqGUGW6.esm.js.map +1 -0
- package/dist/chunks/KHR_mesh_quantization-Dg22auJA.esm.min.js +2 -0
- package/dist/chunks/KHR_mesh_quantization-Dg22auJA.esm.min.js.map +1 -0
- package/dist/chunks/KHR_mesh_quantization-hvxpvTbe.esm.js +26 -0
- package/dist/chunks/KHR_mesh_quantization-hvxpvTbe.esm.js.map +1 -0
- package/dist/chunks/KHR_node_hoverability-BDiqFmBB.esm.js +39 -0
- package/dist/chunks/KHR_node_hoverability-BDiqFmBB.esm.js.map +1 -0
- package/dist/chunks/KHR_node_hoverability-CumkOtZM.esm.min.js +2 -0
- package/dist/chunks/KHR_node_hoverability-CumkOtZM.esm.min.js.map +1 -0
- package/dist/chunks/KHR_node_visibility-BKEa-Yfj.esm.min.js +2 -0
- package/dist/chunks/KHR_node_visibility-BKEa-Yfj.esm.min.js.map +1 -0
- package/dist/chunks/KHR_node_visibility-K0fsD4Vv.esm.js +46 -0
- package/dist/chunks/KHR_node_visibility-K0fsD4Vv.esm.js.map +1 -0
- package/dist/chunks/KHR_texture_basisu-8YVY1pKo.esm.js +43 -0
- package/dist/chunks/KHR_texture_basisu-8YVY1pKo.esm.js.map +1 -0
- package/dist/chunks/KHR_texture_basisu-BM__NeSW.esm.min.js +2 -0
- package/dist/chunks/KHR_texture_basisu-BM__NeSW.esm.min.js.map +1 -0
- package/dist/chunks/KHR_texture_transform--qxpdvRw.esm.js +63 -0
- package/dist/chunks/KHR_texture_transform--qxpdvRw.esm.js.map +1 -0
- package/dist/chunks/KHR_texture_transform-C0MO-oJp.esm.min.js +2 -0
- package/dist/chunks/KHR_texture_transform-C0MO-oJp.esm.min.js.map +1 -0
- package/dist/chunks/KHR_xmp_json_ld-D9FpHvJo.esm.js +51 -0
- package/dist/chunks/KHR_xmp_json_ld-D9FpHvJo.esm.js.map +1 -0
- package/dist/chunks/KHR_xmp_json_ld-DeXPWWQE.esm.min.js +2 -0
- package/dist/chunks/KHR_xmp_json_ld-DeXPWWQE.esm.min.js.map +1 -0
- package/dist/chunks/MSFT_audio_emitter-BbICSwFH.esm.min.js +2 -0
- package/dist/chunks/MSFT_audio_emitter-BbICSwFH.esm.min.js.map +1 -0
- package/dist/chunks/MSFT_audio_emitter-Dd5lbfUc.esm.js +2201 -0
- package/dist/chunks/MSFT_audio_emitter-Dd5lbfUc.esm.js.map +1 -0
- package/dist/chunks/MSFT_lod-B0zrRF3s.esm.js +337 -0
- package/dist/chunks/MSFT_lod-B0zrRF3s.esm.js.map +1 -0
- package/dist/chunks/MSFT_lod-Bd4znUfD.esm.min.js +2 -0
- package/dist/chunks/MSFT_lod-Bd4znUfD.esm.min.js.map +1 -0
- package/dist/chunks/MSFT_minecraftMesh-CdIpMgsb.esm.min.js +2 -0
- package/dist/chunks/MSFT_minecraftMesh-CdIpMgsb.esm.min.js.map +1 -0
- package/dist/chunks/MSFT_minecraftMesh-WFc8m_Ka.esm.js +46 -0
- package/dist/chunks/MSFT_minecraftMesh-WFc8m_Ka.esm.js.map +1 -0
- package/dist/chunks/MSFT_sRGBFactors-CTbtGna8.esm.js +47 -0
- package/dist/chunks/MSFT_sRGBFactors-CTbtGna8.esm.js.map +1 -0
- package/dist/chunks/MSFT_sRGBFactors-yTSoBQJx.esm.min.js +2 -0
- package/dist/chunks/MSFT_sRGBFactors-yTSoBQJx.esm.min.js.map +1 -0
- package/dist/chunks/animationGroup-8TJDgymS.esm.js +2482 -0
- package/dist/chunks/animationGroup-8TJDgymS.esm.js.map +1 -0
- package/dist/chunks/animationGroup-toXtd3a1.esm.min.js +2 -0
- package/dist/chunks/animationGroup-toXtd3a1.esm.min.js.map +1 -0
- package/dist/chunks/assetContainer-7pMDUaac.esm.min.js +2 -0
- package/dist/chunks/assetContainer-7pMDUaac.esm.min.js.map +1 -0
- package/dist/chunks/assetContainer-DYzO0AbX.esm.js +1720 -0
- package/dist/chunks/assetContainer-DYzO0AbX.esm.js.map +1 -0
- package/dist/chunks/audioEngine-Kz4HSEXd.esm.min.js +2 -0
- package/dist/chunks/audioEngine-Kz4HSEXd.esm.min.js.map +1 -0
- package/dist/chunks/audioEngine-peiGqjr6.esm.js +305 -0
- package/dist/chunks/audioEngine-peiGqjr6.esm.js.map +1 -0
- package/dist/chunks/bakedVertexAnimation-BZvcL01J.esm.min.js +2 -0
- package/dist/chunks/bakedVertexAnimation-BZvcL01J.esm.min.js.map +1 -0
- package/dist/chunks/bakedVertexAnimation-CPflSjER.esm.js +114 -0
- package/dist/chunks/bakedVertexAnimation-CPflSjER.esm.js.map +1 -0
- package/dist/chunks/basisTextureLoader-CR0XhSAg.esm.js +600 -0
- package/dist/chunks/basisTextureLoader-CR0XhSAg.esm.js.map +1 -0
- package/dist/chunks/basisTextureLoader-DVJdcB62.esm.min.js +2 -0
- package/dist/chunks/basisTextureLoader-DVJdcB62.esm.min.js.map +1 -0
- package/dist/chunks/dds-6EdM5O6M.esm.js +540 -0
- package/dist/chunks/dds-6EdM5O6M.esm.js.map +1 -0
- package/dist/chunks/dds-DVX_K9B3.esm.min.js +2 -0
- package/dist/chunks/dds-DVX_K9B3.esm.min.js.map +1 -0
- package/dist/chunks/ddsTextureLoader-BAK7Ib2Z.esm.min.js +2 -0
- package/dist/chunks/ddsTextureLoader-BAK7Ib2Z.esm.min.js.map +1 -0
- package/dist/chunks/ddsTextureLoader-_nktVxwZ.esm.js +88 -0
- package/dist/chunks/ddsTextureLoader-_nktVxwZ.esm.js.map +1 -0
- package/dist/chunks/decalFragment-C_Cews3-.esm.js +18 -0
- package/dist/chunks/decalFragment-C_Cews3-.esm.js.map +1 -0
- package/dist/chunks/decalFragment-Dmj88EX9.esm.min.js +2 -0
- package/dist/chunks/decalFragment-Dmj88EX9.esm.min.js.map +1 -0
- package/dist/chunks/default.fragment-Bv_nR7po.esm.min.js +2 -0
- package/dist/chunks/default.fragment-Bv_nR7po.esm.min.js.map +1 -0
- package/dist/chunks/default.fragment-CkZQyJVM.esm.min.js +2 -0
- package/dist/chunks/default.fragment-CkZQyJVM.esm.min.js.map +1 -0
- package/dist/chunks/default.fragment-CyFHDykY.esm.js +446 -0
- package/dist/chunks/default.fragment-CyFHDykY.esm.js.map +1 -0
- package/dist/chunks/default.fragment-ej-2z5tS.esm.js +515 -0
- package/dist/chunks/default.fragment-ej-2z5tS.esm.js.map +1 -0
- package/dist/chunks/default.vertex-16mVOFgT.esm.js +211 -0
- package/dist/chunks/default.vertex-16mVOFgT.esm.js.map +1 -0
- package/dist/chunks/default.vertex-D--q2At3.esm.min.js +2 -0
- package/dist/chunks/default.vertex-D--q2At3.esm.min.js.map +1 -0
- package/dist/chunks/default.vertex-DDlgZTrR.esm.js +190 -0
- package/dist/chunks/default.vertex-DDlgZTrR.esm.js.map +1 -0
- package/dist/chunks/default.vertex-_jqs3KiZ.esm.min.js +2 -0
- package/dist/chunks/default.vertex-_jqs3KiZ.esm.min.js.map +1 -0
- package/dist/chunks/defaultUboDeclaration-8YG0iNg8.esm.js +15 -0
- package/dist/chunks/defaultUboDeclaration-8YG0iNg8.esm.js.map +1 -0
- package/dist/chunks/defaultUboDeclaration-BoBSRTbi.esm.js +13 -0
- package/dist/chunks/defaultUboDeclaration-BoBSRTbi.esm.js.map +1 -0
- package/dist/chunks/defaultUboDeclaration-Dt_5vo1d.esm.min.js +2 -0
- package/dist/chunks/defaultUboDeclaration-Dt_5vo1d.esm.min.js.map +1 -0
- package/dist/chunks/defaultUboDeclaration-R6gGjkAM.esm.min.js +2 -0
- package/dist/chunks/defaultUboDeclaration-R6gGjkAM.esm.min.js.map +1 -0
- package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js +11 -0
- package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js.map +1 -0
- package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js +2 -0
- package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js.map +1 -0
- package/dist/chunks/dumpTools-Bhux0wvM.esm.js +200 -0
- package/dist/chunks/dumpTools-Bhux0wvM.esm.js.map +1 -0
- package/dist/chunks/dumpTools-CHCb2UkY.esm.min.js +2 -0
- package/dist/chunks/dumpTools-CHCb2UkY.esm.min.js.map +1 -0
- package/dist/chunks/engine-DF_zE4qj.esm.js +2213 -0
- package/dist/chunks/engine-DF_zE4qj.esm.js.map +1 -0
- package/dist/chunks/engine-DVmdDcyP.esm.min.js +2 -0
- package/dist/chunks/engine-DVmdDcyP.esm.min.js.map +1 -0
- package/dist/chunks/engine.common-CvOmoKru.esm.js +1162 -0
- package/dist/chunks/engine.common-CvOmoKru.esm.js.map +1 -0
- package/dist/chunks/engine.common-DpTzktQJ.esm.min.js +2 -0
- package/dist/chunks/engine.common-DpTzktQJ.esm.min.js.map +1 -0
- package/dist/chunks/envTextureLoader-4YxGm-Px.esm.js +64 -0
- package/dist/chunks/envTextureLoader-4YxGm-Px.esm.js.map +1 -0
- package/dist/chunks/envTextureLoader-DMQui088.esm.min.js +2 -0
- package/dist/chunks/envTextureLoader-DMQui088.esm.min.js.map +1 -0
- package/dist/chunks/environmentTextureTools-BPGrTBPI.esm.min.js +2 -0
- package/dist/chunks/environmentTextureTools-BPGrTBPI.esm.min.js.map +1 -0
- package/dist/chunks/environmentTextureTools-DvkpsqkN.esm.js +382 -0
- package/dist/chunks/environmentTextureTools-DvkpsqkN.esm.js.map +1 -0
- package/dist/chunks/exrTextureLoader-BRkB54sO.esm.js +1683 -0
- package/dist/chunks/exrTextureLoader-BRkB54sO.esm.js.map +1 -0
- package/dist/chunks/exrTextureLoader-BtN7_zst.esm.min.js +2 -0
- package/dist/chunks/exrTextureLoader-BtN7_zst.esm.min.js.map +1 -0
- package/dist/chunks/fogFragment-BrGGFaiu.esm.js +101 -0
- package/dist/chunks/fogFragment-BrGGFaiu.esm.js.map +1 -0
- package/dist/chunks/fogFragment-ByOwwQur.esm.min.js +2 -0
- package/dist/chunks/fogFragment-ByOwwQur.esm.min.js.map +1 -0
- package/dist/chunks/fogFragment-Chod24nu.esm.min.js +2 -0
- package/dist/chunks/fogFragment-Chod24nu.esm.min.js.map +1 -0
- package/dist/chunks/fogFragment-gZfybCpt.esm.js +102 -0
- package/dist/chunks/fogFragment-gZfybCpt.esm.js.map +1 -0
- package/dist/chunks/fresnelFunction-BdEia8ob.esm.min.js +2 -0
- package/dist/chunks/fresnelFunction-BdEia8ob.esm.min.js.map +1 -0
- package/dist/chunks/fresnelFunction-DBlxfmri.esm.js +12 -0
- package/dist/chunks/fresnelFunction-DBlxfmri.esm.js.map +1 -0
- package/dist/chunks/glTFLoader-D4C1IGb3.esm.min.js +2 -0
- package/dist/chunks/glTFLoader-D4C1IGb3.esm.min.js.map +1 -0
- package/dist/chunks/glTFLoader-fUFiWvYb.esm.js +7693 -0
- package/dist/chunks/glTFLoader-fUFiWvYb.esm.js.map +1 -0
- package/dist/chunks/glTFLoaderAnimation-BB_Vw079.esm.min.js +2 -0
- package/dist/chunks/glTFLoaderAnimation-BB_Vw079.esm.min.js.map +1 -0
- package/dist/chunks/glTFLoaderAnimation-CttmY50U.esm.js +77 -0
- package/dist/chunks/glTFLoaderAnimation-CttmY50U.esm.js.map +1 -0
- package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js +2 -0
- package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js.map +1 -0
- package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js +67 -0
- package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js.map +1 -0
- package/dist/chunks/harmonicsFunctions-B0Rp1hEo.esm.min.js +2 -0
- package/dist/chunks/harmonicsFunctions-B0Rp1hEo.esm.min.js.map +1 -0
- package/dist/chunks/harmonicsFunctions-Cca_z552.esm.js +34 -0
- package/dist/chunks/harmonicsFunctions-Cca_z552.esm.js.map +1 -0
- package/dist/chunks/harmonicsFunctions-D4ID83NC.esm.min.js +2 -0
- package/dist/chunks/harmonicsFunctions-D4ID83NC.esm.min.js.map +1 -0
- package/dist/chunks/harmonicsFunctions-HJ5dbl0w.esm.js +35 -0
- package/dist/chunks/harmonicsFunctions-HJ5dbl0w.esm.js.map +1 -0
- package/dist/chunks/hdrTextureLoader-C3kqy6YV.esm.js +253 -0
- package/dist/chunks/hdrTextureLoader-C3kqy6YV.esm.js.map +1 -0
- package/dist/chunks/hdrTextureLoader-Dhlluz4z.esm.min.js +2 -0
- package/dist/chunks/hdrTextureLoader-Dhlluz4z.esm.min.js.map +1 -0
- package/dist/chunks/helperFunctions-BJotVqUd.esm.min.js +2 -0
- package/dist/chunks/helperFunctions-BJotVqUd.esm.min.js.map +1 -0
- package/dist/chunks/helperFunctions-C66wRWtu.esm.js +110 -0
- package/dist/chunks/helperFunctions-C66wRWtu.esm.js.map +1 -0
- package/dist/chunks/helperFunctions-DwEZ9rqh.esm.min.js +2 -0
- package/dist/chunks/helperFunctions-DwEZ9rqh.esm.min.js.map +1 -0
- package/dist/chunks/helperFunctions-gnki_9Kj.esm.js +83 -0
- package/dist/chunks/helperFunctions-gnki_9Kj.esm.js.map +1 -0
- package/dist/chunks/iesTextureLoader-QDs2Cwy5.esm.js +189 -0
- package/dist/chunks/iesTextureLoader-QDs2Cwy5.esm.js.map +1 -0
- package/dist/chunks/iesTextureLoader-pwA6Q4HK.esm.min.js +2 -0
- package/dist/chunks/iesTextureLoader-pwA6Q4HK.esm.min.js.map +1 -0
- package/dist/chunks/index-C6hXZyZb.esm.js +74889 -0
- package/dist/chunks/index-C6hXZyZb.esm.js.map +1 -0
- package/dist/chunks/index-rZVkfTE6.esm.min.js +57 -0
- package/dist/chunks/index-rZVkfTE6.esm.min.js.map +1 -0
- package/dist/chunks/ktxTextureLoader-jVu-Sj-0.esm.js +814 -0
- package/dist/chunks/ktxTextureLoader-jVu-Sj-0.esm.js.map +1 -0
- package/dist/chunks/ktxTextureLoader-zG9azrZF.esm.min.js +2 -0
- package/dist/chunks/ktxTextureLoader-zG9azrZF.esm.min.js.map +1 -0
- package/dist/chunks/logDepthDeclaration-0cA1pTvQ.esm.min.js +2 -0
- package/dist/chunks/logDepthDeclaration-0cA1pTvQ.esm.min.js.map +1 -0
- package/dist/chunks/logDepthDeclaration-CYxYhXIS.esm.js +11 -0
- package/dist/chunks/logDepthDeclaration-CYxYhXIS.esm.js.map +1 -0
- package/dist/chunks/logDepthDeclaration-D4KGxdX-.esm.min.js +2 -0
- package/dist/chunks/logDepthDeclaration-D4KGxdX-.esm.min.js.map +1 -0
- package/dist/chunks/logDepthDeclaration-DJlt2-H5.esm.js +35 -0
- package/dist/chunks/logDepthDeclaration-DJlt2-H5.esm.js.map +1 -0
- package/dist/chunks/logDepthVertex-BS2JEtXA.esm.min.js +2 -0
- package/dist/chunks/logDepthVertex-BS2JEtXA.esm.min.js.map +1 -0
- package/dist/chunks/logDepthVertex-DKPfA10X.esm.js +81 -0
- package/dist/chunks/logDepthVertex-DKPfA10X.esm.js.map +1 -0
- package/dist/chunks/logDepthVertex-ojTShW5I.esm.js +77 -0
- package/dist/chunks/logDepthVertex-ojTShW5I.esm.js.map +1 -0
- package/dist/chunks/logDepthVertex-v-0pHNc-.esm.min.js +2 -0
- package/dist/chunks/logDepthVertex-v-0pHNc-.esm.min.js.map +1 -0
- package/dist/chunks/mainUVVaryingDeclaration-BAzmbS0W.esm.min.js +2 -0
- package/dist/chunks/mainUVVaryingDeclaration-BAzmbS0W.esm.min.js.map +1 -0
- package/dist/chunks/mainUVVaryingDeclaration-Cnux1jkK.esm.js +11 -0
- package/dist/chunks/mainUVVaryingDeclaration-Cnux1jkK.esm.js.map +1 -0
- package/dist/chunks/mainUVVaryingDeclaration-CwS0hUUZ.esm.min.js +2 -0
- package/dist/chunks/mainUVVaryingDeclaration-CwS0hUUZ.esm.min.js.map +1 -0
- package/dist/chunks/mainUVVaryingDeclaration-DCawby1A.esm.js +11 -0
- package/dist/chunks/mainUVVaryingDeclaration-DCawby1A.esm.js.map +1 -0
- package/dist/chunks/mesh.vertexData.functions-B_pMCAzZ.esm.js +119 -0
- package/dist/chunks/mesh.vertexData.functions-B_pMCAzZ.esm.js.map +1 -0
- package/dist/chunks/mesh.vertexData.functions-Bo7e6Of9.esm.min.js +2 -0
- package/dist/chunks/mesh.vertexData.functions-Bo7e6Of9.esm.min.js.map +1 -0
- package/dist/chunks/meshUboDeclaration-QvH0RgeZ.esm.js +26 -0
- package/dist/chunks/meshUboDeclaration-QvH0RgeZ.esm.js.map +1 -0
- package/dist/chunks/meshUboDeclaration-g2s_cYI1.esm.min.js +2 -0
- package/dist/chunks/meshUboDeclaration-g2s_cYI1.esm.min.js.map +1 -0
- package/dist/chunks/objFileLoader-BOutXdVR.esm.min.js +2 -0
- package/dist/chunks/objFileLoader-BOutXdVR.esm.min.js.map +1 -0
- package/dist/chunks/objFileLoader-BPwrX8RK.esm.js +1338 -0
- package/dist/chunks/objFileLoader-BPwrX8RK.esm.js.map +1 -0
- package/dist/chunks/oitFragment-CmcWUhsZ.esm.js +1240 -0
- package/dist/chunks/oitFragment-CmcWUhsZ.esm.js.map +1 -0
- package/dist/chunks/oitFragment-D8XBQ6Wa.esm.js +1078 -0
- package/dist/chunks/oitFragment-D8XBQ6Wa.esm.js.map +1 -0
- package/dist/chunks/oitFragment-DgAlmoHs.esm.min.js +2 -0
- package/dist/chunks/oitFragment-DgAlmoHs.esm.min.js.map +1 -0
- package/dist/chunks/oitFragment-DpJ5xGhy.esm.min.js +2 -0
- package/dist/chunks/oitFragment-DpJ5xGhy.esm.min.js.map +1 -0
- package/dist/chunks/pass.fragment--XRaXRhU.esm.js +15 -0
- package/dist/chunks/pass.fragment--XRaXRhU.esm.js.map +1 -0
- package/dist/chunks/pass.fragment-5Q3qXxDe.esm.min.js +2 -0
- package/dist/chunks/pass.fragment-5Q3qXxDe.esm.min.js.map +1 -0
- package/dist/chunks/pass.fragment-BBLiyU_i.esm.min.js +2 -0
- package/dist/chunks/pass.fragment-BBLiyU_i.esm.min.js.map +1 -0
- package/dist/chunks/pass.fragment-DI4ZYZJe.esm.js +15 -0
- package/dist/chunks/pass.fragment-DI4ZYZJe.esm.js.map +1 -0
- package/dist/chunks/pbr.fragment-C7xQS4ZJ.esm.js +3269 -0
- package/dist/chunks/pbr.fragment-C7xQS4ZJ.esm.js.map +1 -0
- package/dist/chunks/pbr.fragment-Ddxaik8T.esm.min.js +2 -0
- package/dist/chunks/pbr.fragment-Ddxaik8T.esm.min.js.map +1 -0
- package/dist/chunks/pbr.fragment-fky04gH_.esm.js +3222 -0
- package/dist/chunks/pbr.fragment-fky04gH_.esm.js.map +1 -0
- package/dist/chunks/pbr.fragment-ya1zai4w.esm.min.js +2 -0
- package/dist/chunks/pbr.fragment-ya1zai4w.esm.min.js.map +1 -0
- package/dist/chunks/pbr.vertex-BPEYHoRM.esm.js +223 -0
- package/dist/chunks/pbr.vertex-BPEYHoRM.esm.js.map +1 -0
- package/dist/chunks/pbr.vertex-BXcMYADF.esm.js +348 -0
- package/dist/chunks/pbr.vertex-BXcMYADF.esm.js.map +1 -0
- package/dist/chunks/pbr.vertex-BjA08auU.esm.min.js +2 -0
- package/dist/chunks/pbr.vertex-BjA08auU.esm.min.js.map +1 -0
- package/dist/chunks/pbr.vertex-Cx2V3lNf.esm.min.js +2 -0
- package/dist/chunks/pbr.vertex-Cx2V3lNf.esm.min.js.map +1 -0
- package/dist/chunks/postprocess.vertex-BHpQrNSx.esm.min.js +2 -0
- package/dist/chunks/postprocess.vertex-BHpQrNSx.esm.min.js.map +1 -0
- package/dist/chunks/postprocess.vertex-DnDbk0tq.esm.js +20 -0
- package/dist/chunks/postprocess.vertex-DnDbk0tq.esm.js.map +1 -0
- package/dist/chunks/rawTexture-CWiRIto8.esm.js +191 -0
- package/dist/chunks/rawTexture-CWiRIto8.esm.js.map +1 -0
- package/dist/chunks/rawTexture-DX8V9PEj.esm.min.js +2 -0
- package/dist/chunks/rawTexture-DX8V9PEj.esm.min.js.map +1 -0
- package/dist/chunks/ray-ix7SqYNQ.esm.min.js +2 -0
- package/dist/chunks/ray-ix7SqYNQ.esm.min.js.map +1 -0
- package/dist/chunks/ray-nTZBkOil.esm.js +946 -0
- package/dist/chunks/ray-nTZBkOil.esm.js.map +1 -0
- package/dist/chunks/rgbdDecode.fragment-Be3ofvlt.esm.min.js +2 -0
- package/dist/chunks/rgbdDecode.fragment-Be3ofvlt.esm.min.js.map +1 -0
- package/dist/chunks/rgbdDecode.fragment-C05QJpT2.esm.js +13 -0
- package/dist/chunks/rgbdDecode.fragment-C05QJpT2.esm.js.map +1 -0
- package/dist/chunks/rgbdDecode.fragment-D3SYBclQ.esm.min.js +2 -0
- package/dist/chunks/rgbdDecode.fragment-D3SYBclQ.esm.min.js.map +1 -0
- package/dist/chunks/rgbdDecode.fragment-DBG6KfKF.esm.js +13 -0
- package/dist/chunks/rgbdDecode.fragment-DBG6KfKF.esm.js.map +1 -0
- package/dist/chunks/rgbdEncode.fragment-BlhtohrO.esm.js +13 -0
- package/dist/chunks/rgbdEncode.fragment-BlhtohrO.esm.js.map +1 -0
- package/dist/chunks/rgbdEncode.fragment-BmJKYw6A.esm.min.js +2 -0
- package/dist/chunks/rgbdEncode.fragment-BmJKYw6A.esm.min.js.map +1 -0
- package/dist/chunks/rgbdEncode.fragment-dr2kGjSO.esm.js +13 -0
- package/dist/chunks/rgbdEncode.fragment-dr2kGjSO.esm.js.map +1 -0
- package/dist/chunks/rgbdEncode.fragment-hXPzg1p5.esm.min.js +2 -0
- package/dist/chunks/rgbdEncode.fragment-hXPzg1p5.esm.min.js.map +1 -0
- package/dist/chunks/splatFileLoader-Bs42LtsP.esm.min.js +2 -0
- package/dist/chunks/splatFileLoader-Bs42LtsP.esm.min.js.map +1 -0
- package/dist/chunks/splatFileLoader-Dp33YOem.esm.js +3379 -0
- package/dist/chunks/splatFileLoader-Dp33YOem.esm.js.map +1 -0
- package/dist/chunks/spotLight-C0NmKeem.esm.js +701 -0
- package/dist/chunks/spotLight-C0NmKeem.esm.js.map +1 -0
- package/dist/chunks/spotLight-CcuCNdES.esm.min.js +2 -0
- package/dist/chunks/spotLight-CcuCNdES.esm.min.js.map +1 -0
- package/dist/chunks/standardMaterial-C1E5n_4w.esm.min.js +2 -0
- package/dist/chunks/standardMaterial-C1E5n_4w.esm.min.js.map +1 -0
- package/dist/chunks/standardMaterial-v_D8QA4q.esm.js +1807 -0
- package/dist/chunks/standardMaterial-v_D8QA4q.esm.js.map +1 -0
- package/dist/chunks/stlFileLoader-DC2IRQDj.esm.min.js +2 -0
- package/dist/chunks/stlFileLoader-DC2IRQDj.esm.min.js.map +1 -0
- package/dist/chunks/stlFileLoader-LRHEIFfU.esm.js +238 -0
- package/dist/chunks/stlFileLoader-LRHEIFfU.esm.js.map +1 -0
- package/dist/chunks/tgaTextureLoader-2ekJC0En.esm.js +349 -0
- package/dist/chunks/tgaTextureLoader-2ekJC0En.esm.js.map +1 -0
- package/dist/chunks/tgaTextureLoader-Clj6zUK-.esm.min.js +2 -0
- package/dist/chunks/tgaTextureLoader-Clj6zUK-.esm.min.js.map +1 -0
- package/dist/chunks/thinEngine-DksimP2U.esm.js +3848 -0
- package/dist/chunks/thinEngine-DksimP2U.esm.js.map +1 -0
- package/dist/chunks/thinEngine-tsALaFYH.esm.min.js +2 -0
- package/dist/chunks/thinEngine-tsALaFYH.esm.min.js.map +1 -0
- package/dist/chunks/thinInstanceMesh-B8AW0Oa2.esm.js +314 -0
- package/dist/chunks/thinInstanceMesh-B8AW0Oa2.esm.js.map +1 -0
- package/dist/chunks/thinInstanceMesh-kCGEJ0-e.esm.min.js +2 -0
- package/dist/chunks/thinInstanceMesh-kCGEJ0-e.esm.min.js.map +1 -0
- package/dist/chunks/vertexColorMixing-Bjijk3lU.esm.min.js +2 -0
- package/dist/chunks/vertexColorMixing-Bjijk3lU.esm.min.js.map +1 -0
- package/dist/chunks/vertexColorMixing-D9917nJN.esm.js +428 -0
- package/dist/chunks/vertexColorMixing-D9917nJN.esm.js.map +1 -0
- package/dist/chunks/vertexColorMixing-DgthWrKf.esm.min.js +2 -0
- package/dist/chunks/vertexColorMixing-DgthWrKf.esm.min.js.map +1 -0
- package/dist/chunks/vertexColorMixing-U1SA6UK3.esm.js +538 -0
- package/dist/chunks/vertexColorMixing-U1SA6UK3.esm.js.map +1 -0
- package/dist/chunks/webgpuEngine-BOGR1D8F.esm.min.js +2 -0
- package/dist/chunks/webgpuEngine-BOGR1D8F.esm.min.js.map +1 -0
- package/dist/chunks/webgpuEngine-BrzOpZ-2.esm.js +11533 -0
- package/dist/chunks/webgpuEngine-BrzOpZ-2.esm.js.map +1 -0
- package/dist/chunks/workerPool-BUOov2K1.esm.js +122 -0
- package/dist/chunks/workerPool-BUOov2K1.esm.js.map +1 -0
- package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js +2 -0
- package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js.map +1 -0
- package/lib/index.d.ts +591 -0
- package/lib/index.js +2165 -0
- package/lib/index.js.map +1 -0
- package/package.json +19 -28
- package/readme.md +28 -28
- package/configuration/configuration.d.ts +0 -107
- package/configuration/configuration.js +0 -16
- package/configuration/configuration.js.map +0 -1
- package/configuration/configurationCompatibility.d.ts +0 -8
- package/configuration/configurationCompatibility.js +0 -66
- package/configuration/configurationCompatibility.js.map +0 -1
- package/configuration/configurationContainer.d.ts +0 -10
- package/configuration/configurationContainer.js +0 -10
- package/configuration/configurationContainer.js.map +0 -1
- package/configuration/globals.d.ts +0 -6
- package/configuration/globals.js +0 -18
- package/configuration/globals.js.map +0 -1
- package/configuration/index.d.ts +0 -2
- package/configuration/index.js +0 -4
- package/configuration/index.js.map +0 -1
- package/configuration/interfaces/cameraConfiguration.d.ts +0 -31
- package/configuration/interfaces/cameraConfiguration.js +0 -2
- package/configuration/interfaces/cameraConfiguration.js.map +0 -1
- package/configuration/interfaces/colorGradingConfiguration.d.ts +0 -81
- package/configuration/interfaces/colorGradingConfiguration.js +0 -2
- package/configuration/interfaces/colorGradingConfiguration.js.map +0 -1
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +0 -20
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +0 -2
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.js.map +0 -1
- package/configuration/interfaces/environmentMapConfiguration.d.ts +0 -22
- package/configuration/interfaces/environmentMapConfiguration.js +0 -2
- package/configuration/interfaces/environmentMapConfiguration.js.map +0 -1
- package/configuration/interfaces/groundConfiguration.d.ts +0 -24
- package/configuration/interfaces/groundConfiguration.js +0 -2
- package/configuration/interfaces/groundConfiguration.js.map +0 -1
- package/configuration/interfaces/imageProcessingConfiguration.d.ts +0 -45
- package/configuration/interfaces/imageProcessingConfiguration.js +0 -2
- package/configuration/interfaces/imageProcessingConfiguration.js.map +0 -1
- package/configuration/interfaces/index.d.ts +0 -15
- package/configuration/interfaces/index.js +0 -16
- package/configuration/interfaces/index.js.map +0 -1
- package/configuration/interfaces/lightConfiguration.d.ts +0 -60
- package/configuration/interfaces/lightConfiguration.js +0 -2
- package/configuration/interfaces/lightConfiguration.js.map +0 -1
- package/configuration/interfaces/modelAnimationConfiguration.d.ts +0 -26
- package/configuration/interfaces/modelAnimationConfiguration.js +0 -2
- package/configuration/interfaces/modelAnimationConfiguration.js.map +0 -1
- package/configuration/interfaces/modelConfiguration.d.ts +0 -65
- package/configuration/interfaces/modelConfiguration.js +0 -2
- package/configuration/interfaces/modelConfiguration.js.map +0 -1
- package/configuration/interfaces/observersConfiguration.d.ts +0 -5
- package/configuration/interfaces/observersConfiguration.js +0 -2
- package/configuration/interfaces/observersConfiguration.js.map +0 -1
- package/configuration/interfaces/sceneConfiguration.d.ts +0 -48
- package/configuration/interfaces/sceneConfiguration.js +0 -2
- package/configuration/interfaces/sceneConfiguration.js.map +0 -1
- package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +0 -23
- package/configuration/interfaces/sceneOptimizerConfiguration.js +0 -2
- package/configuration/interfaces/sceneOptimizerConfiguration.js.map +0 -1
- package/configuration/interfaces/skyboxConfiguration.d.ts +0 -21
- package/configuration/interfaces/skyboxConfiguration.js +0 -2
- package/configuration/interfaces/skyboxConfiguration.js.map +0 -1
- package/configuration/interfaces/templateConfiguration.d.ts +0 -67
- package/configuration/interfaces/templateConfiguration.js +0 -2
- package/configuration/interfaces/templateConfiguration.js.map +0 -1
- package/configuration/interfaces/vrConfiguration.d.ts +0 -16
- package/configuration/interfaces/vrConfiguration.js +0 -2
- package/configuration/interfaces/vrConfiguration.js.map +0 -1
- package/configuration/loader.d.ts +0 -4
- package/configuration/loader.js +0 -17
- package/configuration/loader.js.map +0 -1
- package/configuration/mappers.d.ts +0 -43
- package/configuration/mappers.js +0 -193
- package/configuration/mappers.js.map +0 -1
- package/configuration/renderOnlyLoader.d.ts +0 -33
- package/configuration/renderOnlyLoader.js +0 -162
- package/configuration/renderOnlyLoader.js.map +0 -1
- package/configuration/types/default.d.ts +0 -6
- package/configuration/types/default.js +0 -121
- package/configuration/types/default.js.map +0 -1
- package/configuration/types/environmentMap.d.ts +0 -5
- package/configuration/types/environmentMap.js +0 -14
- package/configuration/types/environmentMap.js.map +0 -1
- package/configuration/types/extended.d.ts +0 -6
- package/configuration/types/extended.js +0 -317
- package/configuration/types/extended.js.map +0 -1
- package/configuration/types/index.d.ts +0 -14
- package/configuration/types/index.js +0 -51
- package/configuration/types/index.js.map +0 -1
- package/configuration/types/minimal.d.ts +0 -6
- package/configuration/types/minimal.js +0 -43
- package/configuration/types/minimal.js.map +0 -1
- package/configuration/types/renderOnlyDefault.d.ts +0 -30
- package/configuration/types/renderOnlyDefault.js +0 -31
- package/configuration/types/renderOnlyDefault.js.map +0 -1
- package/configuration/types/shadowLight.d.ts +0 -9
- package/configuration/types/shadowLight.js +0 -64
- package/configuration/types/shadowLight.js.map +0 -1
- package/helper/index.d.ts +0 -29
- package/helper/index.js +0 -66
- package/helper/index.js.map +0 -1
- package/index.d.ts +0 -30
- package/index.js +0 -46
- package/index.js.map +0 -1
- package/initializer.d.ts +0 -11
- package/initializer.js +0 -35
- package/initializer.js.map +0 -1
- package/interfaces.d.ts +0 -5
- package/interfaces.js +0 -7
- package/interfaces.js.map +0 -1
- package/labs/environmentSerializer.d.ts +0 -126
- package/labs/environmentSerializer.js +0 -191
- package/labs/environmentSerializer.js.map +0 -1
- package/labs/texture.d.ts +0 -183
- package/labs/texture.js +0 -351
- package/labs/texture.js.map +0 -1
- package/labs/viewerLabs.d.ts +0 -51
- package/labs/viewerLabs.js +0 -134
- package/labs/viewerLabs.js.map +0 -1
- package/loader/modelLoader.d.ts +0 -56
- package/loader/modelLoader.js +0 -202
- package/loader/modelLoader.js.map +0 -1
- package/loader/plugins/applyMaterialConfig.d.ts +0 -12
- package/loader/plugins/applyMaterialConfig.js +0 -16
- package/loader/plugins/applyMaterialConfig.js.map +0 -1
- package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +0 -9
- package/loader/plugins/extendedMaterialLoaderPlugin.js +0 -16
- package/loader/plugins/extendedMaterialLoaderPlugin.js.map +0 -1
- package/loader/plugins/index.d.ts +0 -19
- package/loader/plugins/index.js +0 -44
- package/loader/plugins/index.js.map +0 -1
- package/loader/plugins/loaderPlugin.d.ts +0 -24
- package/loader/plugins/loaderPlugin.js +0 -2
- package/loader/plugins/loaderPlugin.js.map +0 -1
- package/loader/plugins/msftLodLoaderPlugin.d.ts +0 -12
- package/loader/plugins/msftLodLoaderPlugin.js +0 -21
- package/loader/plugins/msftLodLoaderPlugin.js.map +0 -1
- package/loader/plugins/telemetryLoaderPlugin.d.ts +0 -12
- package/loader/plugins/telemetryLoaderPlugin.js +0 -36
- package/loader/plugins/telemetryLoaderPlugin.js.map +0 -1
- package/managers/observablesManager.d.ts +0 -66
- package/managers/observablesManager.js +0 -35
- package/managers/observablesManager.js.map +0 -1
- package/managers/sceneManager.d.ts +0 -245
- package/managers/sceneManager.js +0 -1375
- package/managers/sceneManager.js.map +0 -1
- package/managers/telemetryManager.d.ts +0 -78
- package/managers/telemetryManager.js +0 -117
- package/managers/telemetryManager.js.map +0 -1
- package/model/modelAnimation.d.ts +0 -215
- package/model/modelAnimation.js +0 -237
- package/model/modelAnimation.js.map +0 -1
- package/model/viewerModel.d.ts +0 -233
- package/model/viewerModel.js +0 -673
- package/model/viewerModel.js.map +0 -1
- package/optimizer/custom/extended.d.ts +0 -13
- package/optimizer/custom/extended.js +0 -101
- package/optimizer/custom/extended.js.map +0 -1
- package/optimizer/custom/index.d.ts +0 -9
- package/optimizer/custom/index.js +0 -26
- package/optimizer/custom/index.js.map +0 -1
- package/renderOnlyIndex.d.ts +0 -11
- package/renderOnlyIndex.js +0 -18
- package/renderOnlyIndex.js.map +0 -1
- package/templating/eventManager.d.ts +0 -35
- package/templating/eventManager.js +0 -66
- package/templating/eventManager.js.map +0 -1
- package/templating/plugins/hdButtonPlugin.d.ts +0 -9
- package/templating/plugins/hdButtonPlugin.js +0 -22
- package/templating/plugins/hdButtonPlugin.js.map +0 -1
- package/templating/plugins/printButton.d.ts +0 -9
- package/templating/plugins/printButton.js +0 -41
- package/templating/plugins/printButton.js.map +0 -1
- package/templating/templateManager.d.ts +0 -197
- package/templating/templateManager.js +0 -561
- package/templating/templateManager.js.map +0 -1
- package/templating/viewerTemplatePlugin.d.ts +0 -21
- package/templating/viewerTemplatePlugin.js +0 -69
- package/templating/viewerTemplatePlugin.js.map +0 -1
- package/viewer/defaultViewer.d.ts +0 -130
- package/viewer/defaultViewer.js +0 -672
- package/viewer/defaultViewer.js.map +0 -1
- package/viewer/renderOnlyViewer.d.ts +0 -9
- package/viewer/renderOnlyViewer.js +0 -46
- package/viewer/renderOnlyViewer.js.map +0 -1
- package/viewer/viewer.d.ts +0 -258
- package/viewer/viewer.js +0 -783
- package/viewer/viewer.js.map +0 -1
- package/viewer/viewerManager.d.ts +0 -58
- package/viewer/viewerManager.js +0 -91
- package/viewer/viewerManager.js.map +0 -1
- package/viewer/viewerWithTemplate.d.ts +0 -9
- package/viewer/viewerWithTemplate.js +0 -20
- package/viewer/viewerWithTemplate.js.map +0 -1
|
@@ -0,0 +1,946 @@
|
|
|
1
|
+
import { ag as BuildArray, v as Vector3, ah as Epsilon, ai as IntersectionInfo, a7 as TmpVectors, a5 as Matrix, E as EngineStore, aj as PickingInfo, ak as _ImportHelper, al as Scene, Y as Camera } from './index-C6hXZyZb.esm.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Class representing a ray with position and direction
|
|
5
|
+
*/
|
|
6
|
+
class Ray {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a new ray
|
|
9
|
+
* @param origin origin point
|
|
10
|
+
* @param direction direction
|
|
11
|
+
* @param length length of the ray
|
|
12
|
+
* @param epsilon The epsilon value to use when calculating the ray/triangle intersection (default: 0)
|
|
13
|
+
*/
|
|
14
|
+
constructor(
|
|
15
|
+
/** origin point */
|
|
16
|
+
origin,
|
|
17
|
+
/** direction */
|
|
18
|
+
direction,
|
|
19
|
+
/** [Number.MAX_VALUE] length of the ray */
|
|
20
|
+
length = Number.MAX_VALUE,
|
|
21
|
+
/** [Epsilon] The epsilon value to use when calculating the ray/triangle intersection (default: Epsilon from math constants) */
|
|
22
|
+
epsilon = Epsilon) {
|
|
23
|
+
this.origin = origin;
|
|
24
|
+
this.direction = direction;
|
|
25
|
+
this.length = length;
|
|
26
|
+
this.epsilon = epsilon;
|
|
27
|
+
}
|
|
28
|
+
// Methods
|
|
29
|
+
/**
|
|
30
|
+
* Clone the current ray
|
|
31
|
+
* @returns a new ray
|
|
32
|
+
*/
|
|
33
|
+
clone() {
|
|
34
|
+
return new Ray(this.origin.clone(), this.direction.clone(), this.length);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Checks if the ray intersects a box
|
|
38
|
+
* This does not account for the ray length by design to improve perfs.
|
|
39
|
+
* @param minimum bound of the box
|
|
40
|
+
* @param maximum bound of the box
|
|
41
|
+
* @param intersectionTreshold extra extend to be added to the box in all direction
|
|
42
|
+
* @returns if the box was hit
|
|
43
|
+
*/
|
|
44
|
+
intersectsBoxMinMax(minimum, maximum, intersectionTreshold = 0) {
|
|
45
|
+
const newMinimum = Ray._TmpVector3[0].copyFromFloats(minimum.x - intersectionTreshold, minimum.y - intersectionTreshold, minimum.z - intersectionTreshold);
|
|
46
|
+
const newMaximum = Ray._TmpVector3[1].copyFromFloats(maximum.x + intersectionTreshold, maximum.y + intersectionTreshold, maximum.z + intersectionTreshold);
|
|
47
|
+
let d = 0.0;
|
|
48
|
+
let maxValue = Number.MAX_VALUE;
|
|
49
|
+
let inv;
|
|
50
|
+
let min;
|
|
51
|
+
let max;
|
|
52
|
+
let temp;
|
|
53
|
+
if (Math.abs(this.direction.x) < 0.0000001) {
|
|
54
|
+
if (this.origin.x < newMinimum.x || this.origin.x > newMaximum.x) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
inv = 1.0 / this.direction.x;
|
|
60
|
+
min = (newMinimum.x - this.origin.x) * inv;
|
|
61
|
+
max = (newMaximum.x - this.origin.x) * inv;
|
|
62
|
+
if (max === -Infinity) {
|
|
63
|
+
max = Infinity;
|
|
64
|
+
}
|
|
65
|
+
if (min > max) {
|
|
66
|
+
temp = min;
|
|
67
|
+
min = max;
|
|
68
|
+
max = temp;
|
|
69
|
+
}
|
|
70
|
+
d = Math.max(min, d);
|
|
71
|
+
maxValue = Math.min(max, maxValue);
|
|
72
|
+
if (d > maxValue) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (Math.abs(this.direction.y) < 0.0000001) {
|
|
77
|
+
if (this.origin.y < newMinimum.y || this.origin.y > newMaximum.y) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
inv = 1.0 / this.direction.y;
|
|
83
|
+
min = (newMinimum.y - this.origin.y) * inv;
|
|
84
|
+
max = (newMaximum.y - this.origin.y) * inv;
|
|
85
|
+
if (max === -Infinity) {
|
|
86
|
+
max = Infinity;
|
|
87
|
+
}
|
|
88
|
+
if (min > max) {
|
|
89
|
+
temp = min;
|
|
90
|
+
min = max;
|
|
91
|
+
max = temp;
|
|
92
|
+
}
|
|
93
|
+
d = Math.max(min, d);
|
|
94
|
+
maxValue = Math.min(max, maxValue);
|
|
95
|
+
if (d > maxValue) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (Math.abs(this.direction.z) < 0.0000001) {
|
|
100
|
+
if (this.origin.z < newMinimum.z || this.origin.z > newMaximum.z) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
inv = 1.0 / this.direction.z;
|
|
106
|
+
min = (newMinimum.z - this.origin.z) * inv;
|
|
107
|
+
max = (newMaximum.z - this.origin.z) * inv;
|
|
108
|
+
if (max === -Infinity) {
|
|
109
|
+
max = Infinity;
|
|
110
|
+
}
|
|
111
|
+
if (min > max) {
|
|
112
|
+
temp = min;
|
|
113
|
+
min = max;
|
|
114
|
+
max = temp;
|
|
115
|
+
}
|
|
116
|
+
d = Math.max(min, d);
|
|
117
|
+
maxValue = Math.min(max, maxValue);
|
|
118
|
+
if (d > maxValue) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Checks if the ray intersects a box
|
|
126
|
+
* This does not account for the ray lenght by design to improve perfs.
|
|
127
|
+
* @param box the bounding box to check
|
|
128
|
+
* @param intersectionTreshold extra extend to be added to the BoundingBox in all direction
|
|
129
|
+
* @returns if the box was hit
|
|
130
|
+
*/
|
|
131
|
+
intersectsBox(box, intersectionTreshold = 0) {
|
|
132
|
+
return this.intersectsBoxMinMax(box.minimum, box.maximum, intersectionTreshold);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* If the ray hits a sphere
|
|
136
|
+
* @param sphere the bounding sphere to check
|
|
137
|
+
* @param intersectionTreshold extra extend to be added to the BoundingSphere in all direction
|
|
138
|
+
* @returns true if it hits the sphere
|
|
139
|
+
*/
|
|
140
|
+
intersectsSphere(sphere, intersectionTreshold = 0) {
|
|
141
|
+
const x = sphere.center.x - this.origin.x;
|
|
142
|
+
const y = sphere.center.y - this.origin.y;
|
|
143
|
+
const z = sphere.center.z - this.origin.z;
|
|
144
|
+
const pyth = x * x + y * y + z * z;
|
|
145
|
+
const radius = sphere.radius + intersectionTreshold;
|
|
146
|
+
const rr = radius * radius;
|
|
147
|
+
if (pyth <= rr) {
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
const dot = x * this.direction.x + y * this.direction.y + z * this.direction.z;
|
|
151
|
+
if (dot < 0.0) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
const temp = pyth - dot * dot;
|
|
155
|
+
return temp <= rr;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* If the ray hits a triange
|
|
159
|
+
* @param vertex0 triangle vertex
|
|
160
|
+
* @param vertex1 triangle vertex
|
|
161
|
+
* @param vertex2 triangle vertex
|
|
162
|
+
* @returns intersection information if hit
|
|
163
|
+
*/
|
|
164
|
+
intersectsTriangle(vertex0, vertex1, vertex2) {
|
|
165
|
+
const edge1 = Ray._TmpVector3[0];
|
|
166
|
+
const edge2 = Ray._TmpVector3[1];
|
|
167
|
+
const pvec = Ray._TmpVector3[2];
|
|
168
|
+
const tvec = Ray._TmpVector3[3];
|
|
169
|
+
const qvec = Ray._TmpVector3[4];
|
|
170
|
+
vertex1.subtractToRef(vertex0, edge1);
|
|
171
|
+
vertex2.subtractToRef(vertex0, edge2);
|
|
172
|
+
Vector3.CrossToRef(this.direction, edge2, pvec);
|
|
173
|
+
const det = Vector3.Dot(edge1, pvec);
|
|
174
|
+
if (det === 0) {
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
const invdet = 1 / det;
|
|
178
|
+
this.origin.subtractToRef(vertex0, tvec);
|
|
179
|
+
const bv = Vector3.Dot(tvec, pvec) * invdet;
|
|
180
|
+
if (bv < -this.epsilon || bv > 1.0 + this.epsilon) {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
Vector3.CrossToRef(tvec, edge1, qvec);
|
|
184
|
+
const bw = Vector3.Dot(this.direction, qvec) * invdet;
|
|
185
|
+
if (bw < -this.epsilon || bv + bw > 1.0 + this.epsilon) {
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
//check if the distance is longer than the predefined length.
|
|
189
|
+
const distance = Vector3.Dot(edge2, qvec) * invdet;
|
|
190
|
+
if (distance > this.length) {
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
return new IntersectionInfo(1 - bv - bw, bv, distance);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Checks if ray intersects a plane
|
|
197
|
+
* @param plane the plane to check
|
|
198
|
+
* @returns the distance away it was hit
|
|
199
|
+
*/
|
|
200
|
+
intersectsPlane(plane) {
|
|
201
|
+
let distance;
|
|
202
|
+
const result1 = Vector3.Dot(plane.normal, this.direction);
|
|
203
|
+
if (Math.abs(result1) < 9.99999997475243e-7) {
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
const result2 = Vector3.Dot(plane.normal, this.origin);
|
|
208
|
+
distance = (-plane.d - result2) / result1;
|
|
209
|
+
if (distance < 0.0) {
|
|
210
|
+
if (distance < -9.99999997475243e-7) {
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
return 0;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return distance;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Calculate the intercept of a ray on a given axis
|
|
222
|
+
* @param axis to check 'x' | 'y' | 'z'
|
|
223
|
+
* @param offset from axis interception (i.e. an offset of 1y is intercepted above ground)
|
|
224
|
+
* @returns a vector containing the coordinates where 'axis' is equal to zero (else offset), or null if there is no intercept.
|
|
225
|
+
*/
|
|
226
|
+
intersectsAxis(axis, offset = 0) {
|
|
227
|
+
switch (axis) {
|
|
228
|
+
case "y": {
|
|
229
|
+
const t = (this.origin.y - offset) / this.direction.y;
|
|
230
|
+
if (t > 0) {
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
return new Vector3(this.origin.x + this.direction.x * -t, offset, this.origin.z + this.direction.z * -t);
|
|
234
|
+
}
|
|
235
|
+
case "x": {
|
|
236
|
+
const t = (this.origin.x - offset) / this.direction.x;
|
|
237
|
+
if (t > 0) {
|
|
238
|
+
return null;
|
|
239
|
+
}
|
|
240
|
+
return new Vector3(offset, this.origin.y + this.direction.y * -t, this.origin.z + this.direction.z * -t);
|
|
241
|
+
}
|
|
242
|
+
case "z": {
|
|
243
|
+
const t = (this.origin.z - offset) / this.direction.z;
|
|
244
|
+
if (t > 0) {
|
|
245
|
+
return null;
|
|
246
|
+
}
|
|
247
|
+
return new Vector3(this.origin.x + this.direction.x * -t, this.origin.y + this.direction.y * -t, offset);
|
|
248
|
+
}
|
|
249
|
+
default:
|
|
250
|
+
return null;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Checks if ray intersects a mesh. The ray is defined in WORLD space. A mesh triangle can be picked both from its front and back sides,
|
|
255
|
+
* irrespective of orientation.
|
|
256
|
+
* @param mesh the mesh to check
|
|
257
|
+
* @param fastCheck defines if the first intersection will be used (and not the closest)
|
|
258
|
+
* @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
|
|
259
|
+
* @param onlyBoundingInfo defines a boolean indicating if picking should only happen using bounding info (false by default)
|
|
260
|
+
* @param worldToUse defines the world matrix to use to get the world coordinate of the intersection point
|
|
261
|
+
* @param skipBoundingInfo a boolean indicating if we should skip the bounding info check
|
|
262
|
+
* @returns picking info of the intersection
|
|
263
|
+
*/
|
|
264
|
+
intersectsMesh(mesh, fastCheck, trianglePredicate, onlyBoundingInfo = false, worldToUse, skipBoundingInfo = false) {
|
|
265
|
+
const tm = TmpVectors.Matrix[0];
|
|
266
|
+
mesh.getWorldMatrix().invertToRef(tm);
|
|
267
|
+
if (this._tmpRay) {
|
|
268
|
+
Ray.TransformToRef(this, tm, this._tmpRay);
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
this._tmpRay = Ray.Transform(this, tm);
|
|
272
|
+
}
|
|
273
|
+
return mesh.intersects(this._tmpRay, fastCheck, trianglePredicate, onlyBoundingInfo, worldToUse, skipBoundingInfo);
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Checks if ray intersects a mesh
|
|
277
|
+
* @param meshes the meshes to check
|
|
278
|
+
* @param fastCheck defines if the first intersection will be used (and not the closest)
|
|
279
|
+
* @param results array to store result in
|
|
280
|
+
* @returns Array of picking infos
|
|
281
|
+
*/
|
|
282
|
+
intersectsMeshes(meshes, fastCheck, results) {
|
|
283
|
+
if (results) {
|
|
284
|
+
results.length = 0;
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
results = [];
|
|
288
|
+
}
|
|
289
|
+
for (let i = 0; i < meshes.length; i++) {
|
|
290
|
+
const pickInfo = this.intersectsMesh(meshes[i], fastCheck);
|
|
291
|
+
if (pickInfo.hit) {
|
|
292
|
+
results.push(pickInfo);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
results.sort(this._comparePickingInfo);
|
|
296
|
+
return results;
|
|
297
|
+
}
|
|
298
|
+
_comparePickingInfo(pickingInfoA, pickingInfoB) {
|
|
299
|
+
if (pickingInfoA.distance < pickingInfoB.distance) {
|
|
300
|
+
return -1;
|
|
301
|
+
}
|
|
302
|
+
else if (pickingInfoA.distance > pickingInfoB.distance) {
|
|
303
|
+
return 1;
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
return 0;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Intersection test between the ray and a given segment within a given tolerance (threshold)
|
|
311
|
+
* @param sega the first point of the segment to test the intersection against
|
|
312
|
+
* @param segb the second point of the segment to test the intersection against
|
|
313
|
+
* @param threshold the tolerance margin, if the ray doesn't intersect the segment but is close to the given threshold, the intersection is successful
|
|
314
|
+
* @returns the distance from the ray origin to the intersection point if there's intersection, or -1 if there's no intersection
|
|
315
|
+
*/
|
|
316
|
+
intersectionSegment(sega, segb, threshold) {
|
|
317
|
+
const o = this.origin;
|
|
318
|
+
const u = TmpVectors.Vector3[0];
|
|
319
|
+
const rsegb = TmpVectors.Vector3[1];
|
|
320
|
+
const v = TmpVectors.Vector3[2];
|
|
321
|
+
const w = TmpVectors.Vector3[3];
|
|
322
|
+
segb.subtractToRef(sega, u);
|
|
323
|
+
this.direction.scaleToRef(Ray._Rayl, v);
|
|
324
|
+
o.addToRef(v, rsegb);
|
|
325
|
+
sega.subtractToRef(o, w);
|
|
326
|
+
const a = Vector3.Dot(u, u); // always >= 0
|
|
327
|
+
const b = Vector3.Dot(u, v);
|
|
328
|
+
const c = Vector3.Dot(v, v); // always >= 0
|
|
329
|
+
const d = Vector3.Dot(u, w);
|
|
330
|
+
const e = Vector3.Dot(v, w);
|
|
331
|
+
const D = a * c - b * b; // always >= 0
|
|
332
|
+
let sN, sD = D; // sc = sN / sD, default sD = D >= 0
|
|
333
|
+
let tN, tD = D; // tc = tN / tD, default tD = D >= 0
|
|
334
|
+
// compute the line parameters of the two closest points
|
|
335
|
+
if (D < Ray._Smallnum) {
|
|
336
|
+
// the lines are almost parallel
|
|
337
|
+
sN = 0.0; // force using point P0 on segment S1
|
|
338
|
+
sD = 1.0; // to prevent possible division by 0.0 later
|
|
339
|
+
tN = e;
|
|
340
|
+
tD = c;
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
// get the closest points on the infinite lines
|
|
344
|
+
sN = b * e - c * d;
|
|
345
|
+
tN = a * e - b * d;
|
|
346
|
+
if (sN < 0.0) {
|
|
347
|
+
// sc < 0 => the s=0 edge is visible
|
|
348
|
+
sN = 0.0;
|
|
349
|
+
tN = e;
|
|
350
|
+
tD = c;
|
|
351
|
+
}
|
|
352
|
+
else if (sN > sD) {
|
|
353
|
+
// sc > 1 => the s=1 edge is visible
|
|
354
|
+
sN = sD;
|
|
355
|
+
tN = e + b;
|
|
356
|
+
tD = c;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
if (tN < 0.0) {
|
|
360
|
+
// tc < 0 => the t=0 edge is visible
|
|
361
|
+
tN = 0.0;
|
|
362
|
+
// recompute sc for this edge
|
|
363
|
+
if (-d < 0.0) {
|
|
364
|
+
sN = 0.0;
|
|
365
|
+
}
|
|
366
|
+
else if (-d > a) {
|
|
367
|
+
sN = sD;
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
sN = -d;
|
|
371
|
+
sD = a;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
else if (tN > tD) {
|
|
375
|
+
// tc > 1 => the t=1 edge is visible
|
|
376
|
+
tN = tD;
|
|
377
|
+
// recompute sc for this edge
|
|
378
|
+
if (-d + b < 0.0) {
|
|
379
|
+
sN = 0;
|
|
380
|
+
}
|
|
381
|
+
else if (-d + b > a) {
|
|
382
|
+
sN = sD;
|
|
383
|
+
}
|
|
384
|
+
else {
|
|
385
|
+
sN = -d + b;
|
|
386
|
+
sD = a;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
// finally do the division to get sc and tc
|
|
390
|
+
const sc = Math.abs(sN) < Ray._Smallnum ? 0.0 : sN / sD;
|
|
391
|
+
const tc = Math.abs(tN) < Ray._Smallnum ? 0.0 : tN / tD;
|
|
392
|
+
// get the difference of the two closest points
|
|
393
|
+
const qtc = TmpVectors.Vector3[4];
|
|
394
|
+
v.scaleToRef(tc, qtc);
|
|
395
|
+
const qsc = TmpVectors.Vector3[5];
|
|
396
|
+
u.scaleToRef(sc, qsc);
|
|
397
|
+
qsc.addInPlace(w);
|
|
398
|
+
const dP = TmpVectors.Vector3[6];
|
|
399
|
+
qsc.subtractToRef(qtc, dP); // = S1(sc) - S2(tc)
|
|
400
|
+
const isIntersected = tc > 0 && tc <= this.length && dP.lengthSquared() < threshold * threshold; // return intersection result
|
|
401
|
+
if (isIntersected) {
|
|
402
|
+
return qsc.length();
|
|
403
|
+
}
|
|
404
|
+
return -1;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Update the ray from viewport position
|
|
408
|
+
* @param x position
|
|
409
|
+
* @param y y position
|
|
410
|
+
* @param viewportWidth viewport width
|
|
411
|
+
* @param viewportHeight viewport height
|
|
412
|
+
* @param world world matrix
|
|
413
|
+
* @param view view matrix
|
|
414
|
+
* @param projection projection matrix
|
|
415
|
+
* @param enableDistantPicking defines if picking should handle large values for mesh position/scaling (false by default)
|
|
416
|
+
* @returns this ray updated
|
|
417
|
+
*/
|
|
418
|
+
update(x, y, viewportWidth, viewportHeight, world, view, projection, enableDistantPicking = false) {
|
|
419
|
+
if (enableDistantPicking) {
|
|
420
|
+
// With world matrices having great values (like 8000000000 on 1 or more scaling or position axis),
|
|
421
|
+
// multiplying view/projection/world and doing invert will result in loss of float precision in the matrix.
|
|
422
|
+
// One way to fix it is to compute the ray with world at identity then transform the ray in object space.
|
|
423
|
+
// This is slower (2 matrix inverts instead of 1) but precision is preserved.
|
|
424
|
+
// This is hidden behind `EnableDistantPicking` flag (default is false)
|
|
425
|
+
if (!Ray._RayDistant) {
|
|
426
|
+
Ray._RayDistant = Ray.Zero();
|
|
427
|
+
}
|
|
428
|
+
Ray._RayDistant.unprojectRayToRef(x, y, viewportWidth, viewportHeight, Matrix.IdentityReadOnly, view, projection);
|
|
429
|
+
const tm = TmpVectors.Matrix[0];
|
|
430
|
+
world.invertToRef(tm);
|
|
431
|
+
Ray.TransformToRef(Ray._RayDistant, tm, this);
|
|
432
|
+
}
|
|
433
|
+
else {
|
|
434
|
+
this.unprojectRayToRef(x, y, viewportWidth, viewportHeight, world, view, projection);
|
|
435
|
+
}
|
|
436
|
+
return this;
|
|
437
|
+
}
|
|
438
|
+
// Statics
|
|
439
|
+
/**
|
|
440
|
+
* Creates a ray with origin and direction of 0,0,0
|
|
441
|
+
* @returns the new ray
|
|
442
|
+
*/
|
|
443
|
+
static Zero() {
|
|
444
|
+
return new Ray(Vector3.Zero(), Vector3.Zero());
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Creates a new ray from screen space and viewport
|
|
448
|
+
* @param x position
|
|
449
|
+
* @param y y position
|
|
450
|
+
* @param viewportWidth viewport width
|
|
451
|
+
* @param viewportHeight viewport height
|
|
452
|
+
* @param world world matrix
|
|
453
|
+
* @param view view matrix
|
|
454
|
+
* @param projection projection matrix
|
|
455
|
+
* @returns new ray
|
|
456
|
+
*/
|
|
457
|
+
static CreateNew(x, y, viewportWidth, viewportHeight, world, view, projection) {
|
|
458
|
+
const result = Ray.Zero();
|
|
459
|
+
return result.update(x, y, viewportWidth, viewportHeight, world, view, projection);
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be
|
|
463
|
+
* transformed to the given world matrix.
|
|
464
|
+
* @param origin The origin point
|
|
465
|
+
* @param end The end point
|
|
466
|
+
* @param world a matrix to transform the ray to. Default is the identity matrix.
|
|
467
|
+
* @returns the new ray
|
|
468
|
+
*/
|
|
469
|
+
static CreateNewFromTo(origin, end, world = Matrix.IdentityReadOnly) {
|
|
470
|
+
const result = new Ray(new Vector3(0, 0, 0), new Vector3(0, 0, 0));
|
|
471
|
+
return Ray.CreateFromToToRef(origin, end, result, world);
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Function will update a transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be
|
|
475
|
+
* transformed to the given world matrix.
|
|
476
|
+
* @param origin The origin point
|
|
477
|
+
* @param end The end point
|
|
478
|
+
* @param result the object to store the result
|
|
479
|
+
* @param world a matrix to transform the ray to. Default is the identity matrix.
|
|
480
|
+
* @returns the ref ray
|
|
481
|
+
*/
|
|
482
|
+
static CreateFromToToRef(origin, end, result, world = Matrix.IdentityReadOnly) {
|
|
483
|
+
result.origin.copyFrom(origin);
|
|
484
|
+
const direction = end.subtractToRef(origin, result.direction);
|
|
485
|
+
const length = Math.sqrt(direction.x * direction.x + direction.y * direction.y + direction.z * direction.z);
|
|
486
|
+
result.length = length;
|
|
487
|
+
result.direction.normalize();
|
|
488
|
+
return Ray.TransformToRef(result, world, result);
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Transforms a ray by a matrix
|
|
492
|
+
* @param ray ray to transform
|
|
493
|
+
* @param matrix matrix to apply
|
|
494
|
+
* @returns the resulting new ray
|
|
495
|
+
*/
|
|
496
|
+
static Transform(ray, matrix) {
|
|
497
|
+
const result = new Ray(new Vector3(0, 0, 0), new Vector3(0, 0, 0));
|
|
498
|
+
Ray.TransformToRef(ray, matrix, result);
|
|
499
|
+
return result;
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Transforms a ray by a matrix
|
|
503
|
+
* @param ray ray to transform
|
|
504
|
+
* @param matrix matrix to apply
|
|
505
|
+
* @param result ray to store result in
|
|
506
|
+
* @returns the updated result ray
|
|
507
|
+
*/
|
|
508
|
+
static TransformToRef(ray, matrix, result) {
|
|
509
|
+
Vector3.TransformCoordinatesToRef(ray.origin, matrix, result.origin);
|
|
510
|
+
Vector3.TransformNormalToRef(ray.direction, matrix, result.direction);
|
|
511
|
+
result.length = ray.length;
|
|
512
|
+
result.epsilon = ray.epsilon;
|
|
513
|
+
const dir = result.direction;
|
|
514
|
+
const len = dir.length();
|
|
515
|
+
if (!(len === 0 || len === 1)) {
|
|
516
|
+
const num = 1.0 / len;
|
|
517
|
+
dir.x *= num;
|
|
518
|
+
dir.y *= num;
|
|
519
|
+
dir.z *= num;
|
|
520
|
+
result.length *= len;
|
|
521
|
+
}
|
|
522
|
+
return result;
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Unproject a ray from screen space to object space
|
|
526
|
+
* @param sourceX defines the screen space x coordinate to use
|
|
527
|
+
* @param sourceY defines the screen space y coordinate to use
|
|
528
|
+
* @param viewportWidth defines the current width of the viewport
|
|
529
|
+
* @param viewportHeight defines the current height of the viewport
|
|
530
|
+
* @param world defines the world matrix to use (can be set to Identity to go to world space)
|
|
531
|
+
* @param view defines the view matrix to use
|
|
532
|
+
* @param projection defines the projection matrix to use
|
|
533
|
+
*/
|
|
534
|
+
unprojectRayToRef(sourceX, sourceY, viewportWidth, viewportHeight, world, view, projection) {
|
|
535
|
+
const matrix = TmpVectors.Matrix[0];
|
|
536
|
+
world.multiplyToRef(view, matrix);
|
|
537
|
+
matrix.multiplyToRef(projection, matrix);
|
|
538
|
+
matrix.invert();
|
|
539
|
+
const engine = EngineStore.LastCreatedEngine;
|
|
540
|
+
const nearScreenSource = TmpVectors.Vector3[0];
|
|
541
|
+
nearScreenSource.x = (sourceX / viewportWidth) * 2 - 1;
|
|
542
|
+
nearScreenSource.y = -((sourceY / viewportHeight) * 2 - 1);
|
|
543
|
+
nearScreenSource.z = engine?.useReverseDepthBuffer ? 1 : engine?.isNDCHalfZRange ? 0 : -1;
|
|
544
|
+
// far Z need to be close but < to 1 or camera projection matrix with maxZ = 0 will NaN
|
|
545
|
+
const farScreenSource = TmpVectors.Vector3[1].copyFromFloats(nearScreenSource.x, nearScreenSource.y, 1.0 - 1e-8);
|
|
546
|
+
const nearVec3 = TmpVectors.Vector3[2];
|
|
547
|
+
const farVec3 = TmpVectors.Vector3[3];
|
|
548
|
+
Vector3._UnprojectFromInvertedMatrixToRef(nearScreenSource, matrix, nearVec3);
|
|
549
|
+
Vector3._UnprojectFromInvertedMatrixToRef(farScreenSource, matrix, farVec3);
|
|
550
|
+
this.origin.copyFrom(nearVec3);
|
|
551
|
+
farVec3.subtractToRef(nearVec3, this.direction);
|
|
552
|
+
this.direction.normalize();
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
Ray._TmpVector3 = BuildArray(6, Vector3.Zero);
|
|
556
|
+
Ray._RayDistant = Ray.Zero();
|
|
557
|
+
Ray._Smallnum = 0.00000001;
|
|
558
|
+
Ray._Rayl = 10e8;
|
|
559
|
+
/**
|
|
560
|
+
* Creates a ray that can be used to pick in the scene
|
|
561
|
+
* @param scene defines the scene to use for the picking
|
|
562
|
+
* @param x defines the x coordinate of the origin (on-screen)
|
|
563
|
+
* @param y defines the y coordinate of the origin (on-screen)
|
|
564
|
+
* @param world defines the world matrix to use if you want to pick in object space (instead of world space)
|
|
565
|
+
* @param camera defines the camera to use for the picking
|
|
566
|
+
* @param cameraViewSpace defines if picking will be done in view space (false by default)
|
|
567
|
+
* @returns a Ray
|
|
568
|
+
*/
|
|
569
|
+
function CreatePickingRay(scene, x, y, world, camera, cameraViewSpace = false) {
|
|
570
|
+
const result = Ray.Zero();
|
|
571
|
+
CreatePickingRayToRef(scene, x, y, world, result, camera, cameraViewSpace);
|
|
572
|
+
return result;
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Creates a ray that can be used to pick in the scene
|
|
576
|
+
* @param scene defines the scene to use for the picking
|
|
577
|
+
* @param x defines the x coordinate of the origin (on-screen)
|
|
578
|
+
* @param y defines the y coordinate of the origin (on-screen)
|
|
579
|
+
* @param world defines the world matrix to use if you want to pick in object space (instead of world space)
|
|
580
|
+
* @param result defines the ray where to store the picking ray
|
|
581
|
+
* @param camera defines the camera to use for the picking
|
|
582
|
+
* @param cameraViewSpace defines if picking will be done in view space (false by default)
|
|
583
|
+
* @param enableDistantPicking defines if picking should handle large values for mesh position/scaling (false by default)
|
|
584
|
+
* @returns the current scene
|
|
585
|
+
*/
|
|
586
|
+
function CreatePickingRayToRef(scene, x, y, world, result, camera, cameraViewSpace = false, enableDistantPicking = false) {
|
|
587
|
+
const engine = scene.getEngine();
|
|
588
|
+
if (!camera && !(camera = scene.activeCamera)) {
|
|
589
|
+
return scene;
|
|
590
|
+
}
|
|
591
|
+
const cameraViewport = camera.viewport;
|
|
592
|
+
const renderHeight = engine.getRenderHeight();
|
|
593
|
+
const { x: vx, y: vy, width, height } = cameraViewport.toGlobal(engine.getRenderWidth(), renderHeight);
|
|
594
|
+
// Moving coordinates to local viewport world
|
|
595
|
+
const levelInv = 1 / engine.getHardwareScalingLevel();
|
|
596
|
+
x = x * levelInv - vx;
|
|
597
|
+
y = y * levelInv - (renderHeight - vy - height);
|
|
598
|
+
result.update(x, y, width, height, world ? world : Matrix.IdentityReadOnly, cameraViewSpace ? Matrix.IdentityReadOnly : camera.getViewMatrix(), camera.getProjectionMatrix(), enableDistantPicking);
|
|
599
|
+
return scene;
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* Creates a ray that can be used to pick in the scene
|
|
603
|
+
* @param scene defines the scene to use for the picking
|
|
604
|
+
* @param x defines the x coordinate of the origin (on-screen)
|
|
605
|
+
* @param y defines the y coordinate of the origin (on-screen)
|
|
606
|
+
* @param camera defines the camera to use for the picking
|
|
607
|
+
* @returns a Ray
|
|
608
|
+
*/
|
|
609
|
+
function CreatePickingRayInCameraSpace(scene, x, y, camera) {
|
|
610
|
+
const result = Ray.Zero();
|
|
611
|
+
CreatePickingRayInCameraSpaceToRef(scene, x, y, result, camera);
|
|
612
|
+
return result;
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* Creates a ray that can be used to pick in the scene
|
|
616
|
+
* @param scene defines the scene to use for the picking
|
|
617
|
+
* @param x defines the x coordinate of the origin (on-screen)
|
|
618
|
+
* @param y defines the y coordinate of the origin (on-screen)
|
|
619
|
+
* @param result defines the ray where to store the picking ray
|
|
620
|
+
* @param camera defines the camera to use for the picking
|
|
621
|
+
* @returns the current scene
|
|
622
|
+
*/
|
|
623
|
+
function CreatePickingRayInCameraSpaceToRef(scene, x, y, result, camera) {
|
|
624
|
+
if (!PickingInfo) {
|
|
625
|
+
return scene;
|
|
626
|
+
}
|
|
627
|
+
const engine = scene.getEngine();
|
|
628
|
+
if (!camera && !(camera = scene.activeCamera)) {
|
|
629
|
+
throw new Error("Active camera not set");
|
|
630
|
+
}
|
|
631
|
+
const cameraViewport = camera.viewport;
|
|
632
|
+
const renderHeight = engine.getRenderHeight();
|
|
633
|
+
const { x: vx, y: vy, width, height } = cameraViewport.toGlobal(engine.getRenderWidth(), renderHeight);
|
|
634
|
+
const identity = Matrix.Identity();
|
|
635
|
+
// Moving coordinates to local viewport world
|
|
636
|
+
const levelInv = 1 / engine.getHardwareScalingLevel();
|
|
637
|
+
x = x * levelInv - vx;
|
|
638
|
+
y = y * levelInv - (renderHeight - vy - height);
|
|
639
|
+
result.update(x, y, width, height, identity, identity, camera.getProjectionMatrix());
|
|
640
|
+
return scene;
|
|
641
|
+
}
|
|
642
|
+
function InternalPickForMesh(pickingInfo, rayFunction, mesh, world, fastCheck, onlyBoundingInfo, trianglePredicate, skipBoundingInfo) {
|
|
643
|
+
const ray = rayFunction(world, mesh.enableDistantPicking);
|
|
644
|
+
const result = mesh.intersects(ray, fastCheck, trianglePredicate, onlyBoundingInfo, world, skipBoundingInfo);
|
|
645
|
+
if (!result || !result.hit) {
|
|
646
|
+
return null;
|
|
647
|
+
}
|
|
648
|
+
if (!fastCheck && pickingInfo != null && result.distance >= pickingInfo.distance) {
|
|
649
|
+
return null;
|
|
650
|
+
}
|
|
651
|
+
return result;
|
|
652
|
+
}
|
|
653
|
+
function InternalPick(scene, rayFunction, predicate, fastCheck, onlyBoundingInfo, trianglePredicate) {
|
|
654
|
+
let pickingInfo = null;
|
|
655
|
+
const computeWorldMatrixForCamera = !!(scene.activeCameras && scene.activeCameras.length > 1 && scene.cameraToUseForPointers !== scene.activeCamera);
|
|
656
|
+
const currentCamera = scene.cameraToUseForPointers || scene.activeCamera;
|
|
657
|
+
const picker = InternalPickForMesh;
|
|
658
|
+
for (let meshIndex = 0; meshIndex < scene.meshes.length; meshIndex++) {
|
|
659
|
+
const mesh = scene.meshes[meshIndex];
|
|
660
|
+
if (predicate) {
|
|
661
|
+
if (!predicate(mesh, -1)) {
|
|
662
|
+
continue;
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
else if (!mesh.isEnabled() || !mesh.isVisible || !mesh.isPickable) {
|
|
666
|
+
continue;
|
|
667
|
+
}
|
|
668
|
+
const forceCompute = computeWorldMatrixForCamera && mesh.isWorldMatrixCameraDependent();
|
|
669
|
+
const world = mesh.computeWorldMatrix(forceCompute, currentCamera);
|
|
670
|
+
if (mesh.hasThinInstances && mesh.thinInstanceEnablePicking) {
|
|
671
|
+
// first check if the ray intersects the whole bounding box/sphere of the mesh
|
|
672
|
+
const result = picker(pickingInfo, rayFunction, mesh, world, true, true, trianglePredicate);
|
|
673
|
+
if (result) {
|
|
674
|
+
if (onlyBoundingInfo) {
|
|
675
|
+
// the user only asked for a bounding info check so we can return
|
|
676
|
+
return result;
|
|
677
|
+
}
|
|
678
|
+
const tmpMatrix = TmpVectors.Matrix[1];
|
|
679
|
+
const thinMatrices = mesh.thinInstanceGetWorldMatrices();
|
|
680
|
+
for (let index = 0; index < thinMatrices.length; index++) {
|
|
681
|
+
if (predicate && !predicate(mesh, index)) {
|
|
682
|
+
continue;
|
|
683
|
+
}
|
|
684
|
+
const thinMatrix = thinMatrices[index];
|
|
685
|
+
thinMatrix.multiplyToRef(world, tmpMatrix);
|
|
686
|
+
const result = picker(pickingInfo, rayFunction, mesh, tmpMatrix, fastCheck, onlyBoundingInfo, trianglePredicate, true);
|
|
687
|
+
if (result) {
|
|
688
|
+
pickingInfo = result;
|
|
689
|
+
pickingInfo.thinInstanceIndex = index;
|
|
690
|
+
if (fastCheck) {
|
|
691
|
+
return pickingInfo;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
else {
|
|
698
|
+
const result = picker(pickingInfo, rayFunction, mesh, world, fastCheck, onlyBoundingInfo, trianglePredicate);
|
|
699
|
+
if (result) {
|
|
700
|
+
pickingInfo = result;
|
|
701
|
+
if (fastCheck) {
|
|
702
|
+
return pickingInfo;
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
return pickingInfo || new PickingInfo();
|
|
708
|
+
}
|
|
709
|
+
function InternalMultiPick(scene, rayFunction, predicate, trianglePredicate) {
|
|
710
|
+
if (!PickingInfo) {
|
|
711
|
+
return null;
|
|
712
|
+
}
|
|
713
|
+
const pickingInfos = [];
|
|
714
|
+
const computeWorldMatrixForCamera = !!(scene.activeCameras && scene.activeCameras.length > 1 && scene.cameraToUseForPointers !== scene.activeCamera);
|
|
715
|
+
const currentCamera = scene.cameraToUseForPointers || scene.activeCamera;
|
|
716
|
+
const picker = InternalPickForMesh;
|
|
717
|
+
for (let meshIndex = 0; meshIndex < scene.meshes.length; meshIndex++) {
|
|
718
|
+
const mesh = scene.meshes[meshIndex];
|
|
719
|
+
if (predicate) {
|
|
720
|
+
if (!predicate(mesh, -1)) {
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
else if (!mesh.isEnabled() || !mesh.isVisible || !mesh.isPickable) {
|
|
725
|
+
continue;
|
|
726
|
+
}
|
|
727
|
+
const forceCompute = computeWorldMatrixForCamera && mesh.isWorldMatrixCameraDependent();
|
|
728
|
+
const world = mesh.computeWorldMatrix(forceCompute, currentCamera);
|
|
729
|
+
if (mesh.hasThinInstances && mesh.thinInstanceEnablePicking) {
|
|
730
|
+
const result = picker(null, rayFunction, mesh, world, true, true, trianglePredicate);
|
|
731
|
+
if (result) {
|
|
732
|
+
const tmpMatrix = TmpVectors.Matrix[1];
|
|
733
|
+
const thinMatrices = mesh.thinInstanceGetWorldMatrices();
|
|
734
|
+
for (let index = 0; index < thinMatrices.length; index++) {
|
|
735
|
+
if (predicate && !predicate(mesh, index)) {
|
|
736
|
+
continue;
|
|
737
|
+
}
|
|
738
|
+
const thinMatrix = thinMatrices[index];
|
|
739
|
+
thinMatrix.multiplyToRef(world, tmpMatrix);
|
|
740
|
+
const result = picker(null, rayFunction, mesh, tmpMatrix, false, false, trianglePredicate, true);
|
|
741
|
+
if (result) {
|
|
742
|
+
result.thinInstanceIndex = index;
|
|
743
|
+
pickingInfos.push(result);
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
else {
|
|
749
|
+
const result = picker(null, rayFunction, mesh, world, false, false, trianglePredicate);
|
|
750
|
+
if (result) {
|
|
751
|
+
pickingInfos.push(result);
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
return pickingInfos;
|
|
756
|
+
}
|
|
757
|
+
/** Launch a ray to try to pick a mesh in the scene using only bounding information of the main mesh (not using submeshes)
|
|
758
|
+
* @param scene defines the scene to use for the picking
|
|
759
|
+
* @param x position on screen
|
|
760
|
+
* @param y position on screen
|
|
761
|
+
* @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced
|
|
762
|
+
* @param fastCheck defines if the first intersection will be used (and not the closest)
|
|
763
|
+
* @param camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
|
|
764
|
+
* @returns a PickingInfo (Please note that some info will not be set like distance, bv, bu and everything that cannot be capture by only using bounding infos)
|
|
765
|
+
*/
|
|
766
|
+
function PickWithBoundingInfo(scene, x, y, predicate, fastCheck, camera) {
|
|
767
|
+
if (!PickingInfo) {
|
|
768
|
+
return null;
|
|
769
|
+
}
|
|
770
|
+
const result = InternalPick(scene, (world) => {
|
|
771
|
+
if (!scene._tempPickingRay) {
|
|
772
|
+
scene._tempPickingRay = Ray.Zero();
|
|
773
|
+
}
|
|
774
|
+
CreatePickingRayToRef(scene, x, y, world, scene._tempPickingRay, camera || null);
|
|
775
|
+
return scene._tempPickingRay;
|
|
776
|
+
}, predicate, fastCheck, true);
|
|
777
|
+
if (result) {
|
|
778
|
+
result.ray = CreatePickingRay(scene, x, y, Matrix.Identity(), camera || null);
|
|
779
|
+
}
|
|
780
|
+
return result;
|
|
781
|
+
}
|
|
782
|
+
/** Launch a ray to try to pick a mesh in the scene
|
|
783
|
+
* @param scene defines the scene to use for the picking
|
|
784
|
+
* @param x position on screen
|
|
785
|
+
* @param y position on screen
|
|
786
|
+
* @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced
|
|
787
|
+
* @param fastCheck defines if the first intersection will be used (and not the closest)
|
|
788
|
+
* @param camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
|
|
789
|
+
* @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
|
|
790
|
+
* @param _enableDistantPicking defines if picking should handle large values for mesh position/scaling (false by default)
|
|
791
|
+
* @returns a PickingInfo
|
|
792
|
+
*/
|
|
793
|
+
function Pick(scene, x, y, predicate, fastCheck, camera, trianglePredicate, _enableDistantPicking = false) {
|
|
794
|
+
const result = InternalPick(scene, (world, enableDistantPicking) => {
|
|
795
|
+
if (!scene._tempPickingRay) {
|
|
796
|
+
scene._tempPickingRay = Ray.Zero();
|
|
797
|
+
}
|
|
798
|
+
CreatePickingRayToRef(scene, x, y, world, scene._tempPickingRay, camera || null, false, enableDistantPicking);
|
|
799
|
+
return scene._tempPickingRay;
|
|
800
|
+
}, predicate, fastCheck, false, trianglePredicate);
|
|
801
|
+
if (result) {
|
|
802
|
+
result.ray = CreatePickingRay(scene, x, y, Matrix.Identity(), camera || null);
|
|
803
|
+
}
|
|
804
|
+
return result;
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* Use the given ray to pick a mesh in the scene. A mesh triangle can be picked both from its front and back sides,
|
|
808
|
+
* irrespective of orientation.
|
|
809
|
+
* @param scene defines the scene to use for the picking
|
|
810
|
+
* @param ray The ray to use to pick meshes
|
|
811
|
+
* @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must have isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced
|
|
812
|
+
* @param fastCheck defines if the first intersection will be used (and not the closest)
|
|
813
|
+
* @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
|
|
814
|
+
* @returns a PickingInfo
|
|
815
|
+
*/
|
|
816
|
+
function PickWithRay(scene, ray, predicate, fastCheck, trianglePredicate) {
|
|
817
|
+
const result = InternalPick(scene, (world) => {
|
|
818
|
+
if (!scene._pickWithRayInverseMatrix) {
|
|
819
|
+
scene._pickWithRayInverseMatrix = Matrix.Identity();
|
|
820
|
+
}
|
|
821
|
+
world.invertToRef(scene._pickWithRayInverseMatrix);
|
|
822
|
+
if (!scene._cachedRayForTransform) {
|
|
823
|
+
scene._cachedRayForTransform = Ray.Zero();
|
|
824
|
+
}
|
|
825
|
+
Ray.TransformToRef(ray, scene._pickWithRayInverseMatrix, scene._cachedRayForTransform);
|
|
826
|
+
return scene._cachedRayForTransform;
|
|
827
|
+
}, predicate, fastCheck, false, trianglePredicate);
|
|
828
|
+
if (result) {
|
|
829
|
+
result.ray = ray;
|
|
830
|
+
}
|
|
831
|
+
return result;
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* Launch a ray to try to pick a mesh in the scene. A mesh triangle can be picked both from its front and back sides,
|
|
835
|
+
* irrespective of orientation.
|
|
836
|
+
* @param scene defines the scene to use for the picking
|
|
837
|
+
* @param x X position on screen
|
|
838
|
+
* @param y Y position on screen
|
|
839
|
+
* @param predicate Predicate function used to determine eligible meshes and instances. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced
|
|
840
|
+
* @param camera camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
|
|
841
|
+
* @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
|
|
842
|
+
* @returns an array of PickingInfo
|
|
843
|
+
*/
|
|
844
|
+
function MultiPick(scene, x, y, predicate, camera, trianglePredicate) {
|
|
845
|
+
return InternalMultiPick(scene, (world) => CreatePickingRay(scene, x, y, world, camera || null), predicate, trianglePredicate);
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* Launch a ray to try to pick a mesh in the scene
|
|
849
|
+
* @param scene defines the scene to use for the picking
|
|
850
|
+
* @param ray Ray to use
|
|
851
|
+
* @param predicate Predicate function used to determine eligible meshes and instances. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced
|
|
852
|
+
* @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
|
|
853
|
+
* @returns an array of PickingInfo
|
|
854
|
+
*/
|
|
855
|
+
function MultiPickWithRay(scene, ray, predicate, trianglePredicate) {
|
|
856
|
+
return InternalMultiPick(scene, (world) => {
|
|
857
|
+
if (!scene._pickWithRayInverseMatrix) {
|
|
858
|
+
scene._pickWithRayInverseMatrix = Matrix.Identity();
|
|
859
|
+
}
|
|
860
|
+
world.invertToRef(scene._pickWithRayInverseMatrix);
|
|
861
|
+
if (!scene._cachedRayForTransform) {
|
|
862
|
+
scene._cachedRayForTransform = Ray.Zero();
|
|
863
|
+
}
|
|
864
|
+
Ray.TransformToRef(ray, scene._pickWithRayInverseMatrix, scene._cachedRayForTransform);
|
|
865
|
+
return scene._cachedRayForTransform;
|
|
866
|
+
}, predicate, trianglePredicate);
|
|
867
|
+
}
|
|
868
|
+
/**
|
|
869
|
+
* Gets a ray in the forward direction from the camera.
|
|
870
|
+
* @param camera Defines the camera to use to get the ray from
|
|
871
|
+
* @param refRay the ray to (re)use when setting the values
|
|
872
|
+
* @param length Defines the length of the ray to create
|
|
873
|
+
* @param transform Defines the transform to apply to the ray, by default the world matrx is used to create a workd space ray
|
|
874
|
+
* @param origin Defines the start point of the ray which defaults to the camera position
|
|
875
|
+
* @returns the forward ray
|
|
876
|
+
*/
|
|
877
|
+
function GetForwardRayToRef(camera, refRay, length = 100, transform, origin) {
|
|
878
|
+
if (!transform) {
|
|
879
|
+
transform = camera.getWorldMatrix();
|
|
880
|
+
}
|
|
881
|
+
refRay.length = length;
|
|
882
|
+
if (origin) {
|
|
883
|
+
refRay.origin.copyFrom(origin);
|
|
884
|
+
}
|
|
885
|
+
else {
|
|
886
|
+
refRay.origin.copyFrom(camera.position);
|
|
887
|
+
}
|
|
888
|
+
const forward = TmpVectors.Vector3[2];
|
|
889
|
+
forward.set(0, 0, camera._scene.useRightHandedSystem ? -1 : 1);
|
|
890
|
+
const worldForward = TmpVectors.Vector3[3];
|
|
891
|
+
Vector3.TransformNormalToRef(forward, transform, worldForward);
|
|
892
|
+
Vector3.NormalizeToRef(worldForward, refRay.direction);
|
|
893
|
+
return refRay;
|
|
894
|
+
}
|
|
895
|
+
/**
|
|
896
|
+
* Initialize the minimal interdependecies between the Ray and Scene and Camera
|
|
897
|
+
* @param sceneClass defines the scene prototype to use
|
|
898
|
+
* @param cameraClass defines the camera prototype to use
|
|
899
|
+
*/
|
|
900
|
+
function AddRayExtensions(sceneClass, cameraClass) {
|
|
901
|
+
if (cameraClass) {
|
|
902
|
+
cameraClass.prototype.getForwardRay = function (length = 100, transform, origin) {
|
|
903
|
+
return GetForwardRayToRef(this, new Ray(Vector3.Zero(), Vector3.Zero(), length), length, transform, origin);
|
|
904
|
+
};
|
|
905
|
+
cameraClass.prototype.getForwardRayToRef = function (refRay, length = 100, transform, origin) {
|
|
906
|
+
return GetForwardRayToRef(this, refRay, length, transform, origin);
|
|
907
|
+
};
|
|
908
|
+
}
|
|
909
|
+
if (!sceneClass) {
|
|
910
|
+
return;
|
|
911
|
+
}
|
|
912
|
+
_ImportHelper._IsPickingAvailable = true;
|
|
913
|
+
sceneClass.prototype.createPickingRay = function (x, y, world, camera, cameraViewSpace = false) {
|
|
914
|
+
return CreatePickingRay(this, x, y, world, camera, cameraViewSpace);
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
// Picking
|
|
919
|
+
AddRayExtensions(Scene, Camera);
|
|
920
|
+
Scene.prototype.createPickingRayToRef = function (x, y, world, result, camera, cameraViewSpace = false, enableDistantPicking = false) {
|
|
921
|
+
return CreatePickingRayToRef(this, x, y, world, result, camera, cameraViewSpace, enableDistantPicking);
|
|
922
|
+
};
|
|
923
|
+
Scene.prototype.createPickingRayInCameraSpace = function (x, y, camera) {
|
|
924
|
+
return CreatePickingRayInCameraSpace(this, x, y, camera);
|
|
925
|
+
};
|
|
926
|
+
Scene.prototype.createPickingRayInCameraSpaceToRef = function (x, y, result, camera) {
|
|
927
|
+
return CreatePickingRayInCameraSpaceToRef(this, x, y, result, camera);
|
|
928
|
+
};
|
|
929
|
+
Scene.prototype.pickWithBoundingInfo = function (x, y, predicate, fastCheck, camera) {
|
|
930
|
+
return PickWithBoundingInfo(this, x, y, predicate, fastCheck, camera);
|
|
931
|
+
};
|
|
932
|
+
Scene.prototype.pick = function (x, y, predicate, fastCheck, camera, trianglePredicate, _enableDistantPicking = false) {
|
|
933
|
+
return Pick(this, x, y, predicate, fastCheck, camera, trianglePredicate, _enableDistantPicking);
|
|
934
|
+
};
|
|
935
|
+
Scene.prototype.pickWithRay = function (ray, predicate, fastCheck, trianglePredicate) {
|
|
936
|
+
return PickWithRay(this, ray, predicate, fastCheck, trianglePredicate);
|
|
937
|
+
};
|
|
938
|
+
Scene.prototype.multiPick = function (x, y, predicate, camera, trianglePredicate) {
|
|
939
|
+
return MultiPick(this, x, y, predicate, camera, trianglePredicate);
|
|
940
|
+
};
|
|
941
|
+
Scene.prototype.multiPickWithRay = function (ray, predicate, trianglePredicate) {
|
|
942
|
+
return MultiPickWithRay(this, ray, predicate, trianglePredicate);
|
|
943
|
+
};
|
|
944
|
+
|
|
945
|
+
export { AddRayExtensions, CreatePickingRay, CreatePickingRayInCameraSpace, CreatePickingRayInCameraSpaceToRef, CreatePickingRayToRef, GetForwardRayToRef, MultiPick, MultiPickWithRay, Pick, PickWithBoundingInfo, PickWithRay, Ray };
|
|
946
|
+
//# sourceMappingURL=ray-nTZBkOil.esm.js.map
|