From f9ffd235630d3433f3feacf77b33ae5198520af4 Mon Sep 17 00:00:00 2001 From: Muhammad Saad Jumani Date: Fri, 6 May 2022 17:20:19 +0500 Subject: [PATCH] Interior updated --- 1390892.json | 2 +- __game-scripts.js | 2 +- config.json | 2 +- playcanvas-stable.min.js | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/1390892.json b/1390892.json index efa0ec1..22d982c 100644 --- a/1390892.json +++ b/1390892.json @@ -1 +1 @@ -{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","name":"Untitled","created":"2022-04-14T19:03:47.042Z","settings":{"physics":{"gravity":[0,-9.8,0]},"render":{"lightmapFilterRange":10,"tonemapping":0,"ambientBakeOcclusionContrast":0,"skybox":null,"lightmapFilterSmoothness":0.2,"gamma_correction":1,"fog_start":1,"skyboxIntensity":1,"fog_color":[0,0,0],"lightmapMode":1,"ambientBakeSpherePart":0.4,"fog":"none","lightmapMaxResolution":2048,"skyboxMip":0,"lightmapSizeMultiplier":16,"fog_end":1000,"lightmapFilterEnabled":false,"ambientBake":false,"fog_density":0.01,"exposure":1,"global_ambient":[0.2,0.2,0.2],"ambientBakeNumSamples":1,"ambientBakeOcclusionBrightness":0,"skyboxRotation":[0,0,0]}},"entities":{"9cb346f8-bc25-11ec-baee-d62e0a56bcb8":{"position":[0,1.312804937362671,-5],"scale":[1,1,1],"name":"Camera","parent":"9cb34568-bc25-11ec-baee-d62e0a56bcb8","resource_id":"9cb346f8-bc25-11ec-baee-d62e0a56bcb8","components":{"camera":{"projection":0,"farClip":1000,"clearColorBuffer":true,"layers":[0,1,2,3,4],"priority":0,"fov":45,"clearDepthBuffer":true,"frustumCulling":true,"clearColor":[0.118,0.118,0.118,1],"enabled":true,"orthoHeight":4,"nearClip":0.1,"rect":[0,0,1,1]},"script":{"enabled":true,"order":["pickerRaycast"],"scripts":{"pickerRaycast":{"enabled":true,"attributes":{}}}}},"rotation":[180,2.5444437451708134e-14,180],"tags":[],"enabled":true,"children":[]},"9cb347f2-bc25-11ec-baee-d62e0a56bcb8":{"position":[2,2,-2],"scale":[1,1,1],"name":"Light","parent":"9cb34568-bc25-11ec-baee-d62e0a56bcb8","resource_id":"9cb347f2-bc25-11ec-baee-d62e0a56bcb8","components":{"light":{"castShadows":true,"isStatic":false,"vsmBlurSize":11,"shadowUpdateMode":2,"normalOffsetBias":0.05,"color":[1,1,1],"bakeArea":0,"numCascades":1,"outerConeAngle":45,"bakeNumSamples":1,"affectDynamic":true,"intensity":1,"bakeDir":true,"cookieAngle":0,"affectLightmapped":false,"cookieChannel":"rgb","innerConeAngle":40,"shadowBias":0.2,"bake":false,"falloffMode":0,"cookieAsset":null,"vsmBias":0.01,"layers":[0],"cookieIntensity":1,"cascadeDistribution":0.5,"cookieOffset":[0,0],"shadowResolution":1024,"cookieScale":[1,1],"enabled":false,"shape":0,"range":8,"vsmBlurMode":1,"shadowDistance":16,"type":"directional","cookieFalloff":true,"shadowType":0}},"rotation":[45,135,0],"tags":[],"enabled":true,"children":[]},"9cb34568-bc25-11ec-baee-d62e0a56bcb8":{"position":[0,0,0],"scale":[1,1,1],"name":"Root","parent":null,"resource_id":"9cb34568-bc25-11ec-baee-d62e0a56bcb8","components":{},"rotation":[0,0,0],"tags":[],"enabled":true,"children":["9cb346f8-bc25-11ec-baee-d62e0a56bcb8","9cb347f2-bc25-11ec-baee-d62e0a56bcb8","22167d55-25a5-4148-9b6c-990202e40293","3d941a31-278b-4806-8e28-19e8040a8232","f0f8f8f2-8749-48db-a9d9-b24c738d8913"]},"c040964c-0b12-45a9-bf11-e4aa25d5b9db":{"name":"Plane","tags":[],"enabled":true,"resource_id":"c040964c-0b12-45a9-bf11-e4aa25d5b9db","parent":"22167d55-25a5-4148-9b6c-990202e40293","children":[],"position":[0.025807051390890817,-8.742268278183474e-7,-0.3270192418237561],"rotation":[0,0,0],"scale":[1,1,1],"components":{"render":{"enabled":true,"type":"plane","asset":null,"materialAssets":[78072855],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null},"script":{"enabled":true,"order":["switchingTextures"],"scripts":{"switchingTextures":{"enabled":true,"attributes":{"textures":[78072763,78072763],"url":"https://farsh-mobile.s3.me-south-1.amazonaws.com/cdn/loonie1.png","WebTexture":null}}}}}},"3d941a31-278b-4806-8e28-19e8040a8232":{"enabled":true,"tags":[],"children":["559c7d7f-e35c-4349-9993-b4361a7cd124"],"position":[0,0,2.102861961682632],"rotation":[360,90,0],"scale":[0.00801352120321123,0.003093432959569368,0.0049292920472502584],"resource_id":"3d941a31-278b-4806-8e28-19e8040a8232","name":"livingroom","components":{},"parent":"9cb34568-bc25-11ec-baee-d62e0a56bcb8","template_ent_ids":{"3d941a31-278b-4806-8e28-19e8040a8232":"992e38f0-dd22-4fe8-843f-5c80f0b4190f","559c7d7f-e35c-4349-9993-b4361a7cd124":"cf173562-138d-43de-b497-644f7ffe4239","62ccd1f3-5767-44f2-9193-ffa73fe2e9c6":"19b78e10-9bec-4619-80ff-e761bd368e6e","bcf973e8-eb88-4ab3-b280-7425854c4c40":"f637845d-7f0e-416e-a2da-27a804b90a26","7cb58f5e-9aa4-4d17-b8b2-7db4581ac210":"624e755c-e008-4e38-a4ae-e189b9e6af0e","35251334-db47-4176-8cff-515c607ee8e3":"8fd046ca-9bf2-4996-a426-d5f6f336a65b","b4933e85-8415-4d5f-a4d2-c43879b48e01":"235f5a54-087f-4b74-bcb8-e92fb0454a6f","22cd60ef-8fb8-4497-a662-5fc73472eefb":"92d77773-aa8e-4faa-a639-619c285b76f1","808a03c9-659f-4d1e-ad28-c83a3295d69c":"0e2a3a2c-7ef9-48a5-94f8-425b169eb692","67e25dc4-4a9f-49fc-b358-2cb1de96ee78":"9ea5ecb4-e90e-41e7-8464-9700435c402b","ca56ef18-a240-4297-bd58-5b04d7f9ccde":"7a7196e1-59de-4cee-831f-db20924f5a99","fa7b5cb6-00d8-4b88-9c86-cf1d018cfe9d":"03051ef6-4f3a-438e-9160-a8aea926e2d0","608f46a5-dd55-411e-81ec-29ac7adc517e":"3ce4c2c1-7a99-4730-a57c-346004bc1485","8f1aaf7e-8ab1-46fc-8a7d-ac391603dfbd":"90839ae3-cc29-477f-a88e-53fb57152250","0995bd62-11c1-40f3-b5c9-73f3df99b2d4":"04a75aae-eb81-4d94-8678-29e91bc7ff75","90a04939-5806-490e-af60-40c0e5726521":"26ac5c6d-406a-4e21-b3ce-6e451befe8e9","96379cae-b823-4135-9005-75ecd5078867":"0ca19a72-2469-4446-b3d5-d341756117d3","7de9bdec-06bb-4c2b-a5b5-9d539c247d6c":"afce77e7-aca3-481a-b7ad-35126ffafcde","225f53f4-35b9-48ab-a9ef-d045105420f4":"1dbd7266-a1ce-4993-a0c0-14bc38ef3479","e3db52ba-6801-43bb-9191-d1eed1bf9fe7":"d5b5339a-94b6-4efa-822b-9c5c7997f1e1","8540efe6-07b3-475a-b42b-3b973e9926a7":"232324a7-b6aa-4551-a098-bc9ea317773c","76a034d5-b7a7-4f67-80e6-da64d139d265":"1346743e-6c0f-4290-9590-f6e6b64494a1","42dec380-69b2-4102-8ed4-4c53347a7777":"8a26cc25-f015-4fc5-8cfc-d2366cd0ec11","41f0ea83-d79a-4305-989a-e8971adae5db":"8f969715-c24b-40d4-a640-80340cc8ddaf","17712308-3fb7-4346-9c92-28a4e9a30090":"71743733-1689-447d-b55b-ef36a1f9832f"},"template_id":78181896},"559c7d7f-e35c-4349-9993-b4361a7cd124":{"enabled":true,"tags":[],"children":["67e25dc4-4a9f-49fc-b358-2cb1de96ee78","ca56ef18-a240-4297-bd58-5b04d7f9ccde","76a034d5-b7a7-4f67-80e6-da64d139d265","41f0ea83-d79a-4305-989a-e8971adae5db"],"position":[0,0,0],"rotation":[0,0,0],"scale":[2.54,2.54,2.54],"resource_id":"559c7d7f-e35c-4349-9993-b4361a7cd124","name":"Fbx_Root","components":{},"parent":"3d941a31-278b-4806-8e28-19e8040a8232"},"67e25dc4-4a9f-49fc-b358-2cb1de96ee78":{"enabled":true,"tags":[],"children":[],"position":[129.593,0,84.7355],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"67e25dc4-4a9f-49fc-b358-2cb1de96ee78","name":"Plane01","components":{"render":{"enabled":true,"type":"asset","asset":78181884,"materialAssets":[78181754],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"559c7d7f-e35c-4349-9993-b4361a7cd124"},"41f0ea83-d79a-4305-989a-e8971adae5db":{"enabled":true,"tags":[],"children":[],"position":[151.448,178.646,280.302],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"41f0ea83-d79a-4305-989a-e8971adae5db","name":"Omni03","components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":0.2214,"castShadows":false,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":8,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}},"parent":"559c7d7f-e35c-4349-9993-b4361a7cd124"},"ca56ef18-a240-4297-bd58-5b04d7f9ccde":{"name":"C-Ext01","tags":[],"enabled":true,"resource_id":"ca56ef18-a240-4297-bd58-5b04d7f9ccde","parent":"559c7d7f-e35c-4349-9993-b4361a7cd124","children":[],"position":[385.604,0,-284.937],"rotation":[0,0,0],"scale":[1,1,1],"components":{"render":{"enabled":true,"type":"asset","asset":78181885,"materialAssets":[78181756],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}}},"76a034d5-b7a7-4f67-80e6-da64d139d265":{"name":"Omni01","tags":[],"enabled":true,"resource_id":"76a034d5-b7a7-4f67-80e6-da64d139d265","parent":"559c7d7f-e35c-4349-9993-b4361a7cd124","children":[],"position":[-65.75098866989103,150.47056222036824,84.29774646389346],"rotation":[0,0,0],"scale":[1,1,1],"components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":1.17,"castShadows":false,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":8,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}}},"f0f8f8f2-8749-48db-a9d9-b24c738d8913":{"enabled":true,"tags":[],"children":["155feed0-4828-4db3-bd69-ec82a43b842a"],"position":[2.0661966012532695,1.0520708560943604,2.8588311672210693],"rotation":[0,0,0],"scale":[0.10537460532856122,0.10537460532856122,0.10537460532856122],"resource_id":"f0f8f8f2-8749-48db-a9d9-b24c738d8913","name":"doorman","components":{"collision":{"enabled":true,"type":"box","halfExtents":[0.458,1.028,0.319],"radius":0.5,"axis":1,"height":2,"asset":null,"renderAsset":null},"rigidbody":{"enabled":true,"type":"kinematic","mass":1,"linearDamping":0,"angularDamping":0,"linearFactor":[1,1,1],"angularFactor":[1,1,1],"friction":0.5,"restitution":0.5},"script":{"enabled":true,"order":["mouse","touch"],"scripts":{"mouse":{"enabled":true,"attributes":{"Selected":0,"redMaterial":null,"greenMaterial":null,"blueMaterial":null}},"touch":{"enabled":true,"attributes":{"Selected":0}}}}},"parent":"9cb34568-bc25-11ec-baee-d62e0a56bcb8","template_ent_ids":{"f0f8f8f2-8749-48db-a9d9-b24c738d8913":"2cfeea72-a4bb-4a0e-8dad-abd92cc83dad","155feed0-4828-4db3-bd69-ec82a43b842a":"9ccb87a7-6e1d-4ae0-9c96-b3b5d27c22f2","a7c74765-6d1f-4585-83fa-3d1678d4565c":"a662f523-2a86-4f77-9951-1053085f7717","c4e7019f-d3ef-48c6-8f74-3d5beb2f2d4e":"fbf7970b-0b02-48c8-9fbb-6fbb5d4f3485","c7f8fe2d-4cc6-4e6b-9050-ec7eb392e1ca":"cafbe398-372c-44b5-a905-6a9ca90c105c","209d5672-6d22-4502-bbcd-704d9b2fad6b":"6147aeb5-2849-4302-80b1-7120263a14de"},"template_id":78401706},"155feed0-4828-4db3-bd69-ec82a43b842a":{"enabled":true,"tags":[],"children":["a7c74765-6d1f-4585-83fa-3d1678d4565c","c4e7019f-d3ef-48c6-8f74-3d5beb2f2d4e","c7f8fe2d-4cc6-4e6b-9050-ec7eb392e1ca","209d5672-6d22-4502-bbcd-704d9b2fad6b"],"position":[0.0000011739132332877489,-9.810510408982324,0.000005324964376995922],"rotation":[-180,0,-180],"scale":[2.997398613039719,2.997398613039719,2.997398613039719],"resource_id":"155feed0-4828-4db3-bd69-ec82a43b842a","name":"doorman_root","components":{},"parent":"f0f8f8f2-8749-48db-a9d9-b24c738d8913"},"a7c74765-6d1f-4585-83fa-3d1678d4565c":{"enabled":true,"tags":[],"children":[],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"a7c74765-6d1f-4585-83fa-3d1678d4565c","name":"rdmobj00","components":{"render":{"enabled":true,"type":"asset","asset":78401702,"materialAssets":[78401697],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"155feed0-4828-4db3-bd69-ec82a43b842a"},"c4e7019f-d3ef-48c6-8f74-3d5beb2f2d4e":{"enabled":true,"tags":[],"children":[],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"c4e7019f-d3ef-48c6-8f74-3d5beb2f2d4e","name":"rdmobj01","components":{"render":{"enabled":true,"type":"asset","asset":78401703,"materialAssets":[78401698],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"155feed0-4828-4db3-bd69-ec82a43b842a"},"c7f8fe2d-4cc6-4e6b-9050-ec7eb392e1ca":{"enabled":true,"tags":[],"children":[],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"c7f8fe2d-4cc6-4e6b-9050-ec7eb392e1ca","name":"rdmobj02","components":{"render":{"enabled":true,"type":"asset","asset":78401705,"materialAssets":[78401700],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"155feed0-4828-4db3-bd69-ec82a43b842a"},"209d5672-6d22-4502-bbcd-704d9b2fad6b":{"enabled":true,"tags":[],"children":[],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"209d5672-6d22-4502-bbcd-704d9b2fad6b","name":"rdmobj03","components":{"render":{"enabled":true,"type":"asset","asset":78401704,"materialAssets":[78401699],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"155feed0-4828-4db3-bd69-ec82a43b842a"},"22167d55-25a5-4148-9b6c-990202e40293":{"name":"Plane","tags":[],"enabled":true,"resource_id":"22167d55-25a5-4148-9b6c-990202e40293","parent":"9cb34568-bc25-11ec-baee-d62e0a56bcb8","children":["d03348cb-478b-4674-a566-e6d088570d7c","21011587-80d5-4b5f-827a-646a50c51f04","c040964c-0b12-45a9-bf11-e4aa25d5b9db"],"position":[-0.1034941432693432,0.3006536364555359,2.993325710296631],"rotation":[90,180,0],"scale":[1.8697205174118348,1.8697205174118348,1.8697205174118348],"components":{"render":{"enabled":false,"type":"plane","asset":null,"materialAssets":[78072855],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null},"script":{"enabled":true,"order":["mouse","touch","showHeightAndWidth"],"scripts":{"mouse":{"enabled":true,"attributes":{"redMaterial":null,"greenMaterial":null,"blueMaterial":null,"Selected":0}},"touch":{"enabled":true,"attributes":{"Selected":0}},"showHeightAndWidth":{"enabled":true,"attributes":{"width":"21011587-80d5-4b5f-827a-646a50c51f04","height":"d03348cb-478b-4674-a566-e6d088570d7c","hideInterval":5}}}},"collision":{"enabled":true,"type":"box","halfExtents":[0.451,0.046,1.364],"radius":0.5,"axis":1,"height":2,"asset":null,"renderAsset":null}}},"21011587-80d5-4b5f-827a-646a50c51f04":{"name":"WidthPlane","tags":[],"enabled":false,"resource_id":"21011587-80d5-4b5f-827a-646a50c51f04","parent":"22167d55-25a5-4148-9b6c-990202e40293","children":["817af38c-c49e-4345-8262-7ad8951af88c"],"position":[0.016248916703851257,0.03636760460318578,-0.8011533512191992],"rotation":[0,0,0],"scale":[0.5519397175109401,1,1],"components":{"render":{"enabled":true,"type":"plane","asset":null,"materialAssets":[79458597],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null},"script":{"enabled":true,"order":[],"scripts":{}}}},"d03348cb-478b-4674-a566-e6d088570d7c":{"name":"HeightPlane","tags":[],"enabled":false,"resource_id":"d03348cb-478b-4674-a566-e6d088570d7c","parent":"22167d55-25a5-4148-9b6c-990202e40293","children":["25b8dc8f-b9c3-4ea8-a69d-4a7f4bc9bc43"],"position":[0.30972888276372146,0.07273621094883254,-0.3444118296490938],"rotation":[-1.1349114719074897e-12,-89.31740387174081,1.1304134085385617e-12],"scale":[1,1,1],"components":{"render":{"enabled":true,"type":"plane","asset":null,"materialAssets":[79458597],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null},"script":{"enabled":true,"order":[],"scripts":{}}}},"25b8dc8f-b9c3-4ea8-a69d-4a7f4bc9bc43":{"name":"Text","tags":[],"enabled":true,"resource_id":"25b8dc8f-b9c3-4ea8-a69d-4a7f4bc9bc43","parent":"d03348cb-478b-4674-a566-e6d088570d7c","children":[],"position":[0.0025968772360304704,-5.2326313726425155e-8,-0.17825210191257268],"rotation":[-90,90,0],"scale":[0.004705564106317546,0.004705564106317546,0.004705564106317546],"components":{"element":{"enabled":true,"type":"text","anchor":[0.5,0.5,0.5,0.5],"pivot":[0.5,0.5],"text":"6'6","key":null,"fontAsset":79465530,"fontSize":32,"minFontSize":8,"maxFontSize":32,"autoFitWidth":false,"autoFitHeight":false,"maxLines":null,"lineHeight":32,"wrapLines":true,"spacing":1,"color":[0,0,0],"opacity":1,"textureAsset":null,"spriteAsset":null,"spriteFrame":0,"pixelsPerUnit":null,"width":42.953,"height":29.875,"margin":[-21.474,-14.938,-21.479,-14.937],"alignment":[0.5,0.5],"outlineColor":[1,1,1,1],"outlineThickness":0.1,"shadowColor":[0,0,0,1],"shadowOffset":[0,0],"rect":[0,0,1,1],"materialAsset":null,"autoWidth":true,"autoHeight":true,"useInput":false,"batchGroupId":null,"mask":false,"layers":[4],"enableMarkup":false},"script":{"enabled":true,"order":["getHeightFromUrlparams"],"scripts":{"getHeightFromUrlparams":{"enabled":true,"attributes":{}}}}}},"817af38c-c49e-4345-8262-7ad8951af88c":{"name":"Text","tags":[],"enabled":true,"resource_id":"817af38c-c49e-4345-8262-7ad8951af88c","parent":"21011587-80d5-4b5f-827a-646a50c51f04","children":[],"position":[3.1729249783118973e-10,-5.8503573319157454e-8,-0.093912709118815],"rotation":[-90,5.39872334669395e-15,-1.149867515828846e-14],"scale":[0.010722314017446152,0.005053979179437539,0.005053979179437539],"components":{"element":{"enabled":true,"type":"text","anchor":[0.5,0.5,0.5,0.5],"pivot":[0.5,0.5],"text":"2'5","key":null,"fontAsset":79465530,"fontSize":32,"minFontSize":8,"maxFontSize":32,"autoFitWidth":false,"autoFitHeight":false,"maxLines":null,"lineHeight":32,"wrapLines":true,"spacing":1,"color":[0,0,0],"opacity":1,"textureAsset":null,"spriteAsset":null,"spriteFrame":0,"pixelsPerUnit":null,"width":40.125,"height":29.875,"margin":[-20.062,-14.938,-20.063,-14.937],"alignment":[0.5,0.5],"outlineColor":[1,1,1,1],"outlineThickness":0.13,"shadowColor":[0,0,0,1],"shadowOffset":[0,0],"rect":[0,0,1,1],"materialAsset":null,"autoWidth":true,"autoHeight":true,"useInput":false,"batchGroupId":null,"mask":false,"layers":[4],"enableMarkup":false},"script":{"enabled":true,"order":["getWidthFromUrlparams"],"scripts":{"getWidthFromUrlparams":{"enabled":true,"attributes":{}}}}}}},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":1390892} \ No newline at end of file +{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","name":"Untitled","created":"2022-04-14T19:03:47.042Z","settings":{"physics":{"gravity":[0,-9.8,0]},"render":{"lightmapFilterRange":10,"tonemapping":0,"ambientBakeOcclusionContrast":0,"skybox":null,"lightmapFilterSmoothness":0.2,"gamma_correction":1,"fog_start":1,"skyboxIntensity":1,"fog_color":[0,0,0],"lightmapMode":1,"ambientBakeSpherePart":0.4,"fog":"none","lightmapMaxResolution":2048,"skyboxMip":0,"lightmapSizeMultiplier":16,"fog_end":1000,"lightmapFilterEnabled":false,"ambientBake":false,"fog_density":0.01,"exposure":1,"global_ambient":[0.2,0.2,0.2],"ambientBakeNumSamples":1,"ambientBakeOcclusionBrightness":0,"skyboxRotation":[0,0,0]}},"entities":{"9cb346f8-bc25-11ec-baee-d62e0a56bcb8":{"position":[0.6755273036174856,1.523343563079834,-5.283106803894043],"scale":[1,1,1],"name":"Camera","parent":"9cb34568-bc25-11ec-baee-d62e0a56bcb8","resource_id":"9cb346f8-bc25-11ec-baee-d62e0a56bcb8","components":{"camera":{"projection":0,"farClip":1000,"clearColorBuffer":true,"layers":[0,1,2,3,4],"priority":0,"fov":45,"clearDepthBuffer":true,"frustumCulling":true,"clearColor":[0.118,0.118,0.118,1],"enabled":true,"orthoHeight":4,"nearClip":0.1,"rect":[0,0,1,1]},"script":{"enabled":true,"order":["pickerRaycast"],"scripts":{"pickerRaycast":{"enabled":true,"attributes":{}}}}},"rotation":[180,2.5444437451708134e-14,180],"tags":[],"enabled":true,"children":[]},"9cb34568-bc25-11ec-baee-d62e0a56bcb8":{"position":[0,0,0],"scale":[1,1,1],"name":"Root","parent":null,"resource_id":"9cb34568-bc25-11ec-baee-d62e0a56bcb8","components":{},"rotation":[0,0,0],"tags":[],"enabled":true,"children":["9cb346f8-bc25-11ec-baee-d62e0a56bcb8","22167d55-25a5-4148-9b6c-990202e40293","3d941a31-278b-4806-8e28-19e8040a8232","f0f8f8f2-8749-48db-a9d9-b24c738d8913","23df4040-3a41-4768-8b84-574cabcebcc1","fced5bb8-d393-4862-9b7f-3141839103b5","8fb34d18-dd24-48a8-bf98-c7c7ec9cdaf5"]},"c040964c-0b12-45a9-bf11-e4aa25d5b9db":{"name":"Plane","tags":[],"enabled":true,"resource_id":"c040964c-0b12-45a9-bf11-e4aa25d5b9db","parent":"22167d55-25a5-4148-9b6c-990202e40293","children":[],"position":[-0.03963230726247283,-9.5367431640625e-7,-0.3270192742347724],"rotation":[0,0,0],"scale":[1.4432275955089495,1.4432275955089495,1.4432275955089495],"components":{"render":{"enabled":true,"type":"plane","asset":null,"materialAssets":[78072855],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null},"script":{"enabled":true,"order":["switchingTextures"],"scripts":{"switchingTextures":{"enabled":true,"attributes":{"textures":[78072763,78072763],"url":"https://farsh-mobile.s3.me-south-1.amazonaws.com/cdn/loonie1.png","WebTexture":null}}}}}},"3d941a31-278b-4806-8e28-19e8040a8232":{"enabled":true,"tags":[],"children":["559c7d7f-e35c-4349-9993-b4361a7cd124"],"position":[0,0,2.102861961682632],"rotation":[360,90,0],"scale":[0.00801352120321123,0.003093432959569368,0.0049292920472502584],"resource_id":"3d941a31-278b-4806-8e28-19e8040a8232","name":"livingroom","components":{},"parent":"9cb34568-bc25-11ec-baee-d62e0a56bcb8","template_ent_ids":{"3d941a31-278b-4806-8e28-19e8040a8232":"992e38f0-dd22-4fe8-843f-5c80f0b4190f","559c7d7f-e35c-4349-9993-b4361a7cd124":"cf173562-138d-43de-b497-644f7ffe4239","62ccd1f3-5767-44f2-9193-ffa73fe2e9c6":"19b78e10-9bec-4619-80ff-e761bd368e6e","bcf973e8-eb88-4ab3-b280-7425854c4c40":"f637845d-7f0e-416e-a2da-27a804b90a26","7cb58f5e-9aa4-4d17-b8b2-7db4581ac210":"624e755c-e008-4e38-a4ae-e189b9e6af0e","35251334-db47-4176-8cff-515c607ee8e3":"8fd046ca-9bf2-4996-a426-d5f6f336a65b","b4933e85-8415-4d5f-a4d2-c43879b48e01":"235f5a54-087f-4b74-bcb8-e92fb0454a6f","22cd60ef-8fb8-4497-a662-5fc73472eefb":"92d77773-aa8e-4faa-a639-619c285b76f1","808a03c9-659f-4d1e-ad28-c83a3295d69c":"0e2a3a2c-7ef9-48a5-94f8-425b169eb692","67e25dc4-4a9f-49fc-b358-2cb1de96ee78":"9ea5ecb4-e90e-41e7-8464-9700435c402b","ca56ef18-a240-4297-bd58-5b04d7f9ccde":"7a7196e1-59de-4cee-831f-db20924f5a99","fa7b5cb6-00d8-4b88-9c86-cf1d018cfe9d":"03051ef6-4f3a-438e-9160-a8aea926e2d0","608f46a5-dd55-411e-81ec-29ac7adc517e":"3ce4c2c1-7a99-4730-a57c-346004bc1485","8f1aaf7e-8ab1-46fc-8a7d-ac391603dfbd":"90839ae3-cc29-477f-a88e-53fb57152250","0995bd62-11c1-40f3-b5c9-73f3df99b2d4":"04a75aae-eb81-4d94-8678-29e91bc7ff75","90a04939-5806-490e-af60-40c0e5726521":"26ac5c6d-406a-4e21-b3ce-6e451befe8e9","96379cae-b823-4135-9005-75ecd5078867":"0ca19a72-2469-4446-b3d5-d341756117d3","7de9bdec-06bb-4c2b-a5b5-9d539c247d6c":"afce77e7-aca3-481a-b7ad-35126ffafcde","225f53f4-35b9-48ab-a9ef-d045105420f4":"1dbd7266-a1ce-4993-a0c0-14bc38ef3479","e3db52ba-6801-43bb-9191-d1eed1bf9fe7":"d5b5339a-94b6-4efa-822b-9c5c7997f1e1","8540efe6-07b3-475a-b42b-3b973e9926a7":"232324a7-b6aa-4551-a098-bc9ea317773c","76a034d5-b7a7-4f67-80e6-da64d139d265":"1346743e-6c0f-4290-9590-f6e6b64494a1","42dec380-69b2-4102-8ed4-4c53347a7777":"8a26cc25-f015-4fc5-8cfc-d2366cd0ec11","41f0ea83-d79a-4305-989a-e8971adae5db":"8f969715-c24b-40d4-a640-80340cc8ddaf","17712308-3fb7-4346-9c92-28a4e9a30090":"71743733-1689-447d-b55b-ef36a1f9832f"},"template_id":78181896},"559c7d7f-e35c-4349-9993-b4361a7cd124":{"enabled":true,"tags":[],"children":["67e25dc4-4a9f-49fc-b358-2cb1de96ee78","ca56ef18-a240-4297-bd58-5b04d7f9ccde","f12c70c5-2724-4d4a-a330-e39702963d6f","76a034d5-b7a7-4f67-80e6-da64d139d265"],"position":[0,0,0],"rotation":[0,0,0],"scale":[2.54,2.54,2.54],"resource_id":"559c7d7f-e35c-4349-9993-b4361a7cd124","name":"Fbx_Root","components":{},"parent":"3d941a31-278b-4806-8e28-19e8040a8232"},"67e25dc4-4a9f-49fc-b358-2cb1de96ee78":{"enabled":true,"tags":[],"children":[],"position":[129.593,0,84.7355],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"67e25dc4-4a9f-49fc-b358-2cb1de96ee78","name":"Plane01","components":{"render":{"enabled":true,"type":"asset","asset":78181884,"materialAssets":[78181754],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"559c7d7f-e35c-4349-9993-b4361a7cd124"},"ca56ef18-a240-4297-bd58-5b04d7f9ccde":{"name":"C-Ext01","tags":[],"enabled":true,"resource_id":"ca56ef18-a240-4297-bd58-5b04d7f9ccde","parent":"559c7d7f-e35c-4349-9993-b4361a7cd124","children":[],"position":[385.60399417146976,-1.444866033838162e-14,-247.91648714465805],"rotation":[0,0,0],"scale":[1,1.436031315043665,0.8457077102428969],"components":{"render":{"enabled":true,"type":"asset","asset":78181885,"materialAssets":[78181757],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}}},"76a034d5-b7a7-4f67-80e6-da64d139d265":{"name":"Omni01","tags":[],"enabled":true,"resource_id":"76a034d5-b7a7-4f67-80e6-da64d139d265","parent":"559c7d7f-e35c-4349-9993-b4361a7cd124","children":["79b9190e-1be1-45cc-9ee7-71fd07d524c5","63ab292d-45f9-4b5d-939e-82118e057592"],"position":[-49.48874449656523,223.5151107115206,285.66864960133177],"rotation":[0,0,0],"scale":[1,1,1],"components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":0.8,"castShadows":false,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":8,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}}},"f0f8f8f2-8749-48db-a9d9-b24c738d8913":{"enabled":true,"tags":[],"children":["bab2ed8f-5323-4ad2-82f4-45b64ca3f542"],"position":[2.157904453739669,1.0520708560943604,2.8588311672210693],"rotation":[0,0,0],"scale":[0.10537460532856122,0.10537460532856122,0.10537460532856122],"resource_id":"f0f8f8f2-8749-48db-a9d9-b24c738d8913","name":"doorman","components":{"collision":{"enabled":true,"type":"box","halfExtents":[0.458,1.028,0.319],"radius":0.5,"axis":1,"height":2,"asset":null,"renderAsset":null},"rigidbody":{"enabled":true,"type":"kinematic","mass":1,"linearDamping":0,"angularDamping":0,"linearFactor":[1,1,1],"angularFactor":[1,1,1],"friction":0.5,"restitution":0.5},"script":{"enabled":true,"order":["mouse","touch"],"scripts":{"mouse":{"enabled":true,"attributes":{"Selected":0,"redMaterial":null,"greenMaterial":null,"blueMaterial":null}},"touch":{"enabled":true,"attributes":{"Selected":0}}}}},"parent":"9cb34568-bc25-11ec-baee-d62e0a56bcb8","template_ent_ids":{"f0f8f8f2-8749-48db-a9d9-b24c738d8913":"2cfeea72-a4bb-4a0e-8dad-abd92cc83dad","155feed0-4828-4db3-bd69-ec82a43b842a":"9ccb87a7-6e1d-4ae0-9c96-b3b5d27c22f2","a7c74765-6d1f-4585-83fa-3d1678d4565c":"a662f523-2a86-4f77-9951-1053085f7717","c4e7019f-d3ef-48c6-8f74-3d5beb2f2d4e":"fbf7970b-0b02-48c8-9fbb-6fbb5d4f3485","c7f8fe2d-4cc6-4e6b-9050-ec7eb392e1ca":"cafbe398-372c-44b5-a905-6a9ca90c105c","209d5672-6d22-4502-bbcd-704d9b2fad6b":"6147aeb5-2849-4302-80b1-7120263a14de"},"template_id":78401706},"22167d55-25a5-4148-9b6c-990202e40293":{"name":"Plane","tags":[],"enabled":true,"resource_id":"22167d55-25a5-4148-9b6c-990202e40293","parent":"9cb34568-bc25-11ec-baee-d62e0a56bcb8","children":["d03348cb-478b-4674-a566-e6d088570d7c","21011587-80d5-4b5f-827a-646a50c51f04","c040964c-0b12-45a9-bf11-e4aa25d5b9db"],"position":[0.6259794642726152,0.3006536364555359,2.993325710296631],"rotation":[90,180,0],"scale":[1,1,1],"components":{"render":{"enabled":false,"type":"plane","asset":null,"materialAssets":[78072855],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null},"script":{"enabled":true,"order":["mouse","touch","showHeightAndWidth"],"scripts":{"mouse":{"enabled":true,"attributes":{"redMaterial":null,"greenMaterial":null,"blueMaterial":null,"Selected":0}},"touch":{"enabled":true,"attributes":{"Selected":0}},"showHeightAndWidth":{"enabled":true,"attributes":{"width":"21011587-80d5-4b5f-827a-646a50c51f04","height":"d03348cb-478b-4674-a566-e6d088570d7c","hideInterval":5,"baseScale":3}}}},"collision":{"enabled":true,"type":"box","halfExtents":[1,0.1,1],"radius":0.5,"axis":1,"height":2,"asset":null,"renderAsset":null}}},"21011587-80d5-4b5f-827a-646a50c51f04":{"name":"WidthPlane","tags":[],"enabled":false,"resource_id":"21011587-80d5-4b5f-827a-646a50c51f04","parent":"22167d55-25a5-4148-9b6c-990202e40293","children":["817af38c-c49e-4345-8262-7ad8951af88c"],"position":[0.016248916703851257,0.03636760460318578,-0.8011533512191992],"rotation":[0,0,0],"scale":[0.5519397175109401,1,1],"components":{"render":{"enabled":true,"type":"plane","asset":null,"materialAssets":[79458597],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null},"script":{"enabled":true,"order":[],"scripts":{}}}},"d03348cb-478b-4674-a566-e6d088570d7c":{"name":"HeightPlane","tags":[],"enabled":false,"resource_id":"d03348cb-478b-4674-a566-e6d088570d7c","parent":"22167d55-25a5-4148-9b6c-990202e40293","children":["25b8dc8f-b9c3-4ea8-a69d-4a7f4bc9bc43"],"position":[0.30972888276372146,0.07273621094883254,-0.3444118296490938],"rotation":[-1.1349114719074897e-12,-89.31740387174081,1.1304134085385617e-12],"scale":[1,1,1],"components":{"render":{"enabled":true,"type":"plane","asset":null,"materialAssets":[79458597],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null},"script":{"enabled":true,"order":[],"scripts":{}}}},"25b8dc8f-b9c3-4ea8-a69d-4a7f4bc9bc43":{"name":"Text","tags":[],"enabled":true,"resource_id":"25b8dc8f-b9c3-4ea8-a69d-4a7f4bc9bc43","parent":"d03348cb-478b-4674-a566-e6d088570d7c","children":[],"position":[0.0025968772360304704,-5.2326313726425155e-8,-0.17825210191257268],"rotation":[-90,90,0],"scale":[0.004705564106317546,0.004705564106317546,0.004705564106317546],"components":{"element":{"enabled":true,"type":"text","anchor":[0.5,0.5,0.5,0.5],"pivot":[0.5,0.5],"text":"6'6","key":null,"fontAsset":79465530,"fontSize":32,"minFontSize":8,"maxFontSize":32,"autoFitWidth":false,"autoFitHeight":false,"maxLines":null,"lineHeight":32,"wrapLines":true,"spacing":1,"color":[0,0,0],"opacity":1,"textureAsset":null,"spriteAsset":null,"spriteFrame":0,"pixelsPerUnit":null,"width":42.953,"height":29.875,"margin":[-21.474,-14.938,-21.479,-14.937],"alignment":[0.5,0.5],"outlineColor":[1,1,1,1],"outlineThickness":0.1,"shadowColor":[0,0,0,1],"shadowOffset":[0,0],"rect":[0,0,1,1],"materialAsset":null,"autoWidth":true,"autoHeight":true,"useInput":false,"batchGroupId":null,"mask":false,"layers":[4],"enableMarkup":false},"script":{"enabled":true,"order":["getHeightFromUrlparams"],"scripts":{"getHeightFromUrlparams":{"enabled":true,"attributes":{}}}}}},"817af38c-c49e-4345-8262-7ad8951af88c":{"name":"Text","tags":[],"enabled":true,"resource_id":"817af38c-c49e-4345-8262-7ad8951af88c","parent":"21011587-80d5-4b5f-827a-646a50c51f04","children":[],"position":[3.1729249783118973e-10,-5.8503573319157454e-8,-0.093912709118815],"rotation":[-90,5.39872334669395e-15,-1.149867515828846e-14],"scale":[0.010722314017446152,0.005053979179437539,0.005053979179437539],"components":{"element":{"enabled":true,"type":"text","anchor":[0.5,0.5,0.5,0.5],"pivot":[0.5,0.5],"text":"2'5","key":null,"fontAsset":79465530,"fontSize":32,"minFontSize":8,"maxFontSize":32,"autoFitWidth":false,"autoFitHeight":false,"maxLines":null,"lineHeight":32,"wrapLines":true,"spacing":1,"color":[0,0,0],"opacity":1,"textureAsset":null,"spriteAsset":null,"spriteFrame":0,"pixelsPerUnit":null,"width":40.125,"height":29.875,"margin":[-20.062,-14.938,-20.063,-14.937],"alignment":[0.5,0.5],"outlineColor":[1,1,1,1],"outlineThickness":0.13,"shadowColor":[0,0,0,1],"shadowOffset":[0,0],"rect":[0,0,1,1],"materialAsset":null,"autoWidth":true,"autoHeight":true,"useInput":false,"batchGroupId":null,"mask":false,"layers":[4],"enableMarkup":false},"script":{"enabled":true,"order":["getWidthFromUrlparams"],"scripts":{"getWidthFromUrlparams":{"enabled":true,"attributes":{}}}}}},"79b9190e-1be1-45cc-9ee7-71fd07d524c5":{"name":"Omni01","tags":[],"enabled":true,"resource_id":"79b9190e-1be1-45cc-9ee7-71fd07d524c5","parent":"76a034d5-b7a7-4f67-80e6-da64d139d265","children":[],"position":[-2.657165403848893,2.410082724219933,-5.178268755732063],"rotation":[0,0,0],"scale":[1,1,1],"components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":6.49,"castShadows":false,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":0.81,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}}},"f12c70c5-2724-4d4a-a330-e39702963d6f":{"name":"Omni01","tags":[],"enabled":true,"resource_id":"f12c70c5-2724-4d4a-a330-e39702963d6f","parent":"559c7d7f-e35c-4349-9993-b4361a7cd124","children":[],"position":[145.8048851846752,262.23750249755045,119.277572364992],"rotation":[0,0,0],"scale":[1,1,1],"components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":0.6,"castShadows":true,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":8,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}}},"63ab292d-45f9-4b5d-939e-82118e057592":{"name":"Omni01","tags":[],"enabled":true,"resource_id":"63ab292d-45f9-4b5d-939e-82118e057592","parent":"76a034d5-b7a7-4f67-80e6-da64d139d265","children":["27ce0554-28be-4dce-a0a1-9e8077bc062e"],"position":[-1.135208142655756,-8.347295838118924,-340.3798603759385],"rotation":[0,0,0],"scale":[1,1,1],"components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":0.8,"castShadows":false,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":8,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}}},"27ce0554-28be-4dce-a0a1-9e8077bc062e":{"name":"Omni01","tags":[],"enabled":true,"resource_id":"27ce0554-28be-4dce-a0a1-9e8077bc062e","parent":"63ab292d-45f9-4b5d-939e-82118e057592","children":[],"position":[-2.657165403848893,2.410082724219933,-5.178268755732063],"rotation":[0,0,0],"scale":[1,1,1],"components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":6.49,"castShadows":false,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":0.81,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}}},"23df4040-3a41-4768-8b84-574cabcebcc1":{"name":"Box","tags":[],"enabled":true,"resource_id":"23df4040-3a41-4768-8b84-574cabcebcc1","parent":"9cb34568-bc25-11ec-baee-d62e0a56bcb8","children":[],"position":[0,4.0786117319377775,0],"rotation":[0,0,0],"scale":[12.98453792144335,0.6476422676766433,16.20920054793964],"components":{"render":{"enabled":true,"type":"box","asset":null,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}}},"fced5bb8-d393-4862-9b7f-3141839103b5":{"enabled":true,"tags":[],"children":["169a81c2-9a4c-4032-835c-810faa8b40e2","69e9c7f3-31d2-4163-a479-0a3ae82ea113","df21d052-16b5-4d94-9937-13cc4920f550","2cd99d94-b235-414b-b4d9-ef27ec8a4942","21a54141-20ca-49b0-a4de-8bb6d28dc798","a5898fbb-49ca-4531-a0af-53e5c35960b6","56ec04a5-6776-4592-92bd-2557e17cdcf9","e4019a54-3112-4d49-9968-cdf664bc00d0"],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"fced5bb8-d393-4862-9b7f-3141839103b5","name":"Apt_Furniture_01","components":{},"parent":"9cb34568-bc25-11ec-baee-d62e0a56bcb8","template_ent_ids":{"fced5bb8-d393-4862-9b7f-3141839103b5":"822f5dc8-53ba-4044-b40a-ad6cd166437f","1c3c93bf-6b60-41c3-98a0-bc708b7abd9c":"338bd52b-a2f6-42de-bf8b-52fe3de7e179","9dc4e90f-1c30-4fd4-a875-0937b6eed694":"bb75b8cf-bc5d-41d3-9397-2cf9a2afbc55","c209b3f2-6209-4de6-a159-694e43602a27":"839c3672-62f2-4511-b1f2-f4ab2af9f4c2","a160655e-312b-413f-9be3-ec3703c5bd9e":"da569564-4cbd-4cdb-8909-364bedaddc37","169a81c2-9a4c-4032-835c-810faa8b40e2":"b3d32185-01fc-4b15-95c1-4ecd52e0294a","f33ca4ad-7296-439f-ae8f-48566c8ba21f":"50a77350-fe85-46c3-a2fb-9e21842e4f61","c010262f-7a2f-44b9-af6f-c30839d4a505":"477e175d-7f2a-41ee-9b8e-47d79cece154","337088a4-1021-4f53-9255-4ab12e39e980":"f7b007c3-643d-46e6-92fe-29102a9abbb7","b2f5b024-4e88-40ed-9a69-99bd98a01a83":"0639e112-c6c2-4f53-88e5-bd862a09099e","97224de9-e4f5-42d3-88f3-7b40669d3f1a":"03438cd4-6bc6-450a-9978-e2a08d05f2ab","8351d7fd-b94d-48e4-a99f-fa3baa46a624":"d45f4566-8dad-4bac-998d-de7ddf327ba4","b91a91a0-a12a-4a3f-bd69-1e258393b094":"dc03387b-81dc-44e0-b6e0-ba2d516f252f","8dd3b904-aedd-4134-ab8d-cf202e0c0e60":"12dff73c-1236-4ff1-950d-b2a6cedb2192","43da3459-679b-40aa-88c9-dc8d70ee690d":"49b744f9-be83-4f22-9f75-904dcee5cd5e","a60c0bec-309a-4f72-8154-4d1d1ba3c5ac":"dc35a58d-1836-400c-8b50-db2faf37e3af","69e9c7f3-31d2-4163-a479-0a3ae82ea113":"5d15a1a2-f7cd-4a57-986f-4f008d76e2cf","846d36f6-c0c2-49de-8ea3-24bb3d35d3e0":"eb1b0ace-1641-4461-9f95-6d7ba7c48949","7220e6bf-f178-42d0-ace6-8170a831f0cf":"549a5dca-b381-4f6b-8d50-523720570de8","4fa2a559-5047-4a48-80bc-21444d2c4538":"1c4f7ce5-e910-455b-bd5e-8467a5e1df57","5a7fcb20-f2db-4d59-983f-54399a615cc2":"c51f1b53-cda0-48b6-ba0c-d6321f55bcdd","585f4d69-c265-4b17-9147-afbfd5320768":"d30d9440-da09-45d6-b682-c37bfe2dd14a","1612fe18-d030-4f4e-a9bc-49d1b44cad63":"0d692efe-1397-4c2b-b908-5b605c559dff","df21d052-16b5-4d94-9937-13cc4920f550":"bd601a02-6551-416a-a740-4d12955a891c","b829e2c2-ab49-437f-af23-583f6f8ca5ba":"03f5cd73-5a3b-44cb-9b7b-1f9c6df460eb","eff20f88-a5c7-422b-a9e2-66de46957b92":"146e0679-341f-45e7-a408-82a3bb658c7c","72d77452-ed42-4505-bf9f-e0c6155568ad":"eaba8cfb-4902-4a3d-9f69-a1c3fb381fa9","22963e60-d83d-4d52-a1a4-4c776adde83b":"f2bce001-6ff5-4a6d-b792-279dcf1e1915","55df8837-0fad-4daa-9e1e-237b08e7704a":"57850126-9d95-4b9a-9ad1-5fce4d1569b2","0fd3420a-8e59-405d-a943-efdedecb8faf":"ee1a3c07-0c5f-4221-bd99-ab036871aa98","21e86f11-75ba-4dc4-9f1d-dd81d6b39148":"9d90e8bf-5dfc-4014-aa00-6512a57df38a","b52f8088-f9fd-412f-aade-465ee3169d44":"f46a51c2-8d1b-4062-a5b2-3b3691c1591a","7701f0d1-51b2-48d7-b35f-563677bbc12c":"e55b0112-6b47-4d32-a83e-be36db426d05","4a154f8c-07c2-4240-aa64-63cbbf7780e8":"9713ca82-4f59-4aa5-bc9b-810c05eaa3ce","f3bb4feb-57d4-4736-99b4-2432280677d3":"8c459bfc-d378-4f72-b395-adaf6a5831f1","36abed74-7dbe-4f1d-8e13-632058d8afcb":"38df4006-0b7a-46bd-b4bd-10f8b47119f2","cad29ba2-41f6-4054-bdc5-a9f9f5761a03":"bb11a9ef-dfa7-4138-aa4c-8628d7dcd37a","971df413-bb7f-4066-a54b-3f75dcb41ccc":"a21a6c4c-fb9d-40cb-9409-3743c58928ad","a373c3ff-2f68-43a3-ba84-a58459e6a1cc":"4aa1522b-ec5e-49c3-ba92-896f61fda63d","3a1a9a91-6999-47db-bfb7-e17ec48997a9":"9f876abb-6a34-4fcf-acc5-6d7fb8690362","28346ecf-b250-43fd-902c-ebf1821382d6":"88f8fb98-40e9-4e60-92c4-0b80cf88f8ea","65e0f3fc-4402-4eab-aa0b-9c1128d0a524":"37a43e6b-9ca2-496d-9767-810dd59fa980","deab4a29-4b7b-4d44-8b70-b9ea914f0db8":"d1fca74e-2de2-44d5-8a98-127c05c8cb8f","1d1ae5e3-43ec-4aca-a1f7-1f9f89e973d2":"7d45ccac-4dbe-407a-818e-3e9dcdd22520","93e9fe04-4c10-4f20-85a2-8a0ae397a63c":"776bfefc-5ae5-4b00-89c4-f2f69a65e3ed","53293a85-073a-491b-8612-e5ba689aad14":"154c5e44-2514-4ce2-9f34-74baee97ffe1","910dab0c-c32d-425a-afcd-4acf1218b289":"a7494ae9-03fe-44e2-ab2d-2ee5a2bbb92a","1a0fd6e5-5c78-41e5-b53d-2a5f119b01af":"6dc30efb-70c0-403c-a029-336f35961270","21a54141-20ca-49b0-a4de-8bb6d28dc798":"9433823b-85be-4a39-b240-feba83d2c90c","bfd435c1-c1cc-413a-b91d-4bb1b58f2851":"db1eaac3-eeda-4d7e-a493-1397a8522fce","e966af55-6ae6-4521-b550-23b016ca2be3":"abe67550-6b78-417b-a7a2-eafbbc743997","73ec9b43-c678-4cbf-8068-b6ace1e99e23":"4c0dda32-bd65-4696-ac4a-e63339a0423e","32328052-779f-4893-8f0e-3fce10e50595":"5c196002-661e-44dc-bc8f-149ae68950a8","a5898fbb-49ca-4531-a0af-53e5c35960b6":"b61f87ee-5892-421a-99f2-42c9069341f6","0f71264c-c2be-43db-8acd-189c1c9348c2":"51fab529-d2a7-4f3b-a4be-e8ceba0462fa","68781438-a4c6-4173-98e7-bc90b490a905":"09ffffd8-29e1-427b-9351-a882029d9274","edf87d59-b959-433d-8175-eeb0c15fac7e":"69e70553-c577-4c2d-a43b-698ec28ed97d","fd520a82-eff5-4962-8a9c-9e5d7c981282":"5ab2cedd-50c4-4bad-afc9-501da54b64e2","b60d1d45-c07c-4284-a8ee-5a8fd72b146d":"397ab891-54ea-4bf7-90d4-a74fb824d891","a88d1547-5b3a-452e-80ef-33eb46a8f8b9":"5b35bf87-de7b-44ae-8d00-6ea37130a152","c164e725-61b8-44a9-a222-5c9046bd5608":"284c22da-792e-406b-a60a-0c5cd4d8da51","bffdffd5-9054-41e3-9aa5-706063ea66fc":"9b30f32e-d431-4b5d-ad41-9c18e9421f3a","1c7a0217-c7f5-4d67-8bd5-4ce6b168d20f":"3cde92d0-5dff-40f2-a3a9-77138b9b9c77","06ea4ec3-6106-4e40-90e3-594e1fbb6c7e":"6fd2e3e5-a95f-4993-93c6-ea59b10b2cdf","38bf8679-da2f-4e8b-945f-8b3b8ad39616":"2a6d0d32-0fdd-4444-b0eb-5b7b76e42663","0f7e00d8-eba0-4938-9f27-cde507465844":"010d2d12-9d00-47d4-95d1-192e9996bc11","026f7e11-abbb-418e-9653-608d3eb03f26":"bf5e0099-b3ba-4710-87d0-cd7f3f871f42","99950708-3710-4d18-adec-78371d016ed9":"fd9725f2-5df1-4804-80fb-95787dbb1184","d0d95c22-c81e-40bc-a350-fc4b97faaa4b":"5335fb89-bc5e-4007-8c5d-4f28fc6b8f24","c0c9660f-0af7-492e-9c0d-a0f6e7832a94":"1e3969e9-8224-4a5a-b5a8-b10b7fbfa194","f98bfbd5-37d8-4304-adf9-ed461ab99cfb":"f3fc4719-5d34-4d6e-b8cf-cb75b67aaad4","cf4e7073-e54f-4e9f-9bc5-22b4f64e8721":"001c6978-45d7-46e0-9d70-65f55141ccc4","9301934b-9fb6-4f8e-9797-51152bb30953":"09a1895d-542e-43e7-85de-48dacaf55d9b","16ce5020-2113-44fc-a330-e78c83793565":"db25fd53-4a53-4ac2-961c-4cee46c93043","56ec04a5-6776-4592-92bd-2557e17cdcf9":"47da6ac3-f30e-4429-95a8-74d02dcb2713","e4019a54-3112-4d49-9968-cdf664bc00d0":"f18906a3-7e3a-4997-b64b-628333b8e776"},"template_id":80901149},"169a81c2-9a4c-4032-835c-810faa8b40e2":{"enabled":true,"tags":[],"children":["f33ca4ad-7296-439f-ae8f-48566c8ba21f","b2f5b024-4e88-40ed-9a69-99bd98a01a83","8351d7fd-b94d-48e4-a99f-fa3baa46a624","8dd3b904-aedd-4134-ab8d-cf202e0c0e60"],"position":[-2.3777512268732837,-0.0010123299434781075,0.8716712594032288],"rotation":[0.00000250448,180,0],"scale":[0.9095428864356427,0.9095428864356427,0.9095428864356427],"resource_id":"169a81c2-9a4c-4032-835c-810faa8b40e2","name":"MediaTable_01","components":{"render":{"enabled":true,"type":"asset","asset":80901078,"materialAssets":[80909898],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"fced5bb8-d393-4862-9b7f-3141839103b5"},"f33ca4ad-7296-439f-ae8f-48566c8ba21f":{"enabled":true,"tags":[],"children":["c010262f-7a2f-44b9-af6f-c30839d4a505","337088a4-1021-4f53-9255-4ab12e39e980"],"position":[-0.431799,0.411594,-1.27608],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"f33ca4ad-7296-439f-ae8f-48566c8ba21f","name":"Door.L.001","components":{"render":{"enabled":true,"type":"asset","asset":80901079,"materialAssets":[80909898],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"169a81c2-9a4c-4032-835c-810faa8b40e2"},"c010262f-7a2f-44b9-af6f-c30839d4a505":{"enabled":true,"tags":[],"children":[],"position":[0.0156746,7.1816e-9,0.422001],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"c010262f-7a2f-44b9-af6f-c30839d4a505","name":"Glass","components":{"render":{"enabled":true,"type":"asset","asset":80901080,"materialAssets":[80896683],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"f33ca4ad-7296-439f-ae8f-48566c8ba21f"},"337088a4-1021-4f53-9255-4ab12e39e980":{"enabled":true,"tags":[],"children":[],"position":[-0.0098722,2.43353e-8,0.814431],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"337088a4-1021-4f53-9255-4ab12e39e980","name":"Knob.004","components":{"render":{"enabled":true,"type":"asset","asset":80901081,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"f33ca4ad-7296-439f-ae8f-48566c8ba21f"},"b2f5b024-4e88-40ed-9a69-99bd98a01a83":{"enabled":true,"tags":[],"children":["97224de9-e4f5-42d3-88f3-7b40669d3f1a"],"position":[-0.433271,0.373799,2.38419e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"b2f5b024-4e88-40ed-9a69-99bd98a01a83","name":"Drawer_01.001","components":{"render":{"enabled":true,"type":"asset","asset":80901082,"materialAssets":[80909898],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"169a81c2-9a4c-4032-835c-810faa8b40e2"},"97224de9-e4f5-42d3-88f3-7b40669d3f1a":{"enabled":true,"tags":[],"children":[],"position":[0,0.0503578,-4.76837e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"97224de9-e4f5-42d3-88f3-7b40669d3f1a","name":"Handle.001","components":{"render":{"enabled":true,"type":"asset","asset":80901083,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"b2f5b024-4e88-40ed-9a69-99bd98a01a83"},"8351d7fd-b94d-48e4-a99f-fa3baa46a624":{"enabled":true,"tags":[],"children":["b91a91a0-a12a-4a3f-bd69-1e258393b094"],"position":[-0.433271,0.163137,-2.38419e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"8351d7fd-b94d-48e4-a99f-fa3baa46a624","name":"Drawer_02.001","components":{"render":{"enabled":true,"type":"asset","asset":80901084,"materialAssets":[80909898],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"169a81c2-9a4c-4032-835c-810faa8b40e2"},"b91a91a0-a12a-4a3f-bd69-1e258393b094":{"enabled":true,"tags":[],"children":[],"position":[0,0.0503578,-4.76837e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"b91a91a0-a12a-4a3f-bd69-1e258393b094","name":"Handle.002","components":{"render":{"enabled":true,"type":"asset","asset":80901085,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"8351d7fd-b94d-48e4-a99f-fa3baa46a624"},"8dd3b904-aedd-4134-ab8d-cf202e0c0e60":{"enabled":true,"tags":[],"children":["43da3459-679b-40aa-88c9-dc8d70ee690d","a60c0bec-309a-4f72-8154-4d1d1ba3c5ac"],"position":[-0.431799,0.411593,1.27608],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"8dd3b904-aedd-4134-ab8d-cf202e0c0e60","name":"Door.R.001","components":{"render":{"enabled":true,"type":"asset","asset":80901086,"materialAssets":[80909898],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"169a81c2-9a4c-4032-835c-810faa8b40e2"},"43da3459-679b-40aa-88c9-dc8d70ee690d":{"enabled":true,"tags":[],"children":[],"position":[-0.0098722,-2.4713e-8,-0.814432],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"43da3459-679b-40aa-88c9-dc8d70ee690d","name":"Knob.001","components":{"render":{"enabled":true,"type":"asset","asset":80901087,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"8dd3b904-aedd-4134-ab8d-cf202e0c0e60"},"a60c0bec-309a-4f72-8154-4d1d1ba3c5ac":{"enabled":true,"tags":[],"children":[],"position":[0.0156746,-7.5593e-9,-0.422],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"a60c0bec-309a-4f72-8154-4d1d1ba3c5ac","name":"Glass.001","components":{"render":{"enabled":true,"type":"asset","asset":80901088,"materialAssets":[80896683],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"8dd3b904-aedd-4134-ab8d-cf202e0c0e60"},"69e9c7f3-31d2-4163-a479-0a3ae82ea113":{"enabled":true,"tags":[],"children":["846d36f6-c0c2-49de-8ea3-24bb3d35d3e0","7220e6bf-f178-42d0-ace6-8170a831f0cf"],"position":[-2.8091469959925464,1.5456985235214233,1.0108129978179932],"rotation":[0.00000250448,180,0],"scale":[0.9095428864356427,0.9095428864356427,0.9095428864356427],"resource_id":"69e9c7f3-31d2-4163-a479-0a3ae82ea113","name":"TV_Apt_01","components":{"render":{"enabled":true,"type":"asset","asset":80901089,"materialAssets":[80896683],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"fced5bb8-d393-4862-9b7f-3141839103b5"},"846d36f6-c0c2-49de-8ea3-24bb3d35d3e0":{"enabled":true,"tags":[],"children":[],"position":[-0.0422344,9.06879e-7,-1.19209e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"846d36f6-c0c2-49de-8ea3-24bb3d35d3e0","name":"Screen","components":{"render":{"enabled":true,"type":"asset","asset":80901090,"materialAssets":[80896683],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"69e9c7f3-31d2-4163-a479-0a3ae82ea113"},"7220e6bf-f178-42d0-ace6-8170a831f0cf":{"enabled":true,"tags":[],"children":[],"position":[0.0455265,-4.67956e-8,-1.19209e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"7220e6bf-f178-42d0-ace6-8170a831f0cf","name":"Mount","components":{"render":{"enabled":true,"type":"asset","asset":80901091,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"69e9c7f3-31d2-4163-a479-0a3ae82ea113"},"df21d052-16b5-4d94-9937-13cc4920f550":{"enabled":true,"tags":[],"children":["b829e2c2-ab49-437f-af23-583f6f8ca5ba","eff20f88-a5c7-422b-a9e2-66de46957b92"],"position":[-2.180132265539055,0.4802030026912689,0.22044254839420319],"rotation":[0.00000250448,0,0],"scale":[0.9095428864356427,0.9095428864356427,0.9095428864356427],"resource_id":"df21d052-16b5-4d94-9937-13cc4920f550","name":"SS_01","components":{"render":{"enabled":true,"type":"asset","asset":80901096,"materialAssets":[80896683],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"fced5bb8-d393-4862-9b7f-3141839103b5"},"b829e2c2-ab49-437f-af23-583f6f8ca5ba":{"enabled":true,"tags":[],"children":[],"position":[0,1.47123e-8,-2.38419e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"b829e2c2-ab49-437f-af23-583f6f8ca5ba","name":"Feet","components":{"render":{"enabled":true,"type":"asset","asset":80901097,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"df21d052-16b5-4d94-9937-13cc4920f550"},"eff20f88-a5c7-422b-a9e2-66de46957b92":{"enabled":true,"tags":[],"children":[],"position":[0,1.47123e-8,-2.38419e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"eff20f88-a5c7-422b-a9e2-66de46957b92","name":"Fabric","components":{"render":{"enabled":true,"type":"asset","asset":80901098,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"df21d052-16b5-4d94-9937-13cc4920f550"},"21a54141-20ca-49b0-a4de-8bb6d28dc798":{"enabled":true,"tags":[],"children":["bfd435c1-c1cc-413a-b91d-4bb1b58f2851"],"position":[3.301447700131071,-0.0010125599801540375,3.8757314682006836],"rotation":[0.00000250448,0,0],"scale":[1.234077033853895,0.8094050434852456,1.0903833088064017],"resource_id":"21a54141-20ca-49b0-a4de-8bb6d28dc798","name":"Lamp_Floor_01","components":{"render":{"enabled":true,"type":"asset","asset":80901121,"materialAssets":[80679924],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"fced5bb8-d393-4862-9b7f-3141839103b5"},"bfd435c1-c1cc-413a-b91d-4bb1b58f2851":{"enabled":true,"tags":[],"children":[],"position":[1.49012e-8,2.17624,-2.38419e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"bfd435c1-c1cc-413a-b91d-4bb1b58f2851","name":"Glow.002","components":{"render":{"enabled":true,"type":"asset","asset":80901122,"materialAssets":[80679925],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"21a54141-20ca-49b0-a4de-8bb6d28dc798"},"a5898fbb-49ca-4531-a0af-53e5c35960b6":{"enabled":true,"tags":[],"children":["0f71264c-c2be-43db-8acd-189c1c9348c2"],"position":[3.7169441278019937,-0.08543109148740768,0.3537379205226898],"rotation":[0.00000250448,0,0],"scale":[0.8807917282639184,0.8807917282639184,0.7174876837415948],"resource_id":"a5898fbb-49ca-4531-a0af-53e5c35960b6","name":"Sofa_Apt_01","components":{"render":{"enabled":true,"type":"asset","asset":80901126,"materialAssets":[80914323],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"fced5bb8-d393-4862-9b7f-3141839103b5"},"0f71264c-c2be-43db-8acd-189c1c9348c2":{"enabled":true,"tags":[],"children":[],"position":[5.96046e-8,1.42109e-14,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"0f71264c-c2be-43db-8acd-189c1c9348c2","name":"feet","components":{"render":{"enabled":true,"type":"asset","asset":80901127,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"a5898fbb-49ca-4531-a0af-53e5c35960b6"},"56ec04a5-6776-4592-92bd-2557e17cdcf9":{"enabled":true,"tags":[],"children":[],"position":[0.277431,2.31297,8.37136],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"56ec04a5-6776-4592-92bd-2557e17cdcf9","name":"Canvas_Painting_01","components":{"render":{"enabled":true,"type":"asset","asset":80901147,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"fced5bb8-d393-4862-9b7f-3141839103b5"},"e4019a54-3112-4d49-9968-cdf664bc00d0":{"enabled":true,"tags":[],"children":[],"position":[1.0179775953292847,2.0512493529829823,4.161427974700928],"rotation":[0.000002504484267025183,90,4.194515164508042e-12],"scale":[1,1,1],"resource_id":"e4019a54-3112-4d49-9968-cdf664bc00d0","name":"Plane.003","components":{"render":{"enabled":true,"type":"asset","asset":80901148,"materialAssets":[80904631],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"fced5bb8-d393-4862-9b7f-3141839103b5"},"2cd99d94-b235-414b-b4d9-ef27ec8a4942":{"name":"Lamp_Floor_01","tags":[],"enabled":true,"resource_id":"2cd99d94-b235-414b-b4d9-ef27ec8a4942","parent":"fced5bb8-d393-4862-9b7f-3141839103b5","children":["39037671-6c81-4d4e-afb5-0659c7ad5208"],"position":[-1.2856939347321235,-0.0018323158146813512,3.8648271560668945],"rotation":[0.0000051209778868339296,0,0],"scale":[1.234077033853895,0.8094050434852456,1.0903833088064017],"components":{"render":{"enabled":true,"type":"asset","asset":80901121,"materialAssets":[80679924],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}}},"39037671-6c81-4d4e-afb5-0659c7ad5208":{"name":"Glow.002","tags":[],"enabled":true,"resource_id":"39037671-6c81-4d4e-afb5-0659c7ad5208","parent":"2cd99d94-b235-414b-b4d9-ef27ec8a4942","children":[],"position":[1.49012e-8,2.17624,-2.38419e-7],"rotation":[0,0,0],"scale":[1,1,1],"components":{"render":{"enabled":true,"type":"asset","asset":80901122,"materialAssets":[80679925],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}}},"8fb34d18-dd24-48a8-bf98-c7c7ec9cdaf5":{"name":"Plane","tags":[],"enabled":true,"resource_id":"8fb34d18-dd24-48a8-bf98-c7c7ec9cdaf5","parent":"9cb34568-bc25-11ec-baee-d62e0a56bcb8","children":[],"position":[0.7068448066711426,0.008999999612569809,0.19599451032144533],"rotation":[0,0,0],"scale":[4.253792294827105,4.253792294827105,4.253792294827105],"components":{"render":{"enabled":true,"type":"plane","asset":null,"materialAssets":[80914528],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}}},"bab2ed8f-5323-4ad2-82f4-45b64ca3f542":{"enabled":true,"tags":[],"children":["6f1bb49c-4ed9-45de-b2c0-9d0e22fadd86","eb255f1a-f435-42c2-bd0f-f492fc5046bc"],"position":[0.4109169812027993,-9.984101958119583,-1.5043396099642905],"rotation":[-180,0.04178816319325096,-180],"scale":[0.1,0.1,0.1],"resource_id":"bab2ed8f-5323-4ad2-82f4-45b64ca3f542","name":"BlueSuitFree01","components":{},"parent":"f0f8f8f2-8749-48db-a9d9-b24c738d8913","template_ent_ids":{"bab2ed8f-5323-4ad2-82f4-45b64ca3f542":"349f823f-3e44-4162-9ed4-1ec84e75483e","6f1bb49c-4ed9-45de-b2c0-9d0e22fadd86":"25304268-5782-46b4-8096-5a1f035ab0d0","8fb613b2-ce32-41e6-9e2d-45fbe3d1209d":"246d9b13-1098-45a7-8efc-e4049fd311a3","843063c7-5ea3-4a5a-b20d-3da11360fb04":"bc364d92-e370-47d9-b20d-98c792aabe97","7b589cc4-8c29-4aa9-b38f-ef45ea42a365":"0eaf1817-47cf-4320-aec4-ec4b5d4890ac","2f5f1556-6cbf-4d37-bb11-82311e02d606":"9d5cddc3-0168-44c2-8497-2f1d7c82fdaf","24043609-98d1-4834-84ec-c86519d19e1c":"f0f0f0a5-b770-47ca-84c3-6171f02026c4","2eec7d1b-0189-4cfe-a244-cf01acc7d47a":"66a06794-d1eb-420c-8966-d33c47f62243","4fd63b56-edb2-4a07-be5f-975139d122e0":"4b69f146-6d36-445d-8cf1-b30df1714d26","fd9f0e3d-3559-4406-b658-602a71751431":"185884e8-8d7f-4d73-ac4e-1e91a6ba694f","971cb390-3bf0-4b68-a4c5-395464e6d489":"6779d20e-ffd2-477d-80b7-425c0475f1d5","4d024319-4d3e-4d36-aab2-2d17c0a326b3":"69dafd9b-5183-4dec-97b8-f2290ad74a88","7aa1e45b-c0c3-4d90-a35d-5465bf13dfc7":"5c4b614b-ca99-45d1-9ffd-01ba4dca482d","c29a0386-611e-4068-a7b8-b4df066aa471":"154ec305-b964-4a07-bcf7-75787b883c55","7b6f4ede-5865-4dc7-b683-db3e3d525f9f":"2a2b3e82-d0b1-429b-9ac0-a428b9b95d26","84f7fce1-cbc1-4100-a7b3-2124f9a3ab90":"70dc6419-fd57-4484-82f9-a76a9febe516","e2d72471-5013-427a-8e70-f7f6b173c9e2":"930b8e63-6492-4681-8c80-c279a115c7ca","a8788210-7086-4983-8f25-483647685c19":"9d0c19ef-7c47-4889-b6c2-bf67f6676c43","198fdef5-1b67-44c2-ab04-73ebbbbb38ad":"1511ab22-1978-4397-8ce9-84d25d969039","ef45eef6-6a79-4a16-a6c8-ff34de434632":"a74c353f-c707-4245-a5e0-211c193e2f82","39285ce3-64c6-4c2f-82fa-3f2b72dca52a":"8d5f729b-c6b8-4496-ad31-162dbb88a4b0","04818824-0318-4b46-be06-f8fc3fa1e656":"5170b049-30a6-4290-8fc9-71f0369044fb","3d109788-9c05-4cae-b6d8-b077edfddbb3":"8dad2df0-2a5c-4d29-ac1d-0da768c0af1a","9765c624-ea3d-4d90-8f05-40197fdf6973":"32454a3b-dc95-4603-8275-9bfa4d3656a5","81b5aa17-4f3b-43c5-8bd3-7eeec5798380":"d25c60b0-e9ec-4946-b309-52cb2d7bb6ce","f6421ddc-1235-4660-bfd0-a40845e6d7ea":"66c5cf80-593e-43a7-9985-262e8c3943db","4e79333c-096c-490a-aa0c-9ff81e867dc1":"9bb4ad61-8b98-40b3-8f03-471e717aaa10","0cf39fde-b162-4374-b65f-7253d03fc90e":"948f7e2a-f7ac-43db-9f13-c4a211931cb8","ed3cfe7a-f075-4b56-bd42-e4beff4496a5":"62dd3059-d198-4a25-a948-58aa9ad6de9a","b7a5b767-2c06-4dae-9d0a-ad229e554cd6":"663ef460-551d-4fdf-9f9f-6d80af049001","6d64109e-a5a9-41fc-8ee5-2a20d106079d":"0ab2d415-16f1-433c-839c-f5dc8a12ece6","7966646d-55df-4f8e-8bf2-00534b4d00bd":"5b405fed-76b0-4a86-a7be-3631dfb22d64","20538600-4751-4007-ad65-f80019798ad1":"8c45383b-77c5-4d41-9465-4aea58643c8b","46429438-175d-4194-9b61-c58fff9f9305":"acfbb9a3-a794-4d6d-ba44-423df348662b","361d16e2-9a6c-4c3f-bdc7-2cf659f0bd2f":"78e35c79-f4b2-4b45-a8bb-ce6232b10926","01bc0aec-840d-438e-b25e-52b181a09e79":"44ba2028-08bb-471b-b01d-bfebdff376c2","1062bd57-376a-43e4-a8fb-35eb66f9453b":"75173193-4148-4d13-8f87-3ed747edba07","6303bdad-1a6a-45ff-9f18-e84cd16f695c":"0bb5ecac-fdd5-4206-9727-58742015c918","4daade1b-88eb-4f0e-831d-ea15e1421b08":"d1d22996-f6cf-46a7-a1da-e1f21e206e4f","4c2773cf-3622-44e8-97f3-fc209bb8cee4":"a2cbe25c-d987-45d8-afb7-fa723c9e4f65","8f4d51cb-83c7-4b91-bd8a-4e5b63508b27":"0ca9cdcf-2466-4c04-80a4-ccf74d859d95","f867d446-9883-4a4a-a400-1199c1c71c78":"fedb1ab2-2c0a-4158-aa3d-6aea2debcc56","6db18510-6f37-4c0d-9304-9f7601f54a34":"4052b35f-20d3-4bf7-a7bb-d9afae946c44","cadfd24f-45fc-4d7a-a2ff-d6864a714d78":"133a3599-deb2-4f93-bb79-2fdaea1f53b5","189cbc37-77dc-481d-8182-d1f00e212258":"0a828f87-deb9-497b-9af5-540b60eafff1","b1bb8e43-d388-4781-b86e-762011e1c581":"54de4e11-2768-477f-8a66-d26f13fd0fe6","4b131250-2d30-40da-a4ab-48d636acd76b":"4003c198-1874-42dc-83a4-56b8b704eff6","0b15aa7b-1e37-4b14-84c2-940c77107c5d":"27584000-9400-4126-a17c-845a9f9f7605","d75a19a7-b62a-4529-aa76-3c408712accf":"2fdd9dbe-f57c-4b97-89d9-3c8e05200917","0dfd2e5b-f1f0-4781-a0d3-d49e978e9f13":"ef7ab9d6-07e7-4e0c-97ee-66b5e94f6b21","21dd3cfd-c9b6-425b-a666-8540ce0c8ab3":"b05cb928-fd7e-48cd-9e18-afc07c46fba3","0cc9906a-d4bb-46ae-964f-bfc150aa4d5d":"4e2fd5fc-6dbe-420a-ab31-fb287e31c726","3e70b84f-9892-426c-ad76-16543550310f":"25ebeb00-d02d-4d7a-b09a-1c773f157f56","be7fe0e3-57d5-46c9-bfe8-0114f2ec95aa":"1ddeca7a-7d8b-4993-a05c-5f47a62fb541","8b1771d5-ce8e-4d50-8c98-3bb61c5e6971":"aba2941b-f3e0-4469-8126-2a5e9052a7d8","e5aee98d-0807-424b-8e40-aa9baa5275b3":"44e89eeb-26ac-4f17-96dc-eb7925aa0576","b84a76af-a752-44eb-8496-91ea0f963c48":"25037cf1-bb2d-45f1-962a-0ccae3e7f47d","8cd435a4-ac35-42df-a4df-9d17a6540121":"86903bbc-4a42-44a5-a4fb-9f94ebc80ff5","8493c096-5583-45aa-be6c-8af7f2c3a7b9":"4a0d4912-c2f7-4a8a-8d15-c21b278c6ba8","475326af-dd08-43ca-a0d1-3a58216aaa33":"7cdc4abd-7de8-4aab-bbaf-5287b47baea9","47db01a7-e641-410a-9db0-f09a05e40bf0":"6c23aa87-ff9a-45da-83c0-e56a98fe765d","0b617cf6-774d-4ae4-8186-ca0b45c031d7":"18966956-e888-4707-872f-7bcad5dd4975","5d677778-911c-48e0-aa12-3e916aab0262":"e155d26f-a44d-4065-b856-3c1f7655dd45","8be17afe-ac74-46a5-a1f8-f84ad3bf21ac":"19d67abf-6da7-4668-bb56-63e362a0abb8","02e281e0-0e40-43ce-8b57-81550fd9f875":"120cf609-3d9a-4068-9c11-d7b7feb1abdc","2c541398-aa9f-4bb9-bfcb-8eb30927974b":"b161ff11-86c3-4e00-bb3c-bd09ea8a4bf8","c46ded4d-1d76-46fa-aa6c-ad003e012e95":"578ebeda-4f81-42eb-8220-e276bf55e73b","fb47204a-8050-4dbf-92d9-4d0f890a7690":"84c775d9-46f4-480c-bfa8-ebac01660934","fee0f120-caa1-4f9e-8e80-dc3de3eed987":"fcda9764-a9e6-4790-b7c8-2275e8fdce3a","3aa8fd7c-a907-4a1e-9750-72742b231108":"0cae0b66-218e-4636-95b8-cf3cc24c14c5","3def1b77-54d5-49ff-aa96-ffe10667f25e":"f1dd3f38-f2a7-4e2d-8437-5c8968e56595","3f857d76-c1ca-442e-bab5-306f1e857cf1":"648f62bc-f587-4a1a-944c-663cc286ba53","dab2f521-3703-419a-8fb2-2c538ec08bc9":"5ac65a16-94b0-478a-b324-791b9c77ee5f","f740a22f-4149-424c-9d1a-d0488bbe70db":"5ad7ed93-07f3-4e3d-8792-fe9e33ed134b","7a92c945-554e-45a4-b6ae-71c1ee001a5f":"8c176529-ae92-4185-af03-cf980598f550","2dea15ad-7e5b-4c2d-ab56-c0b8db6448ba":"2d05dab9-2167-4ce6-85d3-0b2127ab677d","038e8909-3cff-4b4c-a51d-8b8aa7ff7a2d":"b6911b20-b769-488a-95f4-b6c960fb41f3","c4de8417-8875-407b-abf8-f7dda9d5f933":"36ce698b-7be6-4bec-9080-01be8e125d22","eb255f1a-f435-42c2-bd0f-f492fc5046bc":"2cb48962-5b67-4b71-b0b2-afa8d9db58c1","bccb9535-b53e-471e-98e5-8b81ab255417":"5b0ab82e-f081-47c5-98bc-75d547e77476","20792f1a-7d6a-4e98-a660-61fe0335f26a":"ce472413-e97f-4cff-92be-695f07c7bedc"},"template_id":80915306},"6f1bb49c-4ed9-45de-b2c0-9d0e22fadd86":{"enabled":true,"tags":[],"children":["8fb613b2-ce32-41e6-9e2d-45fbe3d1209d"],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"6f1bb49c-4ed9-45de-b2c0-9d0e22fadd86","name":"Group","components":{},"parent":"bab2ed8f-5323-4ad2-82f4-45b64ca3f542"},"8fb613b2-ce32-41e6-9e2d-45fbe3d1209d":{"enabled":true,"tags":[],"children":["843063c7-5ea3-4a5a-b20d-3da11360fb04"],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"8fb613b2-ce32-41e6-9e2d-45fbe3d1209d","name":"Main","components":{},"parent":"6f1bb49c-4ed9-45de-b2c0-9d0e22fadd86"},"843063c7-5ea3-4a5a-b20d-3da11360fb04":{"enabled":true,"tags":[],"children":["7b589cc4-8c29-4aa9-b38f-ef45ea42a365"],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"843063c7-5ea3-4a5a-b20d-3da11360fb04","name":"DeformationSystem","components":{},"parent":"8fb613b2-ce32-41e6-9e2d-45fbe3d1209d"},"7b589cc4-8c29-4aa9-b38f-ef45ea42a365":{"enabled":true,"tags":[],"children":["2f5f1556-6cbf-4d37-bb11-82311e02d606","971cb390-3bf0-4b68-a4c5-395464e6d489","f740a22f-4149-424c-9d1a-d0488bbe70db"],"position":[-3.44673e-14,95.3786,-1.71933],"rotation":[90,-2.06823,90],"scale":[1,1,1],"resource_id":"7b589cc4-8c29-4aa9-b38f-ef45ea42a365","name":"Root_M","components":{},"parent":"843063c7-5ea3-4a5a-b20d-3da11360fb04"},"2f5f1556-6cbf-4d37-bb11-82311e02d606":{"enabled":true,"tags":[],"children":["24043609-98d1-4834-84ec-c86519d19e1c"],"position":[-2.04778,-0.445829,-9.98721],"rotation":[-178.09,6.36596,178.487],"scale":[1,1,1],"resource_id":"2f5f1556-6cbf-4d37-bb11-82311e02d606","name":"Hip_R","components":{},"parent":"7b589cc4-8c29-4aa9-b38f-ef45ea42a365"},"24043609-98d1-4834-84ec-c86519d19e1c":{"enabled":true,"tags":[],"children":["2eec7d1b-0189-4cfe-a244-cf01acc7d47a"],"position":[44.9641,2.22045e-15,-6.39488e-14],"rotation":[0,0,-9.83765],"scale":[1,1,1],"resource_id":"24043609-98d1-4834-84ec-c86519d19e1c","name":"Knee_R","components":{},"parent":"2f5f1556-6cbf-4d37-bb11-82311e02d606"},"2eec7d1b-0189-4cfe-a244-cf01acc7d47a":{"enabled":true,"tags":[],"children":["4fd63b56-edb2-4a07-be5f-975139d122e0"],"position":[39.9237,1.06581e-14,-7.10543e-14],"rotation":[1.70759,6.38072,10.1826],"scale":[1,1,1],"resource_id":"2eec7d1b-0189-4cfe-a244-cf01acc7d47a","name":"Ankle_R","components":{},"parent":"24043609-98d1-4834-84ec-c86519d19e1c"},"4fd63b56-edb2-4a07-be5f-975139d122e0":{"enabled":true,"tags":[],"children":["fd9f0e3d-3559-4406-b658-602a71751431"],"position":[7.95222,15.2582,9.23706e-14],"rotation":[-4.68637,1.48242,86.1308],"scale":[1,1,1],"resource_id":"4fd63b56-edb2-4a07-be5f-975139d122e0","name":"Toes_R","components":{},"parent":"2eec7d1b-0189-4cfe-a244-cf01acc7d47a"},"fd9f0e3d-3559-4406-b658-602a71751431":{"enabled":true,"tags":[],"children":[],"position":[6.08362,-1.21014e-14,-3.55271e-14],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"fd9f0e3d-3559-4406-b658-602a71751431","name":"ToesEnd_R","components":{},"parent":"4fd63b56-edb2-4a07-be5f-975139d122e0"},"971cb390-3bf0-4b68-a4c5-395464e6d489":{"enabled":true,"tags":[],"children":["4d024319-4d3e-4d36-aab2-2d17c0a326b3"],"position":[17.1229,7.99361e-15,-1.819e-14],"rotation":[0,0,-8.40716],"scale":[1,1,1],"resource_id":"971cb390-3bf0-4b68-a4c5-395464e6d489","name":"Spine1_M","components":{},"parent":"7b589cc4-8c29-4aa9-b38f-ef45ea42a365"},"4d024319-4d3e-4d36-aab2-2d17c0a326b3":{"enabled":true,"tags":[],"children":["7aa1e45b-c0c3-4d90-a35d-5465bf13dfc7"],"position":[4.57661,-3.01981e-14,-3.85972e-15],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"4d024319-4d3e-4d36-aab2-2d17c0a326b3","name":"Spine1Part1_M","components":{},"parent":"971cb390-3bf0-4b68-a4c5-395464e6d489"},"7aa1e45b-c0c3-4d90-a35d-5465bf13dfc7":{"enabled":true,"tags":[],"children":["c29a0386-611e-4068-a7b8-b4df066aa471"],"position":[4.57661,-3.37508e-14,-4.87593e-15],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"7aa1e45b-c0c3-4d90-a35d-5465bf13dfc7","name":"Spine1Part2_M","components":{},"parent":"4d024319-4d3e-4d36-aab2-2d17c0a326b3"},"c29a0386-611e-4068-a7b8-b4df066aa471":{"enabled":true,"tags":[],"children":["7b6f4ede-5865-4dc7-b683-db3e3d525f9f","4c2773cf-3622-44e8-97f3-fc209bb8cee4","d75a19a7-b62a-4529-aa76-3c408712accf"],"position":[4.57661,-1.42109e-14,-1.10591e-14],"rotation":[0,0,8.22027],"scale":[1,1,1],"resource_id":"c29a0386-611e-4068-a7b8-b4df066aa471","name":"Chest_M","components":{},"parent":"7aa1e45b-c0c3-4d90-a35d-5465bf13dfc7"},"7b6f4ede-5865-4dc7-b683-db3e3d525f9f":{"enabled":true,"tags":[],"children":["84f7fce1-cbc1-4100-a7b3-2124f9a3ab90"],"position":[15.5097,-1.70398,-8.47709],"rotation":[-40.4095,82.4185,-48.3494],"scale":[1,1,1],"resource_id":"7b6f4ede-5865-4dc7-b683-db3e3d525f9f","name":"Scapula_R","components":{},"parent":"c29a0386-611e-4068-a7b8-b4df066aa471"},"84f7fce1-cbc1-4100-a7b3-2124f9a3ab90":{"enabled":true,"tags":[],"children":["e2d72471-5013-427a-8e70-f7f6b173c9e2"],"position":[12.1813,1.06581e-14,2.84217e-13],"rotation":[-8.047748352849949,85.07569946758942,-5.304344968732038],"scale":[1,1,1],"resource_id":"84f7fce1-cbc1-4100-a7b3-2124f9a3ab90","name":"Shoulder_R","components":{},"parent":"7b6f4ede-5865-4dc7-b683-db3e3d525f9f"},"e2d72471-5013-427a-8e70-f7f6b173c9e2":{"enabled":true,"tags":[],"children":["a8788210-7086-4983-8f25-483647685c19"],"position":[27.3069,-7.4607e-14,2.84217e-14],"rotation":[0,0,10.2376],"scale":[1,1,1],"resource_id":"e2d72471-5013-427a-8e70-f7f6b173c9e2","name":"Elbow_R","components":{},"parent":"84f7fce1-cbc1-4100-a7b3-2124f9a3ab90"},"a8788210-7086-4983-8f25-483647685c19":{"enabled":true,"tags":[],"children":["198fdef5-1b67-44c2-ab04-73ebbbbb38ad","3d109788-9c05-4cae-b6d8-b077edfddbb3","4e79333c-096c-490a-aa0c-9ff81e867dc1","6d64109e-a5a9-41fc-8ee5-2a20d106079d"],"position":[25.3891,-5.68434e-14,1.13687e-13],"rotation":[-25.03787049769309,-11.861148218978702,11.423455745783814],"scale":[1,1,1],"resource_id":"a8788210-7086-4983-8f25-483647685c19","name":"Wrist_R","components":{},"parent":"e2d72471-5013-427a-8e70-f7f6b173c9e2"},"198fdef5-1b67-44c2-ab04-73ebbbbb38ad":{"enabled":true,"tags":[],"children":["ef45eef6-6a79-4a16-a6c8-ff34de434632"],"position":[10.7004,-4.32987e-14,4.26326e-14],"rotation":[16.6631,19.9882,4.62472],"scale":[1,1,1],"resource_id":"198fdef5-1b67-44c2-ab04-73ebbbbb38ad","name":"MiddleFinger1_R","components":{},"parent":"a8788210-7086-4983-8f25-483647685c19"},"ef45eef6-6a79-4a16-a6c8-ff34de434632":{"enabled":true,"tags":[],"children":["39285ce3-64c6-4c2f-82fa-3f2b72dca52a"],"position":[4.89337,2.84217e-14,-8.52651e-14],"rotation":[0.0389883,21.5463,0.0131999],"scale":[1,1,1],"resource_id":"ef45eef6-6a79-4a16-a6c8-ff34de434632","name":"MiddleFinger2_R","components":{},"parent":"198fdef5-1b67-44c2-ab04-73ebbbbb38ad"},"39285ce3-64c6-4c2f-82fa-3f2b72dca52a":{"enabled":true,"tags":[],"children":["04818824-0318-4b46-be06-f8fc3fa1e656"],"position":[2.69621,8.17124e-14,2.13163e-13],"rotation":[0.054418,11.2242,0.0118381],"scale":[1,1,1],"resource_id":"39285ce3-64c6-4c2f-82fa-3f2b72dca52a","name":"MiddleFinger3_R","components":{},"parent":"ef45eef6-6a79-4a16-a6c8-ff34de434632"},"04818824-0318-4b46-be06-f8fc3fa1e656":{"enabled":true,"tags":[],"children":[],"position":[2.71607,-1.06581e-14,-1.7053e-13],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"04818824-0318-4b46-be06-f8fc3fa1e656","name":"MiddleFinger4_R","components":{},"parent":"39285ce3-64c6-4c2f-82fa-3f2b72dca52a"},"3d109788-9c05-4cae-b6d8-b077edfddbb3":{"enabled":true,"tags":[],"children":["9765c624-ea3d-4d90-8f05-40197fdf6973"],"position":[3.10674,2.31021,-0.483349],"rotation":[-50.0838,12.4673,45.8555],"scale":[1,1,1],"resource_id":"3d109788-9c05-4cae-b6d8-b077edfddbb3","name":"ThumbFinger1_R","components":{},"parent":"a8788210-7086-4983-8f25-483647685c19"},"9765c624-ea3d-4d90-8f05-40197fdf6973":{"enabled":true,"tags":[],"children":["81b5aa17-4f3b-43c5-8bd3-7eeec5798380"],"position":[4.34949,-1.42109e-14,-1.42109e-13],"rotation":[0,4.37155,0],"scale":[1,1,1],"resource_id":"9765c624-ea3d-4d90-8f05-40197fdf6973","name":"ThumbFinger2_R","components":{},"parent":"3d109788-9c05-4cae-b6d8-b077edfddbb3"},"81b5aa17-4f3b-43c5-8bd3-7eeec5798380":{"enabled":true,"tags":[],"children":["f6421ddc-1235-4660-bfd0-a40845e6d7ea"],"position":[3.1758,-1.42109e-13,-8.52651e-14],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"81b5aa17-4f3b-43c5-8bd3-7eeec5798380","name":"ThumbFinger3_R","components":{},"parent":"9765c624-ea3d-4d90-8f05-40197fdf6973"},"f6421ddc-1235-4660-bfd0-a40845e6d7ea":{"enabled":true,"tags":[],"children":[],"position":[2.76567,-0.00000358292,-0.00000228963],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"f6421ddc-1235-4660-bfd0-a40845e6d7ea","name":"ThumbFinger4_R","components":{},"parent":"81b5aa17-4f3b-43c5-8bd3-7eeec5798380"},"4e79333c-096c-490a-aa0c-9ff81e867dc1":{"enabled":true,"tags":[],"children":["0cf39fde-b162-4374-b65f-7253d03fc90e"],"position":[10.4145,2.09944,0.18772],"rotation":[12.8626,11.9827,15.7219],"scale":[1,1,1],"resource_id":"4e79333c-096c-490a-aa0c-9ff81e867dc1","name":"IndexFinger1_R","components":{},"parent":"a8788210-7086-4983-8f25-483647685c19"},"0cf39fde-b162-4374-b65f-7253d03fc90e":{"enabled":true,"tags":[],"children":["ed3cfe7a-f075-4b56-bd42-e4beff4496a5"],"position":[4.25091,4.26326e-14,2.84217e-14],"rotation":[0.0303742,19.975,-0.00270507],"scale":[1,1,1],"resource_id":"0cf39fde-b162-4374-b65f-7253d03fc90e","name":"IndexFinger2_R","components":{},"parent":"4e79333c-096c-490a-aa0c-9ff81e867dc1"},"ed3cfe7a-f075-4b56-bd42-e4beff4496a5":{"enabled":true,"tags":[],"children":["b7a5b767-2c06-4dae-9d0a-ad229e554cd6"],"position":[2.52958,-2.70006e-13,-9.9476e-14],"rotation":[-1.73917,20.228,-0.667874],"scale":[1,1,1],"resource_id":"ed3cfe7a-f075-4b56-bd42-e4beff4496a5","name":"IndexFinger3_R","components":{},"parent":"0cf39fde-b162-4374-b65f-7253d03fc90e"},"b7a5b767-2c06-4dae-9d0a-ad229e554cd6":{"enabled":true,"tags":[],"children":[],"position":[2.13039,-8.52651e-14,1.63425e-13],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"b7a5b767-2c06-4dae-9d0a-ad229e554cd6","name":"IndexFinger4_R","components":{},"parent":"ed3cfe7a-f075-4b56-bd42-e4beff4496a5"},"6d64109e-a5a9-41fc-8ee5-2a20d106079d":{"enabled":true,"tags":[],"children":["7966646d-55df-4f8e-8bf2-00534b4d00bd","01bc0aec-840d-438e-b25e-52b181a09e79"],"position":[1.94157,-1.04512,0.00628707],"rotation":[0.0354528,2.78555,0.729473],"scale":[1,1,1],"resource_id":"6d64109e-a5a9-41fc-8ee5-2a20d106079d","name":"Cup_R","components":{},"parent":"a8788210-7086-4983-8f25-483647685c19"},"7966646d-55df-4f8e-8bf2-00534b4d00bd":{"enabled":true,"tags":[],"children":["20538600-4751-4007-ad65-f80019798ad1"],"position":[8.45064,-0.933787,-0.419414],"rotation":[17.5479,25.7488,-3.43213],"scale":[1,1,1],"resource_id":"7966646d-55df-4f8e-8bf2-00534b4d00bd","name":"RingFinger1_R","components":{},"parent":"6d64109e-a5a9-41fc-8ee5-2a20d106079d"},"20538600-4751-4007-ad65-f80019798ad1":{"enabled":true,"tags":[],"children":["46429438-175d-4194-9b61-c58fff9f9305"],"position":[4.34265,-8.88178e-14,1.27898e-13],"rotation":[-0.290359,10.8685,-0.0563096],"scale":[1,1,1],"resource_id":"20538600-4751-4007-ad65-f80019798ad1","name":"RingFinger2_R","components":{},"parent":"7966646d-55df-4f8e-8bf2-00534b4d00bd"},"46429438-175d-4194-9b61-c58fff9f9305":{"enabled":true,"tags":[],"children":["361d16e2-9a6c-4c3f-bdc7-2cf659f0bd2f"],"position":[2.67256,-7.10543e-15,7.10543e-14],"rotation":[0.589289,16.0378,0.170807],"scale":[1,1,1],"resource_id":"46429438-175d-4194-9b61-c58fff9f9305","name":"RingFinger3_R","components":{},"parent":"20538600-4751-4007-ad65-f80019798ad1"},"361d16e2-9a6c-4c3f-bdc7-2cf659f0bd2f":{"enabled":true,"tags":[],"children":[],"position":[2.53469,-7.10543e-14,-7.10543e-14],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"361d16e2-9a6c-4c3f-bdc7-2cf659f0bd2f","name":"RingFinger4_R","components":{},"parent":"46429438-175d-4194-9b61-c58fff9f9305"},"01bc0aec-840d-438e-b25e-52b181a09e79":{"enabled":true,"tags":[],"children":["1062bd57-376a-43e4-a8fb-35eb66f9453b"],"position":[7.91143,-2.6839,-1.31764],"rotation":[15.0094,29.8961,-14.1535],"scale":[1,1,1],"resource_id":"01bc0aec-840d-438e-b25e-52b181a09e79","name":"PinkyFinger1_R","components":{},"parent":"6d64109e-a5a9-41fc-8ee5-2a20d106079d"},"1062bd57-376a-43e4-a8fb-35eb66f9453b":{"enabled":true,"tags":[],"children":["6303bdad-1a6a-45ff-9f18-e84cd16f695c"],"position":[3.58146,-3.4639e-14,-9.9476e-14],"rotation":[0.279928,3.28062,0.126074],"scale":[1,1,1],"resource_id":"1062bd57-376a-43e4-a8fb-35eb66f9453b","name":"PinkyFinger2_R","components":{},"parent":"01bc0aec-840d-438e-b25e-52b181a09e79"},"6303bdad-1a6a-45ff-9f18-e84cd16f695c":{"enabled":true,"tags":[],"children":["4daade1b-88eb-4f0e-831d-ea15e1421b08"],"position":[1.91524,5.32907e-15,4.68958e-13],"rotation":[2.18092,11.1041,0.396434],"scale":[1,1,1],"resource_id":"6303bdad-1a6a-45ff-9f18-e84cd16f695c","name":"PinkyFinger3_R","components":{},"parent":"1062bd57-376a-43e4-a8fb-35eb66f9453b"},"4daade1b-88eb-4f0e-831d-ea15e1421b08":{"enabled":true,"tags":[],"children":[],"position":[1.72662,-6.39488e-14,-1.42109e-13],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"4daade1b-88eb-4f0e-831d-ea15e1421b08","name":"PinkyFinger4_R","components":{},"parent":"6303bdad-1a6a-45ff-9f18-e84cd16f695c"},"4c2773cf-3622-44e8-97f3-fc209bb8cee4":{"enabled":true,"tags":[],"children":["8f4d51cb-83c7-4b91-bd8a-4e5b63508b27"],"position":[23.2872,1.95399e-14,2.64984e-14],"rotation":[0,0,19.0927],"scale":[1,1,1],"resource_id":"4c2773cf-3622-44e8-97f3-fc209bb8cee4","name":"Neck_M","components":{},"parent":"c29a0386-611e-4068-a7b8-b4df066aa471"},"8f4d51cb-83c7-4b91-bd8a-4e5b63508b27":{"enabled":true,"tags":[],"children":["f867d446-9883-4a4a-a400-1199c1c71c78","cadfd24f-45fc-4d7a-a2ff-d6864a714d78","b1bb8e43-d388-4781-b86e-762011e1c581","4b131250-2d30-40da-a4ab-48d636acd76b"],"position":[9.92291,2.77112e-13,-3.53251e-14],"rotation":[0,0,-15.3283],"scale":[1,1,1],"resource_id":"8f4d51cb-83c7-4b91-bd8a-4e5b63508b27","name":"Head_M","components":{},"parent":"4c2773cf-3622-44e8-97f3-fc209bb8cee4"},"f867d446-9883-4a4a-a400-1199c1c71c78":{"enabled":true,"tags":[],"children":["6db18510-6f37-4c0d-9304-9f7601f54a34"],"position":[8.45394,6.53702,-3.17524],"rotation":[0,0,84.3542],"scale":[1,1,1],"resource_id":"f867d446-9883-4a4a-a400-1199c1c71c78","name":"Eye_R","components":{},"parent":"8f4d51cb-83c7-4b91-bd8a-4e5b63508b27"},"6db18510-6f37-4c0d-9304-9f7601f54a34":{"enabled":true,"tags":[],"children":[],"position":[1.65817,-3.69482e-13,3.5083e-14],"rotation":[15.9437,-0.260386,-0.0181438],"scale":[1,1,1],"resource_id":"6db18510-6f37-4c0d-9304-9f7601f54a34","name":"EyeEnd_R","components":{},"parent":"f867d446-9883-4a4a-a400-1199c1c71c78"},"cadfd24f-45fc-4d7a-a2ff-d6864a714d78":{"enabled":true,"tags":[],"children":["189cbc37-77dc-481d-8182-d1f00e212258"],"position":[0.712399,0.792158,-9.93169e-15],"rotation":[0,0,114.083],"scale":[1,1,1],"resource_id":"cadfd24f-45fc-4d7a-a2ff-d6864a714d78","name":"Jaw_M","components":{},"parent":"8f4d51cb-83c7-4b91-bd8a-4e5b63508b27"},"189cbc37-77dc-481d-8182-d1f00e212258":{"enabled":true,"tags":[],"children":[],"position":[11.1906,-1.98952e-13,-2.18793e-14],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"189cbc37-77dc-481d-8182-d1f00e212258","name":"JawEnd_M","components":{},"parent":"cadfd24f-45fc-4d7a-a2ff-d6864a714d78"},"b1bb8e43-d388-4781-b86e-762011e1c581":{"enabled":true,"tags":[],"children":[],"position":[21.1224,-7.10543e-15,-3.19636e-14],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"b1bb8e43-d388-4781-b86e-762011e1c581","name":"HeadEnd_M","components":{},"parent":"8f4d51cb-83c7-4b91-bd8a-4e5b63508b27"},"4b131250-2d30-40da-a4ab-48d636acd76b":{"enabled":true,"tags":[],"children":["0b15aa7b-1e37-4b14-84c2-940c77107c5d"],"position":[8.45394,6.53702,3.17524],"rotation":[0,0,84.3542],"scale":[1,1,1],"resource_id":"4b131250-2d30-40da-a4ab-48d636acd76b","name":"Eye_L","components":{},"parent":"8f4d51cb-83c7-4b91-bd8a-4e5b63508b27"},"0b15aa7b-1e37-4b14-84c2-940c77107c5d":{"enabled":true,"tags":[],"children":[],"position":[1.65817,-3.97904e-13,-4.04121e-14],"rotation":[-15.9437,0.260386,-0.0181438],"scale":[1,1,1],"resource_id":"0b15aa7b-1e37-4b14-84c2-940c77107c5d","name":"EyeEnd_L","components":{},"parent":"4b131250-2d30-40da-a4ab-48d636acd76b"},"d75a19a7-b62a-4529-aa76-3c408712accf":{"enabled":true,"tags":[],"children":["0dfd2e5b-f1f0-4781-a0d3-d49e978e9f13"],"position":[15.5097,-1.70398,8.47709],"rotation":[-40.4095,82.4185,131.651],"scale":[1,1,1],"resource_id":"d75a19a7-b62a-4529-aa76-3c408712accf","name":"Scapula_L","components":{},"parent":"c29a0386-611e-4068-a7b8-b4df066aa471"},"0dfd2e5b-f1f0-4781-a0d3-d49e978e9f13":{"enabled":true,"tags":[],"children":["21dd3cfd-c9b6-425b-a666-8540ce0c8ab3"],"position":[-12.1813,-3.01981e-14,-2.84217e-13],"rotation":[-9.628551510098124,85.69363770219339,-6.943683205519091],"scale":[1,1,1],"resource_id":"0dfd2e5b-f1f0-4781-a0d3-d49e978e9f13","name":"Shoulder_L","components":{},"parent":"d75a19a7-b62a-4529-aa76-3c408712accf"},"21dd3cfd-c9b6-425b-a666-8540ce0c8ab3":{"enabled":true,"tags":[],"children":["0cc9906a-d4bb-46ae-964f-bfc150aa4d5d"],"position":[-27.3069,-2.84217e-14,1.42109e-13],"rotation":[0,0,10.2376],"scale":[1,1,1],"resource_id":"21dd3cfd-c9b6-425b-a666-8540ce0c8ab3","name":"Elbow_L","components":{},"parent":"0dfd2e5b-f1f0-4781-a0d3-d49e978e9f13"},"0cc9906a-d4bb-46ae-964f-bfc150aa4d5d":{"enabled":true,"tags":[],"children":["3e70b84f-9892-426c-ad76-16543550310f","b84a76af-a752-44eb-8496-91ea0f963c48","47db01a7-e641-410a-9db0-f09a05e40bf0","02e281e0-0e40-43ce-8b57-81550fd9f875"],"position":[-25.3891,-2.84217e-14,-2.41585e-13],"rotation":[-17.98274557460915,2.7680631043652397,9.94242891256244],"scale":[1,1,1],"resource_id":"0cc9906a-d4bb-46ae-964f-bfc150aa4d5d","name":"Wrist_L","components":{},"parent":"21dd3cfd-c9b6-425b-a666-8540ce0c8ab3"},"3e70b84f-9892-426c-ad76-16543550310f":{"enabled":true,"tags":[],"children":["be7fe0e3-57d5-46c9-bfe8-0114f2ec95aa"],"position":[-10.7004,3.33067e-14,0],"rotation":[16.6631,19.9882,4.62472],"scale":[1,1,1],"resource_id":"3e70b84f-9892-426c-ad76-16543550310f","name":"MiddleFinger1_L","components":{},"parent":"0cc9906a-d4bb-46ae-964f-bfc150aa4d5d"},"be7fe0e3-57d5-46c9-bfe8-0114f2ec95aa":{"enabled":true,"tags":[],"children":["8b1771d5-ce8e-4d50-8c98-3bb61c5e6971"],"position":[-4.89337,-8.52651e-14,1.13687e-13],"rotation":[0.0389883,21.5463,0.0131999],"scale":[1,1,1],"resource_id":"be7fe0e3-57d5-46c9-bfe8-0114f2ec95aa","name":"MiddleFinger2_L","components":{},"parent":"3e70b84f-9892-426c-ad76-16543550310f"},"8b1771d5-ce8e-4d50-8c98-3bb61c5e6971":{"enabled":true,"tags":[],"children":["e5aee98d-0807-424b-8e40-aa9baa5275b3"],"position":[-2.69621,-1.77636e-14,-9.23706e-14],"rotation":[0.054418,11.2242,0.0118381],"scale":[1,1,1],"resource_id":"8b1771d5-ce8e-4d50-8c98-3bb61c5e6971","name":"MiddleFinger3_L","components":{},"parent":"be7fe0e3-57d5-46c9-bfe8-0114f2ec95aa"},"e5aee98d-0807-424b-8e40-aa9baa5275b3":{"enabled":true,"tags":[],"children":[],"position":[-2.71607,3.55271e-15,1.27898e-13],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"e5aee98d-0807-424b-8e40-aa9baa5275b3","name":"MiddleFinger4_L","components":{},"parent":"8b1771d5-ce8e-4d50-8c98-3bb61c5e6971"},"b84a76af-a752-44eb-8496-91ea0f963c48":{"enabled":true,"tags":[],"children":["8cd435a4-ac35-42df-a4df-9d17a6540121"],"position":[-3.10674,-2.31021,0.483349],"rotation":[-50.0838,12.4673,45.8555],"scale":[1,1,1],"resource_id":"b84a76af-a752-44eb-8496-91ea0f963c48","name":"ThumbFinger1_L","components":{},"parent":"0cc9906a-d4bb-46ae-964f-bfc150aa4d5d"},"8cd435a4-ac35-42df-a4df-9d17a6540121":{"enabled":true,"tags":[],"children":["8493c096-5583-45aa-be6c-8af7f2c3a7b9"],"position":[-4.34949,-1.56319e-13,1.7053e-13],"rotation":[0,4.37155,0],"scale":[1,1,1],"resource_id":"8cd435a4-ac35-42df-a4df-9d17a6540121","name":"ThumbFinger2_L","components":{},"parent":"b84a76af-a752-44eb-8496-91ea0f963c48"},"8493c096-5583-45aa-be6c-8af7f2c3a7b9":{"enabled":true,"tags":[],"children":["475326af-dd08-43ca-a0d1-3a58216aaa33"],"position":[-3.1758,3.19744e-13,1.13687e-13],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"8493c096-5583-45aa-be6c-8af7f2c3a7b9","name":"ThumbFinger3_L","components":{},"parent":"8cd435a4-ac35-42df-a4df-9d17a6540121"},"475326af-dd08-43ca-a0d1-3a58216aaa33":{"enabled":true,"tags":[],"children":[],"position":[-2.76567,0.00000358292,0.00000228963],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"475326af-dd08-43ca-a0d1-3a58216aaa33","name":"ThumbFinger4_L","components":{},"parent":"8493c096-5583-45aa-be6c-8af7f2c3a7b9"},"47db01a7-e641-410a-9db0-f09a05e40bf0":{"enabled":true,"tags":[],"children":["0b617cf6-774d-4ae4-8186-ca0b45c031d7"],"position":[-10.4145,-2.09944,-0.18772],"rotation":[12.8626,11.9827,15.7219],"scale":[1,1,1],"resource_id":"47db01a7-e641-410a-9db0-f09a05e40bf0","name":"IndexFinger1_L","components":{},"parent":"0cc9906a-d4bb-46ae-964f-bfc150aa4d5d"},"0b617cf6-774d-4ae4-8186-ca0b45c031d7":{"enabled":true,"tags":[],"children":["5d677778-911c-48e0-aa12-3e916aab0262"],"position":[-4.25091,4.9738e-14,9.9476e-14],"rotation":[0.0303742,19.975,-0.00270507],"scale":[1,1,1],"resource_id":"0b617cf6-774d-4ae4-8186-ca0b45c031d7","name":"IndexFinger2_L","components":{},"parent":"47db01a7-e641-410a-9db0-f09a05e40bf0"},"5d677778-911c-48e0-aa12-3e916aab0262":{"enabled":true,"tags":[],"children":["8be17afe-ac74-46a5-a1f8-f84ad3bf21ac"],"position":[-2.52958,2.70006e-13,1.27898e-13],"rotation":[-1.73917,20.228,-0.667874],"scale":[1,1,1],"resource_id":"5d677778-911c-48e0-aa12-3e916aab0262","name":"IndexFinger3_L","components":{},"parent":"0b617cf6-774d-4ae4-8186-ca0b45c031d7"},"8be17afe-ac74-46a5-a1f8-f84ad3bf21ac":{"enabled":true,"tags":[],"children":[],"position":[-2.13039,3.55271e-15,-2.13163e-13],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"8be17afe-ac74-46a5-a1f8-f84ad3bf21ac","name":"IndexFinger4_L","components":{},"parent":"5d677778-911c-48e0-aa12-3e916aab0262"},"02e281e0-0e40-43ce-8b57-81550fd9f875":{"enabled":true,"tags":[],"children":["2c541398-aa9f-4bb9-bfcb-8eb30927974b","3aa8fd7c-a907-4a1e-9750-72742b231108"],"position":[-1.94157,1.04512,-0.00628707],"rotation":[0.0354528,2.78555,0.729473],"scale":[1,1,1],"resource_id":"02e281e0-0e40-43ce-8b57-81550fd9f875","name":"Cup_L","components":{},"parent":"0cc9906a-d4bb-46ae-964f-bfc150aa4d5d"},"2c541398-aa9f-4bb9-bfcb-8eb30927974b":{"enabled":true,"tags":[],"children":["c46ded4d-1d76-46fa-aa6c-ad003e012e95"],"position":[-8.45064,0.933787,0.419414],"rotation":[17.5479,25.7488,-3.43213],"scale":[1,1,1],"resource_id":"2c541398-aa9f-4bb9-bfcb-8eb30927974b","name":"RingFinger1_L","components":{},"parent":"02e281e0-0e40-43ce-8b57-81550fd9f875"},"c46ded4d-1d76-46fa-aa6c-ad003e012e95":{"enabled":true,"tags":[],"children":["fb47204a-8050-4dbf-92d9-4d0f890a7690"],"position":[-4.34265,6.03961e-14,7.10543e-14],"rotation":[-0.290359,10.8685,-0.0563096],"scale":[1,1,1],"resource_id":"c46ded4d-1d76-46fa-aa6c-ad003e012e95","name":"RingFinger2_L","components":{},"parent":"2c541398-aa9f-4bb9-bfcb-8eb30927974b"},"fb47204a-8050-4dbf-92d9-4d0f890a7690":{"enabled":true,"tags":[],"children":["fee0f120-caa1-4f9e-8e80-dc3de3eed987"],"position":[-2.67256,3.55271e-15,-9.23706e-14],"rotation":[0.589289,16.0378,0.170807],"scale":[1,1,1],"resource_id":"fb47204a-8050-4dbf-92d9-4d0f890a7690","name":"RingFinger3_L","components":{},"parent":"c46ded4d-1d76-46fa-aa6c-ad003e012e95"},"fee0f120-caa1-4f9e-8e80-dc3de3eed987":{"enabled":true,"tags":[],"children":[],"position":[-2.53469,4.61853e-14,8.88178e-14],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"fee0f120-caa1-4f9e-8e80-dc3de3eed987","name":"RingFinger4_L","components":{},"parent":"fb47204a-8050-4dbf-92d9-4d0f890a7690"},"3aa8fd7c-a907-4a1e-9750-72742b231108":{"enabled":true,"tags":[],"children":["3def1b77-54d5-49ff-aa96-ffe10667f25e"],"position":[-7.91143,2.6839,1.31764],"rotation":[15.0094,29.8961,-14.1535],"scale":[1,1,1],"resource_id":"3aa8fd7c-a907-4a1e-9750-72742b231108","name":"PinkyFinger1_L","components":{},"parent":"02e281e0-0e40-43ce-8b57-81550fd9f875"},"3def1b77-54d5-49ff-aa96-ffe10667f25e":{"enabled":true,"tags":[],"children":["3f857d76-c1ca-442e-bab5-306f1e857cf1"],"position":[-3.58146,1.02141e-14,1.27898e-13],"rotation":[0.279928,3.28062,0.126074],"scale":[1,1,1],"resource_id":"3def1b77-54d5-49ff-aa96-ffe10667f25e","name":"PinkyFinger2_L","components":{},"parent":"3aa8fd7c-a907-4a1e-9750-72742b231108"},"3f857d76-c1ca-442e-bab5-306f1e857cf1":{"enabled":true,"tags":[],"children":["dab2f521-3703-419a-8fb2-2c538ec08bc9"],"position":[-1.91524,8.43769e-15,-5.11591e-13],"rotation":[2.18092,11.1041,0.396434],"scale":[1,1,1],"resource_id":"3f857d76-c1ca-442e-bab5-306f1e857cf1","name":"PinkyFinger3_L","components":{},"parent":"3def1b77-54d5-49ff-aa96-ffe10667f25e"},"dab2f521-3703-419a-8fb2-2c538ec08bc9":{"enabled":true,"tags":[],"children":[],"position":[-1.72662,8.52651e-14,2.55795e-13],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"dab2f521-3703-419a-8fb2-2c538ec08bc9","name":"PinkyFinger4_L","components":{},"parent":"3f857d76-c1ca-442e-bab5-306f1e857cf1"},"f740a22f-4149-424c-9d1a-d0488bbe70db":{"enabled":true,"tags":[],"children":["7a92c945-554e-45a4-b6ae-71c1ee001a5f"],"position":[-2.04778,-0.445829,9.98721],"rotation":[-178.09,6.36596,-1.51345],"scale":[1,1,1],"resource_id":"f740a22f-4149-424c-9d1a-d0488bbe70db","name":"Hip_L","components":{},"parent":"7b589cc4-8c29-4aa9-b38f-ef45ea42a365"},"7a92c945-554e-45a4-b6ae-71c1ee001a5f":{"enabled":true,"tags":[],"children":["2dea15ad-7e5b-4c2d-ab56-c0b8db6448ba"],"position":[-44.9641,-3.55271e-15,1.06581e-13],"rotation":[0,0,-9.83765],"scale":[1,1,1],"resource_id":"7a92c945-554e-45a4-b6ae-71c1ee001a5f","name":"Knee_L","components":{},"parent":"f740a22f-4149-424c-9d1a-d0488bbe70db"},"2dea15ad-7e5b-4c2d-ab56-c0b8db6448ba":{"enabled":true,"tags":[],"children":["038e8909-3cff-4b4c-a51d-8b8aa7ff7a2d"],"position":[-39.9237,8.34888e-14,7.10543e-14],"rotation":[1.70759,6.38072,10.1826],"scale":[1,1,1],"resource_id":"2dea15ad-7e5b-4c2d-ab56-c0b8db6448ba","name":"Ankle_L","components":{},"parent":"7a92c945-554e-45a4-b6ae-71c1ee001a5f"},"038e8909-3cff-4b4c-a51d-8b8aa7ff7a2d":{"enabled":true,"tags":[],"children":["c4de8417-8875-407b-abf8-f7dda9d5f933"],"position":[-7.95222,-15.2582,-6.75016e-14],"rotation":[-4.68637,1.48242,86.1308],"scale":[1,1,1],"resource_id":"038e8909-3cff-4b4c-a51d-8b8aa7ff7a2d","name":"Toes_L","components":{},"parent":"2dea15ad-7e5b-4c2d-ab56-c0b8db6448ba"},"c4de8417-8875-407b-abf8-f7dda9d5f933":{"enabled":true,"tags":[],"children":[],"position":[-6.08362,2.11497e-14,2.13163e-14],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"c4de8417-8875-407b-abf8-f7dda9d5f933","name":"ToesEnd_L","components":{},"parent":"038e8909-3cff-4b4c-a51d-8b8aa7ff7a2d"},"eb255f1a-f435-42c2-bd0f-f492fc5046bc":{"enabled":true,"tags":[],"children":["bccb9535-b53e-471e-98e5-8b81ab255417","20792f1a-7d6a-4e98-a660-61fe0335f26a"],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"eb255f1a-f435-42c2-bd0f-f492fc5046bc","name":"Geo","components":{},"parent":"bab2ed8f-5323-4ad2-82f4-45b64ca3f542"},"bccb9535-b53e-471e-98e5-8b81ab255417":{"enabled":true,"tags":[],"children":[],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"bccb9535-b53e-471e-98e5-8b81ab255417","name":"SuitGEO01","components":{"render":{"enabled":true,"type":"asset","asset":80915304,"materialAssets":[80915301],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":"7b589cc4-8c29-4aa9-b38f-ef45ea42a365"}},"parent":"eb255f1a-f435-42c2-bd0f-f492fc5046bc"},"20792f1a-7d6a-4e98-a660-61fe0335f26a":{"enabled":true,"tags":[],"children":[],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"20792f1a-7d6a-4e98-a660-61fe0335f26a","name":"HeadF","components":{"render":{"enabled":true,"type":"asset","asset":80915305,"materialAssets":[80915302],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":"7b589cc4-8c29-4aa9-b38f-ef45ea42a365"}},"parent":"eb255f1a-f435-42c2-bd0f-f492fc5046bc"}},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":1390892} \ No newline at end of file diff --git a/__game-scripts.js b/__game-scripts.js index 7e839db..829ba86 100644 --- a/__game-scripts.js +++ b/__game-scripts.js @@ -1 +1 @@ -var Mouse=pc.createScript("mouse");Mouse.attributes.add("Selected",{type:"number",default:0}),Mouse.attributes.add("redMaterial",{type:"asset",assetType:"material"}),Mouse.attributes.add("greenMaterial",{type:"asset",assetType:"material"}),Mouse.attributes.add("blueMaterial",{type:"asset",assetType:"material"}),Mouse.prototype.initialize=function(){this.pos=new pc.Vec3,this.app.mouse.disableContextMenu(),this.app.mouse.on(pc.EVENT_MOUSEMOVE,this.onMouseMove,this),this.app.mouse.on(pc.EVENT_MOUSEDOWN,this.onMouseDown,this),this.app.mouse.on(pc.EVENT_MOUSEUP,this.onMouseUp,this)},Mouse.prototype.onMouseMove=function(t){if(1==this.Selected){this.app.graphicsDevice.canvas.clientWidth;var e=this.app.graphicsDevice.canvas.clientHeight,s=(e-t.y)/e*16,i=this.entity.getPosition();this.app.root.findByName("Camera").camera.screenToWorld(t.x,t.y,s,this.pos),this.entity.setPosition(this.pos.x,i.y,this.pos.z),this.entity.getPosition().z>3&&this.entity.setPosition(this.pos.x,i.y,3)}},Mouse.prototype.onMouseDown=function(t){t.button,pc.MOUSEBUTTON_LEFT},Mouse.prototype.onMouseUp=function(t){t.button===pc.MOUSEBUTTON_LEFT&&(this.Selected=0)};var Touch=pc.createScript("touch");Touch.attributes.add("Selected",{type:"number",default:0});var LastX=0,LastY=0,dx=0,dy=0;Touch.prototype.initialize=function(){this.pos=new pc.Vec3,this.cameraEntity=this.app.root.findByName("Camera");var t=this.app.touch;t&&(t.on(pc.EVENT_TOUCHSTART,this.onTouchStart,this),t.on(pc.EVENT_TOUCHMOVE,this.onTouchMove,this),t.on(pc.EVENT_TOUCHEND,this.onTouchEnd,this),t.on(pc.EVENT_TOUCHCANCEL,this.onTouchCancel,this)),this.on("destroy",(function(){t.off(pc.EVENT_TOUCHSTART,this.onTouchStart,this),t.off(pc.EVENT_TOUCHMOVE,this.onTouchMove,this),t.off(pc.EVENT_TOUCHEND,this.onTouchEnd,this),t.off(pc.EVENT_TOUCHCANCEL,this.onTouchCancel,this)}),this)},Touch.prototype.updateFromScreen=function(t){if(1==this.Selected){this.app.graphicsDevice.canvas.clientWidth;var o=this.app.graphicsDevice.canvas.clientHeight,e=(o-t.y)/o*16;console.log("depth: = "+e);var i=this.entity.getPosition();this.app.root.findByName("Camera").camera.screenToWorld(t.x,t.y,e,this.pos),this.entity.setPosition(this.pos.x,i.y,this.pos.z),this.entity.getPosition().z>3&&this.entity.setPosition(this.pos.x,i.y,3)}},Touch.prototype.onTouchStart=function(t){1===t.touches.length&&this.updateFromScreen(t.touches[0]),t.event.preventDefault()},Touch.prototype.onTouchMove=function(t){this.updateFromScreen(t.touches[0]),t.event.preventDefault()},Touch.prototype.onTouchEnd=function(t){this.Selected=0,t.event.preventDefault()},Touch.prototype.onTouchCancel=function(t){this.Selected=0,t.event.preventDefault()};var PickerRaycast=pc.createScript("pickerRaycast");PickerRaycast.prototype.initialize=function(){this.app.mouse.on(pc.EVENT_MOUSEDOWN,this.onSelect,this);var t=this.app.touch;t&&t.on(pc.EVENT_TOUCHSTART,this.onTouch,this),this.on("destroy",(function(){this.app.mouse.off(pc.EVENT_MOUSEDOWN,this.onSelect,this),t&&this.app.touch.off(pc.EVENT_TOUCHSTART,this.onTouch,this)}),this)},PickerRaycast.prototype.onSelect=function(t){var i=this.entity.camera.screenToWorld(t.x,t.y,this.entity.camera.nearClip),s=this.entity.camera.screenToWorld(t.x,t.y,this.entity.camera.farClip);this.app.systems.rigidbody.raycastFirst(i,s,(function(t){var i=t.entity;i.script.mouse.Selected=1,i.script.showHeightAndWidth&&i.script.showHeightAndWidth.showArrows(),console.log("raycastHit")}))},PickerRaycast.prototype.onTouch=function(t){var i=this.entity.camera.screenToWorld(t.touches[0].x,t.touches[0].y,this.entity.camera.nearClip),s=this.entity.camera.screenToWorld(t.touches[0].x,t.touches[0].y,this.entity.camera.farClip);console.log("raycastHit"),console.log("screenx: "+t.x+" screenY: "+t.y),console.log("from: "+i+" to: "+s),this.app.systems.rigidbody.raycastFirst(i,s,(function(t){var i=t.entity;i.script.touch.Selected=1,i.script.showHeightAndWidth&&i.script.showHeightAndWidth.showArrows(),console.log("raycastHitInside")}))};var LoadImage=pc.createScript("loadImage");LoadImage.attributes.add("url",{type:"string"}),LoadImage.prototype.initialize=function(){const e=window.location.search;console.log(e);const t=new URLSearchParams(e).get("filename");console.log(t),this.url=t,setInterval((function(){this.changeToNextTexture()}),1e3)},LoadImage.prototype.changeToNextTexture=function(){var e=new Image;e.crossOrigin="anonymous",e.onload=function(){var t=new pc.Texture(self.app.graphicsDevice);t.setSource(e);for(var a=this.entity.findComponents("render"),n=0;nthis.hideInterval&&(this.timer=0,this.width.enabled=!1,this.height.enabled=!1)},ShowHeightAndWidth.prototype.showArrows=function(){this.timer=0,this.width.enabled=!0,this.height.enabled=!0}; \ No newline at end of file +var Mouse=pc.createScript("mouse");Mouse.attributes.add("Selected",{type:"number",default:0}),Mouse.attributes.add("redMaterial",{type:"asset",assetType:"material"}),Mouse.attributes.add("greenMaterial",{type:"asset",assetType:"material"}),Mouse.attributes.add("blueMaterial",{type:"asset",assetType:"material"}),Mouse.prototype.initialize=function(){this.pos=new pc.Vec3,this.app.mouse.disableContextMenu(),this.app.mouse.on(pc.EVENT_MOUSEMOVE,this.onMouseMove,this),this.app.mouse.on(pc.EVENT_MOUSEDOWN,this.onMouseDown,this),this.app.mouse.on(pc.EVENT_MOUSEUP,this.onMouseUp,this)},Mouse.prototype.onMouseMove=function(t){if(1==this.Selected){this.app.graphicsDevice.canvas.clientWidth;var e=this.app.graphicsDevice.canvas.clientHeight,s=(e-t.y)/e*16,i=this.entity.getPosition();this.app.root.findByName("Camera").camera.screenToWorld(t.x,t.y,s,this.pos),this.entity.setPosition(this.pos.x,i.y,this.pos.z),this.entity.getPosition().z>3&&this.entity.setPosition(this.pos.x,i.y,3)}},Mouse.prototype.onMouseDown=function(t){t.button,pc.MOUSEBUTTON_LEFT},Mouse.prototype.onMouseUp=function(t){t.button===pc.MOUSEBUTTON_LEFT&&(this.Selected=0)};var Touch=pc.createScript("touch");Touch.attributes.add("Selected",{type:"number",default:0});var LastX=0,LastY=0,dx=0,dy=0;Touch.prototype.initialize=function(){this.pos=new pc.Vec3,this.cameraEntity=this.app.root.findByName("Camera");var t=this.app.touch;t&&(t.on(pc.EVENT_TOUCHSTART,this.onTouchStart,this),t.on(pc.EVENT_TOUCHMOVE,this.onTouchMove,this),t.on(pc.EVENT_TOUCHEND,this.onTouchEnd,this),t.on(pc.EVENT_TOUCHCANCEL,this.onTouchCancel,this)),this.on("destroy",(function(){t.off(pc.EVENT_TOUCHSTART,this.onTouchStart,this),t.off(pc.EVENT_TOUCHMOVE,this.onTouchMove,this),t.off(pc.EVENT_TOUCHEND,this.onTouchEnd,this),t.off(pc.EVENT_TOUCHCANCEL,this.onTouchCancel,this)}),this)},Touch.prototype.updateFromScreen=function(t){if(1==this.Selected){this.app.graphicsDevice.canvas.clientWidth;var o=this.app.graphicsDevice.canvas.clientHeight,e=(o-t.y)/o*16;console.log("depth: = "+e);var i=this.entity.getPosition();this.app.root.findByName("Camera").camera.screenToWorld(t.x,t.y,e,this.pos),this.entity.setPosition(this.pos.x,i.y,this.pos.z),this.entity.getPosition().z>3&&this.entity.setPosition(this.pos.x,i.y,3)}},Touch.prototype.onTouchStart=function(t){1===t.touches.length&&this.updateFromScreen(t.touches[0]),t.event.preventDefault()},Touch.prototype.onTouchMove=function(t){this.updateFromScreen(t.touches[0]),t.event.preventDefault()},Touch.prototype.onTouchEnd=function(t){this.Selected=0,t.event.preventDefault()},Touch.prototype.onTouchCancel=function(t){this.Selected=0,t.event.preventDefault()};var PickerRaycast=pc.createScript("pickerRaycast");PickerRaycast.prototype.initialize=function(){this.app.mouse.on(pc.EVENT_MOUSEDOWN,this.onSelect,this);var t=this.app.touch;t&&t.on(pc.EVENT_TOUCHSTART,this.onTouch,this),this.on("destroy",(function(){this.app.mouse.off(pc.EVENT_MOUSEDOWN,this.onSelect,this),t&&this.app.touch.off(pc.EVENT_TOUCHSTART,this.onTouch,this)}),this)},PickerRaycast.prototype.onSelect=function(t){var i=this.entity.camera.screenToWorld(t.x,t.y,this.entity.camera.nearClip),s=this.entity.camera.screenToWorld(t.x,t.y,this.entity.camera.farClip);this.app.systems.rigidbody.raycastFirst(i,s,(function(t){var i=t.entity;i.script.mouse.Selected=1,i.script.showHeightAndWidth&&i.script.showHeightAndWidth.showArrows(),console.log("raycastHit")}))},PickerRaycast.prototype.onTouch=function(t){var i=this.entity.camera.screenToWorld(t.touches[0].x,t.touches[0].y,this.entity.camera.nearClip),s=this.entity.camera.screenToWorld(t.touches[0].x,t.touches[0].y,this.entity.camera.farClip);console.log("raycastHit"),console.log("screenx: "+t.x+" screenY: "+t.y),console.log("from: "+i+" to: "+s),this.app.systems.rigidbody.raycastFirst(i,s,(function(t){var i=t.entity;i.script.touch.Selected=1,i.script.showHeightAndWidth&&i.script.showHeightAndWidth.showArrows(),console.log("raycastHitInside")}))};var LoadImage=pc.createScript("loadImage");LoadImage.attributes.add("url",{type:"string"}),LoadImage.prototype.initialize=function(){const e=window.location.search;console.log(e);const t=new URLSearchParams(e).get("filename");console.log(t),this.url=t,setInterval((function(){this.changeToNextTexture()}),1e3)},LoadImage.prototype.changeToNextTexture=function(){var e=new Image;e.crossOrigin="anonymous",e.onload=function(){var t=new pc.Texture(self.app.graphicsDevice);t.setSource(e);for(var a=this.entity.findComponents("render"),n=0;nthis.hideInterval&&(this.timer=0,this.width.enabled=!1,this.height.enabled=!1)},ShowHeightAndWidth.prototype.showArrows=function(){this.timer=0,this.width.enabled=!0,this.height.enabled=!0}; \ No newline at end of file diff --git a/config.json b/config.json index 8704c76..45c6db1 100644 --- a/config.json +++ b/config.json @@ -1 +1 @@ -{"application_properties":{"i18nAssets":[],"useTouch":true,"layerOrder":[{"layer":0,"enabled":true,"transparent":false},{"layer":1,"enabled":true,"transparent":false},{"layer":2,"enabled":true,"transparent":false},{"layer":0,"enabled":true,"transparent":true},{"layer":3,"enabled":true,"transparent":false},{"layer":3,"enabled":true,"transparent":true},{"layer":4,"enabled":true,"transparent":true}],"externalScripts":[],"height":720,"vr":false,"useModelV2":false,"antiAlias":true,"layers":{"0":{"transparentSortMode":3,"opaqueSortMode":2,"name":"World"},"1":{"transparentSortMode":3,"opaqueSortMode":2,"name":"Depth"},"2":{"transparentSortMode":3,"opaqueSortMode":0,"name":"Skybox"},"3":{"transparentSortMode":3,"opaqueSortMode":0,"name":"Immediate"},"4":{"transparentSortMode":1,"opaqueSortMode":1,"name":"UI"}},"width":1280,"useDevicePixelRatio":false,"useKeyboard":true,"maxAssetRetries":5,"powerPreference":"default","batchGroups":[],"preserveDrawingBuffer":false,"useLegacyScripts":false,"fillMode":"KEEP_ASPECT","scripts":[77854887,78097772,78382718,79014545,79153391,79459251,79465795,79469394],"useMouse":true,"use3dPhysics":false,"transparentCanvas":false,"resolutionMode":"AUTO","loadingScreenScript":null,"preferWebGl2":true,"useGamepads":false,"libraries":[]},"scenes":[{"name":"Untitled","url":"1390892.json"}],"assets":{"77854887":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"mouse.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"mouse":{"attributesOrder":["Selected","redMaterial","greenMaterial","blueMaterial"],"attributes":{"redMaterial":{"type":"asset","assetType":"material"},"greenMaterial":{"type":"asset","assetType":"material"},"blueMaterial":{"type":"asset","assetType":"material"},"Selected":{"type":"number","default":0}}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":7221,"hash":"88b3c04e2c42f73de8df5dbc8373e721","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"d113604b-6b50-4b8a-b789-8d3bd115e928","same_as_backup":0,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"77854887"},"77855246":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"New Material","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[0,0.3764705882352941,1],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissive":[0,0,0],"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacity":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"77855246"},"77855249":{"tags":[],"name":"New Material","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[1,0,0],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissive":[0,0,0],"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacity":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"77855249"},"77855250":{"tags":[],"name":"New Material","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[0.3333333333333333,1,0],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissive":[0,0,0],"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacity":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"77855250"},"78072763":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"loonie1.png","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"png","type":"Bilevel","width":500,"height":500,"alpha":true,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"loonie1.png","size":179080,"hash":"549278f659af3330a068eeab4953f01b","variants":{},"url":"files/assets/78072763/1/loonie1.png"},"region":"eu-west-1","i18n":{},"immutable_backup":"18691b30-4b08-4f1a-af0e-de96e176d2ec","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78072763"},"78072855":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"New Material","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[1,1,1],"diffuseMap":78072763,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":2,"emissive":[0,0,0],"emissiveMap":78072763,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1.18,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0.686,"alphaFade":1,"opacity":1,"opacityMap":78072763,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78072855"},"78097772":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"touch.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"touch":{"attributesOrder":["Selected"],"attributes":{"Selected":{"type":"number","default":0}}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":7221,"hash":"88b3c04e2c42f73de8df5dbc8373e721","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"1d747b38-0749-4591-b2b0-423b6ce0f124","same_as_backup":0,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78097772"},"78181705":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Wdparq2.jpg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":true,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":351,"height":351,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"Wdparq2.jpg","size":63706,"hash":"2095a6d326c917be6886f7e49298c039","variants":{},"url":"files/assets/78181705/1/Wdparq2.jpg"},"region":"eu-west-1","i18n":{},"immutable_backup":"22a14b99-6d79-47c9-8f24-15d6a8f2296e","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181705"},"78181706":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"robe2.jpg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":298,"height":298,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"robe2.jpg","size":18470,"hash":"3508e1085ab2dc004e38257685c02922","variants":{},"url":"files/assets/78181706/1/robe2.jpg"},"region":"eu-west-1","i18n":{},"immutable_backup":"e490c699-0138-4c10-8583-e80c56b0524b","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181706"},"78181707":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"ceilingbump.jpg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":283,"height":403,"alpha":false,"depth":8,"srgb":false,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"ceilingbump.jpg","size":115965,"hash":"c78e303aa89c57fb464518c819f327b6","variants":{},"url":"files/assets/78181707/1/ceilingbump.jpg"},"region":"eu-west-1","i18n":{},"immutable_backup":"0d620af6-09c2-4f07-ade6-c05639b72cd4","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181707"},"78181708":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"walls.jpg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":983,"height":662,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"walls.jpg","size":79678,"hash":"8959016d8864904b03e3c778260cee6f","variants":{},"url":"files/assets/78181708/1/walls.jpg"},"region":"eu-west-1","i18n":{},"immutable_backup":"9a16ead2-527f-4bc0-9361-a7950c057189","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181708"},"78181709":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"CARPTTAN.JPG","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":512,"height":512,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"CARPTTAN.JPG","size":250224,"hash":"1d7c8fb9403e175e294aa0a14e290a54","variants":{},"url":"files/assets/78181709/1/CARPTTAN.JPG"},"region":"eu-west-1","i18n":{},"immutable_backup":"d0ae7e5d-36d3-43ed-b153-52400d67c20d","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181709"},"78181710":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"livingroom.max","revision":1,"preload":true,"exclude":false,"meta":null,"data":null,"type":"binary","file":{"filename":"livingroom.max","size":302592,"hash":"444dd36a95b616a14e030148af5cda69","url":"files/assets/78181710/1/livingroom.max"},"region":"eu-west-1","i18n":{},"immutable_backup":"930de445-fae5-4586-94bb-889d3fd0555d","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181710"},"78181711":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"BURLOAK.JPG","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":756,"height":512,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"BURLOAK.JPG","size":189060,"hash":"3a7de42744d470c97f33b53c1b3eef7b","variants":{},"url":"files/assets/78181711/1/BURLOAK.JPG"},"region":"eu-west-1","i18n":{},"immutable_backup":"ae4e4bb5-0c36-4e7e-85b4-492e145c6574","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181711"},"78181751":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Take 001.glb","revision":1,"preload":true,"region":"eu-west-1","meta":{"name":"Take 001","duration":0},"data":null,"type":"animation","file":{"hash":"cb00af4e5637090a638f86273312a910","size":13688,"filename":"Take 001.glb","url":"files/assets/78181751/1/Take%20001.glb"},"i18n":{},"immutable_backup":"5badb4b8-22df-4a7c-9068-f4f7ddb16bae","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181751"},"78181752":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"01 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":0},"data":{"shader":"blinn","ambient":[0.588235,0.588235,0.588235],"diffuse":[0.588235,0.588235,0.588235],"diffuseMap":null,"diffuseMapOffset":[0,0],"diffuseMapTiling":[1,1],"specular":[0,0,0],"shininess":1.81818,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMapChannel":"rgb","diffuseMapUv":0,"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181752"},"78181753":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"02 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":3},"data":{"shader":"blinn","ambient":[0.588235,0.588235,0.588235],"diffuse":[0.588235,0.588235,0.588235],"diffuseMap":null,"diffuseMapOffset":[0,0],"diffuseMapTiling":[1,1],"specular":[0,0,0],"shininess":18.1818,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMapChannel":"rgb","diffuseMapUv":0,"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181753"},"78181754":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"13 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":1},"data":{"shader":"blinn","ambient":[0.588235,0.588235,0.588235],"diffuse":[0.588235,0.588235,0.588235],"diffuseMap":78181705,"diffuseMapOffset":[-0.35,-0.7],"diffuseMapTiling":[4.75,3.61],"specular":[0,0,0],"shininess":18.1818,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMapChannel":"rgb","diffuseMapUv":0,"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181754"},"78181756":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"14 - Defaultwall","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":2},"data":{"shader":"blinn","ambient":[0.588235,0.588235,0.588235],"diffuse":[0.588235,0.588235,0.588235],"diffuseMap":78181708,"diffuseMapOffset":[4.17233e-7,0],"diffuseMapTiling":[0.999999,1],"specular":[0,0,0],"shininess":18.1818,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMapChannel":"rgb","diffuseMapUv":0,"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181756"},"78181757":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"07 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":6},"data":{"shader":"blinn","ambient":[1,1,0.960784],"diffuse":[1,1,0.960784],"specular":[0,0,0],"shininess":18.1818,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181757"},"78181758":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"15 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":8},"data":{"shader":"blinn","ambient":[0.686275,0.423529,0.192157],"diffuse":[0.686275,0.423529,0.192157],"specular":[0,0,0],"shininess":18.1818,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181758"},"78181759":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"14 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":7},"data":{"shader":"blinn","ambient":[0.588235,0.588235,0.588235],"diffuse":[0.588235,0.588235,0.588235],"diffuseMap":null,"diffuseMapOffset":[0,0],"diffuseMapTiling":[1,1],"specular":[0,0,0],"shininess":18.1818,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMapChannel":"rgb","diffuseMapUv":0,"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181759"},"78181760":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"08 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":5},"data":{"shader":"blinn","ambient":[1,0.729412,0],"diffuse":[1,0.729412,0],"specular":[0.31132,0.31132,0.31132],"shininess":90.9091,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181760"},"78181761":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"03 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":4},"data":{"shader":"blinn","ambient":[1,1,1],"diffuse":[1,1,1],"specular":[1.6045,1.6045,1.6045],"shininess":90.9091,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181761"},"78181762":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":658,"triangles":768,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":0},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181762"},"78181763":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box02","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":658,"triangles":768,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":1},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181763"},"78181764":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box03","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":658,"triangles":768,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":2},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181764"},"78181765":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box04","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":652,"triangles":764,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":3},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181765"},"78181766":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box05","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":652,"triangles":764,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":4},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181766"},"78181767":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box06","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":652,"triangles":764,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":5},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181767"},"78181768":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box07","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":11646,"triangles":15932,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":6},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181768"},"78181769":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":391,"triangles":704,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":7},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181769"},"78181770":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"C-Ext01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":56,"triangles":28,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":8},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181770"},"78181771":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box08","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":406,"triangles":212,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":9},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181771"},"78181772":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Sphere01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1412,"triangles":2300,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":10},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181772"},"78181773":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Cylinder01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":79,"triangles":72,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":11},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181773"},"78181774":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Sphere02","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":71,"triangles":80,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":12},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181774"},"78181775":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Line01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1503,"triangles":1572,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":13},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181775"},"78181776":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box09","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":14},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181776"},"78181777":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box10","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":15},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181777"},"78181778":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box11","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":16},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181778"},"78181779":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box12","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":17},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181779"},"78181780":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box13","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":18},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181780"},"78181876":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"livingroom.glb","revision":1,"preload":true,"region":"eu-west-1","meta":null,"data":{},"type":"container","file":{"hash":"78e748bf3b30b70fc9d4b74e36d22e8d","size":815580,"filename":"livingroom.glb","url":"files/assets/78181876/1/livingroom.glb"},"i18n":{},"immutable_backup":"47d741c1-43e5-456c-a962-4f29772eb1b5","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181876"},"78181877":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":658,"triangles":768,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":0},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181877"},"78181878":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box02","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":658,"triangles":768,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":1},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181878"},"78181879":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box03","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":658,"triangles":768,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":2},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181879"},"78181880":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box04","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":652,"triangles":764,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":3},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181880"},"78181881":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box05","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":652,"triangles":764,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":4},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181881"},"78181882":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box06","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":652,"triangles":764,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":5},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181882"},"78181883":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box07","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":11646,"triangles":15932,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":6},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181883"},"78181884":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":391,"triangles":704,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":7},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181884"},"78181885":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"C-Ext01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":56,"triangles":28,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":8},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181885"},"78181886":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Sphere01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1412,"triangles":2300,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":10},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181886"},"78181887":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box08","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":406,"triangles":212,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":9},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181887"},"78181888":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Cylinder01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":79,"triangles":72,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":11},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181888"},"78181889":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Sphere02","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":71,"triangles":80,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":12},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181889"},"78181890":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Line01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1503,"triangles":1572,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":13},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181890"},"78181891":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box09","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":14},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181891"},"78181892":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box10","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":15},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181892"},"78181893":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box11","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":16},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181893"},"78181894":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box12","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":17},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181894"},"78181895":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box13","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":18},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181895"},"78181896":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"livingroom","revision":1,"preload":true,"region":"eu-west-1","meta":{"containerAsset":78181876},"data":{"entities":{"992e38f0-dd22-4fe8-843f-5c80f0b4190f":{"enabled":true,"tags":[],"children":["cf173562-138d-43de-b497-644f7ffe4239"],"position":[0,0,0],"rotation":[0,0,0],"scale":[0.01,0.01,0.01],"resource_id":"992e38f0-dd22-4fe8-843f-5c80f0b4190f","name":"RootNode","components":{},"parent":null},"cf173562-138d-43de-b497-644f7ffe4239":{"enabled":true,"tags":[],"children":["19b78e10-9bec-4619-80ff-e761bd368e6e","f637845d-7f0e-416e-a2da-27a804b90a26","624e755c-e008-4e38-a4ae-e189b9e6af0e","8fd046ca-9bf2-4996-a426-d5f6f336a65b","235f5a54-087f-4b74-bcb8-e92fb0454a6f","92d77773-aa8e-4faa-a639-619c285b76f1","0e2a3a2c-7ef9-48a5-94f8-425b169eb692","9ea5ecb4-e90e-41e7-8464-9700435c402b","7a7196e1-59de-4cee-831f-db20924f5a99","03051ef6-4f3a-438e-9160-a8aea926e2d0","3ce4c2c1-7a99-4730-a57c-346004bc1485","90839ae3-cc29-477f-a88e-53fb57152250","04a75aae-eb81-4d94-8678-29e91bc7ff75","26ac5c6d-406a-4e21-b3ce-6e451befe8e9","0ca19a72-2469-4446-b3d5-d341756117d3","afce77e7-aca3-481a-b7ad-35126ffafcde","1dbd7266-a1ce-4993-a0c0-14bc38ef3479","d5b5339a-94b6-4efa-822b-9c5c7997f1e1","232324a7-b6aa-4551-a098-bc9ea317773c","1346743e-6c0f-4290-9590-f6e6b64494a1","8a26cc25-f015-4fc5-8cfc-d2366cd0ec11","8f969715-c24b-40d4-a640-80340cc8ddaf","71743733-1689-447d-b55b-ef36a1f9832f"],"position":[0,0,0],"rotation":[0,0,0],"scale":[2.54,2.54,2.54],"resource_id":"cf173562-138d-43de-b497-644f7ffe4239","name":"Fbx_Root","components":{},"parent":"992e38f0-dd22-4fe8-843f-5c80f0b4190f"},"19b78e10-9bec-4619-80ff-e761bd368e6e":{"enabled":true,"tags":[],"children":[],"position":[-7.74598,38.4319,30.0512],"rotation":[0,0,14.3003],"scale":[1.07852,1.07852,1.07852],"resource_id":"19b78e10-9bec-4619-80ff-e761bd368e6e","name":"Box01","components":{"render":{"enabled":true,"type":"asset","asset":78181877,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"f637845d-7f0e-416e-a2da-27a804b90a26":{"enabled":true,"tags":[],"children":[],"position":[-7.74598,38.4319,96.2053],"rotation":[0,0,14.3003],"scale":[1.07852,1.07852,-1.07852],"resource_id":"f637845d-7f0e-416e-a2da-27a804b90a26","name":"Box02","components":{"render":{"enabled":true,"type":"asset","asset":78181878,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"624e755c-e008-4e38-a4ae-e189b9e6af0e":{"enabled":true,"tags":[],"children":[],"position":[-19.7797,35.3645,160.262],"rotation":[0,0,14.3003],"scale":[-1.07852,1.07852,-1.07852],"resource_id":"624e755c-e008-4e38-a4ae-e189b9e6af0e","name":"Box03","components":{"render":{"enabled":true,"type":"asset","asset":78181879,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"8fd046ca-9bf2-4996-a426-d5f6f336a65b":{"enabled":true,"tags":[],"children":[],"position":[8.67342,31.0299,-2.24907],"rotation":[90,0,0],"scale":[1.07852,1.07852,1.07852],"resource_id":"8fd046ca-9bf2-4996-a426-d5f6f336a65b","name":"Box04","components":{"render":{"enabled":true,"type":"asset","asset":78181880,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"235f5a54-087f-4b74-bcb8-e92fb0454a6f":{"enabled":true,"tags":[],"children":[],"position":[8.67342,31.0299,64.5707],"rotation":[90,0,0],"scale":[1.07852,1.07852,1.07852],"resource_id":"235f5a54-087f-4b74-bcb8-e92fb0454a6f","name":"Box05","components":{"render":{"enabled":true,"type":"asset","asset":78181881,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"92d77773-aa8e-4faa-a639-619c285b76f1":{"enabled":true,"tags":[],"children":[],"position":[8.67342,31.0299,131.359],"rotation":[90,0,0],"scale":[1.07852,1.07852,1.07852],"resource_id":"92d77773-aa8e-4faa-a639-619c285b76f1","name":"Box06","components":{"render":{"enabled":true,"type":"asset","asset":78181882,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"0e2a3a2c-7ef9-48a5-94f8-425b169eb692":{"enabled":true,"tags":[],"children":[],"position":[-0.578045,3.58283,-15.3967],"rotation":[90,0,0],"scale":[1,1,1],"resource_id":"0e2a3a2c-7ef9-48a5-94f8-425b169eb692","name":"Box07","components":{"render":{"enabled":true,"type":"asset","asset":78181883,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"9ea5ecb4-e90e-41e7-8464-9700435c402b":{"enabled":true,"tags":[],"children":[],"position":[129.593,0,84.7355],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"9ea5ecb4-e90e-41e7-8464-9700435c402b","name":"Plane01","components":{"render":{"enabled":true,"type":"asset","asset":78181884,"materialAssets":[78181754],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"7a7196e1-59de-4cee-831f-db20924f5a99":{"enabled":true,"tags":[],"children":[],"position":[385.604,0,-284.937],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"7a7196e1-59de-4cee-831f-db20924f5a99","name":"C-Ext01","components":{"render":{"enabled":true,"type":"asset","asset":78181885,"materialAssets":[78181756],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"03051ef6-4f3a-438e-9160-a8aea926e2d0":{"enabled":true,"tags":[],"children":[],"position":[-0.0364215,-0.117522,-46.2227],"rotation":[0,0,0],"scale":[0.945135,0.945135,0.945135],"resource_id":"03051ef6-4f3a-438e-9160-a8aea926e2d0","name":"Box08","components":{"render":{"enabled":true,"type":"asset","asset":78181887,"materialAssets":[78181753],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"3ce4c2c1-7a99-4730-a57c-346004bc1485":{"enabled":true,"tags":[],"children":[],"position":[-12.6914,51.191,-45.6799],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"3ce4c2c1-7a99-4730-a57c-346004bc1485","name":"Sphere01","components":{"render":{"enabled":true,"type":"asset","asset":78181886,"materialAssets":[78181761],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"90839ae3-cc29-477f-a88e-53fb57152250":{"enabled":true,"tags":[],"children":[],"position":[-12.745,67.1823,-45.5833],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"90839ae3-cc29-477f-a88e-53fb57152250","name":"Cylinder01","components":{"render":{"enabled":true,"type":"asset","asset":78181888,"materialAssets":[78181760],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"04a75aae-eb81-4d94-8678-29e91bc7ff75":{"enabled":true,"tags":[],"children":[],"position":[-12.6219,79.6286,-45.6129],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"04a75aae-eb81-4d94-8678-29e91bc7ff75","name":"Sphere02","components":{"render":{"enabled":true,"type":"asset","asset":78181889,"materialAssets":[78181757],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"26ac5c6d-406a-4e21-b3ce-6e451befe8e9":{"enabled":true,"tags":[],"children":[],"position":[-12.5626,77.3243,-55.9246],"rotation":[90,-90,0],"scale":[1,1,1],"resource_id":"26ac5c6d-406a-4e21-b3ce-6e451befe8e9","name":"Line01","components":{"render":{"enabled":true,"type":"asset","asset":78181890,"materialAssets":[78181759],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"0ca19a72-2469-4446-b3d5-d341756117d3":{"enabled":true,"tags":[],"children":[],"position":[22.6662,0,-33.2917],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"0ca19a72-2469-4446-b3d5-d341756117d3","name":"Box09","components":{"render":{"enabled":true,"type":"asset","asset":78181891,"materialAssets":[78181758],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"afce77e7-aca3-481a-b7ad-35126ffafcde":{"enabled":true,"tags":[],"children":[],"position":[22.6133,0,-38.6055],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"afce77e7-aca3-481a-b7ad-35126ffafcde","name":"Box10","components":{"render":{"enabled":true,"type":"asset","asset":78181892,"materialAssets":[78181758],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"1dbd7266-a1ce-4993-a0c0-14bc38ef3479":{"enabled":true,"tags":[],"children":[],"position":[21.9913,0,-42.9339],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"1dbd7266-a1ce-4993-a0c0-14bc38ef3479","name":"Box11","components":{"render":{"enabled":true,"type":"asset","asset":78181893,"materialAssets":[78181758],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"d5b5339a-94b6-4efa-822b-9c5c7997f1e1":{"enabled":true,"tags":[],"children":[],"position":[21.3003,0,-45.9494],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"d5b5339a-94b6-4efa-822b-9c5c7997f1e1","name":"Box12","components":{"render":{"enabled":true,"type":"asset","asset":78181894,"materialAssets":[78181758],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"232324a7-b6aa-4551-a098-bc9ea317773c":{"enabled":true,"tags":[],"children":[],"position":[20.5984,0,-49.921],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"232324a7-b6aa-4551-a098-bc9ea317773c","name":"Box13","components":{"render":{"enabled":true,"type":"asset","asset":78181895,"materialAssets":[78181758],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"1346743e-6c0f-4290-9590-f6e6b64494a1":{"enabled":true,"tags":[],"children":[],"position":[-12.5328,80.4621,-45.5371],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"1346743e-6c0f-4290-9590-f6e6b64494a1","name":"Omni01","components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":1.17,"castShadows":false,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":8,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"8a26cc25-f015-4fc5-8cfc-d2366cd0ec11":{"enabled":true,"tags":[],"children":[],"position":[127.84,180.989,-13.2821],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"8a26cc25-f015-4fc5-8cfc-d2366cd0ec11","name":"Omni02","components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":0.269,"castShadows":false,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":8,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"8f969715-c24b-40d4-a640-80340cc8ddaf":{"enabled":true,"tags":[],"children":[],"position":[151.448,178.646,280.302],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"8f969715-c24b-40d4-a640-80340cc8ddaf","name":"Omni03","components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":0.2214,"castShadows":false,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":8,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"71743733-1689-447d-b55b-ef36a1f9832f":{"enabled":true,"tags":[],"children":[],"position":[151.448,304.742,75.99],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"71743733-1689-447d-b55b-ef36a1f9832f","name":"Omni04","components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":0.2214,"castShadows":false,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":8,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"}}},"type":"template","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78181896"},"78379717":{"tags":[],"name":"ammo.js","revision":1,"preload":false,"meta":null,"data":{"order":100,"scripts":{},"loadingType":0},"type":"script","file":{"filename":"ammo.js","size":1895438,"hash":"34480c72ed787337db20c105cb9ba69d","url":"files/assets/78379717/1/ammo.js"},"region":"eu-west-1","i18n":{},"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","immutable_backup":"0ff0f9dc-f3c3-46e0-be11-42b897c70cde","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78379717"},"78379718":{"tags":[],"name":"ammo.wasm.js","revision":1,"preload":false,"meta":null,"data":{"order":100,"scripts":{},"loadingType":0},"type":"script","file":{"filename":"ammo.wasm.js","size":391789,"hash":"6b7ab3989e4f9f17c86e44380f9181c6","url":"files/assets/78379718/1/ammo.wasm.js"},"region":"eu-west-1","i18n":{},"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","immutable_backup":"92f1f196-1475-43fb-99fb-a41e0037a862","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78379718"},"78379719":{"tags":[],"name":"ammo.wasm.wasm","revision":1,"preload":false,"meta":null,"data":{"moduleName":"Ammo","glueScriptId":78379718,"fallbackScriptId":78379717,"loadingType":0},"type":"wasm","file":{"filename":"ammo.wasm.wasm","size":659433,"hash":"a6819ea71a53e67f1dfe3e42957c2971","url":"files/assets/78379719/1/ammo.wasm.wasm"},"region":"eu-west-1","i18n":{},"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","immutable_backup":"945f70cd-330b-490b-9579-f478f1763e7e","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78379719"},"78382718":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"picker_raycast.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"pickerRaycast":{"attributesOrder":[],"attributes":{}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":7221,"hash":"88b3c04e2c42f73de8df5dbc8373e721","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"30c045f3-71a6-4380-b3df-c4d688419deb","same_as_backup":0,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78382718"},"78401677":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"doorman.mtl","revision":1,"preload":true,"exclude":false,"meta":null,"data":null,"type":"binary","file":{"filename":"doorman.mtl","size":930,"hash":"db9bed74e8bdc6681a6ab846c919aada","url":"files/assets/78401677/1/doorman.mtl"},"region":"eu-west-1","i18n":{},"immutable_backup":"2dcc7ca7-aff1-41b0-847d-78cfca884300","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78401677"},"78401691":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"t_eye_d.jpeg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":256,"height":256,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"t_eye_d.jpeg","hash":"fef226427dfd003d8f8b462219f1df8e","size":10713,"variants":{},"url":"files/assets/78401691/1/t_eye_d.jpeg"},"region":"eu-west-1","i18n":{},"immutable_backup":"c8660319-154d-4019-930b-427862948cc7","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78401691"},"78401692":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"t_doorMan_teeth_d.jpeg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":256,"height":256,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"t_doorMan_teeth_d.jpeg","hash":"32521ea35225763f7f528eb8e7b4393e","size":16505,"variants":{},"url":"files/assets/78401692/1/t_doorMan_teeth_d.jpeg"},"region":"eu-west-1","i18n":{},"immutable_backup":"f7dbe0fd-0aed-4bef-bd94-1aad0fc300d8","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78401692"},"78401693":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"t_doorMan_teeth_n.jpeg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":true,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":256,"height":256,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"t_doorMan_teeth_n.jpeg","hash":"d75247a48a056745a100fc522344f5b0","size":22879,"variants":{},"url":"files/assets/78401693/1/t_doorMan_teeth_n.jpeg"},"region":"eu-west-1","i18n":{},"immutable_backup":"af0745ef-bfd2-41bb-81f7-87c74c81f07a","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78401693"},"78401695":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"t_eye_n.png","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":true,"normals":true,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"png","type":"Bilevel","width":256,"height":256,"alpha":true,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"t_eye_n.png","hash":"18e0ed32b974fc7e20d98149d20e7589","size":35989,"variants":{},"url":"files/assets/78401695/1/t_eye_n.png"},"region":"eu-west-1","i18n":{},"immutable_backup":"797bfc00-99dc-42db-ba65-712c4193aa75","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78401695"},"78401697":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"rdmobj00Mat","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":0},"data":{"shader":"blinn","ambient":[0.2,0.2,0.2],"diffuse":[0.8,0.8,0.8],"specular":[0.2,0.2,0.2],"shininess":39.2903,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":78401692,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78401697"},"78401698":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"rdmobj01Mat","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":1},"data":{"shader":"blinn","ambient":[0.2,0.2,0.2],"diffuse":[0.8,0.8,0.8],"specular":[0.2,0.2,0.2],"shininess":39.2903,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":78401691,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78401698"},"78401699":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"rdmobj03Mat","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":3},"data":{"shader":"blinn","ambient":[0.2,0.2,0.2],"diffuse":[0.8,0.8,0.8],"specular":[0.2,0.2,0.2],"shininess":39.2903,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":78402284,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":78402285,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":78402286,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78401699"},"78401700":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"rdmobj02Mat","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":2},"data":{"shader":"blinn","ambient":[0.2,0.2,0.2],"diffuse":[0.8,0.8,0.8],"specular":[0.2,0.2,0.2],"shininess":39.2903,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":78402284,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":78402286,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78401700"},"78401701":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"doorman.glb","revision":1,"preload":true,"region":"eu-west-1","meta":null,"data":{},"type":"container","file":{"hash":"20572c505d27cbde1e4c76f0b853421f","size":306708,"filename":"doorman.glb","url":"files/assets/78401701/1/doorman.glb"},"i18n":{},"immutable_backup":"16399660-c5cc-4c78-bcfc-912f396ba609","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78401701"},"78401702":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"rdmobj00","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":2190,"triangles":730,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78401701,"renderIndex":0},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78401702"},"78401703":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"rdmobj01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":338,"triangles":624,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78401701,"renderIndex":1},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78401703"},"78401704":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"rdmobj03","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":3310,"triangles":5289,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78401701,"renderIndex":3},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78401704"},"78401705":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"rdmobj02","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1795,"triangles":3140,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78401701,"renderIndex":2},"type":"render","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78401705"},"78401706":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"doorman","revision":1,"preload":true,"region":"eu-west-1","meta":{"containerAsset":78401701},"data":{"entities":{"2cfeea72-a4bb-4a0e-8dad-abd92cc83dad":{"enabled":true,"tags":[],"children":["9ccb87a7-6e1d-4ae0-9c96-b3b5d27c22f2"],"position":[0,0,0],"rotation":[0,0,0],"scale":[0.12734020167208698,0.12734020167208698,0.12734020167208698],"resource_id":"2cfeea72-a4bb-4a0e-8dad-abd92cc83dad","name":"RootNode","components":{"collision":{"enabled":true,"type":"box","halfExtents":[0.458,1.106,0.319],"radius":0.5,"axis":1,"height":2,"asset":null,"renderAsset":null}},"parent":null},"9ccb87a7-6e1d-4ae0-9c96-b3b5d27c22f2":{"enabled":true,"tags":[],"children":["a662f523-2a86-4f77-9951-1053085f7717","fbf7970b-0b02-48c8-9fbb-6fbb5d4f3485","cafbe398-372c-44b5-a905-6a9ca90c105c","6147aeb5-2849-4302-80b1-7120263a14de"],"position":[0,-9.158829431059022,0.000002486358653186471],"rotation":[-180,0,-180],"scale":[2.997398613039719,2.997398613039719,2.997398613039719],"resource_id":"9ccb87a7-6e1d-4ae0-9c96-b3b5d27c22f2","name":"doorman_root","components":{"script":{"enabled":true,"order":["mouse","touch"],"scripts":{"mouse":{"enabled":true,"attributes":{"Selected":0,"redMaterial":null,"greenMaterial":null,"blueMaterial":null}},"touch":{"enabled":true,"attributes":{"Selected":0}}}}},"parent":"2cfeea72-a4bb-4a0e-8dad-abd92cc83dad"},"a662f523-2a86-4f77-9951-1053085f7717":{"enabled":true,"tags":[],"children":[],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"a662f523-2a86-4f77-9951-1053085f7717","name":"rdmobj00","components":{"render":{"enabled":true,"type":"asset","asset":78401702,"materialAssets":[78401697],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"9ccb87a7-6e1d-4ae0-9c96-b3b5d27c22f2"},"fbf7970b-0b02-48c8-9fbb-6fbb5d4f3485":{"enabled":true,"tags":[],"children":[],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"fbf7970b-0b02-48c8-9fbb-6fbb5d4f3485","name":"rdmobj01","components":{"render":{"enabled":true,"type":"asset","asset":78401703,"materialAssets":[78401698],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"9ccb87a7-6e1d-4ae0-9c96-b3b5d27c22f2"},"cafbe398-372c-44b5-a905-6a9ca90c105c":{"enabled":true,"tags":[],"children":[],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"cafbe398-372c-44b5-a905-6a9ca90c105c","name":"rdmobj02","components":{"render":{"enabled":true,"type":"asset","asset":78401705,"materialAssets":[78401700],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"9ccb87a7-6e1d-4ae0-9c96-b3b5d27c22f2"},"6147aeb5-2849-4302-80b1-7120263a14de":{"enabled":true,"tags":[],"children":[],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"6147aeb5-2849-4302-80b1-7120263a14de","name":"rdmobj03","components":{"render":{"enabled":true,"type":"asset","asset":78401704,"materialAssets":[78401699],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"9ccb87a7-6e1d-4ae0-9c96-b3b5d27c22f2"}}},"type":"template","file":null,"i18n":{},"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78401706"},"78402284":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"t_doorMan_d.jpeg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":1024,"height":1024,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"t_doorMan_d.jpeg","hash":"c098404fd23169b3f6dfe0e20bec277f","size":170279,"variants":{},"url":"files/assets/78402284/1/t_doorMan_d.jpeg"},"region":"eu-west-1","i18n":{},"immutable_backup":"f4d4139b-1258-4016-b255-06b035819135","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78402284"},"78402285":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"t_doorMan_s.jpeg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":1024,"height":1024,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"t_doorMan_s.jpeg","hash":"560ee2f398d81b75b4ba419cce710cb9","size":122293,"variants":{},"url":"files/assets/78402285/1/t_doorMan_s.jpeg"},"region":"eu-west-1","i18n":{},"immutable_backup":"15c98bcc-4411-4004-ae75-c1faa6ad291e","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78402285"},"78402286":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"t_doorMan_n.jpeg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":true,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":1024,"height":1024,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"t_doorMan_n.jpeg","hash":"803af87756a209776154326664e5dbc9","size":237433,"variants":{},"url":"files/assets/78402286/1/t_doorMan_n.jpeg"},"region":"eu-west-1","i18n":{},"immutable_backup":"82735f59-b4e3-4199-8460-c70ab4206e2c","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78402286"},"78406226":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"archive-roundface-script_bigfontsite.com.ttf","revision":1,"preload":true,"exclude":false,"meta":{"chars":" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"},"data":{"version":2,"intensity":0,"info":{"face":"archive-roundface-script_bigfontsite.com","maps":[{"width":1024,"height":512}]},"chars":{"32":{"id":32,"letter":" ","x":1,"y":1,"width":64,"height":64,"map":0,"xadvance":4.992,"xoffset":31.5,"yoffset":31.5,"scale":1,"range":8},"33":{"id":33,"letter":"!","x":67,"y":1,"width":64,"height":64,"map":0,"xadvance":7.776,"xoffset":26.288,"yoffset":23.152,"scale":1,"range":8,"bounds":[0.128,-0.48,11.296,18.176]},"34":{"id":34,"letter":"\"","x":133,"y":1,"width":64,"height":64,"map":0,"xadvance":8.352,"xoffset":27.632,"yoffset":22.816,"scale":1,"range":8,"bounds":[1.12,5.888,7.616,12.48]},"36":{"id":36,"letter":"$","x":199,"y":1,"width":64,"height":64,"map":0,"xadvance":21.024,"xoffset":20.96,"yoffset":24.704,"scale":1,"range":8,"bounds":[1.024,-5.952,21.056,20.544]},"38":{"id":38,"letter":"&","x":265,"y":1,"width":64,"height":64,"map":0,"xadvance":20.832,"xoffset":20.464,"yoffset":22.56,"scale":1,"range":8,"bounds":[1.632,-0.096,21.44,18.976]},"39":{"id":39,"letter":"'","x":331,"y":1,"width":64,"height":64,"map":0,"xadvance":4.896,"xoffset":29.392,"yoffset":23.088,"scale":1,"range":8,"bounds":[1.12,5.792,4.096,12.032]},"44":{"id":44,"letter":",","x":397,"y":1,"width":64,"height":64,"map":0,"xadvance":5.888,"xoffset":28.672,"yoffset":32.88,"scale":1,"range":8,"bounds":[1.152,-5.024,5.504,3.264]},"45":{"id":45,"letter":"-","x":463,"y":1,"width":64,"height":64,"map":0,"xadvance":9.76,"xoffset":27.408,"yoffset":26.688,"scale":1,"range":8,"bounds":[0.544,3.904,8.64,6.72]},"46":{"id":46,"letter":".","x":529,"y":1,"width":64,"height":64,"map":0,"xadvance":5.44,"xoffset":29.168,"yoffset":30.528,"scale":1,"range":8,"bounds":[1.12,-0.32,4.544,3.264]},"48":{"id":48,"letter":"0","x":595,"y":1,"width":64,"height":64,"map":0,"xadvance":15.52,"xoffset":23.472,"yoffset":22.736,"scale":1,"range":8,"bounds":[1.376,-0.416,15.68,18.944]},"49":{"id":49,"letter":"1","x":661,"y":1,"width":64,"height":64,"map":0,"xadvance":10.208,"xoffset":25.2,"yoffset":22.704,"scale":1,"range":8,"bounds":[0.544,-0.224,13.056,18.816]},"50":{"id":50,"letter":"2","x":727,"y":1,"width":64,"height":64,"map":0,"xadvance":15.552,"xoffset":24.192,"yoffset":22.7330909091,"scale":1,"range":8,"bounds":[-0.448,-0.346181818182,16.064,18.88]},"51":{"id":51,"letter":"3","x":793,"y":1,"width":64,"height":64,"map":0,"xadvance":15.68,"xoffset":23.344,"yoffset":22.656,"scale":1,"range":8,"bounds":[0.768,-0.256,16.544,18.944]},"52":{"id":52,"letter":"4","x":859,"y":1,"width":64,"height":64,"map":0,"xadvance":14.944,"xoffset":23.744,"yoffset":22.576,"scale":1,"range":8,"bounds":[0.736,-0.128,15.776,18.976]},"53":{"id":53,"letter":"5","x":925,"y":1,"width":64,"height":64,"map":0,"xadvance":16.672,"xoffset":22.464,"yoffset":22.704,"scale":1,"range":8,"bounds":[0.96,-0.224,18.112,18.816]},"54":{"id":54,"letter":"6","x":1,"y":67,"width":64,"height":64,"map":0,"xadvance":14.72,"xoffset":24,"yoffset":22,"scale":1,"range":8,"bounds":[0.96,-0.352,15.04,20.352]},"55":{"id":55,"letter":"7","x":67,"y":67,"width":64,"height":64,"map":0,"xadvance":11.2,"xoffset":24.016,"yoffset":22.656,"scale":1,"range":8,"bounds":[1.216,-0.128,14.752,18.816]},"56":{"id":56,"letter":"8","x":133,"y":67,"width":64,"height":64,"map":0,"xadvance":15.104,"xoffset":23.232,"yoffset":22.496,"scale":1,"range":8,"bounds":[0.96,-0.256,16.576,19.264]},"57":{"id":57,"letter":"9","x":199,"y":67,"width":64,"height":64,"map":0,"xadvance":16.672,"xoffset":23.664,"yoffset":24.208,"scale":1,"range":8,"bounds":[1.12,-3.296,15.552,18.88]},"58":{"id":58,"letter":":","x":265,"y":67,"width":64,"height":64,"map":0,"xadvance":7.488,"xoffset":28.16,"yoffset":27.36,"scale":1,"range":8,"bounds":[1.12,-0.32,6.56,9.6]},"59":{"id":59,"letter":";","x":331,"y":67,"width":64,"height":64,"map":0,"xadvance":7.168,"xoffset":28.032,"yoffset":29.792,"scale":1,"range":8,"bounds":[1.152,-5.024,6.784,9.44]},"63":{"id":63,"letter":"?","x":397,"y":67,"width":64,"height":64,"map":0,"xadvance":8.736,"xoffset":25.552,"yoffset":23.088,"scale":1,"range":8,"bounds":[0.384,-0.32,12.512,18.144]},"65":{"id":65,"letter":"A","x":463,"y":67,"width":64,"height":64,"map":0,"xadvance":29.248,"xoffset":13.184,"yoffset":20.496,"scale":1,"range":8,"bounds":[0.576,-0.32,37.056,23.328]},"66":{"id":66,"letter":"B","x":529,"y":67,"width":64,"height":64,"map":0,"xadvance":27.744,"xoffset":16.16,"yoffset":20.704,"scale":1,"range":8,"bounds":[1.024,-0.384,30.656,22.976]},"67":{"id":67,"letter":"C","x":595,"y":67,"width":64,"height":64,"map":0,"xadvance":18.368,"xoffset":20.608,"yoffset":20.688,"scale":1,"range":8,"bounds":[1.344,-0.256,21.44,22.88]},"68":{"id":68,"letter":"D","x":661,"y":67,"width":64,"height":64,"map":0,"xadvance":29.248,"xoffset":16.192,"yoffset":20.752,"scale":1,"range":8,"bounds":[1.216,-0.512,30.4,23.008]},"69":{"id":69,"letter":"E","x":727,"y":67,"width":64,"height":64,"map":0,"xadvance":18.496,"xoffset":20.832,"yoffset":20.624,"scale":1,"range":8,"bounds":[1.12,-0.448,21.216,23.2]},"70":{"id":70,"letter":"F","x":793,"y":67,"width":64,"height":64,"map":0,"xadvance":19.008,"xoffset":17.408,"yoffset":20.688,"scale":1,"range":8,"bounds":[1.12,-0.512,28.064,23.136]},"71":{"id":71,"letter":"G","x":859,"y":67,"width":64,"height":64,"map":0,"xadvance":20,"xoffset":18.592,"yoffset":20.816,"scale":1,"range":8,"bounds":[1.056,-0.64,25.76,23.008]},"72":{"id":72,"letter":"H","x":925,"y":67,"width":64,"height":64,"map":0,"xadvance":27.904,"xoffset":13.76,"yoffset":20.64,"scale":1,"range":8,"bounds":[1.216,-0.256,35.264,22.976]},"73":{"id":73,"letter":"I","x":1,"y":133,"width":64,"height":64,"map":0,"xadvance":20,"xoffset":17.856,"yoffset":20.816,"scale":1,"range":8,"bounds":[0.96,-0.576,27.328,22.944]},"74":{"id":74,"letter":"J","x":67,"y":133,"width":64,"height":64,"map":0,"xadvance":14.24,"xoffset":25.296,"yoffset":24.784,"scale":1,"range":8,"bounds":[-7.52,-8.448,20.928,22.88]},"75":{"id":75,"letter":"K","x":133,"y":133,"width":64,"height":64,"map":0,"xadvance":32.128,"xoffset":14.368,"yoffset":20.544,"scale":1,"range":8,"bounds":[1.344,-0.32,33.92,23.232]},"76":{"id":76,"letter":"L","x":199,"y":133,"width":64,"height":64,"map":0,"xadvance":18.08,"xoffset":20.16,"yoffset":20.592,"scale":1,"range":8,"bounds":[0.832,-0.192,22.848,23.008]},"77":{"id":77,"letter":"M","x":265,"y":133,"width":64,"height":64,"map":0,"xadvance":36.512,"xoffset":11.76,"yoffset":20.72,"scale":1,"range":8,"bounds":[0.736,-0.256,39.744,22.816]},"78":{"id":78,"letter":"N","x":331,"y":133,"width":64,"height":64,"map":0,"xadvance":27.04,"xoffset":13.984,"yoffset":20.56,"scale":1,"range":8,"bounds":[0.832,-0.256,35.2,23.136]},"79":{"id":79,"letter":"O","x":397,"y":133,"width":64,"height":64,"map":0,"xadvance":17.024,"xoffset":21.184,"yoffset":20.56,"scale":1,"range":8,"bounds":[1.216,-0.16,20.416,23.04]},"80":{"id":80,"letter":"P","x":463,"y":133,"width":64,"height":64,"map":0,"xadvance":20.256,"xoffset":18.672,"yoffset":20.832,"scale":1,"range":8,"bounds":[1.344,-0.512,25.312,22.848]},"81":{"id":81,"letter":"Q","x":529,"y":133,"width":64,"height":64,"map":0,"xadvance":21.12,"xoffset":21.6,"yoffset":23.984,"scale":1,"range":8,"bounds":[-1.216,-6.752,22.016,22.784]},"82":{"id":82,"letter":"R","x":595,"y":133,"width":64,"height":64,"map":0,"xadvance":28.928,"xoffset":16.064,"yoffset":20.912,"scale":1,"range":8,"bounds":[1.056,-0.768,30.816,22.944]},"83":{"id":83,"letter":"S","x":661,"y":133,"width":64,"height":64,"map":0,"xadvance":19.104,"xoffset":21.28,"yoffset":20.544,"scale":1,"range":8,"bounds":[0.896,-0.096,20.544,23.008]},"84":{"id":84,"letter":"T","x":727,"y":133,"width":64,"height":64,"map":0,"xadvance":18.784,"xoffset":17.712,"yoffset":20.6228571429,"scale":1,"range":8,"bounds":[1.12,-0.32,27.456,23.0742857143]},"85":{"id":85,"letter":"U","x":793,"y":133,"width":64,"height":64,"map":0,"xadvance":23.744,"xoffset":16.896,"yoffset":20.608,"scale":1,"range":8,"bounds":[1.408,-0.32,28.8,23.104]},"86":{"id":86,"letter":"V","x":859,"y":133,"width":64,"height":64,"map":0,"xadvance":11.008,"xoffset":20.944,"yoffset":20.848,"scale":1,"range":8,"bounds":[1.12,-0.608,20.992,22.912]},"87":{"id":87,"letter":"W","x":925,"y":133,"width":64,"height":64,"map":0,"xadvance":17.76,"xoffset":16.896,"yoffset":20.976,"scale":1,"range":8,"bounds":[1.568,-0.8,28.64,22.848]},"88":{"id":88,"letter":"X","x":1,"y":199,"width":64,"height":64,"map":0,"xadvance":25.888,"xoffset":15.856,"yoffset":20.656,"scale":1,"range":8,"bounds":[1.248,-0.448,31.04,23.136]},"89":{"id":89,"letter":"Y","x":67,"y":199,"width":64,"height":64,"map":0,"xadvance":11.52,"xoffset":23.632,"yoffset":24.48,"scale":1,"range":8,"bounds":[-5.024,-8.192,21.76,23.232]},"90":{"id":90,"letter":"Z","x":133,"y":199,"width":64,"height":64,"map":0,"xadvance":20.96,"xoffset":17.328,"yoffset":20.544,"scale":1,"range":8,"bounds":[1.056,-0.16,28.288,23.072]},"97":{"id":97,"letter":"a","x":199,"y":199,"width":64,"height":64,"map":0,"xadvance":12.48,"xoffset":25.44,"yoffset":27.504,"scale":1,"range":8,"bounds":[0.32,-0.352,12.8,9.344]},"98":{"id":98,"letter":"b","x":265,"y":199,"width":64,"height":64,"map":0,"xadvance":12,"xoffset":25.712,"yoffset":22.656,"scale":1,"range":8,"bounds":[0.576,-0.416,12,19.104]},"99":{"id":99,"letter":"c","x":331,"y":199,"width":64,"height":64,"map":0,"xadvance":8.992,"xoffset":27.376,"yoffset":27.488,"scale":1,"range":8,"bounds":[0.32,-0.32,8.928,9.344]},"100":{"id":100,"letter":"d","x":397,"y":199,"width":64,"height":64,"map":0,"xadvance":12.768,"xoffset":23.056,"yoffset":22.8,"scale":1,"range":8,"bounds":[0.32,-0.384,17.568,18.784]},"101":{"id":101,"letter":"e","x":463,"y":199,"width":64,"height":64,"map":0,"xadvance":8.992,"xoffset":27.232,"yoffset":27.424,"scale":1,"range":8,"bounds":[0.32,-0.192,9.216,9.344]},"102":{"id":102,"letter":"f","x":529,"y":199,"width":64,"height":64,"map":0,"xadvance":6.752,"xoffset":24.72,"yoffset":22.72,"scale":1,"range":8,"bounds":[0.128,-0.096,14.432,18.656]},"103":{"id":103,"letter":"g","x":595,"y":199,"width":64,"height":64,"map":0,"xadvance":11.488,"xoffset":26.784,"yoffset":31.52,"scale":1,"range":8,"bounds":[-2.432,-8.448,12.864,9.408]},"104":{"id":104,"letter":"h","x":661,"y":199,"width":64,"height":64,"map":0,"xadvance":12.864,"xoffset":25.568,"yoffset":22.624,"scale":1,"range":8,"bounds":[0.032,-0.16,12.832,18.912]},"105":{"id":105,"letter":"i","x":727,"y":199,"width":64,"height":64,"map":0,"xadvance":6.56,"xoffset":27.584,"yoffset":25.12,"scale":1,"range":8,"bounds":[0.48,-0.032,8.352,13.792]},"106":{"id":106,"letter":"j","x":793,"y":199,"width":64,"height":64,"map":0,"xadvance":5.984,"xoffset":29.568,"yoffset":29.184,"scale":1,"range":8,"bounds":[-4.256,-8.128,9.12,13.76]},"107":{"id":107,"letter":"k","x":859,"y":199,"width":64,"height":64,"map":0,"xadvance":12.288,"xoffset":25.056,"yoffset":22.736,"scale":1,"range":8,"bounds":[0.032,-0.416,13.856,18.944]},"108":{"id":108,"letter":"l","x":925,"y":199,"width":64,"height":64,"map":0,"xadvance":6.304,"xoffset":25.824,"yoffset":22.72,"scale":1,"range":8,"bounds":[0.576,-0.32,11.776,18.88]},"109":{"id":109,"letter":"m","x":1,"y":265,"width":64,"height":64,"map":0,"xadvance":17.888,"xoffset":22.656,"yoffset":27.344,"scale":1,"range":8,"bounds":[0.192,-0.224,18.496,9.536]},"110":{"id":110,"letter":"n","x":67,"y":265,"width":64,"height":64,"map":0,"xadvance":12.48,"xoffset":25.728,"yoffset":27.408,"scale":1,"range":8,"bounds":[0.16,-0.256,12.384,9.44]},"111":{"id":111,"letter":"o","x":133,"y":265,"width":64,"height":64,"map":0,"xadvance":11.04,"xoffset":26.32,"yoffset":27.392,"scale":1,"range":8,"bounds":[0.32,-0.16,11.04,9.376]},"112":{"id":112,"letter":"p","x":199,"y":265,"width":64,"height":64,"map":0,"xadvance":11.968,"xoffset":28.64,"yoffset":31.648,"scale":1,"range":8,"bounds":[-5.216,-8.576,11.936,9.28]},"113":{"id":113,"letter":"q","x":265,"y":265,"width":64,"height":64,"map":0,"xadvance":11.968,"xoffset":25.296,"yoffset":31.552,"scale":1,"range":8,"bounds":[0.192,-8.544,13.216,9.44]},"114":{"id":114,"letter":"r","x":331,"y":265,"width":64,"height":64,"map":0,"xadvance":10.208,"xoffset":26.336,"yoffset":27.344,"scale":1,"range":8,"bounds":[0.16,-0.032,11.168,9.344]},"115":{"id":115,"letter":"s","x":397,"y":265,"width":64,"height":64,"map":0,"xadvance":9.216,"xoffset":27.216,"yoffset":27.424,"scale":1,"range":8,"bounds":[0.032,-0.192,9.536,9.344]},"116":{"id":116,"letter":"t","x":463,"y":265,"width":64,"height":64,"map":0,"xadvance":7.648,"xoffset":26.368,"yoffset":24.352,"scale":1,"range":8,"bounds":[0.864,-0.32,10.4,15.616]},"117":{"id":117,"letter":"u","x":529,"y":265,"width":64,"height":64,"map":0,"xadvance":11.712,"xoffset":25.824,"yoffset":27.536,"scale":1,"range":8,"bounds":[0.224,-0.224,12.128,9.152]},"118":{"id":118,"letter":"v","x":595,"y":265,"width":64,"height":64,"map":0,"xadvance":10.496,"xoffset":26.384,"yoffset":27.472,"scale":1,"range":8,"bounds":[0.192,-0.224,11.04,9.28]},"119":{"id":119,"letter":"w","x":661,"y":265,"width":64,"height":64,"map":0,"xadvance":16.608,"xoffset":23.152,"yoffset":27.392,"scale":1,"range":8,"bounds":[0.224,-0.224,17.472,9.44]},"120":{"id":120,"letter":"x","x":727,"y":265,"width":64,"height":64,"map":0,"xadvance":11.68,"xoffset":25.536,"yoffset":27.504,"scale":1,"range":8,"bounds":[0.192,-0.192,12.736,9.184]},"121":{"id":121,"letter":"y","x":793,"y":265,"width":64,"height":64,"map":0,"xadvance":11.776,"xoffset":26.336,"yoffset":31.568,"scale":1,"range":8,"bounds":[-0.96,-8.352,12.288,9.216]},"122":{"id":122,"letter":"z","x":859,"y":265,"width":64,"height":64,"map":0,"xadvance":11.744,"xoffset":25.6,"yoffset":27.536,"scale":1,"range":8,"bounds":[0.16,-0.32,12.64,9.248]}},"kerning":{}},"type":"font","file":{"filename":"archive-roundface-script_bigfontsite.com.png","hash":"93d340738cc8d0c06cda084ff749b82f","size":367744,"url":"files/assets/78406226/1/archive-roundface-script_bigfontsite.com.png"},"region":"eu-west-1","i18n":{},"immutable_backup":"c7c09dc1-29d2-4d3f-b0f9-ad6aecd16eb5","same_as_backup":1,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"78406226"},"79014545":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"load_image.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"loadImage":{"attributesOrder":[],"attributes":{}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":7221,"hash":"88b3c04e2c42f73de8df5dbc8373e721","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"83b9fab9-9575-465c-afc4-b40d48842d88","same_as_backup":0,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"79014545"},"79153391":{"tags":[],"name":"switching-textures.js","revision":1,"preload":true,"meta":null,"data":{"scripts":{"switchingTextures":{"attributesOrder":["textures","url","WebTexture"],"attributes":{"textures":{"type":"asset","assetType":"texture","array":true,"title":"Textures"},"url":{"type":"string"},"WebTexture":{"type":"asset","assetType":"texture","array":false,"title":"WebTexture"}}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":7221,"hash":"88b3c04e2c42f73de8df5dbc8373e721","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","immutable_backup":"eb68abc7-6d15-4324-a60a-162dc50382f2","same_as_backup":0,"checkpoint_id":"5405def1-2a1b-4515-9ccb-51568b974b41","id":"79153391"},"79449648":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"double-sided-arrow-png-51575265495yriug9wtzm.png","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"png","type":"Bilevel","width":480,"height":480,"alpha":true,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"double-sided-arrow-png-51575265495yriug9wtzm.png","size":3179,"hash":"27ebb44979c6d0aeffa4c540526a1fee","variants":{},"url":"files/assets/79449648/1/double-sided-arrow-png-51575265495yriug9wtzm.png"},"region":"eu-west-1","i18n":{},"id":"79449648"},"79458597":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"New Material","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[1,1,1],"diffuseMap":79449648,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissive":[0,0,0],"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0.298,"alphaFade":1,"opacity":1,"opacityMap":79449648,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"id":"79458597"},"79459251":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"GetWidthFromURLParams.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"getWidthFromUrlparams":{"attributesOrder":[],"attributes":{}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":7221,"hash":"88b3c04e2c42f73de8df5dbc8373e721","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"id":"79459251"},"79465530":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"BRLNSDB.TTF","revision":1,"preload":true,"exclude":false,"meta":{"chars":" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"},"data":{"version":2,"intensity":0,"info":{"face":"BRLNSDB","maps":[{"width":1024,"height":512}]},"chars":{"32":{"id":32,"letter":" ","x":1,"y":1,"width":64,"height":64,"map":0,"xadvance":8,"xoffset":31.5,"yoffset":31.5,"scale":1,"range":8},"33":{"id":33,"letter":"!","x":67,"y":1,"width":64,"height":64,"map":0,"xadvance":8.953125,"xoffset":27.359375,"yoffset":21.234375,"scale":1,"range":8,"bounds":[1.703125,-0.390625,7.578125,21.921875]},"34":{"id":34,"letter":"\"","x":133,"y":1,"width":64,"height":64,"map":0,"xadvance":12.515625,"xoffset":25.7421875,"yoffset":13.96875,"scale":1,"range":8,"bounds":[1.0625,14.046875,11.453125,22.015625]},"35":{"id":35,"letter":"#","x":199,"y":1,"width":64,"height":64,"map":0,"xadvance":22.71875,"xoffset":20.7578125,"yoffset":21.6484375,"scale":1,"range":8,"bounds":[1.25,-1.71875,21.234375,22.421875]},"36":{"id":36,"letter":"$","x":265,"y":1,"width":64,"height":64,"map":0,"xadvance":15.546875,"xoffset":24.125,"yoffset":22.5859375,"scale":1,"range":8,"bounds":[1.125,-2.609375,14.625,21.4375]},"37":{"id":37,"letter":"%","x":331,"y":1,"width":64,"height":64,"map":0,"xadvance":25.703125,"xoffset":19.1484375,"yoffset":22.2890625,"scale":1,"range":8,"bounds":[0.484375,-0.6875,25.21875,20.109375]},"38":{"id":38,"letter":"&","x":397,"y":1,"width":64,"height":64,"map":0,"xadvance":22.34375,"xoffset":20.75,"yoffset":21.203125,"scale":1,"range":8,"bounds":[1.09375,-0.546875,21.40625,22.140625]},"39":{"id":39,"letter":"'","x":463,"y":1,"width":64,"height":64,"map":0,"xadvance":7.421875,"xoffset":28.2578125,"yoffset":14.4453125,"scale":1,"range":8,"bounds":[1.21875,13.09375,6.265625,22.015625]},"40":{"id":40,"letter":"(","x":529,"y":1,"width":64,"height":64,"map":0,"xadvance":12.734375,"xoffset":25.1015625,"yoffset":23.828125,"scale":1,"range":8,"bounds":[1.5,-6.53125,12.296875,22.875]},"41":{"id":41,"letter":")","x":595,"y":1,"width":64,"height":64,"map":0,"xadvance":12.734375,"xoffset":26.1640625,"yoffset":23.8359375,"scale":1,"range":8,"bounds":[0.4375,-6.546875,11.234375,22.875]},"42":{"id":42,"letter":"*","x":661,"y":1,"width":64,"height":64,"map":0,"xadvance":13.5625,"xoffset":25.3359375,"yoffset":16.453125,"scale":1,"range":8,"bounds":[0.515625,9.265625,12.8125,21.828125]},"43":{"id":43,"letter":"+","x":727,"y":1,"width":64,"height":64,"map":0,"xadvance":15.140625,"xoffset":24.5234375,"yoffset":22.671875,"scale":1,"range":8,"bounds":[0.515625,2.046875,14.4375,16.609375]},"44":{"id":44,"letter":",","x":793,"y":1,"width":64,"height":64,"map":0,"xadvance":8.984375,"xoffset":28.0078125,"yoffset":31.125,"scale":1,"range":8,"bounds":[-0.1875,-4.171875,8.171875,5.921875]},"45":{"id":45,"letter":"-","x":859,"y":1,"width":64,"height":64,"map":0,"xadvance":13.59375,"xoffset":25.1953125,"yoffset":22.4609375,"scale":1,"range":8,"bounds":[1.125,6.53125,12.484375,12.546875]},"46":{"id":46,"letter":".","x":925,"y":1,"width":64,"height":64,"map":0,"xadvance":8.984375,"xoffset":27.5078125,"yoffset":28.5859375,"scale":1,"range":8,"bounds":[0.828125,-0.3125,8.15625,7.140625]},"47":{"id":47,"letter":"/","x":1,"y":67,"width":64,"height":64,"map":0,"xadvance":10.59375,"xoffset":26.71875,"yoffset":21.96875,"scale":1,"range":8,"bounds":[0.53125,-2.078125,10.03125,22.140625]},"48":{"id":48,"letter":"0","x":67,"y":67,"width":64,"height":64,"map":0,"xadvance":20.15625,"xoffset":21.921875,"yoffset":22.59375,"scale":1,"range":8,"bounds":[0.765625,-0.484375,19.390625,19.296875]},"49":{"id":49,"letter":"1","x":133,"y":67,"width":64,"height":64,"map":0,"xadvance":10.296875,"xoffset":27.5859375,"yoffset":22.15625,"scale":1,"range":8,"bounds":[0.1875,-0.03125,8.640625,19.71875]},"50":{"id":50,"letter":"2","x":199,"y":67,"width":64,"height":64,"map":0,"xadvance":16.546875,"xoffset":23.6875,"yoffset":22.59375,"scale":1,"range":8,"bounds":[0.34375,-0.484375,16.28125,19.296875]},"51":{"id":51,"letter":"3","x":265,"y":67,"width":64,"height":64,"map":0,"xadvance":15.578125,"xoffset":24.234375,"yoffset":22.578125,"scale":1,"range":8,"bounds":[0.453125,-0.453125,15.078125,19.296875]},"52":{"id":52,"letter":"4","x":331,"y":67,"width":64,"height":64,"map":0,"xadvance":17.65625,"xoffset":23.1640625,"yoffset":22.21875,"scale":1,"range":8,"bounds":[0.609375,-0.1875,17.0625,19.75]},"53":{"id":53,"letter":"5","x":397,"y":67,"width":64,"height":64,"map":0,"xadvance":16.15625,"xoffset":24.015625,"yoffset":22.625,"scale":1,"range":8,"bounds":[0.546875,-0.453125,15.421875,19.203125]},"54":{"id":54,"letter":"6","x":463,"y":67,"width":64,"height":64,"map":0,"xadvance":17.765625,"xoffset":23.0390625,"yoffset":22.4375,"scale":1,"range":8,"bounds":[0.765625,-0.359375,17.15625,19.484375]},"55":{"id":55,"letter":"7","x":529,"y":67,"width":64,"height":64,"map":0,"xadvance":15.296875,"xoffset":24.5,"yoffset":22.5,"scale":1,"range":8,"bounds":[0.1875,-0.421875,14.8125,19.421875]},"56":{"id":56,"letter":"8","x":595,"y":67,"width":64,"height":64,"map":0,"xadvance":15.71875,"xoffset":24.1796875,"yoffset":22.515625,"scale":1,"range":8,"bounds":[0.3125,-0.484375,15.328125,19.453125]},"57":{"id":57,"letter":"9","x":661,"y":67,"width":64,"height":64,"map":0,"xadvance":18.078125,"xoffset":23.0078125,"yoffset":22.5625,"scale":1,"range":8,"bounds":[0.765625,-0.578125,17.21875,19.453125]},"58":{"id":58,"letter":":","x":727,"y":67,"width":64,"height":64,"map":0,"xadvance":7.96875,"xoffset":27.984375,"yoffset":25.2265625,"scale":1,"range":8,"bounds":[0.890625,-0.25,7.140625,13.796875]},"59":{"id":59,"letter":";","x":793,"y":67,"width":64,"height":64,"map":0,"xadvance":7.96875,"xoffset":28.8515625,"yoffset":27.1953125,"scale":1,"range":8,"bounds":[-0.84375,-4.1875,7.140625,13.796875]},"60":{"id":60,"letter":"<","x":859,"y":67,"width":64,"height":64,"map":0,"xadvance":12.828125,"xoffset":25.421875,"yoffset":23.0390625,"scale":1,"range":8,"bounds":[1.0625,0.96875,12.09375,16.953125]},"61":{"id":61,"letter":"=","x":925,"y":67,"width":64,"height":64,"map":0,"xadvance":15.421875,"xoffset":24.234375,"yoffset":22.375,"scale":1,"range":8,"bounds":[1.15625,4.625,14.375,14.625]},"62":{"id":62,"letter":">","x":1,"y":133,"width":64,"height":64,"map":0,"xadvance":12.828125,"xoffset":25.6875,"yoffset":22.9140625,"scale":1,"range":8,"bounds":[0.8125,1.09375,11.8125,17.078125]},"63":{"id":63,"letter":"?","x":67,"y":133,"width":64,"height":64,"map":0,"xadvance":13.5,"xoffset":25.234375,"yoffset":21.171875,"scale":1,"range":8,"bounds":[0.4375,-0.390625,13.09375,22.046875]},"64":{"id":64,"letter":"@","x":133,"y":133,"width":64,"height":64,"map":0,"xadvance":21.984375,"xoffset":21.25,"yoffset":21.0390625,"scale":1,"range":8,"bounds":[0.859375,-0.578125,20.640625,22.5]},"65":{"id":65,"letter":"A","x":199,"y":133,"width":64,"height":64,"map":0,"xadvance":22.203125,"xoffset":20.9296875,"yoffset":20.9140625,"scale":1,"range":8,"bounds":[0.09375,-0.125,22.046875,22.296875]},"66":{"id":66,"letter":"B","x":265,"y":133,"width":64,"height":64,"map":0,"xadvance":20.453125,"xoffset":21.359375,"yoffset":21.1015625,"scale":1,"range":8,"bounds":[1.375,-0.1875,19.90625,21.984375]},"67":{"id":67,"letter":"C","x":331,"y":133,"width":64,"height":64,"map":0,"xadvance":19.9375,"xoffset":21.7265625,"yoffset":21.0546875,"scale":1,"range":8,"bounds":[0.859375,-0.546875,19.6875,22.4375]},"68":{"id":68,"letter":"D","x":397,"y":133,"width":64,"height":64,"map":0,"xadvance":22.8125,"xoffset":20.3359375,"yoffset":21.0703125,"scale":1,"range":8,"bounds":[1.5,-0.09375,21.828125,21.953125]},"69":{"id":69,"letter":"E","x":463,"y":133,"width":64,"height":64,"map":0,"xadvance":18.078125,"xoffset":22.59375,"yoffset":21.15625,"scale":1,"range":8,"bounds":[1.375,-0.234375,17.4375,21.921875]},"70":{"id":70,"letter":"F","x":529,"y":133,"width":64,"height":64,"map":0,"xadvance":17.984375,"xoffset":22.5627441406,"yoffset":21.0390625,"scale":1,"range":8,"bounds":[1.29638671875,-0.21875,17.578125,22.140625]},"71":{"id":71,"letter":"G","x":595,"y":133,"width":64,"height":64,"map":0,"xadvance":22.75,"xoffset":20.5693359375,"yoffset":20.9765625,"scale":1,"range":8,"bounds":[0.859375,-0.390625,22.001953125,22.4375]},"72":{"id":72,"letter":"H","x":661,"y":133,"width":64,"height":64,"map":0,"xadvance":23.84375,"xoffset":20.078125,"yoffset":21.0859375,"scale":1,"range":8,"bounds":[1.4375,-0.09375,22.40625,21.921875]},"73":{"id":73,"letter":"I","x":727,"y":133,"width":64,"height":64,"map":0,"xadvance":9.53125,"xoffset":27.2578125,"yoffset":21.1015625,"scale":1,"range":8,"bounds":[1.34375,-0.125,8.140625,21.921875]},"74":{"id":74,"letter":"J","x":793,"y":133,"width":64,"height":64,"map":0,"xadvance":10.78125,"xoffset":27.3984375,"yoffset":22.9453125,"scale":1,"range":8,"bounds":[0.046875,-3.78125,9.15625,21.890625]},"75":{"id":75,"letter":"K","x":859,"y":133,"width":64,"height":64,"map":0,"xadvance":21.03125,"xoffset":20.9453125,"yoffset":21.1171875,"scale":1,"range":8,"bounds":[1.4375,-0.15625,20.671875,21.921875]},"76":{"id":76,"letter":"L","x":925,"y":133,"width":64,"height":64,"map":0,"xadvance":17.5,"xoffset":22.6484375,"yoffset":21.1796875,"scale":1,"range":8,"bounds":[1.546875,-0.265625,17.15625,21.90625]},"77":{"id":77,"letter":"M","x":1,"y":199,"width":64,"height":64,"map":0,"xadvance":26.203125,"xoffset":18.9140625,"yoffset":21.1171875,"scale":1,"range":8,"bounds":[1.4375,-0.3125,24.734375,22.078125]},"78":{"id":78,"letter":"N","x":67,"y":199,"width":64,"height":64,"map":0,"xadvance":23.8125,"xoffset":20.109375,"yoffset":20.9140625,"scale":1,"range":8,"bounds":[1.4375,-0.0625,22.34375,22.234375]},"79":{"id":79,"letter":"O","x":133,"y":199,"width":64,"height":64,"map":0,"xadvance":24.03125,"xoffset":20,"yoffset":21.0390625,"scale":1,"range":8,"bounds":[0.859375,-0.578125,23.140625,22.5]},"80":{"id":80,"letter":"P","x":199,"y":199,"width":64,"height":64,"map":0,"xadvance":20.859375,"xoffset":21.2587316176,"yoffset":21.09375,"scale":1,"range":8,"bounds":[1.32628676471,-0.109375,20.15625,21.921875]},"81":{"id":81,"letter":"Q","x":265,"y":199,"width":64,"height":64,"map":0,"xadvance":24.03125,"xoffset":20,"yoffset":22.703125,"scale":1,"range":8,"bounds":[0.859375,-3.90625,23.140625,22.5]},"82":{"id":82,"letter":"R","x":331,"y":199,"width":64,"height":64,"map":0,"xadvance":20.390625,"xoffset":21.25,"yoffset":21.0390625,"scale":1,"range":8,"bounds":[1.4375,-0.09375,20.0625,22.015625]},"83":{"id":83,"letter":"S","x":397,"y":199,"width":64,"height":64,"map":0,"xadvance":13.25,"xoffset":25.609375,"yoffset":21.1171875,"scale":1,"range":8,"bounds":[0.6875,-0.8125,12.09375,22.578125]},"84":{"id":84,"letter":"T","x":463,"y":199,"width":64,"height":64,"map":0,"xadvance":16.890625,"xoffset":23.5859375,"yoffset":21.0078125,"scale":1,"range":8,"bounds":[0.171875,-0.125,16.65625,22.109375]},"85":{"id":85,"letter":"U","x":529,"y":199,"width":64,"height":64,"map":0,"xadvance":21.734375,"xoffset":21.140625,"yoffset":21.25,"scale":1,"range":8,"bounds":[1.359375,-0.421875,20.359375,21.921875]},"86":{"id":86,"letter":"V","x":595,"y":199,"width":64,"height":64,"map":0,"xadvance":20.890625,"xoffset":21.515625,"yoffset":21.0703125,"scale":1,"range":8,"bounds":[0.953125,-0.0625,20.015625,21.921875]},"87":{"id":87,"letter":"W","x":661,"y":199,"width":64,"height":64,"map":0,"xadvance":30.046875,"xoffset":16.9453125,"yoffset":21.0859375,"scale":1,"range":8,"bounds":[0.921875,-0.09375,29.1875,21.921875]},"88":{"id":88,"letter":"X","x":727,"y":199,"width":64,"height":64,"map":0,"xadvance":19.71875,"xoffset":22.1796875,"yoffset":21.0625,"scale":1,"range":8,"bounds":[0.953125,-0.078125,18.6875,21.953125]},"89":{"id":89,"letter":"Y","x":793,"y":199,"width":64,"height":64,"map":0,"xadvance":19.875,"xoffset":22.078125,"yoffset":21.0859375,"scale":1,"range":8,"bounds":[0.484375,-0.09375,19.359375,21.921875]},"90":{"id":90,"letter":"Z","x":859,"y":199,"width":64,"height":64,"map":0,"xadvance":17.28125,"xoffset":23.3203125,"yoffset":21.0859375,"scale":1,"range":8,"bounds":[1,-0.25,16.359375,22.078125]},"91":{"id":91,"letter":"[","x":925,"y":199,"width":64,"height":64,"map":0,"xadvance":13.09375,"xoffset":24.734375,"yoffset":24,"scale":1,"range":8,"bounds":[2.015625,-6.078125,12.515625,22.078125]},"92":{"id":92,"letter":"\\","x":1,"y":265,"width":64,"height":64,"map":0,"xadvance":10.59375,"xoffset":26.734375,"yoffset":21.9765625,"scale":1,"range":8,"bounds":[0.625,-2,9.90625,22.046875]},"93":{"id":93,"letter":"]","x":67,"y":265,"width":64,"height":64,"map":0,"xadvance":13.09375,"xoffset":25.5234375,"yoffset":24.000390625,"scale":1,"range":8,"bounds":[1.234375,-6.07890625,11.71875,22.078125]},"94":{"id":94,"letter":"^","x":133,"y":265,"width":64,"height":64,"map":0,"xadvance":16.671875,"xoffset":23.5703125,"yoffset":17.46875,"scale":1,"range":8,"bounds":[0.703125,8.671875,16.15625,20.390625]},"95":{"id":95,"letter":"_","x":199,"y":265,"width":64,"height":64,"map":0,"xadvance":14.75,"xoffset":24.7109375,"yoffset":36.2578125,"scale":1,"range":8,"bounds":[-0.3125,-6.5,14.890625,-2.015625]},"96":{"id":96,"letter":"`","x":265,"y":265,"width":64,"height":64,"map":0,"xadvance":11.84375,"xoffset":26.453125,"yoffset":11.875,"scale":1,"range":8,"bounds":[0.828125,16.921875,10.265625,23.328125]},"97":{"id":97,"letter":"a","x":331,"y":265,"width":64,"height":64,"map":0,"xadvance":18.8125,"xoffset":22.875,"yoffset":24.421875,"scale":1,"range":8,"bounds":[0.671875,-0.359375,17.578125,15.515625]},"98":{"id":98,"letter":"b","x":397,"y":265,"width":64,"height":64,"map":0,"xadvance":18.84375,"xoffset":22.359375,"yoffset":20.859375,"scale":1,"range":8,"bounds":[1.015625,-0.1875,18.265625,22.46875]},"99":{"id":99,"letter":"c","x":463,"y":265,"width":64,"height":64,"map":0,"xadvance":13.3125,"xoffset":25.21875,"yoffset":24.3046875,"scale":1,"range":8,"bounds":[0.578125,-0.390625,12.984375,15.78125]},"100":{"id":100,"letter":"d","x":529,"y":265,"width":64,"height":64,"map":0,"xadvance":18.875,"xoffset":22.75,"yoffset":20.8125,"scale":1,"range":8,"bounds":[0.609375,-0.1875,17.890625,22.5625]},"101":{"id":101,"letter":"e","x":595,"y":265,"width":64,"height":64,"map":0,"xadvance":16.03125,"xoffset":23.859375,"yoffset":24.2890625,"scale":1,"range":8,"bounds":[0.640625,-0.453125,15.640625,15.875]},"102":{"id":102,"letter":"f","x":661,"y":265,"width":64,"height":64,"map":0,"xadvance":11.296875,"xoffset":26.34375,"yoffset":20.578125,"scale":1,"range":8,"bounds":[0.375,-0.09375,10.9375,22.9375]},"103":{"id":103,"letter":"g","x":727,"y":265,"width":64,"height":64,"map":0,"xadvance":18.265625,"xoffset":23.2109375,"yoffset":26.3984375,"scale":1,"range":8,"bounds":[0.578125,-4.3125,17,15.515625]},"104":{"id":104,"letter":"h","x":793,"y":265,"width":64,"height":64,"map":0,"xadvance":18.140625,"xoffset":23,"yoffset":20.921875,"scale":1,"range":8,"bounds":[1.078125,-0.125,16.921875,22.28125]},"105":{"id":105,"letter":"i","x":859,"y":265,"width":64,"height":64,"map":0,"xadvance":8.796875,"xoffset":27.6015625,"yoffset":21.296875,"scale":1,"range":8,"bounds":[1.28125,-0.09375,7.515625,21.5]},"106":{"id":106,"letter":"j","x":925,"y":265,"width":64,"height":64,"map":0,"xadvance":8.890625,"xoffset":28.4296875,"yoffset":23.296875,"scale":1,"range":8,"bounds":[-0.46875,-4.1875,7.609375,21.59375]},"107":{"id":107,"letter":"k","x":1,"y":331,"width":64,"height":64,"map":0,"xadvance":19.234375,"xoffset":21.984375,"yoffset":20.84375,"scale":1,"range":8,"bounds":[1.34375,-0.09375,18.6875,22.40625]},"108":{"id":108,"letter":"l","x":67,"y":331,"width":64,"height":64,"map":0,"xadvance":8.546875,"xoffset":27.7332175926,"yoffset":21.0859375,"scale":1,"range":8,"bounds":[1.09375,-0.125,7.43981481481,21.953125]},"109":{"id":109,"letter":"m","x":133,"y":331,"width":64,"height":64,"map":0,"xadvance":27.9375,"xoffset":18.2734375,"yoffset":24.2890625,"scale":1,"range":8,"bounds":[1.15625,-0.09375,26.296875,15.515625]},"110":{"id":110,"letter":"n","x":199,"y":331,"width":64,"height":64,"map":0,"xadvance":18.140625,"xoffset":23.109375,"yoffset":24.3203125,"scale":1,"range":8,"bounds":[0.921875,-0.09375,16.859375,15.453125]},"111":{"id":111,"letter":"o","x":265,"y":331,"width":64,"height":64,"map":0,"xadvance":16.921875,"xoffset":23.53125,"yoffset":24.3359375,"scale":1,"range":8,"bounds":[0.578125,-0.3125,16.359375,15.640625]},"112":{"id":112,"letter":"p","x":331,"y":331,"width":64,"height":64,"map":0,"xadvance":19.265625,"xoffset":22.078125,"yoffset":26.7734375,"scale":1,"range":8,"bounds":[1.28125,-4.90625,18.5625,15.359375]},"113":{"id":113,"letter":"q","x":397,"y":331,"width":64,"height":64,"map":0,"xadvance":18.9375,"xoffset":22.9140625,"yoffset":26.5703125,"scale":1,"range":8,"bounds":[0.609375,-4.890625,17.5625,15.75]},"114":{"id":114,"letter":"r","x":463,"y":331,"width":64,"height":64,"map":0,"xadvance":12.1875,"xoffset":25.6484375,"yoffset":24.3359375,"scale":1,"range":8,"bounds":[0.859375,-0.09375,11.84375,15.421875]},"115":{"id":115,"letter":"s","x":529,"y":331,"width":64,"height":64,"map":0,"xadvance":11.390625,"xoffset":26.4375,"yoffset":24.1484375,"scale":1,"range":8,"bounds":[0.65625,-0.578125,10.46875,16.28125]},"116":{"id":116,"letter":"t","x":595,"y":331,"width":64,"height":64,"map":0,"xadvance":12.09375,"xoffset":25.953125,"yoffset":22.0078125,"scale":1,"range":8,"bounds":[0.3125,-0.28125,11.78125,20.265625]},"117":{"id":117,"letter":"u","x":661,"y":331,"width":64,"height":64,"map":0,"xadvance":18.65625,"xoffset":22.65625,"yoffset":24.640625,"scale":1,"range":8,"bounds":[1.28125,-0.15625,17.40625,14.875]},"118":{"id":118,"letter":"v","x":727,"y":331,"width":64,"height":64,"map":0,"xadvance":17.15625,"xoffset":23.4375,"yoffset":24.625,"scale":1,"range":8,"bounds":[0.765625,-0.125,16.359375,14.875]},"119":{"id":119,"letter":"w","x":793,"y":331,"width":64,"height":64,"map":0,"xadvance":24.21875,"xoffset":19.8828125,"yoffset":24.59375,"scale":1,"range":8,"bounds":[0.484375,-0.09375,23.75,14.90625]},"120":{"id":120,"letter":"x","x":859,"y":331,"width":64,"height":64,"map":0,"xadvance":15.640625,"xoffset":24.15625,"yoffset":24.625,"scale":1,"range":8,"bounds":[0.578125,-0.125,15.109375,14.875]},"121":{"id":121,"letter":"y","x":925,"y":331,"width":64,"height":64,"map":0,"xadvance":17.21875,"xoffset":23.296875,"yoffset":27.171875,"scale":1,"range":8,"bounds":[0.734375,-5.21875,16.671875,14.875]},"122":{"id":122,"letter":"z","x":1,"y":397,"width":64,"height":64,"map":0,"xadvance":14.96875,"xoffset":24.1875,"yoffset":24.5625,"scale":1,"range":8,"bounds":[0.859375,-0.203125,14.765625,15.078125]},"123":{"id":123,"letter":"{","x":67,"y":397,"width":64,"height":64,"map":0,"xadvance":12.515625,"xoffset":25.8515625,"yoffset":23.96875,"scale":1,"range":8,"bounds":[0.953125,-6.5,11.34375,22.5625]},"124":{"id":124,"letter":"|","x":133,"y":397,"width":64,"height":64,"map":0,"xadvance":9.953125,"xoffset":27.0854166667,"yoffset":21.9765625,"scale":1,"range":8,"bounds":[2.90625,-2.1875,6.92291666667,22.234375]},"125":{"id":125,"letter":"}","x":199,"y":397,"width":64,"height":64,"map":0,"xadvance":12.515625,"xoffset":25.640625,"yoffset":23.96875,"scale":1,"range":8,"bounds":[1.171875,-6.5,11.546875,22.5625]},"126":{"id":126,"letter":"~","x":265,"y":397,"width":64,"height":64,"map":0,"xadvance":17.28125,"xoffset":23.265625,"yoffset":22.28125,"scale":1,"range":8,"bounds":[0.171875,5.484375,17.296875,13.953125]}},"kerning":{}},"type":"font","file":{"filename":"BRLNSDB.png","hash":"64c1f05f77830228af9c5fa580768cf1","size":369767,"url":"files/assets/79465530/1/BRLNSDB.png"},"region":"eu-west-1","i18n":{},"id":"79465530"},"79465795":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"GetHeightFromURLParams.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"getHeightFromUrlparams":{"attributesOrder":[],"attributes":{}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":7221,"hash":"88b3c04e2c42f73de8df5dbc8373e721","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"id":"79465795"},"79469394":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"showHeightAndWidth.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"showHeightAndWidth":{"attributesOrder":["width","height","hideInterval"],"attributes":{"width":{"type":"entity"},"height":{"type":"entity"},"hideInterval":{"type":"number"}}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":7221,"hash":"88b3c04e2c42f73de8df5dbc8373e721","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"id":"79469394"}}} \ No newline at end of file +{"application_properties":{"i18nAssets":[],"useTouch":true,"layerOrder":[{"layer":0,"enabled":true,"transparent":false},{"layer":1,"enabled":true,"transparent":false},{"layer":2,"enabled":true,"transparent":false},{"layer":0,"enabled":true,"transparent":true},{"layer":3,"enabled":true,"transparent":false},{"layer":3,"enabled":true,"transparent":true},{"layer":4,"enabled":true,"transparent":true}],"externalScripts":[],"height":720,"vr":false,"useModelV2":false,"antiAlias":true,"layers":{"0":{"transparentSortMode":3,"opaqueSortMode":2,"name":"World"},"1":{"transparentSortMode":3,"opaqueSortMode":2,"name":"Depth"},"2":{"transparentSortMode":3,"opaqueSortMode":0,"name":"Skybox"},"3":{"transparentSortMode":3,"opaqueSortMode":0,"name":"Immediate"},"4":{"transparentSortMode":1,"opaqueSortMode":1,"name":"UI"}},"width":1280,"useDevicePixelRatio":false,"useKeyboard":true,"maxAssetRetries":5,"powerPreference":"default","batchGroups":[],"preserveDrawingBuffer":false,"useLegacyScripts":false,"fillMode":"KEEP_ASPECT","scripts":[77854887,78097772,78382718,79014545,79153391,79459251,79465795,79469394],"useMouse":true,"use3dPhysics":false,"transparentCanvas":false,"resolutionMode":"AUTO","loadingScreenScript":null,"preferWebGl2":true,"useGamepads":false,"libraries":[]},"scenes":[{"name":"Untitled","url":"1390892.json"}],"assets":{"77854887":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"mouse.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"mouse":{"attributesOrder":["Selected","redMaterial","greenMaterial","blueMaterial"],"attributes":{"redMaterial":{"type":"asset","assetType":"material"},"greenMaterial":{"type":"asset","assetType":"material"},"blueMaterial":{"type":"asset","assetType":"material"},"Selected":{"type":"number","default":0}}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":7745,"hash":"26438be64e4843173ea5ffa5a1fc2300","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"e08efc6d-ce1f-4489-8e56-d0c13ffdba20","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"77854887"},"77855246":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"New Material","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[0,0.3764705882352941,1],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissive":[0,0,0],"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacity":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"77855246"},"77855249":{"tags":[],"name":"New Material","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[1,0,0],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissive":[0,0,0],"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacity":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"77855249"},"77855250":{"tags":[],"name":"New Material","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[0.3333333333333333,1,0],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissive":[0,0,0],"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacity":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"77855250"},"78072763":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"loonie1.png","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"png","type":"Bilevel","width":500,"height":500,"alpha":true,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"loonie1.png","size":179080,"hash":"549278f659af3330a068eeab4953f01b","variants":{},"url":"files/assets/78072763/1/loonie1.png"},"region":"eu-west-1","i18n":{},"immutable_backup":"18691b30-4b08-4f1a-af0e-de96e176d2ec","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78072763"},"78072855":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"New Material","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[1,1,1],"diffuseMap":78072763,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":2,"emissive":[0,0,0],"emissiveMap":78072763,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1.18,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0.686,"alphaFade":1,"opacity":1,"opacityMap":78072763,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78072855"},"78097772":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"touch.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"touch":{"attributesOrder":["Selected"],"attributes":{"Selected":{"type":"number","default":0}}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":7745,"hash":"26438be64e4843173ea5ffa5a1fc2300","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"80a64f57-ab50-40bb-9ad6-a11a4c149415","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78097772"},"78181705":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Wdparq2.jpg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":351,"height":351,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"Wdparq2.jpg","size":75522,"hash":"bf13297b4b74e7c37839ecba595482f2","variants":{},"url":"files/assets/78181705/1/Wdparq2.jpg"},"region":"eu-west-1","i18n":{},"immutable_backup":"22a14b99-6d79-47c9-8f24-15d6a8f2296e","same_as_backup":0,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181705"},"78181706":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"robe2.jpg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":298,"height":298,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"robe2.jpg","size":18470,"hash":"3508e1085ab2dc004e38257685c02922","variants":{},"url":"files/assets/78181706/1/robe2.jpg"},"region":"eu-west-1","i18n":{},"immutable_backup":"e490c699-0138-4c10-8583-e80c56b0524b","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181706"},"78181707":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"ceilingbump.jpg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":283,"height":403,"alpha":false,"depth":8,"srgb":false,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"ceilingbump.jpg","size":115965,"hash":"c78e303aa89c57fb464518c819f327b6","variants":{},"url":"files/assets/78181707/1/ceilingbump.jpg"},"region":"eu-west-1","i18n":{},"immutable_backup":"0d620af6-09c2-4f07-ade6-c05639b72cd4","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181707"},"78181708":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"walls.jpg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":983,"height":662,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"walls.jpg","size":79678,"hash":"8959016d8864904b03e3c778260cee6f","variants":{},"url":"files/assets/78181708/1/walls.jpg"},"region":"eu-west-1","i18n":{},"immutable_backup":"9a16ead2-527f-4bc0-9361-a7950c057189","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181708"},"78181709":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"CARPTTAN.JPG","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":512,"height":512,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"CARPTTAN.JPG","size":250224,"hash":"1d7c8fb9403e175e294aa0a14e290a54","variants":{},"url":"files/assets/78181709/1/CARPTTAN.JPG"},"region":"eu-west-1","i18n":{},"immutable_backup":"d0ae7e5d-36d3-43ed-b153-52400d67c20d","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181709"},"78181710":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"livingroom.max","revision":1,"preload":true,"exclude":false,"meta":null,"data":null,"type":"binary","file":{"filename":"livingroom.max","size":302592,"hash":"444dd36a95b616a14e030148af5cda69","url":"files/assets/78181710/1/livingroom.max"},"region":"eu-west-1","i18n":{},"immutable_backup":"930de445-fae5-4586-94bb-889d3fd0555d","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181710"},"78181711":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"BURLOAK.JPG","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":756,"height":512,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"BURLOAK.JPG","size":189060,"hash":"3a7de42744d470c97f33b53c1b3eef7b","variants":{},"url":"files/assets/78181711/1/BURLOAK.JPG"},"region":"eu-west-1","i18n":{},"immutable_backup":"ae4e4bb5-0c36-4e7e-85b4-492e145c6574","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181711"},"78181751":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Take 001.glb","revision":1,"preload":true,"region":"eu-west-1","meta":{"name":"Take 001","duration":0},"data":null,"type":"animation","file":{"hash":"cb00af4e5637090a638f86273312a910","size":13688,"filename":"Take 001.glb","url":"files/assets/78181751/1/Take%20001.glb"},"i18n":{},"immutable_backup":"5badb4b8-22df-4a7c-9068-f4f7ddb16bae","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181751"},"78181752":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"01 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":0},"data":{"shader":"blinn","ambient":[0.588235,0.588235,0.588235],"diffuse":[0.588235,0.588235,0.588235],"diffuseMap":null,"diffuseMapOffset":[0,0],"diffuseMapTiling":[1,1],"specular":[0,0,0],"shininess":1.81818,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMapChannel":"rgb","diffuseMapUv":0,"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181752"},"78181753":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"02 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":3},"data":{"shader":"blinn","ambient":[0.588235,0.588235,0.588235],"diffuse":[0.588235,0.588235,0.588235],"diffuseMap":null,"diffuseMapOffset":[0,0],"diffuseMapTiling":[1,1],"specular":[0,0,0],"shininess":18.1818,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMapChannel":"rgb","diffuseMapUv":0,"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181753"},"78181754":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"13 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":1},"data":{"shader":"blinn","ambient":[0.588235,0.588235,0.588235],"diffuse":[0.6588235294117647,0.6392156862745098,0.6235294117647059],"diffuseMap":78181705,"diffuseMapOffset":[-0.35,-0.7],"diffuseMapTiling":[4.75,3.61],"specular":[0,0,0],"shininess":18.1818,"emissive":[0.01568627450980392,0.01568627450980392,0.01568627450980392],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMapChannel":"rgb","diffuseMapUv":0,"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":true,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181754"},"78181756":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"14 - Defaultwall","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":2},"data":{"shader":"blinn","ambient":[0.588235,0.588235,0.588235],"diffuse":[0.588235,0.588235,0.588235],"diffuseMap":78181708,"diffuseMapOffset":[4.17233e-7,0],"diffuseMapTiling":[0.999999,1],"specular":[0,0,0],"shininess":18.1818,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMapChannel":"rgb","diffuseMapUv":0,"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181756"},"78181757":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"07 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":6},"data":{"shader":"blinn","ambient":[1,1,0.960784],"diffuse":[1,1,0.960784],"specular":[0,0,0],"shininess":18.1818,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181757"},"78181758":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"15 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":8},"data":{"shader":"blinn","ambient":[0.686275,0.423529,0.192157],"diffuse":[0.686275,0.423529,0.192157],"specular":[0,0,0],"shininess":18.1818,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181758"},"78181759":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"14 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":7},"data":{"shader":"blinn","ambient":[0.588235,0.588235,0.588235],"diffuse":[0.588235,0.588235,0.588235],"diffuseMap":null,"diffuseMapOffset":[0,0],"diffuseMapTiling":[1,1],"specular":[0,0,0],"shininess":18.1818,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMapChannel":"rgb","diffuseMapUv":0,"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181759"},"78181760":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"08 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":5},"data":{"shader":"blinn","ambient":[1,0.729412,0],"diffuse":[1,0.729412,0],"specular":[0.31132,0.31132,0.31132],"shininess":90.9091,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181760"},"78181761":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"03 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":4},"data":{"shader":"blinn","ambient":[1,1,1],"diffuse":[1,1,1],"specular":[1.6045,1.6045,1.6045],"shininess":90.9091,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181761"},"78181762":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":658,"triangles":768,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":0},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181762"},"78181763":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box02","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":658,"triangles":768,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":1},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181763"},"78181764":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box03","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":658,"triangles":768,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":2},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181764"},"78181765":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box04","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":652,"triangles":764,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":3},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181765"},"78181766":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box05","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":652,"triangles":764,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":4},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181766"},"78181767":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box06","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":652,"triangles":764,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":5},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181767"},"78181768":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box07","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":11646,"triangles":15932,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":6},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181768"},"78181769":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":391,"triangles":704,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":7},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181769"},"78181770":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"C-Ext01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":56,"triangles":28,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":8},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181770"},"78181771":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box08","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":406,"triangles":212,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":9},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181771"},"78181772":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Sphere01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1412,"triangles":2300,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":10},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181772"},"78181773":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Cylinder01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":79,"triangles":72,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":11},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181773"},"78181774":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Sphere02","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":71,"triangles":80,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":12},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181774"},"78181775":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Line01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1503,"triangles":1572,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":13},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181775"},"78181776":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box09","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":14},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181776"},"78181777":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box10","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":15},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181777"},"78181778":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box11","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":16},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181778"},"78181779":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box12","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":17},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181779"},"78181780":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box13","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":18},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181780"},"78181876":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"livingroom.glb","revision":1,"preload":true,"region":"eu-west-1","meta":null,"data":{},"type":"container","file":{"hash":"78e748bf3b30b70fc9d4b74e36d22e8d","size":815580,"filename":"livingroom.glb","url":"files/assets/78181876/1/livingroom.glb"},"i18n":{},"immutable_backup":"47d741c1-43e5-456c-a962-4f29772eb1b5","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181876"},"78181877":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":658,"triangles":768,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":0},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181877"},"78181878":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box02","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":658,"triangles":768,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":1},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181878"},"78181879":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box03","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":658,"triangles":768,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":2},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181879"},"78181880":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box04","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":652,"triangles":764,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":3},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181880"},"78181881":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box05","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":652,"triangles":764,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":4},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181881"},"78181882":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box06","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":652,"triangles":764,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":5},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181882"},"78181883":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box07","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":11646,"triangles":15932,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":6},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181883"},"78181884":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":391,"triangles":704,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":7},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181884"},"78181885":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"C-Ext01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":56,"triangles":28,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":8},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181885"},"78181886":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Sphere01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1412,"triangles":2300,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":10},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181886"},"78181887":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box08","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":406,"triangles":212,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":9},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181887"},"78181888":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Cylinder01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":79,"triangles":72,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":11},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181888"},"78181889":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Sphere02","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":71,"triangles":80,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":12},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181889"},"78181890":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Line01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1503,"triangles":1572,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":13},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181890"},"78181891":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box09","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":14},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181891"},"78181892":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box10","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":15},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181892"},"78181893":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box11","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":16},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181893"},"78181894":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box12","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":17},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181894"},"78181895":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box13","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":18},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181895"},"78181896":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"livingroom","revision":1,"preload":true,"region":"eu-west-1","meta":{"containerAsset":78181876},"data":{"entities":{"992e38f0-dd22-4fe8-843f-5c80f0b4190f":{"enabled":true,"tags":[],"children":["cf173562-138d-43de-b497-644f7ffe4239"],"position":[0,0,0],"rotation":[0,0,0],"scale":[0.01,0.01,0.01],"resource_id":"992e38f0-dd22-4fe8-843f-5c80f0b4190f","name":"RootNode","components":{},"parent":null},"cf173562-138d-43de-b497-644f7ffe4239":{"enabled":true,"tags":[],"children":["19b78e10-9bec-4619-80ff-e761bd368e6e","f637845d-7f0e-416e-a2da-27a804b90a26","624e755c-e008-4e38-a4ae-e189b9e6af0e","8fd046ca-9bf2-4996-a426-d5f6f336a65b","235f5a54-087f-4b74-bcb8-e92fb0454a6f","92d77773-aa8e-4faa-a639-619c285b76f1","0e2a3a2c-7ef9-48a5-94f8-425b169eb692","9ea5ecb4-e90e-41e7-8464-9700435c402b","7a7196e1-59de-4cee-831f-db20924f5a99","03051ef6-4f3a-438e-9160-a8aea926e2d0","3ce4c2c1-7a99-4730-a57c-346004bc1485","90839ae3-cc29-477f-a88e-53fb57152250","04a75aae-eb81-4d94-8678-29e91bc7ff75","26ac5c6d-406a-4e21-b3ce-6e451befe8e9","0ca19a72-2469-4446-b3d5-d341756117d3","afce77e7-aca3-481a-b7ad-35126ffafcde","1dbd7266-a1ce-4993-a0c0-14bc38ef3479","d5b5339a-94b6-4efa-822b-9c5c7997f1e1","232324a7-b6aa-4551-a098-bc9ea317773c","1346743e-6c0f-4290-9590-f6e6b64494a1","8a26cc25-f015-4fc5-8cfc-d2366cd0ec11","8f969715-c24b-40d4-a640-80340cc8ddaf","71743733-1689-447d-b55b-ef36a1f9832f"],"position":[0,0,0],"rotation":[0,0,0],"scale":[2.54,2.54,2.54],"resource_id":"cf173562-138d-43de-b497-644f7ffe4239","name":"Fbx_Root","components":{},"parent":"992e38f0-dd22-4fe8-843f-5c80f0b4190f"},"19b78e10-9bec-4619-80ff-e761bd368e6e":{"enabled":true,"tags":[],"children":[],"position":[-7.74598,38.4319,30.0512],"rotation":[0,0,14.3003],"scale":[1.07852,1.07852,1.07852],"resource_id":"19b78e10-9bec-4619-80ff-e761bd368e6e","name":"Box01","components":{"render":{"enabled":true,"type":"asset","asset":78181877,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"f637845d-7f0e-416e-a2da-27a804b90a26":{"enabled":true,"tags":[],"children":[],"position":[-7.74598,38.4319,96.2053],"rotation":[0,0,14.3003],"scale":[1.07852,1.07852,-1.07852],"resource_id":"f637845d-7f0e-416e-a2da-27a804b90a26","name":"Box02","components":{"render":{"enabled":true,"type":"asset","asset":78181878,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"624e755c-e008-4e38-a4ae-e189b9e6af0e":{"enabled":true,"tags":[],"children":[],"position":[-19.7797,35.3645,160.262],"rotation":[0,0,14.3003],"scale":[-1.07852,1.07852,-1.07852],"resource_id":"624e755c-e008-4e38-a4ae-e189b9e6af0e","name":"Box03","components":{"render":{"enabled":true,"type":"asset","asset":78181879,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"8fd046ca-9bf2-4996-a426-d5f6f336a65b":{"enabled":true,"tags":[],"children":[],"position":[8.67342,31.0299,-2.24907],"rotation":[90,0,0],"scale":[1.07852,1.07852,1.07852],"resource_id":"8fd046ca-9bf2-4996-a426-d5f6f336a65b","name":"Box04","components":{"render":{"enabled":true,"type":"asset","asset":78181880,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"235f5a54-087f-4b74-bcb8-e92fb0454a6f":{"enabled":true,"tags":[],"children":[],"position":[8.67342,31.0299,64.5707],"rotation":[90,0,0],"scale":[1.07852,1.07852,1.07852],"resource_id":"235f5a54-087f-4b74-bcb8-e92fb0454a6f","name":"Box05","components":{"render":{"enabled":true,"type":"asset","asset":78181881,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"92d77773-aa8e-4faa-a639-619c285b76f1":{"enabled":true,"tags":[],"children":[],"position":[8.67342,31.0299,131.359],"rotation":[90,0,0],"scale":[1.07852,1.07852,1.07852],"resource_id":"92d77773-aa8e-4faa-a639-619c285b76f1","name":"Box06","components":{"render":{"enabled":true,"type":"asset","asset":78181882,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"0e2a3a2c-7ef9-48a5-94f8-425b169eb692":{"enabled":true,"tags":[],"children":[],"position":[-0.578045,3.58283,-15.3967],"rotation":[90,0,0],"scale":[1,1,1],"resource_id":"0e2a3a2c-7ef9-48a5-94f8-425b169eb692","name":"Box07","components":{"render":{"enabled":true,"type":"asset","asset":78181883,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"9ea5ecb4-e90e-41e7-8464-9700435c402b":{"enabled":true,"tags":[],"children":[],"position":[129.593,0,84.7355],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"9ea5ecb4-e90e-41e7-8464-9700435c402b","name":"Plane01","components":{"render":{"enabled":true,"type":"asset","asset":78181884,"materialAssets":[78181754],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"7a7196e1-59de-4cee-831f-db20924f5a99":{"enabled":true,"tags":[],"children":[],"position":[385.604,0,-284.937],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"7a7196e1-59de-4cee-831f-db20924f5a99","name":"C-Ext01","components":{"render":{"enabled":true,"type":"asset","asset":78181885,"materialAssets":[78181756],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"03051ef6-4f3a-438e-9160-a8aea926e2d0":{"enabled":true,"tags":[],"children":[],"position":[-0.0364215,-0.117522,-46.2227],"rotation":[0,0,0],"scale":[0.945135,0.945135,0.945135],"resource_id":"03051ef6-4f3a-438e-9160-a8aea926e2d0","name":"Box08","components":{"render":{"enabled":true,"type":"asset","asset":78181887,"materialAssets":[78181753],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"3ce4c2c1-7a99-4730-a57c-346004bc1485":{"enabled":true,"tags":[],"children":[],"position":[-12.6914,51.191,-45.6799],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"3ce4c2c1-7a99-4730-a57c-346004bc1485","name":"Sphere01","components":{"render":{"enabled":true,"type":"asset","asset":78181886,"materialAssets":[78181761],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"90839ae3-cc29-477f-a88e-53fb57152250":{"enabled":true,"tags":[],"children":[],"position":[-12.745,67.1823,-45.5833],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"90839ae3-cc29-477f-a88e-53fb57152250","name":"Cylinder01","components":{"render":{"enabled":true,"type":"asset","asset":78181888,"materialAssets":[78181760],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"04a75aae-eb81-4d94-8678-29e91bc7ff75":{"enabled":true,"tags":[],"children":[],"position":[-12.6219,79.6286,-45.6129],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"04a75aae-eb81-4d94-8678-29e91bc7ff75","name":"Sphere02","components":{"render":{"enabled":true,"type":"asset","asset":78181889,"materialAssets":[78181757],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"26ac5c6d-406a-4e21-b3ce-6e451befe8e9":{"enabled":true,"tags":[],"children":[],"position":[-12.5626,77.3243,-55.9246],"rotation":[90,-90,0],"scale":[1,1,1],"resource_id":"26ac5c6d-406a-4e21-b3ce-6e451befe8e9","name":"Line01","components":{"render":{"enabled":true,"type":"asset","asset":78181890,"materialAssets":[78181759],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"0ca19a72-2469-4446-b3d5-d341756117d3":{"enabled":true,"tags":[],"children":[],"position":[22.6662,0,-33.2917],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"0ca19a72-2469-4446-b3d5-d341756117d3","name":"Box09","components":{"render":{"enabled":true,"type":"asset","asset":78181891,"materialAssets":[78181758],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"afce77e7-aca3-481a-b7ad-35126ffafcde":{"enabled":true,"tags":[],"children":[],"position":[22.6133,0,-38.6055],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"afce77e7-aca3-481a-b7ad-35126ffafcde","name":"Box10","components":{"render":{"enabled":true,"type":"asset","asset":78181892,"materialAssets":[78181758],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"1dbd7266-a1ce-4993-a0c0-14bc38ef3479":{"enabled":true,"tags":[],"children":[],"position":[21.9913,0,-42.9339],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"1dbd7266-a1ce-4993-a0c0-14bc38ef3479","name":"Box11","components":{"render":{"enabled":true,"type":"asset","asset":78181893,"materialAssets":[78181758],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"d5b5339a-94b6-4efa-822b-9c5c7997f1e1":{"enabled":true,"tags":[],"children":[],"position":[21.3003,0,-45.9494],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"d5b5339a-94b6-4efa-822b-9c5c7997f1e1","name":"Box12","components":{"render":{"enabled":true,"type":"asset","asset":78181894,"materialAssets":[78181758],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"232324a7-b6aa-4551-a098-bc9ea317773c":{"enabled":true,"tags":[],"children":[],"position":[20.5984,0,-49.921],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"232324a7-b6aa-4551-a098-bc9ea317773c","name":"Box13","components":{"render":{"enabled":true,"type":"asset","asset":78181895,"materialAssets":[78181758],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"1346743e-6c0f-4290-9590-f6e6b64494a1":{"enabled":true,"tags":[],"children":[],"position":[-12.5328,80.4621,-45.5371],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"1346743e-6c0f-4290-9590-f6e6b64494a1","name":"Omni01","components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":1.17,"castShadows":false,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":8,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"8a26cc25-f015-4fc5-8cfc-d2366cd0ec11":{"enabled":true,"tags":[],"children":[],"position":[127.84,180.989,-13.2821],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"8a26cc25-f015-4fc5-8cfc-d2366cd0ec11","name":"Omni02","components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":0.269,"castShadows":false,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":8,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"8f969715-c24b-40d4-a640-80340cc8ddaf":{"enabled":true,"tags":[],"children":[],"position":[151.448,178.646,280.302],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"8f969715-c24b-40d4-a640-80340cc8ddaf","name":"Omni03","components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":0.2214,"castShadows":false,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":8,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"71743733-1689-447d-b55b-ef36a1f9832f":{"enabled":true,"tags":[],"children":[],"position":[151.448,304.742,75.99],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"71743733-1689-447d-b55b-ef36a1f9832f","name":"Omni04","components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":0.2214,"castShadows":false,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":8,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"}}},"type":"template","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78181896"},"78379717":{"tags":[],"name":"ammo.js","revision":1,"preload":false,"meta":null,"data":{"order":100,"scripts":{},"loadingType":0},"type":"script","file":{"filename":"ammo.js","size":1895438,"hash":"34480c72ed787337db20c105cb9ba69d","url":"files/assets/78379717/1/ammo.js"},"region":"eu-west-1","i18n":{},"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","immutable_backup":"0ff0f9dc-f3c3-46e0-be11-42b897c70cde","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78379717"},"78379718":{"tags":[],"name":"ammo.wasm.js","revision":1,"preload":false,"meta":null,"data":{"order":100,"scripts":{},"loadingType":0},"type":"script","file":{"filename":"ammo.wasm.js","size":391789,"hash":"6b7ab3989e4f9f17c86e44380f9181c6","url":"files/assets/78379718/1/ammo.wasm.js"},"region":"eu-west-1","i18n":{},"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","immutable_backup":"92f1f196-1475-43fb-99fb-a41e0037a862","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78379718"},"78379719":{"tags":[],"name":"ammo.wasm.wasm","revision":1,"preload":false,"meta":null,"data":{"moduleName":"Ammo","glueScriptId":78379718,"fallbackScriptId":78379717,"loadingType":0},"type":"wasm","file":{"filename":"ammo.wasm.wasm","size":659433,"hash":"a6819ea71a53e67f1dfe3e42957c2971","url":"files/assets/78379719/1/ammo.wasm.wasm"},"region":"eu-west-1","i18n":{},"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","immutable_backup":"945f70cd-330b-490b-9579-f478f1763e7e","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78379719"},"78382718":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"picker_raycast.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"pickerRaycast":{"attributesOrder":[],"attributes":{}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":7745,"hash":"26438be64e4843173ea5ffa5a1fc2300","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"3d0cd516-d183-4e9f-b7e8-407ee8c7bde0","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78382718"},"78401677":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"doorman.mtl","revision":1,"preload":true,"exclude":false,"meta":null,"data":null,"type":"binary","file":{"filename":"doorman.mtl","size":930,"hash":"db9bed74e8bdc6681a6ab846c919aada","url":"files/assets/78401677/1/doorman.mtl"},"region":"eu-west-1","i18n":{},"immutable_backup":"2dcc7ca7-aff1-41b0-847d-78cfca884300","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78401677"},"78401691":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"t_eye_d.jpeg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":256,"height":256,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"t_eye_d.jpeg","hash":"fef226427dfd003d8f8b462219f1df8e","size":10713,"variants":{},"url":"files/assets/78401691/1/t_eye_d.jpeg"},"region":"eu-west-1","i18n":{},"immutable_backup":"c8660319-154d-4019-930b-427862948cc7","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78401691"},"78401692":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"t_doorMan_teeth_d.jpeg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":256,"height":256,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"t_doorMan_teeth_d.jpeg","hash":"32521ea35225763f7f528eb8e7b4393e","size":16505,"variants":{},"url":"files/assets/78401692/1/t_doorMan_teeth_d.jpeg"},"region":"eu-west-1","i18n":{},"immutable_backup":"f7dbe0fd-0aed-4bef-bd94-1aad0fc300d8","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78401692"},"78401693":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"t_doorMan_teeth_n.jpeg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":true,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":256,"height":256,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"t_doorMan_teeth_n.jpeg","hash":"d75247a48a056745a100fc522344f5b0","size":22879,"variants":{},"url":"files/assets/78401693/1/t_doorMan_teeth_n.jpeg"},"region":"eu-west-1","i18n":{},"immutable_backup":"af0745ef-bfd2-41bb-81f7-87c74c81f07a","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78401693"},"78401695":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"t_eye_n.png","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":true,"normals":true,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"png","type":"Bilevel","width":256,"height":256,"alpha":true,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"t_eye_n.png","hash":"18e0ed32b974fc7e20d98149d20e7589","size":35989,"variants":{},"url":"files/assets/78401695/1/t_eye_n.png"},"region":"eu-west-1","i18n":{},"immutable_backup":"797bfc00-99dc-42db-ba65-712c4193aa75","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78401695"},"78401697":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"rdmobj00Mat","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":0},"data":{"shader":"blinn","ambient":[0.2,0.2,0.2],"diffuse":[0.8,0.8,0.8],"specular":[0.2,0.2,0.2],"shininess":39.2903,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":78401692,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78401697"},"78401698":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"rdmobj01Mat","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":1},"data":{"shader":"blinn","ambient":[0.2,0.2,0.2],"diffuse":[0.8,0.8,0.8],"specular":[0.2,0.2,0.2],"shininess":39.2903,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":78401691,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78401698"},"78401699":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"rdmobj03Mat","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":3},"data":{"shader":"blinn","ambient":[0.2,0.2,0.2],"diffuse":[0.8,0.8,0.8],"specular":[0.2,0.2,0.2],"shininess":39.2903,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":78402284,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":78402285,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":78402286,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78401699"},"78401700":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"rdmobj02Mat","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":2},"data":{"shader":"blinn","ambient":[0.2,0.2,0.2],"diffuse":[0.8,0.8,0.8],"specular":[0.2,0.2,0.2],"shininess":39.2903,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":78402284,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":78402286,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78401700"},"78401701":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"doorman.glb","revision":1,"preload":true,"region":"eu-west-1","meta":null,"data":{},"type":"container","file":{"hash":"20572c505d27cbde1e4c76f0b853421f","size":306708,"filename":"doorman.glb","url":"files/assets/78401701/1/doorman.glb"},"i18n":{},"immutable_backup":"16399660-c5cc-4c78-bcfc-912f396ba609","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78401701"},"78401702":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"rdmobj00","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":2190,"triangles":730,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78401701,"renderIndex":0},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78401702"},"78401703":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"rdmobj01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":338,"triangles":624,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78401701,"renderIndex":1},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78401703"},"78401704":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"rdmobj03","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":3310,"triangles":5289,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78401701,"renderIndex":3},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78401704"},"78401705":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"rdmobj02","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1795,"triangles":3140,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78401701,"renderIndex":2},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78401705"},"78401706":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"doorman","revision":1,"preload":true,"region":"eu-west-1","meta":{"containerAsset":78401701},"data":{"entities":{"2cfeea72-a4bb-4a0e-8dad-abd92cc83dad":{"enabled":true,"tags":[],"children":["9ccb87a7-6e1d-4ae0-9c96-b3b5d27c22f2"],"position":[0,0,0],"rotation":[0,0,0],"scale":[0.12734020167208698,0.12734020167208698,0.12734020167208698],"resource_id":"2cfeea72-a4bb-4a0e-8dad-abd92cc83dad","name":"RootNode","components":{"collision":{"enabled":true,"type":"box","halfExtents":[0.458,1.106,0.319],"radius":0.5,"axis":1,"height":2,"asset":null,"renderAsset":null}},"parent":null},"9ccb87a7-6e1d-4ae0-9c96-b3b5d27c22f2":{"enabled":true,"tags":[],"children":["a662f523-2a86-4f77-9951-1053085f7717","fbf7970b-0b02-48c8-9fbb-6fbb5d4f3485","cafbe398-372c-44b5-a905-6a9ca90c105c","6147aeb5-2849-4302-80b1-7120263a14de"],"position":[0,-9.158829431059022,0.000002486358653186471],"rotation":[-180,0,-180],"scale":[2.997398613039719,2.997398613039719,2.997398613039719],"resource_id":"9ccb87a7-6e1d-4ae0-9c96-b3b5d27c22f2","name":"doorman_root","components":{"script":{"enabled":true,"order":["mouse","touch"],"scripts":{"mouse":{"enabled":true,"attributes":{"Selected":0,"redMaterial":null,"greenMaterial":null,"blueMaterial":null}},"touch":{"enabled":true,"attributes":{"Selected":0}}}}},"parent":"2cfeea72-a4bb-4a0e-8dad-abd92cc83dad"},"a662f523-2a86-4f77-9951-1053085f7717":{"enabled":true,"tags":[],"children":[],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"a662f523-2a86-4f77-9951-1053085f7717","name":"rdmobj00","components":{"render":{"enabled":true,"type":"asset","asset":78401702,"materialAssets":[78401697],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"9ccb87a7-6e1d-4ae0-9c96-b3b5d27c22f2"},"fbf7970b-0b02-48c8-9fbb-6fbb5d4f3485":{"enabled":true,"tags":[],"children":[],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"fbf7970b-0b02-48c8-9fbb-6fbb5d4f3485","name":"rdmobj01","components":{"render":{"enabled":true,"type":"asset","asset":78401703,"materialAssets":[78401698],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"9ccb87a7-6e1d-4ae0-9c96-b3b5d27c22f2"},"cafbe398-372c-44b5-a905-6a9ca90c105c":{"enabled":true,"tags":[],"children":[],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"cafbe398-372c-44b5-a905-6a9ca90c105c","name":"rdmobj02","components":{"render":{"enabled":true,"type":"asset","asset":78401705,"materialAssets":[78401700],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"9ccb87a7-6e1d-4ae0-9c96-b3b5d27c22f2"},"6147aeb5-2849-4302-80b1-7120263a14de":{"enabled":true,"tags":[],"children":[],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"6147aeb5-2849-4302-80b1-7120263a14de","name":"rdmobj03","components":{"render":{"enabled":true,"type":"asset","asset":78401704,"materialAssets":[78401699],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"9ccb87a7-6e1d-4ae0-9c96-b3b5d27c22f2"}}},"type":"template","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78401706"},"78402284":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"t_doorMan_d.jpeg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":1024,"height":1024,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"t_doorMan_d.jpeg","hash":"c098404fd23169b3f6dfe0e20bec277f","size":170279,"variants":{},"url":"files/assets/78402284/1/t_doorMan_d.jpeg"},"region":"eu-west-1","i18n":{},"immutable_backup":"f4d4139b-1258-4016-b255-06b035819135","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78402284"},"78402285":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"t_doorMan_s.jpeg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":1024,"height":1024,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"t_doorMan_s.jpeg","hash":"560ee2f398d81b75b4ba419cce710cb9","size":122293,"variants":{},"url":"files/assets/78402285/1/t_doorMan_s.jpeg"},"region":"eu-west-1","i18n":{},"immutable_backup":"15c98bcc-4411-4004-ae75-c1faa6ad291e","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78402285"},"78402286":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"t_doorMan_n.jpeg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":true,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":1024,"height":1024,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"t_doorMan_n.jpeg","hash":"803af87756a209776154326664e5dbc9","size":237433,"variants":{},"url":"files/assets/78402286/1/t_doorMan_n.jpeg"},"region":"eu-west-1","i18n":{},"immutable_backup":"82735f59-b4e3-4199-8460-c70ab4206e2c","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78402286"},"78406226":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"archive-roundface-script_bigfontsite.com.ttf","revision":1,"preload":true,"exclude":false,"meta":{"chars":" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"},"data":{"version":2,"intensity":0,"info":{"face":"archive-roundface-script_bigfontsite.com","maps":[{"width":1024,"height":512}]},"chars":{"32":{"id":32,"letter":" ","x":1,"y":1,"width":64,"height":64,"map":0,"xadvance":4.992,"xoffset":31.5,"yoffset":31.5,"scale":1,"range":8},"33":{"id":33,"letter":"!","x":67,"y":1,"width":64,"height":64,"map":0,"xadvance":7.776,"xoffset":26.288,"yoffset":23.152,"scale":1,"range":8,"bounds":[0.128,-0.48,11.296,18.176]},"34":{"id":34,"letter":"\"","x":133,"y":1,"width":64,"height":64,"map":0,"xadvance":8.352,"xoffset":27.632,"yoffset":22.816,"scale":1,"range":8,"bounds":[1.12,5.888,7.616,12.48]},"36":{"id":36,"letter":"$","x":199,"y":1,"width":64,"height":64,"map":0,"xadvance":21.024,"xoffset":20.96,"yoffset":24.704,"scale":1,"range":8,"bounds":[1.024,-5.952,21.056,20.544]},"38":{"id":38,"letter":"&","x":265,"y":1,"width":64,"height":64,"map":0,"xadvance":20.832,"xoffset":20.464,"yoffset":22.56,"scale":1,"range":8,"bounds":[1.632,-0.096,21.44,18.976]},"39":{"id":39,"letter":"'","x":331,"y":1,"width":64,"height":64,"map":0,"xadvance":4.896,"xoffset":29.392,"yoffset":23.088,"scale":1,"range":8,"bounds":[1.12,5.792,4.096,12.032]},"44":{"id":44,"letter":",","x":397,"y":1,"width":64,"height":64,"map":0,"xadvance":5.888,"xoffset":28.672,"yoffset":32.88,"scale":1,"range":8,"bounds":[1.152,-5.024,5.504,3.264]},"45":{"id":45,"letter":"-","x":463,"y":1,"width":64,"height":64,"map":0,"xadvance":9.76,"xoffset":27.408,"yoffset":26.688,"scale":1,"range":8,"bounds":[0.544,3.904,8.64,6.72]},"46":{"id":46,"letter":".","x":529,"y":1,"width":64,"height":64,"map":0,"xadvance":5.44,"xoffset":29.168,"yoffset":30.528,"scale":1,"range":8,"bounds":[1.12,-0.32,4.544,3.264]},"48":{"id":48,"letter":"0","x":595,"y":1,"width":64,"height":64,"map":0,"xadvance":15.52,"xoffset":23.472,"yoffset":22.736,"scale":1,"range":8,"bounds":[1.376,-0.416,15.68,18.944]},"49":{"id":49,"letter":"1","x":661,"y":1,"width":64,"height":64,"map":0,"xadvance":10.208,"xoffset":25.2,"yoffset":22.704,"scale":1,"range":8,"bounds":[0.544,-0.224,13.056,18.816]},"50":{"id":50,"letter":"2","x":727,"y":1,"width":64,"height":64,"map":0,"xadvance":15.552,"xoffset":24.192,"yoffset":22.7330909091,"scale":1,"range":8,"bounds":[-0.448,-0.346181818182,16.064,18.88]},"51":{"id":51,"letter":"3","x":793,"y":1,"width":64,"height":64,"map":0,"xadvance":15.68,"xoffset":23.344,"yoffset":22.656,"scale":1,"range":8,"bounds":[0.768,-0.256,16.544,18.944]},"52":{"id":52,"letter":"4","x":859,"y":1,"width":64,"height":64,"map":0,"xadvance":14.944,"xoffset":23.744,"yoffset":22.576,"scale":1,"range":8,"bounds":[0.736,-0.128,15.776,18.976]},"53":{"id":53,"letter":"5","x":925,"y":1,"width":64,"height":64,"map":0,"xadvance":16.672,"xoffset":22.464,"yoffset":22.704,"scale":1,"range":8,"bounds":[0.96,-0.224,18.112,18.816]},"54":{"id":54,"letter":"6","x":1,"y":67,"width":64,"height":64,"map":0,"xadvance":14.72,"xoffset":24,"yoffset":22,"scale":1,"range":8,"bounds":[0.96,-0.352,15.04,20.352]},"55":{"id":55,"letter":"7","x":67,"y":67,"width":64,"height":64,"map":0,"xadvance":11.2,"xoffset":24.016,"yoffset":22.656,"scale":1,"range":8,"bounds":[1.216,-0.128,14.752,18.816]},"56":{"id":56,"letter":"8","x":133,"y":67,"width":64,"height":64,"map":0,"xadvance":15.104,"xoffset":23.232,"yoffset":22.496,"scale":1,"range":8,"bounds":[0.96,-0.256,16.576,19.264]},"57":{"id":57,"letter":"9","x":199,"y":67,"width":64,"height":64,"map":0,"xadvance":16.672,"xoffset":23.664,"yoffset":24.208,"scale":1,"range":8,"bounds":[1.12,-3.296,15.552,18.88]},"58":{"id":58,"letter":":","x":265,"y":67,"width":64,"height":64,"map":0,"xadvance":7.488,"xoffset":28.16,"yoffset":27.36,"scale":1,"range":8,"bounds":[1.12,-0.32,6.56,9.6]},"59":{"id":59,"letter":";","x":331,"y":67,"width":64,"height":64,"map":0,"xadvance":7.168,"xoffset":28.032,"yoffset":29.792,"scale":1,"range":8,"bounds":[1.152,-5.024,6.784,9.44]},"63":{"id":63,"letter":"?","x":397,"y":67,"width":64,"height":64,"map":0,"xadvance":8.736,"xoffset":25.552,"yoffset":23.088,"scale":1,"range":8,"bounds":[0.384,-0.32,12.512,18.144]},"65":{"id":65,"letter":"A","x":463,"y":67,"width":64,"height":64,"map":0,"xadvance":29.248,"xoffset":13.184,"yoffset":20.496,"scale":1,"range":8,"bounds":[0.576,-0.32,37.056,23.328]},"66":{"id":66,"letter":"B","x":529,"y":67,"width":64,"height":64,"map":0,"xadvance":27.744,"xoffset":16.16,"yoffset":20.704,"scale":1,"range":8,"bounds":[1.024,-0.384,30.656,22.976]},"67":{"id":67,"letter":"C","x":595,"y":67,"width":64,"height":64,"map":0,"xadvance":18.368,"xoffset":20.608,"yoffset":20.688,"scale":1,"range":8,"bounds":[1.344,-0.256,21.44,22.88]},"68":{"id":68,"letter":"D","x":661,"y":67,"width":64,"height":64,"map":0,"xadvance":29.248,"xoffset":16.192,"yoffset":20.752,"scale":1,"range":8,"bounds":[1.216,-0.512,30.4,23.008]},"69":{"id":69,"letter":"E","x":727,"y":67,"width":64,"height":64,"map":0,"xadvance":18.496,"xoffset":20.832,"yoffset":20.624,"scale":1,"range":8,"bounds":[1.12,-0.448,21.216,23.2]},"70":{"id":70,"letter":"F","x":793,"y":67,"width":64,"height":64,"map":0,"xadvance":19.008,"xoffset":17.408,"yoffset":20.688,"scale":1,"range":8,"bounds":[1.12,-0.512,28.064,23.136]},"71":{"id":71,"letter":"G","x":859,"y":67,"width":64,"height":64,"map":0,"xadvance":20,"xoffset":18.592,"yoffset":20.816,"scale":1,"range":8,"bounds":[1.056,-0.64,25.76,23.008]},"72":{"id":72,"letter":"H","x":925,"y":67,"width":64,"height":64,"map":0,"xadvance":27.904,"xoffset":13.76,"yoffset":20.64,"scale":1,"range":8,"bounds":[1.216,-0.256,35.264,22.976]},"73":{"id":73,"letter":"I","x":1,"y":133,"width":64,"height":64,"map":0,"xadvance":20,"xoffset":17.856,"yoffset":20.816,"scale":1,"range":8,"bounds":[0.96,-0.576,27.328,22.944]},"74":{"id":74,"letter":"J","x":67,"y":133,"width":64,"height":64,"map":0,"xadvance":14.24,"xoffset":25.296,"yoffset":24.784,"scale":1,"range":8,"bounds":[-7.52,-8.448,20.928,22.88]},"75":{"id":75,"letter":"K","x":133,"y":133,"width":64,"height":64,"map":0,"xadvance":32.128,"xoffset":14.368,"yoffset":20.544,"scale":1,"range":8,"bounds":[1.344,-0.32,33.92,23.232]},"76":{"id":76,"letter":"L","x":199,"y":133,"width":64,"height":64,"map":0,"xadvance":18.08,"xoffset":20.16,"yoffset":20.592,"scale":1,"range":8,"bounds":[0.832,-0.192,22.848,23.008]},"77":{"id":77,"letter":"M","x":265,"y":133,"width":64,"height":64,"map":0,"xadvance":36.512,"xoffset":11.76,"yoffset":20.72,"scale":1,"range":8,"bounds":[0.736,-0.256,39.744,22.816]},"78":{"id":78,"letter":"N","x":331,"y":133,"width":64,"height":64,"map":0,"xadvance":27.04,"xoffset":13.984,"yoffset":20.56,"scale":1,"range":8,"bounds":[0.832,-0.256,35.2,23.136]},"79":{"id":79,"letter":"O","x":397,"y":133,"width":64,"height":64,"map":0,"xadvance":17.024,"xoffset":21.184,"yoffset":20.56,"scale":1,"range":8,"bounds":[1.216,-0.16,20.416,23.04]},"80":{"id":80,"letter":"P","x":463,"y":133,"width":64,"height":64,"map":0,"xadvance":20.256,"xoffset":18.672,"yoffset":20.832,"scale":1,"range":8,"bounds":[1.344,-0.512,25.312,22.848]},"81":{"id":81,"letter":"Q","x":529,"y":133,"width":64,"height":64,"map":0,"xadvance":21.12,"xoffset":21.6,"yoffset":23.984,"scale":1,"range":8,"bounds":[-1.216,-6.752,22.016,22.784]},"82":{"id":82,"letter":"R","x":595,"y":133,"width":64,"height":64,"map":0,"xadvance":28.928,"xoffset":16.064,"yoffset":20.912,"scale":1,"range":8,"bounds":[1.056,-0.768,30.816,22.944]},"83":{"id":83,"letter":"S","x":661,"y":133,"width":64,"height":64,"map":0,"xadvance":19.104,"xoffset":21.28,"yoffset":20.544,"scale":1,"range":8,"bounds":[0.896,-0.096,20.544,23.008]},"84":{"id":84,"letter":"T","x":727,"y":133,"width":64,"height":64,"map":0,"xadvance":18.784,"xoffset":17.712,"yoffset":20.6228571429,"scale":1,"range":8,"bounds":[1.12,-0.32,27.456,23.0742857143]},"85":{"id":85,"letter":"U","x":793,"y":133,"width":64,"height":64,"map":0,"xadvance":23.744,"xoffset":16.896,"yoffset":20.608,"scale":1,"range":8,"bounds":[1.408,-0.32,28.8,23.104]},"86":{"id":86,"letter":"V","x":859,"y":133,"width":64,"height":64,"map":0,"xadvance":11.008,"xoffset":20.944,"yoffset":20.848,"scale":1,"range":8,"bounds":[1.12,-0.608,20.992,22.912]},"87":{"id":87,"letter":"W","x":925,"y":133,"width":64,"height":64,"map":0,"xadvance":17.76,"xoffset":16.896,"yoffset":20.976,"scale":1,"range":8,"bounds":[1.568,-0.8,28.64,22.848]},"88":{"id":88,"letter":"X","x":1,"y":199,"width":64,"height":64,"map":0,"xadvance":25.888,"xoffset":15.856,"yoffset":20.656,"scale":1,"range":8,"bounds":[1.248,-0.448,31.04,23.136]},"89":{"id":89,"letter":"Y","x":67,"y":199,"width":64,"height":64,"map":0,"xadvance":11.52,"xoffset":23.632,"yoffset":24.48,"scale":1,"range":8,"bounds":[-5.024,-8.192,21.76,23.232]},"90":{"id":90,"letter":"Z","x":133,"y":199,"width":64,"height":64,"map":0,"xadvance":20.96,"xoffset":17.328,"yoffset":20.544,"scale":1,"range":8,"bounds":[1.056,-0.16,28.288,23.072]},"97":{"id":97,"letter":"a","x":199,"y":199,"width":64,"height":64,"map":0,"xadvance":12.48,"xoffset":25.44,"yoffset":27.504,"scale":1,"range":8,"bounds":[0.32,-0.352,12.8,9.344]},"98":{"id":98,"letter":"b","x":265,"y":199,"width":64,"height":64,"map":0,"xadvance":12,"xoffset":25.712,"yoffset":22.656,"scale":1,"range":8,"bounds":[0.576,-0.416,12,19.104]},"99":{"id":99,"letter":"c","x":331,"y":199,"width":64,"height":64,"map":0,"xadvance":8.992,"xoffset":27.376,"yoffset":27.488,"scale":1,"range":8,"bounds":[0.32,-0.32,8.928,9.344]},"100":{"id":100,"letter":"d","x":397,"y":199,"width":64,"height":64,"map":0,"xadvance":12.768,"xoffset":23.056,"yoffset":22.8,"scale":1,"range":8,"bounds":[0.32,-0.384,17.568,18.784]},"101":{"id":101,"letter":"e","x":463,"y":199,"width":64,"height":64,"map":0,"xadvance":8.992,"xoffset":27.232,"yoffset":27.424,"scale":1,"range":8,"bounds":[0.32,-0.192,9.216,9.344]},"102":{"id":102,"letter":"f","x":529,"y":199,"width":64,"height":64,"map":0,"xadvance":6.752,"xoffset":24.72,"yoffset":22.72,"scale":1,"range":8,"bounds":[0.128,-0.096,14.432,18.656]},"103":{"id":103,"letter":"g","x":595,"y":199,"width":64,"height":64,"map":0,"xadvance":11.488,"xoffset":26.784,"yoffset":31.52,"scale":1,"range":8,"bounds":[-2.432,-8.448,12.864,9.408]},"104":{"id":104,"letter":"h","x":661,"y":199,"width":64,"height":64,"map":0,"xadvance":12.864,"xoffset":25.568,"yoffset":22.624,"scale":1,"range":8,"bounds":[0.032,-0.16,12.832,18.912]},"105":{"id":105,"letter":"i","x":727,"y":199,"width":64,"height":64,"map":0,"xadvance":6.56,"xoffset":27.584,"yoffset":25.12,"scale":1,"range":8,"bounds":[0.48,-0.032,8.352,13.792]},"106":{"id":106,"letter":"j","x":793,"y":199,"width":64,"height":64,"map":0,"xadvance":5.984,"xoffset":29.568,"yoffset":29.184,"scale":1,"range":8,"bounds":[-4.256,-8.128,9.12,13.76]},"107":{"id":107,"letter":"k","x":859,"y":199,"width":64,"height":64,"map":0,"xadvance":12.288,"xoffset":25.056,"yoffset":22.736,"scale":1,"range":8,"bounds":[0.032,-0.416,13.856,18.944]},"108":{"id":108,"letter":"l","x":925,"y":199,"width":64,"height":64,"map":0,"xadvance":6.304,"xoffset":25.824,"yoffset":22.72,"scale":1,"range":8,"bounds":[0.576,-0.32,11.776,18.88]},"109":{"id":109,"letter":"m","x":1,"y":265,"width":64,"height":64,"map":0,"xadvance":17.888,"xoffset":22.656,"yoffset":27.344,"scale":1,"range":8,"bounds":[0.192,-0.224,18.496,9.536]},"110":{"id":110,"letter":"n","x":67,"y":265,"width":64,"height":64,"map":0,"xadvance":12.48,"xoffset":25.728,"yoffset":27.408,"scale":1,"range":8,"bounds":[0.16,-0.256,12.384,9.44]},"111":{"id":111,"letter":"o","x":133,"y":265,"width":64,"height":64,"map":0,"xadvance":11.04,"xoffset":26.32,"yoffset":27.392,"scale":1,"range":8,"bounds":[0.32,-0.16,11.04,9.376]},"112":{"id":112,"letter":"p","x":199,"y":265,"width":64,"height":64,"map":0,"xadvance":11.968,"xoffset":28.64,"yoffset":31.648,"scale":1,"range":8,"bounds":[-5.216,-8.576,11.936,9.28]},"113":{"id":113,"letter":"q","x":265,"y":265,"width":64,"height":64,"map":0,"xadvance":11.968,"xoffset":25.296,"yoffset":31.552,"scale":1,"range":8,"bounds":[0.192,-8.544,13.216,9.44]},"114":{"id":114,"letter":"r","x":331,"y":265,"width":64,"height":64,"map":0,"xadvance":10.208,"xoffset":26.336,"yoffset":27.344,"scale":1,"range":8,"bounds":[0.16,-0.032,11.168,9.344]},"115":{"id":115,"letter":"s","x":397,"y":265,"width":64,"height":64,"map":0,"xadvance":9.216,"xoffset":27.216,"yoffset":27.424,"scale":1,"range":8,"bounds":[0.032,-0.192,9.536,9.344]},"116":{"id":116,"letter":"t","x":463,"y":265,"width":64,"height":64,"map":0,"xadvance":7.648,"xoffset":26.368,"yoffset":24.352,"scale":1,"range":8,"bounds":[0.864,-0.32,10.4,15.616]},"117":{"id":117,"letter":"u","x":529,"y":265,"width":64,"height":64,"map":0,"xadvance":11.712,"xoffset":25.824,"yoffset":27.536,"scale":1,"range":8,"bounds":[0.224,-0.224,12.128,9.152]},"118":{"id":118,"letter":"v","x":595,"y":265,"width":64,"height":64,"map":0,"xadvance":10.496,"xoffset":26.384,"yoffset":27.472,"scale":1,"range":8,"bounds":[0.192,-0.224,11.04,9.28]},"119":{"id":119,"letter":"w","x":661,"y":265,"width":64,"height":64,"map":0,"xadvance":16.608,"xoffset":23.152,"yoffset":27.392,"scale":1,"range":8,"bounds":[0.224,-0.224,17.472,9.44]},"120":{"id":120,"letter":"x","x":727,"y":265,"width":64,"height":64,"map":0,"xadvance":11.68,"xoffset":25.536,"yoffset":27.504,"scale":1,"range":8,"bounds":[0.192,-0.192,12.736,9.184]},"121":{"id":121,"letter":"y","x":793,"y":265,"width":64,"height":64,"map":0,"xadvance":11.776,"xoffset":26.336,"yoffset":31.568,"scale":1,"range":8,"bounds":[-0.96,-8.352,12.288,9.216]},"122":{"id":122,"letter":"z","x":859,"y":265,"width":64,"height":64,"map":0,"xadvance":11.744,"xoffset":25.6,"yoffset":27.536,"scale":1,"range":8,"bounds":[0.16,-0.32,12.64,9.248]}},"kerning":{}},"type":"font","file":{"filename":"archive-roundface-script_bigfontsite.com.png","hash":"93d340738cc8d0c06cda084ff749b82f","size":367744,"url":"files/assets/78406226/1/archive-roundface-script_bigfontsite.com.png"},"region":"eu-west-1","i18n":{},"immutable_backup":"c7c09dc1-29d2-4d3f-b0f9-ad6aecd16eb5","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"78406226"},"79014545":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"load_image.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"loadImage":{"attributesOrder":[],"attributes":{}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":7745,"hash":"26438be64e4843173ea5ffa5a1fc2300","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"c6340062-deb9-478d-93cb-12fd1392454c","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"79014545"},"79153391":{"tags":[],"name":"switching-textures.js","revision":1,"preload":true,"meta":null,"data":{"scripts":{"switchingTextures":{"attributesOrder":["textures","url","WebTexture"],"attributes":{"textures":{"type":"asset","assetType":"texture","array":true,"title":"Textures"},"url":{"type":"string"},"WebTexture":{"type":"asset","assetType":"texture","array":false,"title":"WebTexture"}}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":7745,"hash":"26438be64e4843173ea5ffa5a1fc2300","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","immutable_backup":"c31262e8-bb45-4278-98fa-d05a8bdb8606","same_as_backup":0,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"79153391"},"79449648":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"double-sided-arrow-png-51575265495yriug9wtzm.png","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"png","type":"Bilevel","width":480,"height":480,"alpha":true,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"double-sided-arrow-png-51575265495yriug9wtzm.png","size":3179,"hash":"27ebb44979c6d0aeffa4c540526a1fee","variants":{},"url":"files/assets/79449648/1/double-sided-arrow-png-51575265495yriug9wtzm.png"},"region":"eu-west-1","i18n":{},"immutable_backup":"4fc709ac-349d-4514-ab4b-64d705953e89","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"79449648"},"79458597":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"New Material","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[1,1,1],"diffuseMap":79449648,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissive":[0,0,0],"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0.298,"alphaFade":1,"opacity":1,"opacityMap":79449648,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"79458597"},"79459251":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"GetWidthFromURLParams.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"getWidthFromUrlparams":{"attributesOrder":[],"attributes":{}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":7745,"hash":"26438be64e4843173ea5ffa5a1fc2300","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"b451465d-204c-4380-8ca8-55d61da76f08","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"79459251"},"79465530":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"BRLNSDB.TTF","revision":1,"preload":true,"exclude":false,"meta":{"chars":" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"},"data":{"version":2,"intensity":0,"info":{"face":"BRLNSDB","maps":[{"width":1024,"height":512}]},"chars":{"32":{"id":32,"letter":" ","x":1,"y":1,"width":64,"height":64,"map":0,"xadvance":8,"xoffset":31.5,"yoffset":31.5,"scale":1,"range":8},"33":{"id":33,"letter":"!","x":67,"y":1,"width":64,"height":64,"map":0,"xadvance":8.953125,"xoffset":27.359375,"yoffset":21.234375,"scale":1,"range":8,"bounds":[1.703125,-0.390625,7.578125,21.921875]},"34":{"id":34,"letter":"\"","x":133,"y":1,"width":64,"height":64,"map":0,"xadvance":12.515625,"xoffset":25.7421875,"yoffset":13.96875,"scale":1,"range":8,"bounds":[1.0625,14.046875,11.453125,22.015625]},"35":{"id":35,"letter":"#","x":199,"y":1,"width":64,"height":64,"map":0,"xadvance":22.71875,"xoffset":20.7578125,"yoffset":21.6484375,"scale":1,"range":8,"bounds":[1.25,-1.71875,21.234375,22.421875]},"36":{"id":36,"letter":"$","x":265,"y":1,"width":64,"height":64,"map":0,"xadvance":15.546875,"xoffset":24.125,"yoffset":22.5859375,"scale":1,"range":8,"bounds":[1.125,-2.609375,14.625,21.4375]},"37":{"id":37,"letter":"%","x":331,"y":1,"width":64,"height":64,"map":0,"xadvance":25.703125,"xoffset":19.1484375,"yoffset":22.2890625,"scale":1,"range":8,"bounds":[0.484375,-0.6875,25.21875,20.109375]},"38":{"id":38,"letter":"&","x":397,"y":1,"width":64,"height":64,"map":0,"xadvance":22.34375,"xoffset":20.75,"yoffset":21.203125,"scale":1,"range":8,"bounds":[1.09375,-0.546875,21.40625,22.140625]},"39":{"id":39,"letter":"'","x":463,"y":1,"width":64,"height":64,"map":0,"xadvance":7.421875,"xoffset":28.2578125,"yoffset":14.4453125,"scale":1,"range":8,"bounds":[1.21875,13.09375,6.265625,22.015625]},"40":{"id":40,"letter":"(","x":529,"y":1,"width":64,"height":64,"map":0,"xadvance":12.734375,"xoffset":25.1015625,"yoffset":23.828125,"scale":1,"range":8,"bounds":[1.5,-6.53125,12.296875,22.875]},"41":{"id":41,"letter":")","x":595,"y":1,"width":64,"height":64,"map":0,"xadvance":12.734375,"xoffset":26.1640625,"yoffset":23.8359375,"scale":1,"range":8,"bounds":[0.4375,-6.546875,11.234375,22.875]},"42":{"id":42,"letter":"*","x":661,"y":1,"width":64,"height":64,"map":0,"xadvance":13.5625,"xoffset":25.3359375,"yoffset":16.453125,"scale":1,"range":8,"bounds":[0.515625,9.265625,12.8125,21.828125]},"43":{"id":43,"letter":"+","x":727,"y":1,"width":64,"height":64,"map":0,"xadvance":15.140625,"xoffset":24.5234375,"yoffset":22.671875,"scale":1,"range":8,"bounds":[0.515625,2.046875,14.4375,16.609375]},"44":{"id":44,"letter":",","x":793,"y":1,"width":64,"height":64,"map":0,"xadvance":8.984375,"xoffset":28.0078125,"yoffset":31.125,"scale":1,"range":8,"bounds":[-0.1875,-4.171875,8.171875,5.921875]},"45":{"id":45,"letter":"-","x":859,"y":1,"width":64,"height":64,"map":0,"xadvance":13.59375,"xoffset":25.1953125,"yoffset":22.4609375,"scale":1,"range":8,"bounds":[1.125,6.53125,12.484375,12.546875]},"46":{"id":46,"letter":".","x":925,"y":1,"width":64,"height":64,"map":0,"xadvance":8.984375,"xoffset":27.5078125,"yoffset":28.5859375,"scale":1,"range":8,"bounds":[0.828125,-0.3125,8.15625,7.140625]},"47":{"id":47,"letter":"/","x":1,"y":67,"width":64,"height":64,"map":0,"xadvance":10.59375,"xoffset":26.71875,"yoffset":21.96875,"scale":1,"range":8,"bounds":[0.53125,-2.078125,10.03125,22.140625]},"48":{"id":48,"letter":"0","x":67,"y":67,"width":64,"height":64,"map":0,"xadvance":20.15625,"xoffset":21.921875,"yoffset":22.59375,"scale":1,"range":8,"bounds":[0.765625,-0.484375,19.390625,19.296875]},"49":{"id":49,"letter":"1","x":133,"y":67,"width":64,"height":64,"map":0,"xadvance":10.296875,"xoffset":27.5859375,"yoffset":22.15625,"scale":1,"range":8,"bounds":[0.1875,-0.03125,8.640625,19.71875]},"50":{"id":50,"letter":"2","x":199,"y":67,"width":64,"height":64,"map":0,"xadvance":16.546875,"xoffset":23.6875,"yoffset":22.59375,"scale":1,"range":8,"bounds":[0.34375,-0.484375,16.28125,19.296875]},"51":{"id":51,"letter":"3","x":265,"y":67,"width":64,"height":64,"map":0,"xadvance":15.578125,"xoffset":24.234375,"yoffset":22.578125,"scale":1,"range":8,"bounds":[0.453125,-0.453125,15.078125,19.296875]},"52":{"id":52,"letter":"4","x":331,"y":67,"width":64,"height":64,"map":0,"xadvance":17.65625,"xoffset":23.1640625,"yoffset":22.21875,"scale":1,"range":8,"bounds":[0.609375,-0.1875,17.0625,19.75]},"53":{"id":53,"letter":"5","x":397,"y":67,"width":64,"height":64,"map":0,"xadvance":16.15625,"xoffset":24.015625,"yoffset":22.625,"scale":1,"range":8,"bounds":[0.546875,-0.453125,15.421875,19.203125]},"54":{"id":54,"letter":"6","x":463,"y":67,"width":64,"height":64,"map":0,"xadvance":17.765625,"xoffset":23.0390625,"yoffset":22.4375,"scale":1,"range":8,"bounds":[0.765625,-0.359375,17.15625,19.484375]},"55":{"id":55,"letter":"7","x":529,"y":67,"width":64,"height":64,"map":0,"xadvance":15.296875,"xoffset":24.5,"yoffset":22.5,"scale":1,"range":8,"bounds":[0.1875,-0.421875,14.8125,19.421875]},"56":{"id":56,"letter":"8","x":595,"y":67,"width":64,"height":64,"map":0,"xadvance":15.71875,"xoffset":24.1796875,"yoffset":22.515625,"scale":1,"range":8,"bounds":[0.3125,-0.484375,15.328125,19.453125]},"57":{"id":57,"letter":"9","x":661,"y":67,"width":64,"height":64,"map":0,"xadvance":18.078125,"xoffset":23.0078125,"yoffset":22.5625,"scale":1,"range":8,"bounds":[0.765625,-0.578125,17.21875,19.453125]},"58":{"id":58,"letter":":","x":727,"y":67,"width":64,"height":64,"map":0,"xadvance":7.96875,"xoffset":27.984375,"yoffset":25.2265625,"scale":1,"range":8,"bounds":[0.890625,-0.25,7.140625,13.796875]},"59":{"id":59,"letter":";","x":793,"y":67,"width":64,"height":64,"map":0,"xadvance":7.96875,"xoffset":28.8515625,"yoffset":27.1953125,"scale":1,"range":8,"bounds":[-0.84375,-4.1875,7.140625,13.796875]},"60":{"id":60,"letter":"<","x":859,"y":67,"width":64,"height":64,"map":0,"xadvance":12.828125,"xoffset":25.421875,"yoffset":23.0390625,"scale":1,"range":8,"bounds":[1.0625,0.96875,12.09375,16.953125]},"61":{"id":61,"letter":"=","x":925,"y":67,"width":64,"height":64,"map":0,"xadvance":15.421875,"xoffset":24.234375,"yoffset":22.375,"scale":1,"range":8,"bounds":[1.15625,4.625,14.375,14.625]},"62":{"id":62,"letter":">","x":1,"y":133,"width":64,"height":64,"map":0,"xadvance":12.828125,"xoffset":25.6875,"yoffset":22.9140625,"scale":1,"range":8,"bounds":[0.8125,1.09375,11.8125,17.078125]},"63":{"id":63,"letter":"?","x":67,"y":133,"width":64,"height":64,"map":0,"xadvance":13.5,"xoffset":25.234375,"yoffset":21.171875,"scale":1,"range":8,"bounds":[0.4375,-0.390625,13.09375,22.046875]},"64":{"id":64,"letter":"@","x":133,"y":133,"width":64,"height":64,"map":0,"xadvance":21.984375,"xoffset":21.25,"yoffset":21.0390625,"scale":1,"range":8,"bounds":[0.859375,-0.578125,20.640625,22.5]},"65":{"id":65,"letter":"A","x":199,"y":133,"width":64,"height":64,"map":0,"xadvance":22.203125,"xoffset":20.9296875,"yoffset":20.9140625,"scale":1,"range":8,"bounds":[0.09375,-0.125,22.046875,22.296875]},"66":{"id":66,"letter":"B","x":265,"y":133,"width":64,"height":64,"map":0,"xadvance":20.453125,"xoffset":21.359375,"yoffset":21.1015625,"scale":1,"range":8,"bounds":[1.375,-0.1875,19.90625,21.984375]},"67":{"id":67,"letter":"C","x":331,"y":133,"width":64,"height":64,"map":0,"xadvance":19.9375,"xoffset":21.7265625,"yoffset":21.0546875,"scale":1,"range":8,"bounds":[0.859375,-0.546875,19.6875,22.4375]},"68":{"id":68,"letter":"D","x":397,"y":133,"width":64,"height":64,"map":0,"xadvance":22.8125,"xoffset":20.3359375,"yoffset":21.0703125,"scale":1,"range":8,"bounds":[1.5,-0.09375,21.828125,21.953125]},"69":{"id":69,"letter":"E","x":463,"y":133,"width":64,"height":64,"map":0,"xadvance":18.078125,"xoffset":22.59375,"yoffset":21.15625,"scale":1,"range":8,"bounds":[1.375,-0.234375,17.4375,21.921875]},"70":{"id":70,"letter":"F","x":529,"y":133,"width":64,"height":64,"map":0,"xadvance":17.984375,"xoffset":22.5627441406,"yoffset":21.0390625,"scale":1,"range":8,"bounds":[1.29638671875,-0.21875,17.578125,22.140625]},"71":{"id":71,"letter":"G","x":595,"y":133,"width":64,"height":64,"map":0,"xadvance":22.75,"xoffset":20.5693359375,"yoffset":20.9765625,"scale":1,"range":8,"bounds":[0.859375,-0.390625,22.001953125,22.4375]},"72":{"id":72,"letter":"H","x":661,"y":133,"width":64,"height":64,"map":0,"xadvance":23.84375,"xoffset":20.078125,"yoffset":21.0859375,"scale":1,"range":8,"bounds":[1.4375,-0.09375,22.40625,21.921875]},"73":{"id":73,"letter":"I","x":727,"y":133,"width":64,"height":64,"map":0,"xadvance":9.53125,"xoffset":27.2578125,"yoffset":21.1015625,"scale":1,"range":8,"bounds":[1.34375,-0.125,8.140625,21.921875]},"74":{"id":74,"letter":"J","x":793,"y":133,"width":64,"height":64,"map":0,"xadvance":10.78125,"xoffset":27.3984375,"yoffset":22.9453125,"scale":1,"range":8,"bounds":[0.046875,-3.78125,9.15625,21.890625]},"75":{"id":75,"letter":"K","x":859,"y":133,"width":64,"height":64,"map":0,"xadvance":21.03125,"xoffset":20.9453125,"yoffset":21.1171875,"scale":1,"range":8,"bounds":[1.4375,-0.15625,20.671875,21.921875]},"76":{"id":76,"letter":"L","x":925,"y":133,"width":64,"height":64,"map":0,"xadvance":17.5,"xoffset":22.6484375,"yoffset":21.1796875,"scale":1,"range":8,"bounds":[1.546875,-0.265625,17.15625,21.90625]},"77":{"id":77,"letter":"M","x":1,"y":199,"width":64,"height":64,"map":0,"xadvance":26.203125,"xoffset":18.9140625,"yoffset":21.1171875,"scale":1,"range":8,"bounds":[1.4375,-0.3125,24.734375,22.078125]},"78":{"id":78,"letter":"N","x":67,"y":199,"width":64,"height":64,"map":0,"xadvance":23.8125,"xoffset":20.109375,"yoffset":20.9140625,"scale":1,"range":8,"bounds":[1.4375,-0.0625,22.34375,22.234375]},"79":{"id":79,"letter":"O","x":133,"y":199,"width":64,"height":64,"map":0,"xadvance":24.03125,"xoffset":20,"yoffset":21.0390625,"scale":1,"range":8,"bounds":[0.859375,-0.578125,23.140625,22.5]},"80":{"id":80,"letter":"P","x":199,"y":199,"width":64,"height":64,"map":0,"xadvance":20.859375,"xoffset":21.2587316176,"yoffset":21.09375,"scale":1,"range":8,"bounds":[1.32628676471,-0.109375,20.15625,21.921875]},"81":{"id":81,"letter":"Q","x":265,"y":199,"width":64,"height":64,"map":0,"xadvance":24.03125,"xoffset":20,"yoffset":22.703125,"scale":1,"range":8,"bounds":[0.859375,-3.90625,23.140625,22.5]},"82":{"id":82,"letter":"R","x":331,"y":199,"width":64,"height":64,"map":0,"xadvance":20.390625,"xoffset":21.25,"yoffset":21.0390625,"scale":1,"range":8,"bounds":[1.4375,-0.09375,20.0625,22.015625]},"83":{"id":83,"letter":"S","x":397,"y":199,"width":64,"height":64,"map":0,"xadvance":13.25,"xoffset":25.609375,"yoffset":21.1171875,"scale":1,"range":8,"bounds":[0.6875,-0.8125,12.09375,22.578125]},"84":{"id":84,"letter":"T","x":463,"y":199,"width":64,"height":64,"map":0,"xadvance":16.890625,"xoffset":23.5859375,"yoffset":21.0078125,"scale":1,"range":8,"bounds":[0.171875,-0.125,16.65625,22.109375]},"85":{"id":85,"letter":"U","x":529,"y":199,"width":64,"height":64,"map":0,"xadvance":21.734375,"xoffset":21.140625,"yoffset":21.25,"scale":1,"range":8,"bounds":[1.359375,-0.421875,20.359375,21.921875]},"86":{"id":86,"letter":"V","x":595,"y":199,"width":64,"height":64,"map":0,"xadvance":20.890625,"xoffset":21.515625,"yoffset":21.0703125,"scale":1,"range":8,"bounds":[0.953125,-0.0625,20.015625,21.921875]},"87":{"id":87,"letter":"W","x":661,"y":199,"width":64,"height":64,"map":0,"xadvance":30.046875,"xoffset":16.9453125,"yoffset":21.0859375,"scale":1,"range":8,"bounds":[0.921875,-0.09375,29.1875,21.921875]},"88":{"id":88,"letter":"X","x":727,"y":199,"width":64,"height":64,"map":0,"xadvance":19.71875,"xoffset":22.1796875,"yoffset":21.0625,"scale":1,"range":8,"bounds":[0.953125,-0.078125,18.6875,21.953125]},"89":{"id":89,"letter":"Y","x":793,"y":199,"width":64,"height":64,"map":0,"xadvance":19.875,"xoffset":22.078125,"yoffset":21.0859375,"scale":1,"range":8,"bounds":[0.484375,-0.09375,19.359375,21.921875]},"90":{"id":90,"letter":"Z","x":859,"y":199,"width":64,"height":64,"map":0,"xadvance":17.28125,"xoffset":23.3203125,"yoffset":21.0859375,"scale":1,"range":8,"bounds":[1,-0.25,16.359375,22.078125]},"91":{"id":91,"letter":"[","x":925,"y":199,"width":64,"height":64,"map":0,"xadvance":13.09375,"xoffset":24.734375,"yoffset":24,"scale":1,"range":8,"bounds":[2.015625,-6.078125,12.515625,22.078125]},"92":{"id":92,"letter":"\\","x":1,"y":265,"width":64,"height":64,"map":0,"xadvance":10.59375,"xoffset":26.734375,"yoffset":21.9765625,"scale":1,"range":8,"bounds":[0.625,-2,9.90625,22.046875]},"93":{"id":93,"letter":"]","x":67,"y":265,"width":64,"height":64,"map":0,"xadvance":13.09375,"xoffset":25.5234375,"yoffset":24.000390625,"scale":1,"range":8,"bounds":[1.234375,-6.07890625,11.71875,22.078125]},"94":{"id":94,"letter":"^","x":133,"y":265,"width":64,"height":64,"map":0,"xadvance":16.671875,"xoffset":23.5703125,"yoffset":17.46875,"scale":1,"range":8,"bounds":[0.703125,8.671875,16.15625,20.390625]},"95":{"id":95,"letter":"_","x":199,"y":265,"width":64,"height":64,"map":0,"xadvance":14.75,"xoffset":24.7109375,"yoffset":36.2578125,"scale":1,"range":8,"bounds":[-0.3125,-6.5,14.890625,-2.015625]},"96":{"id":96,"letter":"`","x":265,"y":265,"width":64,"height":64,"map":0,"xadvance":11.84375,"xoffset":26.453125,"yoffset":11.875,"scale":1,"range":8,"bounds":[0.828125,16.921875,10.265625,23.328125]},"97":{"id":97,"letter":"a","x":331,"y":265,"width":64,"height":64,"map":0,"xadvance":18.8125,"xoffset":22.875,"yoffset":24.421875,"scale":1,"range":8,"bounds":[0.671875,-0.359375,17.578125,15.515625]},"98":{"id":98,"letter":"b","x":397,"y":265,"width":64,"height":64,"map":0,"xadvance":18.84375,"xoffset":22.359375,"yoffset":20.859375,"scale":1,"range":8,"bounds":[1.015625,-0.1875,18.265625,22.46875]},"99":{"id":99,"letter":"c","x":463,"y":265,"width":64,"height":64,"map":0,"xadvance":13.3125,"xoffset":25.21875,"yoffset":24.3046875,"scale":1,"range":8,"bounds":[0.578125,-0.390625,12.984375,15.78125]},"100":{"id":100,"letter":"d","x":529,"y":265,"width":64,"height":64,"map":0,"xadvance":18.875,"xoffset":22.75,"yoffset":20.8125,"scale":1,"range":8,"bounds":[0.609375,-0.1875,17.890625,22.5625]},"101":{"id":101,"letter":"e","x":595,"y":265,"width":64,"height":64,"map":0,"xadvance":16.03125,"xoffset":23.859375,"yoffset":24.2890625,"scale":1,"range":8,"bounds":[0.640625,-0.453125,15.640625,15.875]},"102":{"id":102,"letter":"f","x":661,"y":265,"width":64,"height":64,"map":0,"xadvance":11.296875,"xoffset":26.34375,"yoffset":20.578125,"scale":1,"range":8,"bounds":[0.375,-0.09375,10.9375,22.9375]},"103":{"id":103,"letter":"g","x":727,"y":265,"width":64,"height":64,"map":0,"xadvance":18.265625,"xoffset":23.2109375,"yoffset":26.3984375,"scale":1,"range":8,"bounds":[0.578125,-4.3125,17,15.515625]},"104":{"id":104,"letter":"h","x":793,"y":265,"width":64,"height":64,"map":0,"xadvance":18.140625,"xoffset":23,"yoffset":20.921875,"scale":1,"range":8,"bounds":[1.078125,-0.125,16.921875,22.28125]},"105":{"id":105,"letter":"i","x":859,"y":265,"width":64,"height":64,"map":0,"xadvance":8.796875,"xoffset":27.6015625,"yoffset":21.296875,"scale":1,"range":8,"bounds":[1.28125,-0.09375,7.515625,21.5]},"106":{"id":106,"letter":"j","x":925,"y":265,"width":64,"height":64,"map":0,"xadvance":8.890625,"xoffset":28.4296875,"yoffset":23.296875,"scale":1,"range":8,"bounds":[-0.46875,-4.1875,7.609375,21.59375]},"107":{"id":107,"letter":"k","x":1,"y":331,"width":64,"height":64,"map":0,"xadvance":19.234375,"xoffset":21.984375,"yoffset":20.84375,"scale":1,"range":8,"bounds":[1.34375,-0.09375,18.6875,22.40625]},"108":{"id":108,"letter":"l","x":67,"y":331,"width":64,"height":64,"map":0,"xadvance":8.546875,"xoffset":27.7332175926,"yoffset":21.0859375,"scale":1,"range":8,"bounds":[1.09375,-0.125,7.43981481481,21.953125]},"109":{"id":109,"letter":"m","x":133,"y":331,"width":64,"height":64,"map":0,"xadvance":27.9375,"xoffset":18.2734375,"yoffset":24.2890625,"scale":1,"range":8,"bounds":[1.15625,-0.09375,26.296875,15.515625]},"110":{"id":110,"letter":"n","x":199,"y":331,"width":64,"height":64,"map":0,"xadvance":18.140625,"xoffset":23.109375,"yoffset":24.3203125,"scale":1,"range":8,"bounds":[0.921875,-0.09375,16.859375,15.453125]},"111":{"id":111,"letter":"o","x":265,"y":331,"width":64,"height":64,"map":0,"xadvance":16.921875,"xoffset":23.53125,"yoffset":24.3359375,"scale":1,"range":8,"bounds":[0.578125,-0.3125,16.359375,15.640625]},"112":{"id":112,"letter":"p","x":331,"y":331,"width":64,"height":64,"map":0,"xadvance":19.265625,"xoffset":22.078125,"yoffset":26.7734375,"scale":1,"range":8,"bounds":[1.28125,-4.90625,18.5625,15.359375]},"113":{"id":113,"letter":"q","x":397,"y":331,"width":64,"height":64,"map":0,"xadvance":18.9375,"xoffset":22.9140625,"yoffset":26.5703125,"scale":1,"range":8,"bounds":[0.609375,-4.890625,17.5625,15.75]},"114":{"id":114,"letter":"r","x":463,"y":331,"width":64,"height":64,"map":0,"xadvance":12.1875,"xoffset":25.6484375,"yoffset":24.3359375,"scale":1,"range":8,"bounds":[0.859375,-0.09375,11.84375,15.421875]},"115":{"id":115,"letter":"s","x":529,"y":331,"width":64,"height":64,"map":0,"xadvance":11.390625,"xoffset":26.4375,"yoffset":24.1484375,"scale":1,"range":8,"bounds":[0.65625,-0.578125,10.46875,16.28125]},"116":{"id":116,"letter":"t","x":595,"y":331,"width":64,"height":64,"map":0,"xadvance":12.09375,"xoffset":25.953125,"yoffset":22.0078125,"scale":1,"range":8,"bounds":[0.3125,-0.28125,11.78125,20.265625]},"117":{"id":117,"letter":"u","x":661,"y":331,"width":64,"height":64,"map":0,"xadvance":18.65625,"xoffset":22.65625,"yoffset":24.640625,"scale":1,"range":8,"bounds":[1.28125,-0.15625,17.40625,14.875]},"118":{"id":118,"letter":"v","x":727,"y":331,"width":64,"height":64,"map":0,"xadvance":17.15625,"xoffset":23.4375,"yoffset":24.625,"scale":1,"range":8,"bounds":[0.765625,-0.125,16.359375,14.875]},"119":{"id":119,"letter":"w","x":793,"y":331,"width":64,"height":64,"map":0,"xadvance":24.21875,"xoffset":19.8828125,"yoffset":24.59375,"scale":1,"range":8,"bounds":[0.484375,-0.09375,23.75,14.90625]},"120":{"id":120,"letter":"x","x":859,"y":331,"width":64,"height":64,"map":0,"xadvance":15.640625,"xoffset":24.15625,"yoffset":24.625,"scale":1,"range":8,"bounds":[0.578125,-0.125,15.109375,14.875]},"121":{"id":121,"letter":"y","x":925,"y":331,"width":64,"height":64,"map":0,"xadvance":17.21875,"xoffset":23.296875,"yoffset":27.171875,"scale":1,"range":8,"bounds":[0.734375,-5.21875,16.671875,14.875]},"122":{"id":122,"letter":"z","x":1,"y":397,"width":64,"height":64,"map":0,"xadvance":14.96875,"xoffset":24.1875,"yoffset":24.5625,"scale":1,"range":8,"bounds":[0.859375,-0.203125,14.765625,15.078125]},"123":{"id":123,"letter":"{","x":67,"y":397,"width":64,"height":64,"map":0,"xadvance":12.515625,"xoffset":25.8515625,"yoffset":23.96875,"scale":1,"range":8,"bounds":[0.953125,-6.5,11.34375,22.5625]},"124":{"id":124,"letter":"|","x":133,"y":397,"width":64,"height":64,"map":0,"xadvance":9.953125,"xoffset":27.0854166667,"yoffset":21.9765625,"scale":1,"range":8,"bounds":[2.90625,-2.1875,6.92291666667,22.234375]},"125":{"id":125,"letter":"}","x":199,"y":397,"width":64,"height":64,"map":0,"xadvance":12.515625,"xoffset":25.640625,"yoffset":23.96875,"scale":1,"range":8,"bounds":[1.171875,-6.5,11.546875,22.5625]},"126":{"id":126,"letter":"~","x":265,"y":397,"width":64,"height":64,"map":0,"xadvance":17.28125,"xoffset":23.265625,"yoffset":22.28125,"scale":1,"range":8,"bounds":[0.171875,5.484375,17.296875,13.953125]}},"kerning":{}},"type":"font","file":{"filename":"BRLNSDB.png","hash":"64c1f05f77830228af9c5fa580768cf1","size":369767,"url":"files/assets/79465530/1/BRLNSDB.png"},"region":"eu-west-1","i18n":{},"immutable_backup":"1fc2d350-45b1-4d28-93db-c0853a7b7eed","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"79465530"},"79465795":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"GetHeightFromURLParams.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"getHeightFromUrlparams":{"attributesOrder":[],"attributes":{}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":7745,"hash":"26438be64e4843173ea5ffa5a1fc2300","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"e70bc0ed-cdb7-4cd5-9c0c-839bcacd499a","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"79465795"},"79469394":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"showHeightAndWidth.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"showHeightAndWidth":{"attributesOrder":["width","height","hideInterval","baseScale"],"attributes":{"width":{"type":"entity"},"height":{"type":"entity"},"hideInterval":{"type":"number"},"baseScale":{"type":"number"}}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":7745,"hash":"26438be64e4843173ea5ffa5a1fc2300","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"ae45f8a7-fce5-4343-8d3c-6304ad9cf6a6","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"79469394"},"80679924":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"wood","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":0},"data":{"shader":"blinn","ambient":[0,0,0],"diffuse":[0.3803921568627451,0.15294117647058825,0.06274509803921569],"diffuseMap":null,"diffuseMapOffset":[0,0],"diffuseMapTiling":[1,1],"specular":[0.145366,0.0976329,0.0411764],"shininess":42.2169,"glossMap":null,"glossMapOffset":[0,0],"glossMapTiling":[1,1],"emissive":[0,0,0],"normalMap":null,"normalMapOffset":[0,0],"normalMapTiling":[1,1],"bumpMapFactor":1,"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMapChannel":"rgb","diffuseMapUv":0,"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMapChannel":"r","glossMapUv":0,"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMapUv":0,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"80679924"},"80679925":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"lamp","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":1},"data":{"shader":"blinn","ambient":[0,0,0],"diffuse":[0.8,0.8,0.8],"specular":[0.2,0.2,0.2],"shininess":42.2169,"emissive":[0.8196078431372549,0.8745098039215686,0.5450980392156862],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":2.08,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"80679925"},"80679926":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"shelfLamp.glb","revision":1,"preload":true,"region":"eu-west-1","meta":null,"data":{},"type":"container","file":{"hash":"a9484a51794190cd74aa3b3d81da87e2","size":23156,"filename":"shelfLamp.glb","url":"files/assets/80679926/1/shelfLamp.glb"},"i18n":{},"immutable_backup":"27dd1ec2-80e7-4999-97da-1411c62e3b9a","same_as_backup":1,"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"80679926"},"80679927":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Cube.075","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":24,"triangles":12,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80679926,"renderIndex":0},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"80679927"},"80679928":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Cube.076","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":24,"triangles":12,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80679926,"renderIndex":1},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"80679928"},"80679929":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Cube.077","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":24,"triangles":12,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80679926,"renderIndex":2},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"80679929"},"80679930":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Cube.078","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":24,"triangles":12,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80679926,"renderIndex":3},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"80679930"},"80679931":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Cube.079","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":72,"triangles":44,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80679926,"renderIndex":4},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"80679931"},"80679932":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Cube.081","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":72,"triangles":44,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80679926,"renderIndex":6},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"80679932"},"80679933":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Cube.080","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":72,"triangles":44,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80679926,"renderIndex":5},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"80679933"},"80679934":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Cube.082","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":72,"triangles":44,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80679926,"renderIndex":7},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"80679934"},"80679935":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Cube.001","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":56,"triangles":28,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80679926,"renderIndex":8},"type":"render","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"80679935"},"80679936":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"shelfLamp","revision":1,"preload":true,"region":"eu-west-1","meta":{"containerAsset":80679926},"data":{"entities":{"2f98331a-f416-4fba-ab37-a9552ed8909a":{"enabled":true,"tags":[],"children":["d8ddbdd6-c9a5-455c-be0b-e69eb330ea37","24992962-3f33-4690-82dd-d86e478bbc37","c96a4fa9-1092-42b8-b3e7-7991457b8f13","7cf96d6d-2951-4852-9aa9-703033d78cf2","2851c034-273d-4931-8fe9-be3f6b2ea7d7","c1117206-78cf-4fee-8122-241344d3e7b0","a5040658-5d95-43a8-8b51-8927fbaebae5","bc406cfc-db95-4b46-8526-8b85d1858c76","1e6539fd-d4f6-4810-af40-98bf5679a9ea"],"position":[0,0,0],"rotation":[0,0,0],"scale":[0.01,0.01,0.01],"resource_id":"2f98331a-f416-4fba-ab37-a9552ed8909a","name":"RootNode","components":{},"parent":null},"d8ddbdd6-c9a5-455c-be0b-e69eb330ea37":{"enabled":true,"tags":[],"children":[],"position":[2.05715,75.0536,36.0618],"rotation":[-90,0,0],"scale":[20,20,750],"resource_id":"d8ddbdd6-c9a5-455c-be0b-e69eb330ea37","name":"leg 1.001","components":{"render":{"enabled":true,"type":"asset","asset":80679927,"materialAssets":[80679924],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"2f98331a-f416-4fba-ab37-a9552ed8909a"},"24992962-3f33-4690-82dd-d86e478bbc37":{"enabled":true,"tags":[],"children":[],"position":[36.0572,75.0536,36.0618],"rotation":[-90,0,0],"scale":[20,20,750],"resource_id":"24992962-3f33-4690-82dd-d86e478bbc37","name":"leg 2.001","components":{"render":{"enabled":true,"type":"asset","asset":80679928,"materialAssets":[80679924],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"2f98331a-f416-4fba-ab37-a9552ed8909a"},"c96a4fa9-1092-42b8-b3e7-7991457b8f13":{"enabled":true,"tags":[],"children":[],"position":[2.05715,75.0536,2.06183],"rotation":[-90,0,0],"scale":[20,20,750],"resource_id":"c96a4fa9-1092-42b8-b3e7-7991457b8f13","name":"leg 3.001","components":{"render":{"enabled":true,"type":"asset","asset":80679929,"materialAssets":[80679924],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"2f98331a-f416-4fba-ab37-a9552ed8909a"},"7cf96d6d-2951-4852-9aa9-703033d78cf2":{"enabled":true,"tags":[],"children":[],"position":[36.0572,75.0536,2.06183],"rotation":[-90,0,0],"scale":[20,20,750],"resource_id":"7cf96d6d-2951-4852-9aa9-703033d78cf2","name":"leg 4.001","components":{"render":{"enabled":true,"type":"asset","asset":80679930,"materialAssets":[80679924],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"2f98331a-f416-4fba-ab37-a9552ed8909a"},"2851c034-273d-4931-8fe9-be3f6b2ea7d7":{"enabled":true,"tags":[],"children":[],"position":[19.0571,9.05356,19.0618],"rotation":[-90,0,0],"scale":[190,190,10],"resource_id":"2851c034-273d-4931-8fe9-be3f6b2ea7d7","name":"shelf","components":{"render":{"enabled":true,"type":"asset","asset":80679931,"materialAssets":[80679924],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"2f98331a-f416-4fba-ab37-a9552ed8909a"},"c1117206-78cf-4fee-8122-241344d3e7b0":{"enabled":true,"tags":[],"children":[],"position":[19.0571,39.0536,19.0618],"rotation":[-90,0,0],"scale":[190,190,10],"resource_id":"c1117206-78cf-4fee-8122-241344d3e7b0","name":"shelf.001","components":{"render":{"enabled":true,"type":"asset","asset":80679933,"materialAssets":[80679924],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"2f98331a-f416-4fba-ab37-a9552ed8909a"},"a5040658-5d95-43a8-8b51-8927fbaebae5":{"enabled":true,"tags":[],"children":[],"position":[19.0571,69.0536,19.0618],"rotation":[-90,0,0],"scale":[190,190,10],"resource_id":"a5040658-5d95-43a8-8b51-8927fbaebae5","name":"shelf.002","components":{"render":{"enabled":true,"type":"asset","asset":80679932,"materialAssets":[80679924],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"2f98331a-f416-4fba-ab37-a9552ed8909a"},"bc406cfc-db95-4b46-8526-8b85d1858c76":{"enabled":true,"tags":[],"children":[],"position":[19.0571,99.0536,19.0618],"rotation":[-90,0,0],"scale":[190,190,10],"resource_id":"bc406cfc-db95-4b46-8526-8b85d1858c76","name":"shelf.003","components":{"render":{"enabled":true,"type":"asset","asset":80679934,"materialAssets":[80679924],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"2f98331a-f416-4fba-ab37-a9552ed8909a"},"1e6539fd-d4f6-4810-af40-98bf5679a9ea":{"enabled":true,"tags":[],"children":[],"position":[19.0571,120.054,19.0618],"rotation":[-90,0,0],"scale":[150,150,200],"resource_id":"1e6539fd-d4f6-4810-af40-98bf5679a9ea","name":"lamp","components":{"render":{"enabled":true,"type":"asset","asset":80679935,"materialAssets":[80679925],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"2f98331a-f416-4fba-ab37-a9552ed8909a"}}},"type":"template","file":null,"i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"80679936"},"80683536":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"New Material","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[1,1,1],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissive":[0,0,0],"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacity":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"checkpoint_id":"1f8adaa6-d132-4540-a035-6d950102e6b8","id":"80683536"},"80896512":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"teahub.io-desktop-wallpaper-hd-3d-372445.jpg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":3840,"height":2160,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"teahub.io-desktop-wallpaper-hd-3d-372445.jpg","size":1372708,"hash":"f48f51f1665d566ed96110aac1a32191","variants":{},"url":"files/assets/80896512/1/teahub.io-desktop-wallpaper-hd-3d-372445.jpg"},"region":"eu-west-1","i18n":{},"id":"80896512"},"80896591":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"AbstractPainting","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[1,1,1],"diffuseMap":80896512,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissive":[0,0,0],"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacity":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"id":"80896591"},"80896683":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"BlackFrame","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[0,0,0],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissive":[0,0,0],"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacity":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"id":"80896683"},"80901073":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Apt_Furniture_01.glb","revision":1,"preload":true,"region":"eu-west-1","meta":null,"data":{},"type":"container","file":{"hash":"200765e99dc3f8f266a1c0ac44cf4733","size":1902416,"filename":"Apt_Furniture_01.glb","url":"files/assets/80901073/1/Apt_Furniture_01.glb"},"i18n":{},"id":"80901073"},"80901074":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.010","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":284,"triangles":316,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":0},"type":"render","file":null,"i18n":{},"id":"80901074"},"80901075":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.011","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":568,"triangles":288,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":2},"type":"render","file":null,"i18n":{},"id":"80901075"},"80901076":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.012","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":288,"triangles":158,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":1},"type":"render","file":null,"i18n":{},"id":"80901076"},"80901077":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.012","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":640,"triangles":312,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":3},"type":"render","file":null,"i18n":{},"id":"80901077"},"80901078":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.016","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":2368,"triangles":1154,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":4},"type":"render","file":null,"i18n":{},"id":"80901078"},"80901079":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.017","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1248,"triangles":636,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":5},"type":"render","file":null,"i18n":{},"id":"80901079"},"80901080":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.020","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":24,"triangles":12,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":6},"type":"render","file":null,"i18n":{},"id":"80901080"},"80901081":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.015","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":280,"triangles":134,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":7},"type":"render","file":null,"i18n":{},"id":"80901081"},"80901082":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.018","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":404,"triangles":198,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":8},"type":"render","file":null,"i18n":{},"id":"80901082"},"80901083":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.032","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":88,"triangles":42,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":9},"type":"render","file":null,"i18n":{},"id":"80901083"},"80901084":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.031","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":404,"triangles":198,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":10},"type":"render","file":null,"i18n":{},"id":"80901084"},"80901085":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.033","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":88,"triangles":42,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":11},"type":"render","file":null,"i18n":{},"id":"80901085"},"80901086":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.034","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1248,"triangles":636,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":12},"type":"render","file":null,"i18n":{},"id":"80901086"},"80901087":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.016","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":280,"triangles":134,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":13},"type":"render","file":null,"i18n":{},"id":"80901087"},"80901088":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.026","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":22,"triangles":12,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":14},"type":"render","file":null,"i18n":{},"id":"80901088"},"80901089":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.035","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":420,"triangles":210,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":15},"type":"render","file":null,"i18n":{},"id":"80901089"},"80901090":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.027","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":4,"triangles":2,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":16},"type":"render","file":null,"i18n":{},"id":"80901090"},"80901091":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.029","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":240,"triangles":120,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":17},"type":"render","file":null,"i18n":{},"id":"80901091"},"80901092":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.036","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":200,"triangles":92,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":18},"type":"render","file":null,"i18n":{},"id":"80901092"},"80901093":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.037","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1750,"triangles":872,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":19},"type":"render","file":null,"i18n":{},"id":"80901093"},"80901094":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.017","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1376,"triangles":700,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":20},"type":"render","file":null,"i18n":{},"id":"80901094"},"80901095":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.031","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":770,"triangles":776,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":21},"type":"render","file":null,"i18n":{},"id":"80901095"},"80901096":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.038","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":556,"triangles":276,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":22},"type":"render","file":null,"i18n":{},"id":"80901096"},"80901097":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.041","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":384,"triangles":176,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":23},"type":"render","file":null,"i18n":{},"id":"80901097"},"80901098":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.043","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":600,"triangles":300,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":24},"type":"render","file":null,"i18n":{},"id":"80901098"},"80901099":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.018","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":336,"triangles":168,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":25},"type":"render","file":null,"i18n":{},"id":"80901099"},"80901100":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.042","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":552,"triangles":276,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":26},"type":"render","file":null,"i18n":{},"id":"80901100"},"80901101":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.044","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":600,"triangles":300,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":27},"type":"render","file":null,"i18n":{},"id":"80901101"},"80901102":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.045","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":2044,"triangles":972,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":28},"type":"render","file":null,"i18n":{},"id":"80901102"},"80901103":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.047","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":240,"triangles":114,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":29},"type":"render","file":null,"i18n":{},"id":"80901103"},"80901104":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.019","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":720,"triangles":366,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":30},"type":"render","file":null,"i18n":{},"id":"80901104"},"80901105":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.048","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":624,"triangles":288,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":31},"type":"render","file":null,"i18n":{},"id":"80901105"},"80901106":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.049","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":384,"triangles":176,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":32},"type":"render","file":null,"i18n":{},"id":"80901106"},"80901107":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.050","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1456,"triangles":672,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":33},"type":"render","file":null,"i18n":{},"id":"80901107"},"80901108":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.020","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":416,"triangles":216,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":34},"type":"render","file":null,"i18n":{},"id":"80901108"},"80901109":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.061","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":24,"triangles":12,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":35},"type":"render","file":null,"i18n":{},"id":"80901109"},"80901110":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.021","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1920,"triangles":944,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":36},"type":"render","file":null,"i18n":{},"id":"80901110"},"80901111":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.022","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":2928,"triangles":1510,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":37},"type":"render","file":null,"i18n":{},"id":"80901111"},"80901112":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.023","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":608,"triangles":316,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":38},"type":"render","file":null,"i18n":{},"id":"80901112"},"80901113":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.024","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":144,"triangles":78,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":39},"type":"render","file":null,"i18n":{},"id":"80901113"},"80901114":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.025","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":864,"triangles":444,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":40},"type":"render","file":null,"i18n":{},"id":"80901114"},"80901115":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.026","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":608,"triangles":316,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":41},"type":"render","file":null,"i18n":{},"id":"80901115"},"80901116":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.027","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":144,"triangles":78,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":42},"type":"render","file":null,"i18n":{},"id":"80901116"},"80901117":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.028","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":864,"triangles":444,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":43},"type":"render","file":null,"i18n":{},"id":"80901117"},"80901118":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.029","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":608,"triangles":316,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":44},"type":"render","file":null,"i18n":{},"id":"80901118"},"80901119":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.036","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":144,"triangles":78,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":45},"type":"render","file":null,"i18n":{},"id":"80901119"},"80901120":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.040","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":864,"triangles":444,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":46},"type":"render","file":null,"i18n":{},"id":"80901120"},"80901121":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.051","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":512,"triangles":240,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":47},"type":"render","file":null,"i18n":{},"id":"80901121"},"80901122":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.067","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":24,"triangles":12,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":48},"type":"render","file":null,"i18n":{},"id":"80901122"},"80901123":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.053","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":4148,"triangles":1916,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":49},"type":"render","file":null,"i18n":{},"id":"80901123"},"80901124":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.052","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":96,"triangles":44,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":50},"type":"render","file":null,"i18n":{},"id":"80901124"},"80901125":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.054","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":96,"triangles":44,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":51},"type":"render","file":null,"i18n":{},"id":"80901125"},"80901126":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.167","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":3040,"triangles":4352,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":52},"type":"render","file":null,"i18n":{},"id":"80901126"},"80901127":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.055","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":864,"triangles":432,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":53},"type":"render","file":null,"i18n":{},"id":"80901127"},"80901128":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.059","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":832,"triangles":384,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":54},"type":"render","file":null,"i18n":{},"id":"80901128"},"80901129":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.056","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":392,"triangles":180,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":55},"type":"render","file":null,"i18n":{},"id":"80901129"},"80901130":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.057","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":200,"triangles":92,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":56},"type":"render","file":null,"i18n":{},"id":"80901130"},"80901131":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.060","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":64,"triangles":30,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":57},"type":"render","file":null,"i18n":{},"id":"80901131"},"80901132":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.062","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":916,"triangles":448,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":58},"type":"render","file":null,"i18n":{},"id":"80901132"},"80901133":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.042","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":2944,"triangles":1520,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":59},"type":"render","file":null,"i18n":{},"id":"80901133"},"80901134":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.043","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":592,"triangles":272,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":60},"type":"render","file":null,"i18n":{},"id":"80901134"},"80901135":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.044","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":200,"triangles":92,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":61},"type":"render","file":null,"i18n":{},"id":"80901135"},"80901136":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.058","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":144,"triangles":68,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":62},"type":"render","file":null,"i18n":{},"id":"80901136"},"80901137":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.045","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":200,"triangles":92,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":63},"type":"render","file":null,"i18n":{},"id":"80901137"},"80901138":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.059","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":144,"triangles":68,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":64},"type":"render","file":null,"i18n":{},"id":"80901138"},"80901139":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.050","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":200,"triangles":92,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":65},"type":"render","file":null,"i18n":{},"id":"80901139"},"80901140":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.054","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":144,"triangles":68,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":66},"type":"render","file":null,"i18n":{},"id":"80901140"},"80901141":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.060","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":528,"triangles":256,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":67},"type":"render","file":null,"i18n":{},"id":"80901141"},"80901142":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.062","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":416,"triangles":222,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":68},"type":"render","file":null,"i18n":{},"id":"80901142"},"80901143":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.061","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":576,"triangles":316,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":69},"type":"render","file":null,"i18n":{},"id":"80901143"},"80901144":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.008","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":24,"triangles":12,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":70},"type":"render","file":null,"i18n":{},"id":"80901144"},"80901145":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Circle.064","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1184,"triangles":604,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":71},"type":"render","file":null,"i18n":{},"id":"80901145"},"80901146":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.063","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1152,"triangles":528,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":72},"type":"render","file":null,"i18n":{},"id":"80901146"},"80901147":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.064","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":216,"triangles":108,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":73},"type":"render","file":null,"i18n":{},"id":"80901147"},"80901148":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane.065","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":480,"triangles":220,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":80901073,"renderIndex":74},"type":"render","file":null,"i18n":{},"id":"80901148"},"80901149":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Apt_Furniture_01","revision":1,"preload":true,"region":"eu-west-1","meta":{"containerAsset":80901073},"data":{"entities":{"822f5dc8-53ba-4044-b40a-ad6cd166437f":{"enabled":true,"tags":[],"children":["338bd52b-a2f6-42de-bf8b-52fe3de7e179","839c3672-62f2-4511-b1f2-f4ab2af9f4c2","b3d32185-01fc-4b15-95c1-4ecd52e0294a","5d15a1a2-f7cd-4a57-986f-4f008d76e2cf","1c4f7ce5-e910-455b-bd5e-8467a5e1df57","c51f1b53-cda0-48b6-ba0c-d6321f55bcdd","d30d9440-da09-45d6-b682-c37bfe2dd14a","bd601a02-6551-416a-a740-4d12955a891c","eaba8cfb-4902-4a3d-9f69-a1c3fb381fa9","ee1a3c07-0c5f-4221-bd99-ab036871aa98","e55b0112-6b47-4d32-a83e-be36db426d05","38df4006-0b7a-46bd-b4bd-10f8b47119f2","4aa1522b-ec5e-49c3-ba92-896f61fda63d","9433823b-85be-4a39-b240-feba83d2c90c","abe67550-6b78-417b-a7a2-eafbbc743997","b61f87ee-5892-421a-99f2-42c9069341f6","09ffffd8-29e1-427b-9351-a882029d9274","5b35bf87-de7b-44ae-8d00-6ea37130a152","9b30f32e-d431-4b5d-ad41-9c18e9421f3a","1e3969e9-8224-4a5a-b5a8-b10b7fbfa194","001c6978-45d7-46e0-9d70-65f55141ccc4","09a1895d-542e-43e7-85de-48dacaf55d9b","47da6ac3-f30e-4429-95a8-74d02dcb2713","f18906a3-7e3a-4997-b64b-628333b8e776"],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"822f5dc8-53ba-4044-b40a-ad6cd166437f","name":"RootNode","components":{},"parent":null},"338bd52b-a2f6-42de-bf8b-52fe3de7e179":{"enabled":true,"tags":[],"children":["bb75b8cf-bc5d-41d3-9397-2cf9a2afbc55"],"position":[-0.162169,7.15256e-7,7.76014],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"338bd52b-a2f6-42de-bf8b-52fe3de7e179","name":"Table_Apt_01","components":{"render":{"enabled":true,"type":"asset","asset":80901074,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"bb75b8cf-bc5d-41d3-9397-2cf9a2afbc55":{"enabled":true,"tags":[],"children":[],"position":[4.76837e-7,2.38419e-7,-4.76837e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"bb75b8cf-bc5d-41d3-9397-2cf9a2afbc55","name":"Table Top","components":{"render":{"enabled":true,"type":"asset","asset":80901076,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"338bd52b-a2f6-42de-bf8b-52fe3de7e179"},"839c3672-62f2-4511-b1f2-f4ab2af9f4c2":{"enabled":true,"tags":[],"children":["da569564-4cbd-4cdb-8909-364bedaddc37"],"position":[1.01744,-0.000638247,7.88769],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"839c3672-62f2-4511-b1f2-f4ab2af9f4c2","name":"Chair_Apt_01","components":{"render":{"enabled":true,"type":"asset","asset":80901075,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"da569564-4cbd-4cdb-8909-364bedaddc37":{"enabled":true,"tags":[],"children":[],"position":[0,2.38437e-7,4.76837e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"da569564-4cbd-4cdb-8909-364bedaddc37","name":"Legs Chair","components":{"render":{"enabled":true,"type":"asset","asset":80901077,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"839c3672-62f2-4511-b1f2-f4ab2af9f4c2"},"b3d32185-01fc-4b15-95c1-4ecd52e0294a":{"enabled":true,"tags":[],"children":["50a77350-fe85-46c3-a2fb-9e21842e4f61","0639e112-c6c2-4f53-88e5-bd862a09099e","d45f4566-8dad-4bac-998d-de7ddf327ba4","12dff73c-1236-4ff1-950d-b2a6cedb2192"],"position":[-0.189795,-0.00101233,-1.02702],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"b3d32185-01fc-4b15-95c1-4ecd52e0294a","name":"MediaTable_01","components":{"render":{"enabled":true,"type":"asset","asset":80901078,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"50a77350-fe85-46c3-a2fb-9e21842e4f61":{"enabled":true,"tags":[],"children":["477e175d-7f2a-41ee-9b8e-47d79cece154","f7b007c3-643d-46e6-92fe-29102a9abbb7"],"position":[-0.431799,0.411594,-1.27608],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"50a77350-fe85-46c3-a2fb-9e21842e4f61","name":"Door.L.001","components":{"render":{"enabled":true,"type":"asset","asset":80901079,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"b3d32185-01fc-4b15-95c1-4ecd52e0294a"},"477e175d-7f2a-41ee-9b8e-47d79cece154":{"enabled":true,"tags":[],"children":[],"position":[0.0156746,7.1816e-9,0.422001],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"477e175d-7f2a-41ee-9b8e-47d79cece154","name":"Glass","components":{"render":{"enabled":true,"type":"asset","asset":80901080,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"50a77350-fe85-46c3-a2fb-9e21842e4f61"},"f7b007c3-643d-46e6-92fe-29102a9abbb7":{"enabled":true,"tags":[],"children":[],"position":[-0.0098722,2.43353e-8,0.814431],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"f7b007c3-643d-46e6-92fe-29102a9abbb7","name":"Knob.004","components":{"render":{"enabled":true,"type":"asset","asset":80901081,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"50a77350-fe85-46c3-a2fb-9e21842e4f61"},"0639e112-c6c2-4f53-88e5-bd862a09099e":{"enabled":true,"tags":[],"children":["03438cd4-6bc6-450a-9978-e2a08d05f2ab"],"position":[-0.433271,0.373799,2.38419e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"0639e112-c6c2-4f53-88e5-bd862a09099e","name":"Drawer_01.001","components":{"render":{"enabled":true,"type":"asset","asset":80901082,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"b3d32185-01fc-4b15-95c1-4ecd52e0294a"},"03438cd4-6bc6-450a-9978-e2a08d05f2ab":{"enabled":true,"tags":[],"children":[],"position":[0,0.0503578,-4.76837e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"03438cd4-6bc6-450a-9978-e2a08d05f2ab","name":"Handle.001","components":{"render":{"enabled":true,"type":"asset","asset":80901083,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"0639e112-c6c2-4f53-88e5-bd862a09099e"},"d45f4566-8dad-4bac-998d-de7ddf327ba4":{"enabled":true,"tags":[],"children":["dc03387b-81dc-44e0-b6e0-ba2d516f252f"],"position":[-0.433271,0.163137,-2.38419e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"d45f4566-8dad-4bac-998d-de7ddf327ba4","name":"Drawer_02.001","components":{"render":{"enabled":true,"type":"asset","asset":80901084,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"b3d32185-01fc-4b15-95c1-4ecd52e0294a"},"dc03387b-81dc-44e0-b6e0-ba2d516f252f":{"enabled":true,"tags":[],"children":[],"position":[0,0.0503578,-4.76837e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"dc03387b-81dc-44e0-b6e0-ba2d516f252f","name":"Handle.002","components":{"render":{"enabled":true,"type":"asset","asset":80901085,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"d45f4566-8dad-4bac-998d-de7ddf327ba4"},"12dff73c-1236-4ff1-950d-b2a6cedb2192":{"enabled":true,"tags":[],"children":["49b744f9-be83-4f22-9f75-904dcee5cd5e","dc35a58d-1836-400c-8b50-db2faf37e3af"],"position":[-0.431799,0.411593,1.27608],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"12dff73c-1236-4ff1-950d-b2a6cedb2192","name":"Door.R.001","components":{"render":{"enabled":true,"type":"asset","asset":80901086,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"b3d32185-01fc-4b15-95c1-4ecd52e0294a"},"49b744f9-be83-4f22-9f75-904dcee5cd5e":{"enabled":true,"tags":[],"children":[],"position":[-0.0098722,-2.4713e-8,-0.814432],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"49b744f9-be83-4f22-9f75-904dcee5cd5e","name":"Knob.001","components":{"render":{"enabled":true,"type":"asset","asset":80901087,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"12dff73c-1236-4ff1-950d-b2a6cedb2192"},"dc35a58d-1836-400c-8b50-db2faf37e3af":{"enabled":true,"tags":[],"children":[],"position":[0.0156746,-7.5593e-9,-0.422],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"dc35a58d-1836-400c-8b50-db2faf37e3af","name":"Glass.001","components":{"render":{"enabled":true,"type":"asset","asset":80901088,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"12dff73c-1236-4ff1-950d-b2a6cedb2192"},"5d15a1a2-f7cd-4a57-986f-4f008d76e2cf":{"enabled":true,"tags":[],"children":["eb1b0ace-1641-4461-9f95-6d7ba7c48949","549a5dca-b381-4f6b-8d50-523720570de8"],"position":[0.245534,1.7729,-1.07056],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"5d15a1a2-f7cd-4a57-986f-4f008d76e2cf","name":"TV_Apt_01","components":{"render":{"enabled":true,"type":"asset","asset":80901089,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"eb1b0ace-1641-4461-9f95-6d7ba7c48949":{"enabled":true,"tags":[],"children":[],"position":[-0.0422344,9.06879e-7,-1.19209e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"eb1b0ace-1641-4461-9f95-6d7ba7c48949","name":"Screen","components":{"render":{"enabled":true,"type":"asset","asset":80901090,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"5d15a1a2-f7cd-4a57-986f-4f008d76e2cf"},"549a5dca-b381-4f6b-8d50-523720570de8":{"enabled":true,"tags":[],"children":[],"position":[0.0455265,-4.67956e-8,-1.19209e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"549a5dca-b381-4f6b-8d50-523720570de8","name":"Mount","components":{"render":{"enabled":true,"type":"asset","asset":80901091,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"5d15a1a2-f7cd-4a57-986f-4f008d76e2cf"},"1c4f7ce5-e910-455b-bd5e-8467a5e1df57":{"enabled":true,"tags":[],"children":[],"position":[0.277431,3.14655,-1.75637],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"1c4f7ce5-e910-455b-bd5e-8467a5e1df57","name":"WallShelf_Apt_01","components":{"render":{"enabled":true,"type":"asset","asset":80901092,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"c51f1b53-cda0-48b6-ba0c-d6321f55bcdd":{"enabled":true,"tags":[],"children":[],"position":[-0.280342,0,-3.91486],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"c51f1b53-cda0-48b6-ba0c-d6321f55bcdd","name":"Shelf_Apt_01","components":{"render":{"enabled":true,"type":"asset","asset":80901093,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"d30d9440-da09-45d6-b682-c37bfe2dd14a":{"enabled":true,"tags":[],"children":["0d692efe-1397-4c2b-b908-5b605c559dff"],"position":[-0.334039,2.1779,-3.91486],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"d30d9440-da09-45d6-b682-c37bfe2dd14a","name":"Vase_Apt_01","components":{"render":{"enabled":true,"type":"asset","asset":80901094,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"0d692efe-1397-4c2b-b908-5b605c559dff":{"enabled":true,"tags":[],"children":[],"position":[0.0165925,0.0244001,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"0d692efe-1397-4c2b-b908-5b605c559dff","name":"Plastic Flower","components":{"render":{"enabled":true,"type":"asset","asset":80901095,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"d30d9440-da09-45d6-b682-c37bfe2dd14a"},"bd601a02-6551-416a-a740-4d12955a891c":{"enabled":true,"tags":[],"children":["03f5cd73-5a3b-44cb-9b7b-1f9c6df460eb","146e0679-341f-45e7-a408-82a3bb658c7c"],"position":[-0.421535,0.480203,-1.02702],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"bd601a02-6551-416a-a740-4d12955a891c","name":"SS_01","components":{"render":{"enabled":true,"type":"asset","asset":80901096,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"03f5cd73-5a3b-44cb-9b7b-1f9c6df460eb":{"enabled":true,"tags":[],"children":[],"position":[0,1.47123e-8,-2.38419e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"03f5cd73-5a3b-44cb-9b7b-1f9c6df460eb","name":"Feet","components":{"render":{"enabled":true,"type":"asset","asset":80901097,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"bd601a02-6551-416a-a740-4d12955a891c"},"146e0679-341f-45e7-a408-82a3bb658c7c":{"enabled":true,"tags":[],"children":[],"position":[0,1.47123e-8,-2.38419e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"146e0679-341f-45e7-a408-82a3bb658c7c","name":"Fabric","components":{"render":{"enabled":true,"type":"asset","asset":80901098,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"bd601a02-6551-416a-a740-4d12955a891c"},"eaba8cfb-4902-4a3d-9f69-a1c3fb381fa9":{"enabled":true,"tags":[],"children":["f2bce001-6ff5-4a6d-b792-279dcf1e1915"],"position":[0.132616,-0.00101256,1.76616],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"eaba8cfb-4902-4a3d-9f69-a1c3fb381fa9","name":"SS_Stand_01","components":{"render":{"enabled":true,"type":"asset","asset":80901099,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"f2bce001-6ff5-4a6d-b792-279dcf1e1915":{"enabled":true,"tags":[],"children":["57850126-9d95-4b9a-9ad1-5fce4d1569b2"],"position":[-0.00078249,1.33675,-5.96046e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"f2bce001-6ff5-4a6d-b792-279dcf1e1915","name":"SS_02","components":{"render":{"enabled":true,"type":"asset","asset":80901100,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"eaba8cfb-4902-4a3d-9f69-a1c3fb381fa9"},"57850126-9d95-4b9a-9ad1-5fce4d1569b2":{"enabled":true,"tags":[],"children":[],"position":[0,-4.2008e-8,2.38419e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"57850126-9d95-4b9a-9ad1-5fce4d1569b2","name":"Fabric.001","components":{"render":{"enabled":true,"type":"asset","asset":80901101,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"f2bce001-6ff5-4a6d-b792-279dcf1e1915"},"ee1a3c07-0c5f-4221-bd99-ab036871aa98":{"enabled":true,"tags":[],"children":["9d90e8bf-5dfc-4014-aa00-6512a57df38a"],"position":[-0.370188,-0.0010128,-6.10933],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"ee1a3c07-0c5f-4221-bd99-ab036871aa98","name":"BarCabinet_Apt_01","components":{"render":{"enabled":true,"type":"asset","asset":80901102,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"9d90e8bf-5dfc-4014-aa00-6512a57df38a":{"enabled":true,"tags":[],"children":["f46a51c2-8d1b-4062-a5b2-3b3691c1591a"],"position":[-0.323143,1.34984,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"9d90e8bf-5dfc-4014-aa00-6512a57df38a","name":"BarDrawer","components":{"render":{"enabled":true,"type":"asset","asset":80901103,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"ee1a3c07-0c5f-4221-bd99-ab036871aa98"},"f46a51c2-8d1b-4062-a5b2-3b3691c1591a":{"enabled":true,"tags":[],"children":[],"position":[0,-2.86287e-8,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"f46a51c2-8d1b-4062-a5b2-3b3691c1591a","name":"Knob.002","components":{"render":{"enabled":true,"type":"asset","asset":80901104,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"9d90e8bf-5dfc-4014-aa00-6512a57df38a"},"e55b0112-6b47-4d32-a83e-be36db426d05":{"enabled":true,"tags":[],"children":["9713ca82-4f59-4aa5-bc9b-810c05eaa3ce","8c459bfc-d378-4f72-b395-adaf6a5831f1"],"position":[-0.0638549,2.14632,-6.17385],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"e55b0112-6b47-4d32-a83e-be36db426d05","name":"Wall Wine Rack_Apt_01","components":{"render":{"enabled":true,"type":"asset","asset":80901105,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"9713ca82-4f59-4aa5-bc9b-810c05eaa3ce":{"enabled":true,"tags":[],"children":[],"position":[0,2.0697e-7,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"9713ca82-4f59-4aa5-bc9b-810c05eaa3ce","name":"WineArt","components":{"render":{"enabled":true,"type":"asset","asset":80901106,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"e55b0112-6b47-4d32-a83e-be36db426d05"},"8c459bfc-d378-4f72-b395-adaf6a5831f1":{"enabled":true,"tags":[],"children":[],"position":[-0.0792939,0.68252,0.478048],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"8c459bfc-d378-4f72-b395-adaf6a5831f1","name":"Holder","components":{"render":{"enabled":true,"type":"asset","asset":80901107,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"e55b0112-6b47-4d32-a83e-be36db426d05"},"38df4006-0b7a-46bd-b4bd-10f8b47119f2":{"enabled":true,"tags":[],"children":["bb11a9ef-dfa7-4138-aa4c-8628d7dcd37a","a21a6c4c-fb9d-40cb-9409-3743c58928ad"],"position":[-0.415298,1.5528,-6.11221],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"38df4006-0b7a-46bd-b4bd-10f8b47119f2","name":"MirrorPlate_Glass","components":{"render":{"enabled":true,"type":"asset","asset":80901108,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"bb11a9ef-dfa7-4138-aa4c-8628d7dcd37a":{"enabled":true,"tags":[],"children":[],"position":[-2.98023e-8,2.09664e-7,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"bb11a9ef-dfa7-4138-aa4c-8628d7dcd37a","name":"MirrorPlate","components":{"render":{"enabled":true,"type":"asset","asset":80901109,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"38df4006-0b7a-46bd-b4bd-10f8b47119f2"},"a21a6c4c-fb9d-40cb-9409-3743c58928ad":{"enabled":true,"tags":[],"children":[],"position":[0,2.09664e-7,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"a21a6c4c-fb9d-40cb-9409-3743c58928ad","name":"Elbow","components":{"render":{"enabled":true,"type":"asset","asset":80901110,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"38df4006-0b7a-46bd-b4bd-10f8b47119f2"},"4aa1522b-ec5e-49c3-ba92-896f61fda63d":{"enabled":true,"tags":[],"children":["9f876abb-6a34-4fcf-acc5-6d7fb8690362","d1fca74e-2de2-44d5-8a98-127c05c8cb8f","154c5e44-2514-4ce2-9f34-74baee97ffe1"],"position":[0.12547,3.8934,1.03536],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"4aa1522b-ec5e-49c3-ba92-896f61fda63d","name":"Lamp_Apt_01","components":{"render":{"enabled":true,"type":"asset","asset":80901111,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"9f876abb-6a34-4fcf-acc5-6d7fb8690362":{"enabled":true,"tags":[],"children":["88f8fb98-40e9-4e60-92c4-0b80cf88f8ea"],"position":[-0.23112,-0.227014,0.00351596],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"9f876abb-6a34-4fcf-acc5-6d7fb8690362","name":"Glass.003","components":{"render":{"enabled":true,"type":"asset","asset":80901112,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"4aa1522b-ec5e-49c3-ba92-896f61fda63d"},"88f8fb98-40e9-4e60-92c4-0b80cf88f8ea":{"enabled":true,"tags":[],"children":["37a43e6b-9ca2-496d-9767-810dd59fa980"],"position":[0,0.002914,4.76837e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"88f8fb98-40e9-4e60-92c4-0b80cf88f8ea","name":"BulbBase","components":{"render":{"enabled":true,"type":"asset","asset":80901113,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"9f876abb-6a34-4fcf-acc5-6d7fb8690362"},"37a43e6b-9ca2-496d-9767-810dd59fa980":{"enabled":true,"tags":[],"children":[],"position":[-2.38419e-7,-0.0778269,4.76837e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"37a43e6b-9ca2-496d-9767-810dd59fa980","name":"Bulb","components":{"render":{"enabled":true,"type":"asset","asset":80901114,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"88f8fb98-40e9-4e60-92c4-0b80cf88f8ea"},"d1fca74e-2de2-44d5-8a98-127c05c8cb8f":{"enabled":true,"tags":[],"children":["7d45ccac-4dbe-407a-818e-3e9dcdd22520"],"position":[0.123119,-0.378064,-0.196344],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"d1fca74e-2de2-44d5-8a98-127c05c8cb8f","name":"Glass.004","components":{"render":{"enabled":true,"type":"asset","asset":80901115,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"4aa1522b-ec5e-49c3-ba92-896f61fda63d"},"7d45ccac-4dbe-407a-818e-3e9dcdd22520":{"enabled":true,"tags":[],"children":["776bfefc-5ae5-4b00-89c4-f2f69a65e3ed"],"position":[0,0.00291447,4.76837e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"7d45ccac-4dbe-407a-818e-3e9dcdd22520","name":"BulbBase.001","components":{"render":{"enabled":true,"type":"asset","asset":80901116,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"d1fca74e-2de2-44d5-8a98-127c05c8cb8f"},"776bfefc-5ae5-4b00-89c4-f2f69a65e3ed":{"enabled":true,"tags":[],"children":[],"position":[-2.38419e-7,-0.0778274,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"776bfefc-5ae5-4b00-89c4-f2f69a65e3ed","name":"Bulb.001","components":{"render":{"enabled":true,"type":"asset","asset":80901117,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"7d45ccac-4dbe-407a-818e-3e9dcdd22520"},"154c5e44-2514-4ce2-9f34-74baee97ffe1":{"enabled":true,"tags":[],"children":["a7494ae9-03fe-44e2-ab2d-2ee5a2bbb92a"],"position":[0.12379,-0.559335,0.199886],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"154c5e44-2514-4ce2-9f34-74baee97ffe1","name":"Glass.005","components":{"render":{"enabled":true,"type":"asset","asset":80901118,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"4aa1522b-ec5e-49c3-ba92-896f61fda63d"},"a7494ae9-03fe-44e2-ab2d-2ee5a2bbb92a":{"enabled":true,"tags":[],"children":["6dc30efb-70c0-403c-a029-336f35961270"],"position":[0,0.00291448,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"a7494ae9-03fe-44e2-ab2d-2ee5a2bbb92a","name":"BulbBase.002","components":{"render":{"enabled":true,"type":"asset","asset":80901119,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"154c5e44-2514-4ce2-9f34-74baee97ffe1"},"6dc30efb-70c0-403c-a029-336f35961270":{"enabled":true,"tags":[],"children":[],"position":[-2.38419e-7,-0.0778274,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"6dc30efb-70c0-403c-a029-336f35961270","name":"Bulb.002","components":{"render":{"enabled":true,"type":"asset","asset":80901120,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"a7494ae9-03fe-44e2-ab2d-2ee5a2bbb92a"},"9433823b-85be-4a39-b240-feba83d2c90c":{"enabled":true,"tags":[],"children":["db1eaac3-eeda-4d7e-a493-1397a8522fce"],"position":[-0.0370805,-0.00101256,0.913527],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"9433823b-85be-4a39-b240-feba83d2c90c","name":"Lamp_Floor_01","components":{"render":{"enabled":true,"type":"asset","asset":80901121,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"db1eaac3-eeda-4d7e-a493-1397a8522fce":{"enabled":true,"tags":[],"children":[],"position":[1.49012e-8,2.17624,-2.38419e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"db1eaac3-eeda-4d7e-a493-1397a8522fce","name":"Glow.002","components":{"render":{"enabled":true,"type":"asset","asset":80901122,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"9433823b-85be-4a39-b240-feba83d2c90c"},"abe67550-6b78-417b-a7a2-eafbbc743997":{"enabled":true,"tags":[],"children":["4c0dda32-bd65-4696-ac4a-e63339a0423e","5c196002-661e-44dc-bc8f-149ae68950a8"],"position":[-0.289215,9.53674e-7,10.8742],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"abe67550-6b78-417b-a7a2-eafbbc743997","name":"Bench_Apt_01","components":{"render":{"enabled":true,"type":"asset","asset":80901123,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"4c0dda32-bd65-4696-ac4a-e63339a0423e":{"enabled":true,"tags":[],"children":[],"position":[0.344695,0.751946,-0.747669],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"4c0dda32-bd65-4696-ac4a-e63339a0423e","name":"Door.L.002","components":{"render":{"enabled":true,"type":"asset","asset":80901124,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"abe67550-6b78-417b-a7a2-eafbbc743997"},"5c196002-661e-44dc-bc8f-149ae68950a8":{"enabled":true,"tags":[],"children":[],"position":[0.344695,0.751946,0.747669],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"5c196002-661e-44dc-bc8f-149ae68950a8","name":"Door.R.002","components":{"render":{"enabled":true,"type":"asset","asset":80901125,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"abe67550-6b78-417b-a7a2-eafbbc743997"},"b61f87ee-5892-421a-99f2-42c9069341f6":{"enabled":true,"tags":[],"children":["51fab529-d2a7-4f3b-a4be-e8ceba0462fa"],"position":[-0.114658,4.76837e-7,4.82657],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"b61f87ee-5892-421a-99f2-42c9069341f6","name":"Sofa_Apt_01","components":{"render":{"enabled":true,"type":"asset","asset":80901126,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"51fab529-d2a7-4f3b-a4be-e8ceba0462fa":{"enabled":true,"tags":[],"children":[],"position":[5.96046e-8,1.42109e-14,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"51fab529-d2a7-4f3b-a4be-e8ceba0462fa","name":"feet","components":{"render":{"enabled":true,"type":"asset","asset":80901127,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"b61f87ee-5892-421a-99f2-42c9069341f6"},"09ffffd8-29e1-427b-9351-a882029d9274":{"enabled":true,"tags":[],"children":["69e70553-c577-4c2d-a43b-698ec28ed97d"],"position":[-0.240763,4.76837e-7,2.50322],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"09ffffd8-29e1-427b-9351-a882029d9274","name":"Table_Side_Apt_01","components":{"render":{"enabled":true,"type":"asset","asset":80901128,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"69e70553-c577-4c2d-a43b-698ec28ed97d":{"enabled":true,"tags":[],"children":["5ab2cedd-50c4-4bad-afc9-501da54b64e2"],"position":[0,1.42109e-14,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"69e70553-c577-4c2d-a43b-698ec28ed97d","name":"Table","components":{"render":{"enabled":true,"type":"asset","asset":80901129,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"09ffffd8-29e1-427b-9351-a882029d9274"},"5ab2cedd-50c4-4bad-afc9-501da54b64e2":{"enabled":true,"tags":[],"children":["397ab891-54ea-4bf7-90d4-a74fb824d891"],"position":[-0.309411,0.634836,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"5ab2cedd-50c4-4bad-afc9-501da54b64e2","name":"Drawer.001","components":{"render":{"enabled":true,"type":"asset","asset":80901130,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"69e70553-c577-4c2d-a43b-698ec28ed97d"},"397ab891-54ea-4bf7-90d4-a74fb824d891":{"enabled":true,"tags":[],"children":[],"position":[-0.00766277,-9.7899e-9,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"397ab891-54ea-4bf7-90d4-a74fb824d891","name":"Handle.005","components":{"render":{"enabled":true,"type":"asset","asset":80901131,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"5ab2cedd-50c4-4bad-afc9-501da54b64e2"},"5b35bf87-de7b-44ae-8d00-6ea37130a152":{"enabled":true,"tags":[],"children":["284c22da-792e-406b-a60a-0c5cd4d8da51"],"position":[0.127256,2.84462,10.8742],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"5b35bf87-de7b-44ae-8d00-6ea37130a152","name":"WallShelf_Apt_02","components":{"render":{"enabled":true,"type":"asset","asset":80901132,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"284c22da-792e-406b-a60a-0c5cd4d8da51":{"enabled":true,"tags":[],"children":[],"position":[-0.0701228,-0.242698,9.53674e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"284c22da-792e-406b-a60a-0c5cd4d8da51","name":"Hook","components":{"render":{"enabled":true,"type":"asset","asset":80901133,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"5b35bf87-de7b-44ae-8d00-6ea37130a152"},"9b30f32e-d431-4b5d-ad41-9c18e9421f3a":{"enabled":true,"tags":[],"children":["3cde92d0-5dff-40f2-a3a9-77138b9b9c77","2a6d0d32-0fdd-4444-b0eb-5b7b76e42663","bf5e0099-b3ba-4710-87d0-cd7f3f871f42","5335fb89-bc5e-4007-8c5d-4f28fc6b8f24"],"position":[-0.312675,0.00000286102,14.9362],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"9b30f32e-d431-4b5d-ad41-9c18e9421f3a","name":"ComputerTable_Apt_01","components":{"render":{"enabled":true,"type":"asset","asset":80901134,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"3cde92d0-5dff-40f2-a3a9-77138b9b9c77":{"enabled":true,"tags":[],"children":["6fd2e3e5-a95f-4993-93c6-ea59b10b2cdf"],"position":[-0.624033,0.734103,-0.937548],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"3cde92d0-5dff-40f2-a3a9-77138b9b9c77","name":"Drawer_01","components":{"render":{"enabled":true,"type":"asset","asset":80901135,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"9b30f32e-d431-4b5d-ad41-9c18e9421f3a"},"6fd2e3e5-a95f-4993-93c6-ea59b10b2cdf":{"enabled":true,"tags":[],"children":[],"position":[0,0.135898,-0.00000190735],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"6fd2e3e5-a95f-4993-93c6-ea59b10b2cdf","name":"Handle.003","components":{"render":{"enabled":true,"type":"asset","asset":80901136,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"3cde92d0-5dff-40f2-a3a9-77138b9b9c77"},"2a6d0d32-0fdd-4444-b0eb-5b7b76e42663":{"enabled":true,"tags":[],"children":["010d2d12-9d00-47d4-95d1-192e9996bc11"],"position":[-0.624033,0.870001,0.937548],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"2a6d0d32-0fdd-4444-b0eb-5b7b76e42663","name":"Drawer_02","components":{"render":{"enabled":true,"type":"asset","asset":80901137,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"9b30f32e-d431-4b5d-ad41-9c18e9421f3a"},"010d2d12-9d00-47d4-95d1-192e9996bc11":{"enabled":true,"tags":[],"children":[],"position":[0,-2.13919e-8,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"010d2d12-9d00-47d4-95d1-192e9996bc11","name":"Handle.004","components":{"render":{"enabled":true,"type":"asset","asset":80901138,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"2a6d0d32-0fdd-4444-b0eb-5b7b76e42663"},"bf5e0099-b3ba-4710-87d0-cd7f3f871f42":{"enabled":true,"tags":[],"children":["fd9725f2-5df1-4804-80fb-95787dbb1184"],"position":[-0.624033,0.598205,0.937548],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"bf5e0099-b3ba-4710-87d0-cd7f3f871f42","name":"Drawer_03","components":{"render":{"enabled":true,"type":"asset","asset":80901139,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"9b30f32e-d431-4b5d-ad41-9c18e9421f3a"},"fd9725f2-5df1-4804-80fb-95787dbb1184":{"enabled":true,"tags":[],"children":[],"position":[0,-2.13919e-8,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"fd9725f2-5df1-4804-80fb-95787dbb1184","name":"Handle","components":{"render":{"enabled":true,"type":"asset","asset":80901140,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"bf5e0099-b3ba-4710-87d0-cd7f3f871f42"},"5335fb89-bc5e-4007-8c5d-4f28fc6b8f24":{"enabled":true,"tags":[],"children":[],"position":[0,4.76837e-7,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"5335fb89-bc5e-4007-8c5d-4f28fc6b8f24","name":"MetalBar","components":{"render":{"enabled":true,"type":"asset","asset":80901141,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"9b30f32e-d431-4b5d-ad41-9c18e9421f3a"},"1e3969e9-8224-4a5a-b5a8-b10b7fbfa194":{"enabled":true,"tags":[],"children":["f3fc4719-5d34-4d6e-b8cf-cb75b67aaad4"],"position":[0.12547,3.8934,2.75656],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"1e3969e9-8224-4a5a-b5a8-b10b7fbfa194","name":"Lamp_Apt_03","components":{"render":{"enabled":true,"type":"asset","asset":80901142,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"f3fc4719-5d34-4d6e-b8cf-cb75b67aaad4":{"enabled":true,"tags":[],"children":[],"position":[0,-1.17926e-7,2.38419e-7],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"f3fc4719-5d34-4d6e-b8cf-cb75b67aaad4","name":"Glow.001","components":{"render":{"enabled":true,"type":"asset","asset":80901143,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"1e3969e9-8224-4a5a-b5a8-b10b7fbfa194"},"001c6978-45d7-46e0-9d70-65f55141ccc4":{"enabled":true,"tags":[],"children":[],"position":[-3.15547,4.76837e-7,0.202325],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"001c6978-45d7-46e0-9d70-65f55141ccc4","name":"Carpet","components":{"render":{"enabled":true,"type":"asset","asset":80901144,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"09a1895d-542e-43e7-85de-48dacaf55d9b":{"enabled":true,"tags":[],"children":["db25fd53-4a53-4ac2-961c-4cee46c93043"],"position":[-2.82971,4.76837e-7,4.82657],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"09a1895d-542e-43e7-85de-48dacaf55d9b","name":"Coffee_Table_Apt_01","components":{"render":{"enabled":true,"type":"asset","asset":80901145,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"db25fd53-4a53-4ac2-961c-4cee46c93043":{"enabled":true,"tags":[],"children":[],"position":[0,0.476482,-0.419532],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"db25fd53-4a53-4ac2-961c-4cee46c93043","name":"WoodBars","components":{"render":{"enabled":true,"type":"asset","asset":80901146,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"09a1895d-542e-43e7-85de-48dacaf55d9b"},"47da6ac3-f30e-4429-95a8-74d02dcb2713":{"enabled":true,"tags":[],"children":[],"position":[0.277431,2.31297,8.37136],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"47da6ac3-f30e-4429-95a8-74d02dcb2713","name":"Canvas_Painting_01","components":{"render":{"enabled":true,"type":"asset","asset":80901147,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"},"f18906a3-7e3a-4997-b64b-628333b8e776":{"enabled":true,"tags":[],"children":[],"position":[0.277431,2.31297,4.81633],"rotation":[0.00000250448,0,0],"scale":[1,1,1],"resource_id":"f18906a3-7e3a-4997-b64b-628333b8e776","name":"Plane.003","components":{"render":{"enabled":true,"type":"asset","asset":80901148,"materialAssets":[null],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"822f5dc8-53ba-4044-b40a-ad6cd166437f"}}},"type":"template","file":null,"i18n":{},"id":"80901149"},"80904628":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Pattern_02.png","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"png","type":"Bilevel","width":2048,"height":2048,"alpha":true,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"Pattern_02.png","size":573803,"hash":"3d842093aa9dc06e90e2bfa8660e990d","variants":{},"url":"files/assets/80904628/1/Pattern_02.png"},"region":"eu-west-1","i18n":{},"id":"80904628"},"80904631":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Painting","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[1,1,1],"diffuseMap":80904628,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissive":[0,0,0],"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacity":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"id":"80904631"},"80909898":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"AddlerDarkWood","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[0.8941176470588236,0.6509803921568628,0.403921568627451],"diffuseMap":80909930,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissive":[0,0,0],"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacity":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":true,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"id":"80909898"},"80909930":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"AdlerWood_01_A.png","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"png","type":"Bilevel","width":2048,"height":2048,"alpha":true,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"AdlerWood_01_A.png","size":7210176,"hash":"a86a48c40f8fbddbc2a05fd66a550f47","variants":{},"url":"files/assets/80909930/1/AdlerWood_01_A.png"},"region":"eu-west-1","i18n":{},"id":"80909930"},"80914320":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Leather_A.png","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"png","type":"Bilevel","width":2048,"height":2048,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"Leather_A.png","size":2076534,"hash":"dee46b38f83f456df454fb3618886460","variants":{},"url":"files/assets/80914320/1/Leather_A.png"},"region":"eu-west-1","i18n":{},"id":"80914320"},"80914323":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Leather","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":80914320,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[0.8470588235294118,0.7764705882352941,0.6313725490196078],"diffuseMap":80914320,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissive":[0,0,0],"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":80914327,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":80914379,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacity":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":true,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"id":"80914323"},"80914327":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Leather_N.png","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":true,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"png","type":"Bilevel","width":2048,"height":2048,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"Leather_N.png","size":1967312,"hash":"96851c1912063975f4196561f6f9474e","variants":{},"url":"files/assets/80914327/1/Leather_N.png"},"region":"eu-west-1","i18n":{},"id":"80914327"},"80914379":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Leather_H.png","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"png","type":"Bilevel","width":2048,"height":2048,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"Leather_H.png","size":1589116,"hash":"58875597dc9abcc09977b734b8d324a2","variants":{},"url":"files/assets/80914379/1/Leather_H.png"},"region":"eu-west-1","i18n":{},"id":"80914379"},"80914525":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Rug_A.png","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"png","type":"Bilevel","width":2048,"height":2048,"alpha":true,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"Rug_A.png","size":1336005,"hash":"d9fc10241f0ff45e784604183d022c1f","variants":{},"url":"files/assets/80914525/1/Rug_A.png"},"region":"eu-west-1","i18n":{},"id":"80914525"},"80914526":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Rug_N.png","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"png","type":"Bilevel","width":2048,"height":2048,"alpha":true,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"Rug_N.png","size":10647747,"hash":"7051f7fb5490df353794142090ca2af3","variants":{},"url":"files/assets/80914526/1/Rug_N.png"},"region":"eu-west-1","i18n":{},"id":"80914526"},"80914528":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Rug","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":80914525,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[1,1,1],"diffuseMap":80914525,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissive":[0,0,0],"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":80914526,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacity":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"id":"80914528"},"80915301":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"SuitMAT","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":0},"data":{"shader":"blinn","ambient":[0,0,0],"diffuse":[0.4,0.4,0.4],"specular":[0,0,0],"shininess":0,"emissive":[0,0,0],"normalMap":null,"normalMapOffset":[0,0],"normalMapTiling":[1,1],"bumpMapFactor":1,"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":80915351,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMapUv":0,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"id":"80915301"},"80915302":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"HeadF_MAT","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":1},"data":{"shader":"blinn","ambient":[0,0,0],"diffuse":[0.8,0.8,0.8],"diffuseMap":80915363,"diffuseMapOffset":[0,0],"diffuseMapTiling":[1,1],"specular":[0.5,0.5,0.5],"shininess":24.1641,"emissive":[0,0,0],"normalMap":null,"normalMapOffset":[0,0],"normalMapTiling":[1,1],"bumpMapFactor":1,"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMapChannel":"rgb","diffuseMapUv":0,"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMapUv":0,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"id":"80915302"},"80915303":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"BlueSuitFree01.glb","revision":1,"preload":true,"region":"eu-west-1","meta":null,"data":{},"type":"container","file":{"hash":"74a408bb9a43950ad8883b9995c7a3a1","size":282244,"filename":"BlueSuitFree01.glb","url":"files/assets/80915303/1/BlueSuitFree01.glb"},"i18n":{},"id":"80915303"},"80915304":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"SuitGEO01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":true,"vertices":2930,"triangles":4957,"attributes":{"POSITION":1,"NORMAL":1,"BONEINDICES":1,"BONEWEIGHTS":1,"TEXCOORD_0":1}},"data":{"containerAsset":80915303,"renderIndex":0},"type":"render","file":null,"i18n":{},"id":"80915304"},"80915305":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"HeadF","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":true,"vertices":1293,"triangles":2394,"attributes":{"POSITION":1,"NORMAL":1,"BONEINDICES":1,"BONEWEIGHTS":1,"TEXCOORD_0":1}},"data":{"containerAsset":80915303,"renderIndex":1},"type":"render","file":null,"i18n":{},"id":"80915305"},"80915306":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"BlueSuitFree01","revision":1,"preload":true,"region":"eu-west-1","meta":{"containerAsset":80915303},"data":{"entities":{"349f823f-3e44-4162-9ed4-1ec84e75483e":{"enabled":true,"tags":[],"children":["25304268-5782-46b4-8096-5a1f035ab0d0","2cb48962-5b67-4b71-b0b2-afa8d9db58c1"],"position":[0,0,0],"rotation":[0,0,0],"scale":[0.01,0.01,0.01],"resource_id":"349f823f-3e44-4162-9ed4-1ec84e75483e","name":"RootNode","components":{},"parent":null},"25304268-5782-46b4-8096-5a1f035ab0d0":{"enabled":true,"tags":[],"children":["246d9b13-1098-45a7-8efc-e4049fd311a3"],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"25304268-5782-46b4-8096-5a1f035ab0d0","name":"Group","components":{},"parent":"349f823f-3e44-4162-9ed4-1ec84e75483e"},"246d9b13-1098-45a7-8efc-e4049fd311a3":{"enabled":true,"tags":[],"children":["bc364d92-e370-47d9-b20d-98c792aabe97"],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"246d9b13-1098-45a7-8efc-e4049fd311a3","name":"Main","components":{},"parent":"25304268-5782-46b4-8096-5a1f035ab0d0"},"bc364d92-e370-47d9-b20d-98c792aabe97":{"enabled":true,"tags":[],"children":["0eaf1817-47cf-4320-aec4-ec4b5d4890ac"],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"bc364d92-e370-47d9-b20d-98c792aabe97","name":"DeformationSystem","components":{},"parent":"246d9b13-1098-45a7-8efc-e4049fd311a3"},"0eaf1817-47cf-4320-aec4-ec4b5d4890ac":{"enabled":true,"tags":[],"children":["9d5cddc3-0168-44c2-8497-2f1d7c82fdaf","6779d20e-ffd2-477d-80b7-425c0475f1d5","5ad7ed93-07f3-4e3d-8792-fe9e33ed134b"],"position":[-3.44673e-14,95.3786,-1.71933],"rotation":[90,-2.06823,90],"scale":[1,1,1],"resource_id":"0eaf1817-47cf-4320-aec4-ec4b5d4890ac","name":"Root_M","components":{},"parent":"bc364d92-e370-47d9-b20d-98c792aabe97"},"9d5cddc3-0168-44c2-8497-2f1d7c82fdaf":{"enabled":true,"tags":[],"children":["f0f0f0a5-b770-47ca-84c3-6171f02026c4"],"position":[-2.04778,-0.445829,-9.98721],"rotation":[-178.09,6.36596,178.487],"scale":[1,1,1],"resource_id":"9d5cddc3-0168-44c2-8497-2f1d7c82fdaf","name":"Hip_R","components":{},"parent":"0eaf1817-47cf-4320-aec4-ec4b5d4890ac"},"f0f0f0a5-b770-47ca-84c3-6171f02026c4":{"enabled":true,"tags":[],"children":["66a06794-d1eb-420c-8966-d33c47f62243"],"position":[44.9641,2.22045e-15,-6.39488e-14],"rotation":[0,0,-9.83765],"scale":[1,1,1],"resource_id":"f0f0f0a5-b770-47ca-84c3-6171f02026c4","name":"Knee_R","components":{},"parent":"9d5cddc3-0168-44c2-8497-2f1d7c82fdaf"},"66a06794-d1eb-420c-8966-d33c47f62243":{"enabled":true,"tags":[],"children":["4b69f146-6d36-445d-8cf1-b30df1714d26"],"position":[39.9237,1.06581e-14,-7.10543e-14],"rotation":[1.70759,6.38072,10.1826],"scale":[1,1,1],"resource_id":"66a06794-d1eb-420c-8966-d33c47f62243","name":"Ankle_R","components":{},"parent":"f0f0f0a5-b770-47ca-84c3-6171f02026c4"},"4b69f146-6d36-445d-8cf1-b30df1714d26":{"enabled":true,"tags":[],"children":["185884e8-8d7f-4d73-ac4e-1e91a6ba694f"],"position":[7.95222,15.2582,9.23706e-14],"rotation":[-4.68637,1.48242,86.1308],"scale":[1,1,1],"resource_id":"4b69f146-6d36-445d-8cf1-b30df1714d26","name":"Toes_R","components":{},"parent":"66a06794-d1eb-420c-8966-d33c47f62243"},"185884e8-8d7f-4d73-ac4e-1e91a6ba694f":{"enabled":true,"tags":[],"children":[],"position":[6.08362,-1.21014e-14,-3.55271e-14],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"185884e8-8d7f-4d73-ac4e-1e91a6ba694f","name":"ToesEnd_R","components":{},"parent":"4b69f146-6d36-445d-8cf1-b30df1714d26"},"6779d20e-ffd2-477d-80b7-425c0475f1d5":{"enabled":true,"tags":[],"children":["69dafd9b-5183-4dec-97b8-f2290ad74a88"],"position":[17.1229,7.99361e-15,-1.819e-14],"rotation":[0,0,-8.40716],"scale":[1,1,1],"resource_id":"6779d20e-ffd2-477d-80b7-425c0475f1d5","name":"Spine1_M","components":{},"parent":"0eaf1817-47cf-4320-aec4-ec4b5d4890ac"},"69dafd9b-5183-4dec-97b8-f2290ad74a88":{"enabled":true,"tags":[],"children":["5c4b614b-ca99-45d1-9ffd-01ba4dca482d"],"position":[4.57661,-3.01981e-14,-3.85972e-15],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"69dafd9b-5183-4dec-97b8-f2290ad74a88","name":"Spine1Part1_M","components":{},"parent":"6779d20e-ffd2-477d-80b7-425c0475f1d5"},"5c4b614b-ca99-45d1-9ffd-01ba4dca482d":{"enabled":true,"tags":[],"children":["154ec305-b964-4a07-bcf7-75787b883c55"],"position":[4.57661,-3.37508e-14,-4.87593e-15],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"5c4b614b-ca99-45d1-9ffd-01ba4dca482d","name":"Spine1Part2_M","components":{},"parent":"69dafd9b-5183-4dec-97b8-f2290ad74a88"},"154ec305-b964-4a07-bcf7-75787b883c55":{"enabled":true,"tags":[],"children":["2a2b3e82-d0b1-429b-9ac0-a428b9b95d26","a2cbe25c-d987-45d8-afb7-fa723c9e4f65","2fdd9dbe-f57c-4b97-89d9-3c8e05200917"],"position":[4.57661,-1.42109e-14,-1.10591e-14],"rotation":[0,0,8.22027],"scale":[1,1,1],"resource_id":"154ec305-b964-4a07-bcf7-75787b883c55","name":"Chest_M","components":{},"parent":"5c4b614b-ca99-45d1-9ffd-01ba4dca482d"},"2a2b3e82-d0b1-429b-9ac0-a428b9b95d26":{"enabled":true,"tags":[],"children":["70dc6419-fd57-4484-82f9-a76a9febe516"],"position":[15.5097,-1.70398,-8.47709],"rotation":[-40.4095,82.4185,-48.3494],"scale":[1,1,1],"resource_id":"2a2b3e82-d0b1-429b-9ac0-a428b9b95d26","name":"Scapula_R","components":{},"parent":"154ec305-b964-4a07-bcf7-75787b883c55"},"70dc6419-fd57-4484-82f9-a76a9febe516":{"enabled":true,"tags":[],"children":["930b8e63-6492-4681-8c80-c279a115c7ca"],"position":[12.1813,1.06581e-14,2.84217e-13],"rotation":[4.90796e-16,50.6498,6.10091],"scale":[1,1,1],"resource_id":"70dc6419-fd57-4484-82f9-a76a9febe516","name":"Shoulder_R","components":{},"parent":"2a2b3e82-d0b1-429b-9ac0-a428b9b95d26"},"930b8e63-6492-4681-8c80-c279a115c7ca":{"enabled":true,"tags":[],"children":["9d0c19ef-7c47-4889-b6c2-bf67f6676c43"],"position":[27.3069,-7.4607e-14,2.84217e-14],"rotation":[0,0,10.2376],"scale":[1,1,1],"resource_id":"930b8e63-6492-4681-8c80-c279a115c7ca","name":"Elbow_R","components":{},"parent":"70dc6419-fd57-4484-82f9-a76a9febe516"},"9d0c19ef-7c47-4889-b6c2-bf67f6676c43":{"enabled":true,"tags":[],"children":["1511ab22-1978-4397-8ce9-84d25d969039","8dad2df0-2a5c-4d29-ac1d-0da768c0af1a","9bb4ad61-8b98-40b3-8f03-471e717aaa10","0ab2d415-16f1-433c-839c-f5dc8a12ece6"],"position":[25.3891,-5.68434e-14,1.13687e-13],"rotation":[-13.4593,12.3893,9.94431],"scale":[1,1,1],"resource_id":"9d0c19ef-7c47-4889-b6c2-bf67f6676c43","name":"Wrist_R","components":{},"parent":"930b8e63-6492-4681-8c80-c279a115c7ca"},"1511ab22-1978-4397-8ce9-84d25d969039":{"enabled":true,"tags":[],"children":["a74c353f-c707-4245-a5e0-211c193e2f82"],"position":[10.7004,-4.32987e-14,4.26326e-14],"rotation":[16.6631,19.9882,4.62472],"scale":[1,1,1],"resource_id":"1511ab22-1978-4397-8ce9-84d25d969039","name":"MiddleFinger1_R","components":{},"parent":"9d0c19ef-7c47-4889-b6c2-bf67f6676c43"},"a74c353f-c707-4245-a5e0-211c193e2f82":{"enabled":true,"tags":[],"children":["8d5f729b-c6b8-4496-ad31-162dbb88a4b0"],"position":[4.89337,2.84217e-14,-8.52651e-14],"rotation":[0.0389883,21.5463,0.0131999],"scale":[1,1,1],"resource_id":"a74c353f-c707-4245-a5e0-211c193e2f82","name":"MiddleFinger2_R","components":{},"parent":"1511ab22-1978-4397-8ce9-84d25d969039"},"8d5f729b-c6b8-4496-ad31-162dbb88a4b0":{"enabled":true,"tags":[],"children":["5170b049-30a6-4290-8fc9-71f0369044fb"],"position":[2.69621,8.17124e-14,2.13163e-13],"rotation":[0.054418,11.2242,0.0118381],"scale":[1,1,1],"resource_id":"8d5f729b-c6b8-4496-ad31-162dbb88a4b0","name":"MiddleFinger3_R","components":{},"parent":"a74c353f-c707-4245-a5e0-211c193e2f82"},"5170b049-30a6-4290-8fc9-71f0369044fb":{"enabled":true,"tags":[],"children":[],"position":[2.71607,-1.06581e-14,-1.7053e-13],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"5170b049-30a6-4290-8fc9-71f0369044fb","name":"MiddleFinger4_R","components":{},"parent":"8d5f729b-c6b8-4496-ad31-162dbb88a4b0"},"8dad2df0-2a5c-4d29-ac1d-0da768c0af1a":{"enabled":true,"tags":[],"children":["32454a3b-dc95-4603-8275-9bfa4d3656a5"],"position":[3.10674,2.31021,-0.483349],"rotation":[-50.0838,12.4673,45.8555],"scale":[1,1,1],"resource_id":"8dad2df0-2a5c-4d29-ac1d-0da768c0af1a","name":"ThumbFinger1_R","components":{},"parent":"9d0c19ef-7c47-4889-b6c2-bf67f6676c43"},"32454a3b-dc95-4603-8275-9bfa4d3656a5":{"enabled":true,"tags":[],"children":["d25c60b0-e9ec-4946-b309-52cb2d7bb6ce"],"position":[4.34949,-1.42109e-14,-1.42109e-13],"rotation":[0,4.37155,0],"scale":[1,1,1],"resource_id":"32454a3b-dc95-4603-8275-9bfa4d3656a5","name":"ThumbFinger2_R","components":{},"parent":"8dad2df0-2a5c-4d29-ac1d-0da768c0af1a"},"d25c60b0-e9ec-4946-b309-52cb2d7bb6ce":{"enabled":true,"tags":[],"children":["66c5cf80-593e-43a7-9985-262e8c3943db"],"position":[3.1758,-1.42109e-13,-8.52651e-14],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"d25c60b0-e9ec-4946-b309-52cb2d7bb6ce","name":"ThumbFinger3_R","components":{},"parent":"32454a3b-dc95-4603-8275-9bfa4d3656a5"},"66c5cf80-593e-43a7-9985-262e8c3943db":{"enabled":true,"tags":[],"children":[],"position":[2.76567,-0.00000358292,-0.00000228963],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"66c5cf80-593e-43a7-9985-262e8c3943db","name":"ThumbFinger4_R","components":{},"parent":"d25c60b0-e9ec-4946-b309-52cb2d7bb6ce"},"9bb4ad61-8b98-40b3-8f03-471e717aaa10":{"enabled":true,"tags":[],"children":["948f7e2a-f7ac-43db-9f13-c4a211931cb8"],"position":[10.4145,2.09944,0.18772],"rotation":[12.8626,11.9827,15.7219],"scale":[1,1,1],"resource_id":"9bb4ad61-8b98-40b3-8f03-471e717aaa10","name":"IndexFinger1_R","components":{},"parent":"9d0c19ef-7c47-4889-b6c2-bf67f6676c43"},"948f7e2a-f7ac-43db-9f13-c4a211931cb8":{"enabled":true,"tags":[],"children":["62dd3059-d198-4a25-a948-58aa9ad6de9a"],"position":[4.25091,4.26326e-14,2.84217e-14],"rotation":[0.0303742,19.975,-0.00270507],"scale":[1,1,1],"resource_id":"948f7e2a-f7ac-43db-9f13-c4a211931cb8","name":"IndexFinger2_R","components":{},"parent":"9bb4ad61-8b98-40b3-8f03-471e717aaa10"},"62dd3059-d198-4a25-a948-58aa9ad6de9a":{"enabled":true,"tags":[],"children":["663ef460-551d-4fdf-9f9f-6d80af049001"],"position":[2.52958,-2.70006e-13,-9.9476e-14],"rotation":[-1.73917,20.228,-0.667874],"scale":[1,1,1],"resource_id":"62dd3059-d198-4a25-a948-58aa9ad6de9a","name":"IndexFinger3_R","components":{},"parent":"948f7e2a-f7ac-43db-9f13-c4a211931cb8"},"663ef460-551d-4fdf-9f9f-6d80af049001":{"enabled":true,"tags":[],"children":[],"position":[2.13039,-8.52651e-14,1.63425e-13],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"663ef460-551d-4fdf-9f9f-6d80af049001","name":"IndexFinger4_R","components":{},"parent":"62dd3059-d198-4a25-a948-58aa9ad6de9a"},"0ab2d415-16f1-433c-839c-f5dc8a12ece6":{"enabled":true,"tags":[],"children":["5b405fed-76b0-4a86-a7be-3631dfb22d64","44ba2028-08bb-471b-b01d-bfebdff376c2"],"position":[1.94157,-1.04512,0.00628707],"rotation":[0.0354528,2.78555,0.729473],"scale":[1,1,1],"resource_id":"0ab2d415-16f1-433c-839c-f5dc8a12ece6","name":"Cup_R","components":{},"parent":"9d0c19ef-7c47-4889-b6c2-bf67f6676c43"},"5b405fed-76b0-4a86-a7be-3631dfb22d64":{"enabled":true,"tags":[],"children":["8c45383b-77c5-4d41-9465-4aea58643c8b"],"position":[8.45064,-0.933787,-0.419414],"rotation":[17.5479,25.7488,-3.43213],"scale":[1,1,1],"resource_id":"5b405fed-76b0-4a86-a7be-3631dfb22d64","name":"RingFinger1_R","components":{},"parent":"0ab2d415-16f1-433c-839c-f5dc8a12ece6"},"8c45383b-77c5-4d41-9465-4aea58643c8b":{"enabled":true,"tags":[],"children":["acfbb9a3-a794-4d6d-ba44-423df348662b"],"position":[4.34265,-8.88178e-14,1.27898e-13],"rotation":[-0.290359,10.8685,-0.0563096],"scale":[1,1,1],"resource_id":"8c45383b-77c5-4d41-9465-4aea58643c8b","name":"RingFinger2_R","components":{},"parent":"5b405fed-76b0-4a86-a7be-3631dfb22d64"},"acfbb9a3-a794-4d6d-ba44-423df348662b":{"enabled":true,"tags":[],"children":["78e35c79-f4b2-4b45-a8bb-ce6232b10926"],"position":[2.67256,-7.10543e-15,7.10543e-14],"rotation":[0.589289,16.0378,0.170807],"scale":[1,1,1],"resource_id":"acfbb9a3-a794-4d6d-ba44-423df348662b","name":"RingFinger3_R","components":{},"parent":"8c45383b-77c5-4d41-9465-4aea58643c8b"},"78e35c79-f4b2-4b45-a8bb-ce6232b10926":{"enabled":true,"tags":[],"children":[],"position":[2.53469,-7.10543e-14,-7.10543e-14],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"78e35c79-f4b2-4b45-a8bb-ce6232b10926","name":"RingFinger4_R","components":{},"parent":"acfbb9a3-a794-4d6d-ba44-423df348662b"},"44ba2028-08bb-471b-b01d-bfebdff376c2":{"enabled":true,"tags":[],"children":["75173193-4148-4d13-8f87-3ed747edba07"],"position":[7.91143,-2.6839,-1.31764],"rotation":[15.0094,29.8961,-14.1535],"scale":[1,1,1],"resource_id":"44ba2028-08bb-471b-b01d-bfebdff376c2","name":"PinkyFinger1_R","components":{},"parent":"0ab2d415-16f1-433c-839c-f5dc8a12ece6"},"75173193-4148-4d13-8f87-3ed747edba07":{"enabled":true,"tags":[],"children":["0bb5ecac-fdd5-4206-9727-58742015c918"],"position":[3.58146,-3.4639e-14,-9.9476e-14],"rotation":[0.279928,3.28062,0.126074],"scale":[1,1,1],"resource_id":"75173193-4148-4d13-8f87-3ed747edba07","name":"PinkyFinger2_R","components":{},"parent":"44ba2028-08bb-471b-b01d-bfebdff376c2"},"0bb5ecac-fdd5-4206-9727-58742015c918":{"enabled":true,"tags":[],"children":["d1d22996-f6cf-46a7-a1da-e1f21e206e4f"],"position":[1.91524,5.32907e-15,4.68958e-13],"rotation":[2.18092,11.1041,0.396434],"scale":[1,1,1],"resource_id":"0bb5ecac-fdd5-4206-9727-58742015c918","name":"PinkyFinger3_R","components":{},"parent":"75173193-4148-4d13-8f87-3ed747edba07"},"d1d22996-f6cf-46a7-a1da-e1f21e206e4f":{"enabled":true,"tags":[],"children":[],"position":[1.72662,-6.39488e-14,-1.42109e-13],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"d1d22996-f6cf-46a7-a1da-e1f21e206e4f","name":"PinkyFinger4_R","components":{},"parent":"0bb5ecac-fdd5-4206-9727-58742015c918"},"a2cbe25c-d987-45d8-afb7-fa723c9e4f65":{"enabled":true,"tags":[],"children":["0ca9cdcf-2466-4c04-80a4-ccf74d859d95"],"position":[23.2872,1.95399e-14,2.64984e-14],"rotation":[0,0,19.0927],"scale":[1,1,1],"resource_id":"a2cbe25c-d987-45d8-afb7-fa723c9e4f65","name":"Neck_M","components":{},"parent":"154ec305-b964-4a07-bcf7-75787b883c55"},"0ca9cdcf-2466-4c04-80a4-ccf74d859d95":{"enabled":true,"tags":[],"children":["fedb1ab2-2c0a-4158-aa3d-6aea2debcc56","133a3599-deb2-4f93-bb79-2fdaea1f53b5","54de4e11-2768-477f-8a66-d26f13fd0fe6","4003c198-1874-42dc-83a4-56b8b704eff6"],"position":[9.92291,2.77112e-13,-3.53251e-14],"rotation":[0,0,-15.3283],"scale":[1,1,1],"resource_id":"0ca9cdcf-2466-4c04-80a4-ccf74d859d95","name":"Head_M","components":{},"parent":"a2cbe25c-d987-45d8-afb7-fa723c9e4f65"},"fedb1ab2-2c0a-4158-aa3d-6aea2debcc56":{"enabled":true,"tags":[],"children":["4052b35f-20d3-4bf7-a7bb-d9afae946c44"],"position":[8.45394,6.53702,-3.17524],"rotation":[0,0,84.3542],"scale":[1,1,1],"resource_id":"fedb1ab2-2c0a-4158-aa3d-6aea2debcc56","name":"Eye_R","components":{},"parent":"0ca9cdcf-2466-4c04-80a4-ccf74d859d95"},"4052b35f-20d3-4bf7-a7bb-d9afae946c44":{"enabled":true,"tags":[],"children":[],"position":[1.65817,-3.69482e-13,3.5083e-14],"rotation":[15.9437,-0.260386,-0.0181438],"scale":[1,1,1],"resource_id":"4052b35f-20d3-4bf7-a7bb-d9afae946c44","name":"EyeEnd_R","components":{},"parent":"fedb1ab2-2c0a-4158-aa3d-6aea2debcc56"},"133a3599-deb2-4f93-bb79-2fdaea1f53b5":{"enabled":true,"tags":[],"children":["0a828f87-deb9-497b-9af5-540b60eafff1"],"position":[0.712399,0.792158,-9.93169e-15],"rotation":[0,0,114.083],"scale":[1,1,1],"resource_id":"133a3599-deb2-4f93-bb79-2fdaea1f53b5","name":"Jaw_M","components":{},"parent":"0ca9cdcf-2466-4c04-80a4-ccf74d859d95"},"0a828f87-deb9-497b-9af5-540b60eafff1":{"enabled":true,"tags":[],"children":[],"position":[11.1906,-1.98952e-13,-2.18793e-14],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"0a828f87-deb9-497b-9af5-540b60eafff1","name":"JawEnd_M","components":{},"parent":"133a3599-deb2-4f93-bb79-2fdaea1f53b5"},"54de4e11-2768-477f-8a66-d26f13fd0fe6":{"enabled":true,"tags":[],"children":[],"position":[21.1224,-7.10543e-15,-3.19636e-14],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"54de4e11-2768-477f-8a66-d26f13fd0fe6","name":"HeadEnd_M","components":{},"parent":"0ca9cdcf-2466-4c04-80a4-ccf74d859d95"},"4003c198-1874-42dc-83a4-56b8b704eff6":{"enabled":true,"tags":[],"children":["27584000-9400-4126-a17c-845a9f9f7605"],"position":[8.45394,6.53702,3.17524],"rotation":[0,0,84.3542],"scale":[1,1,1],"resource_id":"4003c198-1874-42dc-83a4-56b8b704eff6","name":"Eye_L","components":{},"parent":"0ca9cdcf-2466-4c04-80a4-ccf74d859d95"},"27584000-9400-4126-a17c-845a9f9f7605":{"enabled":true,"tags":[],"children":[],"position":[1.65817,-3.97904e-13,-4.04121e-14],"rotation":[-15.9437,0.260386,-0.0181438],"scale":[1,1,1],"resource_id":"27584000-9400-4126-a17c-845a9f9f7605","name":"EyeEnd_L","components":{},"parent":"4003c198-1874-42dc-83a4-56b8b704eff6"},"2fdd9dbe-f57c-4b97-89d9-3c8e05200917":{"enabled":true,"tags":[],"children":["ef7ab9d6-07e7-4e0c-97ee-66b5e94f6b21"],"position":[15.5097,-1.70398,8.47709],"rotation":[-40.4095,82.4185,131.651],"scale":[1,1,1],"resource_id":"2fdd9dbe-f57c-4b97-89d9-3c8e05200917","name":"Scapula_L","components":{},"parent":"154ec305-b964-4a07-bcf7-75787b883c55"},"ef7ab9d6-07e7-4e0c-97ee-66b5e94f6b21":{"enabled":true,"tags":[],"children":["b05cb928-fd7e-48cd-9e18-afc07c46fba3"],"position":[-12.1813,-3.01981e-14,-2.84217e-13],"rotation":[1.09927e-15,50.6498,6.10091],"scale":[1,1,1],"resource_id":"ef7ab9d6-07e7-4e0c-97ee-66b5e94f6b21","name":"Shoulder_L","components":{},"parent":"2fdd9dbe-f57c-4b97-89d9-3c8e05200917"},"b05cb928-fd7e-48cd-9e18-afc07c46fba3":{"enabled":true,"tags":[],"children":["4e2fd5fc-6dbe-420a-ab31-fb287e31c726"],"position":[-27.3069,-2.84217e-14,1.42109e-13],"rotation":[0,0,10.2376],"scale":[1,1,1],"resource_id":"b05cb928-fd7e-48cd-9e18-afc07c46fba3","name":"Elbow_L","components":{},"parent":"ef7ab9d6-07e7-4e0c-97ee-66b5e94f6b21"},"4e2fd5fc-6dbe-420a-ab31-fb287e31c726":{"enabled":true,"tags":[],"children":["25ebeb00-d02d-4d7a-b09a-1c773f157f56","25037cf1-bb2d-45f1-962a-0ccae3e7f47d","6c23aa87-ff9a-45da-83c0-e56a98fe765d","120cf609-3d9a-4068-9c11-d7b7feb1abdc"],"position":[-25.3891,-2.84217e-14,-2.41585e-13],"rotation":[-13.4593,12.3893,9.94431],"scale":[1,1,1],"resource_id":"4e2fd5fc-6dbe-420a-ab31-fb287e31c726","name":"Wrist_L","components":{},"parent":"b05cb928-fd7e-48cd-9e18-afc07c46fba3"},"25ebeb00-d02d-4d7a-b09a-1c773f157f56":{"enabled":true,"tags":[],"children":["1ddeca7a-7d8b-4993-a05c-5f47a62fb541"],"position":[-10.7004,3.33067e-14,0],"rotation":[16.6631,19.9882,4.62472],"scale":[1,1,1],"resource_id":"25ebeb00-d02d-4d7a-b09a-1c773f157f56","name":"MiddleFinger1_L","components":{},"parent":"4e2fd5fc-6dbe-420a-ab31-fb287e31c726"},"1ddeca7a-7d8b-4993-a05c-5f47a62fb541":{"enabled":true,"tags":[],"children":["aba2941b-f3e0-4469-8126-2a5e9052a7d8"],"position":[-4.89337,-8.52651e-14,1.13687e-13],"rotation":[0.0389883,21.5463,0.0131999],"scale":[1,1,1],"resource_id":"1ddeca7a-7d8b-4993-a05c-5f47a62fb541","name":"MiddleFinger2_L","components":{},"parent":"25ebeb00-d02d-4d7a-b09a-1c773f157f56"},"aba2941b-f3e0-4469-8126-2a5e9052a7d8":{"enabled":true,"tags":[],"children":["44e89eeb-26ac-4f17-96dc-eb7925aa0576"],"position":[-2.69621,-1.77636e-14,-9.23706e-14],"rotation":[0.054418,11.2242,0.0118381],"scale":[1,1,1],"resource_id":"aba2941b-f3e0-4469-8126-2a5e9052a7d8","name":"MiddleFinger3_L","components":{},"parent":"1ddeca7a-7d8b-4993-a05c-5f47a62fb541"},"44e89eeb-26ac-4f17-96dc-eb7925aa0576":{"enabled":true,"tags":[],"children":[],"position":[-2.71607,3.55271e-15,1.27898e-13],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"44e89eeb-26ac-4f17-96dc-eb7925aa0576","name":"MiddleFinger4_L","components":{},"parent":"aba2941b-f3e0-4469-8126-2a5e9052a7d8"},"25037cf1-bb2d-45f1-962a-0ccae3e7f47d":{"enabled":true,"tags":[],"children":["86903bbc-4a42-44a5-a4fb-9f94ebc80ff5"],"position":[-3.10674,-2.31021,0.483349],"rotation":[-50.0838,12.4673,45.8555],"scale":[1,1,1],"resource_id":"25037cf1-bb2d-45f1-962a-0ccae3e7f47d","name":"ThumbFinger1_L","components":{},"parent":"4e2fd5fc-6dbe-420a-ab31-fb287e31c726"},"86903bbc-4a42-44a5-a4fb-9f94ebc80ff5":{"enabled":true,"tags":[],"children":["4a0d4912-c2f7-4a8a-8d15-c21b278c6ba8"],"position":[-4.34949,-1.56319e-13,1.7053e-13],"rotation":[0,4.37155,0],"scale":[1,1,1],"resource_id":"86903bbc-4a42-44a5-a4fb-9f94ebc80ff5","name":"ThumbFinger2_L","components":{},"parent":"25037cf1-bb2d-45f1-962a-0ccae3e7f47d"},"4a0d4912-c2f7-4a8a-8d15-c21b278c6ba8":{"enabled":true,"tags":[],"children":["7cdc4abd-7de8-4aab-bbaf-5287b47baea9"],"position":[-3.1758,3.19744e-13,1.13687e-13],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"4a0d4912-c2f7-4a8a-8d15-c21b278c6ba8","name":"ThumbFinger3_L","components":{},"parent":"86903bbc-4a42-44a5-a4fb-9f94ebc80ff5"},"7cdc4abd-7de8-4aab-bbaf-5287b47baea9":{"enabled":true,"tags":[],"children":[],"position":[-2.76567,0.00000358292,0.00000228963],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"7cdc4abd-7de8-4aab-bbaf-5287b47baea9","name":"ThumbFinger4_L","components":{},"parent":"4a0d4912-c2f7-4a8a-8d15-c21b278c6ba8"},"6c23aa87-ff9a-45da-83c0-e56a98fe765d":{"enabled":true,"tags":[],"children":["18966956-e888-4707-872f-7bcad5dd4975"],"position":[-10.4145,-2.09944,-0.18772],"rotation":[12.8626,11.9827,15.7219],"scale":[1,1,1],"resource_id":"6c23aa87-ff9a-45da-83c0-e56a98fe765d","name":"IndexFinger1_L","components":{},"parent":"4e2fd5fc-6dbe-420a-ab31-fb287e31c726"},"18966956-e888-4707-872f-7bcad5dd4975":{"enabled":true,"tags":[],"children":["e155d26f-a44d-4065-b856-3c1f7655dd45"],"position":[-4.25091,4.9738e-14,9.9476e-14],"rotation":[0.0303742,19.975,-0.00270507],"scale":[1,1,1],"resource_id":"18966956-e888-4707-872f-7bcad5dd4975","name":"IndexFinger2_L","components":{},"parent":"6c23aa87-ff9a-45da-83c0-e56a98fe765d"},"e155d26f-a44d-4065-b856-3c1f7655dd45":{"enabled":true,"tags":[],"children":["19d67abf-6da7-4668-bb56-63e362a0abb8"],"position":[-2.52958,2.70006e-13,1.27898e-13],"rotation":[-1.73917,20.228,-0.667874],"scale":[1,1,1],"resource_id":"e155d26f-a44d-4065-b856-3c1f7655dd45","name":"IndexFinger3_L","components":{},"parent":"18966956-e888-4707-872f-7bcad5dd4975"},"19d67abf-6da7-4668-bb56-63e362a0abb8":{"enabled":true,"tags":[],"children":[],"position":[-2.13039,3.55271e-15,-2.13163e-13],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"19d67abf-6da7-4668-bb56-63e362a0abb8","name":"IndexFinger4_L","components":{},"parent":"e155d26f-a44d-4065-b856-3c1f7655dd45"},"120cf609-3d9a-4068-9c11-d7b7feb1abdc":{"enabled":true,"tags":[],"children":["b161ff11-86c3-4e00-bb3c-bd09ea8a4bf8","0cae0b66-218e-4636-95b8-cf3cc24c14c5"],"position":[-1.94157,1.04512,-0.00628707],"rotation":[0.0354528,2.78555,0.729473],"scale":[1,1,1],"resource_id":"120cf609-3d9a-4068-9c11-d7b7feb1abdc","name":"Cup_L","components":{},"parent":"4e2fd5fc-6dbe-420a-ab31-fb287e31c726"},"b161ff11-86c3-4e00-bb3c-bd09ea8a4bf8":{"enabled":true,"tags":[],"children":["578ebeda-4f81-42eb-8220-e276bf55e73b"],"position":[-8.45064,0.933787,0.419414],"rotation":[17.5479,25.7488,-3.43213],"scale":[1,1,1],"resource_id":"b161ff11-86c3-4e00-bb3c-bd09ea8a4bf8","name":"RingFinger1_L","components":{},"parent":"120cf609-3d9a-4068-9c11-d7b7feb1abdc"},"578ebeda-4f81-42eb-8220-e276bf55e73b":{"enabled":true,"tags":[],"children":["84c775d9-46f4-480c-bfa8-ebac01660934"],"position":[-4.34265,6.03961e-14,7.10543e-14],"rotation":[-0.290359,10.8685,-0.0563096],"scale":[1,1,1],"resource_id":"578ebeda-4f81-42eb-8220-e276bf55e73b","name":"RingFinger2_L","components":{},"parent":"b161ff11-86c3-4e00-bb3c-bd09ea8a4bf8"},"84c775d9-46f4-480c-bfa8-ebac01660934":{"enabled":true,"tags":[],"children":["fcda9764-a9e6-4790-b7c8-2275e8fdce3a"],"position":[-2.67256,3.55271e-15,-9.23706e-14],"rotation":[0.589289,16.0378,0.170807],"scale":[1,1,1],"resource_id":"84c775d9-46f4-480c-bfa8-ebac01660934","name":"RingFinger3_L","components":{},"parent":"578ebeda-4f81-42eb-8220-e276bf55e73b"},"fcda9764-a9e6-4790-b7c8-2275e8fdce3a":{"enabled":true,"tags":[],"children":[],"position":[-2.53469,4.61853e-14,8.88178e-14],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"fcda9764-a9e6-4790-b7c8-2275e8fdce3a","name":"RingFinger4_L","components":{},"parent":"84c775d9-46f4-480c-bfa8-ebac01660934"},"0cae0b66-218e-4636-95b8-cf3cc24c14c5":{"enabled":true,"tags":[],"children":["f1dd3f38-f2a7-4e2d-8437-5c8968e56595"],"position":[-7.91143,2.6839,1.31764],"rotation":[15.0094,29.8961,-14.1535],"scale":[1,1,1],"resource_id":"0cae0b66-218e-4636-95b8-cf3cc24c14c5","name":"PinkyFinger1_L","components":{},"parent":"120cf609-3d9a-4068-9c11-d7b7feb1abdc"},"f1dd3f38-f2a7-4e2d-8437-5c8968e56595":{"enabled":true,"tags":[],"children":["648f62bc-f587-4a1a-944c-663cc286ba53"],"position":[-3.58146,1.02141e-14,1.27898e-13],"rotation":[0.279928,3.28062,0.126074],"scale":[1,1,1],"resource_id":"f1dd3f38-f2a7-4e2d-8437-5c8968e56595","name":"PinkyFinger2_L","components":{},"parent":"0cae0b66-218e-4636-95b8-cf3cc24c14c5"},"648f62bc-f587-4a1a-944c-663cc286ba53":{"enabled":true,"tags":[],"children":["5ac65a16-94b0-478a-b324-791b9c77ee5f"],"position":[-1.91524,8.43769e-15,-5.11591e-13],"rotation":[2.18092,11.1041,0.396434],"scale":[1,1,1],"resource_id":"648f62bc-f587-4a1a-944c-663cc286ba53","name":"PinkyFinger3_L","components":{},"parent":"f1dd3f38-f2a7-4e2d-8437-5c8968e56595"},"5ac65a16-94b0-478a-b324-791b9c77ee5f":{"enabled":true,"tags":[],"children":[],"position":[-1.72662,8.52651e-14,2.55795e-13],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"5ac65a16-94b0-478a-b324-791b9c77ee5f","name":"PinkyFinger4_L","components":{},"parent":"648f62bc-f587-4a1a-944c-663cc286ba53"},"5ad7ed93-07f3-4e3d-8792-fe9e33ed134b":{"enabled":true,"tags":[],"children":["8c176529-ae92-4185-af03-cf980598f550"],"position":[-2.04778,-0.445829,9.98721],"rotation":[-178.09,6.36596,-1.51345],"scale":[1,1,1],"resource_id":"5ad7ed93-07f3-4e3d-8792-fe9e33ed134b","name":"Hip_L","components":{},"parent":"0eaf1817-47cf-4320-aec4-ec4b5d4890ac"},"8c176529-ae92-4185-af03-cf980598f550":{"enabled":true,"tags":[],"children":["2d05dab9-2167-4ce6-85d3-0b2127ab677d"],"position":[-44.9641,-3.55271e-15,1.06581e-13],"rotation":[0,0,-9.83765],"scale":[1,1,1],"resource_id":"8c176529-ae92-4185-af03-cf980598f550","name":"Knee_L","components":{},"parent":"5ad7ed93-07f3-4e3d-8792-fe9e33ed134b"},"2d05dab9-2167-4ce6-85d3-0b2127ab677d":{"enabled":true,"tags":[],"children":["b6911b20-b769-488a-95f4-b6c960fb41f3"],"position":[-39.9237,8.34888e-14,7.10543e-14],"rotation":[1.70759,6.38072,10.1826],"scale":[1,1,1],"resource_id":"2d05dab9-2167-4ce6-85d3-0b2127ab677d","name":"Ankle_L","components":{},"parent":"8c176529-ae92-4185-af03-cf980598f550"},"b6911b20-b769-488a-95f4-b6c960fb41f3":{"enabled":true,"tags":[],"children":["36ce698b-7be6-4bec-9080-01be8e125d22"],"position":[-7.95222,-15.2582,-6.75016e-14],"rotation":[-4.68637,1.48242,86.1308],"scale":[1,1,1],"resource_id":"b6911b20-b769-488a-95f4-b6c960fb41f3","name":"Toes_L","components":{},"parent":"2d05dab9-2167-4ce6-85d3-0b2127ab677d"},"36ce698b-7be6-4bec-9080-01be8e125d22":{"enabled":true,"tags":[],"children":[],"position":[-6.08362,2.11497e-14,2.13163e-14],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"36ce698b-7be6-4bec-9080-01be8e125d22","name":"ToesEnd_L","components":{},"parent":"b6911b20-b769-488a-95f4-b6c960fb41f3"},"2cb48962-5b67-4b71-b0b2-afa8d9db58c1":{"enabled":true,"tags":[],"children":["5b0ab82e-f081-47c5-98bc-75d547e77476","ce472413-e97f-4cff-92be-695f07c7bedc"],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"2cb48962-5b67-4b71-b0b2-afa8d9db58c1","name":"Geo","components":{},"parent":"349f823f-3e44-4162-9ed4-1ec84e75483e"},"5b0ab82e-f081-47c5-98bc-75d547e77476":{"enabled":true,"tags":[],"children":[],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"5b0ab82e-f081-47c5-98bc-75d547e77476","name":"SuitGEO01","components":{"render":{"enabled":true,"type":"asset","asset":80915304,"materialAssets":[80915301],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":"0eaf1817-47cf-4320-aec4-ec4b5d4890ac"}},"parent":"2cb48962-5b67-4b71-b0b2-afa8d9db58c1"},"ce472413-e97f-4cff-92be-695f07c7bedc":{"enabled":true,"tags":[],"children":[],"position":[0,0,0],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"ce472413-e97f-4cff-92be-695f07c7bedc","name":"HeadF","components":{"render":{"enabled":true,"type":"asset","asset":80915305,"materialAssets":[80915302],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":"0eaf1817-47cf-4320-aec4-ec4b5d4890ac"}},"parent":"2cb48962-5b67-4b71-b0b2-afa8d9db58c1"}}},"type":"template","file":null,"i18n":{},"id":"80915306"},"80915351":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"SuitMAT_AlbedoTransparency.jpeg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":2048,"height":2048,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"SuitMAT_AlbedoTransparency.jpeg","hash":"9daac0d54c547cfb2f7302d96b8d3237","size":758293,"variants":{},"url":"files/assets/80915351/1/SuitMAT_AlbedoTransparency.jpeg"},"region":"eu-west-1","i18n":{},"id":"80915351"},"80915363":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"HeadF_MAT_AlbedoTransparency.jpeg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":2048,"height":2048,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"HeadF_MAT_AlbedoTransparency.jpeg","hash":"a3d0992364ed16e1a4f78eabd61a2479","size":541517,"variants":{},"url":"files/assets/80915363/1/HeadF_MAT_AlbedoTransparency.jpeg"},"region":"eu-west-1","i18n":{},"id":"80915363"}}} \ No newline at end of file diff --git a/playcanvas-stable.min.js b/playcanvas-stable.min.js index f5aeef1..f7d2f5e 100644 --- a/playcanvas-stable.min.js +++ b/playcanvas-stable.min.js @@ -1,6 +1,6 @@ /** * @license - * PlayCanvas Engine v1.52.6 revision 2409b8a86 + * PlayCanvas Engine v1.53.4 revision 25b117788 * Copyright 2011-2022 PlayCanvas Ltd. All rights reserved. */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).pc={})}(this,(function(t){"use strict";Array.prototype.fill||Object.defineProperty(Array.prototype,"fill",{value:function(t){if(null==this)throw new TypeError("this is null or not defined");for(var e=Object(this),i=e.length>>>0,n=arguments[1],s=n>>0,a=s<0?Math.max(i+s,0):Math.min(s,i),r=arguments[2],o=void 0===r?i:r>>0,h=o<0?Math.max(i+o,0):Math.min(o,i);a>>0;if("function"!=typeof t)throw TypeError("predicate must be a function");for(var n=arguments[1],s=0;s>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var n=arguments[1],s=0;s0)-(t<0)||+t}),void 0===Number.isFinite&&(Number.isFinite=function(t){return"number"==typeof t&&isFinite(t)}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),n=1;nthis.length)&&(e=this.length),this.substring(e-t.length,e)===t}),String.prototype.includes||(String.prototype.includes=function(t,e){return"number"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)}),String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return this.substr(!e||e<0?0:+e,t.length)===t}),Int8Array.prototype.fill||(Int8Array.prototype.fill=Array.prototype.fill),Uint8Array.prototype.fill||(Uint8Array.prototype.fill=Array.prototype.fill),Uint8ClampedArray.prototype.fill||(Uint8ClampedArray.prototype.fill=Array.prototype.fill),Int16Array.prototype.fill||(Int16Array.prototype.fill=Array.prototype.fill),Uint16Array.prototype.fill||(Uint16Array.prototype.fill=Array.prototype.fill),Int32Array.prototype.fill||(Int32Array.prototype.fill=Array.prototype.fill),Uint32Array.prototype.fill||(Uint32Array.prototype.fill=Array.prototype.fill),Float32Array.prototype.fill||(Float32Array.prototype.fill=Array.prototype.fill);var e={};function i(t,i){var n;e[t]=!0,void 0!==i&&(n=i,window.console&&window.console.error&&window.console.error(n))}var n=function t(e){var i=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(var n=0;n0?a=a.slice(0,a.length-2):(r>0&&a.push(p.delimiter),a.push(n[r])));return s=a.join(""),e||s[0]!==p.delimiter||(s=s.slice(1)),i&&s[s.length-1]!==p.delimiter&&(s+=p.delimiter),s},split:function(t){var e=t.split(p.delimiter),i=e.slice(e.length-1)[0];return[e.slice(0,e.length-1).join(p.delimiter),i]},getBasename:function(t){return p.split(t)[1]},getDirectory:function(t){var e=t.split(p.delimiter);return e.slice(0,e.length-1).join(p.delimiter)},getExtension:function(t){var e=t.split("?")[0].split(".").pop();return e!==t?"."+e:""},isRelativePath:function(t){return"/"!==t.charAt(0)&&null===t.match(/:\/\//)},extractPath:function(t){var e="",i=t.split("/"),n=0;if(i.length>1)if(p.isRelativePath(t))if("."===i[0])for(n=0;n0),S="getGamepads"in navigator,w="undefined"!=typeof Worker;try{var M=Object.defineProperty({},"passive",{get:function(){return T=!0,!1}});window.addEventListener("testpassive",null,M),window.removeEventListener("testpassive",null,M)}catch(t){}}var C="undefined"!=typeof window?"browser":"node",E={environment:C,global:"browser"===C?window:global,browser:"browser"===C,desktop:m,mobile:_,ios:x,android:y,windows:g,xbox:v,gamepads:S,touch:b,workers:w,passiveEvents:T},P="abcdefghijklmnopqrstuvwxyz",R="ABCDEFGHIJKLMNOPQRSTUVWXYZ",I=55296,L=127462,D=127487,k=65024,O=65039;function F(t,e){void 0===e&&(e=0);var i=t.length;if(e<0||e>=i)return null;var n=t.charCodeAt(e);if(i>1&&n>=I&&n<=56319){var s=t.charCodeAt(e+1);if(s>=56320&&s<=57343)return{code:1024*(n-I)+s-56320+65536,long:!0}}return{code:n,long:!1}}function B(t,e,i){if(!t)return!1;var n=F(t);if(n){var s=n.code;return s>=e&&s<=i}return!1}function N(t,e){if(e===t.length-1)return 1;if(B(t[e],I,56319)){var i=t.substring(e,e+2),n=t.substring(e+2,e+4);return B(n,127995,127999)||B(i,L,D)&&B(n,L,D)?4:B(n,k,O)?3:2}return B(t[e+1],k,O)?2:1}var U={ASCII_LOWERCASE:P,ASCII_UPPERCASE:R,ASCII_LETTERS:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",format:function(t){for(var e=1;e65535?[55296+(e>>10),e%1024+56320]:[t],n.push(String.fromCharCode.apply(null,i));return n.join("")}},z=function(){function t(){this._list=[],this._index={}}var e=t.prototype;return e.push=function(t,e){if(this._index[t])throw Error("Key already in index "+t);var i=this._list.push(e)-1;this._index[t]=i},e.has=function(t){return void 0!==this._index[t]},e.get=function(t){var e=this._index[t];return void 0!==e?this._list[e]:null},e.remove=function(t){var e=this._index[t];if(void 0!==e){for(t in this._list.splice(e,1),delete this._index[t],this._index){var i=this._index[t];i>e&&(this._index[t]=i-1)}return!0}return!1},e.list=function(){return this._list},e.clear=function(){for(var t in this._list.length=0,this._index)delete this._index[t]},t}();function V(t,e){for(var i=0;it.length)&&(e=t.length);for(var i=0,n=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var K=function(){function t(t){this.arraybuffer=t,this.dataView=new DataView(t),this.offset=0,this.stack=[]}var e=t.prototype;return e.reset=function(t){void 0===t&&(t=0),this.offset=t},e.skip=function(t){this.offset+=t},e.align=function(t){this.offset=this.offset+t-1&~(t-1)},e._inc=function(t){return this.offset+=t,this.offset-t},e.readChar=function(){return String.fromCharCode(this.dataView.getUint8(this.offset++))},e.readChars=function(t){for(var e="",i=0;i=t.byteLength);){var i=String.fromCharCode(this.readU8());if("\n"===i)break;e+=i}return e},W(t,[{key:"remainingBytes",get:function(){return this.dataView.byteLength-this.offset}}]),t}(),Z=function(){function t(t){this.items=[],this.length=0,this.loopIndex=-1,this._sortBy=t.sortBy,this._sortHandler=this._doSort.bind(this)}var e=t.prototype;return e._binarySearch=function(t){for(var e,i,n=0,s=this.items.length-1,a=t[this._sortBy];n<=s;)e=Math.floor((n+s)/2),(i=this.items[e][this._sortBy])<=a?n=e+1:i>a&&(s=e-1);return n},e._doSort=function(t,e){var i=this._sortBy;return t[i]-e[i]},e.insert=function(t){var e=this._binarySearch(t);this.items.splice(e,0,t),this.length++,this.loopIndex>=e&&this.loopIndex++},e.append=function(t){this.items.push(t),this.length++},e.remove=function(t){var e=this.items.indexOf(t);e<0||(this.items.splice(e,1),this.length--,this.loopIndex>=e&&this.loopIndex--)},e.sort=function(){var t=this.loopIndex>=0?this.items[this.loopIndex]:null;this.items.sort(this._sortHandler),null!==t&&(this.loopIndex=this.items.indexOf(t))},t}(),$=function(t){function e(e){var i;return(i=t.call(this)||this)._index={},i._list=[],i._parent=e,i}H(e,t);var i=e.prototype;return i.add=function(){var t=!1,e=this._processArguments(arguments,!0);if(!e.length)return t;for(var i=0;i=i?i:t<=e?e:t},intToBytes24:function(t){return[t>>16&255,t>>8&255,255&t]},intToBytes32:function(t){return[t>>24&255,t>>16&255,t>>8&255,255&t]},bytesToInt24:function(t,e,i){return t.length&&(i=t[2],e=t[1],t=t[0]),t<<16|e<<8|i},bytesToInt32:function(t,e,i,n){return t.length&&(n=t[3],i=t[2],e=t[1],t=t[0]),(t<<24|e<<16|i<<8|n)>>>0},lerp:function(t,e,i){return t+(e-t)*it.clamp(i,0,1)},lerpAngle:function(t,e,i){return e-t>180&&(e-=360),e-t<-180&&(e+=360),it.lerp(t,e,it.clamp(i,0,1))},powerOfTwo:function(t){return 0!==t&&!(t&t-1)},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t},random:function(t,e){var i=e-t;return Math.random()*i+t},smoothstep:function(t,e,i){return i<=t?0:i>=e?1:(i=(i-t)/(e-t))*i*(3-2*i)},smootherstep:function(t,e,i){return i<=t?0:i>=e?1:(i=(i-t)/(e-t))*i*i*(i*(6*i-15)+10)},roundUp:function(t,e){return 0===e?t:Math.ceil(t/e)*e},between:function(t,e,i,n){var s=Math.min(e,i),a=Math.max(e,i);return n?t>=s&&t<=a:t>s&&t=0?t.ResponseType.ARRAY_BUFFER:".xml"===n?t.ResponseType.DOCUMENT:t.ResponseType.TEXT},e._isBinaryContentType=function(e){return[t.ContentType.MP4,t.ContentType.WAV,t.ContentType.OGG,t.ContentType.MP3,t.ContentType.BIN,t.ContentType.DDS,t.ContentType.BASIS,t.ContentType.GLB].indexOf(e)>=0},e._onReadyStateChange=function(t,e,i,n){if(4===n.readyState)switch(n.status){case 0:n.responseURL&&n.responseURL.startsWith("file:///")?this._onSuccess(t,e,i,n):this._onError(t,e,i,n);break;case 200:case 201:case 206:case 304:this._onSuccess(t,e,i,n);break;default:this._onError(t,e,i,n)}},e._onSuccess=function(e,i,n,s){var a,r,o=s.getResponseHeader("Content-Type");o&&(r=o.split(";")[0].trim());try{a=r===t.ContentType.JSON||i.split("?")[0].endsWith(".json")?JSON.parse(s.responseText):this._isBinaryContentType(r)||s.responseType===t.ResponseType.ARRAY_BUFFER||s.responseType===t.ResponseType.BLOB||s.responseType===t.ResponseType.JSON?s.response:s.responseType===t.ResponseType.DOCUMENT||r===t.ContentType.XML?s.responseXML:s.responseText,n.callback(null,a)}catch(t){n.callback(t)}},e._onError=function(e,i,n,s){var a=this;if(!n.retrying)if(n.retry&&n.retries7?e=it.intToBytes32(i):(e=it.intToBytes24(i))[3]=255,this.set(e[0]/255,e[1]/255,e[2]/255,e[3]/255),this},e.toString=function(t){var e="#"+((1<<24)+(Math.round(255*this.r)<<16)+(Math.round(255*this.g)<<8)+Math.round(255*this.b)).toString(16).slice(1);if(!0===t){var i=Math.round(255*this.a).toString(16);this.a<16/255?e+="0"+i:e+=i}return e},t}();at.BLACK=Object.freeze(new at(0,0,0,1)),at.BLUE=Object.freeze(new at(0,0,1,1)),at.CYAN=Object.freeze(new at(0,1,1,1)),at.GRAY=Object.freeze(new at(.5,.5,.5,1)),at.GREEN=Object.freeze(new at(0,1,0,1)),at.MAGENTA=Object.freeze(new at(1,0,1,1)),at.RED=Object.freeze(new at(1,0,0,1)),at.WHITE=Object.freeze(new at(1,1,1,1)),at.YELLOW=Object.freeze(new at(1,1,0,1));var rt=function(){function t(t,e){void 0===e&&(e=0),this._curve=t,this._left=-1/0,this._right=1/0,this._recip=0,this._p0=0,this._p1=0,this._m0=0,this._m1=0,this._reset(e)}var e=t.prototype;return e.evaluate=function(t,e){var i;void 0===e&&(e=!1),(e||t=this._right)&&this._reset(t);var n=this._curve.type;if(5===n)i=this._p0;else{var s=0===this._recip?0:(t-this._left)*this._recip;i=0===n?it.lerp(this._p0,this._p1,s):1===n?it.lerp(this._p0,this._p1,s*s*(3-2*s)):this._evaluateHermite(this._p0,this._p1,this._m0,this._m1,s)}return i},e._reset=function(t){var e=this._curve.keys,i=e.length;if(i)if(t=e[i-1][0])this._left=e[i-1][0],this._right=1/0,this._recip=0,this._p0=this._p1=e[i-1][1],this._m0=this._m1=0;else{for(var n=0;t>=e[n+1][0];)n++;this._left=e[n][0],this._right=e[n+1][0];var s=1/(this._right-this._left);this._recip=isFinite(s)?s:0,this._p0=e[n][1],this._p1=e[n+1][1],this._isHermite()&&this._calcTangents(e,n)}else this._left=-1/0,this._right=1/0,this._recip=0,this._p0=this._p1=this._m0=this._m1=0},e._isHermite=function(){return 2===this._curve.type||3===this._curve.type||4===this._curve.type},e._calcTangents=function(t,e){var i,n,s=t[e],a=t[e+1];if(i=0===e?[t[0][0]+(t[0][0]-t[1][0]),t[0][1]+(t[0][1]-t[1][1])]:t[e-1],n=e===t.length-2?[t[e+1][0]+(t[e+1][0]-t[e][0]),t[e+1][1]+(t[e+1][1]-t[e][1])]:t[e+2],4===this._curve.type){var r=2*(a[0]-s[0])/(a[0]-i[0]),o=2*(a[0]-s[0])/(n[0]-s[0]);this._m0=this._curve.tension*(isFinite(r)?r:0)*(a[1]-i[1]),this._m1=this._curve.tension*(isFinite(o)?o:0)*(n[1]-s[1])}else{var h=(a[0]-s[0])/(s[0]-i[0]),l=(a[0]-s[0])/(n[0]-a[0]),c=s[1]+(i[1]-s[1])*(isFinite(h)?h:0),u=a[1]+(n[1]-a[1])*(isFinite(l)?l:0),d=2===this._curve.type?.5:this._curve.tension;this._m0=d*(a[1]-c),this._m1=d*(u-s[1])}},e._evaluateHermite=function(t,e,i,n,s){var a=s*s,r=s+s,o=1-s,h=o*o;return t*((1+r)*h)+i*(s*h)+e*(a*(3-r))+n*(a*(s-1))},t}(),ot=function(){function t(t){if(this.keys=[],this.type=1,this.tension=.5,this._eval=new rt(this),t)for(var e=0;et);s++);var a=[t,e];return this.keys.splice(s,0,a),a},e.get=function(t){return this.keys[t]},e.sort=function(){this.keys.sort((function(t,e){return t[0]-e[0]}))},e.value=function(t){return this._eval.evaluate(t,!0)},e.closest=function(t){for(var e=this.keys,i=e.length,n=2,s=null,a=0;a=r))break;n=r,s=e[a]}return s},e.clone=function(){var e=new t;return e.keys=l(e.keys,this.keys),e.type=this.type,e.tension=this.tension,e},e.quantize=function(t){t=Math.max(t,2);var e=new Float32Array(t),i=1/(t-1);e[0]=this._eval.evaluate(0,!0);for(var n=1;n1)for(var t=0;t0){var e=1/Math.sqrt(t);this.x*=e,this.y*=e,this.z*=e}return this},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},e.min=function(t){return t.xthis.x&&(this.x=t.x),t.y>this.y&&(this.y=t.y),t.z>this.z&&(this.z=t.z),this},e.project=function(t){var e=(this.x*t.x+this.y*t.y+this.z*t.z)/(t.x*t.x+t.y*t.y+t.z*t.z);return this.x=t.x*e,this.y=t.y*e,this.z=t.z*e,this},e.set=function(t,e,i){return this.x=t,this.y=e,this.z=i,this},e.sub=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this},e.sub2=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},e.subScalar=function(t){return this.x-=t,this.y-=t,this.z-=t,this},e.toString=function(){return"["+this.x+", "+this.y+", "+this.z+"]"},t}();lt.ZERO=Object.freeze(new lt(0,0,0)),lt.ONE=Object.freeze(new lt(1,1,1)),lt.UP=Object.freeze(new lt(0,1,0)),lt.DOWN=Object.freeze(new lt(0,-1,0)),lt.RIGHT=Object.freeze(new lt(1,0,0)),lt.LEFT=Object.freeze(new lt(-1,0,0)),lt.FORWARD=Object.freeze(new lt(0,0,-1)),lt.BACK=Object.freeze(new lt(0,0,1));var ct=function(){function t(){var t=new Float32Array(9);t[0]=t[4]=t[8]=1,this.data=t}var e=t.prototype;return e.clone=function(){return(new t).copy(this)},e.copy=function(t){var e=t.data,i=this.data;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],this},e.set=function(t){var e=this.data;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},e.equals=function(t){var e=this.data,i=t.data;return e[0]===i[0]&&e[1]===i[1]&&e[2]===i[2]&&e[3]===i[3]&&e[4]===i[4]&&e[5]===i[5]&&e[6]===i[6]&&e[7]===i[7]&&e[8]===i[8]},e.isIdentity=function(){var t=this.data;return 1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&1===t[4]&&0===t[5]&&0===t[6]&&0===t[7]&&1===t[8]},e.setIdentity=function(){var t=this.data;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},e.toString=function(){for(var t="[",e=0;e<9;e++)t+=this.data[e],t+=8!==e?", ":"";return t+="]"},e.transpose=function(){var t,e=this.data;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},e.setFromMat4=function(t){var e=t.data,i=this.data;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},e.transformVector=function(t,e){void 0===e&&(e=new lt);var i=this.data,n=t.x,s=t.y,a=t.z;return e.x=n*i[0]+s*i[3]+a*i[6],e.y=n*i[1]+s*i[4]+a*i[7],e.z=n*i[2]+s*i[5]+a*i[8],e},t}();ct.IDENTITY=Object.freeze(new ct),ct.ZERO=Object.freeze((new ct).set([0,0,0,0,0,0,0,0,0]));var ut=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),2===t.length?(this.x=t[0],this.y=t[1]):(this.x=t,this.y=e)}var e=t.prototype;return e.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.add2=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},e.addScalar=function(t){return this.x+=t,this.y+=t,this},e.clone=function(){return new t(this.x,this.y)},e.copy=function(t){return this.x=t.x,this.y=t.y,this},e.cross=function(t){return this.x*t.y-this.y*t.x},e.distance=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},e.div=function(t){return this.x/=t.x,this.y/=t.y,this},e.div2=function(t,e){return this.x=t.x/e.x,this.y=t.y/e.y,this},e.divScalar=function(t){return this.x/=t,this.y/=t,this},e.dot=function(t){return this.x*t.x+this.y*t.y},e.equals=function(t){return this.x===t.x&&this.y===t.y},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.lengthSq=function(){return this.x*this.x+this.y*this.y},e.lerp=function(t,e,i){return this.x=t.x+i*(e.x-t.x),this.y=t.y+i*(e.y-t.y),this},e.mul=function(t){return this.x*=t.x,this.y*=t.y,this},e.mul2=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this},e.mulScalar=function(t){return this.x*=t,this.y*=t,this},e.normalize=function(){var t=this.x*this.x+this.y*this.y;if(t>0){var e=1/Math.sqrt(t);this.x*=e,this.y*=e}return this},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},e.min=function(t){return t.xthis.x&&(this.x=t.x),t.y>this.y&&(this.y=t.y),this},e.set=function(t,e){return this.x=t,this.y=e,this},e.sub=function(t){return this.x-=t.x,this.y-=t.y,this},e.sub2=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},e.subScalar=function(t){return this.x-=t,this.y-=t,this},e.toString=function(){return"["+this.x+", "+this.y+"]"},t.angleRad=function(t,e){return Math.atan2(t.x*e.y-t.y*e.x,t.x*e.x+t.y*e.y)},t}();ut.ZERO=Object.freeze(new ut(0,0)),ut.ONE=Object.freeze(new ut(1,1)),ut.UP=Object.freeze(new ut(0,1)),ut.DOWN=Object.freeze(new ut(0,-1)),ut.RIGHT=Object.freeze(new ut(1,0)),ut.LEFT=Object.freeze(new ut(-1,0));var dt=function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),4===t.length?(this.x=t[0],this.y=t[1],this.z=t[2],this.w=t[3]):(this.x=t,this.y=e,this.z=i,this.w=n)}var e=t.prototype;return e.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},e.add2=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},e.addScalar=function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},e.clone=function(){return new t(this.x,this.y,this.z,this.w)},e.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},e.div=function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this},e.div2=function(t,e){return this.x=t.x/e.x,this.y=t.y/e.y,this.z=t.z/e.z,this.w=t.w/e.w,this},e.divScalar=function(t){return this.x/=t,this.y/=t,this.z/=t,this.w/=t,this},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},e.equals=function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},e.lerp=function(t,e,i){return this.x=t.x+i*(e.x-t.x),this.y=t.y+i*(e.y-t.y),this.z=t.z+i*(e.z-t.z),this.w=t.w+i*(e.w-t.w),this},e.mul=function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this},e.mul2=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this.w=t.w*e.w,this},e.mulScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},e.normalize=function(){var t=this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w;if(t>0){var e=1/Math.sqrt(t);this.x*=e,this.y*=e,this.z*=e,this.w*=e}return this},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},e.min=function(t){return t.xthis.x&&(this.x=t.x),t.y>this.y&&(this.y=t.y),t.z>this.z&&(this.z=t.z),t.w>this.w&&(this.w=t.w),this},e.set=function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this},e.sub=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this},e.sub2=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},e.subScalar=function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},e.toString=function(){return"["+this.x+", "+this.y+", "+this.z+", "+this.w+"]"},t}();dt.ZERO=Object.freeze(new dt(0,0,0,0)),dt.ONE=Object.freeze(new dt(1,1,1,1));var ft=new ut,pt=new lt,mt=new lt,_t=new lt,gt=new lt,vt=function(){function t(){var t=new Float32Array(16);t[0]=t[5]=t[10]=t[15]=1,this.data=t}t._getPerspectiveHalfSize=function(t,e,i,n,s){s?(t.x=n*Math.tan(e*Math.PI/360),t.y=t.x/i):(t.y=n*Math.tan(e*Math.PI/360),t.x=t.y*i)};var e=t.prototype;return e.add2=function(t,e){var i=t.data,n=e.data,s=this.data;return s[0]=i[0]+n[0],s[1]=i[1]+n[1],s[2]=i[2]+n[2],s[3]=i[3]+n[3],s[4]=i[4]+n[4],s[5]=i[5]+n[5],s[6]=i[6]+n[6],s[7]=i[7]+n[7],s[8]=i[8]+n[8],s[9]=i[9]+n[9],s[10]=i[10]+n[10],s[11]=i[11]+n[11],s[12]=i[12]+n[12],s[13]=i[13]+n[13],s[14]=i[14]+n[14],s[15]=i[15]+n[15],this},e.add=function(t){return this.add2(this,t)},e.clone=function(){return(new t).copy(this)},e.copy=function(t){var e=t.data,i=this.data;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],this},e.equals=function(t){var e=this.data,i=t.data;return e[0]===i[0]&&e[1]===i[1]&&e[2]===i[2]&&e[3]===i[3]&&e[4]===i[4]&&e[5]===i[5]&&e[6]===i[6]&&e[7]===i[7]&&e[8]===i[8]&&e[9]===i[9]&&e[10]===i[10]&&e[11]===i[11]&&e[12]===i[12]&&e[13]===i[13]&&e[14]===i[14]&&e[15]===i[15]},e.isIdentity=function(){var t=this.data;return 1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&0===t[4]&&1===t[5]&&0===t[6]&&0===t[7]&&0===t[8]&&0===t[9]&&1===t[10]&&0===t[11]&&0===t[12]&&0===t[13]&&0===t[14]&&1===t[15]},e.mul2=function(t,e){var i,n,s,a,r=t.data,o=e.data,h=this.data,l=r[0],c=r[1],u=r[2],d=r[3],f=r[4],p=r[5],m=r[6],_=r[7],g=r[8],v=r[9],y=r[10],x=r[11],b=r[12],S=r[13],w=r[14],T=r[15];return i=o[0],n=o[1],s=o[2],a=o[3],h[0]=l*i+f*n+g*s+b*a,h[1]=c*i+p*n+v*s+S*a,h[2]=u*i+m*n+y*s+w*a,h[3]=d*i+_*n+x*s+T*a,i=o[4],n=o[5],s=o[6],a=o[7],h[4]=l*i+f*n+g*s+b*a,h[5]=c*i+p*n+v*s+S*a,h[6]=u*i+m*n+y*s+w*a,h[7]=d*i+_*n+x*s+T*a,i=o[8],n=o[9],s=o[10],a=o[11],h[8]=l*i+f*n+g*s+b*a,h[9]=c*i+p*n+v*s+S*a,h[10]=u*i+m*n+y*s+w*a,h[11]=d*i+_*n+x*s+T*a,i=o[12],n=o[13],s=o[14],a=o[15],h[12]=l*i+f*n+g*s+b*a,h[13]=c*i+p*n+v*s+S*a,h[14]=u*i+m*n+y*s+w*a,h[15]=d*i+_*n+x*s+T*a,this},e.mulAffine2=function(t,e){var i,n,s,a=t.data,r=e.data,o=this.data,h=a[0],l=a[1],c=a[2],u=a[4],d=a[5],f=a[6],p=a[8],m=a[9],_=a[10],g=a[12],v=a[13],y=a[14];return i=r[0],n=r[1],s=r[2],o[0]=h*i+u*n+p*s,o[1]=l*i+d*n+m*s,o[2]=c*i+f*n+_*s,o[3]=0,i=r[4],n=r[5],s=r[6],o[4]=h*i+u*n+p*s,o[5]=l*i+d*n+m*s,o[6]=c*i+f*n+_*s,o[7]=0,i=r[8],n=r[9],s=r[10],o[8]=h*i+u*n+p*s,o[9]=l*i+d*n+m*s,o[10]=c*i+f*n+_*s,o[11]=0,i=r[12],n=r[13],s=r[14],o[12]=h*i+u*n+p*s+g,o[13]=l*i+d*n+m*s+v,o[14]=c*i+f*n+_*s+y,o[15]=1,this},e.mul=function(t){return this.mul2(this,t)},e.transformPoint=function(t,e){void 0===e&&(e=new lt);var i=this.data,n=t.x,s=t.y,a=t.z;return e.x=n*i[0]+s*i[4]+a*i[8]+i[12],e.y=n*i[1]+s*i[5]+a*i[9]+i[13],e.z=n*i[2]+s*i[6]+a*i[10]+i[14],e},e.transformVector=function(t,e){void 0===e&&(e=new lt);var i=this.data,n=t.x,s=t.y,a=t.z;return e.x=n*i[0]+s*i[4]+a*i[8],e.y=n*i[1]+s*i[5]+a*i[9],e.z=n*i[2]+s*i[6]+a*i[10],e},e.transformVec4=function(t,e){void 0===e&&(e=new dt);var i=this.data,n=t.x,s=t.y,a=t.z,r=t.w;return e.x=n*i[0]+s*i[4]+a*i[8]+r*i[12],e.y=n*i[1]+s*i[5]+a*i[9]+r*i[13],e.z=n*i[2]+s*i[6]+a*i[10]+r*i[14],e.w=n*i[3]+s*i[7]+a*i[11]+r*i[15],e},e.setLookAt=function(t,e,i){_t.sub2(t,e).normalize(),mt.copy(i).normalize(),pt.cross(mt,_t).normalize(),mt.cross(_t,pt);var n=this.data;return n[0]=pt.x,n[1]=pt.y,n[2]=pt.z,n[3]=0,n[4]=mt.x,n[5]=mt.y,n[6]=mt.z,n[7]=0,n[8]=_t.x,n[9]=_t.y,n[10]=_t.z,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this},e.setFrustum=function(t,e,i,n,s,a){var r=2*s,o=e-t,h=n-i,l=a-s,c=this.data;return c[0]=r/o,c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=r/h,c[6]=0,c[7]=0,c[8]=(e+t)/o,c[9]=(n+i)/h,c[10]=(-a-s)/l,c[11]=-1,c[12]=0,c[13]=0,c[14]=-r*a/l,c[15]=0,this},e.setPerspective=function(e,i,n,s,a){return t._getPerspectiveHalfSize(ft,e,i,n,a),this.setFrustum(-ft.x,ft.x,-ft.y,ft.y,n,s)},e.setOrtho=function(t,e,i,n,s,a){var r=this.data;return r[0]=2/(e-t),r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=2/(n-i),r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-2/(a-s),r[11]=0,r[12]=-(e+t)/(e-t),r[13]=-(n+i)/(n-i),r[14]=-(a+s)/(a-s),r[15]=1,this},e.setFromAxisAngle=function(t,e){e*=it.DEG_TO_RAD;var i=t.x,n=t.y,s=t.z,a=Math.cos(e),r=Math.sin(e),o=1-a,h=o*i,l=o*n,c=this.data;return c[0]=h*i+a,c[1]=h*n+r*s,c[2]=h*s-r*n,c[3]=0,c[4]=h*n-r*s,c[5]=l*n+a,c[6]=l*s+r*i,c[7]=0,c[8]=h*s+r*n,c[9]=l*s-i*r,c[10]=o*s*s+a,c[11]=0,c[12]=0,c[13]=0,c[14]=0,c[15]=1,this},e.setTranslate=function(t,e,i){var n=this.data;return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=t,n[13]=e,n[14]=i,n[15]=1,this},e.setScale=function(t,e,i){var n=this.data;return n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=e,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=i,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this},e.setViewport=function(t,e,i,n){var s=this.data;return s[0]=.5*i,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=.5*n,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=.5,s[11]=0,s[12]=t+.5*i,s[13]=e+.5*n,s[14]=.5,s[15]=1,this},e.invert=function(){var t=this.data,e=t[0],i=t[1],n=t[2],s=t[3],a=t[4],r=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],f=t[12],p=t[13],m=t[14],_=t[15],g=e*r-i*a,v=e*o-n*a,y=e*h-s*a,x=i*o-n*r,b=i*h-s*r,S=n*h-s*o,w=l*p-c*f,T=l*m-u*f,A=l*_-d*f,M=c*m-u*p,C=c*_-d*p,E=u*_-d*m,P=g*E-v*C+y*M+x*A-b*T+S*w;if(0===P)this.setIdentity();else{var R=1/P;t[0]=(r*E-o*C+h*M)*R,t[1]=(-i*E+n*C-s*M)*R,t[2]=(p*S-m*b+_*x)*R,t[3]=(-c*S+u*b-d*x)*R,t[4]=(-a*E+o*A-h*T)*R,t[5]=(e*E-n*A+s*T)*R,t[6]=(-f*S+m*y-_*v)*R,t[7]=(l*S-u*y+d*v)*R,t[8]=(a*C-r*A+h*w)*R,t[9]=(-e*C+i*A-s*w)*R,t[10]=(f*b-p*y+_*g)*R,t[11]=(-l*b+c*y-d*g)*R,t[12]=(-a*M+r*T-o*w)*R,t[13]=(e*M-i*T+n*w)*R,t[14]=(-f*x+p*v-m*g)*R,t[15]=(l*x-c*v+u*g)*R}return this},e.set=function(t){var e=this.data;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},e.setIdentity=function(){var t=this.data;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},e.setTRS=function(t,e,i){var n=e.x,s=e.y,a=e.z,r=e.w,o=i.x,h=i.y,l=i.z,c=n+n,u=s+s,d=a+a,f=n*c,p=n*u,m=n*d,_=s*u,g=s*d,v=a*d,y=r*c,x=r*u,b=r*d,S=this.data;return S[0]=(1-(_+v))*o,S[1]=(p+b)*o,S[2]=(m-x)*o,S[3]=0,S[4]=(p-b)*h,S[5]=(1-(f+v))*h,S[6]=(g+y)*h,S[7]=0,S[8]=(m+x)*l,S[9]=(g-y)*l,S[10]=(1-(f+_))*l,S[11]=0,S[12]=t.x,S[13]=t.y,S[14]=t.z,S[15]=1,this},e.transpose=function(){var t,e=this.data;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},e.invertTo3x3=function(t){var e=this.data,i=t.data,n=e[0],s=e[1],a=e[2],r=e[4],o=e[5],h=e[6],l=e[8],c=e[9],u=e[10],d=u*o-h*c,f=-u*s+a*c,p=h*s-a*o,m=-u*r+h*l,_=u*n-a*l,g=-h*n+a*r,v=c*r-o*l,y=-c*n+s*l,x=o*n-s*r,b=n*d+s*m+a*v;if(0===b)return this;var S=1/b;return i[0]=S*d,i[1]=S*f,i[2]=S*p,i[3]=S*m,i[4]=S*_,i[5]=S*g,i[6]=S*v,i[7]=S*y,i[8]=S*x,this},e.getTranslation=function(t){return void 0===t&&(t=new lt),t.set(this.data[12],this.data[13],this.data[14])},e.getX=function(t){return void 0===t&&(t=new lt),t.set(this.data[0],this.data[1],this.data[2])},e.getY=function(t){return void 0===t&&(t=new lt),t.set(this.data[4],this.data[5],this.data[6])},e.getZ=function(t){return void 0===t&&(t=new lt),t.set(this.data[8],this.data[9],this.data[10])},e.getScale=function(t){return void 0===t&&(t=new lt),this.getX(pt),this.getY(mt),this.getZ(_t),t.set(pt.length(),mt.length(),_t.length()),t},e.setFromEulerAngles=function(t,e,i){t*=it.DEG_TO_RAD,e*=it.DEG_TO_RAD,i*=it.DEG_TO_RAD;var n=Math.sin(-t),s=Math.cos(-t),a=Math.sin(-e),r=Math.cos(-e),o=Math.sin(-i),h=Math.cos(-i),l=this.data;return l[0]=r*h,l[1]=-r*o,l[2]=a,l[3]=0,l[4]=s*o+h*n*a,l[5]=s*h-n*a*o,l[6]=-r*n,l[7]=0,l[8]=n*o-s*h*a,l[9]=h*n+s*a*o,l[10]=s*r,l[11]=0,l[12]=0,l[13]=0,l[14]=0,l[15]=1,this},e.getEulerAngles=function(t){void 0===t&&(t=new lt),this.getScale(gt);var e=gt.x,i=gt.y,n=gt.z;if(0===e||0===i||0===n)return t.set(0,0,0);var s,a,r=this.data,o=Math.asin(-r[2]/e),h=.5*Math.PI;return o-h?(s=Math.atan2(r[6]/i,r[10]/n),a=Math.atan2(r[1]/e,r[0]/e)):(a=0,s=-Math.atan2(r[4]/i,r[5]/i)):(a=0,s=Math.atan2(r[4]/i,r[5]/i)),t.set(s,o,a).mulScalar(it.RAD_TO_DEG)},e.toString=function(){for(var t="[",e=0;e<16;e+=1)t+=this.data[e],t+=15!==e?", ":"";return t+="]"},t}();vt.IDENTITY=Object.freeze(new vt),vt.ZERO=Object.freeze((new vt).set([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]));var yt=function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),4===t.length?(this.x=t[0],this.y=t[1],this.z=t[2],this.w=t[3]):(this.x=t,this.y=e,this.z=i,this.w=n)}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y,this.z,this.w)},e.conjugate=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},e.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},e.equals=function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},e.getAxisAngle=function(t){var e=2*Math.acos(this.w),i=Math.sin(e/2);return 0!==i?(t.x=this.x/i,t.y=this.y/i,t.z=this.z/i,(t.x<0||t.y<0||t.z<0)&&(t.x*=-1,t.y*=-1,t.z*=-1,e*=-1)):(t.x=1,t.y=0,t.z=0),e*it.RAD_TO_DEG},e.getEulerAngles=function(t){var e,i,n;void 0===t&&(t=new lt);var s=this.x,a=this.y,r=this.z,o=this.w,h=2*(o*a-s*r);return h<=-.99999?(e=2*Math.atan2(s,o),i=-Math.PI/2,n=0):h>=.99999?(e=2*Math.atan2(s,o),i=Math.PI/2,n=0):(e=Math.atan2(2*(o*s+a*r),1-2*(s*s+a*a)),i=Math.asin(h),n=Math.atan2(2*(o*r+s*a),1-2*(a*a+r*r))),t.set(e,i,n).mulScalar(it.RAD_TO_DEG)},e.invert=function(){return this.conjugate().normalize()},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},e.mul=function(t){var e=this.x,i=this.y,n=this.z,s=this.w,a=t.x,r=t.y,o=t.z,h=t.w;return this.x=s*a+e*h+i*o-n*r,this.y=s*r+i*h+n*a-e*o,this.z=s*o+n*h+e*r-i*a,this.w=s*h-e*a-i*r-n*o,this},e.mul2=function(t,e){var i=t.x,n=t.y,s=t.z,a=t.w,r=e.x,o=e.y,h=e.z,l=e.w;return this.x=a*r+i*l+n*h-s*o,this.y=a*o+n*l+s*r-i*h,this.z=a*h+s*l+i*o-n*r,this.w=a*l-i*r-n*o-s*h,this},e.normalize=function(){var t=this.length();return 0===t?(this.x=this.y=this.z=0,this.w=1):(t=1/t,this.x*=t,this.y*=t,this.z*=t,this.w*=t),this},e.set=function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this},e.setFromAxisAngle=function(t,e){e*=.5*it.DEG_TO_RAD;var i=Math.sin(e),n=Math.cos(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=n,this},e.setFromEulerAngles=function(t,e,i){var n=.5*it.DEG_TO_RAD;t*=n,e*=n,i*=n;var s=Math.sin(t),a=Math.cos(t),r=Math.sin(e),o=Math.cos(e),h=Math.sin(i),l=Math.cos(i);return this.x=s*o*l-a*r*h,this.y=a*r*l+s*o*h,this.z=a*o*h-s*r*l,this.w=a*o*l+s*r*h,this},e.setFromMat4=function(t){var e,i,n,s,a,r,o,h,l,c,u,d,f,p;if(e=(t=t.data)[0],i=t[1],n=t[2],s=t[4],a=t[5],r=t[6],o=t[8],h=t[9],l=t[10],0===(d=e*e+i*i+n*n))return this;if(d=1/Math.sqrt(d),0===(f=s*s+a*a+r*r))return this;if(f=1/Math.sqrt(f),0===(p=o*o+h*h+l*l))return this;i*=d,n*=d,s*=f,r*=f,o*=p=1/Math.sqrt(p),h*=p;var m=(e*=d)+(a*=f)+(l*=p);return m>=0?(c=Math.sqrt(m+1),this.w=.5*c,c=.5/c,this.x=(r-h)*c,this.y=(o-n)*c,this.z=(i-s)*c):e>a?e>l?(u=e-(a+l)+1,u=Math.sqrt(u),this.x=.5*u,u=.5/u,this.w=(r-h)*u,this.y=(i+s)*u,this.z=(n+o)*u):(u=l-(e+a)+1,u=Math.sqrt(u),this.z=.5*u,u=.5/u,this.w=(i-s)*u,this.x=(o+n)*u,this.y=(h+r)*u):a>l?(u=a-(l+e)+1,u=Math.sqrt(u),this.y=.5*u,u=.5/u,this.w=(o-n)*u,this.z=(r+h)*u,this.x=(s+i)*u):(u=l-(e+a)+1,u=Math.sqrt(u),this.z=.5*u,u=.5/u,this.w=(i-s)*u,this.x=(o+n)*u,this.y=(h+r)*u),this},e.slerp=function(t,e,i){var n=t.x,s=t.y,a=t.z,r=t.w,o=e.x,h=e.y,l=e.z,c=e.w,u=r*c+n*o+s*h+a*l;if(u<0&&(c=-c,o=-o,h=-h,l=-l,u=-u),Math.abs(u)>=1)return this.w=r,this.x=n,this.y=s,this.z=a,this;var d=Math.acos(u),f=Math.sqrt(1-u*u);if(Math.abs(f)<.001)return this.w=.5*r+.5*c,this.x=.5*n+.5*o,this.y=.5*s+.5*h,this.z=.5*a+.5*l,this;var p=Math.sin((1-i)*d)/f,m=Math.sin(i*d)/f;return this.w=r*p+c*m,this.x=n*p+o*m,this.y=s*p+h*m,this.z=a*p+l*m,this},e.transformVector=function(t,e){void 0===e&&(e=new lt);var i=t.x,n=t.y,s=t.z,a=this.x,r=this.y,o=this.z,h=this.w,l=h*i+r*s-o*n,c=h*n+o*i-a*s,u=h*s+a*n-r*i,d=-a*i-r*n-o*s;return e.x=l*h+d*-a+c*-o-u*-r,e.y=c*h+d*-r+u*-a-l*-o,e.z=u*h+d*-o+l*-r-c*-a,e},e.toString=function(){return"["+this.x+", "+this.y+", "+this.z+", "+this.w+"]"},t}();yt.IDENTITY=Object.freeze(new yt(0,0,0,1)),yt.ZERO=Object.freeze(new yt(0,0,0,0));var xt=new lt,bt=new lt,St=new lt,wt=new lt,Tt=new lt,At=function(){function t(t,e){void 0===t&&(t=new lt),void 0===e&&(e=new lt(.5,.5,.5)),this.center=t,this.halfExtents=e,this._min=new lt,this._max=new lt}var e=t.prototype;return e.add=function(t){var e=this.center,i=e.x,n=e.y,s=e.z,a=this.halfExtents,r=a.x,o=a.y,h=a.z,l=i-r,c=i+r,u=n-o,d=n+o,f=s-h,p=s+h,m=t.center,_=m.x,g=m.y,v=m.z,y=t.halfExtents,x=y.x,b=y.y,S=y.z,w=_-x,T=_+x,A=g-b,M=g+b,C=v-S,E=v+S;wc&&(c=T),Ad&&(d=M),Cp&&(p=E),e.x=.5*(l+c),e.y=.5*(u+d),e.z=.5*(f+p),a.x=.5*(c-l),a.y=.5*(d-u),a.z=.5*(p-f)},e.copy=function(t){this.center.copy(t.center),this.halfExtents.copy(t.halfExtents)},e.clone=function(){return new t(this.center.clone(),this.halfExtents.clone())},e.intersects=function(t){var e=this.getMax(),i=this.getMin(),n=t.getMax(),s=t.getMin();return i.x<=n.x&&e.x>=s.x&&i.y<=n.y&&e.y>=s.y&&i.z<=n.z&&e.z>=s.z},e._intersectsRay=function(t,e){var i=xt.copy(this.getMin()).sub(t.origin),n=bt.copy(this.getMax()).sub(t.origin),s=t.direction;0===s.x?(i.x=i.x<0?-Number.MAX_VALUE:Number.MAX_VALUE,n.x=n.x<0?-Number.MAX_VALUE:Number.MAX_VALUE):(i.x/=s.x,n.x/=s.x),0===s.y?(i.y=i.y<0?-Number.MAX_VALUE:Number.MAX_VALUE,n.y=n.y<0?-Number.MAX_VALUE:Number.MAX_VALUE):(i.y/=s.y,n.y/=s.y),0===s.z?(i.z=i.z<0?-Number.MAX_VALUE:Number.MAX_VALUE,n.z=n.z<0?-Number.MAX_VALUE:Number.MAX_VALUE):(i.z/=s.z,n.z/=s.z);var a=St.set(Math.min(i.x,n.x),Math.min(i.y,n.y),Math.min(i.z,n.z)),r=wt.set(Math.max(i.x,n.x),Math.max(i.y,n.y),Math.max(i.z,n.z)),o=Math.min(Math.min(r.x,r.y),r.z),h=Math.max(Math.max(a.x,a.y),a.z),l=o>=h&&h>=0;return l&&e.copy(t.direction).mulScalar(h).add(t.origin),l},e._fastIntersectsRay=function(t){var e=xt,i=bt,n=St,s=wt,a=Tt,r=t.direction;return e.sub2(t.origin,this.center),s.set(Math.abs(e.x),Math.abs(e.y),Math.abs(e.z)),n.mul2(e,r),!(s.x>this.halfExtents.x&&n.x>=0)&&(!(s.y>this.halfExtents.y&&n.y>=0)&&(!(s.z>this.halfExtents.z&&n.z>=0)&&(a.set(Math.abs(r.x),Math.abs(r.y),Math.abs(r.z)),i.cross(r,e),i.set(Math.abs(i.x),Math.abs(i.y),Math.abs(i.z)),!(i.x>this.halfExtents.y*a.z+this.halfExtents.z*a.y)&&(!(i.y>this.halfExtents.x*a.z+this.halfExtents.z*a.x)&&!(i.z>this.halfExtents.x*a.y+this.halfExtents.y*a.x)))))},e.intersectsRay=function(t,e){return e?this._intersectsRay(t,e):this._fastIntersectsRay(t)},e.setMinMax=function(t,e){this.center.add2(e,t).mulScalar(.5),this.halfExtents.sub2(e,t).mulScalar(.5)},e.getMin=function(){return this._min.copy(this.center).sub(this.halfExtents)},e.getMax=function(){return this._max.copy(this.center).add(this.halfExtents)},e.containsPoint=function(t){var e=this.getMin(),i=this.getMax();return!(t.xi.x||t.yi.y||t.zi.z)},e.setFromTransformedAabb=function(t,e,i){void 0===i&&(i=!1);var n=t.center,s=t.halfExtents,a=e.data,r=a[0],o=a[4],h=a[8],l=a[1],c=a[5],u=a[9],d=a[2],f=a[6],p=a[10];if(i){var m=r*r+o*o+h*h;if(m>0){var _=1/Math.sqrt(m);r*=_,o*=_,h*=_}if((m=l*l+c*c+u*u)>0){var g=1/Math.sqrt(m);l*=g,c*=g,u*=g}if((m=d*d+f*f+p*p)>0){var v=1/Math.sqrt(m);d*=v,f*=v,p*=v}}this.center.set(a[12]+r*n.x+o*n.y+h*n.z,a[13]+l*n.x+c*n.y+u*n.z,a[14]+d*n.x+f*n.y+p*n.z),this.halfExtents.set(Math.abs(r)*s.x+Math.abs(o)*s.y+Math.abs(h)*s.z,Math.abs(l)*s.x+Math.abs(c)*s.y+Math.abs(u)*s.z,Math.abs(d)*s.x+Math.abs(f)*s.y+Math.abs(p)*s.z)},e.compute=function(t,e){if((e=void 0===e?t.length/3:e)>0){for(var i=xt.set(t[0],t[1],t[2]),n=bt.set(t[0],t[1],t[2]),s=1;sn.x&&(n.x=a),r>n.y&&(n.y=r),o>n.z&&(n.z=o)}this.setMinMax(i,n)}},e.intersectsBoundingSphere=function(t){return this._distanceToBoundingSphereSq(t)<=t.radius*t.radius},e._distanceToBoundingSphereSq=function(t){for(var e=this.getMin(),i=this.getMax(),n=0,s=["x","y","z"],a=0;a<3;++a){var r=0,o=t.center[s[a]],h=e[s[a]],l=i[s[a]],c=0;ol&&(r+=(c=o-l)*c),n+=r}return n},e._expand=function(t,e){xt.add2(this.getMin(),t),bt.add2(this.getMax(),e),this.setMinMax(xt,bt)},t}(),Mt=new lt,Ct=new lt,Et=function(){function t(t,e){void 0===t&&(t=new lt),void 0===e&&(e=.5),this.center=t,this.radius=e}var e=t.prototype;return e.containsPoint=function(t){var e=Mt.sub2(t,this.center).lengthSq(),i=this.radius;return e0&&n>0)return!1;var a=n*n-s;if(a<0)return!1;var r=Math.abs(-n-Math.sqrt(a));return e&&e.copy(t.direction).mulScalar(r).add(t.origin),!0},e.intersectsBoundingSphere=function(t){Mt.sub2(t.center,this.center);var e=t.radius+this.radius;return Mt.lengthSq()<=e*e},t}(),Pt="none",Rt="linear",It={0:"PCF3",1:"VSM8",2:"VSM16",3:"VSM32",4:"PCF5",5:"PCF1"},Lt=128,Dt=256,kt=1024,Ot=2048,Ft=4096,Bt=8192,Nt=18,Ut=[new lt,new lt,new lt,new lt,new lt,new lt,new lt,new lt],zt=function(){function t(){this.planes=[];for(var t=0;t<6;t++)this.planes[t]=[]}var e=t.prototype;return e.setFromMat4=function(t){var e,i=t.data,n=this.planes;(e=n[0])[0]=i[3]-i[0],e[1]=i[7]-i[4],e[2]=i[11]-i[8],e[3]=i[15]-i[12];var s=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=s,e[1]/=s,e[2]/=s,e[3]/=s,(e=n[1])[0]=i[3]+i[0],e[1]=i[7]+i[4],e[2]=i[11]+i[8],e[3]=i[15]+i[12],s=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),e[0]/=s,e[1]/=s,e[2]/=s,e[3]/=s,(e=n[2])[0]=i[3]+i[1],e[1]=i[7]+i[5],e[2]=i[11]+i[9],e[3]=i[15]+i[13],s=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),e[0]/=s,e[1]/=s,e[2]/=s,e[3]/=s,(e=n[3])[0]=i[3]-i[1],e[1]=i[7]-i[5],e[2]=i[11]-i[9],e[3]=i[15]-i[13],s=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),e[0]/=s,e[1]/=s,e[2]/=s,e[3]/=s,(e=n[4])[0]=i[3]-i[2],e[1]=i[7]-i[6],e[2]=i[11]-i[10],e[3]=i[15]-i[14],s=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),e[0]/=s,e[1]/=s,e[2]/=s,e[3]/=s,(e=n[5])[0]=i[3]+i[2],e[1]=i[7]+i[6],e[2]=i[11]+i[10],e[3]=i[15]+i[14],s=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),e[0]/=s,e[1]/=s,e[2]/=s,e[3]/=s},e.containsPoint=function(t){var e,i;for(e=0;e<6;e++)if((i=this.planes[e])[0]*t.x+i[1]*t.y+i[2]*t.z+i[3]<=0)return!1;return!0},e.containsSphere=function(t){var e,i,n,s=0,a=t.radius,r=t.center,o=r.x,h=r.y,l=r.z,c=this.planes;for(i=0;i<6;i++){if((e=(n=c[i])[0]*o+n[1]*h+n[2]*l+n[3])<=-a)return 0;e>a&&s++}return 6===s?2:1},t.getPoints=function(t,e,i){e=e||t._nearClip,i=i||t._farClip;var n=t._fov*Math.PI/180,s=0===t._projection?Math.tan(n/2)*e:t._orthoHeight,a=s*t._aspectRatio,r=Ut;return r[0].x=a,r[0].y=-s,r[0].z=-e,r[1].x=a,r[1].y=s,r[1].z=-e,r[2].x=-a,r[2].y=s,r[2].z=-e,r[3].x=-a,r[3].y=-s,r[3].z=-e,0===t._projection&&(a=(s=Math.tan(n/2)*i)*t._aspectRatio),r[4].x=a,r[4].y=-s,r[4].z=-i,r[5].x=a,r[5].y=s,r[5].z=-i,r[6].x=-a,r[6].y=s,r[6].z=-i,r[7].x=-a,r[7].y=-s,r[7].z=-i,r},t}(),Vt=function(){function t(t,e){void 0===t&&(t=new lt),void 0===e&&(e=new lt(0,0,-1)),this.origin=t,this.direction=e}return t.prototype.set=function(t,e){return this.origin.copy(t),this.direction.copy(e),this},t}(),Wt=new Vt,Gt=new lt,Ht=new Et,Xt=new vt,qt=function(){function t(t,e){void 0===t&&(t=new vt),void 0===e&&(e=new lt(.5,.5,.5)),this.halfExtents=e,this._modelTransform=t.clone().invert(),this._worldTransform=t.clone(),this._aabb=new At(new lt,this.halfExtents)}var e=t.prototype;return e.intersectsRay=function(t,e){if(this._modelTransform.transformPoint(t.origin,Wt.origin),this._modelTransform.transformVector(t.direction,Wt.direction),e){var i=this._aabb._intersectsRay(Wt,e);return Xt.copy(this._modelTransform).invert().transformPoint(e,e),i}return this._aabb._fastIntersectsRay(Wt)},e.containsPoint=function(t){return this._modelTransform.transformPoint(t,Gt),this._aabb.containsPoint(Gt)},e.intersectsBoundingSphere=function(t){return this._modelTransform.transformPoint(t.center,Ht.center),Ht.radius=t.radius,!!this._aabb.intersectsBoundingSphere(Ht)},W(t,[{key:"worldTransform",get:function(){return this._worldTransform},set:function(t){this._worldTransform.copy(t),this._modelTransform.copy(t).invert()}}]),t}(),jt=new lt,Yt=function(){function t(t,e){void 0===t&&(t=new lt),void 0===e&&(e=new lt(0,0,1)),this.normal=e,this.point=t}var e=t.prototype;return e.intersectsLine=function(t,e,i){var n=-this.normal.dot(this.point),s=this.normal.dot(t)+n,a=s/(s-(this.normal.dot(e)+n)),r=a>=0&&a<=1;return r&&i&&i.lerp(t,e,a),r},e.intersectsRay=function(t,e){var i=jt.sub2(this.point,t.origin),n=this.normal.dot(i)/this.normal.dot(t.direction),s=n>=0;return s&&e&&e.copy(t.direction).mulScalar(n).add(t.origin),s},t}(),Kt=10,Zt=11,$t=12,Qt=13,Jt=14,te=16,ee=17,ie=21,ne=24,se=25,ae="POSITION",re="NORMAL",oe="TANGENT",he="BLENDWEIGHT",le="BLENDINDICES",ce="COLOR",ue="TEXCOORD",de="TEXCOORD0",fe="TEXCOORD1",pe="TEXCOORD2",me="TEXCOORD3",_e="TEXCOORD4",ge="TEXCOORD5",ve="TEXCOORD6",ye="TEXCOORD7",xe="ATTR",be="ATTR0",Se="ATTR1",we="ATTR2",Te="ATTR3",Ae="ATTR4",Me="ATTR5",Ce="ATTR6",Ee="ATTR7",Pe="ATTR8",Re="ATTR9",Ie="ATTR10",Le="ATTR11",De="ATTR12",ke="ATTR13",Oe="ATTR14",Fe="ATTR15",Be="default",Ne="rgbm",Ue="rgbe",ze="swizzleGGGR",Ve="none",We="cube",Ge="equirect",He="octahedral",Xe=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array],qe=[1,1,2,2,4,4,4],je={Int8Array:0,Uint8Array:1,Int16Array:2,Uint16Array:3,Int32Array:4,Uint32Array:5,Float32Array:6},Ye=[Uint8Array,Uint16Array,Uint32Array],Ke=[1,2,4],Ze={POSITION:0,NORMAL:1,BLENDWEIGHT:2,BLENDINDICES:3,COLOR:4,TEXCOORD0:5,TEXCOORD1:6,TEXCOORD2:7,TEXCOORD3:8,TEXCOORD4:9,TEXCOORD5:10,TEXCOORD6:11,TEXCOORD7:12,TANGENT:13,ATTR0:0,ATTR1:1,ATTR2:2,ATTR3:3,ATTR4:4,ATTR5:5,ATTR6:6,ATTR7:7,ATTR8:8,ATTR9:9,ATTR10:10,ATTR11:11,ATTR12:12,ATTR13:13,ATTR14:14,ATTR15:15},$e=0,Qe=function(){function t(t,e,i,n,s){void 0===n&&(n=0),this.device=t,this.format=e,this.numVertices=i,this.usage=n,this.id=$e++,this.impl=t.createVertexBufferImpl(this,e),this.instancing=!1,this.numBytes=e.verticesByteSize?e.verticesByteSize:e.size*i,t._vram.vb+=this.numBytes,s?this.setData(s):this.storage=new ArrayBuffer(this.numBytes),this.device.buffers.push(this)}var e=t.prototype;return e.destroy=function(){var t=this.device,e=t.buffers.indexOf(this);-1!==e&&t.buffers.splice(e,1),this.impl.destroy(t),t._vram.vb-=this.storage.byteLength},e.loseContext=function(){this.impl.loseContext()},e.getFormat=function(){return this.format},e.getUsage=function(){return this.usage},e.getNumVertices=function(){return this.numVertices},e.lock=function(){return this.storage},e.unlock=function(){this.impl.unlock(this)},e.setData=function(t){return t.byteLength===this.numBytes&&(this.storage=t,this.unlock(),!0)},t}();function Je(t){for(var e=0,i=0,n=t.length;i 0.5) {\n\t\tif (dAtten > 0.00001) {\n\t\t\tdirLm.xyz = dirLm.xyz * 2.0 - vec3(1.0);\n\t\t\tdAtten = saturate(dAtten);\n\t\t\tgl_FragColor.rgb = normalize(dLightDirNormW.xyz*dAtten + dirLm.xyz*dirLm.w) * 0.5 + vec3(0.5);\n\t\t\tgl_FragColor.a = dirLm.w + dAtten;\n\t\t\tgl_FragColor.a = max(gl_FragColor.a, 1.0 / 255.0);\n\t\t} else {\n\t\t\tgl_FragColor = dirLm;\n\t\t}\n\t} else {\n\t\tgl_FragColor.rgb = dirLm.xyz;\n\t\tgl_FragColor.a = max(dirLm.w, dAtten > 0.00001? (1.0/255.0) : 0.0);\n\t}\n",bakeLmEndPS:"\tgl_FragColor.rgb = dDiffuseLight;\n\tgl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(0.5));\n\tgl_FragColor.rgb /= 8.0;\n\tgl_FragColor.a = clamp( max( max( gl_FragColor.r, gl_FragColor.g ), max( gl_FragColor.b, 1.0 / 255.0 ) ), 0.0,1.0 );\n\tgl_FragColor.a = ceil(gl_FragColor.a * 255.0) / 255.0;\n\tgl_FragColor.rgb /= gl_FragColor.a;\n",basePS:"uniform vec3 view_position;\nuniform vec3 light_globalAmbient;\nfloat square(float x) {\n\treturn x*x;\n}\nfloat saturate(float x) {\n\treturn clamp(x, 0.0, 1.0);\n}\nvec3 saturate(vec3 x) {\n\treturn clamp(x, vec3(0.0), vec3(1.0));\n}\n",baseVS:"attribute vec3 vertex_position;\nattribute vec3 vertex_normal;\nattribute vec4 vertex_tangent;\nattribute vec2 vertex_texCoord0;\nattribute vec2 vertex_texCoord1;\nattribute vec4 vertex_color;\nuniform mat4 matrix_viewProjection;\nuniform mat4 matrix_model;\nuniform mat3 matrix_normal;\nvec3 dPositionW;\nmat4 dModelMatrix;\nmat3 dNormalMatrix;\n",baseNineSlicedPS:"#define NINESLICED\nvarying vec2 vMask;\nvarying vec2 vTiledUv;\nuniform mediump vec4 innerOffset;\nuniform mediump vec2 outerScale;\nuniform mediump vec4 atlasRect;\nvec2 nineSlicedUv;\n",baseNineSlicedVS:"#define NINESLICED\nvarying vec2 vMask;\nvarying vec2 vTiledUv;\nuniform mediump vec4 innerOffset;\nuniform mediump vec2 outerScale;\nuniform mediump vec4 atlasRect;\n",baseNineSlicedTiledPS:"#define NINESLICED\n#define NINESLICETILED\nvarying vec2 vMask;\nvarying vec2 vTiledUv;\nuniform mediump vec4 innerOffset;\nuniform mediump vec2 outerScale;\nuniform mediump vec4 atlasRect;\nvec2 nineSlicedUv;\n",biasConstPS:"#define SHADOWBIAS\nfloat getShadowBias(float resolution, float maxBias) {\n\treturn maxBias;\n}\n",blurVSMPS:"varying vec2 vUv0;\nuniform sampler2D source;\nuniform vec2 pixelOffset;\n#ifdef GAUSS\nuniform float weight[SAMPLES];\n#endif\n#ifdef PACKED\nfloat decodeFloatRG(vec2 rg) {\n\treturn rg.y*(1.0/255.0) + rg.x;\n}\nvec2 encodeFloatRG( float v ) {\n\tvec2 enc = vec2(1.0, 255.0) * v;\n\tenc = fract(enc);\n\tenc -= enc.yy * vec2(1.0/255.0, 1.0/255.0);\n\treturn enc;\n}\n#endif\nvoid main(void) {\n\tvec3 moments = vec3(0.0);\n\tvec2 uv = vUv0 - pixelOffset * (float(SAMPLES) * 0.5);\n\tfor (int i=0; i shadowZ ? 1.0 : 0.0;\n\t}\n\t#endif\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF3) || defined(CLUSTER_SHADOW_TYPE_PCF5)\n\tfloat getShadowOmniClusteredPCF3(sampler2D shadowMap, vec4 shadowParams, vec3 omniAtlasViewport, float shadowEdgePixels, vec3 dir) {\n\t\tfloat shadowTextureResolution = shadowParams.x;\n\t\tvec2 uv = getCubemapAtlasCoordinates(omniAtlasViewport, shadowEdgePixels, shadowTextureResolution, dir);\n\t\tfloat shadowZ = length(dir) * shadowParams.w + shadowParams.z;\n\t\tdShadowCoord = vec3(uv, shadowZ);\n\t\treturn getShadowPCF3x3(shadowMap, shadowParams.xyz);\n\t}\n\t#endif\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF5)\n\tfloat getShadowOmniClusteredPCF5(sampler2D shadowMap, vec4 shadowParams, vec3 omniAtlasViewport, float shadowEdgePixels, vec3 dir) {\n\t\treturn getShadowOmniClusteredPCF3(shadowMap, shadowParams, omniAtlasViewport, shadowEdgePixels, dir);\n\t}\n\t#endif\n#endif\n#ifdef GL2\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF1)\n\tfloat getShadowSpotClusteredPCF1(sampler2DShadow shadowMap, vec4 shadowParams) {\n\t\treturn texture(shadowMap, dShadowCoord);\n\t}\n\t#endif\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF3)\n\tfloat getShadowSpotClusteredPCF3(sampler2DShadow shadowMap, vec4 shadowParams) {\n\t\treturn getShadowSpotPCF3x3(shadowMap, shadowParams);\n\t}\n\t#endif\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF5)\n\tfloat getShadowSpotClusteredPCF5(sampler2DShadow shadowMap, vec4 shadowParams) {\n\t\treturn getShadowPCF5x5(shadowMap, shadowParams.xyz);\n\t}\n\t#endif\n#else\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF1)\n\tfloat getShadowSpotClusteredPCF1(sampler2D shadowMap, vec4 shadowParams) {\n\t\tfloat depth = unpackFloat(texture2D(shadowMap, dShadowCoord.xy));\n\t\treturn depth > dShadowCoord.z ? 1.0 : 0.0;\n\t}\n\t#endif\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF3) || defined(CLUSTER_SHADOW_TYPE_PCF5)\n\tfloat getShadowSpotClusteredPCF3(sampler2D shadowMap, vec4 shadowParams) {\n\t\treturn getShadowSpotPCF3x3(shadowMap, shadowParams);\n\t}\n\t#endif\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF5)\n\tfloat getShadowSpotClusteredPCF5(sampler2D shadowMap, vec4 shadowParams) {\n\t\treturn getShadowSpotClusteredPCF3(shadowMap, shadowParams);\n\t}\n\t#endif\n#endif\n",clusteredLightUtilsPS:"vec2 getCubemapFaceCoordinates(const vec3 dir, out float faceIndex, out vec2 tileOffset)\n{\n\tvec3 vAbs = abs(dir);\n\tfloat ma;\n\tvec2 uv;\n\tif (vAbs.z >= vAbs.x && vAbs.z >= vAbs.y) {\n\t\tfaceIndex = dir.z < 0.0 ? 5.0 : 4.0;\n\t\tma = 0.5 / vAbs.z;\n\t\tuv = vec2(dir.z < 0.0 ? -dir.x : dir.x, -dir.y);\n\t\ttileOffset.x = 2.0;\n\t\ttileOffset.y = dir.z < 0.0 ? 1.0 : 0.0;\n\t} else if(vAbs.y >= vAbs.x) {\n\t\tfaceIndex = dir.y < 0.0 ? 3.0 : 2.0;\n\t\tma = 0.5 / vAbs.y;\n\t\tuv = vec2(dir.x, dir.y < 0.0 ? -dir.z : dir.z);\n\t\ttileOffset.x = 1.0;\n\t\ttileOffset.y = dir.y < 0.0 ? 1.0 : 0.0;\n\t} else {\n\t\tfaceIndex = dir.x < 0.0 ? 1.0 : 0.0;\n\t\tma = 0.5 / vAbs.x;\n\t\tuv = vec2(dir.x < 0.0 ? dir.z : -dir.z, -dir.y);\n\t\ttileOffset.x = 0.0;\n\t\ttileOffset.y = dir.x < 0.0 ? 1.0 : 0.0;\n\t}\n\treturn uv * ma + 0.5;\n}\nvec2 getCubemapAtlasCoordinates(const vec3 omniAtlasViewport, float shadowEdgePixels, float shadowTextureResolution, const vec3 dir) {\n\tfloat faceIndex;\n\tvec2 tileOffset;\n\tvec2 uv = getCubemapFaceCoordinates(dir, faceIndex, tileOffset);\n\tfloat atlasFaceSize = omniAtlasViewport.z;\n\tfloat tileSize = shadowTextureResolution * atlasFaceSize;\n\tfloat offset = shadowEdgePixels / tileSize;\n\tuv = uv * vec2(1.0 - offset * 2.0) + vec2(offset * 1.0);\n\tuv *= atlasFaceSize;\n\tuv += tileOffset * atlasFaceSize;\n\tuv += omniAtlasViewport.xy;\n\treturn uv;\n}\n",clusteredLightPS:"uniform sampler2D clusterWorldTexture;\nuniform sampler2D lightsTexture8;\nuniform highp sampler2D lightsTextureFloat;\n#ifdef CLUSTER_SHADOWS\n\t#ifdef GL2\n\t\tuniform sampler2DShadow shadowAtlasTexture;\n\t#else\n\t\tuniform sampler2D shadowAtlasTexture;\n\t#endif\n#endif\n#ifdef CLUSTER_COOKIES\n\tuniform sampler2D cookieAtlasTexture;\n#endif\nuniform float clusterPixelsPerCell;\nuniform vec3 clusterCellsCountByBoundsSize;\nuniform vec4 lightsTextureInvSize;\nuniform vec3 clusterTextureSize;\nuniform vec3 clusterBoundsMin;\nuniform vec3 clusterBoundsDelta;\nuniform vec3 clusterCellsDot;\nuniform vec3 clusterCellsMax;\nuniform vec2 clusterCompressionLimit0;\nuniform vec2 shadowAtlasParams;\nfloat LTCLightValuesEvaluated = 0.0;\nstruct ClusterLightData {\n\tfloat lightV;\n\tfloat type;\n\tfloat shape;\n\tvec3 halfWidth;\n\tvec3 halfHeight;\n\tfloat falloffMode;\n\tfloat castShadows;\n\tfloat shadowBias;\n\tfloat shadowNormalBias;\n\tvec3 position;\n\tvec3 direction;\n\tfloat range;\n\tfloat innerConeAngleCos;\n\tfloat outerConeAngleCos;\n\tvec3 color;\n\tvec3 omniAtlasViewport;\n\tfloat cookie;\n\tfloat cookieRgb;\n\tfloat cookieIntensity;\n\tvec4 cookieChannelMask;\n\tfloat mask;\n};\nmat4 lightProjectionMatrix;\n#define isClusteredLightCastShadow(light) ( light.castShadows > 0.5 )\n#define isClusteredLightCookie(light) (light.cookie > 0.5 )\n#define isClusteredLightCookieRgb(light) (light.cookieRgb > 0.5 )\n#define isClusteredLightSpot(light) ( light.type > 0.5 )\n#define isClusteredLightFalloffLinear(light) ( light.falloffMode < 0.5 )\n#define isClusteredLightArea(light) ( light.shape > 0.1 )\n#define isClusteredLightRect(light) ( light.shape < 0.3 )\n#define isClusteredLightDisk(light) ( light.shape < 0.6 )\n#ifdef CLUSTER_MESH_DYNAMIC_LIGHTS\n\t#define acceptLightMask(light) ( light.mask < 0.75)\n#else\n\t#define acceptLightMask(light) ( light.mask > 0.25)\n#endif\nvec4 decodeClusterLowRange4Vec4(vec4 d0, vec4 d1, vec4 d2, vec4 d3) {\n\treturn vec4(\n\t\tbytes2floatRange4(d0, -2.0, 2.0),\n\t\tbytes2floatRange4(d1, -2.0, 2.0),\n\t\tbytes2floatRange4(d2, -2.0, 2.0),\n\t\tbytes2floatRange4(d3, -2.0, 2.0)\n\t);\n}\n#ifdef SUPPORTS_TEXLOD\n\t#define textureData(texture, uv) texture2DLodEXT(texture, uv, 0.0)\n#else\n\t#define textureData(texture, uv) texture2D(texture, uv)\n#endif\nvec4 sampleLightsTexture8(const ClusterLightData clusterLightData, float index) {\n\treturn textureData(lightsTexture8, vec2(index * lightsTextureInvSize.z, clusterLightData.lightV));\n}\nvec4 sampleLightTextureF(const ClusterLightData clusterLightData, float index) {\n\treturn textureData(lightsTextureFloat, vec2(index * lightsTextureInvSize.x, clusterLightData.lightV));\n}\nvoid decodeClusterLightCore(inout ClusterLightData clusterLightData, float lightIndex) {\n\tclusterLightData.lightV = (lightIndex + 0.5) * lightsTextureInvSize.w;\n\tvec4 lightInfo = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_FLAGS);\n\tclusterLightData.type = lightInfo.x;\n\tclusterLightData.shape = lightInfo.y;\n\tclusterLightData.falloffMode = lightInfo.z;\n\tclusterLightData.castShadows = lightInfo.w;\n\tvec4 colorA = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_COLOR_A);\n\tvec4 colorB = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_COLOR_B);\n\tclusterLightData.color = vec3(bytes2float2(colorA.xy), bytes2float2(colorA.zw), bytes2float2(colorB.xy)) * clusterCompressionLimit0.y;\n\tclusterLightData.cookie = colorB.z;\n\tclusterLightData.mask = colorB.w;\n\t#ifdef CLUSTER_TEXTURE_FLOAT\n\t\tvec4 lightPosRange = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_POSITION_RANGE);\n\t\tclusterLightData.position = lightPosRange.xyz;\n\t\tclusterLightData.range = lightPosRange.w;\n\t\tvec4 lightDir_Unused = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_SPOT_DIRECTION);\n\t\tclusterLightData.direction = lightDir_Unused.xyz;\n\t#else\n\t\tvec4 encPosX = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_POSITION_X);\n\t\tvec4 encPosY = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_POSITION_Y);\n\t\tvec4 encPosZ = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_POSITION_Z);\n\t\tclusterLightData.position = vec3(bytes2float4(encPosX), bytes2float4(encPosY), bytes2float4(encPosZ)) * clusterBoundsDelta + clusterBoundsMin;\n\t\tvec4 encRange = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_RANGE);\n\t\tclusterLightData.range = bytes2float4(encRange) * clusterCompressionLimit0.x;\n\t\tvec4 encDirX = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_SPOT_DIRECTION_X);\n\t\tvec4 encDirY = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_SPOT_DIRECTION_Y);\n\t\tvec4 encDirZ = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_SPOT_DIRECTION_Z);\n\t\tclusterLightData.direction = vec3(bytes2float4(encDirX), bytes2float4(encDirY), bytes2float4(encDirZ)) * 2.0 - 1.0;\n\t#endif\n}\nvoid decodeClusterLightSpot(inout ClusterLightData clusterLightData) {\n\tvec4 coneAngle = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_SPOT_ANGLES);\n\tclusterLightData.innerConeAngleCos = bytes2float2(coneAngle.xy) * 2.0 - 1.0;\n\tclusterLightData.outerConeAngleCos = bytes2float2(coneAngle.zw) * 2.0 - 1.0;\n}\nvoid decodeClusterLightOmniAtlasViewport(inout ClusterLightData clusterLightData) {\n\t#ifdef CLUSTER_TEXTURE_FLOAT\n\t\tclusterLightData.omniAtlasViewport = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_PROJ_MAT_0).xyz;\n\t#else\n\t\tvec4 viewportA = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_ATLAS_VIEWPORT_A);\n\t\tvec4 viewportB = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_ATLAS_VIEWPORT_B);\n\t\tclusterLightData.omniAtlasViewport = vec3(bytes2float2(viewportA.xy), bytes2float2(viewportA.zw), bytes2float2(viewportB.xy));\n\t#endif\n}\nvoid decodeClusterLightAreaData(inout ClusterLightData clusterLightData) {\n\t#ifdef CLUSTER_TEXTURE_FLOAT\n\t\tclusterLightData.halfWidth = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_AREA_DATA_WIDTH).xyz;\n\t\tclusterLightData.halfHeight = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_AREA_DATA_HEIGHT).xyz;\n\t#else\n\t\tvec4 areaWidthX = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_WIDTH_X);\n\t\tvec4 areaWidthY = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_WIDTH_Y);\n\t\tvec4 areaWidthZ = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_WIDTH_Z);\n\t\tclusterLightData.halfWidth = vec3(mantissaExponent2Float(areaWidthX), mantissaExponent2Float(areaWidthY), mantissaExponent2Float(areaWidthZ));\n\t\tvec4 areaHeightX = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_HEIGHT_X);\n\t\tvec4 areaHeightY = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_HEIGHT_Y);\n\t\tvec4 areaHeightZ = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_HEIGHT_Z);\n\t\tclusterLightData.halfHeight = vec3(mantissaExponent2Float(areaHeightX), mantissaExponent2Float(areaHeightY), mantissaExponent2Float(areaHeightZ));\n\t#endif\n}\nvoid decodeClusterLightProjectionMatrixData(inout ClusterLightData clusterLightData) {\n\t#ifdef CLUSTER_TEXTURE_FLOAT\n\t\tvec4 m0 = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_PROJ_MAT_0);\n\t\tvec4 m1 = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_PROJ_MAT_1);\n\t\tvec4 m2 = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_PROJ_MAT_2);\n\t\tvec4 m3 = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_PROJ_MAT_3);\n\t#else\n\t\tvec4 m00 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_00);\n\t\tvec4 m01 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_01);\n\t\tvec4 m02 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_02);\n\t\tvec4 m03 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_03);\n\t\tvec4 m0 = decodeClusterLowRange4Vec4(m00, m01, m02, m03);\n\t\tvec4 m10 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_10);\n\t\tvec4 m11 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_11);\n\t\tvec4 m12 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_12);\n\t\tvec4 m13 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_13);\n\t\tvec4 m1 = decodeClusterLowRange4Vec4(m10, m11, m12, m13);\n\t\tvec4 m20 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_20);\n\t\tvec4 m21 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_21);\n\t\tvec4 m22 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_22);\n\t\tvec4 m23 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_23);\n\t\tvec4 m2 = decodeClusterLowRange4Vec4(m20, m21, m22, m23);\n\t\tvec4 m30 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_30);\n\t\tvec4 m31 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_31);\n\t\tvec4 m32 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_32);\n\t\tvec4 m33 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_33);\n\t\tvec4 m3 = vec4(mantissaExponent2Float(m30), mantissaExponent2Float(m31), mantissaExponent2Float(m32), mantissaExponent2Float(m33));\n\t#endif\n\tlightProjectionMatrix = mat4(m0, m1, m2, m3);\n}\nvoid decodeClusterLightShadowData(inout ClusterLightData clusterLightData) {\n\tvec4 biases = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_SHADOW_BIAS);\n\tclusterLightData.shadowBias = bytes2floatRange2(biases.xy, -1.0, 20.0),\n\tclusterLightData.shadowNormalBias = bytes2float2(biases.zw);\n}\nvoid decodeClusterLightCookieData(inout ClusterLightData clusterLightData) {\n\tvec4 cookieA = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_COOKIE_A);\n\tclusterLightData.cookieIntensity = cookieA.x;\n\tclusterLightData.cookieRgb = cookieA.y;\n\tclusterLightData.cookieChannelMask = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_COOKIE_B);\n}\nvoid evaluateLight(ClusterLightData light) {\n\tdAtten3 = vec3(1.0);\n\tgetLightDirPoint(light.position);\n\t#ifdef CLUSTER_AREALIGHTS\n\tif (isClusteredLightArea(light)) {\n\t\tdecodeClusterLightAreaData(light);\n\t\tif (LTCLightValuesEvaluated < 0.5) {\n\t\t\tLTCLightValuesEvaluated = 1.0;\n\t\t\tcalcLTCLightValues();\n\t\t}\n\t\tif (isClusteredLightRect(light)) {\n\t\t\tcalcRectLightValues(light.position, light.halfWidth, light.halfHeight);\n\t\t} else if (isClusteredLightDisk(light)) {\n\t\t\tcalcDiskLightValues(light.position, light.halfWidth, light.halfHeight);\n\t\t} else {\n\t\t\tcalcSphereLightValues(light.position, light.halfWidth, light.halfHeight);\n\t\t}\n\t\tdAtten = getFalloffWindow(light.range);\n\t} else\n\t#endif\n\t{\n\t\tif (isClusteredLightFalloffLinear(light))\n\t\t\tdAtten = getFalloffLinear(light.range);\n\t\telse\n\t\t\tdAtten = getFalloffInvSquared(light.range);\n\t}\n\tif (dAtten > 0.00001) {\n\t\t#ifdef CLUSTER_AREALIGHTS\n\t\tif (isClusteredLightArea(light)) {\n\t\t\tif (isClusteredLightRect(light)) {\n\t\t\t\tdAttenD = getRectLightDiffuse() * 16.0;\n\t\t\t} else if (isClusteredLightDisk(light)) {\n\t\t\t\tdAttenD = getDiskLightDiffuse() * 16.0;\n\t\t\t} else {\n\t\t\t\tdAttenD = getSphereLightDiffuse() * 16.0;\n\t\t\t}\n\t\t} else\n\t\t#endif\n\t\t{\n\t\t\tdAtten *= getLightDiffuse();\n\t\t}\n\t\tif (isClusteredLightSpot(light)) {\n\t\t\tdecodeClusterLightSpot(light);\n\t\t\tdAtten *= getSpotEffect(light.direction, light.innerConeAngleCos, light.outerConeAngleCos);\n\t\t}\n\t\t#if defined(CLUSTER_COOKIES) || defined(CLUSTER_SHADOWS)\n\t\tif (dAtten > 0.00001) {\n\t\t\tif (isClusteredLightCastShadow(light) || isClusteredLightCookie(light)) {\n\t\t\t\tif (isClusteredLightSpot(light)) {\n\t\t\t\t\tdecodeClusterLightProjectionMatrixData(light);\n\t\t\t\t} else {\n\t\t\t\t\tdecodeClusterLightOmniAtlasViewport(light);\n\t\t\t\t}\n\t\t\t\tfloat shadowTextureResolution = shadowAtlasParams.x;\n\t\t\t\tfloat shadowEdgePixels = shadowAtlasParams.y;\n\t\t\t\t#ifdef CLUSTER_COOKIES\n\t\t\t\tif (isClusteredLightCookie(light)) {\n\t\t\t\t\tdecodeClusterLightCookieData(light);\n\t\t\t\t\tif (isClusteredLightSpot(light)) {\n\t\t\t\t\t\tdAtten3 = getCookie2DClustered(cookieAtlasTexture, lightProjectionMatrix, vPositionW, light.cookieIntensity, isClusteredLightCookieRgb(light), light.cookieChannelMask);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdAtten3 = getCookieCubeClustered(cookieAtlasTexture, dLightDirW, light.cookieIntensity, isClusteredLightCookieRgb(light), light.cookieChannelMask, shadowTextureResolution, shadowEdgePixels, light.omniAtlasViewport);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t#endif\n\t\t\t\t#ifdef CLUSTER_SHADOWS\n\t\t\t\tif (isClusteredLightCastShadow(light)) {\n\t\t\t\t\tdecodeClusterLightShadowData(light);\n\t\t\t\t\tvec4 shadowParams = vec4(shadowTextureResolution, light.shadowNormalBias, light.shadowBias, 1.0 / light.range);\n\t\t\t\t\tif (isClusteredLightSpot(light)) {\n\t\t\t\t\t\tgetShadowCoordPerspZbufferNormalOffset(lightProjectionMatrix, shadowParams);\n\t\t\t\t\t\t#if defined(CLUSTER_SHADOW_TYPE_PCF1)\n\t\t\t\t\t\t\tdAtten *= getShadowSpotClusteredPCF1(shadowAtlasTexture, shadowParams);\n\t\t\t\t\t\t#elif defined(CLUSTER_SHADOW_TYPE_PCF3)\n\t\t\t\t\t\t\tdAtten *= getShadowSpotClusteredPCF3(shadowAtlasTexture, shadowParams);\n\t\t\t\t\t\t#elif defined(CLUSTER_SHADOW_TYPE_PCF5)\n\t\t\t\t\t\t\tdAtten *= getShadowSpotClusteredPCF5(shadowAtlasTexture, shadowParams);\n\t\t\t\t\t\t#endif\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnormalOffsetPointShadow(shadowParams);\n\t\t\t\t\t\t#if defined(CLUSTER_SHADOW_TYPE_PCF1)\n\t\t\t\t\t\t\tdAtten *= getShadowOmniClusteredPCF1(shadowAtlasTexture, shadowParams, light.omniAtlasViewport, shadowEdgePixels, dLightDirW);\n\t\t\t\t\t\t#elif defined(CLUSTER_SHADOW_TYPE_PCF3)\n\t\t\t\t\t\t\tdAtten *= getShadowOmniClusteredPCF3(shadowAtlasTexture, shadowParams, light.omniAtlasViewport, shadowEdgePixels, dLightDirW);\n\t\t\t\t\t\t#elif defined(CLUSTER_SHADOW_TYPE_PCF5)\n\t\t\t\t\t\t\tdAtten *= getShadowOmniClusteredPCF5(shadowAtlasTexture, shadowParams, light.omniAtlasViewport, shadowEdgePixels, dLightDirW);\n\t\t\t\t\t\t#endif\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t#endif\n\t\t\t}\n\t\t}\n\t\t#endif\n\t\t#ifdef CLUSTER_AREALIGHTS\n\t\tif (isClusteredLightArea(light)) {\n\t\t\t{\n\t\t\t\tvec3 areaDiffuse = (dAttenD * dAtten) * light.color * dAtten3;\n\t\t\t\t#if defined(CLUSTER_SPECULAR) && defined(CLUSTER_CONSERVE_ENERGY)\n\t\t\t\t\tareaDiffuse = mix(areaDiffuse, vec3(0), dLTCSpecFres);\n\t\t\t\t#endif\n\t\t\t\tdDiffuseLight += areaDiffuse;\n\t\t\t}\n\t\t\t#ifdef CLUSTER_SPECULAR\n\t\t\t\tfloat areaLightSpecular;\n\t\t\t\tif (isClusteredLightRect(light)) {\n\t\t\t\t\tareaLightSpecular = getRectLightSpecular();\n\t\t\t\t} else if (isClusteredLightDisk(light)) {\n\t\t\t\t\tareaLightSpecular = getDiskLightSpecular();\n\t\t\t\t} else {\n\t\t\t\t\tareaLightSpecular = getSphereLightSpecular();\n\t\t\t\t}\n\t\t\t\tdSpecularLight += dLTCSpecFres * areaLightSpecular * dAtten * light.color * dAtten3;\n\t\t\t\t#ifdef CLUSTER_CLEAR_COAT\n\t\t\t\t\tfloat areaLightSpecularCC;\n\t\t\t\t\tif (isClusteredLightRect(light)) {\n\t\t\t\t\t\tareaLightSpecularCC = getRectLightSpecularCC();\n\t\t\t\t\t} else if (isClusteredLightDisk(light)) {\n\t\t\t\t\t\tareaLightSpecularCC = getDiskLightSpecularCC();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tareaLightSpecularCC = getSphereLightSpecularCC();\n\t\t\t\t\t}\n\t\t\t\t\tccSpecularLight += ccLTCSpecFres * areaLightSpecularCC * dAtten * light.color\t* dAtten3;\n\t\t\t\t#endif\n\t\t\t#endif\n\t\t} else\n\t\t#endif\n\t\t{\n\t\t\t{\n\t\t\t\tvec3 punctualDiffuse = dAtten * light.color * dAtten3;\n\t\t\t\t#if defined(CLUSTER_AREALIGHTS) && defined(CLUSTER_SPECULAR) && defined(CLUSTER_CONSERVE_ENERGY)\n\t\t\t\t\tpunctualDiffuse = mix(punctualDiffuse, vec3(0), dSpecularity);\n\t\t\t\t#endif\n\t\t\t\tdDiffuseLight += punctualDiffuse;\n\t\t\t}\n\t\t\t#ifdef CLUSTER_SPECULAR\n\t\t\t\t{\n\t\t\t\t\tvec3 punctualSpecular = getLightSpecular() * dAtten * light.color * dAtten3;\n\t\t\t\t\t#if defined(CLUSTER_AREALIGHTS)\n\t\t\t\t\t\tpunctualSpecular *= dSpecularity;\n\t\t\t\t\t#endif\n\t\t\t\t\tdSpecularLight += punctualSpecular;\n\t\t\t\t}\n\t\t\t\t#ifdef CLUSTER_CLEAR_COAT\n\t\t\t\t\tvec3 punctualCC = getLightSpecularCC() * dAtten * light.color * dAtten3;\n\t\t\t\t\t#if defined(CLUSTER_AREALIGHTS)\n\t\t\t\t\t\tpunctualCC *= ccSpecularity;\n\t\t\t\t\t#endif\n\t\t\t\t\tccSpecularLight += punctualCC;\n\t\t\t\t#endif\n\t\t\t#endif\n\t\t}\n\t}\n}\nvoid evaluateClusterLight(float lightIndex) {\n\tClusterLightData clusterLightData;\n\tdecodeClusterLightCore(clusterLightData, lightIndex);\n\tif (acceptLightMask(clusterLightData))\n\t\tevaluateLight(clusterLightData);\n}\nvoid addClusteredLights() {\n\tvec3 cellCoords = floor((vPositionW - clusterBoundsMin) * clusterCellsCountByBoundsSize);\n\tif (!(any(lessThan(cellCoords, vec3(0.0))) || any(greaterThanEqual(cellCoords, clusterCellsMax)))) {\n\t\tfloat cellIndex = dot(clusterCellsDot, cellCoords);\n\t\tfloat clusterV = floor(cellIndex * clusterTextureSize.y);\n\t\tfloat clusterU = cellIndex - (clusterV * clusterTextureSize.x);\n\t\tclusterV = (clusterV + 0.5) * clusterTextureSize.z;\n\t\tconst float maxLightCells = 256.0 / 4.0;\n\t\tfor (float lightCellIndex = 0.5; lightCellIndex < maxLightCells; lightCellIndex++) {\n\t\t\tvec4 lightIndices = textureData(clusterWorldTexture, vec2(clusterTextureSize.y * (clusterU + lightCellIndex), clusterV));\n\t\t\tvec4 indices = lightIndices * 255.0;\n\t\t\tfor (int i = 0; i < 4; i++) {\n\t\t\t\tif (indices.x <= 0.0)\n\t\t\t\t\treturn;\n\t\t\t\tevaluateClusterLight(indices.x);\n\t\t\t\tindices = indices.yzwx;\n\t\t\t}\n\t\t\tif (lightCellIndex > clusterPixelsPerCell) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n",combineClearCoatPS:"vec3 combineColorCC() {\n\treturn combineColor()+(ccSpecularLight*ccSpecularity+ccReflection.rgb*ccSpecularity*ccReflection.a);\n}\n",combineDiffusePS:"vec3 combineColor() {\n\treturn dAlbedo * dDiffuseLight;\n}\n",combineDiffuseSpecularPS:"vec3 combineColor() {\n\treturn mix(dAlbedo * dDiffuseLight, dSpecularLight + dReflection.rgb * dReflection.a, dSpecularity);\n}\n",combineDiffuseSpecularNoConservePS:"vec3 combineColor() {\n\treturn dAlbedo * dDiffuseLight + (dSpecularLight + dReflection.rgb * dReflection.a) * dSpecularity;\n}\n",combineDiffuseSpecularNoReflPS:"vec3 combineColor() {\n\treturn dAlbedo * dDiffuseLight + dSpecularLight * dSpecularity;\n}\n",combineDiffuseSpecularNoReflSeparateAmbientPS:"uniform vec3 material_ambient;\nvec3 combineColor() {\n\treturn (dDiffuseLight - light_globalAmbient) * dAlbedo + dSpecularLight * dSpecularity + material_ambient * light_globalAmbient;\n}\n",combineDiffuseSpecularOldPS:"vec3 combineColor() {\n\treturn mix(dAlbedo * dDiffuseLight + dSpecularLight * dSpecularity, dReflection.rgb, dReflection.a);\n}\n",cookiePS:"vec4 getCookie2D(sampler2D tex, mat4 transform, float intensity) {\n\tvec4 projPos = transform * vec4(vPositionW, 1.0);\n\tprojPos.xy /= projPos.w;\n\treturn mix(vec4(1.0), texture2D(tex, projPos.xy), intensity);\n}\nvec4 getCookie2DClip(sampler2D tex, mat4 transform, float intensity) {\n\tvec4 projPos = transform * vec4(vPositionW, 1.0);\n\tprojPos.xy /= projPos.w;\n\tif (projPos.x < 0.0 || projPos.x > 1.0 || projPos.y < 0.0 || projPos.y > 1.0 || projPos.z < 0.0) return vec4(0.0);\n\treturn mix(vec4(1.0), texture2D(tex, projPos.xy), intensity);\n}\nvec4 getCookie2DXform(sampler2D tex, mat4 transform, float intensity, vec4 cookieMatrix, vec2 cookieOffset) {\n\tvec4 projPos = transform * vec4(vPositionW, 1.0);\n\tprojPos.xy /= projPos.w;\n\tprojPos.xy += cookieOffset;\n\tvec2 uv = mat2(cookieMatrix) * (projPos.xy-vec2(0.5)) + vec2(0.5);\n\treturn mix(vec4(1.0), texture2D(tex, uv), intensity);\n}\nvec4 getCookie2DClipXform(sampler2D tex, mat4 transform, float intensity, vec4 cookieMatrix, vec2 cookieOffset) {\n\tvec4 projPos = transform * vec4(vPositionW, 1.0);\n\tprojPos.xy /= projPos.w;\n\tprojPos.xy += cookieOffset;\n\tif (projPos.x < 0.0 || projPos.x > 1.0 || projPos.y < 0.0 || projPos.y > 1.0 || projPos.z < 0.0) return vec4(0.0);\n\tvec2 uv = mat2(cookieMatrix) * (projPos.xy-vec2(0.5)) + vec2(0.5);\n\treturn mix(vec4(1.0), texture2D(tex, uv), intensity);\n}\nvec4 getCookieCube(samplerCube tex, mat4 transform, float intensity) {\n\treturn mix(vec4(1.0), textureCube(tex, dLightDirNormW * mat3(transform)), intensity);\n}\n",cubeMapProjectBoxPS:"uniform vec3 envBoxMin, envBoxMax;\nvec3 cubeMapProject(vec3 nrdir) {\n\tnrdir = cubeMapRotate(nrdir);\n\tvec3 rbmax = (envBoxMax - vPositionW) / nrdir;\n\tvec3 rbmin = (envBoxMin - vPositionW) / nrdir;\n\tvec3 rbminmax;\n\trbminmax.x = nrdir.x>0.0? rbmax.x : rbmin.x;\n\trbminmax.y = nrdir.y>0.0? rbmax.y : rbmin.y;\n\trbminmax.z = nrdir.z>0.0? rbmax.z : rbmin.z;\n\tfloat fa = min(min(rbminmax.x, rbminmax.y), rbminmax.z);\n\tvec3 posonbox = vPositionW + nrdir * fa;\n\tvec3 envBoxPos = (envBoxMin + envBoxMax) * 0.5;\n\treturn normalize(posonbox - envBoxPos);\n}\n",cubeMapProjectNonePS:"vec3 cubeMapProject(vec3 dir) {\n\treturn cubeMapRotate(dir);\n}\n",cubeMapRotatePS:"#ifdef CUBEMAP_ROTATION\nuniform mat3 cubeMapRotationMatrix;\n#endif\nvec3 cubeMapRotate(vec3 refDir) {\n#ifdef CUBEMAP_ROTATION\n\treturn refDir * cubeMapRotationMatrix;\n#else\n\treturn refDir;\n#endif\n}\n",detailModesPS:"vec3 detailMode_mul(vec3 c1, vec3 c2) {\n\treturn c1 * c2;\n}\nvec3 detailMode_add(vec3 c1, vec3 c2) {\n\treturn c1 + c2;\n}\nvec3 detailMode_screen(vec3 c1, vec3 c2) {\n\treturn 1.0 - (1.0 - c1)*(1.0 - c2);\n}\nvec3 detailMode_overlay(vec3 c1, vec3 c2) {\n\treturn mix(1.0 - 2.0*(1.0 - c1)*(1.0 - c2), 2.0*c1*c2, step(c1, vec3(0.5)));\n}\nvec3 detailMode_min(vec3 c1, vec3 c2) {\n\treturn min(c1, c2);\n}\nvec3 detailMode_max(vec3 c1, vec3 c2) {\n\treturn max(c1, c2);\n}\n",diffusePS:"#ifdef MAPCOLOR\nuniform vec3 material_diffuse;\n#endif\n#ifdef MAPTEXTURE\nuniform sampler2D texture_diffuseMap;\n#endif\nvoid getAlbedo() {\n\tdAlbedo = vec3(1.0);\n\t#ifdef MAPCOLOR\n\tdAlbedo *= material_diffuse.rgb;\n\t#endif\n\t#ifdef MAPTEXTURE\n\tdAlbedo *= gammaCorrectInput(addAlbedoDetail(texture2D(texture_diffuseMap, $UV).$CH));\n\t#endif\n\t#ifdef MAPVERTEX\n\tdAlbedo *= gammaCorrectInput(saturate(vVertexColor.$VC));\n\t#endif\n}\n",diffuseDetailMapPS:"#ifdef MAPTEXTURE\nuniform sampler2D texture_diffuseDetailMap;\n#endif\nvec3 addAlbedoDetail(vec3 albedo) {\n\t#ifdef MAPTEXTURE\n\tvec3 albedoDetail = vec3(texture2D(texture_diffuseDetailMap, $UV).$CH);\n\treturn detailMode_$DETAILMODE(albedo, albedoDetail);\n\t#else\n\treturn albedo;\n\t#endif\n}\n",dilatePS:"#define SHADER_NAME Dilate\nvarying vec2 vUv0;\nuniform sampler2D source;\nuniform vec2 pixelOffset;\nvoid main(void) {\n\tvec4 c = texture2D(source, vUv0);\n\tc = c.a>0.0? c : texture2D(source, vUv0 - pixelOffset);\n\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(0, -pixelOffset.y));\n\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(pixelOffset.x, -pixelOffset.y));\n\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(-pixelOffset.x, 0));\n\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(pixelOffset.x, 0));\n\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(-pixelOffset.x, pixelOffset.y));\n\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(0, pixelOffset.y));\n\tc = c.a>0.0? c : texture2D(source, vUv0 + pixelOffset);\n\tgl_FragColor = c;\n}\n",bilateralDeNoisePS:"#define SHADER_NAME BilateralDeNoise\nfloat normpdf3(in vec3 v, in float sigma) {\n\treturn 0.39894 * exp(-0.5 * dot(v, v) / (sigma * sigma)) / sigma;\n}\nvec3 decodeRGBM(vec4 rgbm) {\n\tvec3 color = (8.0 * rgbm.a) * rgbm.rgb;\n\treturn color * color;\n}\nfloat saturate(float x) {\n\treturn clamp(x, 0.0, 1.0);\n}\nvec4 encodeRGBM(vec3 color) {\n\tvec4 encoded;\n\tencoded.rgb = pow(color.rgb, vec3(0.5));\n\tencoded.rgb *= 1.0 / 8.0;\n\tencoded.a = saturate( max( max( encoded.r, encoded.g ), max( encoded.b, 1.0 / 255.0 ) ) );\n\tencoded.a = ceil(encoded.a * 255.0) / 255.0;\n\tencoded.rgb /= encoded.a;\n\treturn encoded;\n}\n#define MSIZE 15\nvarying vec2 vUv0;\nuniform sampler2D source;\nuniform vec2 pixelOffset;\nuniform vec2 sigmas;\nuniform float bZnorm;\nuniform float kernel[MSIZE];\nvoid main(void) {\n\tvec4 pixelRgbm = texture2D(source, vUv0);\n\tif (pixelRgbm.a <= 0.0) {\n\t\tgl_FragColor = pixelRgbm;\n\t\treturn ;\n\t}\n\tfloat sigma = sigmas.x;\n\tfloat bSigma = sigmas.y;\n\tvec3 pixelHdr = decodeRGBM(pixelRgbm);\n\tvec3 accumulatedHdr = vec3(0.0);\n\tfloat accumulatedFactor = 0.0;\n\tconst int kSize = (MSIZE-1)/2;\n\tfor (int i = -kSize; i <= kSize; ++i) {\n\t\tfor (int j = -kSize; j <= kSize; ++j) {\n\t\t\tvec2 coord = vUv0 + vec2(float(i), float(j)) * pixelOffset;\n\t\t\tvec4 rgbm = texture2D(source, coord);\n\t\t\tif (rgbm.a > 0.0) {\n\t\t\t\tvec3 hdr = decodeRGBM(rgbm);\n\t\t\t\tfloat factor = kernel[kSize + j] * kernel[kSize + i];\n\t\t\t\tfactor *= normpdf3(hdr - pixelHdr, bSigma) * bZnorm;\n\t\t\t\taccumulatedHdr += factor * hdr;\n\t\t\t\taccumulatedFactor += factor;\n\t\t\t}\n\t\t}\n\t}\n\tgl_FragColor = encodeRGBM(accumulatedHdr / accumulatedFactor);\n}\n",decodePS:"vec3 decodeLinear(vec4 raw) {\n\treturn raw.rgb;\n}\nvec3 decodeGamma(vec4 raw) {\n\treturn pow(raw.xyz, vec3(2.2));\n}\nvec3 decodeRGBM(vec4 raw) {\n\tvec3 color = (8.0 * raw.a) * raw.rgb;\n\treturn color * color;\n}\nvec3 decodeRGBE(vec4 raw) {\n\tif (raw.a == 0.0) {\n\t\treturn vec3(0.0, 0.0, 0.0);\n\t} else {\n\t\treturn raw.xyz * pow(2.0, raw.w * 255.0 - 128.0);\n\t}\n}\nconst float PI = 3.141592653589793;\nvec2 toSpherical(vec3 dir) {\n\treturn vec2(dir.xz == vec2(0.0) ? 0.0 : atan(dir.x, dir.z), asin(dir.y));\n}\nvec2 toSphericalUv(vec3 dir) {\n\tvec2 uv = toSpherical(dir) / vec2(PI * 2.0, PI) + 0.5;\n\treturn vec2(uv.x, 1.0 - uv.y);\n}\nconst float atlasSize = 512.0;\nconst float seamSize = 1.0 / atlasSize;\nvec2 mapUv(vec2 uv, vec4 rect) {\n\treturn vec2(mix(rect.x + seamSize, rect.x + rect.z - seamSize, uv.x),\n\t\t\t\tmix(rect.y + seamSize, rect.y + rect.w - seamSize, uv.y));\n}\nvec2 mapRoughnessUv(vec2 uv, float level) {\n\tfloat t = 1.0 / exp2(level);\n\treturn mapUv(uv, vec4(0, 1.0 - t, t, t * 0.5));\n}\nvec2 mapMip(vec2 uv, float level) {\n\tfloat t = 1.0 / exp2(level);\n\treturn mapUv(uv, vec4(1.0 - t, 1.0 - t, t, t * 0.5));\n}\n",emissivePS:"#ifdef MAPCOLOR\nuniform vec3 material_emissive;\n#endif\n#ifdef MAPFLOAT\nuniform float material_emissiveIntensity;\n#endif\n#ifdef MAPTEXTURE\nuniform sampler2D texture_emissiveMap;\n#endif\nvec3 getEmission() {\n\tvec3 emission = vec3(1.0);\n\t#ifdef MAPFLOAT\n\temission *= material_emissiveIntensity;\n\t#endif\n\t#ifdef MAPCOLOR\n\temission *= material_emissive;\n\t#endif\n\t#ifdef MAPTEXTURE\n\temission *= $texture2DSAMPLE(texture_emissiveMap, $UV).$CH;\n\t#endif\n\t#ifdef MAPVERTEX\n\temission *= gammaCorrectInput(saturate(vVertexColor.$VC));\n\t#endif\n\treturn emission;\n}\n",endPS:"\t#ifdef CLEARCOAT\n\tgl_FragColor.rgb = combineColorCC();\n\t#else\n\tgl_FragColor.rgb = combineColor();\n\t#endif\n\tgl_FragColor.rgb += getEmission();\n\tgl_FragColor.rgb = addFog(gl_FragColor.rgb);\n\t#ifndef HDR\n\tgl_FragColor.rgb = toneMap(gl_FragColor.rgb);\n\tgl_FragColor.rgb = gammaCorrectOutput(gl_FragColor.rgb);\n\t#endif\n",endVS:"\n",envConstPS:"vec3 processEnvironment(vec3 color) {\n\treturn color;\n}\n",envMultiplyPS:"uniform float skyboxIntensity;\nvec3 processEnvironment(vec3 color) {\n\treturn color * skyboxIntensity;\n}\n",extensionPS:"\n",extensionVS:"\n",falloffInvSquaredPS:"float getFalloffWindow(float lightRadius) {\n\tfloat sqrDist = dot(dLightDirW, dLightDirW);\n\tfloat invRadius = 1.0 / lightRadius;\n\treturn square( saturate( 1.0 - square( sqrDist * square(invRadius) ) ) );\n}\nfloat getFalloffInvSquared(float lightRadius) {\n\tfloat sqrDist = dot(dLightDirW, dLightDirW);\n\tfloat falloff = 1.0 / (sqrDist + 1.0);\n\tfloat invRadius = 1.0 / lightRadius;\n\tfalloff *= 16.0;\n\tfalloff *= square( saturate( 1.0 - square( sqrDist * square(invRadius) ) ) );\n\treturn falloff;\n}\n",falloffLinearPS:"float getFalloffLinear(float lightRadius) {\n\tfloat d = length(dLightDirW);\n\treturn max(((lightRadius - d) / lightRadius), 0.0);\n}\n",fixCubemapSeamsNonePS:"vec3 fixSeams(vec3 vec, float mipmapIndex) {\n\treturn vec;\n}\nvec3 fixSeams(vec3 vec) {\n\treturn vec;\n}\nvec3 fixSeamsStatic(vec3 vec, float invRecMipSize) {\n\treturn vec;\n}\nvec3 calcSeam(vec3 vec) {\n\treturn vec3(0);\n}\nvec3 applySeam(vec3 vec, vec3 seam, float scale) {\n\treturn vec;\n}\n",fixCubemapSeamsStretchPS:"vec3 fixSeams(vec3 vec, float mipmapIndex) {\n\tvec3 avec = abs(vec);\n\tfloat scale = 1.0 - exp2(mipmapIndex) / 128.0;\n\tfloat M = max(max(avec.x, avec.y), avec.z);\n\tif (avec.x != M) vec.x *= scale;\n\tif (avec.y != M) vec.y *= scale;\n\tif (avec.z != M) vec.z *= scale;\n\treturn vec;\n}\nvec3 fixSeams(vec3 vec) {\n\tvec3 avec = abs(vec);\n\tfloat scale = 1.0 - 1.0 / 128.0;\n\tfloat M = max(max(avec.x, avec.y), avec.z);\n\tif (avec.x != M) vec.x *= scale;\n\tif (avec.y != M) vec.y *= scale;\n\tif (avec.z != M) vec.z *= scale;\n\treturn vec;\n}\nvec3 fixSeamsStatic(vec3 vec, float invRecMipSize) {\n\tvec3 avec = abs(vec);\n\tfloat scale = invRecMipSize;\n\tfloat M = max(max(avec.x, avec.y), avec.z);\n\tif (avec.x != M) vec.x *= scale;\n\tif (avec.y != M) vec.y *= scale;\n\tif (avec.z != M) vec.z *= scale;\n\treturn vec;\n}\nvec3 calcSeam(vec3 vec) {\n\tvec3 avec = abs(vec);\n\tfloat M = max(avec.x, max(avec.y, avec.z));\n\treturn vec3(avec.x != M ? 1.0 : 0.0,\n\t\t\t\tavec.y != M ? 1.0 : 0.0,\n\t\t\t\tavec.z != M ? 1.0 : 0.0);\n}\nvec3 applySeam(vec3 vec, vec3 seam, float scale) {\n\treturn vec * (seam * -scale + vec3(1.0));\n}\n",floatUnpackingPS:"float bytes2float2(vec2 data) {\n\treturn dot(data, vec2(1.0, 1.0 / 255.0));\n}\nfloat bytes2float3(vec3 data) {\n\treturn dot(data, vec3(1.0, 1.0 / 255.0, 1.0 / 65025.0));\n}\nfloat bytes2float4(vec4 data) {\n\treturn dot(data, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));\n}\nfloat bytes2floatRange2(vec2 data, float min, float max) {\n\treturn mix(min, max, bytes2float2(data));\n}\nfloat bytes2floatRange3(vec3 data, float min, float max) {\n\treturn mix(min, max, bytes2float3(data));\n}\nfloat bytes2floatRange4(vec4 data, float min, float max) {\n\treturn mix(min, max, bytes2float4(data));\n}\nfloat mantissaExponent2Float(vec4 pack)\n{\n\tfloat value = bytes2floatRange3(pack.xyz, -1.0, 1.0);\n\tfloat exponent = floor(pack.w * 255.0 - 127.0);\n\treturn value * exp2(exponent);\n}\n",fogExpPS:"uniform vec3 fog_color;\nuniform float fog_density;\nfloat dBlendModeFogFactor = 1.0;\nvec3 addFog(vec3 color) {\n\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\tfloat fogFactor = exp(-depth * fog_density);\n\tfogFactor = clamp(fogFactor, 0.0, 1.0);\n\treturn mix(fog_color * dBlendModeFogFactor, color, fogFactor);\n}\n",fogExp2PS:"uniform vec3 fog_color;\nuniform float fog_density;\nfloat dBlendModeFogFactor = 1.0;\nvec3 addFog(vec3 color) {\n\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\tfloat fogFactor = exp(-depth * depth * fog_density * fog_density);\n\tfogFactor = clamp(fogFactor, 0.0, 1.0);\n\treturn mix(fog_color * dBlendModeFogFactor, color, fogFactor);\n}\n",fogLinearPS:"uniform vec3 fog_color;\nuniform float fog_start;\nuniform float fog_end;\nfloat dBlendModeFogFactor = 1.0;\nvec3 addFog(vec3 color) {\n\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\tfloat fogFactor = (fog_end - depth) / (fog_end - fog_start);\n\tfogFactor = clamp(fogFactor, 0.0, 1.0);\n\tfogFactor = gammaCorrectInput(fogFactor);\n\treturn mix(fog_color * dBlendModeFogFactor, color, fogFactor);\n}\n",fogNonePS:"float dBlendModeFogFactor = 1.0;\nvec3 addFog(vec3 color) {\n\treturn color;\n}\n",fresnelSchlickPS:"uniform float material_fresnelFactor;\nvoid getFresnel() {\n\tfloat fresnel = 1.0 - max(dot(dNormalW, dViewDirW), 0.0);\n\tfloat fresnel2 = fresnel * fresnel;\n\tfresnel *= fresnel2 * fresnel2;\n\tfresnel *= dGlossiness * dGlossiness;\n\tdSpecularity = dSpecularity + (1.0 - dSpecularity) * fresnel;\n\t#ifdef CLEARCOAT\n\tfresnel = 1.0 - max(dot(ccNormalW, dViewDirW), 0.0);\n\tfresnel2 = fresnel * fresnel;\n\tfresnel *= fresnel2 * fresnel2;\n\tfresnel *= ccGlossiness * ccGlossiness;\n\tccSpecularity = ccSpecularity + (1.0 - ccSpecularity) * fresnel;\n\t#endif\n}\n",fullscreenQuadPS:"varying vec2 vUv0;\nuniform sampler2D source;\nvoid main(void) {\n\tgl_FragColor = texture2D(source, vUv0);\n}\n",fullscreenQuadVS:"attribute vec2 vertex_position;\nvarying vec2 vUv0;\nvoid main(void)\n{\n\tgl_Position = vec4(vertex_position, 0.5, 1.0);\n\tvUv0 = vertex_position.xy*0.5+0.5;\n}\n",gamma1_0PS:"vec4 texture2DSRGB(sampler2D tex, vec2 uv) {\n\treturn texture2D(tex, uv);\n}\nvec4 texture2DSRGB(sampler2D tex, vec2 uv, float bias) {\n\treturn texture2D(tex, uv, bias);\n}\nvec4 textureCubeSRGB(samplerCube tex, vec3 uvw) {\n\treturn textureCube(tex, uvw);\n}\nvec3 gammaCorrectOutput(vec3 color) {\n\treturn color;\n}\nvec3 gammaCorrectInput(vec3 color) {\n\treturn color;\n}\nfloat gammaCorrectInput(float color) {\n\treturn color;\n}\nvec4 gammaCorrectInput(vec4 color) {\n\treturn color;\n}\n",gamma2_2PS:"vec3 gammaCorrectInput(vec3 color) {\n\treturn pow(color, vec3(2.2));\n}\nfloat gammaCorrectInput(float color) {\n\treturn pow(color, 2.2);\n}\nvec4 gammaCorrectInput(vec4 color) {\n\treturn vec4(pow(color.rgb, vec3(2.2)), color.a);\n}\nvec4 texture2DSRGB(sampler2D tex, vec2 uv) {\n\tvec4 rgba = texture2D(tex, uv);\n\trgba.rgb = gammaCorrectInput(rgba.rgb);\n\treturn rgba;\n}\nvec4 texture2DSRGB(sampler2D tex, vec2 uv, float bias) {\n\tvec4 rgba = texture2D(tex, uv, bias);\n\trgba.rgb = gammaCorrectInput(rgba.rgb);\n\treturn rgba;\n}\nvec4 textureCubeSRGB(samplerCube tex, vec3 uvw) {\n\tvec4 rgba = textureCube(tex, uvw);\n\trgba.rgb = gammaCorrectInput(rgba.rgb);\n\treturn rgba;\n}\nvec3 gammaCorrectOutput(vec3 color) {\n\t#ifdef HDR\n\treturn color;\n\t#else\n\tcolor += vec3(0.0000001);\n\treturn pow(color, vec3(0.45));\n\t#endif\n}\n",gles3PS:"#define varying in\nout highp vec4 pc_fragColor;\n#define gl_FragColor pc_fragColor\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad\n#define GL2\n#define SUPPORTS_TEXLOD\n",gles3VS:"#define attribute in\n#define varying out\n#define texture2D texture\n#define GL2\n#define VERTEXSHADER\n",glossPS:"#ifdef MAPFLOAT\nuniform float material_shininess;\n#endif\n#ifdef MAPTEXTURE\nuniform sampler2D texture_glossMap;\n#endif\nvoid getGlossiness() {\n\tdGlossiness = 1.0;\n\t#ifdef MAPFLOAT\n\tdGlossiness *= material_shininess;\n\t#endif\n\t#ifdef MAPTEXTURE\n\tdGlossiness *= texture2D(texture_glossMap, $UV).$CH;\n\t#endif\n\t#ifdef MAPVERTEX\n\tdGlossiness *= saturate(vVertexColor.$VC);\n\t#endif\n\tdGlossiness += 0.0000001;\n}\n",instancingVS:"attribute vec4 instance_line1;\nattribute vec4 instance_line2;\nattribute vec4 instance_line3;\nattribute vec4 instance_line4;\n",lightDiffuseLambertPS:"float getLightDiffuse() {\n\treturn max(dot(dNormalW, -dLightDirNormW), 0.0);\n}\n",lightDirPointPS:"void getLightDirPoint(vec3 lightPosW) {\n\tdLightDirW = vPositionW - lightPosW;\n\tdLightDirNormW = normalize(dLightDirW);\n\tdLightPosW = lightPosW;\n}\n",lightmapDirPS:"uniform sampler2D texture_lightMap;\nuniform sampler2D texture_dirLightMap;\nvoid addLightMap() {\n\tvec3 color = $texture2DSAMPLE(texture_lightMap, $UV).$CH;\n\tvec3 dir = texture2D(texture_dirLightMap, $UV).xyz;\n\tif (dot(dir, vec3(1.0)) < 0.00001) {\n\t\tdDiffuseLight += color;\n\t} else {\n\t\tdLightDirNormW = normalize(dir * 2.0 - vec3(1.0));\n\t\tfloat vlight = saturate(dot(dLightDirNormW, -dVertexNormalW));\n\t\tfloat flight = saturate(dot(dLightDirNormW, -dNormalW));\n\t\tfloat nlight = (flight / max(vlight, 0.01)) * 0.5;\n\t\tdDiffuseLight += color * nlight * 2.0;\n\t}\n\tdSpecularLight += color * getLightSpecular();\n}\n",lightmapSinglePS:"#ifdef MAPTEXTURE\nuniform sampler2D texture_lightMap;\n#endif\nvoid addLightMap() {\n\tvec3 lm = vec3(1.0);\n\t#ifdef MAPTEXTURE\n\tlm *= $texture2DSAMPLE(texture_lightMap, $UV).$CH;\n\t#endif\n\t#ifdef MAPVERTEX\n\tlm *= saturate(vVertexColor.$VC);\n\t#endif\n\tdDiffuseLight += lm;\n}\n",lightmapSingleVertPS:"void addLightMap() {\n\tdDiffuseLight += saturate(vVertexColor.$CH);\n}\n",lightSpecularAnisoGGXPS:"float calcLightSpecular(float tGlossiness, vec3 tNormalW) {\n\tfloat PI = 3.141592653589793;\n\tfloat roughness = max((1.0 - tGlossiness) * (1.0 - tGlossiness), 0.001);\n\tfloat anisotropy = material_anisotropy * roughness;\n\tfloat at = max((roughness + anisotropy), roughness / 4.0);\n\tfloat ab = max((roughness - anisotropy), roughness / 4.0);\n\tvec3 h = normalize(normalize(-dLightDirNormW) + normalize(dViewDirW));\n\tfloat NoH = dot(tNormalW, h);\n\tfloat ToH = dot(dTBN[0], h);\n\tfloat BoH = dot(dTBN[1], h);\n\tfloat a2 = at * ab;\n\tvec3 v = vec3(ab * ToH, at * BoH, a2 * NoH);\n\tfloat v2 = dot(v, v);\n\tfloat w2 = a2 / v2;\n\tfloat D = a2 * w2 * w2 * (1.0 / PI);\n\tfloat ToV = dot(dTBN[0], dViewDirW);\n\tfloat BoV = dot(dTBN[1], dViewDirW);\n\tfloat ToL = dot(dTBN[0], -dLightDirNormW);\n\tfloat BoL = dot(dTBN[1], -dLightDirNormW);\n\tfloat NoV = dot(tNormalW, dViewDirW);\n\tfloat NoL = dot(tNormalW, -dLightDirNormW);\n\tfloat lambdaV = NoL * length(vec3(at * ToV, ab * BoV, NoV));\n\tfloat lambdaL = NoV * length(vec3(at * ToL, ab * BoL, NoL));\n\tfloat G = 0.5 / (lambdaV + lambdaL);\n\treturn D * G;\n}\nfloat getLightSpecular() {\n\treturn calcLightSpecular(dGlossiness, dNormalW);\n}\nfloat getLightSpecularCC() {\n\treturn calcLightSpecular(ccGlossiness, ccNormalW);\n}\n",lightSpecularBlinnPS:"float calcLightSpecular(float tGlossiness, vec3 tNormalW) {\n\tvec3 h = normalize( -dLightDirNormW + dViewDirW );\n\tfloat nh = max( dot( h, tNormalW ), 0.0 );\n\tfloat specPow = exp2(tGlossiness * 11.0);\n\tspecPow = antiAliasGlossiness(specPow);\n\tspecPow = max(specPow, 0.0001);\n\treturn pow(nh, specPow) * (specPow + 2.0) / 8.0;\n}\nfloat getLightSpecular() {\n\treturn calcLightSpecular(dGlossiness, dNormalW);\n}\nfloat getLightSpecularCC() {\n\treturn calcLightSpecular(ccGlossiness, ccNormalW);\n}\n",lightSpecularPhongPS:"float calcLightSpecular(float tGlossiness, vec3 tReflDirW) {\n\tfloat specPow = tGlossiness;\n\tspecPow = antiAliasGlossiness(specPow);\n\treturn pow(max(dot(tReflDirW, -dLightDirNormW), 0.0), specPow + 0.0001);\n}\nfloat getLightSpecular() {\n\treturn calcLightSpecular(dGlossiness, dReflDirW);\n}\nfloat getLightSpecularCC() {\n\treturn calcLightSpecular(ccGlossiness, ccReflDirW);\n}\n",ltc:"mat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nstruct Coords {\n\tvec3 coord0;\n\tvec3 coord1;\n\tvec3 coord2;\n\tvec3 coord3;\n};\nfloat LTC_EvaluateRect( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in Coords rectCoords) {\n\tvec3 v1 = rectCoords.coord1 - rectCoords.coord0;\n\tvec3 v2 = rectCoords.coord3 - rectCoords.coord0;\n\tvec3 lightNormal = cross( v1, v2 );\n\tfloat factor = sign(-dot( lightNormal, P - rectCoords.coord0 ));\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 =\tfactor * cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords.coord0 - P );\n\tcoords[ 1 ] = mat * ( rectCoords.coord1 - P );\n\tcoords[ 2 ] = mat * ( rectCoords.coord2 - P );\n\tcoords[ 3 ] = mat * ( rectCoords.coord3 - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn result;\n}\nCoords dLTCCoords;\nCoords getLTCLightCoords(vec3 lightPos, vec3 halfWidth, vec3 halfHeight){\n\tCoords coords;\n\tcoords.coord0 = lightPos + halfWidth - halfHeight;\n\tcoords.coord1 = lightPos - halfWidth - halfHeight;\n\tcoords.coord2 = lightPos - halfWidth + halfHeight;\n\tcoords.coord3 = lightPos + halfWidth + halfHeight;\n\treturn coords;\n}\nfloat dSphereRadius;\nCoords getSphereLightCoords(vec3 lightPos, vec3 halfWidth, vec3 halfHeight){\n\tdSphereRadius = max(length(halfWidth), length(halfHeight));\n\tvec3 f = reflect(normalize(lightPos - view_position), vNormalW);\n\tvec3 w = normalize(cross(f, halfHeight));\n\tvec3 h = normalize(cross(f, w));\n\treturn getLTCLightCoords(lightPos, w * dSphereRadius, h * dSphereRadius);\n}\nvec2 dLTCUV;\n#ifdef CLEARCOAT\nvec2 ccLTCUV;\n#endif\nvec2 getLTCLightUV(float tGlossiness, vec3 tNormalW)\n{\n\tfloat roughness = max((1.0 - tGlossiness) * (1.0 - tGlossiness), 0.001);\n\treturn LTC_Uv( tNormalW, dViewDirW, roughness );\n}\nvec3 dLTCSpecFres;\n#ifdef CLEARCOAT\nvec3 ccLTCSpecFres;\n#endif\nvec3 getLTCLightSpecFres(vec2 uv, vec3 tSpecularity)\n{\n\tvec4 t2 = texture2D( areaLightsLutTex2, uv );\n\t#ifdef AREA_R8_G8_B8_A8_LUTS\n\tt2 *= vec4(0.693103,1,1,1);\n\tt2 += vec4(0.306897,0,0,0);\n\t#endif\n\treturn tSpecularity * t2.x + ( vec3( 1.0 ) - tSpecularity) * t2.y;\n}\nvoid calcLTCLightValues()\n{\n\tdLTCUV = getLTCLightUV(dGlossiness, dNormalW);\n\tdLTCSpecFres = getLTCLightSpecFres(dLTCUV, dSpecularityNoFres);\n#ifdef CLEARCOAT\n\tccLTCUV = getLTCLightUV(ccGlossiness, ccNormalW);\n\tccLTCSpecFres = getLTCLightSpecFres(ccLTCUV, vec3(ccSpecularityNoFres));\n#endif\n}\nvoid calcRectLightValues(vec3 lightPos, vec3 halfWidth, vec3 halfHeight)\n{\n\tdLTCCoords = getLTCLightCoords(lightPos, halfWidth, halfHeight);\n}\nvoid calcDiskLightValues(vec3 lightPos, vec3 halfWidth, vec3 halfHeight)\n{\n\tcalcRectLightValues(lightPos, halfWidth, halfHeight);\n}\nvoid calcSphereLightValues(vec3 lightPos, vec3 halfWidth, vec3 halfHeight)\n{\n\tdLTCCoords = getSphereLightCoords(lightPos, halfWidth, halfHeight);\n}\nvec3 SolveCubic(vec4 Coefficient)\n{\n\tfloat pi = 3.14159;\n\tCoefficient.xyz /= Coefficient.w;\n\tCoefficient.yz /= 3.0;\n\tfloat A = Coefficient.w;\n\tfloat B = Coefficient.z;\n\tfloat C = Coefficient.y;\n\tfloat D = Coefficient.x;\n\tvec3 Delta = vec3(\n\t\t-Coefficient.z * Coefficient.z + Coefficient.y,\n\t\t-Coefficient.y * Coefficient.z + Coefficient.x,\n\t\tdot(vec2(Coefficient.z, -Coefficient.y), Coefficient.xy)\n\t);\n\tfloat Discriminant = dot(vec2(4.0 * Delta.x, -Delta.y), Delta.zy);\n\tvec3 RootsA, RootsD;\n\tvec2 xlc, xsc;\n\t{\n\t\tfloat A_a = 1.0;\n\t\tfloat C_a = Delta.x;\n\t\tfloat D_a = -2.0 * B * Delta.x + Delta.y;\n\t\tfloat Theta = atan(sqrt(Discriminant), -D_a) / 3.0;\n\t\tfloat x_1a = 2.0 * sqrt(-C_a) * cos(Theta);\n\t\tfloat x_3a = 2.0 * sqrt(-C_a) * cos(Theta + (2.0 / 3.0) * pi);\n\t\tfloat xl;\n\t\tif ((x_1a + x_3a) > 2.0 * B)\n\t\t\txl = x_1a;\n\t\telse\n\t\t\txl = x_3a;\n\t\txlc = vec2(xl - B, A);\n\t}\n\t{\n\t\tfloat A_d = D;\n\t\tfloat C_d = Delta.z;\n\t\tfloat D_d = -D * Delta.y + 2.0 * C * Delta.z;\n\t\tfloat Theta = atan(D * sqrt(Discriminant), -D_d) / 3.0;\n\t\tfloat x_1d = 2.0 * sqrt(-C_d) * cos(Theta);\n\t\tfloat x_3d = 2.0 * sqrt(-C_d) * cos(Theta + (2.0 / 3.0) * pi);\n\t\tfloat xs;\n\t\tif (x_1d + x_3d < 2.0 * C)\n\t\t\txs = x_1d;\n\t\telse\n\t\t\txs = x_3d;\n\t\txsc = vec2(-D, xs + C);\n\t}\n\tfloat E =\txlc.y * xsc.y;\n\tfloat F = -xlc.x * xsc.y - xlc.y * xsc.x;\n\tfloat G =\txlc.x * xsc.x;\n\tvec2 xmc = vec2(C * F - B * G, -B * F + C * E);\n\tvec3 Root = vec3(xsc.x / xsc.y, xmc.x / xmc.y, xlc.x / xlc.y);\n\tif (Root.x < Root.y && Root.x < Root.z)\n\t\tRoot.xyz = Root.yxz;\n\telse if (Root.z < Root.x && Root.z < Root.y)\n\t\tRoot.xyz = Root.xzy;\n\treturn Root;\n}\nfloat LTC_EvaluateDisk(vec3 N, vec3 V, vec3 P, mat3 Minv, Coords points)\n{\n\tvec3 T1, T2;\n\tT1 = normalize(V - N * dot(V, N));\n\tT2 = cross(N, T1);\n\tmat3 R = transposeMat3( mat3( T1, T2, N ) );\n\tvec3 L_[ 3 ];\n\tL_[ 0 ] = R * ( points.coord0 - P );\n\tL_[ 1 ] = R * ( points.coord1 - P );\n\tL_[ 2 ] = R * ( points.coord2 - P );\n\tvec3 Lo_i = vec3(0);\n\tvec3 C\t= 0.5 * (L_[0] + L_[2]);\n\tvec3 V1 = 0.5 * (L_[1] - L_[2]);\n\tvec3 V2 = 0.5 * (L_[1] - L_[0]);\n\tC\t= Minv * C;\n\tV1 = Minv * V1;\n\tV2 = Minv * V2;\n\tfloat a, b;\n\tfloat d11 = dot(V1, V1);\n\tfloat d22 = dot(V2, V2);\n\tfloat d12 = dot(V1, V2);\n\tif (abs(d12) / sqrt(d11 * d22) > 0.0001)\n\t{\n\t\tfloat tr = d11 + d22;\n\t\tfloat det = -d12 * d12 + d11 * d22;\n\t\tdet = sqrt(det);\n\t\tfloat u = 0.5 * sqrt(tr - 2.0 * det);\n\t\tfloat v = 0.5 * sqrt(tr + 2.0 * det);\n\t\tfloat e_max = (u + v) * (u + v);\n\t\tfloat e_min = (u - v) * (u - v);\n\t\tvec3 V1_, V2_;\n\t\tif (d11 > d22)\n\t\t{\n\t\t\tV1_ = d12 * V1 + (e_max - d11) * V2;\n\t\t\tV2_ = d12 * V1 + (e_min - d11) * V2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tV1_ = d12*V2 + (e_max - d22)*V1;\n\t\t\tV2_ = d12*V2 + (e_min - d22)*V1;\n\t\t}\n\t\ta = 1.0 / e_max;\n\t\tb = 1.0 / e_min;\n\t\tV1 = normalize(V1_);\n\t\tV2 = normalize(V2_);\n\t}\n\telse\n\t{\n\t\ta = 1.0 / dot(V1, V1);\n\t\tb = 1.0 / dot(V2, V2);\n\t\tV1 *= sqrt(a);\n\t\tV2 *= sqrt(b);\n\t}\n\tvec3 V3 = cross(V1, V2);\n\tif (dot(C, V3) < 0.0)\n\t\tV3 *= -1.0;\n\tfloat L\t= dot(V3, C);\n\tfloat x0 = dot(V1, C) / L;\n\tfloat y0 = dot(V2, C) / L;\n\tfloat E1 = inversesqrt(a);\n\tfloat E2 = inversesqrt(b);\n\ta *= L * L;\n\tb *= L * L;\n\tfloat c0 = a * b;\n\tfloat c1 = a * b * (1.0 + x0 * x0 + y0 * y0) - a - b;\n\tfloat c2 = 1.0 - a * (1.0 + x0 * x0) - b * (1.0 + y0 * y0);\n\tfloat c3 = 1.0;\n\tvec3 roots = SolveCubic(vec4(c0, c1, c2, c3));\n\tfloat e1 = roots.x;\n\tfloat e2 = roots.y;\n\tfloat e3 = roots.z;\n\tvec3 avgDir = vec3(a * x0 / (a - e2), b * y0 / (b - e2), 1.0);\n\tmat3 rotate = mat3(V1, V2, V3);\n\tavgDir = rotate * avgDir;\n\tavgDir = normalize(avgDir);\n\tfloat L1 = sqrt(-e2 / e3);\n\tfloat L2 = sqrt(-e2 / e1);\n\tfloat formFactor = L1 * L2 * inversesqrt((1.0 + L1 * L1) * (1.0 + L2 * L2));\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tvec2 uv = vec2(avgDir.z * 0.5 + 0.5, formFactor);\n\tuv = uv*LUT_SCALE + LUT_BIAS;\n\tfloat scale = texture2D( areaLightsLutTex2, uv ).w;\n\treturn formFactor*scale;\n}\nfloat getRectLightDiffuse() {\n\treturn LTC_EvaluateRect( dNormalW, dViewDirW, vPositionW, mat3( 1.0 ), dLTCCoords );\n}\nfloat getDiskLightDiffuse() {\n\treturn LTC_EvaluateDisk( dNormalW, dViewDirW, vPositionW, mat3( 1.0 ), dLTCCoords );\n}\nfloat getSphereLightDiffuse() {\n\tfloat falloff = dSphereRadius / (dot(dLightDirW, dLightDirW) + dSphereRadius);\n\treturn getLightDiffuse()*falloff;\n}\nmat3 getLTCLightInvMat(vec2 uv)\n{\n\tvec4 t1 = texture2D( areaLightsLutTex1, uv );\n\t#ifdef AREA_R8_G8_B8_A8_LUTS\n\tt1 *= vec4(1.001, 0.3239, 0.60437568, 1.0);\n\tt1 += vec4(0.0, -0.2976, -0.01381, 0.0);\n\t#endif\n\treturn mat3(\n\t\tvec3( t1.x, 0, t1.y ),\n\t\tvec3(\t0, 1,\t0 ),\n\t\tvec3( t1.z, 0, t1.w )\n\t);\n}\nfloat calcRectLightSpecular(vec3 tNormalW, vec2 uv) {\n\tmat3 mInv = getLTCLightInvMat(uv);\n\treturn LTC_EvaluateRect( tNormalW, dViewDirW, vPositionW, mInv, dLTCCoords );\n}\nfloat getRectLightSpecular() {\n\treturn calcRectLightSpecular(dNormalW, dLTCUV);\n}\n#ifdef CLEARCOAT\nfloat getRectLightSpecularCC() {\n\treturn calcRectLightSpecular(ccNormalW, ccLTCUV);\n}\n#endif\nfloat calcDiskLightSpecular(vec3 tNormalW, vec2 uv) {\n\tmat3 mInv = getLTCLightInvMat(uv);\n\treturn LTC_EvaluateDisk( tNormalW, dViewDirW, vPositionW, mInv, dLTCCoords );\n}\nfloat getDiskLightSpecular() {\n\treturn calcDiskLightSpecular(dNormalW, dLTCUV);\n}\n#ifdef CLEARCOAT\nfloat getDiskLightSpecularCC() {\n\treturn calcDiskLightSpecular(ccNormalW, ccLTCUV);\n}\n#endif\nfloat getSphereLightSpecular() {\n\treturn calcDiskLightSpecular(dNormalW, dLTCUV);\n}\n#ifdef CLEARCOAT\nfloat getSphereLightSpecularCC() {\n\treturn calcDiskLightSpecular(ccNormalW, ccLTCUV);\n}\n#endif\n",metalnessPS:"void processMetalness(float metalness) {\n\tconst float dielectricF0 = 0.04;\n\tdSpecularity = mix(vec3(dielectricF0), dAlbedo, metalness);\n\tdAlbedo *= 1.0 - metalness;\n}\n#ifdef MAPFLOAT\nuniform float material_metalness;\n#endif\n#ifdef MAPTEXTURE\nuniform sampler2D texture_metalnessMap;\n#endif\nvoid getSpecularity() {\n\tfloat metalness = 1.0;\n\t#ifdef MAPFLOAT\n\tmetalness *= material_metalness;\n\t#endif\n\t#ifdef MAPTEXTURE\n\tmetalness *= texture2D(texture_metalnessMap, $UV).$CH;\n\t#endif\n\t#ifdef MAPVERTEX\n\tmetalness *= saturate(vVertexColor.$VC);\n\t#endif\n\tprocessMetalness(metalness);\n}\n",msdfPS:"uniform sampler2D texture_msdfMap;\n#ifdef GL_OES_standard_derivatives\n#define USE_FWIDTH\n#endif\n#ifdef GL2\n#define USE_FWIDTH\n#endif\nfloat median(float r, float g, float b) {\n\treturn max(min(r, g), min(max(r, g), b));\n}\nfloat map (float min, float max, float v) {\n\treturn (v - min) / (max - min);\n}\nuniform float font_sdfIntensity;\nuniform float font_pxrange;\nuniform float font_textureWidth;\nuniform vec4 outline_color;\nuniform float outline_thickness;\nuniform vec4 shadow_color;\nuniform vec2 shadow_offset;\nvec4 applyMsdf(vec4 color) {\n\tvec3 tsample = texture2D(texture_msdfMap, vUv0).rgb;\n\tvec2 uvShdw = vUv0 - shadow_offset;\n\tvec3 ssample = texture2D(texture_msdfMap, uvShdw).rgb;\n\tfloat sigDist = median(tsample.r, tsample.g, tsample.b);\n\tfloat sigDistShdw = median(ssample.r, ssample.g, ssample.b);\n\tfloat smoothingMax = 0.2;\n\t#ifdef USE_FWIDTH\n\tvec2 w = fwidth(vUv0);\n\tfloat smoothing = clamp(w.x * font_textureWidth / font_pxrange, 0.0, smoothingMax);\n\t#else\n\tfloat font_size = 16.0;\n\tfloat smoothing = clamp(font_pxrange / font_size, 0.0, smoothingMax);\n\t#endif\n\tfloat mapMin = 0.05;\n\tfloat mapMax = clamp(1.0 - font_sdfIntensity, mapMin, 1.0);\n\tfloat sigDistInner = map(mapMin, mapMax, sigDist);\n\tfloat sigDistOutline = map(mapMin, mapMax, sigDist + outline_thickness);\n\tsigDistShdw = map(mapMin, mapMax, sigDistShdw + outline_thickness);\n\tfloat center = 0.5;\n\tfloat inside = smoothstep(center-smoothing, center+smoothing, sigDistInner);\n\tfloat outline = smoothstep(center-smoothing, center+smoothing, sigDistOutline);\n\tfloat shadow = smoothstep(center-smoothing, center+smoothing, sigDistShdw);\n\tvec4 tcolor = (outline > inside) ? outline * vec4(outline_color.a * outline_color.rgb, outline_color.a) : vec4(0.0);\n\ttcolor = mix(tcolor, color, inside);\n\tvec4 scolor = (shadow > outline) ? shadow * vec4(shadow_color.a * shadow_color.rgb, shadow_color.a) : tcolor;\n\ttcolor = mix(scolor, tcolor, outline);\n\treturn tcolor;\n}\n",normalVS:"#ifdef MORPHING_TEXTURE_BASED_NORMAL\nuniform highp sampler2D morphNormalTex;\n#endif\nvec3 getNormal() {\n\t#ifdef SKIN\n\tdNormalMatrix = mat3(dModelMatrix[0].xyz, dModelMatrix[1].xyz, dModelMatrix[2].xyz);\n\t#elif defined(INSTANCING)\n\tdNormalMatrix = mat3(instance_line1.xyz, instance_line2.xyz, instance_line3.xyz);\n\t#else\n\tdNormalMatrix = matrix_normal;\n\t#endif\n\tvec3 tempNormal = vertex_normal;\n\t#ifdef MORPHING\n\t#ifdef MORPHING_NRM03\n\ttempNormal += morph_weights_a[0] * morph_nrm0;\n\ttempNormal += morph_weights_a[1] * morph_nrm1;\n\ttempNormal += morph_weights_a[2] * morph_nrm2;\n\ttempNormal += morph_weights_a[3] * morph_nrm3;\n\t#endif\n\t#ifdef MORPHING_NRM47\n\ttempNormal += morph_weights_b[0] * morph_nrm4;\n\ttempNormal += morph_weights_b[1] * morph_nrm5;\n\ttempNormal += morph_weights_b[2] * morph_nrm6;\n\ttempNormal += morph_weights_b[3] * morph_nrm7;\n\t#endif\n\t#endif\n\t#ifdef MORPHING_TEXTURE_BASED_NORMAL\n\tvec2 morphUV = getTextureMorphCoords();\n\tvec3 morphNormal = texture2D(morphNormalTex, morphUV).xyz;\n\ttempNormal += morphNormal;\n\t#endif\n\treturn normalize(dNormalMatrix * tempNormal);\n}\n",normalDetailMapPS:"#ifdef MAPTEXTURE\nuniform sampler2D texture_normalDetailMap;\nuniform float material_normalDetailMapBumpiness;\nvec3 blendNormals(vec3 n1, vec3 n2) {\n\tn1 += vec3(0, 0, 1);\n\tn2 *= vec3(-1, -1, 1);\n\treturn normalize(n1*dot(n1, n2)/n1.z - n2);\n}\n#endif\nvec3 addNormalDetail(vec3 normalMap) {\n\t#ifdef MAPTEXTURE\n\tvec3 normalDetailMap = unpackNormal(texture2D(texture_normalDetailMap, $UV));\n\tnormalDetailMap = normalize(mix(vec3(0.0, 0.0, 1.0), normalDetailMap, material_normalDetailMapBumpiness));\n\treturn blendNormals(normalMap, normalDetailMap);\n\t#else\n\treturn normalMap;\n\t#endif\n}\n",normalInstancedVS:"vec3 getNormal() {\n\tdNormalMatrix = mat3(instance_line1.xyz, instance_line2.xyz, instance_line3.xyz);\n\treturn normalize(dNormalMatrix * vertex_normal);\n}\n",normalMapPS:"uniform sampler2D texture_normalMap;\nuniform float material_bumpiness;\nvoid getNormal() {\n\tvec3 normalMap = unpackNormal(texture2D(texture_normalMap, $UV));\n\tnormalMap = normalize(mix(vec3(0.0, 0.0, 1.0), normalMap, material_bumpiness));\n\tdNormalMap = addNormalDetail(normalMap);\n\tdNormalW = dTBN * dNormalMap;\n}\n",normalMapFastPS:"uniform sampler2D texture_normalMap;\nvoid getNormal() {\n\tvec3 normalMap = unpackNormal(texture2D(texture_normalMap, $UV));\n\tdNormalMap = addNormalDetail(normalMap);\n\tdNormalW = dTBN * dNormalMap;\n}\n",normalSkinnedVS:"vec3 getNormal() {\n\tdNormalMatrix = mat3(dModelMatrix[0].xyz, dModelMatrix[1].xyz, dModelMatrix[2].xyz);\n\treturn normalize(dNormalMatrix * vertex_normal);\n}\n",normalVertexPS:"void getNormal() {\n\tdNormalW = normalize(dVertexNormalW);\n}\n",normalXYPS:"vec3 unpackNormal(vec4 nmap) {\n\tvec3 normal;\n\tnormal.xy = nmap.wy * 2.0 - 1.0;\n\tnormal.z = sqrt(1.0 - saturate(dot(normal.xy, normal.xy)));\n\treturn normal;\n}\n",normalXYZPS:"vec3 unpackNormal(vec4 nmap) {\n\treturn nmap.xyz * 2.0 - 1.0;\n}\n",opacityPS:"#ifdef MAPFLOAT\nuniform float material_opacity;\n#endif\n#ifdef MAPTEXTURE\nuniform sampler2D texture_opacityMap;\n#endif\nvoid getOpacity() {\n\tdAlpha = 1.0;\n\t#ifdef MAPFLOAT\n\tdAlpha *= material_opacity;\n\t#endif\n\t#ifdef MAPTEXTURE\n\tdAlpha *= texture2D(texture_opacityMap, $UV).$CH;\n\t#endif\n\t#ifdef MAPVERTEX\n\tdAlpha *= clamp(vVertexColor.$VC, 0.0, 1.0);\n\t#endif\n}\n",outputAlphaPS:"gl_FragColor.a = dAlpha;\n",outputAlphaOpaquePS:"gl_FragColor.a = 1.0;\n",outputAlphaPremulPS:"gl_FragColor.rgb *= dAlpha;\ngl_FragColor.a = dAlpha;\n",outputCubemapPS:"varying vec2 vUv0;\nuniform samplerCube source;\nuniform vec4 params;\nfloat saturate(float x) {\n\treturn clamp(x, 0.0, 1.0);\n}\nvec4 encodeRGBM(vec4 color) {\n\tcolor.rgb = pow(color.rgb, vec3(0.5));\n\tcolor.rgb *= 1.0 / 8.0;\n\tcolor.a = saturate( max( max( color.r, color.g ), max( color.b, 1.0 / 255.0 ) ) );\n\tcolor.a = ceil(color.a * 255.0) / 255.0;\n\tcolor.rgb /= color.a;\n\treturn color;\n}\nvoid main(void) {\n\tvec2 st = vUv0 * 2.0 - 1.0;\n\tfloat face = params.x;\n\tvec3 vec;\n\tif (face==0.0) {\n\t\tvec = vec3(1, -st.y, -st.x);\n\t} else if (face==1.0) {\n\t\tvec = vec3(-1, -st.y, st.x);\n\t} else if (face==2.0) {\n\t\tvec = vec3(st.x, 1, st.y);\n\t} else if (face==3.0) {\n\t\tvec = vec3(st.x, -1, -st.y);\n\t} else if (face==4.0) {\n\t\tvec = vec3(st.x, -st.y, 1);\n\t} else {\n\t\tvec = vec3(-st.x, -st.y, -1);\n\t}\n\tgl_FragColor = textureCube(source, vec);\n\tif (params.w >= 2.0) gl_FragColor = encodeRGBM(gl_FragColor);\n}\n",outputTex2DPS:"varying vec2 vUv0;\nuniform sampler2D source;\nvoid main(void) {\n\tgl_FragColor = texture2D(source, vUv0);\n}\n",packDepthPS:"vec4 packFloat(float depth) {\n\tconst vec4 bit_shift = vec4(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0);\n\tconst vec4 bit_mask\t= vec4(0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0);\n\tvec4 res = mod(depth * bit_shift * vec4(255), vec4(256) ) / vec4(255);\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\n",packDepthMaskPS:"vec4 packFloat(float depth) {\n\tconst vec4 bit_shift = vec4(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0);\n\tconst vec4 bit_mask\t= vec4(0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0);\n\tvec4 res = mod(depth * bit_shift * vec4(255), vec4(256) ) / vec4(255);\n\tres.x = 0.0;\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\n",parallaxPS:"uniform sampler2D texture_heightMap;\nuniform float material_heightMapFactor;\nvoid getParallax() {\n\tfloat parallaxScale = material_heightMapFactor;\n\tfloat height = texture2D(texture_heightMap, $UV).$CH;\n\theight = height * parallaxScale - parallaxScale*0.5;\n\tvec3 viewDirT = dViewDirW * dTBN;\n\tviewDirT.z += 0.42;\n\tdUvOffset = height * (viewDirT.xy / viewDirT.z);\n}\n",particlePS:"varying vec4 texCoordsAlphaLife;\nuniform sampler2D colorMap;\nuniform sampler2D colorParam;\nuniform float graphSampleSize;\nuniform float graphNumSamples;\n#ifndef CAMERAPLANES\n#define CAMERAPLANES\nuniform vec4 camera_params;\n#endif\nuniform float softening;\nuniform float colorMult;\nfloat saturate(float x) {\n\treturn clamp(x, 0.0, 1.0);\n}\n#ifndef UNPACKFLOAT\n#define UNPACKFLOAT\nfloat unpackFloat(vec4 rgbaDepth) {\n\tconst vec4 bitShift = vec4(1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0);\n\tfloat depth = dot(rgbaDepth, bitShift);\n\treturn depth;\n}\n#endif\nvoid main(void) {\n\tvec4 tex\t= texture2DSRGB(colorMap, vec2(texCoordsAlphaLife.x, 1.0 - texCoordsAlphaLife.y));\n\tvec4 ramp = texture2DSRGB(colorParam, vec2(texCoordsAlphaLife.w, 0.0));\n\tramp.rgb *= colorMult;\n\tramp.a += texCoordsAlphaLife.z;\n\tvec3 rgb = tex.rgb * ramp.rgb;\n\tfloat a\t= tex.a * ramp.a;\n",particleVS:"vec3 unpack3NFloats(float src) {\n\tfloat r = fract(src);\n\tfloat g = fract(src * 256.0);\n\tfloat b = fract(src * 65536.0);\n\treturn vec3(r, g, b);\n}\nfloat saturate(float x) {\n\treturn clamp(x, 0.0, 1.0);\n}\nvec4 tex1Dlod_lerp(highp sampler2D tex, vec2 tc) {\n\treturn mix( texture2D(tex,tc), texture2D(tex,tc + graphSampleSize), fract(tc.x*graphNumSamples) );\n}\nvec4 tex1Dlod_lerp(highp sampler2D tex, vec2 tc, out vec3 w) {\n\tvec4 a = texture2D(tex,tc);\n\tvec4 b = texture2D(tex,tc + graphSampleSize);\n\tfloat c = fract(tc.x*graphNumSamples);\n\tvec3 unpackedA = unpack3NFloats(a.w);\n\tvec3 unpackedB = unpack3NFloats(b.w);\n\tw = mix(unpackedA, unpackedB, c);\n\treturn mix(a, b, c);\n}\nvec2 rotate(vec2 quadXY, float pRotation, out mat2 rotMatrix) {\n\tfloat c = cos(pRotation);\n\tfloat s = sin(pRotation);\n\tmat2 m = mat2(c, -s, s, c);\n\trotMatrix = m;\n\treturn m * quadXY;\n}\nvec3 billboard(vec3 InstanceCoords, vec2 quadXY) {\n\t#ifdef SCREEN_SPACE\n\t\tvec3 pos = vec3(-1, 0, 0) * quadXY.x + vec3(0, -1, 0) * quadXY.y;\n\t#else\n\t\tvec3 pos = -matrix_viewInverse[0].xyz * quadXY.x + -matrix_viewInverse[1].xyz * quadXY.y;\n\t#endif\n\treturn pos;\n}\nvec3 customFace(vec3 InstanceCoords, vec2 quadXY) {\n\tvec3 pos = faceTangent * quadXY.x + faceBinorm * quadXY.y;\n\treturn pos;\n}\nvec2 safeNormalize(vec2 v) {\n\tfloat l = length(v);\n\treturn (l > 1e-06) ? v / l : v;\n}\nvoid main(void) {\n\tvec3 meshLocalPos = particle_vertexData.xyz;\n\tfloat id = floor(particle_vertexData.w);\n\tfloat rndFactor = fract(sin(id + 1.0 + seed));\n\tvec3 rndFactor3 = vec3(rndFactor, fract(rndFactor*10.0), fract(rndFactor*100.0));\n\tfloat uv = id / numParticlesPot;\n\treadInput(uv);\n#ifdef LOCAL_SPACE\n\tinVel = mat3(matrix_model) * inVel;\n#endif\n\tvec2 velocityV = safeNormalize((mat3(matrix_view) * inVel).xy);\n\tfloat particleLifetime = lifetime;\n\tif (inLife <= 0.0 || inLife > particleLifetime || !inShow) meshLocalPos = vec3(0.0);\n\tvec2 quadXY = meshLocalPos.xy;\n\tfloat nlife = clamp(inLife / particleLifetime, 0.0, 1.0);\n\tvec3 paramDiv;\n\tvec4 params = tex1Dlod_lerp(internalTex2, vec2(nlife, 0), paramDiv);\n\tfloat scale = params.y;\n\tfloat scaleDiv = paramDiv.x;\n\tfloat alphaDiv = paramDiv.z;\n\tscale += (scaleDiv * 2.0 - 1.0) * scaleDivMult * fract(rndFactor*10000.0);\n#ifndef USE_MESH\n\ttexCoordsAlphaLife = vec4(quadXY * -0.5 + 0.5, (alphaDiv * 2.0 - 1.0) * alphaDivMult * fract(rndFactor*1000.0), nlife);\n#else\n\ttexCoordsAlphaLife = vec4(particle_uv, (alphaDiv * 2.0 - 1.0) * alphaDivMult * fract(rndFactor*1000.0), nlife);\n#endif\n\tvec3 particlePos = inPos;\n\tvec3 particlePosMoved = vec3(0.0);\n\tmat2 rotMatrix;\n",particleAnimFrameClampVS:"\tfloat animFrame = min(floor(texCoordsAlphaLife.w * animTexParams.y) + animTexParams.x, animTexParams.z);\n",particleAnimFrameLoopVS:"\tfloat animFrame = floor(mod(texCoordsAlphaLife.w * animTexParams.y + animTexParams.x, animTexParams.z + 1.0));\n",particleAnimTexVS:"\tfloat animationIndex;\n\tif (animTexIndexParams.y == 1.0) {\n\t\tanimationIndex = floor((animTexParams.w + 1.0) * rndFactor3.z) * (animTexParams.z + 1.0);\n\t} else {\n\t\tanimationIndex = animTexIndexParams.x * (animTexParams.z + 1.0);\n\t}\n\tfloat atlasX = (animationIndex + animFrame) * animTexTilesParams.x;\n\tfloat atlasY = 1.0 - floor(atlasX + 1.0) * animTexTilesParams.y;\n\tatlasX = fract(atlasX);\n\ttexCoordsAlphaLife.xy *= animTexTilesParams.xy;\n\ttexCoordsAlphaLife.xy += vec2(atlasX, atlasY);\n",particleInputFloatPS:"void readInput(float uv) {\n\tvec4 tex = texture2D(particleTexIN, vec2(uv, 0.25));\n\tvec4 tex2 = texture2D(particleTexIN, vec2(uv, 0.75));\n\tinPos = tex.xyz;\n\tinVel = tex2.xyz;\n\tinAngle = (tex.w < 0.0? -tex.w : tex.w) - 1000.0;\n\tinShow = tex.w >= 0.0;\n\tinLife = tex2.w;\n}\n",particleInputRgba8PS:"#define PI2 6.283185307179586\nuniform vec3 inBoundsSize;\nuniform vec3 inBoundsCenter;\nuniform float maxVel;\nfloat decodeFloatRG(vec2 rg) {\n\treturn rg.y*(1.0/255.0) + rg.x;\n}\nfloat decodeFloatRGBA( vec4 rgba ) {\n\treturn dot( rgba, vec4(1.0, 1.0/255.0, 1.0/65025.0, 1.0/160581375.0) );\n}\nvoid readInput(float uv) {\n\tvec4 tex0 = texture2D(particleTexIN, vec2(uv, 0.125));\n\tvec4 tex1 = texture2D(particleTexIN, vec2(uv, 0.375));\n\tvec4 tex2 = texture2D(particleTexIN, vec2(uv, 0.625));\n\tvec4 tex3 = texture2D(particleTexIN, vec2(uv, 0.875));\n\tinPos = vec3(decodeFloatRG(tex0.rg), decodeFloatRG(tex0.ba), decodeFloatRG(tex1.rg));\n\tinPos = (inPos - vec3(0.5)) * inBoundsSize + inBoundsCenter;\n\tinVel = tex2.xyz;\n\tinVel = (inVel - vec3(0.5)) * maxVel;\n\tinAngle = decodeFloatRG(tex1.ba) * PI2;\n\tinShow = tex2.a > 0.5;\n\tinLife = decodeFloatRGBA(tex3);\n\tfloat maxNegLife = max(lifetime, (numParticles - 1.0) * (rate+rateDiv));\n\tfloat maxPosLife = lifetime+1.0;\n\tinLife = inLife * (maxNegLife + maxPosLife) - maxNegLife;\n}\n",particleOutputFloatPS:"void writeOutput() {\n\tif (gl_FragCoord.y<1.0) {\n\t\tgl_FragColor = vec4(outPos, (outAngle + 1000.0) * visMode);\n\t} else {\n\t\tgl_FragColor = vec4(outVel, outLife);\n\t}\n}\n",particleOutputRgba8PS:"uniform vec3 outBoundsMul;\nuniform vec3 outBoundsAdd;\nvec2 encodeFloatRG( float v ) {\n\tvec2 enc = vec2(1.0, 255.0) * v;\n\tenc = fract(enc);\n\tenc -= enc.yy * vec2(1.0/255.0, 1.0/255.0);\n\treturn enc;\n}\nvec4 encodeFloatRGBA( float v ) {\n\tvec4 enc = vec4(1.0, 255.0, 65025.0, 160581375.0) * v;\n\tenc = fract(enc);\n\tenc -= enc.yzww * vec4(1.0/255.0,1.0/255.0,1.0/255.0,0.0);\n\treturn enc;\n}\nvoid writeOutput() {\n\toutPos = outPos * outBoundsMul + outBoundsAdd;\n\toutAngle = fract(outAngle / PI2);\n\toutVel = (outVel / maxVel) + vec3(0.5);\n\tfloat maxNegLife = max(lifetime, (numParticles - 1.0) * (rate+rateDiv));\n\tfloat maxPosLife = lifetime+1.0;\n\toutLife = (outLife + maxNegLife) / (maxNegLife + maxPosLife);\n\tif (gl_FragCoord.y < 1.0) {\n\t\tgl_FragColor = vec4(encodeFloatRG(outPos.x), encodeFloatRG(outPos.y));\n\t} else if (gl_FragCoord.y < 2.0) {\n\t\tgl_FragColor = vec4(encodeFloatRG(outPos.z), encodeFloatRG(outAngle));\n\t} else if (gl_FragCoord.y < 3.0) {\n\t\tgl_FragColor = vec4(outVel, visMode*0.5+0.5);\n\t} else {\n\t\tgl_FragColor = encodeFloatRGBA(outLife);\n\t}\n}\n",particleUpdaterAABBPS:"uniform mat3 spawnBounds;\nuniform vec3 spawnPosInnerRatio;\nvec3 calcSpawnPosition(vec3 inBounds, float rndFactor) {\n\tvec3 pos = inBounds - vec3(0.5);\n\tvec3 posAbs = abs(pos);\n\tvec3 maxPos = vec3(max(posAbs.x, max(posAbs.y, posAbs.z)));\n\tvec3 edge = maxPos + (vec3(0.5) - maxPos) * spawnPosInnerRatio;\n\tpos.x = edge.x * (maxPos.x == posAbs.x ? sign(pos.x) : 2.0 * pos.x);\n\tpos.y = edge.y * (maxPos.y == posAbs.y ? sign(pos.y) : 2.0 * pos.y);\n\tpos.z = edge.z * (maxPos.z == posAbs.z ? sign(pos.z) : 2.0 * pos.z);\n#ifndef LOCAL_SPACE\n\treturn emitterPos + spawnBounds * pos;\n#else\n\treturn spawnBounds * pos;\n#endif\n}\nvoid addInitialVelocity(inout vec3 localVelocity, vec3 inBounds) {\n\tlocalVelocity -= vec3(0, 0, initialVelocity);\n}\n",particleUpdaterEndPS:"\twriteOutput();\n}\n",particleUpdaterInitPS:"varying vec2 vUv0;\nuniform highp sampler2D particleTexIN;\nuniform highp sampler2D internalTex0;\nuniform highp sampler2D internalTex1;\nuniform highp sampler2D internalTex2;\nuniform highp sampler2D internalTex3;\nuniform mat3 emitterMatrix, emitterMatrixInv;\nuniform vec3 emitterScale;\nuniform vec3 emitterPos, frameRandom, localVelocityDivMult, velocityDivMult;\nuniform float delta, rate, rateDiv, lifetime, numParticles, rotSpeedDivMult, radialSpeedDivMult, seed;\nuniform float startAngle, startAngle2;\nuniform float initialVelocity;\nuniform float graphSampleSize;\nuniform float graphNumSamples;\nvec3 inPos;\nvec3 inVel;\nfloat inAngle;\nbool inShow;\nfloat inLife;\nfloat visMode;\nvec3 outPos;\nvec3 outVel;\nfloat outAngle;\nbool outShow;\nfloat outLife;\n",particleUpdaterNoRespawnPS:"\tif (outLife >= lifetime) {\n\t\toutLife -= max(lifetime, (numParticles - 1.0) * particleRate);\n\t\tvisMode = -1.0;\n\t}\n",particleUpdaterOnStopPS:"\tvisMode = outLife < 0.0? -1.0: visMode;\n",particleUpdaterRespawnPS:"\tif (outLife >= lifetime) {\n\t\toutLife -= max(lifetime, (numParticles - 1.0) * particleRate);\n\t\tvisMode = 1.0;\n\t}\n\tvisMode = outLife < 0.0? 1.0: visMode;\n",particleUpdaterSpherePS:"uniform float spawnBoundsSphere;\nuniform float spawnBoundsSphereInnerRatio;\nvec3 calcSpawnPosition(vec3 inBounds, float rndFactor) {\n\tfloat rnd4 = fract(rndFactor * 1000.0);\n\tvec3 norm = normalize(inBounds.xyz - vec3(0.5));\n\tfloat r = rnd4 * (1.0 - spawnBoundsSphereInnerRatio) + spawnBoundsSphereInnerRatio;\n#ifndef LOCAL_SPACE\n\treturn emitterPos + norm * r * spawnBoundsSphere;\n#else\n\treturn norm * r * spawnBoundsSphere;\n#endif\n}\nvoid addInitialVelocity(inout vec3 localVelocity, vec3 inBounds) {\n\tlocalVelocity += normalize(inBounds - vec3(0.5)) * initialVelocity;\n}\n",particleUpdaterStartPS:"float saturate(float x) {\n\treturn clamp(x, 0.0, 1.0);\n}\nvec3 unpack3NFloats(float src) {\n\tfloat r = fract(src);\n\tfloat g = fract(src * 256.0);\n\tfloat b = fract(src * 65536.0);\n\treturn vec3(r, g, b);\n}\nvec3 tex1Dlod_lerp(highp sampler2D tex, vec2 tc, out vec3 w) {\n\tvec4 a = texture2D(tex, tc);\n\tvec4 b = texture2D(tex, tc + graphSampleSize);\n\tfloat c = fract(tc.x * graphNumSamples);\n\tvec3 unpackedA = unpack3NFloats(a.w);\n\tvec3 unpackedB = unpack3NFloats(b.w);\n\tw = mix(unpackedA, unpackedB, c);\n\treturn mix(a.xyz, b.xyz, c);\n}\n#define HASHSCALE4 vec4(1031, .1030, .0973, .1099)\nvec4 hash41(float p) {\n\tvec4 p4 = fract(vec4(p) * HASHSCALE4);\n\tp4 += dot(p4, p4.wzxy+19.19);\n\treturn fract(vec4((p4.x + p4.y)*p4.z, (p4.x + p4.z)*p4.y, (p4.y + p4.z)*p4.w, (p4.z + p4.w)*p4.x));\n}\nvoid main(void) {\n\tif (gl_FragCoord.x > numParticles) discard;\n\treadInput(vUv0.x);\n\tvisMode = inShow? 1.0 : -1.0;\n\tvec4 rndFactor = hash41(gl_FragCoord.x + seed);\n\tfloat particleRate = rate + rateDiv * rndFactor.x;\n\toutLife = inLife + delta;\n\tfloat nlife = clamp(outLife / lifetime, 0.0, 1.0);\n\tvec3 localVelocityDiv;\n\tvec3 velocityDiv;\n\tvec3 paramDiv;\n\tvec3 localVelocity = tex1Dlod_lerp(internalTex0, vec2(nlife, 0), localVelocityDiv);\n\tvec3 velocity =\t\ttex1Dlod_lerp(internalTex1, vec2(nlife, 0), velocityDiv);\n\tvec3 params =\t\ttex1Dlod_lerp(internalTex2, vec2(nlife, 0), paramDiv);\n\tfloat rotSpeed = params.x;\n\tfloat rotSpeedDiv = paramDiv.y;\n\tvec3 radialParams = tex1Dlod_lerp(internalTex3, vec2(nlife, 0), paramDiv);\n\tfloat radialSpeed = radialParams.x;\n\tfloat radialSpeedDiv = radialParams.y;\n\tbool respawn = inLife <= 0.0 || outLife >= lifetime;\n\tinPos = respawn ? calcSpawnPosition(rndFactor.xyz, rndFactor.x) : inPos;\n\tinAngle = respawn ? mix(startAngle, startAngle2, rndFactor.x) : inAngle;\n#ifndef LOCAL_SPACE\n\tvec3 radialVel = inPos - emitterPos;\n#else\n\tvec3 radialVel = inPos;\n#endif\n\tradialVel = (dot(radialVel, radialVel) > 1.0E-8) ? radialSpeed * normalize(radialVel) : vec3(0.0);\n\tradialVel += (radialSpeedDiv * vec3(2.0) - vec3(1.0)) * radialSpeedDivMult * rndFactor.xyz;\n\tlocalVelocity +=\t(localVelocityDiv * vec3(2.0) - vec3(1.0)) * localVelocityDivMult * rndFactor.xyz;\n\tvelocity +=\t\t (velocityDiv * vec3(2.0) - vec3(1.0)) * velocityDivMult * rndFactor.xyz;\n\trotSpeed +=\t\t (rotSpeedDiv * 2.0 - 1.0) * rotSpeedDivMult * rndFactor.y;\n\taddInitialVelocity(localVelocity, rndFactor.xyz);\n#ifndef LOCAL_SPACE\n\toutVel = emitterMatrix * localVelocity + (radialVel + velocity) * emitterScale;\n#else\n\toutVel = (localVelocity + radialVel) / emitterScale + emitterMatrixInv * velocity;\n#endif\n\toutPos = inPos + outVel * delta;\n\toutAngle = inAngle + rotSpeed * delta;\n",particle_billboardVS:"\tquadXY = rotate(quadXY, inAngle, rotMatrix);\n\tvec3 localPos = billboard(particlePos, quadXY);\n",particle_blendAddPS:"\tdBlendModeFogFactor = 0.0;\n\trgb *= saturate(gammaCorrectInput(max(a, 0.0)));\n\tif ((rgb.r + rgb.g + rgb.b) < 0.000001) discard;\n",particle_blendMultiplyPS:"\trgb = mix(vec3(1.0), rgb, vec3(a));\n\tif (rgb.r + rgb.g + rgb.b > 2.99) discard;\n",particle_blendNormalPS:"\tif (a < 0.01) discard;\n",particle_cpuVS:"attribute vec4 particle_vertexData;\nattribute vec4 particle_vertexData2;\nattribute vec4 particle_vertexData3;\nattribute float particle_vertexData4;\n#ifndef USE_MESH\n#define VDATA5TYPE vec2\n#else\n#define VDATA5TYPE vec4\n#endif\nattribute VDATA5TYPE particle_vertexData5;\nuniform mat4 matrix_viewProjection;\nuniform mat4 matrix_model;\n#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\nuniform mat3 matrix_normal;\nuniform mat4 matrix_viewInverse;\nuniform float numParticles;\nuniform float lifetime;\nuniform float stretch;\nuniform float seed;\nuniform vec3 wrapBounds, emitterScale, faceTangent, faceBinorm;\nuniform sampler2D texLifeAndSourcePosOUT;\nuniform highp sampler2D internalTex0;\nuniform highp sampler2D internalTex1;\nuniform highp sampler2D internalTex2;\nuniform vec3 emitterPos;\nvarying vec4 texCoordsAlphaLife;\nvec2 rotate(vec2 quadXY, float pRotation, out mat2 rotMatrix)\n{\n\tfloat c = cos(pRotation);\n\tfloat s = sin(pRotation);\n\tmat2 m = mat2(c, -s, s, c);\n\trotMatrix = m;\n\treturn m * quadXY;\n}\nvec3 billboard(vec3 InstanceCoords, vec2 quadXY)\n{\n\tvec3 pos = -matrix_viewInverse[0].xyz * quadXY.x + -matrix_viewInverse[1].xyz * quadXY.y;\n\treturn pos;\n}\nvec3 customFace(vec3 InstanceCoords, vec2 quadXY)\n{\n\tvec3 pos = faceTangent * quadXY.x + faceBinorm * quadXY.y;\n\treturn pos;\n}\nvoid main(void)\n{\n\tvec3 particlePos = particle_vertexData.xyz;\n\tvec3 inPos = particlePos;\n\tvec3 vertPos = particle_vertexData3.xyz;\n\tvec3 inVel = vec3(particle_vertexData2.w, particle_vertexData3.w, particle_vertexData5.x);\n\tfloat id = floor(particle_vertexData4);\n\tfloat rndFactor = fract(sin(id + 1.0 + seed));\n\tvec3 rndFactor3 = vec3(rndFactor, fract(rndFactor*10.0), fract(rndFactor*100.0));\n#ifdef LOCAL_SPACE\n\tinVel = mat3(matrix_model) * inVel;\n#endif\n\tvec2 velocityV = normalize((mat3(matrix_view) * inVel).xy);\n\tvec2 quadXY = vertPos.xy;\n#ifdef USE_MESH\n\ttexCoordsAlphaLife = vec4(particle_vertexData5.zw, particle_vertexData2.z, particle_vertexData.w);\n#else\n\ttexCoordsAlphaLife = vec4(quadXY * -0.5 + 0.5, particle_vertexData2.z, particle_vertexData.w);\n#endif\n\tmat2 rotMatrix;\n\tfloat inAngle = particle_vertexData2.x;\n\tvec3 particlePosMoved = vec3(0.0);\n\tvec3 meshLocalPos = particle_vertexData3.xyz;\n",particle_cpu_endVS:"\tlocalPos *= particle_vertexData2.y * emitterScale;\n\tlocalPos += particlePos;\n\tgl_Position = matrix_viewProjection * vec4(localPos, 1.0);\n",particle_customFaceVS:"\tquadXY = rotate(quadXY, inAngle, rotMatrix);\n\tvec3 localPos = customFace(particlePos, quadXY);\n",particle_endPS:"\trgb = addFog(rgb);\n\trgb = toneMap(rgb);\n\trgb = gammaCorrectOutput(rgb);\n\tgl_FragColor = vec4(rgb, a);\n}\n",particle_endVS:"\tlocalPos *= scale * emitterScale;\n\tlocalPos += particlePos;\n\t#ifdef SCREEN_SPACE\n\tgl_Position = vec4(localPos.x, localPos.y, 0.0, 1.0);\n\t#else\n\tgl_Position = matrix_viewProjection * vec4(localPos.xyz, 1.0);\n\t#endif\n",particle_halflambertPS:"\tvec3 negNormal = normal*0.5+0.5;\n\tvec3 posNormal = -normal*0.5+0.5;\n\tnegNormal *= negNormal;\n\tposNormal *= posNormal;\n",particle_initVS:"attribute vec4 particle_vertexData;\n#ifdef USE_MESH\nattribute vec2 particle_uv;\n#endif\nuniform mat4 matrix_viewProjection;\nuniform mat4 matrix_model;\nuniform mat3 matrix_normal;\nuniform mat4 matrix_viewInverse;\n#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\nuniform float numParticles, numParticlesPot;\nuniform float graphSampleSize;\nuniform float graphNumSamples;\nuniform float stretch;\nuniform vec3 wrapBounds;\nuniform vec3 emitterScale, emitterPos, faceTangent, faceBinorm;\nuniform float rate, rateDiv, lifetime, deltaRandomnessStatic, scaleDivMult, alphaDivMult, seed, delta;\nuniform sampler2D particleTexOUT, particleTexIN;\nuniform highp sampler2D internalTex0;\nuniform highp sampler2D internalTex1;\nuniform highp sampler2D internalTex2;\n#ifndef CAMERAPLANES\n#define CAMERAPLANES\nuniform vec4 camera_params;\n#endif\nvarying vec4 texCoordsAlphaLife;\nvec3 inPos;\nvec3 inVel;\nfloat inAngle;\nbool inShow;\nfloat inLife;\n",particle_lambertPS:"\tvec3 negNormal = max(normal, vec3(0.0));\n\tvec3 posNormal = max(-normal, vec3(0.0));\n",particle_lightingPS:"\tvec3 light = negNormal.x*lightCube[0] + posNormal.x*lightCube[1] +\n\t\t\t\t\t\tnegNormal.y*lightCube[2] + posNormal.y*lightCube[3] +\n\t\t\t\t\t\tnegNormal.z*lightCube[4] + posNormal.z*lightCube[5];\n\trgb *= light;\n",particle_localShiftVS:"\tparticlePos = (matrix_model * vec4(particlePos, 1.0)).xyz;\n",particle_meshVS:"\tvec3 localPos = meshLocalPos;\n\tlocalPos.xy = rotate(localPos.xy, inAngle, rotMatrix);\n\tlocalPos.yz = rotate(localPos.yz, inAngle, rotMatrix);\n\tbillboard(particlePos, quadXY);\n",particle_normalVS:"\tNormal = normalize(localPos + matrix_viewInverse[2].xyz);\n",particle_normalMapPS:"\tvec3 normalMap = normalize(texture2D(normalMap, vec2(texCoordsAlphaLife.x, 1.0 - texCoordsAlphaLife.y)).xyz * 2.0 - 1.0);\n\tvec3 normal = ParticleMat * normalMap;\n",particle_pointAlongVS:"\tinAngle = atan(velocityV.x, velocityV.y);\n",particle_softPS:"\tfloat depth = getLinearScreenDepth();\n\tfloat particleDepth = vDepth;\n\tfloat depthDiff = saturate(abs(particleDepth - depth) * softening);\n\ta *= depthDiff;\n",particle_softVS:"\tvDepth = getLinearDepth(localPos);\n",particle_stretchVS:"\tvec3 moveDir = inVel * stretch;\n\tvec3 posPrev = particlePos - moveDir;\n\tposPrev += particlePosMoved;\n\tvec2 centerToVertexV = normalize((mat3(matrix_view) * localPos).xy);\n\tfloat interpolation = dot(-velocityV, centerToVertexV) * 0.5 + 0.5;\n\tparticlePos = mix(particlePos, posPrev, interpolation);\n",particle_TBNVS:"\tmat3 rot3 = mat3(rotMatrix[0][0], rotMatrix[0][1], 0.0, rotMatrix[1][0], rotMatrix[1][1], 0.0, 0.0, 0.0, 1.0);\n\tParticleMat = mat3(-matrix_viewInverse[0].xyz, -matrix_viewInverse[1].xyz, matrix_viewInverse[2].xyz) * rot3;\n",particle_wrapVS:"\tvec3 origParticlePos = particlePos;\n\tparticlePos -= matrix_model[3].xyz;\n\tparticlePos = mod(particlePos, wrapBounds) - wrapBounds * 0.5;\n\tparticlePos += matrix_model[3].xyz;\n\tparticlePosMoved = particlePos - origParticlePos;\n",precisionTestPS:"void main(void) {\n\tgl_FragColor = vec4(2147483648.0);\n}\n",precisionTest2PS:"uniform sampler2D source;\nvec4 packFloat(float depth) {\n\tconst vec4 bit_shift = vec4(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0);\n\tconst vec4 bit_mask\t= vec4(0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0);\n\tvec4 res = mod(depth * bit_shift * vec4(255), vec4(256) ) / vec4(255);\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main(void) {\n\tfloat c = texture2D(source, vec2(0.0)).r;\n\tfloat diff = abs(c - 2147483648.0) / 2147483648.0;\n\tgl_FragColor = packFloat(diff);\n}\n",reflDirPS:"void getReflDir() {\n\tdReflDirW = normalize(-reflect(dViewDirW, dNormalW));\n}\n",reflDirAnisoPS:"void getReflDir() {\n\tfloat roughness = sqrt(1.0 - min(dGlossiness, 1.0));\n\tfloat anisotropy = material_anisotropy * roughness;\n\tvec3 anisotropicDirection = anisotropy >= 0.0 ? dTBN[1] : dTBN[0];\n\tvec3 anisotropicTangent = cross(anisotropicDirection, dViewDirW);\n\tvec3 anisotropicNormal = cross(anisotropicTangent, anisotropicDirection);\n\tvec3 bentNormal = normalize(mix(normalize(dNormalW), normalize(anisotropicNormal), anisotropy));\n\tdReflDirW = reflect(-dViewDirW, bentNormal);\n}\n",reflectionCCPS:"#ifdef CLEARCOAT\nuniform float material_clearCoatReflectivity;\nvoid addReflectionCC() {\n\tccReflection += vec4(calcReflection(ccReflDirW, ccGlossiness), material_clearCoatReflectivity);\n}\n#endif\n",reflectionCubePS:"uniform samplerCube texture_cubeMap;\nuniform float material_reflectivity;\nvec3 calcReflection(vec3 tReflDirW, float tGlossiness) {\n\tvec3 lookupVec = fixSeams(cubeMapProject(tReflDirW));\n\tlookupVec.x *= -1.0;\n\treturn $DECODE(textureCube(texture_cubeMap, lookupVec));\n}\nvoid addReflection() {\n\tdReflection += vec4(calcReflection(dReflDirW, dGlossiness), material_reflectivity);\n}\n",reflectionEnvPS:"#ifndef ENV_ATLAS\n#define ENV_ATLAS\nuniform sampler2D texture_envAtlas;\n#endif\nuniform float material_reflectivity;\nfloat shinyMipLevel(vec2 uv) {\n\tvec2 dx = dFdx(uv);\n\tvec2 dy = dFdy(uv);\n\tvec2 uv2 = vec2(fract(uv.x + 0.5), uv.y);\n\tvec2 dx2 = dFdx(uv2);\n\tvec2 dy2 = dFdy(uv2);\n\tfloat maxd = min(max(dot(dx, dx), dot(dy, dy)), max(dot(dx2, dx2), dot(dy2, dy2)));\n\treturn clamp(0.5 * log2(maxd) - 1.0, 0.0, 6.0);\n}\nvec3 calcReflection(vec3 tReflDirW, float tGlossiness) {\n\tvec3 dir = cubeMapProject(tReflDirW) * vec3(-1.0, 1.0, 1.0);\n\tvec2 uv = toSphericalUv(dir);\n\tfloat level = saturate(1.0 - tGlossiness) * 5.0;\n\tfloat ilevel = floor(level);\n\tfloat level2 = shinyMipLevel(uv * atlasSize);\n\tfloat ilevel2 = floor(level2);\n\tvec2 uv0, uv1;\n\tfloat weight;\n\tif (ilevel == 0.0) {\n\t\tuv0 = mapMip(uv, ilevel2);\n\t\tuv1 = mapMip(uv, ilevel2 + 1.0);\n\t\tweight = level2 - ilevel2;\n\t} else {\n\t\tuv0 = uv1 = mapRoughnessUv(uv, ilevel);\n\t\tweight = 0.0;\n\t}\n\tvec3 linearA = $DECODE(texture2D(texture_envAtlas, uv0));\n\tvec3 linearB = $DECODE(texture2D(texture_envAtlas, uv1));\n\tvec3 linear0 = mix(linearA, linearB, weight);\n\tvec3 linear1 = $DECODE(texture2D(texture_envAtlas, mapRoughnessUv(uv, ilevel + 1.0)));\n\treturn processEnvironment(mix(linear0, linear1, level - ilevel));\n}\nvoid addReflection() {\n\tdReflection += vec4(calcReflection(dReflDirW, dGlossiness), material_reflectivity);\n}\n",reflectionSpherePS:"#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\nuniform sampler2D texture_sphereMap;\nuniform float material_reflectivity;\nvec3 calcReflection(vec3 tReflDirW, float tGlossiness) {\n\tvec3 reflDirV = (mat3(matrix_view) * tReflDirW).xyz;\n\tfloat m = 2.0 * sqrt( dot(reflDirV.xy, reflDirV.xy) + (reflDirV.z+1.0)*(reflDirV.z+1.0) );\n\tvec2 sphereMapUv = reflDirV.xy / m + 0.5;\n\treturn $DECODE(texture2D(texture_sphereMap, sphereMapUv));\n}\nvoid addReflection() {\n\tdReflection += vec4(calcReflection(dReflDirW, dGlossiness), material_reflectivity);\n}\n",reflectionSphereLowPS:"uniform sampler2D texture_sphereMap;\nuniform float material_reflectivity;\nvec3 calcReflection(vec3 tReflDirW, float tGlossiness) {\n\tvec3 reflDirV = vNormalV;\n\tvec2 sphereMapUv = reflDirV.xy * 0.5 + 0.5;\n\treturn $DECODE(texture2D(texture_sphereMap, sphereMapUv));\n}\nvoid addReflection() {\n\tdReflection += vec4(calcReflection(dReflDirW, dGlossiness), material_reflectivity);\n}\n",refractionPS:"uniform float material_refraction, material_refractionIndex;\nvec3 refract2(vec3 viewVec, vec3 Normal, float IOR) {\n\tfloat vn = dot(viewVec, Normal);\n\tfloat k = 1.0 - IOR * IOR * (1.0 - vn * vn);\n\tvec3 refrVec = IOR * viewVec - (IOR * vn + sqrt(k)) * Normal;\n\treturn refrVec;\n}\nvoid addRefraction() {\n\tvec3 tmp = dReflDirW;\n\tvec4 tmp2 = dReflection;\n\tdReflection = vec4(0.0);\n\tdReflDirW = refract2(-dViewDirW, dNormalW, material_refractionIndex);\n\taddReflection();\n\tdDiffuseLight = mix(dDiffuseLight, dReflection.rgb * dAlbedo, material_refraction);\n\tdReflDirW = tmp;\n\tdReflection = tmp2;\n}\n",reprojectPS:"varying vec2 vUv0;\nuniform sampler2D sourceTex;\nuniform samplerCube sourceCube;\nuniform sampler2D samplesTex;\nuniform vec2 samplesTexInverseSize;\nuniform vec4 params;\nuniform vec2 params2;\nfloat targetFace() { return params.x; }\nfloat specularPower() { return params.y; }\nfloat sourceCubeSeamScale() { return params.z; }\nfloat targetCubeSeamScale() { return params.w; }\nfloat targetTotalPixels() { return params2.x; }\nfloat sourceTotalPixels() { return params2.y; }\nfloat PI = 3.141592653589793;\nfloat saturate(float x) {\n\treturn clamp(x, 0.0, 1.0);\n}\nvec3 decodeLinear(vec4 source) {\n\treturn source.rgb;\n}\nvec4 encodeLinear(vec3 source) {\n\treturn vec4(source, 1.0);\n}\nvec3 decodeGamma(vec4 source) {\n\treturn pow(source.xyz, vec3(2.2));\n}\nvec4 encodeGamma(vec3 source) {\n\treturn vec4(pow(source + 0.0000001, vec3(1.0 / 2.2)), 1.0);\n}\nvec3 decodeRGBM(vec4 rgbm) {\n\tvec3 color = (8.0 * rgbm.a) * rgbm.rgb;\n\treturn color * color;\n}\nvec4 encodeRGBM(vec3 source) {\n\tvec4 result;\n\tresult.rgb = pow(source.rgb, vec3(0.5));\n\tresult.rgb *= 1.0 / 8.0;\n\tresult.a = saturate( max( max( result.r, result.g ), max( result.b, 1.0 / 255.0 ) ) );\n\tresult.a = ceil(result.a * 255.0) / 255.0;\n\tresult.rgb /= result.a;\n\treturn result;\n}\nvec3 decodeRGBE(vec4 source) {\n\tif (source.a == 0.0) {\n\t\treturn vec3(0.0, 0.0, 0.0);\n\t} else {\n\t\treturn source.xyz * pow(2.0, source.w * 255.0 - 128.0);\n\t}\n}\nvec4 encodeRGBE(vec3 source) {\n\tfloat maxVal = max(source.x, max(source.y, source.z));\n\tif (maxVal < 1e-32) {\n\t\treturn vec4(0, 0, 0, 0);\n\t} else {\n\t\tfloat e = ceil(log2(maxVal));\n\t\treturn vec4(source / pow(2.0, e), (e + 128.0) / 255.0);\n\t}\n}\nvec3 modifySeams(vec3 dir, float scale) {\n\tvec3 adir = abs(dir);\n\tfloat M = max(max(adir.x, adir.y), adir.z);\n\treturn dir / M * vec3(\n\t\tadir.x == M ? 1.0 : scale,\n\t\tadir.y == M ? 1.0 : scale,\n\t\tadir.z == M ? 1.0 : scale\n\t);\n}\nvec2 toSpherical(vec3 dir) {\n\treturn vec2(dir.xz == vec2(0.0) ? 0.0 : atan(dir.x, dir.z), asin(dir.y));\n}\nvec3 fromSpherical(vec2 uv) {\n\treturn vec3(cos(uv.y) * sin(uv.x),\n\t\t\t\tsin(uv.y),\n\t\t\t\tcos(uv.y) * cos(uv.x));\n}\nvec3 getDirectionEquirect() {\n\treturn fromSpherical((vec2(vUv0.x, 1.0 - vUv0.y) * 2.0 - 1.0) * vec2(PI, PI * 0.5));\n}\nvec4 sampleEquirect(vec2 sph) {\n\tvec2 uv = sph / vec2(PI * 2.0, PI) + 0.5;\n\treturn texture2D(sourceTex, vec2(uv.x, 1.0 - uv.y));\n}\nvec4 sampleEquirect(vec3 dir) {\n\treturn sampleEquirect(toSpherical(dir));\n}\nvec4 sampleCubemap(vec3 dir) {\n\treturn textureCube(sourceCube, modifySeams(dir, 1.0 - sourceCubeSeamScale()));\n}\nvec4 sampleCubemap(vec2 sph) {\n\treturn sampleCubemap(fromSpherical(sph));\n}\nvec4 sampleEquirect(vec2 sph, float mipLevel) {\n\tvec2 uv = sph / vec2(PI * 2.0, PI) + 0.5;\n#ifdef SUPPORTS_TEXLOD\n\treturn texture2DLodEXT(sourceTex, vec2(uv.x, 1.0 - uv.y), mipLevel);\n#else\n\treturn texture2D(sourceTex, vec2(uv.x, 1.0 - uv.y));\n#endif\n}\nvec4 sampleEquirect(vec3 dir, float mipLevel) {\n\treturn sampleEquirect(toSpherical(dir), mipLevel);\n}\nvec4 sampleCubemap(vec3 dir, float mipLevel) {\n#ifdef SUPPORTS_TEXLOD\n\treturn textureCubeLodEXT(sourceCube, modifySeams(dir, 1.0 - exp2(mipLevel) * sourceCubeSeamScale()), mipLevel);\n#else\n\treturn textureCube(sourceCube, modifySeams(dir, 1.0 - exp2(mipLevel) * sourceCubeSeamScale()));\n#endif\n}\nvec4 sampleCubemap(vec2 sph, float mipLevel) {\n\treturn sampleCubemap(fromSpherical(sph), mipLevel);\n}\nfloat signNotZero(float k){\n\treturn(k >= 0.0) ? 1.0 : -1.0;\n}\nvec2 signNotZero(vec2 v) {\n\treturn vec2(signNotZero(v.x), signNotZero(v.y));\n}\nvec3 octDecode(vec2 o) {\n\tvec3 v = vec3(o.x, 1.0 - abs(o.x) - abs(o.y), o.y);\n\tif (v.y < 0.0) {\n\t\tv.xz = (1.0 - abs(v.zx)) * signNotZero(v.xz);\n\t}\n\treturn normalize(v);\n}\nvec3 getDirectionOctahedral() {\n\treturn octDecode(vec2(vUv0.x, 1.0 - vUv0.y) * 2.0 - 1.0);\n}\nvec2 octEncode(in vec3 v) {\n\tfloat l1norm = abs(v.x) + abs(v.y) + abs(v.z);\n\tvec2 result = v.xz * (1.0 / l1norm);\n\tif (v.y < 0.0) {\n\t\tresult = (1.0 - abs(result.yx)) * signNotZero(result.xy);\n\t}\n\treturn result;\n}\nvec4 sampleOctahedral(vec3 dir) {\n\tvec2 uv = octEncode(dir) * 0.5 + 0.5;\n\treturn texture2D(sourceTex, vec2(uv.x, 1.0 - uv.y));\n}\nvec4 sampleOctahedral(vec2 sph) {\n\treturn sampleOctahedral(fromSpherical(sph));\n}\nvec4 sampleOctahedral(vec3 dir, float mipLevel) {\n\tvec2 uv = octEncode(dir) * 0.5 + 0.5;\n#ifdef SUPPORTS_TEXLOD\n\treturn texture2DLodEXT(sourceTex, vec2(uv.x, 1.0 - uv.y), mipLevel);\n#else\n\treturn texture2D(sourceTex, vec2(uv.x, 1.0 - uv.y));\n#endif\n}\nvec4 sampleOctahedral(vec2 sph, float mipLevel) {\n\treturn sampleOctahedral(fromSpherical(sph), mipLevel);\n}\nvec3 getDirectionCubemap() {\n\tvec2 st = vUv0 * 2.0 - 1.0;\n\tfloat face = targetFace();\n\tvec3 vec;\n\tif (face == 0.0) {\n\t\tvec = vec3(1, -st.y, -st.x);\n\t} else if (face == 1.0) {\n\t\tvec = vec3(-1, -st.y, st.x);\n\t} else if (face == 2.0) {\n\t\tvec = vec3(st.x, 1, st.y);\n\t} else if (face == 3.0) {\n\t\tvec = vec3(st.x, -1, -st.y);\n\t} else if (face == 4.0) {\n\t\tvec = vec3(st.x, -st.y, 1);\n\t} else {\n\t\tvec = vec3(-st.x, -st.y, -1);\n\t}\n\treturn normalize(modifySeams(vec, 1.0 / (1.0 - targetCubeSeamScale())));\n}\nmat3 matrixFromVector(vec3 n) {\n\tfloat a = 1.0 / (1.0 + n.z);\n\tfloat b = -n.x * n.y * a;\n\tvec3 b1 = vec3(1.0 - n.x * n.x * a, b, -n.x);\n\tvec3 b2 = vec3(b, 1.0 - n.y * n.y * a, -n.y);\n\treturn mat3(b1, b2, n);\n}\nmat3 matrixFromVectorSlow(vec3 n) {\n\tvec3 up = (1.0 - abs(n.y) <= 0.0000001) ? vec3(0.0, 0.0, n.y > 0.0 ? 1.0 : -1.0) : vec3(0.0, 1.0, 0.0);\n\tvec3 x = normalize(cross(up, n));\n\tvec3 y = cross(n, x);\n\treturn mat3(x, y, n);\n}\nvec4 reproject() {\n\tif (NUM_SAMPLES <= 1) {\n\t\treturn ENCODE_FUNC(DECODE_FUNC(SOURCE_FUNC(TARGET_FUNC())));\n\t} else {\n\t\tvec2 sph = toSpherical(TARGET_FUNC());\n\t\tvec2 sphu = dFdx(sph);\n\t\tvec2 sphv = dFdy(sph);\n\t\tconst float NUM_SAMPLES_SQRT = sqrt(float(NUM_SAMPLES));\n\t\tvec3 result = vec3(0.0);\n\t\tfor (float u = 0.0; u < NUM_SAMPLES_SQRT; ++u) {\n\t\t\tfor (float v = 0.0; v < NUM_SAMPLES_SQRT; ++v) {\n\t\t\t\tresult += DECODE_FUNC(SOURCE_FUNC(sph +\n\t\t\t\t\t\t\t\t\t\t\t\t\tsphu * (u / NUM_SAMPLES_SQRT - 0.5) +\n\t\t\t\t\t\t\t\t\t\t\t\t\tsphv * (v / NUM_SAMPLES_SQRT - 0.5)));\n\t\t\t}\n\t\t}\n\t\treturn ENCODE_FUNC(result / (NUM_SAMPLES_SQRT * NUM_SAMPLES_SQRT));\n\t}\n}\nvec4 unpackFloat = vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0);\nvoid unpackSample(int i, out vec3 L, out float mipLevel) {\n\tfloat u = (float(i * 4) + 0.5) * samplesTexInverseSize.x;\n\tfloat v = (floor(u) + 0.5) * samplesTexInverseSize.y;\n\tvec4 raw;\n\traw.x = dot(texture2D(samplesTex, vec2(u, v)), unpackFloat); u += samplesTexInverseSize.x;\n\traw.y = dot(texture2D(samplesTex, vec2(u, v)), unpackFloat); u += samplesTexInverseSize.x;\n\traw.z = dot(texture2D(samplesTex, vec2(u, v)), unpackFloat); u += samplesTexInverseSize.x;\n\traw.w = dot(texture2D(samplesTex, vec2(u, v)), unpackFloat);\n\tL.xyz = raw.xyz * 2.0 - 1.0;\n\tmipLevel = raw.w * 8.0;\n}\nvec4 prefilterSamples() {\n\tmat3 vecSpace = matrixFromVectorSlow(TARGET_FUNC());\n\tvec3 L;\n\tfloat mipLevel;\n\tvec3 result = vec3(0.0);\n\tfloat totalWeight = 0.0;\n\tfor (int i = 0; i < NUM_SAMPLES; ++i) {\n\t\tunpackSample(i, L, mipLevel);\n\t\tresult += DECODE_FUNC(SOURCE_FUNC(vecSpace * L, mipLevel)) * L.z;\n\t\ttotalWeight += L.z;\n\t}\n\treturn ENCODE_FUNC(result / totalWeight);\n}\nvec4 prefilterSamplesUnweighted() {\n\tmat3 vecSpace = matrixFromVectorSlow(TARGET_FUNC());\n\tvec3 L;\n\tfloat mipLevel;\n\tvec3 result = vec3(0.0);\n\tfloat totalWeight = 0.0;\n\tfor (int i = 0; i < NUM_SAMPLES; ++i) {\n\t\tunpackSample(i, L, mipLevel);\n\t\tresult += DECODE_FUNC(SOURCE_FUNC(vecSpace * L, mipLevel));\n\t}\n\treturn ENCODE_FUNC(result / float(NUM_SAMPLES));\n}\nvoid main(void) {\n\tgl_FragColor = PROCESS_FUNC();\n}\n",rgbmPS:"vec3 texture2DRGBM(sampler2D tex, vec2 uv) {\n\treturn decodeRGBM(texture2D(tex, uv));\n}\nvec3 textureCubeRGBM(samplerCube tex, vec3 uvw) {\n\treturn decodeRGBM(textureCube(tex, uvw));\n}\n",screenDepthPS:"uniform highp sampler2D uDepthMap;\n#ifndef SCREENSIZE\n#define SCREENSIZE\nuniform vec4 uScreenSize;\n#endif\n#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\n#ifndef CAMERAPLANES\n#define CAMERAPLANES\nuniform vec4 camera_params;\n#endif\n#ifdef GL2\nfloat linearizeDepth(float z) {\n\tz = z * 2.0 - 1.0;\n\treturn 1.0 / (camera_params.z * z + camera_params.w);\n}\n#else\n#ifndef UNPACKFLOAT\n#define UNPACKFLOAT\nfloat unpackFloat(vec4 rgbaDepth) {\n\tconst vec4 bitShift = vec4(1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0);\n\treturn dot(rgbaDepth, bitShift);\n}\n#endif\n#endif\nfloat getLinearScreenDepth(vec2 uv) {\n\t#ifdef GL2\n\treturn linearizeDepth(texture2D(uDepthMap, uv).r) * camera_params.y;\n\t#else\n\treturn unpackFloat(texture2D(uDepthMap, uv)) * camera_params.y;\n\t#endif\n}\n#ifndef VERTEXSHADER\nfloat getLinearScreenDepth() {\n\tvec2 uv = gl_FragCoord.xy * uScreenSize.zw;\n\treturn getLinearScreenDepth(uv);\n}\n#endif\nfloat getLinearDepth(vec3 pos) {\n\treturn -(matrix_view * vec4(pos, 1.0)).z;\n}\n",shadowCascadesPS:"const float maxCascades = 4.0;\nmat4 cascadeShadowMat;\nvoid getShadowCascadeMatrix(mat4 shadowMatrixPalette[4], float shadowCascadeDistances[4], float shadowCascadeCount) {\n\tfloat depth = 1.0 / gl_FragCoord.w;\n\tfloat cascadeIndex = 0.0;\n\tfor (float i = 0.0; i < maxCascades; i++) {\n\t\tif (depth < shadowCascadeDistances[int(i)]) {\n\t\t\tcascadeIndex = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\tcascadeIndex = min(cascadeIndex, shadowCascadeCount - 1.0);\n\t#ifdef GL2\n\t\tcascadeShadowMat = shadowMatrixPalette[int(cascadeIndex)];\n\t#else\n\t\tif (cascadeIndex == 0.0) {\n\t\t\tcascadeShadowMat = shadowMatrixPalette[0];\n\t\t}\n\t\telse if (cascadeIndex == 1.0) {\n\t\t\tcascadeShadowMat = shadowMatrixPalette[1];\n\t\t}\n\t\telse if (cascadeIndex == 2.0) {\n\t\t\tcascadeShadowMat = shadowMatrixPalette[2];\n\t\t}\n\t\telse {\n\t\t\tcascadeShadowMat = shadowMatrixPalette[3];\n\t\t}\n\t#endif\n}\nvoid fadeShadow(float shadowCascadeDistances[4]) {\n\tfloat depth = 1.0 / gl_FragCoord.w;\n\tif (depth > shadowCascadeDistances[int(maxCascades - 1.0)]) {\n\t\tdShadowCoord.z = -9999999.0;\n\t}\n}\n",shadowCommonPS:"void normalOffsetPointShadow(vec4 shadowParams) {\n\tfloat distScale = length(dLightDirW);\n\tvec3 wPos = vPositionW + dVertexNormalW * shadowParams.y * clamp(1.0 - dot(dVertexNormalW, -dLightDirNormW), 0.0, 1.0) * distScale;\n\tvec3 dir = wPos - dLightPosW;\n\tdLightDirW = dir;\n}\n",shadowCoordPS:"void _getShadowCoordOrtho(mat4 shadowMatrix, vec3 shadowParams, vec3 wPos) {\n\tdShadowCoord = (shadowMatrix * vec4(wPos, 1.0)).xyz;\n\tdShadowCoord.z = saturate(dShadowCoord.z) - 0.0001;\n\t#ifdef SHADOWBIAS\n\tdShadowCoord.z += getShadowBias(shadowParams.x, shadowParams.z);\n\t#endif\n}\nvoid _getShadowCoordPersp(mat4 shadowMatrix, vec4 shadowParams, vec3 wPos) {\n\tvec4 projPos = shadowMatrix * vec4(wPos, 1.0);\n\tprojPos.xy /= projPos.w;\n\tdShadowCoord.xy = projPos.xy;\n\tdShadowCoord.z = length(dLightDirW) * shadowParams.w;\n\t#ifdef SHADOWBIAS\n\tdShadowCoord.z += getShadowBias(shadowParams.x, shadowParams.z);\n\t#endif\n}\nvoid getShadowCoordOrtho(mat4 shadowMatrix, vec3 shadowParams) {\n\t_getShadowCoordOrtho(shadowMatrix, shadowParams, vPositionW);\n}\nvoid getShadowCoordPersp(mat4 shadowMatrix, vec4 shadowParams) {\n\t_getShadowCoordPersp(shadowMatrix, shadowParams, vPositionW);\n}\nvoid getShadowCoordPerspNormalOffset(mat4 shadowMatrix, vec4 shadowParams) {\n\tfloat distScale = abs(dot(vPositionW - dLightPosW, dLightDirNormW));\n\tvec3 wPos = vPositionW + dVertexNormalW * shadowParams.y * clamp(1.0 - dot(dVertexNormalW, -dLightDirNormW), 0.0, 1.0) * distScale;\n\t_getShadowCoordPersp(shadowMatrix, shadowParams, wPos);\n}\nvoid getShadowCoordOrthoNormalOffset(mat4 shadowMatrix, vec3 shadowParams) {\n\tvec3 wPos = vPositionW + dVertexNormalW * shadowParams.y * clamp(1.0 - dot(dVertexNormalW, -dLightDirNormW), 0.0, 1.0);\n\t_getShadowCoordOrtho(shadowMatrix, shadowParams, wPos);\n}\n",shadowCoordPerspZbufferPS:"void _getShadowCoordPerspZbuffer(mat4 shadowMatrix, vec4 shadowParams, vec3 wPos) {\n\tvec4 projPos = shadowMatrix * vec4(wPos, 1.0);\n\tprojPos.xyz /= projPos.w;\n\tdShadowCoord = projPos.xyz;\n}\nvoid getShadowCoordPerspZbufferNormalOffset(mat4 shadowMatrix, vec4 shadowParams) {\n\tfloat distScale = abs(dot(vPositionW - dLightPosW, dLightDirNormW));\n\tvec3 wPos = vPositionW + dVertexNormalW * shadowParams.y * clamp(1.0 - dot(dVertexNormalW, -dLightDirNormW), 0.0, 1.0) * distScale;\n\t_getShadowCoordPerspZbuffer(shadowMatrix, shadowParams, wPos);\n}\nvoid getShadowCoordPerspZbuffer(mat4 shadowMatrix, vec4 shadowParams) {\n\t_getShadowCoordPerspZbuffer(shadowMatrix, shadowParams, vPositionW);\n}\n",shadowEVSMPS:"float VSM$(sampler2D tex, vec2 texCoords, float resolution, float Z, float vsmBias, float exponent) {\n\tvec3 moments = texture2D(tex, texCoords).xyz;\n\treturn calculateEVSM(moments, Z, vsmBias, exponent);\n}\nfloat getShadowVSM$(sampler2D shadowMap, vec3 shadowParams, float exponent) {\n\treturn VSM$(shadowMap, dShadowCoord.xy, shadowParams.x, dShadowCoord.z, shadowParams.y, exponent);\n}\nfloat getShadowSpotVSM$(sampler2D shadowMap, vec4 shadowParams, float exponent) {\n\treturn VSM$(shadowMap, dShadowCoord.xy, shadowParams.x, length(dLightDirW) * shadowParams.w + shadowParams.z, shadowParams.y, exponent);\n}\n",shadowEVSMnPS:"float VSM$(sampler2D tex, vec2 texCoords, float resolution, float Z, float vsmBias, float exponent) {\n\tfloat pixelSize = 1.0 / resolution;\n\ttexCoords -= vec2(pixelSize);\n\tvec3 s00 = texture2D(tex, texCoords).xyz;\n\tvec3 s10 = texture2D(tex, texCoords + vec2(pixelSize, 0)).xyz;\n\tvec3 s01 = texture2D(tex, texCoords + vec2(0, pixelSize)).xyz;\n\tvec3 s11 = texture2D(tex, texCoords + vec2(pixelSize)).xyz;\n\tvec2 fr = fract(texCoords * resolution);\n\tvec3 h0 = mix(s00, s10, fr.x);\n\tvec3 h1 = mix(s01, s11, fr.x);\n\tvec3 moments = mix(h0, h1, fr.y);\n\treturn calculateEVSM(moments, Z, vsmBias, exponent);\n}\nfloat getShadowVSM$(sampler2D shadowMap, vec3 shadowParams, float exponent) {\n\treturn VSM$(shadowMap, dShadowCoord.xy, shadowParams.x, dShadowCoord.z, shadowParams.y, exponent);\n}\nfloat getShadowSpotVSM$(sampler2D shadowMap, vec4 shadowParams, float exponent) {\n\treturn VSM$(shadowMap, dShadowCoord.xy, shadowParams.x, length(dLightDirW) * shadowParams.w + shadowParams.z, shadowParams.y, exponent);\n}\n",shadowStandardPS:"vec3 lessThan2(vec3 a, vec3 b) {\n\treturn clamp((b - a)*1000.0, 0.0, 1.0);\n}\n#ifndef UNPACKFLOAT\n#define UNPACKFLOAT\nfloat unpackFloat(vec4 rgbaDepth) {\n\tconst vec4 bitShift = vec4(1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0);\n\treturn dot(rgbaDepth, bitShift);\n}\n#endif\n#ifdef GL2\nfloat _getShadowPCF3x3(sampler2DShadow shadowMap, vec3 shadowParams) {\n\tfloat z = dShadowCoord.z;\n\tvec2 uv = dShadowCoord.xy * shadowParams.x;\n\tfloat shadowMapSizeInv = 1.0 / shadowParams.x;\n\tvec2 base_uv = floor(uv + 0.5);\n\tfloat s = (uv.x + 0.5 - base_uv.x);\n\tfloat t = (uv.y + 0.5 - base_uv.y);\n\tbase_uv -= vec2(0.5);\n\tbase_uv *= shadowMapSizeInv;\n\tfloat sum = 0.0;\n\tfloat uw0 = (3.0 - 2.0 * s);\n\tfloat uw1 = (1.0 + 2.0 * s);\n\tfloat u0 = (2.0 - s) / uw0 - 1.0;\n\tfloat u1 = s / uw1 + 1.0;\n\tfloat vw0 = (3.0 - 2.0 * t);\n\tfloat vw1 = (1.0 + 2.0 * t);\n\tfloat v0 = (2.0 - t) / vw0 - 1.0;\n\tfloat v1 = t / vw1 + 1.0;\n\tu0 = u0 * shadowMapSizeInv + base_uv.x;\n\tv0 = v0 * shadowMapSizeInv + base_uv.y;\n\tu1 = u1 * shadowMapSizeInv + base_uv.x;\n\tv1 = v1 * shadowMapSizeInv + base_uv.y;\n\tsum += uw0 * vw0 * texture(shadowMap, vec3(u0, v0, z));\n\tsum += uw1 * vw0 * texture(shadowMap, vec3(u1, v0, z));\n\tsum += uw0 * vw1 * texture(shadowMap, vec3(u0, v1, z));\n\tsum += uw1 * vw1 * texture(shadowMap, vec3(u1, v1, z));\n\tsum *= 1.0f / 16.0;\n\treturn sum;\n}\nfloat getShadowPCF3x3(sampler2DShadow shadowMap, vec3 shadowParams) {\n\treturn _getShadowPCF3x3(shadowMap, shadowParams);\n}\nfloat getShadowSpotPCF3x3(sampler2DShadow shadowMap, vec4 shadowParams) {\n\treturn _getShadowPCF3x3(shadowMap, shadowParams.xyz);\n}\n#else\nfloat _xgetShadowPCF3x3(mat3 depthKernel, sampler2D shadowMap, vec3 shadowParams) {\n\tmat3 shadowKernel;\n\tvec3 shadowCoord = dShadowCoord;\n\tvec3 shadowZ = vec3(shadowCoord.z);\n\tshadowKernel[0] = vec3(greaterThan(depthKernel[0], shadowZ));\n\tshadowKernel[1] = vec3(greaterThan(depthKernel[1], shadowZ));\n\tshadowKernel[2] = vec3(greaterThan(depthKernel[2], shadowZ));\n\tvec2 fractionalCoord = fract( shadowCoord.xy * shadowParams.x );\n\tshadowKernel[0] = mix(shadowKernel[0], shadowKernel[1], fractionalCoord.x);\n\tshadowKernel[1] = mix(shadowKernel[1], shadowKernel[2], fractionalCoord.x);\n\tvec4 shadowValues;\n\tshadowValues.x = mix(shadowKernel[0][0], shadowKernel[0][1], fractionalCoord.y);\n\tshadowValues.y = mix(shadowKernel[0][1], shadowKernel[0][2], fractionalCoord.y);\n\tshadowValues.z = mix(shadowKernel[1][0], shadowKernel[1][1], fractionalCoord.y);\n\tshadowValues.w = mix(shadowKernel[1][1], shadowKernel[1][2], fractionalCoord.y);\n\treturn dot( shadowValues, vec4( 1.0 ) ) * 0.25;\n}\nfloat _getShadowPCF3x3(sampler2D shadowMap, vec3 shadowParams) {\n\tvec3 shadowCoord = dShadowCoord;\n\tfloat xoffset = 1.0 / shadowParams.x;\n\tfloat dx0 = -xoffset;\n\tfloat dx1 = xoffset;\n\tmat3 depthKernel;\n\tdepthKernel[0][0] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx0, dx0)));\n\tdepthKernel[0][1] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx0, 0.0)));\n\tdepthKernel[0][2] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx0, dx1)));\n\tdepthKernel[1][0] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(0.0, dx0)));\n\tdepthKernel[1][1] = unpackFloat(texture2D(shadowMap, shadowCoord.xy));\n\tdepthKernel[1][2] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(0.0, dx1)));\n\tdepthKernel[2][0] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx1, dx0)));\n\tdepthKernel[2][1] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx1, 0.0)));\n\tdepthKernel[2][2] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx1, dx1)));\n\treturn _xgetShadowPCF3x3(depthKernel, shadowMap, shadowParams);\n}\nfloat getShadowPCF3x3(sampler2D shadowMap, vec3 shadowParams) {\n\treturn _getShadowPCF3x3(shadowMap, shadowParams);\n}\nfloat getShadowSpotPCF3x3(sampler2D shadowMap, vec4 shadowParams) {\n\treturn _getShadowPCF3x3(shadowMap, shadowParams.xyz);\n}\n#endif\nfloat _getShadowPoint(samplerCube shadowMap, vec4 shadowParams, vec3 dir) {\n\tvec3 tc = normalize(dir);\n\tvec3 tcAbs = abs(tc);\n\tvec4 dirX = vec4(1,0,0, tc.x);\n\tvec4 dirY = vec4(0,1,0, tc.y);\n\tfloat majorAxisLength = tc.z;\n\tif ((tcAbs.x > tcAbs.y) && (tcAbs.x > tcAbs.z)) {\n\t\tdirX = vec4(0,0,1, tc.z);\n\t\tdirY = vec4(0,1,0, tc.y);\n\t\tmajorAxisLength = tc.x;\n\t} else if ((tcAbs.y > tcAbs.x) && (tcAbs.y > tcAbs.z)) {\n\t\tdirX = vec4(1,0,0, tc.x);\n\t\tdirY = vec4(0,0,1, tc.z);\n\t\tmajorAxisLength = tc.y;\n\t}\n\tfloat shadowParamsInFaceSpace = ((1.0/shadowParams.x) * 2.0) * abs(majorAxisLength);\n\tvec3 xoffset = (dirX.xyz * shadowParamsInFaceSpace);\n\tvec3 yoffset = (dirY.xyz * shadowParamsInFaceSpace);\n\tvec3 dx0 = -xoffset;\n\tvec3 dy0 = -yoffset;\n\tvec3 dx1 = xoffset;\n\tvec3 dy1 = yoffset;\n\tmat3 shadowKernel;\n\tmat3 depthKernel;\n\tdepthKernel[0][0] = unpackFloat(textureCube(shadowMap, tc + dx0 + dy0));\n\tdepthKernel[0][1] = unpackFloat(textureCube(shadowMap, tc + dx0));\n\tdepthKernel[0][2] = unpackFloat(textureCube(shadowMap, tc + dx0 + dy1));\n\tdepthKernel[1][0] = unpackFloat(textureCube(shadowMap, tc + dy0));\n\tdepthKernel[1][1] = unpackFloat(textureCube(shadowMap, tc));\n\tdepthKernel[1][2] = unpackFloat(textureCube(shadowMap, tc + dy1));\n\tdepthKernel[2][0] = unpackFloat(textureCube(shadowMap, tc + dx1 + dy0));\n\tdepthKernel[2][1] = unpackFloat(textureCube(shadowMap, tc + dx1));\n\tdepthKernel[2][2] = unpackFloat(textureCube(shadowMap, tc + dx1 + dy1));\n\tvec3 shadowZ = vec3(length(dir) * shadowParams.w + shadowParams.z);\n\tshadowKernel[0] = vec3(lessThan2(depthKernel[0], shadowZ));\n\tshadowKernel[1] = vec3(lessThan2(depthKernel[1], shadowZ));\n\tshadowKernel[2] = vec3(lessThan2(depthKernel[2], shadowZ));\n\tvec2 uv = (vec2(dirX.w, dirY.w) / abs(majorAxisLength)) * 0.5;\n\tvec2 fractionalCoord = fract( uv * shadowParams.x );\n\tshadowKernel[0] = mix(shadowKernel[0], shadowKernel[1], fractionalCoord.x);\n\tshadowKernel[1] = mix(shadowKernel[1], shadowKernel[2], fractionalCoord.x);\n\tvec4 shadowValues;\n\tshadowValues.x = mix(shadowKernel[0][0], shadowKernel[0][1], fractionalCoord.y);\n\tshadowValues.y = mix(shadowKernel[0][1], shadowKernel[0][2], fractionalCoord.y);\n\tshadowValues.z = mix(shadowKernel[1][0], shadowKernel[1][1], fractionalCoord.y);\n\tshadowValues.w = mix(shadowKernel[1][1], shadowKernel[1][2], fractionalCoord.y);\n\treturn 1.0 - dot( shadowValues, vec4( 1.0 ) ) * 0.25;\n}\nfloat getShadowPointPCF3x3(samplerCube shadowMap, vec4 shadowParams) {\n\treturn _getShadowPoint(shadowMap, shadowParams, dLightDirW);\n}\n",shadowStandardGL2PS:"float _getShadowPCF5x5(sampler2DShadow shadowMap, vec3 shadowParams) {\n\tfloat z = dShadowCoord.z;\n\tvec2 uv = dShadowCoord.xy * shadowParams.x;\n\tfloat shadowMapSizeInv = 1.0 / shadowParams.x;\n\tvec2 base_uv = floor(uv + 0.5);\n\tfloat s = (uv.x + 0.5 - base_uv.x);\n\tfloat t = (uv.y + 0.5 - base_uv.y);\n\tbase_uv -= vec2(0.5);\n\tbase_uv *= shadowMapSizeInv;\n\tfloat uw0 = (4.0 - 3.0 * s);\n\tfloat uw1 = 7.0;\n\tfloat uw2 = (1.0 + 3.0 * s);\n\tfloat u0 = (3.0 - 2.0 * s) / uw0 - 2.0;\n\tfloat u1 = (3.0 + s) / uw1;\n\tfloat u2 = s / uw2 + 2.0;\n\tfloat vw0 = (4.0 - 3.0 * t);\n\tfloat vw1 = 7.0;\n\tfloat vw2 = (1.0 + 3.0 * t);\n\tfloat v0 = (3.0 - 2.0 * t) / vw0 - 2.0;\n\tfloat v1 = (3.0 + t) / vw1;\n\tfloat v2 = t / vw2 + 2.0;\n\tfloat sum = 0.0;\n\tu0 = u0 * shadowMapSizeInv + base_uv.x;\n\tv0 = v0 * shadowMapSizeInv + base_uv.y;\n\tu1 = u1 * shadowMapSizeInv + base_uv.x;\n\tv1 = v1 * shadowMapSizeInv + base_uv.y;\n\tu2 = u2 * shadowMapSizeInv + base_uv.x;\n\tv2 = v2 * shadowMapSizeInv + base_uv.y;\n\tsum += uw0 * vw0 * texture(shadowMap, vec3(u0, v0, z));\n\tsum += uw1 * vw0 * texture(shadowMap, vec3(u1, v0, z));\n\tsum += uw2 * vw0 * texture(shadowMap, vec3(u2, v0, z));\n\tsum += uw0 * vw1 * texture(shadowMap, vec3(u0, v1, z));\n\tsum += uw1 * vw1 * texture(shadowMap, vec3(u1, v1, z));\n\tsum += uw2 * vw1 * texture(shadowMap, vec3(u2, v1, z));\n\tsum += uw0 * vw2 * texture(shadowMap, vec3(u0, v2, z));\n\tsum += uw1 * vw2 * texture(shadowMap, vec3(u1, v2, z));\n\tsum += uw2 * vw2 * texture(shadowMap, vec3(u2, v2, z));\n\tsum *= 1.0f / 144.0;\n\tsum = gammaCorrectInput(sum);\n\tsum = saturate(sum);\n\treturn sum;\n}\nfloat getShadowPCF5x5(sampler2DShadow shadowMap, vec3 shadowParams) {\n\treturn _getShadowPCF5x5(shadowMap, shadowParams);\n}\nfloat getShadowSpotPCF5x5(sampler2DShadow shadowMap, vec4 shadowParams) {\n\treturn _getShadowPCF5x5(shadowMap, shadowParams.xyz);\n}\n",shadowVSM8PS:"float calculateVSM8(vec3 moments, float Z, float vsmBias) {\n\tfloat VSMBias = vsmBias;\n\tfloat depthScale = VSMBias * Z;\n\tfloat minVariance1 = depthScale * depthScale;\n\treturn chebyshevUpperBound(moments.xy, Z, minVariance1, 0.1);\n}\nfloat decodeFloatRG(vec2 rg) {\n\treturn rg.y*(1.0/255.0) + rg.x;\n}\nfloat VSM8(sampler2D tex, vec2 texCoords, float resolution, float Z, float vsmBias, float exponent) {\n\tvec4 c = texture2D(tex, texCoords);\n\tvec3 moments = vec3(decodeFloatRG(c.xy), decodeFloatRG(c.zw), 0.0);\n\treturn calculateVSM8(moments, Z, vsmBias);\n}\nfloat getShadowVSM8(sampler2D shadowMap, vec3 shadowParams, float exponent) {\n\treturn VSM8(shadowMap, dShadowCoord.xy, shadowParams.x, dShadowCoord.z, shadowParams.y, 0.0);\n}\nfloat getShadowSpotVSM8(sampler2D shadowMap, vec4 shadowParams, float exponent) {\n\treturn VSM8(shadowMap, dShadowCoord.xy, shadowParams.x, length(dLightDirW) * shadowParams.w + shadowParams.z, shadowParams.y, 0.0);\n}\n",shadowVSM_commonPS:"float linstep(float a, float b, float v) {\n\treturn saturate((v - a) / (b - a));\n}\nfloat reduceLightBleeding(float pMax, float amount) {\n\t return linstep(amount, 1.0, pMax);\n}\nfloat chebyshevUpperBound(vec2 moments, float mean, float minVariance, float lightBleedingReduction) {\n\tfloat variance = moments.y - (moments.x * moments.x);\n\tvariance = max(variance, minVariance);\n\tfloat d = mean - moments.x;\n\tfloat pMax = variance / (variance + (d * d));\n\tpMax = reduceLightBleeding(pMax, lightBleedingReduction);\n\treturn (mean <= moments.x ? 1.0 : pMax);\n}\nfloat calculateEVSM(vec3 moments, float Z, float vsmBias, float exponent) {\n\tZ = 2.0 * Z - 1.0;\n\tfloat warpedDepth = exp(exponent * Z);\n\tmoments.xy += vec2(warpedDepth, warpedDepth*warpedDepth) * (1.0 - moments.z);\n\tfloat VSMBias = vsmBias;\n\tfloat depthScale = VSMBias * exponent * warpedDepth;\n\tfloat minVariance1 = depthScale * depthScale;\n\treturn chebyshevUpperBound(moments.xy, warpedDepth, minVariance1, 0.1);\n}\n",skinBatchConstVS:"attribute float vertex_boneIndices;\nuniform vec4 matrix_pose[BONE_LIMIT * 3];\nmat4 getBoneMatrix(const in float i) {\n\tvec4 v1 = matrix_pose[int(3.0 * i)];\n\tvec4 v2 = matrix_pose[int(3.0 * i + 1.0)];\n\tvec4 v3 = matrix_pose[int(3.0 * i + 2.0)];\n\treturn mat4(\n\t\tv1.x, v2.x, v3.x, 0,\n\t\tv1.y, v2.y, v3.y, 0,\n\t\tv1.z, v2.z, v3.z, 0,\n\t\tv1.w, v2.w, v3.w, 1\n\t);\n}\n",skinBatchTexVS:"attribute float vertex_boneIndices;\nuniform highp sampler2D texture_poseMap;\nuniform vec4 texture_poseMapSize;\nmat4 getBoneMatrix(const in float i) {\n\tfloat j = i * 3.0;\n\tfloat dx = texture_poseMapSize.z;\n\tfloat dy = texture_poseMapSize.w;\n\tfloat y = floor(j * dx);\n\tfloat x = j - (y * texture_poseMapSize.x);\n\ty = dy * (y + 0.5);\n\tvec4 v1 = texture2D(texture_poseMap, vec2(dx * (x + 0.5), y));\n\tvec4 v2 = texture2D(texture_poseMap, vec2(dx * (x + 1.5), y));\n\tvec4 v3 = texture2D(texture_poseMap, vec2(dx * (x + 2.5), y));\n\treturn mat4(\n\t\tv1.x, v2.x, v3.x, 0,\n\t\tv1.y, v2.y, v3.y, 0,\n\t\tv1.z, v2.z, v3.z, 0,\n\t\tv1.w, v2.w, v3.w, 1\n\t);\n}\n",skinConstVS:"attribute vec4 vertex_boneWeights;\nattribute vec4 vertex_boneIndices;\nuniform vec4 matrix_pose[BONE_LIMIT * 3];\nvoid getBoneMatrix(const in float i, out vec4 v1, out vec4 v2, out vec4 v3) {\n\tv1 = matrix_pose[int(3.0 * i)];\n\tv2 = matrix_pose[int(3.0 * i + 1.0)];\n\tv3 = matrix_pose[int(3.0 * i + 2.0)];\n}\nmat4 getSkinMatrix(const in vec4 indices, const in vec4 weights) {\n\tvec4 a1, a2, a3;\n\tgetBoneMatrix(indices.x, a1, a2, a3);\n\tvec4 b1, b2, b3;\n\tgetBoneMatrix(indices.y, b1, b2, b3);\n\tvec4 c1, c2, c3;\n\tgetBoneMatrix(indices.z, c1, c2, c3);\n\tvec4 d1, d2, d3;\n\tgetBoneMatrix(indices.w, d1, d2, d3);\n\tvec4 v1 = a1 * weights.x + b1 * weights.y + c1 * weights.z + d1 * weights.w;\n\tvec4 v2 = a2 * weights.x + b2 * weights.y + c2 * weights.z + d2 * weights.w;\n\tvec4 v3 = a3 * weights.x + b3 * weights.y + c3 * weights.z + d3 * weights.w;\n\tfloat one = dot(weights, vec4(1.0));\n\treturn mat4(\n\t\tv1.x, v2.x, v3.x, 0,\n\t\tv1.y, v2.y, v3.y, 0,\n\t\tv1.z, v2.z, v3.z, 0,\n\t\tv1.w, v2.w, v3.w, one\n\t);\n}\n",skinTexVS:"attribute vec4 vertex_boneWeights;\nattribute vec4 vertex_boneIndices;\nuniform highp sampler2D texture_poseMap;\nuniform vec4 texture_poseMapSize;\nvoid getBoneMatrix(const in float i, out vec4 v1, out vec4 v2, out vec4 v3) {\n\tfloat j = i * 3.0;\n\tfloat dx = texture_poseMapSize.z;\n\tfloat dy = texture_poseMapSize.w;\n\tfloat y = floor(j * dx);\n\tfloat x = j - (y * texture_poseMapSize.x);\n\ty = dy * (y + 0.5);\n\tv1 = texture2D(texture_poseMap, vec2(dx * (x + 0.5), y));\n\tv2 = texture2D(texture_poseMap, vec2(dx * (x + 1.5), y));\n\tv3 = texture2D(texture_poseMap, vec2(dx * (x + 2.5), y));\n}\nmat4 getSkinMatrix(const in vec4 indices, const in vec4 weights) {\n\tvec4 a1, a2, a3;\n\tgetBoneMatrix(indices.x, a1, a2, a3);\n\tvec4 b1, b2, b3;\n\tgetBoneMatrix(indices.y, b1, b2, b3);\n\tvec4 c1, c2, c3;\n\tgetBoneMatrix(indices.z, c1, c2, c3);\n\tvec4 d1, d2, d3;\n\tgetBoneMatrix(indices.w, d1, d2, d3);\n\tvec4 v1 = a1 * weights.x + b1 * weights.y + c1 * weights.z + d1 * weights.w;\n\tvec4 v2 = a2 * weights.x + b2 * weights.y + c2 * weights.z + d2 * weights.w;\n\tvec4 v3 = a3 * weights.x + b3 * weights.y + c3 * weights.z + d3 * weights.w;\n\tfloat one = dot(weights, vec4(1.0));\n\treturn mat4(\n\t\tv1.x, v2.x, v3.x, 0,\n\t\tv1.y, v2.y, v3.y, 0,\n\t\tv1.z, v2.z, v3.z, 0,\n\t\tv1.w, v2.w, v3.w, one\n\t);\n}\n",skyboxEnvPS:"varying vec3 vViewDir;\nuniform sampler2D texture_envAtlas;\nuniform float mipLevel;\nvoid main(void) {\n\tvec3 dir = vViewDir * vec3(-1.0, 1.0, 1.0);\n\tvec2 uv = toSphericalUv(normalize(dir));\n\tvec3 linear = $DECODE(texture2D(texture_envAtlas, mapRoughnessUv(uv, mipLevel)));\n\tgl_FragColor = vec4(gammaCorrectOutput(toneMap(processEnvironment(linear))), 1.0);\n}\n",skyboxHDRPS:"varying vec3 vViewDir;\nuniform samplerCube texture_cubeMap;\nvoid main(void) {\n\tvec3 dir=vViewDir;\n\tdir.x *= -1.0;\n\tvec3 color = processEnvironment($textureCubeSAMPLE(texture_cubeMap, fixSeamsStatic(dir, $FIXCONST)).rgb);\n\tcolor = toneMap(color);\n\tcolor = gammaCorrectOutput(color);\n\tgl_FragColor = vec4(color, 1.0);\n}\n",skyboxVS:"attribute vec3 aPosition;\n#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\nuniform mat4 matrix_projectionSkybox;\nuniform mat3 cubeMapRotationMatrix;\nvarying vec3 vViewDir;\nvoid main(void) {\n\tmat4 view = matrix_view;\n\tview[3][0] = view[3][1] = view[3][2] = 0.0;\n\tgl_Position = matrix_projectionSkybox * view * vec4(aPosition, 1.0);\n\tgl_Position.z = gl_Position.w - 0.00001;\n\tvViewDir = aPosition * cubeMapRotationMatrix;\n}\n",specularPS:"#ifdef MAPCOLOR\nuniform vec3 material_specular;\n#endif\n#ifdef MAPTEXTURE\nuniform sampler2D texture_specularMap;\n#endif\nvoid getSpecularity() {\n\tdSpecularity = vec3(1.0);\n\t#ifdef MAPCOLOR\n\tdSpecularity *= material_specular;\n\t#endif\n\t#ifdef MAPTEXTURE\n\tdSpecularity *= texture2D(texture_specularMap, $UV).$CH;\n\t#endif\n\t#ifdef MAPVERTEX\n\tdSpecularity *= saturate(vVertexColor.$VC);\n\t#endif\n}\n",specularAaNonePS:"float antiAliasGlossiness(float power) {\n\treturn power;\n}\n",specularAaToksvigPS:"float antiAliasGlossiness(float power) {\n\tfloat rlen = 1.0 / saturate(length(dNormalMap));\n\tfloat toksvig = 1.0 / (1.0 + power * (rlen - 1.0));\n\treturn power * mix(1.0, toksvig, material_bumpiness);\n}\n",specularAaToksvigFastPS:"float antiAliasGlossiness(float power) {\n\tfloat rlen = 1.0 / saturate(length(dNormalMap));\n\tfloat toksvig = 1.0 / (1.0 + power * (rlen - 1.0));\n\treturn power * toksvig;\n}\n",spotPS:"float getSpotEffect(vec3 lightSpotDirW, float lightInnerConeAngle, float lightOuterConeAngle) {\n\tfloat cosAngle = dot(dLightDirNormW, lightSpotDirW);\n\treturn smoothstep(lightOuterConeAngle, lightInnerConeAngle, cosAngle);\n}\n",startPS:"void main(void) {\n\tdDiffuseLight = vec3(0);\n\tdSpecularLight = vec3(0);\n\tdReflection = vec4(0);\n\tdSpecularity = vec3(0);\n\t#ifdef CLEARCOAT\n\tccSpecularLight = vec3(0);\n\tccReflection = vec4(0);\n\t#endif\n",startVS:"void main(void) {\n\tgl_Position = getPosition();\n",startNineSlicedPS:"\tnineSlicedUv = vUv0;\n\tnineSlicedUv.y = 1.0 - nineSlicedUv.y;\n",startNineSlicedTiledPS:"\tvec2 tileMask = step(vMask, vec2(0.99999));\n\tvec2 tileSize = 0.5 * (innerOffset.xy + innerOffset.zw);\n\tvec2 tileScale = vec2(1.0) / (vec2(1.0) - tileSize);\n\tvec2 clampedUv = mix(innerOffset.xy * 0.5, vec2(1.0) - innerOffset.zw * 0.5, fract((vTiledUv - tileSize) * tileScale));\n\tclampedUv = clampedUv * atlasRect.zw + atlasRect.xy;\n\tnineSlicedUv = vUv0 * tileMask + clampedUv * (vec2(1.0) - tileMask);\n\tnineSlicedUv.y = 1.0 - nineSlicedUv.y;\n",storeEVSMPS:"float exponent = VSM_EXPONENT;\ndepth = 2.0 * depth - 1.0;\ndepth =\texp(exponent * depth);\ngl_FragColor = vec4(depth, depth*depth, 1.0, 1.0);\n",tangentBinormalVS:"vec3 getTangent() {\n\treturn normalize(dNormalMatrix * vertex_tangent.xyz);\n}\nvec3 getBinormal() {\n\treturn cross(vNormalW, vTangentW) * vertex_tangent.w;\n}\nvec3 getObjectSpaceUp() {\n\treturn normalize(dNormalMatrix * vec3(0, 1, 0));\n}\n",TBNPS:"void getTBN() {\n\tdTBN = mat3(normalize(dTangentW), normalize(dBinormalW), normalize(dVertexNormalW));\n}\n",TBNderivativePS:"uniform float tbnBasis;\nvoid getTBN() {\n\tvec2 uv = $UV;\n\tvec3 dp1 = dFdx( vPositionW );\n\tvec3 dp2 = dFdy( vPositionW );\n\tvec2 duv1 = dFdx( uv );\n\tvec2 duv2 = dFdy( uv );\n\tvec3 dp2perp = cross( dp2, dVertexNormalW );\n\tvec3 dp1perp = cross( dVertexNormalW, dp1 );\n\tvec3 T = dp2perp * duv1.x + dp1perp * duv2.x;\n\tvec3 B = dp2perp * duv1.y + dp1perp * duv2.y;\n\tfloat denom = max( dot(T,T), dot(B,B) );\n\tfloat invmax = (denom == 0.0) ? 0.0 : tbnBasis / sqrt( denom );\n\tdTBN = mat3(T * invmax, -B * invmax, dVertexNormalW );\n}\n",TBNfastPS:"void getTBN() {\n\tdTBN = mat3(dTangentW, dBinormalW, dVertexNormalW);\n}\n",TBNObjectSpacePS:"void getTBN() {\n\tvec3 B = cross(dVertexNormalW, vObjectSpaceUpW);\n\tvec3 T = cross(dVertexNormalW, B);\n\tif (dot(B,B)==0.0)\n\t{\n\t\tfloat major=max(max(dVertexNormalW.x, dVertexNormalW.y),dVertexNormalW.z);\n\t\tif (dVertexNormalW.x==major)\n\t\t{\n\t\t\tB=cross(dVertexNormalW, vec3(0,1,0));\n\t\t\tT=cross(dVertexNormalW, B);\n\t\t}\n\t\telse if (dVertexNormalW.y==major)\n\t\t{\n\t\t\tB=cross(dVertexNormalW, vec3(0,0,1));\n\t\t\tT=cross(dVertexNormalW, B);\n\t\t}\n\t\telse if (dVertexNormalW.z==major)\n\t\t{\n\t\t\tB=cross(dVertexNormalW, vec3(1,0,0));\n\t\t\tT=cross(dVertexNormalW, B);\n\t\t}\n\t}\n\tdTBN = mat3(normalize(T), normalize(B), normalize(dVertexNormalW));\n}\n",tonemappingAcesPS:"uniform float exposure;\nvec3 toneMap(vec3 color) {\n\tfloat tA = 2.51;\n\tfloat tB = 0.03;\n\tfloat tC = 2.43;\n\tfloat tD = 0.59;\n\tfloat tE = 0.14;\n\tvec3 x = color * exposure;\n\treturn (x*(tA*x+tB))/(x*(tC*x+tD)+tE);\n}\n",tonemappingAces2PS:"uniform float exposure;\nconst mat3 ACESInputMat = mat3(\n\t0.59719, 0.35458, 0.04823,\n\t0.07600, 0.90834, 0.01566,\n\t0.02840, 0.13383, 0.83777\n);\nconst mat3 ACESOutputMat = mat3(\n\t 1.60475, -0.53108, -0.07367,\n\t-0.10208,\t1.10813, -0.00605,\n\t-0.00327, -0.07276,\t1.07602\n);\nvec3 RRTAndODTFit(vec3 v) {\n\tvec3 a = v * (v + 0.0245786) - 0.000090537;\n\tvec3 b = v * (0.983729 * v + 0.4329510) + 0.238081;\n\treturn a / b;\n}\nvec3 toneMap(vec3 color) {\n\tcolor *= exposure;\n\tcolor = color * ACESInputMat;\n\tcolor = RRTAndODTFit(color);\n\tcolor = color * ACESOutputMat;\n\tcolor = clamp(color, 0.0, 1.0);\n\treturn color;\n}\n",tonemappingFilmicPS:"const float A =\t0.15;\nconst float B =\t0.50;\nconst float C =\t0.10;\nconst float D =\t0.20;\nconst float E =\t0.02;\nconst float F =\t0.30;\nconst float W =\t11.2;\nuniform float exposure;\nvec3 uncharted2Tonemap(vec3 x) {\n\t return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;\n}\nvec3 toneMap(vec3 color) {\n\tcolor = uncharted2Tonemap(color * exposure);\n\tvec3 whiteScale = 1.0 / uncharted2Tonemap(vec3(W,W,W));\n\tcolor = color * whiteScale;\n\treturn color;\n}\n",tonemappingHejlPS:"uniform float exposure;\nvec3 toneMap(vec3 color) {\n\tcolor *= exposure;\n\tconst float\tA = 0.22, B = 0.3, C = .1, D = 0.2, E = .01, F = 0.3;\n\tconst float Scl = 1.25;\n\tvec3 h = max( vec3(0.0), color - vec3(0.004) );\n\treturn (h*((Scl*A)*h+Scl*vec3(C*B,C*B,C*B))+Scl*vec3(D*E,D*E,D*E)) / (h*(A*h+vec3(B,B,B))+vec3(D*F,D*F,D*F)) - Scl*vec3(E/F,E/F,E/F);\n}\n",tonemappingLinearPS:"uniform float exposure;\nvec3 toneMap(vec3 color) {\n\treturn color * exposure;\n}\n",tonemappingNonePS:"vec3 toneMap(vec3 color) {\n\treturn color;\n}\n",transformVS:"#ifdef PIXELSNAP\nuniform vec4 uScreenSize;\n#endif\n#ifdef MORPHING\nuniform vec4 morph_weights_a;\nuniform vec4 morph_weights_b;\n#endif\n#ifdef MORPHING_TEXTURE_BASED\nuniform vec4 morph_tex_params;\nvec2 getTextureMorphCoords() {\n\tfloat vertexId = morph_vertex_id;\n\tvec2 textureSize = morph_tex_params.xy;\n\tvec2 invTextureSize = morph_tex_params.zw;\n\tfloat morphGridV = floor(vertexId * invTextureSize.x);\n\tfloat morphGridU = vertexId - (morphGridV * textureSize.x);\n\treturn (vec2(morphGridU, morphGridV) * invTextureSize) + (0.5 * invTextureSize);\n}\n#endif\n#ifdef MORPHING_TEXTURE_BASED_POSITION\nuniform highp sampler2D morphPositionTex;\n#endif\nmat4 getModelMatrix() {\n\t#ifdef DYNAMICBATCH\n\treturn getBoneMatrix(vertex_boneIndices);\n\t#elif defined(SKIN)\n\treturn matrix_model * getSkinMatrix(vertex_boneIndices, vertex_boneWeights);\n\t#elif defined(INSTANCING)\n\treturn mat4(instance_line1, instance_line2, instance_line3, instance_line4);\n\t#else\n\treturn matrix_model;\n\t#endif\n}\nvec4 getPosition() {\n\tdModelMatrix = getModelMatrix();\n\tvec3 localPos = vertex_position;\n\t#ifdef NINESLICED\n\tlocalPos.xz *= outerScale;\n\tvec2 positiveUnitOffset = clamp(vertex_position.xz, vec2(0.0), vec2(1.0));\n\tvec2 negativeUnitOffset = clamp(-vertex_position.xz, vec2(0.0), vec2(1.0));\n\tlocalPos.xz += (-positiveUnitOffset * innerOffset.xy + negativeUnitOffset * innerOffset.zw) * vertex_texCoord0.xy;\n\tvTiledUv = (localPos.xz - outerScale + innerOffset.xy) * -0.5 + 1.0;\n\tlocalPos.xz *= -0.5;\n\tlocalPos = localPos.xzy;\n\t#endif\n\t#ifdef MORPHING\n\t#ifdef MORPHING_POS03\n\tlocalPos.xyz += morph_weights_a[0] * morph_pos0;\n\tlocalPos.xyz += morph_weights_a[1] * morph_pos1;\n\tlocalPos.xyz += morph_weights_a[2] * morph_pos2;\n\tlocalPos.xyz += morph_weights_a[3] * morph_pos3;\n\t#endif\n\t#ifdef MORPHING_POS47\n\tlocalPos.xyz += morph_weights_b[0] * morph_pos4;\n\tlocalPos.xyz += morph_weights_b[1] * morph_pos5;\n\tlocalPos.xyz += morph_weights_b[2] * morph_pos6;\n\tlocalPos.xyz += morph_weights_b[3] * morph_pos7;\n\t#endif\n\t#endif\n\t#ifdef MORPHING_TEXTURE_BASED_POSITION\n\tvec2 morphUV = getTextureMorphCoords();\n\tvec3 morphPos = texture2D(morphPositionTex, morphUV).xyz;\n\tlocalPos += morphPos;\n\t#endif\n\tvec4 posW = dModelMatrix * vec4(localPos, 1.0);\n\t#ifdef SCREENSPACE\n\tposW.zw = vec2(0.0, 1.0);\n\t#endif\n\tdPositionW = posW.xyz;\n\tvec4 screenPos;\n\t#ifdef UV1LAYOUT\n\tscreenPos = vec4(vertex_texCoord1.xy * 2.0 - 1.0, 0.5, 1);\n\t#else\n\t#ifdef SCREENSPACE\n\tscreenPos = posW;\n\t#else\n\tscreenPos = matrix_viewProjection * posW;\n\t#endif\n\t#ifdef PIXELSNAP\n\tscreenPos.xy = (screenPos.xy * 0.5) + 0.5;\n\tscreenPos.xy *= uScreenSize.xy;\n\tscreenPos.xy = floor(screenPos.xy);\n\tscreenPos.xy *= uScreenSize.zw;\n\tscreenPos.xy = (screenPos.xy * 2.0) - 1.0;\n\t#endif\n\t#endif\n\treturn screenPos;\n}\nvec3 getWorldPosition() {\n\treturn dPositionW;\n}\n",transformDeclVS:"attribute vec3 vertex_position;\nuniform mat4 matrix_model;\nuniform mat4 matrix_viewProjection;\nvec3 dPositionW;\nmat4 dModelMatrix;\n",uv0VS:"#ifdef NINESLICED\nvec2 getUv0() {\n\tvec2 uv = vertex_position.xz;\n\tvec2 positiveUnitOffset = clamp(vertex_position.xz, vec2(0.0), vec2(1.0));\n\tvec2 negativeUnitOffset = clamp(-vertex_position.xz, vec2(0.0), vec2(1.0));\n\tuv += (-positiveUnitOffset * innerOffset.xy + negativeUnitOffset * innerOffset.zw) * vertex_texCoord0.xy;\n\tuv = uv * -0.5 + 0.5;\n\tuv = uv * atlasRect.zw + atlasRect.xy;\n\tvMask = vertex_texCoord0.xy;\n\treturn uv;\n}\n#else\nvec2 getUv0() {\n\treturn vertex_texCoord0;\n}\n#endif\n",uv1VS:"vec2 getUv1() {\n\treturn vertex_texCoord1;\n}\n",viewDirPS:"void getViewDir() {\n\tdViewDirW = normalize(view_position - vPositionW);\n}\n",viewNormalVS:"#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\nvec3 getViewNormal() {\n\treturn mat3(matrix_view) * vNormalW;\n}\n"};function oi(t,e){return e||(e=ri),1===t||2===t?e.gamma2_2PS?e.gamma2_2PS:ri.gamma2_2PS:3===t?"#define HDR\n"+(e.gamma2_2PS?e.gamma2_2PS:ri.gamma2_2PS):e.gamma1_0PS?e.gamma1_0PS:ri.gamma1_0PS}function hi(t,e){return e||(e=ri),1===t?e.tonemappingFilmicPS?e.tonemappingFilmicPS:ri.tonemappingFilmicPS:0===t?e.tonemappingLinearPS?e.tonemappingLinearPS:ri.tonemappingLinearPS:2===t?e.tonemappingHejlPS?e.tonemappingHejlPS:ri.tonemappingHejlPS:3===t?e.tonemappingAcesPS?e.tonemappingAcesPS:ri.tonemappingAcesPS:4===t?e.tonemappingAces2PS?e.tonemappingAces2PS:ri.tonemappingAces2PS:e.tonemapingNonePS?e.tonemapingNonePS:ri.tonemappingNonePS}function li(t,e){return e||(e=ri),"linear"===t?e.fogLinearPS?e.fogLinearPS:ri.fogLinearPS:"exp"===t?e.fogExpPS?e.fogExpPS:ri.fogExpPS:"exp2"===t?e.fogExp2PS?e.fogExp2PS:ri.fogExp2PS:e.fogNonePS?e.fogNonePS:ri.fogNonePS}function ci(t,e){return e||(e=ri),t.supportsBoneTextures?e.skinTexVS:"#define BONE_LIMIT "+t.getBoneLimit()+"\n"+e.skinConstVS}function ui(t){var e="precision "+t.precision+" float;\n";return t.webgl2&&(e+="#ifdef GL2\nprecision "+t.precision+" sampler2DShadow;\n#endif\n"),e}function di(t){return t.webgl2?"#version 300 es\n":""}function fi(){return"void main(void) {gl_FragColor = vec4(0.0);}"}function pi(){return"void main(void)\n{\n"}function mi(){return"}\n"}var _i={vertex_position:ae,vertex_normal:re,vertex_tangent:oe,vertex_texCoord0:de,vertex_texCoord1:fe,vertex_texCoord2:pe,vertex_texCoord3:me,vertex_texCoord4:_e,vertex_texCoord5:ge,vertex_texCoord6:ve,vertex_texCoord7:ye,vertex_color:ce,vertex_boneIndices:le,vertex_boneWeights:he};function gi(t){for(var e={},i=0,n=t.indexOf("attribute");n>=0&&!(n>0&&"/"===t[n-1]);){var s=t.indexOf(";",n),a=t.lastIndexOf(" ",s),r=t.substr(a+1,s-(a+1)),o=_i[r];void 0!==o?e[r]=o:(e[r]="ATTR"+i,i++),n=t.indexOf("attribute",n+1)}return e}function vi(t,e,i,n,s,a){void 0===s&&(s=!1),void 0===a&&(a="");var r=t.programLib._cache,o=r[n];if(void 0!==o)return o;i=ui(t)+"\n"+(i||"void main(void) {gl_FragColor = vec4(0.0);}");var h=gi(e);return t.webgl2&&(e=di(t)+ri.gles3VS+e,i=di(t)+ri.gles3PS+i),r[n]=new ai(t,{attributes:h,vshader:e,fshader:a+i,useTransformFeedback:s}),r[n]}ri.collectAttribs=gi,ri.createShader=function(t,e,i,n){void 0===n&&(n=!1);var s=ri[e],a=ui(t)+"\n"+ri[i],r=gi(s);return t.webgl2&&(s=di(t)+ri.gles3VS+s,a=di(t)+ri.gles3PS+a),new ai(t,{attributes:r,vshader:s,fshader:a,useTransformFeedback:n})},ri.createShaderFromCode=vi;var yi=function(){function t(){this.globalId=0,this.revision=0}var e=t.prototype;return e.equals=function(t){return this.globalId===t.globalId&&this.revision===t.revision},e.copy=function(t){this.globalId=t.globalId,this.revision=t.revision},e.reset=function(){this.globalId=0,this.revision=0},t}(),xi=0,bi=function(){function t(){xi++,this.version=new yi,this.version.globalId=xi}return t.prototype.increment=function(){this.version.revision++},t}(),Si=function(){function t(t){this.name=t,this.value=null,this.versionObject=new bi}var e=t.prototype;return e.setValue=function(t){this.value=t,this.versionObject.increment()},e.getValue=function(){return this.value},t}(),wi=function(){function t(t){this.name=t,this.variables=new Map}var e=t.prototype;return e.resolve=function(t){return this.variables.has(t)||this.variables.set(t,new Si(t)),this.variables.get(t)},e.removeValue=function(t){for(var e in this.variables){var i=this.variables[e];i.value===t&&(i.value=null)}},t}(),Ti={generateKey:function(t){var e="basic";return t.fog&&(e+="_fog"),t.alphaTest&&(e+="_atst"),t.vertexColors&&(e+="_vcol"),t.diffuseMap&&(e+="_diff"),t.skin&&(e+="_skin"),t.screenSpace&&(e+="_ss"),t.useInstancing&&(e+="_inst"),t.useMorphPosition&&(e+="_morphp"),t.useMorphNormal&&(e+="_morphn"),t.useMorphTextureBased&&(e+="_morpht"),e+="_"+t.pass},createShaderDefinition:function(t,e){var i={vertex_position:ae};e.skin&&(i.vertex_boneWeights=he,i.vertex_boneIndices=le),e.vertexColors&&(i.vertex_color=ce),e.diffuseMap&&(i.vertex_texCoord0=de);var n="";n+=ri.transformDeclVS,e.skin?(n+=ci(t),n+=ri.transformSkinnedVS):n+=ri.transformVS,e.vertexColors&&(n+="attribute vec4 vertex_color;\n",n+="varying vec4 vColor;\n"),e.diffuseMap&&(n+="attribute vec2 vertex_texCoord0;\n",n+="varying vec2 vUv0;\n"),2===e.pass&&(n+="varying float vDepth;\n",n+="#ifndef VIEWMATRIX\n",n+="#define VIEWMATRIX\n",n+="uniform mat4 matrix_view;\n",n+="#endif\n",n+="#ifndef CAMERAPLANES\n",n+="#define CAMERAPLANES\n",n+="uniform vec4 camera_params;\n\n",n+="#endif\n"),n+="void main(void)\n{\n",n+="\t gl_Position = getPosition();\n",2===e.pass&&(n+="\t\tvDepth = -(matrix_view * vec4(getWorldPosition(),1.0)).z * camera_params.x;\n"),e.vertexColors&&(n+="\t\tvColor = vertex_color;\n"),e.diffuseMap&&(n+="\t\tvUv0 = vertex_texCoord0;\n");var s=n+="}\n";return n=ui(t),e.vertexColors?n+="varying vec4 vColor;\n":n+="uniform vec4 uColor;\n",e.diffuseMap&&(n+="varying vec2 vUv0;\n",n+="uniform sampler2D texture_diffuseMap;\n"),e.fog&&(n+=li(e.fog)),e.alphatest&&(n+=ri.alphaTestPS),2===e.pass&&(n+="varying float vDepth;\n",n+=ri.packDepthPS),n+="void main(void)\n{\n",e.vertexColors?n+="\t\tgl_FragColor = vColor;\n":n+="\t\tgl_FragColor = uColor;\n",e.diffuseMap&&(n+="\t\tgl_FragColor *= texture2D(texture_diffuseMap, vUv0);\n"),e.alphatest&&(n+="\t alphaTest(gl_FragColor.a);\n"),e.pass!==Nt&&(2===e.pass?n+="\t\tgl_FragColor = packFloat(vDepth);\n":e.fog&&(n+="\t glFragColor.rgb = addFog(gl_FragColor.rgb);\n")),{attributes:i,vshader:s,fshader:n+="}\n"}}},Ai={generateKey:function(t){var e="particle";for(var i in t)t.hasOwnProperty(i)&&(e+=t[i]);return e},_animTex:function(t){var e="";return e+=t.animTexLoop?ri.particleAnimFrameLoopVS:ri.particleAnimFrameClampVS,e+=ri.particleAnimTexVS},createShaderDefinition:function(t,e){var i="",n=ui(t)+"\n";n+="#define PARTICLE\n",t.webgl2&&(i+="#define GL2\n",n+="#define GL2\n"),i+="#define VERTEXSHADER\n",e.mesh&&(i+="#define USE_MESH\n"),e.localSpace&&(i+="#define LOCAL_SPACE\n"),e.screenSpace&&(i+="#define SCREEN_SPACE\n"),e.animTex&&(i+="\nuniform vec2 animTexTilesParams;\n"),e.animTex&&(i+="\nuniform vec4 animTexParams;\n"),e.animTex&&(i+="\nuniform vec2 animTexIndexParams;\n"),2===e.normal&&(i+="\nvarying mat3 ParticleMat;\n"),1===e.normal&&(i+="\nvarying vec3 Normal;\n"),e.soft&&(i+="\nvarying float vDepth;\n");var s=e.customFace?ri.particle_customFaceVS:ri.particle_billboardVS;return e.useCpu?(e.soft>0&&(i+=ri.screenDepthPS),i+=ri.particle_cpuVS,e.localSpace&&(i+=ri.particle_localShiftVS),e.animTex&&(i+=this._animTex(e)),e.alignToMotion&&(i+=ri.particle_pointAlongVS),i+=e.mesh?ri.particle_meshVS:s,1===e.normal&&(i+=ri.particle_normalVS),2===e.normal&&(i+=ri.particle_TBNVS),e.stretch>0&&(i+=ri.particle_stretchVS),i+=ri.particle_cpu_endVS,e.soft>0&&(i+=ri.particle_softVS)):(i+=ri.particle_initVS,i+=e.pack8?ri.particleInputRgba8PS:ri.particleInputFloatPS,e.soft>0&&(i+=ri.screenDepthPS),i+=ri.particleVS,e.localSpace&&(i+=ri.particle_localShiftVS),e.animTex&&(i+=this._animTex(e)),e.wrap&&(i+=ri.particle_wrapVS),e.alignToMotion&&(i+=ri.particle_pointAlongVS),i+=e.mesh?ri.particle_meshVS:s,1===e.normal&&(i+=ri.particle_normalVS),2===e.normal&&(i+=ri.particle_TBNVS),e.stretch>0&&(i+=ri.particle_stretchVS),i+=ri.particle_endVS,e.soft>0&&(i+=ri.particle_softVS)),i+="}\n",e.normal>0&&(1===e.normal?n+="\nvarying vec3 Normal;\n":2===e.normal&&(n+="\nvarying mat3 ParticleMat;\n"),n+="\nuniform vec3 lightCube[6];\n"),e.soft&&(n+="\nvarying float vDepth;\n"),0===e.normal&&"none"===e.fog&&(e.srgb=!1),n+=oi(e.gamma),n+=hi(e.toneMap),"linear"===e.fog?n+=ri.fogLinearPS:"exp"===e.fog?n+=ri.fogExpPS:"exp2"===e.fog?n+=ri.fogExp2PS:n+=ri.fogNonePS,2===e.normal&&(n+="\nuniform sampler2D normalMap;\n"),e.soft>0&&(n+=ri.screenDepthPS),n+=ri.particlePS,e.soft>0&&(n+=ri.particle_softPS),1===e.normal&&(n+="\nvec3 normal = Normal;\n"),2===e.normal&&(n+=ri.particle_normalMapPS),e.normal>0&&(n+=e.halflambert?ri.particle_halflambertPS:ri.particle_lambertPS),e.normal>0&&(n+=ri.particle_lightingPS),2===e.blend?n+=ri.particle_blendNormalPS:1===e.blend?n+=ri.particle_blendAddPS:5===e.blend&&(n+=ri.particle_blendMultiplyPS),n+=ri.particle_endPS,{attributes:gi(i),vshader:i,fshader:n}}},Mi={generateKey:function(t){return"cubemap"===t.type?"skybox-"+t.type+"-"+t.rgbm+"-"+t.hdr+"-"+t.fixSeams+"-"+t.toneMapping+"-"+t.gamma+"-"+t.useIntensity+"-"+t.mip:"skybox-"+t.type+"-"+t.encoding+"-"+t.useIntensity+"-"+t.gamma+"-"+t.toneMapping},createShaderDefinition:function(t,e){var i;if("cubemap"===e.type){i=ui(t),i+=e.mip?ri.fixCubemapSeamsStretchPS:ri.fixCubemapSeamsNonePS,i+=e.useIntensity?ri.envMultiplyPS:ri.envConstPS,i+=oi(e.gamma),i+=hi(e.toneMapping),i+=ri.decodePS,i+=ri.rgbmPS,i+=ri.skyboxHDRPS.replace(/\$textureCubeSAMPLE/g,e.rgbm?"textureCubeRGBM":e.hdr?"textureCube":"textureCubeSRGB").replace(/\$FIXCONST/g,1-1/[128,64,16,8,4,2][e.mip]+"")}else{i=ui(t),i+=e.useIntensity?ri.envMultiplyPS:ri.envConstPS,i+=oi(e.gamma),i+=hi(e.toneMapping),i+=ri.decodePS,i+=ri.skyboxEnvPS.replace(/\$DECODE/g,{rgbm:"decodeRGBM",rgbe:"decodeRGBE",linear:"decodeLinear"}[e.encoding]||"decodeGamma")}return{attributes:{aPosition:ae},vshader:ri.skyboxVS,fshader:i}}},Ci=1/255,Ei=new Float32Array(1),Pi=new Int32Array(Ei.buffer),Ri=function(){function t(){}return t.float2Half=function(t){Ei[0]=t;var e=Pi[0],i=e>>16&32768,n=e>>12&2047,s=e>>23&255;return s<103?i:s>142?(i|=31744,i|=(255===s?0:1)&&8388607&e):s<113?i|=((n|=2048)>>114-s)+(n>>113-s&1):(i|=s-112<<10|n>>1,i+=1&n)},t.float2Bytes=function(t,e,i,n){var s=255*t%1;if(e[i+0]=Math.round(255*(t%1-Ci*s)),n>1){var a=65025*t%1;if(e[i+1]=Math.round(255*(s-Ci*a)),n>2){var r=16581375*t%1;e[i+2]=Math.round(255*(a-Ci*r)),n>3&&(e[i+3]=Math.round(255*r))}}},t.float2BytesRange=function(e,i,n,s,a,r){e=it.clamp((e-s)/(a-s),0,1),t.float2Bytes(e,i,n,r)},t.float2MantissaExponent=function(e,i,n,s){var a=Math.floor(Math.log2(Math.abs(e)))+1;e/=Math.pow(2,a),t.float2BytesRange(e,i,n,-1,1,s-1),i[n+s-1]=Math.round(a+127)},t}(),Ii=null,Li=null,Di=function(){function t(t,e){this.device=t,this.name=null,this._width=4,this._height=4,this._depth=1,this._format=7,this.type=Be,this.projection=Ve,this._cubemap=!1,this._volume=!1,this.fixCubemapSeams=!1,this._flipY=!1,this._premultiplyAlpha=!1,this._isRenderTarget=!1,this._mipmaps=!0,this._minFilter=5,this._magFilter=1,this._anisotropy=1,this._addressU=0,this._addressV=0,this._addressW=0,this._compareOnRead=!1,this._compareFunc=1,void 0!==e&&(void 0!==e.name&&(this.name=e.name),this._width=void 0!==e.width?e.width:this._width,this._height=void 0!==e.height?e.height:this._height,this._format=void 0!==e.format?e.format:this._format,e.hasOwnProperty("type")?this.type=e.type:e.hasOwnProperty("rgbm")?this.type=e.rgbm?Ne:Be:e.hasOwnProperty("swizzleGGGR")&&(this.type=e.swizzleGGGR?ze:Be),void 0!==e.mipmaps?this._mipmaps=e.mipmaps:this._mipmaps=void 0!==e.autoMipmap?e.autoMipmap:this._mipmaps,this._levels=e.levels,this._cubemap=void 0!==e.cubemap?e.cubemap:this._cubemap,this.fixCubemapSeams=void 0!==e.fixCubemapSeams?e.fixCubemapSeams:this.fixCubemapSeams,this._cubemap?this.projection=We:e.projection&&e.projection!==We&&(this.projection=e.projection),this._minFilter=void 0!==e.minFilter?e.minFilter:this._minFilter,this._magFilter=void 0!==e.magFilter?e.magFilter:this._magFilter,this._anisotropy=void 0!==e.anisotropy?e.anisotropy:this._anisotropy,this._addressU=void 0!==e.addressU?e.addressU:this._addressU,this._addressV=void 0!==e.addressV?e.addressV:this._addressV,this._compareOnRead=void 0!==e.compareOnRead?e.compareOnRead:this._compareOnRead,this._compareFunc=void 0!==e._compareFunc?e._compareFunc:this._compareFunc,this._flipY=void 0!==e.flipY?e.flipY:this._flipY,this._premultiplyAlpha=void 0!==e.premultiplyAlpha?e.premultiplyAlpha:this._premultiplyAlpha,t.webgl2&&(this._depth=void 0!==e.depth?e.depth:this._depth,this._volume=void 0!==e.volume?e.volume:this._volume,this._addressW=void 0!==e.addressW?e.addressW:this._addressW)),this._compressed=8===this._format||9===this._format||this._format===Kt||this._format>=ie,this._invalid=!1,this._lockedLevel=-1,this._levels||(this._levels=this._cubemap?[[null,null,null,null,null,null]]:[null]),this.dirtyAll(),this._gpuSize=0,this.impl=t.createTextureImpl(this),t.textures.push(this)}var e=t.prototype;return e.destroy=function(){if(this.device){var t=this.device,e=t.textures.indexOf(this);-1!==e&&t.textures.splice(e,1),t.scope.removeValue(this),this.impl.destroy(t),this.adjustVramSizeTracking(t._vram,-this._gpuSize),this._levels=null,this.device=null}},e.loseContext=function(){this.impl.loseContext(),this.dirtyAll()},e.adjustVramSizeTracking=function(t,e){t.tex+=e},t.calcGpuSize=function(t,e,i,n,s,a){Ii||((Ii=[])[0]=1,Ii[1]=1,Ii[2]=2,Ii[3]=2,Ii[4]=2,Ii[5]=2,Ii[6]=4,Ii[7]=4,Ii[11]=8,Ii[12]=8,Ii[13]=16,Ii[14]=16,Ii[15]=4,Ii[16]=4,Ii[17]=4,Ii[18]=4,Ii[19]=4,Ii[20]=4),Li||((Li=[])[21]=8,Li[22]=8,Li[24]=8,Li[25]=8,Li[26]=8,Li[27]=8,Li[8]=8,Li[29]=8,Li[23]=16,Li[9]=16,Li[10]=16,Li[28]=16,Li[30]=16);for(var r=Ii.hasOwnProperty(n)?Ii[n]:0,o=Li.hasOwnProperty(n)?Li[n]:0,h=0;;){if(r>0)h+=t*e*i*r;else{var l=Math.floor((t+3)/4),c=Math.floor((e+3)/4),u=Math.floor((i+3)/4);n!==ne&&n!==se||(l=Math.max(Math.floor(l/2),1)),h+=l*c*u*o}if(!s||1===t&&1===e&&1===i)break;t=Math.max(Math.floor(t/2),1),e=Math.max(Math.floor(e/2),1),i=Math.max(Math.floor(i/2),1)}return h*(a?6:1)},e.dirtyAll=function(){this._levelsUpdated=this._cubemap?[[!0,!0,!0,!0,!0,!0]]:[!0],this._needsUpload=!0,this._needsMipmapsUpload=this._mipmaps,this._mipmapsUploaded=!1,this._parameterFlags=255},e.lock=function(t){if(void 0===t&&(t={}),void 0===t.level&&(t.level=0),void 0===t.face&&(t.face=0),void 0===t.mode&&(t.mode=2),this._lockedLevel=t.level,null===this._levels[t.level])switch(this._format){case 0:case 1:this._levels[t.level]=new Uint8Array(this._width*this._height*this._depth);break;case 2:this._levels[t.level]=new Uint8Array(this._width*this._height*this._depth*2);break;case 3:case 4:case 5:this._levels[t.level]=new Uint16Array(this._width*this._height*this._depth);break;case 6:this._levels[t.level]=new Uint8Array(this._width*this._height*this._depth*3);break;case 7:this._levels[t.level]=new Uint8Array(this._width*this._height*this._depth*4);break;case 8:this._levels[t.level]=new Uint8Array(Math.floor((this._width+3)/4)*Math.floor((this._height+3)/4)*8*this._depth);break;case 9:case Kt:this._levels[t.level]=new Uint8Array(Math.floor((this._width+3)/4)*Math.floor((this._height+3)/4)*16*this._depth);break;case Zt:this._levels[t.level]=new Uint16Array(this._width*this._height*this._depth*3);break;case Qt:this._levels[t.level]=new Float32Array(this._width*this._height*this._depth*3);break;case $t:this._levels[t.level]=new Uint16Array(this._width*this._height*this._depth*4);break;case Jt:this._levels[t.level]=new Float32Array(this._width*this._height*this._depth*4)}return this._levels[t.level]},e.setSource=function(t,e){void 0===e&&(e=0);var i,n,s=!1;if(this._cubemap){if(t[0]){i=t[0].width||0,n=t[0].height||0;for(var a=0;a<6;a++){var r=t[a];if(!r||r.width!==i||r.height!==n||!this.device._isBrowserInterface(r)){s=!0;break}}}else s=!0;if(!s)for(var o=0;o<6;o++)this._levels[e][o]!==t[o]&&(this._levelsUpdated[e][o]=!0)}else this.device._isBrowserInterface(t)||(s=!0),s||(t!==this._levels[e]&&(this._levelsUpdated[e]=!0),i=t.width,n=t.height);if(s)if(this._width=4,this._height=4,this._cubemap)for(var h=0;h<6;h++)this._levels[e][h]=null,this._levelsUpdated[e][h]=!0;else this._levels[e]=null,this._levelsUpdated[e]=!0;else 0===e&&(this._width=i,this._height=n),this._levels[e]=t;this._invalid===s&&s||(this._invalid=s,this.upload())},e.getSource=function(t){return void 0===t&&(t=0),this._levels[t]},e.unlock=function(){this._lockedLevel,this.upload(),this._lockedLevel=-1},e.upload=function(){this._needsUpload=!0,this._needsMipmapsUpload=this._mipmaps},e.getDds=function(){for(var t=128,e=0;this._levels[e];){if(this.cubemap)for(var i=0;i<6;i++){if(!this._levels[e][i])return;var n=this._levels[e][i].length;if(!n)return;t+=n}else{var s=this._levels[e].length;if(!s)return;t+=s}t+=this._levels[e].length,e++}var a=new ArrayBuffer(t),r=new Uint32Array(a,0,32),o=528391;this._levels.length>1&&(o|=131072);var h=4096;this._levels.length>1&&(h|=4194304),(this._levels.length>1||this.cubemap)&&(h|=8);var l=this.cubemap?65024:0;r[0]=542327876,r[1]=124,r[2]=o,r[3]=this.height,r[4]=this.width,r[5]=this.width*this.height*4,r[6]=0,r[7]=this._levels.length;for(var c=0;c<11;c++)r[8+c]=0;r[19]=32,r[20]=65,r[21]=0,r[22]=32,r[23]=16711680,r[24]=65280,r[25]=255,r[26]=4278190080,r[27]=h,r[28]=l,r[29]=0,r[30]=0,r[31]=0;var u=128;if(this.cubemap)for(var d=0;d<6;d++)for(var f=0;f=0?t.insertChild(this,e):t.addChild(this))},i.setLocalEulerAngles=function(t,e,i){t instanceof lt?this.localRotation.setFromEulerAngles(t.x,t.y,t.z):this.localRotation.setFromEulerAngles(t,e,i),this._dirtyLocal||this._dirtifyLocal()},i.setLocalPosition=function(t,e,i){t instanceof lt?this.localPosition.copy(t):this.localPosition.set(t,e,i),this._dirtyLocal||this._dirtifyLocal()},i.setLocalRotation=function(t,e,i,n){t instanceof yt?this.localRotation.copy(t):this.localRotation.set(t,e,i,n),this._dirtyLocal||this._dirtifyLocal()},i.setLocalScale=function(t,e,i){t instanceof lt?this.localScale.copy(t):this.localScale.set(t,e,i),this._dirtyLocal||this._dirtifyLocal()},i._dirtifyLocal=function(){this._dirtyLocal||(this._dirtyLocal=!0,this._dirtyWorld||this._dirtifyWorld())},i._unfreezeParentToRoot=function(){for(var t=this._parent;t;)t._frozen=!1,t=t._parent},i._dirtifyWorld=function(){this._dirtyWorld||this._unfreezeParentToRoot(),this._dirtifyWorldInternal()},i._dirtifyWorldInternal=function(){if(!this._dirtyWorld){this._frozen=!1,this._dirtyWorld=!0;for(var t=0;t8?t.FORMAT_FLOAT:t.FORMAT_8BIT,t.initShaderDefines()},t.createTexture=function(t,e,i,n,s){return new Di(t,{name:s,width:e,height:i,mipmaps:!1,format:n,addressU:1,addressV:1,type:Be,magFilter:0,minFilter:0,anisotropy:1})};var e=t.prototype;return e.destroy=function(){this.lightsTexture8&&(this.lightsTexture8.destroy(),this.lightsTexture8=null),this.lightsTextureFloat&&(this.lightsTextureFloat.destroy(),this.lightsTextureFloat=null)},e.setCompressionRanges=function(t,e){this.invMaxColorValue=1/e,this.invMaxAttenuation=1/t},e.setBounds=function(t,e){this.boundsMin.copy(t),this.boundsDelta.copy(e)},e.uploadTextures=function(){this.lightsTextureFloat&&(this.lightsTextureFloat.lock().set(this.lightsFloat),this.lightsTextureFloat.unlock()),this.lightsTexture8.lock().set(this.lights8),this.lightsTexture8.unlock()},e.updateUniforms=function(){this._lightsTexture8Id.setValue(this.lightsTexture8),t.lightTextureFormat===t.FORMAT_FLOAT&&this._lightsTextureFloatId.setValue(this.lightsTextureFloat),this._lightsTextureInvSizeId.setValue(this._lightsTextureInvSizeData)},e.getSpotDirection=function(t,e){e._node.getWorldTransform().getY(t).mulScalar(-1),t.normalize()},e.getLightAreaSizes=function(t){var e=t._node.getWorldTransform();return e.transformVector(hn,rn),on[0]=rn.x,on[1]=rn.y,on[2]=rn.z,e.transformVector(ln,rn),on[3]=rn.x,on[4]=rn.y,on[5]=rn.z,on},e.addLightDataFlags=function(t,e,i,n,s){t[e+0]=n?255:0,t[e+1]=64*i._shape,t[e+2]=255*i._falloffMode,t[e+3]=s?255:0},e.addLightDataColor=function(t,e,i,n,s){var a=this.invMaxColorValue,r=n?i._linearFinalColor:i._finalColor;Ri.float2Bytes(r[0]*a,t,e+0,2),Ri.float2Bytes(r[1]*a,t,e+2,2),Ri.float2Bytes(r[2]*a,t,e+4,2),t[e+6]=s?255:0;var o=!!(1&i.mask),h=!!(2&i.mask);t[e+7]=o&&h?127:h?255:0},e.addLightDataSpotAngles=function(t,e,i){Ri.float2Bytes(.499999*i._innerConeAngleCos+.5,t,e+0,2),Ri.float2Bytes(.499999*i._outerConeAngleCos+.5,t,e+2,2)},e.addLightDataShadowBias=function(t,e,i){var n=i.getRenderData(null,0),s=i._getUniformBiasValues(n);Ri.float2BytesRange(s.bias,t,e,-1,20,2),Ri.float2Bytes(s.normalBias,t,e+2,2)},e.addLightDataPositionRange=function(t,e,i,n){var s=rn.sub2(n,this.boundsMin).div(this.boundsDelta);Ri.float2Bytes(s.x,t,e+0,4),Ri.float2Bytes(s.y,t,e+4,4),Ri.float2Bytes(s.z,t,e+8,4),Ri.float2Bytes(i.attenuationEnd*this.invMaxAttenuation,t,e+12,4)},e.addLightDataSpotDirection=function(t,e,i){this.getSpotDirection(rn,i),Ri.float2Bytes(.499999*rn.x+.5,t,e+0,4),Ri.float2Bytes(.499999*rn.y+.5,t,e+4,4),Ri.float2Bytes(.499999*rn.z+.5,t,e+8,4)},e.addLightDataLightProjMatrix=function(t,e,i){for(var n=i.data,s=0;s<12;s++)Ri.float2BytesRange(n[s],t,e+4*s,-2,2,4);for(var a=12;a<16;a++)Ri.float2MantissaExponent(n[a],t,e+4*a,4)},e.addLightDataCookies=function(t,e,i){var n="rgb"===i._cookieChannel;if(t[e+0]=Math.floor(255*i.cookieIntensity),t[e+1]=n?255:0,!n){var s=i._cookieChannel;t[e+4]="rrr"===s?255:0,t[e+5]="ggg"===s?255:0,t[e+6]="bbb"===s?255:0,t[e+7]="aaa"===s?255:0}},e.addLightAtlasViewport=function(t,e,i){Ri.float2Bytes(i.x,t,e+0,2),Ri.float2Bytes(i.y,t,e+2,2),Ri.float2Bytes(i.z/3,t,e+4,2)},e.addLightAreaSizes=function(t,e,i){for(var n=this.getLightAreaSizes(i),s=0;s<6;s++)Ri.float2MantissaExponent(n[s],t,e+4*s,4)},e.addLightData=function(e,i,n){var s=2===e._type,a=e.atlasViewportAllocated,r=this.cookiesEnabled&&!!e._cookie&&a,o=this.areaLightsEnabled&&0!==e.shape,h=this.shadowsEnabled&&e.castShadows&&a,l=e._node.getPosition(),c=null,u=null;s?h?c=e.getRenderData(null,0).shadowMatrix:r&&(c=an.evalSpotCookieMatrix(e)):(h||r)&&(u=e.atlasViewport);var d=this.lights8,f=i*this.lightsTexture8.width*4;if(this.addLightDataFlags(d,f+4*cn.FLAGS,e,s,h),this.addLightDataColor(d,f+4*cn.COLOR_A,e,n,r),s&&this.addLightDataSpotAngles(d,f+4*cn.SPOT_ANGLES,e),e.castShadows&&this.addLightDataShadowBias(d,f+4*cn.SHADOW_BIAS,e),r&&this.addLightDataCookies(d,f+4*cn.COOKIE_A,e),t.lightTextureFormat===t.FORMAT_FLOAT){var p=this.lightsFloat,m=i*this.lightsTextureFloat.width*4;if(p[m+4*un.POSITION_RANGE+0]=l.x,p[m+4*un.POSITION_RANGE+1]=l.y,p[m+4*un.POSITION_RANGE+2]=l.z,p[m+4*un.POSITION_RANGE+3]=e.attenuationEnd,s&&(this.getSpotDirection(rn,e),p[m+4*un.SPOT_DIRECTION+0]=rn.x,p[m+4*un.SPOT_DIRECTION+1]=rn.y,p[m+4*un.SPOT_DIRECTION+2]=rn.z),c)for(var _=c.data,g=0;g<16;g++)p[m+4*un.PROJ_MAT_0+g]=_[g];if(u&&(p[m+4*un.ATLAS_VIEWPORT+0]=u.x,p[m+4*un.ATLAS_VIEWPORT+1]=u.y,p[m+4*un.ATLAS_VIEWPORT+2]=u.z/3),o){var v=this.getLightAreaSizes(e);p[m+4*un.AREA_DATA_WIDTH+0]=v[0],p[m+4*un.AREA_DATA_WIDTH+1]=v[1],p[m+4*un.AREA_DATA_WIDTH+2]=v[2],p[m+4*un.AREA_DATA_HEIGHT+0]=v[3],p[m+4*un.AREA_DATA_HEIGHT+1]=v[4],p[m+4*un.AREA_DATA_HEIGHT+2]=v[5]}}else this.addLightDataPositionRange(d,f+4*cn.POSITION_X,e,l),s&&this.addLightDataSpotDirection(d,f+4*cn.SPOT_DIRECTION_X,e),c&&this.addLightDataLightProjMatrix(d,f+4*cn.PROJ_MAT_00,c),u&&this.addLightAtlasViewport(d,f+4*cn.ATLAS_VIEWPORT_A,u),o&&this.addLightAreaSizes(d,f+4*cn.AREA_DATA_WIDTH_X,e)},t}();dn.FORMAT_FLOAT=0,dn.FORMAT_8BIT=1,dn.lightTextureFormat=dn.FORMAT_8BIT,dn.shaderDefines="";var fn=[],pn={rgbm:"decodeRGBM",rgbe:"decodeRGBE",linear:"decodeLinear"},mn={optionsContext:{},optionsContextMin:{},generateKey:function(t){var e,i=function(t){var e=[];for(var i in t)t.hasOwnProperty(i)&&"chunks"!==i&&"lights"!==i&&e.push(i);return e.sort()};t===this.optionsContextMin?(this.propsMin||(this.propsMin=i(t)),e=this.propsMin):t===this.optionsContext?(this.props||(this.props=i(t)),e=this.props):e=i(t);for(var n="standard",s=0;s0){if(fn[t]e.length){for(var i=e,n=i.charAt(i.length-1),s=fn[t]-i.length,a=0;a1&&(a+="getShadowCascadeMatrix(light"+n+"_shadowMatrixPalette, light"+n+"_shadowCascadeDistances, light"+n+"_shadowCascadeCount);\n",e="(cascadeShadowMat, "+i+");\n"),a+=s+e,a+="fadeShadow(light"+n+"_shadowCascadeDistances);\n"},_nonPointShadowMapProjection:function(t,e,i,n,s){var a="("+i+", "+n+");\n";return!e._normalOffsetBias||e._isVsm?2===e._type?e._isPcf&&(t.webgl2||t.extStandardDerivatives)?"\t\t\t getShadowCoordPerspZbuffer"+a:"\t\t\t getShadowCoordPersp"+a:this._directionalShadowMapProjection(e,a,n,s,"getShadowCoordOrtho"):2===e._type?e._isPcf&&(t.webgl2||t.extStandardDerivatives)?"\t\t\t getShadowCoordPerspZbufferNormalOffset"+a:"\t\t\t getShadowCoordPerspNormalOffset"+a:this._directionalShadowMapProjection(e,a,n,s,"getShadowCoordOrthoNormalOffset")},_addVaryingIfNeeded:function(t,e,i){return t.indexOf(i)>=0?"varying "+e+" "+i+";\n":""},_getLightSourceShapeString:function(t){switch(t){case 1:return"Rect";case 2:return"Disk";case 3:return"Sphere";default:return""}},_getPassDefineString:function(t){return t===Nt?"#define PICK_PASS\n":2===t?"#define DEPTH_PASS\n":t>=3&&t<=17?"#define SHADOW_PASS\n":""},_vsAddTransformCode:function(t,e,i,n){return t+=i.transformVS},_vsAddBaseCode:function(t,e,i,n){return t+=i.baseVS,1!==n.nineSlicedMode&&2!==n.nineSlicedMode||(t+=i.baseNineSlicedVS),t},_fsAddBaseCode:function(t,e,i,n){return t+=i.basePS,1===n.nineSlicedMode?t+=i.baseNineSlicedPS:2===n.nineSlicedMode&&(t+=i.baseNineSlicedTiledPS),t},_decodeFunc:function(t){return pn[t]||"decodeGamma"},_fsAddStartCode:function(t,e,i,n){return t+=i.startPS,1===n.nineSlicedMode?t+=i.startNineSlicedPS:2===n.nineSlicedMode&&(t+=i.startNineSlicedTiledPS),t},_buildShadowPassFragmentCode:function(t,e,i,n,s){var a=n.pass-3,r=Math.floor(a/6),o=a-6*r;return e.extStandardDerivatives&&!e.webgl2&&(t+="uniform vec2 polygonOffset;\n"),3===o?e.textureFloatHighPrecision?t+="#define VSM_EXPONENT 15.0\n\n":t+="#define VSM_EXPONENT 5.54\n\n":2===o&&(t+="#define VSM_EXPONENT 5.54\n\n"),0!==r&&(t+="uniform vec3 view_position;\n",t+="uniform float light_radius;\n"),t+=s,n.alphaTest&&(t+="float dAlpha;\n",t+=this._addMap("opacity","opacityPS",n,i),t+=i.alphaTestPS),0!==o||e.webgl2&&1!==r?1===o&&(t+="vec2 encodeFloatRG( float v ) {\n",t+="\t\tvec2 enc = vec2(1.0, 255.0) * v;\n",t+="\t\tenc = fract(enc);\n",t+="\t\tenc -= enc.yy * vec2(1.0/255.0, 1.0/255.0);\n",t+="\t\treturn enc;\n",t+="}\n\n"):t+=i.packDepthPS,t+="void main(void)\n{\n",n.alphaTest&&(t+="\t getOpacity();\n",t+="\t alphaTest(dAlpha);\n"),t+=1===r||(1===o||2===o||3===o)&&0!==r?"\t float depth = min(distance(view_position, vPositionW) / light_radius, 0.99999);\n":"\t float depth = gl_FragCoord.z;\n",0!==o||e.webgl2&&(1!==r||n.clusteredLightingEnabled)?0===o||4===o?(t+="\t gl_FragColor = vec4(1.0);\n",n.clusteredLightingEnabled&&1===r&&e.webgl2&&(t+="\t gl_FragDepth = depth;\n")):t+=1===o?"\t gl_FragColor = vec4(encodeFloatRG(depth), encodeFloatRG(depth*depth));\n":i.storeEVSMPS:e.extStandardDerivatives&&!e.webgl2?(t+="\t float minValue = 2.3374370500153186e-10; //(1.0 / 255.0) / (256.0 * 256.0 * 256.0);\n",t+="\t depth += polygonOffset.x * max(abs(dFdx(depth)), abs(dFdy(depth))) + minValue * polygonOffset.y;\n",t+="\t gl_FragColor = packFloat(depth);\n"):t+="\t gl_FragColor = packFloat(depth);\n",t+="}\n"},createShaderDefinition:function(t,e){var i=e.lights.length>0;e.dirLightMap&&(i=!0),e.clusteredLightingEnabled&&(i=!0),0===e.shadingModel?(e.fresnelModel=0,e.specularAntialias=!1,e.ambientSH=!1):e.fresnelModel=0===e.fresnelModel?2:e.fresnelModel;var n=!!e.reflectionSource;e.useSpecular||(e.specularMap=e.glossMap=null);var s=e.pass>=3&&e.pass<=17,a=i||n||e.ambientSH||e.heightMap||e.enableGGXSpecular||e.clusteredLightingEnabled&&!s||e.clearCoatNormalMap;this.options=e;var r,o,h="",l="",c="",u=ri,d={vertex_position:ae};if(e.chunks){var f={};for(var p in u)u.hasOwnProperty(p)&&(e.chunks[p]?((o=e.chunks[p]).indexOf("vertex_normal")>=0&&(d.vertex_normal=re),o.indexOf("vertex_tangent")>=0&&(d.vertex_tangent=oe),o.indexOf("vertex_texCoord0")>=0&&(d.vertex_texCoord0=de),o.indexOf("vertex_texCoord1")>=0&&(d.vertex_texCoord1=fe),o.indexOf("vertex_color")>=0&&(d.vertex_color=ce),o.indexOf("vertex_boneWeights")>=0&&(d.vertex_boneWeights=he),o.indexOf("vertex_boneIndices")>=0&&(d.vertex_boneIndices=le),f[p]=o):f[p]=u[p]);u=f}h+=this._getPassDefineString(e.pass),h=this._vsAddBaseCode(h,t,u,e),l+="\t vPositionW\t\t= getWorldPosition();\n",2===e.pass&&(h+="varying float vDepth;\n",h+="#ifndef VIEWMATRIX\n",h+="#define VIEWMATRIX\n",h+="uniform mat4 matrix_view;\n",h+="#endif\n",h+="#ifndef CAMERAPLANES\n",h+="#define CAMERAPLANES\n",h+="uniform vec4 camera_params;\n\n",h+="#endif\n",l+="\t\tvDepth = -(matrix_view * vec4(vPositionW,1.0)).z * camera_params.x;\n"),e.useInstancing&&(d.instance_line1=De,d.instance_line2=ke,d.instance_line3=Oe,d.instance_line4=Fe,h+=u.instancingVS),a&&(d.vertex_normal=re,l+="\t vNormalW = getNormal();\n","sphereMap"===e.reflectionSource&&t.fragmentUniformsCount<=16&&(h+=u.viewNormalVS,l+="\t vNormalV\t\t= getViewNormal();\n"),(e.heightMap||e.normalMap||e.enableGGXSpecular)&&e.hasTangents?(d.vertex_tangent=oe,h+=u.tangentBinormalVS,l+="\t vTangentW\t = getTangent();\n",l+="\t vBinormalW\t= getBinormal();\n"):e.enableGGXSpecular&&(h+=u.tangentBinormalVS,l+="\t vObjectSpaceUpW\t= getObjectSpaceUp();\n"));var m=[],_=[];for(var g in fn){var v=g+"Map";if(e[g+"VertexColor"]){var y=g+"VertexColorChannel";e[y]=this._correctChannel(g,e[y])}if(e[v]){var x=v+"Channel",b=v+"Transform",S=v+"Uv";e[S]=Math.min(e[S],1),e[x]=this._correctChannel(g,e[x]);var w=e[S];m[w]=!0,_[w]=_[w]||e[v]&&!e[b]}}e.forceUv1&&(m[1]=!0,_[1]=void 0===_[1]||_[1]);for(var T=0;T<2;T++)m[T]&&(d["vertex_texCoord"+T]="TEXCOORD"+T,h+=u["uv"+T+"VS"],l+="\t vec2 uv"+T+" = getUv"+T+"();\n"),_[T]&&(l+="\t vUv"+T+" = uv"+T+";\n");var A=[h,c,l,[]];for(var M in fn){var C=M+"Map";if(e[C]){var E=C+"Transform";if(e[E]){var P=C+"Uv";this._setMapTransform(A,M,e[E],e[P])}}}h=A[0],c=A[1],l=A[2],e.vertexColors&&(d.vertex_color=ce,l+="\t vVertexColor = vertex_color;\n"),(e.useMorphPosition||e.useMorphNormal)&&(e.useMorphTextureBased?(h+="#define MORPHING_TEXTURE_BASED\n",e.useMorphPosition&&(h+="#define MORPHING_TEXTURE_BASED_POSITION\n"),e.useMorphNormal&&(h+="#define MORPHING_TEXTURE_BASED_NORMAL\n"),d.morph_vertex_id=Fe,h+="attribute float morph_vertex_id;\n"):(h+="#define MORPHING\n",e.useMorphPosition?(d.morph_pos0=Pe,d.morph_pos1=Re,d.morph_pos2=Ie,d.morph_pos3=Le,h+="#define MORPHING_POS03\n",h+="attribute vec3 morph_pos0;\n",h+="attribute vec3 morph_pos1;\n",h+="attribute vec3 morph_pos2;\n",h+="attribute vec3 morph_pos3;\n"):e.useMorphNormal&&(d.morph_nrm0=Pe,d.morph_nrm1=Re,d.morph_nrm2=Ie,d.morph_nrm3=Le,h+="#define MORPHING_NRM03\n",h+="attribute vec3 morph_nrm0;\n",h+="attribute vec3 morph_nrm1;\n",h+="attribute vec3 morph_nrm2;\n",h+="attribute vec3 morph_nrm3;\n"),e.useMorphNormal?(d.morph_nrm4=De,d.morph_nrm5=ke,d.morph_nrm6=Oe,d.morph_nrm7=Fe,h+="#define MORPHING_NRM47\n",h+="attribute vec3 morph_nrm4;\n",h+="attribute vec3 morph_nrm5;\n",h+="attribute vec3 morph_nrm6;\n",h+="attribute vec3 morph_nrm7;\n"):(d.morph_pos4=De,d.morph_pos5=ke,d.morph_pos6=Oe,d.morph_pos7=Fe,h+="#define MORPHING_POS47\n",h+="attribute vec3 morph_pos4;\n",h+="attribute vec3 morph_pos5;\n",h+="attribute vec3 morph_pos6;\n",h+="attribute vec3 morph_pos7;\n"))),e.skin?(d.vertex_boneWeights=he,d.vertex_boneIndices=le,h+=ci(t,u),h+="#define SKIN\n"):e.useInstancing&&(h+="#define INSTANCING\n"),e.screenSpace&&(h+="#define SCREENSPACE\n"),e.pixelSnap&&(h+="#define PIXELSNAP\n"),h=this._vsAddTransformCode(h,t,u,e),a&&(h+=u.normalVS),h+="\n",h+=u.startVS,h+=l,h+=u.endVS;var R=h+="}",I=c;c="",c+=this._addVaryingIfNeeded(h,"vec4","vVertexColor"),c+=this._addVaryingIfNeeded(h,"vec3","vPositionW"),c+=this._addVaryingIfNeeded(h,"vec3","vNormalV"),c+=this._addVaryingIfNeeded(h,"vec3","vNormalW"),c+=this._addVaryingIfNeeded(h,"vec3","vTangentW"),c+=this._addVaryingIfNeeded(h,"vec3","vBinormalW"),c+=this._addVaryingIfNeeded(h,"vec3","vObjectSpaceUpW"),c+=this._addVaryingIfNeeded(h,"vec2","vUv0"),c+=this._addVaryingIfNeeded(h,"vec2","vUv1"),R=(c+=I)+R;var L="";if(t.webgl2?(L=di(t),u.extensionVS&&(L+=u.extensionVS+"\n"),R=L+u.gles3VS+R):(u.extensionVS&&(L=u.extensionVS+"\n"),R=L+R),e.forceFragmentPrecision&&"highp"!==e.forceFragmentPrecision&&"mediump"!==e.forceFragmentPrecision&&"lowp"!==e.forceFragmentPrecision&&(e.forceFragmentPrecision=null),e.forceFragmentPrecision&&("highp"===e.forceFragmentPrecision&&"highp"!==t.maxPrecision&&(e.forceFragmentPrecision="mediump"),"mediump"===e.forceFragmentPrecision&&"lowp"===t.maxPrecision&&(e.forceFragmentPrecision="lowp")),h="",t.webgl2&&(h+=di(t)),t.webgl2||(t.extStandardDerivatives&&(h+="#extension GL_OES_standard_derivatives : enable\n"),t.extTextureLod&&(h+="#extension GL_EXT_shader_texture_lod : enable\n",h+="#define SUPPORTS_TEXLOD\n")),u.extensionPS&&(h+=u.extensionPS+"\n"),t.webgl2&&(h+=u.gles3PS),h+=e.forceFragmentPrecision?"precision "+e.forceFragmentPrecision+" float;\n\n":ui(t),h+=this._getPassDefineString(e.pass),e.pass===Nt)return h+="uniform vec4 uColor;\n",h+=c,e.alphaTest&&(h+="float dAlpha;\n",h+=this._addMap("opacity","opacityPS",e,u),h+=u.alphaTestPS),h+="void main(void)\n{\n",e.alphaTest&&(h+="\t getOpacity();\n",h+="\t alphaTest(dAlpha);\n"),h+="\t\tgl_FragColor = uColor;\n",{attributes:d,vshader:R,fshader:h+="}\n"};if(2===e.pass)return h+="varying float vDepth;\n",h+=c,h+=u.packDepthPS,e.alphaTest&&(h+="float dAlpha;\n",h+=this._addMap("opacity","opacityPS",e,u),h+=u.alphaTestPS),h+="void main(void)\n{\n",e.alphaTest&&(h+="\t getOpacity();\n",h+="\t alphaTest(dAlpha);\n"),h+="\t\tgl_FragColor = packFloat(vDepth);\n",{attributes:d,vshader:R,fshader:h+="}\n"};if(s)return{attributes:d,vshader:R,fshader:this._buildShadowPassFragmentCode(h,t,u,e,c)};if(e.customFragmentShader)return{attributes:d,vshader:R,fshader:h+e.customFragmentShader,tag:1};h+=c,h=this._fsAddBaseCode(h,t,u,e),e.detailModes&&(h+=u.detailModesPS);var D=h;h="",e.clearCoat>0&&(h+="#define CLEARCOAT\n",h+="#define CLUSTER_CLEAR_COAT\n"),!1===e.opacityFadesSpecular&&(h+="uniform float material_alphaFade;\n");var k,O=0,F=[],B=!1,N=!1,U=!1,z=e.lights.some((function(t){return t._shape&&0!==t._shape}));e.clusteredLightingEnabled&&e.clusteredLightingAreaLightsEnabled&&(z=!0),7===t.areaLightLutFormat?(h+="#define AREA_R8_G8_B8_A8_LUTS\n",h+="#define AREA_LUTS_PRECISION lowp\n"):h+="#define AREA_LUTS_PRECISION highp\n",(z||e.clusteredLightingEnabled)&&(h+="#define AREA_LIGHTS\n",h+="uniform AREA_LUTS_PRECISION sampler2D areaLightsLutTex1;\n",h+="uniform AREA_LUTS_PRECISION sampler2D areaLightsLutTex2;\n");for(var V=0;V0?u.cubeMapProjectBoxPS:u.cubeMapProjectNonePS,h+=e.skyboxIntensity?u.envMultiplyPS:u.envConstPS),e.diffuseDetail&&(h+=this._addMap("diffuseDetail","diffuseDetailMapPS",e,u)),h+=this._addMap("diffuse","diffusePS",e,u),(3!==e.blendType||e.alphaTest||e.alphaToCoverage)&&(h+=this._addMap("opacity","opacityPS",e,u)),h+=this._addMap("emissive","emissivePS",e,u,e.emissiveFormat),i&&e.useSpecular||n){e.specularAntialias&&e.normalMap?e.normalizeNormalMap&&a?h+=u.specularAaToksvigPS:h+=u.specularAaToksvigFastPS:h+=u.specularAaNonePS;var j=e.useMetalness?"metalness":"specular";h+=this._addMap(j,j+"PS",e,u),h+=this._addMap("gloss","glossPS",e,u),2===e.fresnelModel&&(h+=u.fresnelSchlickPS)}if(e.clearCoat>0&&(h+=this._addMap("clearCoat","clearCoatPS",e,u),h+=this._addMap("clearCoatGloss","clearCoatGlossPS",e,u),h+=this._addMap("clearCoatNormal","clearCoatNormalPS",e,u)),e.heightMap){if(!e.normalMap){var Y=this._getUvSourceExpression("heightMapTransform","heightMapUv",e);e.hasTangents||(k=k.replace(/\$UV/g,Y)),h+=k}h+=this._addMap("height","parallaxPS",e,u)}var K=e.aoMap||e.aoVertexColor;if(K&&(h+=this._addMap("ao","aoPS",e,u),e.occludeSpecular&&(1===e.occludeSpecular?h+=e.occludeSpecularFloat?u.aoSpecOccSimplePS:u.aoSpecOccConstSimplePS:h+=e.occludeSpecularFloat?u.aoSpecOccPS:u.aoSpecOccConstPS)),"envAtlas"===e.reflectionSource)h+=u.reflectionEnvPS.replace(/\$DECODE/g,this._decodeFunc(e.reflectionEncoding));else if("cubeMap"===e.reflectionSource)h+=e.fixSeams?u.fixCubemapSeamsStretchPS:u.fixCubemapSeamsNonePS,h+=u.reflectionCubePS.replace(/\$DECODE/g,this._decodeFunc(e.reflectionEncoding));else if("sphereMap"===e.reflectionSource){h+=(t.fragmentUniformsCount>16?u.reflectionSpherePS:u.reflectionSphereLowPS).replace(/\$DECODE/g,this._decodeFunc(e.reflectionEncoding))}n&&(e.clearCoat>0&&(h+=u.reflectionCCPS),e.refraction&&(h+=u.refractionPS)),e.clusteredLightingEnabled&&(h+=u.clusteredLightUtilsPS,h+=u.clusteredLightCookiesPS,F[0]=!0,F[4]=!0,U=!0),(O>0||e.clusteredLightingEnabled)&&(B&&(h+=u.shadowCascadesPS),F[0]&&(h+=u.shadowStandardPS),F[4]&&t.webgl2&&(h+=u.shadowStandardGL2PS),N&&(h+=u.shadowVSM_commonPS,F[1]&&(h+=u.shadowVSM8PS),F[2]&&(h+=t.extTextureHalfFloatLinear?u.shadowEVSMPS.replace(/\$/g,"16"):u.shadowEVSMnPS.replace(/\$/g,"16")),F[3]&&(h+=t.extTextureFloatLinear?u.shadowEVSMPS.replace(/\$/g,"32"):u.shadowEVSMnPS.replace(/\$/g,"32"))),t.webgl2||t.extStandardDerivatives||(h+=u.biasConstPS),h+=u.shadowCoordPS+u.shadowCommonPS,U&&(h+=u.shadowCoordPerspZbufferPS)),e.enableGGXSpecular&&(h+="uniform float material_anisotropy;\n"),i&&(h+=u.lightDiffuseLambertPS,(z||e.clusteredLightingEnabled)&&(h+=u.ltc)),h+="\n";var Z=!1;e.useSpecular?(h+="#define CLUSTER_SPECULAR\n",e.conserveEnergy&&(h+="#define CLUSTER_CONSERVE_ENERGY\n"),i&&(h+=0===e.shadingModel?u.lightSpecularPhongPS:e.enableGGXSpecular?u.lightSpecularAnisoGGXPS:u.lightSpecularBlinnPS),e.fresnelModel>0?e.conserveEnergy&&!z?h+=u.combineDiffuseSpecularPS:h+=u.combineDiffuseSpecularNoConservePS:n?h+=u.combineDiffuseSpecularOldPS:e.diffuseMap?h+=u.combineDiffuseSpecularNoReflPS:(h+=u.combineDiffuseSpecularNoReflSeparateAmbientPS,Z=!0)):h+=u.combineDiffusePS,e.clearCoat>0&&(h+=u.combineClearCoatPS);var $=!0;if(e.lightMap||e.lightVertexColor){var Q=e.dirLightMap&&e.useSpecular?"lightmapDirPS":"lightmapSinglePS";h+=this._addMap("light",Q,e,u,e.lightMapFormat),$=e.lightMapWithoutAmbient}$&&("ambientSH"===e.ambientSource?h+=u.ambientSHPS:"envAtlas"===e.ambientSource?h+=u.ambientEnvPS.replace(/\$DECODE/g,this._decodeFunc(e.ambientEncoding)):h+=u.ambientConstantPS),e.ambientTint&&!Z&&(h+="uniform vec3 material_ambient;\n"),e.alphaTest&&(h+=u.alphaTestPS),e.msdf&&(h+=u.msdfPS),a&&(h+=u.viewDirPS,e.useSpecular&&(h+=e.enableGGXSpecular?u.reflDirAnisoPS:u.reflDirPS));var J,tt=!1,et=!1,it=!1,nt=!1,st=!1;e.clusteredLightingEnabled&&i&&(nt=!0,tt=!0,et=!0,st=!0,h+=u.floatUnpackingPS,e.lightMaskDynamic&&(h+="\n#define CLUSTER_MESH_DYNAMIC_LIGHTS"),e.clusteredLightingCookiesEnabled&&(h+="\n#define CLUSTER_COOKIES"),e.clusteredLightingShadowsEnabled&&!e.noShadow&&(h+="\n#define CLUSTER_SHADOWS",h+="\n#define CLUSTER_SHADOW_TYPE_"+It[e.clusteredLightingShadowType]),e.clusteredLightingAreaLightsEnabled&&(h+="\n#define CLUSTER_AREALIGHTS"),h+=dn.shaderDefines,h+=u.clusteredLightShadowsPS,h+=u.clusteredLightPS),e.twoSidedLighting&&(h+="uniform float twoSidedLightingNegScaleFactor;\n"),h=this._fsAddStartCode(h,t,u,e),a&&(e.hasTangents||!t.extStandardDerivatives||e.fastTbn?e.twoSidedLighting?h+="\t dVertexNormalW = gl_FrontFacing ? vNormalW * twoSidedLightingNegScaleFactor : -vNormalW * twoSidedLightingNegScaleFactor;\n":h+="\t dVertexNormalW = vNormalW;\n":e.twoSidedLighting?h+="\t dVertexNormalW = normalize(gl_FrontFacing ? vNormalW * twoSidedLightingNegScaleFactor : -vNormalW * twoSidedLightingNegScaleFactor);\n":h+="\t dVertexNormalW = normalize(vNormalW);\n",(e.heightMap||e.normalMap)&&e.hasTangents&&(e.twoSidedLighting?(h+="\t dTangentW = gl_FrontFacing ? vTangentW * twoSidedLightingNegScaleFactor : -vTangentW * twoSidedLightingNegScaleFactor;\n",h+="\t dBinormalW = gl_FrontFacing ? vBinormalW * twoSidedLightingNegScaleFactor : -vBinormalW * twoSidedLightingNegScaleFactor;\n"):(h+="\t dTangentW = vTangentW;\n",h+="\t dBinormalW = vBinormalW;\n")));var at=!1;3!==e.blendType||e.alphaTest||e.alphaToCoverage?e.heightMap&&e.opacityMap?at=!0:(h+="\t getOpacity();\n",e.alphaTest&&(h+="\t alphaTest(dAlpha);\n")):h+="\t dAlpha = 1.0;\n";var rt=!1;if(a&&(h+="\t getViewDir();\n",(e.heightMap||e.normalMap||e.clearCoatNormalMap||e.enableGGXSpecular)&&(h+="\t getTBN();\n"),e.heightMap&&(h+="\t getParallax();\n"),at&&(h+="\t getOpacity();\n",e.alphaTest&&(h+="\t alphaTest(dAlpha);\n")),h+="\t getNormal();\n",e.useSpecular&&(i&&e.enableGGXSpecular&&(h+="\t getGlossiness();\n",rt=!0),h+="\t getReflDir();\n")),h+="\t getAlbedo();\n",e.clearCoat>0&&(h+="\t getClearCoat();\n",h+="\t getClearCoatGlossiness();\n",h+="\t getClearCoatNormal();\n"),(i&&e.useSpecular||n)&&(h+="\t getSpecularity();\n",rt||(h+="\t getGlossiness();\n"),z&&(h+="\t #ifdef AREA_LIGHTS\n",h+="\t dSpecularityNoFres = dSpecularity;\n",h+="\t #ifdef CLEARCOAT\n",h+="\t ccSpecularityNoFres = ccSpecularity;\n",h+="\t #endif\n",h+="\t #endif\n"),e.fresnelModel>0&&(h+="\t getFresnel();\n")),$&&(h+="\t addAmbient();\n",e.separateAmbient&&(h+="\n\t\t\t\t\t\t\t\t\t\tvec3 dAmbientLight = dDiffuseLight;\n\t\t\t\t\t\t\t\t\t\tdDiffuseLight = vec3(0);\n\t\t\t\t\t\t\t\t")),e.ambientTint&&!Z&&(h+="\t dDiffuseLight *= material_ambient;\n"),K&&!e.occludeDirect&&(h+="\t\tapplyAO();\n"),(e.lightMap||e.lightVertexColor)&&(h+="\t addLightMap();\n"),i||n){n&&(e.clearCoat>0&&(h+="\t addReflectionCC();\n"),h+="\t addReflection();\n"),z&&(h+="\t ccReflection.rgb *= ccSpecularity;\n",h+="\t dReflection.rgb *= dSpecularity;\n",h+="\t dSpecularLight *= dSpecularity;\n",h+="\t float roughness = max((1.0 - dGlossiness) * (1.0 - dGlossiness), 0.001);\n",h+="\t calcLTCLightValues();\n");for(var ot=0;ot 0.00001) {\n",2===lt&&(J&&!ht._cookieFalloff||(h+="\t\t\t dAtten *= getSpotEffect(light"+ot+"_direction, light"+ot+"_innerConeAngle, light"+ot+"_outerConeAngle);\n",nt=!0))),h+=0!==ct?0===lt?"\t\t\t dAttenD = getLightDiffuse();\n":"\t\t\t dAttenD = get"+ut+"LightDiffuse() * 16.0;\n":"\t\t\t dAtten *= getLightDiffuse();\n",ht.castShadows&&!e.noShadow){var dt=null,ft=void 0;if(1===ht._shadowType?(dt="VSM8",ft="0.0"):2===ht._shadowType?(dt="VSM16",ft="5.54"):3===ht._shadowType?(dt="VSM32",ft=t.textureFloatHighPrecision?"15.0":"5.54"):dt=4===ht._shadowType?"PCF5x5":"PCF3x3",null!==dt)if(1===lt)r="(light"+ot+"_shadowMap, light"+ot+"_shadowParams);\n",ht._normalOffsetBias&&(h+="\t\t\t normalOffsetPointShadow(light"+ot+"_shadowParams);\n"),h+="\t\t\t dAtten *= getShadowPoint"+dt+r;else{var pt="light"+ot+"_shadowMatrix",mt="light"+ot+"_shadowParams";h+=this._nonPointShadowMapProjection(t,e.lights[ot],pt,mt,ot),2===lt&&(dt="Spot"+dt),h+="\t\t\t dAtten *= getShadow"+dt+"(light"+ot+"_shadowMap, light"+ot+"_shadowParams"+(ht._isVsm?", "+ft:"")+");\n"}}0!==ct?e.conserveEnergy&&e.useSpecular?h+="\t\t\t dDiffuseLight += mix((dAttenD * dAtten) * light"+ot+"_color"+(J?" * dAtten3":"")+", vec3(0), dLTCSpecFres);\n":h+="\t\t\t dDiffuseLight += (dAttenD * dAtten) * light"+ot+"_color"+(J?" * dAtten3":"")+";\n":z&&e.conserveEnergy&&e.useSpecular?h+="\t\t\t dDiffuseLight += mix(dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+", vec3(0), dSpecularity);\n":h+="\t\t\t dDiffuseLight += dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n",0!==ct?(e.clearCoat>0&&(h+="\t\t\t ccSpecularLight += ccLTCSpecFres * get"+ut+"LightSpecularCC() * dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n"),e.useSpecular&&(h+="\t\t\t dSpecularLight += dLTCSpecFres * get"+ut+"LightSpecular() * dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n")):z?(e.clearCoat>0&&(h+="\t\t\t ccSpecularLight += ccSpecularity * getLightSpecularCC() * dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n"),e.useSpecular&&(h+="\t\t\t dSpecularLight += dSpecularity * getLightSpecular() * dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n")):(e.clearCoat>0&&(h+="\t\t\t ccSpecularLight += getLightSpecularCC() * dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n"),e.useSpecular&&(h+="\t\t\t dSpecularLight += getLightSpecular() * dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n")),0!==lt&&(h+="\t }\n"),h+="\n"}}e.clusteredLightingEnabled&&i&&(et=!0,it=!0,tt=!0,h+="\t addClusteredLights();\n"),z&&(e.clearCoat>0&&(h+="\t ccSpecularity = 1.0;\n"),e.useSpecular&&(h+="\t dSpecularity = vec3(1);\n")),n&&e.refraction&&(h+="\t addRefraction();\n")}h+="\n",K&&(e.occludeDirect&&(h+="\t\tapplyAO();\n"),e.occludeSpecular&&(h+="\t\toccludeSpecular();\n")),!1===e.opacityFadesSpecular&&(2!==e.blendType&&4!==e.blendType||(h+="float specLum = dot((dSpecularLight + dReflection.rgb * dReflection.a) * dSpecularity, vec3( 0.2126, 0.7152, 0.0722 ));\n",h+="#ifdef CLEARCOAT\n specLum += dot(ccSpecularLight * ccSpecularity + ccReflection.rgb * ccReflection.a * ccSpecularity, vec3( 0.2126, 0.7152, 0.0722 ));\n#endif\n",h+="dAlpha = clamp(dAlpha + gammaCorrectInput(specLum), 0.0, 1.0);\n"),h+="dAlpha *= material_alphaFade;\n"),h+=u.endPS,2===e.blendType||6===e.blendType||e.alphaToCoverage?h+=u.outputAlphaPS:4===e.blendType?h+=u.outputAlphaPremulPS:h+=u.outputAlphaOpaquePS,e.msdf&&(h+="\t gl_FragColor = applyMsdf(gl_FragColor);\n"),h+="\n",h+="}\n",tt&&(h=u.lightDirPointPS+h),et&&(h=u.falloffLinearPS+h),it&&(h=u.falloffInvSquaredPS+h),nt&&(h=u.spotPS+h),st&&(h=u.cookiePS+h);var _t="";return h.includes("dReflection")&&(_t+="vec4 dReflection;\n"),h.includes("dTBN")&&(_t+="mat3 dTBN;\n"),h.includes("dAlbedo")&&(_t+="vec3 dAlbedo;\n"),h.includes("dEmission")&&(_t+="vec3 dEmission;\n"),h.includes("dNormalW")&&(_t+="vec3 dNormalW;\n"),h.includes("dVertexNormalW")&&(_t+="vec3 dVertexNormalW;\n"),h.includes("dTangentW")&&(_t+="vec3 dTangentW;\n"),h.includes("dBinormalW")&&(_t+="vec3 dBinormalW;\n"),h.includes("dViewDirW")&&(_t+="vec3 dViewDirW;\n"),h.includes("dReflDirW")&&(_t+="vec3 dReflDirW;\n"),h.includes("dDiffuseLight")&&(_t+="vec3 dDiffuseLight;\n"),h.includes("dSpecularLight")&&(_t+="vec3 dSpecularLight;\n"),h.includes("dLightDirNormW")&&(_t+="vec3 dLightDirNormW;\n"),h.includes("dLightDirW")&&(_t+="vec3 dLightDirW;\n"),h.includes("dLightPosW")&&(_t+="vec3 dLightPosW;\n"),h.includes("dShadowCoord")&&(_t+="vec3 dShadowCoord;\n"),h.includes("dNormalMap")&&(_t+="vec3 dNormalMap;\n"),h.includes("dSpecularity")&&(_t+="vec3 dSpecularity;\n"),h.includes("dSpecularityNoFres")&&(_t+="vec3 dSpecularityNoFres;\n"),h.includes("dUvOffset")&&(_t+="vec2 dUvOffset;\n"),h.includes("dGlossiness")&&(_t+="float dGlossiness;\n"),h.includes("dAlpha")&&(_t+="float dAlpha;\n"),h.includes("dAtten")&&(_t+="float dAtten;\n"),h.includes("dAttenD")&&(_t+="float dAttenD;\n"),h.includes("dAtten3")&&(_t+="vec3 dAtten3;\n"),h.includes("dAo")&&(_t+="float dAo;\n"),h.includes("dMsdf")&&(_t+="vec4 dMsdf;\n"),h.includes("ccReflection")&&(_t+="vec4 ccReflection;\n"),h.includes("ccNormalW")&&(_t+="vec3 ccNormalW;\n"),h.includes("ccReflDirW")&&(_t+="vec3 ccReflDirW;\n"),h.includes("ccSpecularLight")&&(_t+="vec3 ccSpecularLight;\n"),h.includes("ccSpecularity")&&(_t+="float ccSpecularity;\n"),h.includes("ccSpecularityNoFres")&&(_t+="float ccSpecularityNoFres;\n"),h.includes("ccGlossiness")&&(_t+="float ccGlossiness;\n"),{attributes:d,vshader:R,fshader:h=D+_t+h,tag:1}}},_n={begin:pi,dummyFragmentCode:fi,end:mi,fogCode:li,gammaCode:oi,precisionCode:ui,skinCode:ci,tonemapCode:hi,versionCode:di,basic:Ti,particle:Ai,skybox:Mi,standard:mn},gn=2.399963229728653,vn=function(t,e,i){var n=e*gn,s=Math.sqrt(e)/Math.sqrt(i);t.x=s*Math.cos(n),t.y=s*Math.sin(n)},yn=function(t,e,i,n,s){void 0===n&&(n=0),void 0===s&&(s=1),n=1-2*n,s=1-2*s;var a=it.lerp(n,s,e/i),r=Math.sqrt(1-a*a),o=gn*e;t.x=Math.cos(o)*r,t.y=a,t.z=Math.sin(o)*r},xn=function(t){var e=(t<<16|t>>>16)>>>0;return 2.3283064365386963e-10*(e=((16711935&(e=((252645135&(e=((858993459&(e=((1431655765&e)<<1|(2863311530&e)>>>1)>>>0))<<2|(3435973836&e)>>>2)>>>0))<<4|(4042322160&e)>>>4)>>>0))<<8|(4278255360&e)>>>8)>>>0)},bn=function(t){switch(t.type){case Ne:return"RGBM";case Ue:return"RGBE";default:switch(t.format){case Zt:case Qt:case $t:case Jt:return"Linear";default:return"Gamma"}}},Sn=function(t){switch(t===Ve&&(t=Ge),t){case We:return"Cubemap";case Ge:return"Equirect";case He:return"Octahedral"}},wn=function(t,e,i){if(t<=0)e[i+0]=0,e[i+1]=0,e[i+2]=0,e[i+3]=0;else if(t>=1)e[i+0]=255,e[i+1]=0,e[i+2]=0,e[i+3]=0;else{var n=1*t%1,s=255*t%1,a=65025*t%1,r=16581375*t%1;n-=s/255,s-=a/255,a-=r/255,e[i+0]=Math.min(255,Math.floor(256*n)),e[i+1]=Math.min(255,Math.floor(256*s)),e[i+2]=Math.min(255,Math.floor(256*a)),e[i+3]=Math.min(255,Math.floor(256*r))}},Tn=function(t,e,i,n){var s=2*i*Math.PI,a=Math.pow(1-e,1/(n+1)),r=Math.sqrt(1-a*a);t.set(Math.cos(s)*r,Math.sin(s)*r,a).normalize()},An=function(t,e,i){var n=2*i*Math.PI,s=Math.sqrt(1-e),a=Math.sqrt(e);t.set(Math.cos(n)*a,Math.sin(n)*a,s).normalize()},Mn=function(t,e,i,n){var s=2*i*Math.PI,a=Math.sqrt((1-e)/(1+(n*n-1)*e)),r=Math.sqrt(1-a*a);t.set(Math.cos(s)*r,Math.sin(s)*r,a).normalize()},Cn=function(t,e){var i=t*e,n=e/(1-t*t+i*i);return n*n*(1/Math.PI)},En={16:{2:26,8:20,32:17,128:16,512:16},32:{2:53,8:40,32:34,128:32,512:32},128:{2:214,8:163,32:139,128:130,512:128},1024:{2:1722,8:1310,32:1114,128:1041,512:1025}},Pn=function(t,e,i){for(var n=i/t,s=1-Math.log2(e)/11,a=s*s,r=new lt,o=new lt,h=new lt(0,0,1),l=[],c=function(t,e){var i=En[t];return i&&i[e]||t}(t,e),u=0;u0){var f=Cn(Math.min(1,d),a)/4+.001,p=.5*Math.log2(n/f);l.push(o.x,o.y,o.z,p)}}for(;l.length<4*t;)l.push(0,0,0,0);return l},Rn=function(t,e,i){var n=function(t){for(var e=t.length,i=Math.min(e,512),n=Math.ceil(e/i),s=new Uint8Array(i*n*4),a=0,r=0;r>2*o),rect:s,seamPixels:1}),s.y+=s.w,s.z=Math.max(1,Math.floor(.5*s.z)),s.w=Math.max(1,Math.floor(.5*s.w));return s.set(128,384,64,32),Un(t,n,{numSamples:(null==e?void 0:e.numSamples)||2048,distribution:"lambert",rect:s,seamPixels:1}),n},t.generatePrefilteredAtlas=function(t,e){for(var i=t[0].device,n=(null==e?void 0:e.target)||new Di(i,{width:512,height:512,format:7,type:Ne,projection:Ge,addressU:1,addressV:1,mipmaps:!1}),s=new dt(0,0,512,256),a=zn(n.width,n.height),r=0;r0,t.forceFragmentPrecision=i.forceFragmentPrecision||"",t.chunks=i.chunks||"",t.blendType=i.blendType,t.forceUv1=i.forceUv1,t.separateAmbient=!1,t.screenSpace=n&&0!=(n&Dt),t.skin=n&&0!=(2&n),t.useInstancing=n&&0!=(32&n),t.useMorphPosition=n&&0!=(n&kt),t.useMorphNormal=n&&0!=(n&Ot),t.useMorphTextureBased=n&&0!=(n&Ft),t.nineSlicedMode=i.nineSlicedMode||0,e.clusteredLightingEnabled&&(t.clusteredLightingEnabled=!0,t.clusteredLightingCookiesEnabled=e.lighting.cookiesEnabled,t.clusteredLightingShadowsEnabled=e.lighting.shadowsEnabled,t.clusteredLightingShadowType=e.lighting.shadowType,t.clusteredLightingAreaLightsEnabled=e.lighting.areaLightsEnabled)},e._updateUVOptions=function(t,e,i,n){var s=!1,a=!1,r=!1;for(var o in i&&(s=0!=(4&i),a=0!=(8&i),r=0!=(16&i)),t.vertexColors=!1,this._mapXForms=[],fn)this._updateTexOptions(t,e,o,s,a,r,n);this._mapXForms=null},e._updateMinOptions=function(t,e){t.opacityTint=1!==e.opacity&&3!==e.blendType,t.lights=[]},e._updateMaterialOptions=function(t,e){var i,n=(e.diffuseTint||!e.diffuseMap&&!e.diffuseVertexColor)&&jn(e.diffuse),s=!!(e.useMetalness||e.specularMap||e.sphereMap||e.cubeMap||(i=e.specular,0!==i.r||0!==i.g||0!==i.b)||e.enableGGXSpecular||e.clearCoat>0),a=s&&!e.useMetalness&&(e.specularTint||!e.specularMap&&!e.specularVertexColor)&&jn(e.specular),r=!e.emissiveMap||jn(e.emissive)&&e.emissiveTint,o=1!==e.emissiveIntensity,h=!!e.normalMap&&(e.normalMap.format===Kt||e.normalMap.type===ze);t.opacityTint=1!==e.opacity&&3!==e.blendType?1:0,t.blendMapsWithColors=!0,t.ambientTint=e.ambientTint,t.diffuseTint=n?2:0,t.specularTint=a?2:0,t.metalnessTint=e.useMetalness&&e.metalness<1?1:0,t.glossTint=1,t.emissiveTint=(r?2:0)+(o?1:0),t.alphaToCoverage=e.alphaToCoverage,t.normalizeNormalMap=e.normalizeNormalMap,t.ambientSH=!!e.ambientSH,t.useSpecular=s,t.emissiveFormat=e.emissiveMap?e.emissiveMap.type===Ne?1:e.emissiveMap.format===Jt?2:0:null,t.lightMapFormat=e.lightMap?e.lightMap.type===Ne?1:e.lightMap.format===Jt?2:0:null,t.specularAntialias=e.specularAntialias&&!!e.normalMap&&!!e.normalMap.mipmaps&&!h,t.conserveEnergy=e.conserveEnergy,t.opacityFadesSpecular=e.opacityFadesSpecular,t.alphaFade=e.alphaFade,t.occludeSpecular=e.occludeSpecular,t.occludeSpecularFloat=1!==e.occludeSpecularIntensity,t.occludeDirect=e.occludeDirect,t.shadingModel=e.shadingModel,t.fresnelModel=e.fresnelModel,t.packedNormal=h,t.fastTbn=e.fastTbn,t.cubeMapProjection=e.cubeMapProjection,t.customFragmentShader=e.customFragmentShader,t.refraction=!!e.refraction,t.useMetalness=e.useMetalness,t.enableGGXSpecular=e.enableGGXSpecular,t.msdf=!!e.msdfMap,t.twoSidedLighting=e.twoSidedLighting,t.pixelSnap=e.pixelSnap,t.aoMapUv=e.aoUvSet,t.diffuseDetail=!!e.diffuseMap,t.normalDetail=!!e.normalMap,t.diffuseDetailMode=e.diffuseDetailMode,t.detailModes=!!t.diffuseDetail,t.clearCoat=!!e.clearCoat,t.clearCoatTint=1!==e.clearCoat?1:0,t.clearCoatGlossiness=!!e.clearCoatGlossiness,t.clearCoatGlossTint=1!==e.clearCoatGlossiness?1:0},e._updateEnvOptions=function(t,e,i,n){t.fog=i.useFog?n.fog:"none",t.gamma=i.useGammaTonemap?n.gammaCorrection:0,t.toneMap=i.useGammaTonemap?n.toneMapping:-1,t.useRgbm=i.emissiveMap&&i.emissiveMap.type===Ne||i.lightMap&&i.lightMap.type===Ne,t.fixSeams=!!i.cubeMap&&i.cubeMap.fixCubemapSeams;var s=0===i.shadingModel,a=!1;if(i.envAtlas&&!s?(t.reflectionSource="envAtlas",t.reflectionEncoding=i.envAtlas.encoding):i.cubeMap?(t.reflectionSource="cubeMap",t.reflectionEncoding=i.cubeMap.encoding):i.sphereMap?(t.reflectionSource="sphereMap",t.reflectionEncoding=i.sphereMap.encoding):i.useSkybox&&n.envAtlas&&!s?(t.reflectionSource="envAtlas",t.reflectionEncoding=n.envAtlas.encoding,a=!0):(t.reflectionSource=null,t.reflectionEncoding=null),i.ambientSH&&!s)t.ambientSource="ambientSH",t.ambientEncoding=null;else{var r=i.envAtlas||(i.useSkybox&&n.envAtlas?n.envAtlas:null);r&&!s?(t.ambientSource="envAtlas",t.ambientEncoding=r.encoding):(t.ambientSource="constant",t.ambientEncoding=null)}t.skyboxIntensity=a&&1!==n.skyboxIntensity,t.useCubeMapRotation=a&&n.skyboxRotation&&!n.skyboxRotation.equals(yt.IDENTITY)},e._updateLightOptions=function(t,e,i,n,s){if(t.lightMap=!1,t.lightMapChannel="",t.lightMapUv=0,t.lightMapTransform=0,t.lightMapWithoutAmbient=!1,t.dirLightMap=!1,i&&(t.noShadow=0!=(1&i),0!=(64&i)&&(t.lightMapFormat=1,t.lightMap=!0,t.lightMapChannel="rgb",t.lightMapUv=1,t.lightMapTransform=0,t.lightMapWithoutAmbient=!e.lightMap,t.useRgbm=!0,0!=(i&Lt)&&(t.dirLightMap=!0),0!=(i&Bt)&&(t.lightMapWithoutAmbient=!1))),e.useLighting){var a=[],r=i?i>>16:1;t.lightMaskDynamic=!!(1&r),n&&(this._collectLights(0,n[0],a,r),this._collectLights(1,n[1],a,r,s),this._collectLights(2,n[2],a,r,s)),t.lights=a}else t.lights=[];0===t.lights.length&&(t.noShadow=!0)},e._updateTexOptions=function(t,e,i,n,s,a,r){var o=i+"Map",h=i+"VertexColor",l=i+"VertexColorChannel",c=o+"Channel",u=o+"Transform",d=o+"Uv";"light"!==i&&(t[o]=!1,t[c]="",t[u]=0,t[d]=0),t[h]=!1,t[l]="";var f="opacity"===i;if(f&&3===e.blendType&&0===e.alphaTest&&!e.alphaToCoverage)return t;if((!r||f)&&("height"!==i&&e[h]&&a&&(t[h]=e[h],t[l]=e[l],t.vertexColors=!0),e[o])){var p=!0;0!==e[d]||n||(p=!1),1!==e[d]||s||(p=!1),p&&(t[o]=!!e[o],t[u]=this._getMapTransformID(e.getUniform(u),e[d]),t[c]=e[c],t[d]=e[d])}},e._collectLights=function(t,e,i,n,s){for(var a=0;a0&&(this._setParameter("material_clearCoat",this.clearCoat),this._setParameter("material_clearCoatGlossiness",this.clearCoatGlossiness),this._setParameter("material_clearCoatReflectivity",this.clearCoat),this._setParameter("material_clearCoatBumpiness",this.clearCoatBumpiness)),this._setParameter("material_shininess",n("shininess")),this.emissiveMap&&!this.emissiveTint||this._setParameter("material_emissive",n("emissive")),1!==this.emissiveIntensity&&this._setParameter("material_emissiveIntensity",this.emissiveIntensity),this.refraction>0&&(this._setParameter("material_refraction",this.refraction),this._setParameter("material_refractionIndex",this.refractionIndex)),this._setParameter("material_opacity",this.opacity),!1===this.opacityFadesSpecular&&this._setParameter("material_alphaFade",this.alphaFade),this.occludeSpecular&&this._setParameter("material_occludeSpecularIntensity",this.occludeSpecularIntensity),1===this.cubeMapProjection&&this._setParameter(n("cubeMapProjectionBox")),fn)this._updateMap(s);this.ambientSH&&this._setParameter("ambientSH[0]",this.ambientSH),this.normalMap&&this._setParameter("material_bumpiness",this.bumpiness),this.normalMap&&this.normalDetailMap&&this._setParameter("material_normalDetailMapBumpiness",this.normalDetailMapBumpiness),this.heightMap&&this._setParameter("material_heightMapFactor",n("heightMapFactor")),this.cubeMap&&this._setParameter("texture_cubeMap",this.cubeMap),this.sphereMap&&this._setParameter("texture_sphereMap",this.sphereMap),this._setParameter("material_reflectivity",this.reflectivity),this._processParameters("_activeParams"),this._dirtyShader&&(this.shader=null,this.clearVariants())},i.updateEnvUniforms=function(t,e){var i=this.envAtlas||(this.useSkybox?e.envAtlas:null);i&&(this._setParameter("texture_envAtlas",i),this.useSkybox&&!e.skyboxRotation.equals(yt.IDENTITY)&&e._skyboxRotationMat3&&this._setParameter("cubeMapRotationMatrix",e._skyboxRotationMat3.data)),this._processParameters("_activeLightingParams")},i.updateShader=function(t,e,i,n,s,a){this.updateEnvUniforms(t,e);var r=s>1&&s<=Nt,o=r?mn.optionsContextMin:mn.optionsContext;r?this.shaderOptBuilder.updateMinRef(o,t,e,this,i,n,s,a):this.shaderOptBuilder.updateRef(o,t,e,this,i,n,s,a),this.onUpdateShader&&(o=this.onUpdateShader(o));var h=t.getProgramLibrary();this.shader=h.getProgram("standard",o),i||(this.clearVariants(),this.variants[0]=this.shader),this._dirtyShader=!1},i.destroy=function(){for(var e in this._assetReferences)this._assetReferences[e]._unbind();this._assetReferences=null,t.prototype.destroy.call(this)},W(e,[{key:"chunks",get:function(){return this._dirtyShader=!0,this._chunks},set:function(t){this._dirtyShader=!0,this._chunks=t}}]),e}(Xn);ns.TEXTURE_PARAMETERS=Zn,ns.CUBEMAP_PARAMETERS=Qn;var ss=function(t,e){es[t]=e},as=function(t,e,i,n){Object.defineProperty(ns.prototype,t,{get:n||function(){return this["_"+t]},set:i}),ts[t]={value:e}},rs=function(t){return t.defaultValue&&t.defaultValue.clone?function(t){var e="_"+t.name,i=t.dirtyShaderFunc||function(){return!0};as(t.name,(function(){return t.defaultValue.clone()}),(function(t){var n=this[e];n.equals(t)||(this._dirtyShader=this._dirtyShader||i(n,t),this[e]=n.copy(t))}),t.getterFunc)}(t):function(t){var e="_"+t.name,i=t.dirtyShaderFunc||function(){return!0};as(t.name,(function(){return t.defaultValue}),(function(t){var n=this[e];n!==t&&(this._dirtyShader=this._dirtyShader||i(n,t),this[e]=t)}),t.getterFunc)}(t)};function os(t,e,i,n,s,a){fn[t]=i,rs({name:t+"Map",defaultValue:null,dirtyShaderFunc:function(t,e){return!!t!=!!e||t&&(t.type!==e.type||t.fixCubemapSeams!==e.fixCubemapSeams||t.format!==e.format)}}),rs({name:t+"MapTiling",defaultValue:new ut(1,1)}),rs({name:t+"MapOffset",defaultValue:new ut(0,0)}),rs({name:t+"MapRotation",defaultValue:0}),rs({name:t+"MapUv",defaultValue:e}),i>0&&rs({name:t+"MapChannel",defaultValue:n||(i>1?"rgb":"g")}),s&&(rs({name:t+"VertexColor",defaultValue:!1}),i>0&&rs({name:t+"VertexColorChannel",defaultValue:n||(i>1?"rgb":"g")})),a&&rs({name:t+"Mode",defaultValue:"mul"});var r=t+"MapTiling",o=t+"MapOffset",h=t+"MapRotation",l=t+"MapTransform";ss(l,(function(t,e,i){var n=t[r],s=t[o],a=t[h];if(1===n.x&&1===n.y&&0===s.x&&0===s.y&&0===a)return null;var c=t._allocUniform(l,(function(){return[{name:"texture_"+l+"0",value:new Float32Array(3)},{name:"texture_"+l+"1",value:new Float32Array(3)}]})),u=Math.cos(a*it.DEG_TO_RAD),d=Math.sin(a*it.DEG_TO_RAD),f=c[0].value;f[0]=u*n.x,f[1]=-d*n.y,f[2]=s.x;var p=c[1].value;return p[0]=d*n.x,p[1]=u*n.y,p[2]=1-n.y-s.y,c}))}function hs(t,e){rs({name:t,defaultValue:e,getterFunc:function(){return this._dirtyShader=!0,this["_"+t]}}),ss(t,(function(e,i,n){var s=e._allocUniform(t,(function(){return new Float32Array(3)})),a=e[t];return e.useGammaTonemap&&n.gammaCorrection?(s[0]=Math.pow(a.r,2.2),s[1]=Math.pow(a.g,2.2),s[2]=Math.pow(a.b,2.2)):(s[0]=a.r,s[1]=a.g,s[2]=a.b),s}))}function ls(t,e,i){rs({name:t,defaultValue:e,dirtyShaderFunc:function(t,e){return(0===t||1===t)!=(0===e||1===e)}}),ss(t,i)}function cs(t,e){rs({name:t,defaultValue:null,dirtyShaderFunc:function(t,e){return!!t==!!e}}),ss(t,e)}function us(t,e){rs({name:t,defaultValue:e})}!function(){hs("ambient",new at(.7,.7,.7)),hs("diffuse",new at(1,1,1)),hs("specular",new at(0,0,0)),hs("emissive",new at(0,0,0)),ls("emissiveIntensity",1),ls("shininess",25,(function(t,e,i){return 0===t.shadingModel?Math.pow(2,.01*t.shininess*11):.01*t.shininess})),ls("heightMapFactor",1,(function(t,e,i){return.025*t.heightMapFactor})),ls("opacity",1),ls("alphaFade",1),ls("alphaTest",0),ls("bumpiness",1),ls("normalDetailMapBumpiness",1),ls("reflectivity",1),ls("occludeSpecularIntensity",1),ls("refraction",0),ls("refractionIndex",1/1.5),ls("metalness",1),ls("anisotropy",0),ls("clearCoat",0),ls("clearCoatGlossiness",1),ls("clearCoatBumpiness",1),ls("aoUvSet",0,null),cs("ambientSH"),cs("cubeMapProjectionBox",(function(t,e,i){var n=t._allocUniform("cubeMapProjectionBox",(function(){return[{name:"envBoxMin",value:new Float32Array(3)},{name:"envBoxMax",value:new Float32Array(3)}]})),s=t.cubeMapProjectionBox.getMin(),a=n[0].value;a[0]=s.x,a[1]=s.y,a[2]=s.z;var r=t.cubeMapProjectionBox.getMax(),o=n[1].value;return o[0]=r.x,o[1]=r.y,o[2]=r.z,n})),us("ambientTint",!1),us("diffuseTint",!1),us("specularTint",!1),us("emissiveTint",!1),us("fastTbn",!1),us("specularAntialias",!1),us("useMetalness",!1),us("enableGGXSpecular",!1),us("occludeDirect",!1),us("normalizeNormalMap",!0),us("conserveEnergy",!0),us("opacityFadesSpecular",!0),us("occludeSpecular",1),us("shadingModel",1),us("fresnelModel",2),us("cubeMapProjection",0),us("customFragmentShader",null),us("forceFragmentPrecision",null),us("useFog",!0),us("useLighting",!0),us("useGammaTonemap",!0),us("useSkybox",!0),us("forceUv1",!1),us("pixelSnap",!1),us("twoSidedLighting",!1),us("nineSlicedMode",void 0),os("diffuse",0,3,"",!0),os("specular",0,3,"",!0),os("emissive",0,3,"",!0),os("normal",0,-1,"",!1),os("metalness",0,1,"",!0),os("gloss",0,1,"",!0),os("opacity",0,1,"a",!0),os("height",0,1,"",!1),os("ao",0,1,"",!0),os("light",1,3,"",!0),os("msdf",0,3,"",!1),os("diffuseDetail",0,3,"",!1,!0),os("normalDetail",0,-1,"",!1),os("clearCoat",0,1,"",!0),os("clearCoatGloss",0,1,"",!0),os("clearCoatNormal",0,-1,"",!1),cs("cubeMap"),cs("sphereMap"),cs("envAtlas");var t=[null,null,null,null,null,null];as("prefilteredCubemaps",(function(){return t.slice()}),(function(t){var e=this._prefilteredCubemaps;t=t||[];for(var i=!1,n=!0,s=0;s<6;++s){var a=t[s]||null;e[s]!==a&&(e[s]=a,i=!0),n=n&&!!e[s]}i&&(n?this.envAtlas=Vn.generatePrefilteredAtlas(e,{target:this.envAtlas}):this.envAtlas&&(this.envAtlas.destroy(),this.envAtlas=null),this._dirtyShader=!0)}),(function(){return this._prefilteredCubemaps}))}();var ds=function(){function t(t){this._device=t,this._cache={},this._generators={},this._isClearingCache=!1,this._precached=!1,this._programsCollection=[],this._defaultStdMatOption={},this._defaultStdMatOptionMin={};var e=new ns;e.shaderOptBuilder.updateRef(this._defaultStdMatOption,t,{},e,null,[],0,null,null),e.shaderOptBuilder.updateMinRef(this._defaultStdMatOptionMin,t,{},e,null,[],3,null,null)}var e=t.prototype;return e.register=function(t,e){this.isRegistered(t)||(this._generators[t]=e)},e.unregister=function(t){this.isRegistered(t)&&delete this._generators[t]},e.isRegistered=function(t){return void 0!==this._generators[t]},e.getProgram=function(t,e){var i=this._generators[t];if(void 0===i)return null;var n=this._device,s=i.generateKey(e),a=this._cache[s];if(!a){var r;e.lights&&(r=e.lights,e.lights=r.map((function(t){var e=t.clone?t.clone():t;return e.key=t.key,e}))),this.storeNewProgram(t,e),e.lights&&(e.lights=r),this._precached&&console.warn("ProgramLibrary#getProgram: Cache miss for shader "+t+" key "+s+" after shaders precaching");var o=i.createShaderDefinition(n,e);a=this._cache[s]=new ai(n,o)}return a},e.storeNewProgram=function(t,e){var i={};if("standard"===t){var n=this._getDefaultStdMatOptions(e.pass);for(var s in e)(e.hasOwnProperty(s)&&n[s]!==e[s]||"pass"===s)&&(i[s]=e[s])}else i=e;this._programsCollection.push(JSON.stringify({name:t,options:i}))},e.dumpPrograms=function(){var t="let device = pc.app ? pc.app.graphicsDevice : pc.Application.getApplication().graphicsDevice;\n";t+="let shaders = [",this._programsCollection[0]&&(t+="\n\t"+this._programsCollection[0]);for(var e=1;e1&&t<=Nt?this._defaultStdMatOptionMin:this._defaultStdMatOption},e.precompile=function(t){if(t)for(var e=new Array(t.length),i=0;ie)if(ArrayBuffer.isView(t))t=t.subarray(0,e),i.set(t);else for(var n=0;nthis.vertexBuffer.numVertices&&(i=this.vertexBuffer.numVertices);var s=n.numComponents;if(this.vertexBuffer.getFormat().interleaved)for(var a=0,r=0;ri*s){var o=i*s;if(ArrayBuffer.isView(e))e=e.subarray(0,o),n.array.set(e);else for(var h=0;he||n>e){var s=e/Math.max(i,n),a=Math.floor(i*s),r=Math.floor(n*s),o=document.createElement("canvas");return o.width=a,o.height=r,o.getContext("2d").drawImage(t,0,0,i,n,0,0,a,r),o}return t}var qs=function(){function t(){this._glTexture=null,this._glTarget=void 0,this._glFormat=void 0,this._glInternalFormat=void 0,this._glPixelType=void 0}var e=t.prototype;return e.destroy=function(t){if(this._glTexture){for(var e=0;et.maxCubeMapSize||h.height>t.maxCubeMapSize)&&(h=Xs(h,t.maxCubeMapSize),0===a&&(e._width=h.width,e._height=h.height)),t.setUnpackFlipY(!1),t.setUnpackPremultiplyAlpha(e._premultiplyAlpha),i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+o,a,this._glInternalFormat,this._glFormat,this._glPixelType,h)}}else for(s=1/Math.pow(2,a),o=0;o<6;o++)if(e._levelsUpdated[0][o]){var l=n[o];e._compressed?i.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+o,a,this._glInternalFormat,Math.max(e._width*s,1),Math.max(e._height*s,1),0,l):(t.setUnpackFlipY(!1),t.setUnpackPremultiplyAlpha(e._premultiplyAlpha),i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+o,a,this._glInternalFormat,Math.max(e._width*s,1),Math.max(e._height*s,1),0,this._glFormat,this._glPixelType,l))}}else e._volume?(s=1/Math.pow(2,a),e._compressed?i.compressedTexImage3D(i.TEXTURE_3D,a,this._glInternalFormat,Math.max(e._width*s,1),Math.max(e._height*s,1),Math.max(e._depth*s,1),0,n):(t.setUnpackFlipY(!1),t.setUnpackPremultiplyAlpha(e._premultiplyAlpha),i.texImage3D(i.TEXTURE_3D,a,this._glInternalFormat,Math.max(e._width*s,1),Math.max(e._height*s,1),Math.max(e._depth*s,1),0,this._glFormat,this._glPixelType,n))):(t._isBrowserInterface(n)?(n instanceof HTMLImageElement&&(n.width>t.maxTextureSize||n.height>t.maxTextureSize)&&(n=Xs(n,t.maxTextureSize),0===a&&(e._width=n.width,e._height=n.height)),t.setUnpackFlipY(e._flipY),t.setUnpackPremultiplyAlpha(e._premultiplyAlpha),i.texImage2D(i.TEXTURE_2D,a,this._glInternalFormat,this._glFormat,this._glPixelType,n)):(s=1/Math.pow(2,a),e._compressed?i.compressedTexImage2D(i.TEXTURE_2D,a,this._glInternalFormat,Math.max(Math.floor(e._width*s),1),Math.max(Math.floor(e._height*s),1),0,n):(t.setUnpackFlipY(!1),t.setUnpackPremultiplyAlpha(e._premultiplyAlpha),i.texImage2D(i.TEXTURE_2D,a,this._glInternalFormat,Math.max(e._width*s,1),Math.max(e._height*s,1),0,this._glFormat,this._glPixelType,n))),e._mipmapsUploaded=0!==a);a++}else a++;if(e._needsUpload)if(e._cubemap)for(var c=0;c<6;c++)e._levelsUpdated[0][c]=!1;else e._levelsUpdated[0]=!1;!e._compressed&&e._mipmaps&&e._needsMipmapsUpload&&(e.pot||t.webgl2)&&1===e._levels.length&&(i.generateMipmap(this._glTarget),e._mipmapsUploaded=!0),e._gpuSize&&e.adjustVramSizeTracking(t._vram,-e._gpuSize),e._gpuSize=e.gpuSize,e.adjustVramSizeTracking(t._vram,e._gpuSize)}},t}();function js(t,e){var i=!0,n=t.createTexture();t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,2,2,0,t.RGBA,e,null);var s=t.createFramebuffer();return t.bindFramebuffer(t.FRAMEBUFFER,s),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0),t.checkFramebufferStatus(t.FRAMEBUFFER)!==t.FRAMEBUFFER_COMPLETE&&(i=!1),t.bindTexture(t.TEXTURE_2D,null),t.deleteTexture(n),t.bindFramebuffer(t.FRAMEBUFFER,null),t.deleteFramebuffer(s),i}var Ys,Ks=function(t){function e(e,i){var n;if(void 0===i&&(i={}),(n=t.call(this,e)||this).gl=void 0,n.webgl2=void 0,n.defaultFramebuffer=null,n.updateClientRect(),n.contextLost=!1,n._contextLostHandler=function(t){t.preventDefault(),n.contextLost=!0,n.loseContext(),n.fire("devicelost")},n._contextRestoredHandler=function(){n.restoreContext(),n.contextLost=!1,n.fire("devicerestored")},i.stencil=!0,i.powerPreference||(i.powerPreference="high-performance"),"undefined"!=typeof navigator){var a=navigator.userAgent;a.includes("AppleWebKit")&&(a.includes("15.4")||a.includes("15_4"))&&(i.antialias=!1)}for(var r=void 0===i.preferWebGl2||i.preferWebGl2?["webgl2","webgl","experimental-webgl"]:["webgl","experimental-webgl"],o=null,h=0;h0;var _=n.vertexUniformsCount;return _-=16,_-=8,_-=1,_-=16,n.boneLimit=Math.floor(_/3),n.boneLimit=Math.min(n.boneLimit,128),"Mali-450 MP"===n.unmaskedRenderer&&(n.boneLimit=34),n.constantTexSource=n.scope.resolve("source"),n.extTextureFloat?n.webgl2?n.textureFloatRenderable=!!n.extColorBufferFloat:n.textureFloatRenderable=js(o,o.FLOAT):n.textureFloatRenderable=!1,n.extColorBufferHalfFloat?n.textureHalfFloatRenderable=!!n.extColorBufferHalfFloat:n.extTextureHalfFloat?n.webgl2?n.textureHalfFloatRenderable=!!n.extColorBufferFloat:n.textureHalfFloatRenderable=js(o,n.extTextureHalfFloat.HALF_FLOAT_OES):n.textureHalfFloatRenderable=!1,n.supportsMorphTargetTexturesCore="highp"===n.maxPrecision&&n.maxVertexTextures>=2,n._textureFloatHighPrecision=void 0,n._textureHalfFloatUpdatable=void 0,n.grabPassAvailable=!0,n.grabPass=new Us(q(n),i.alpha),n.grabPass.create(),n.areaLightLutFormat=7,n.extTextureHalfFloat&&n.textureHalfFloatUpdatable&&n.extTextureHalfFloatLinear?n.areaLightLutFormat=$t:n.extTextureFloat&&n.extTextureFloatLinear&&(n.areaLightLutFormat=Jt),n}H(e,t);var i=e.prototype;return i.destroy=function(){t.prototype.destroy.call(this);var e=this.gl;this.grabPass.destroy(),this.webgl2&&this.feedback&&e.deleteTransformFeedback(this.feedback),this.clearShaderCache(),this.clearVertexArrayObjectCache(),this.canvas.removeEventListener("webglcontextlost",this._contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this._contextRestoredHandler,!1),this._contextLostHandler=null,this._contextRestoredHandler=null,this.gl=null,t.prototype.postDestroy.call(this)},i.createVertexBufferImpl=function(t,e){return new Vs},i.createIndexBufferImpl=function(t){return new Ws(t)},i.createShaderImpl=function(t){return new Hs(t)},i.createTextureImpl=function(t){return new qs(t)},i.getPrecision=function(){var t=this.gl,e="highp";if(t.getShaderPrecisionFormat){var i=t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT),n=t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT),s=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT),a=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT),r=i.precision>0&&s.precision>0,o=n.precision>0&&a.precision>0;r||(e=o?"mediump":"lowp")}return e},i.initializeExtensions=function(){var t=this.gl,e=t.getSupportedExtensions(),i=function(){for(var i=0;i1&&this.webgl2)){if(t._glDepthBuffer||(t._glDepthBuffer=e.createRenderbuffer()),e.bindRenderbuffer(e.RENDERBUFFER,t._glDepthBuffer),t._stencil)e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t._glDepthBuffer);else{var s=this.webgl2?e.DEPTH_COMPONENT32F:e.DEPTH_COMPONENT16;e.renderbufferStorage(e.RENDERBUFFER,s,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t._glDepthBuffer)}e.bindRenderbuffer(e.RENDERBUFFER,null)}}this.webgl2&&t._samples>1&&(t._glResolveFrameBuffer=t._glFrameBuffer,t._glFrameBuffer=e.createFramebuffer(),this.setFramebuffer(t._glFrameBuffer),i&&(t._glMsaaColorBuffer||(t._glMsaaColorBuffer=e.createRenderbuffer()),e.bindRenderbuffer(e.RENDERBUFFER,t._glMsaaColorBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,t._samples,i.impl._glInternalFormat,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,t._glMsaaColorBuffer)),t._depth&&(t._glMsaaDepthBuffer||(t._glMsaaDepthBuffer=e.createRenderbuffer()),e.bindRenderbuffer(e.RENDERBUFFER,t._glMsaaDepthBuffer),t._stencil?(e.renderbufferStorageMultisample(e.RENDERBUFFER,t._samples,e.DEPTH24_STENCIL8,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t._glMsaaDepthBuffer)):(e.renderbufferStorageMultisample(e.RENDERBUFFER,t._samples,e.DEPTH_COMPONENT32F,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t._glMsaaDepthBuffer)))),this.targets.push(t)}},i.getCopyShader=function(){if(!this._copyShader){var t=ri.fullscreenQuadVS,e=ri.outputTex2DPS;this._copyShader=vi(this,t,e,"outputTex2D")}return this._copyShader},i.updateBegin=function(){if(this.boundVao=null,this._tempEnableSafariTextureUnitWorkaround)for(var t=0;t1&&e.autoResolve&&e.resolve()}},i.setUnpackFlipY=function(t){if(this.unpackFlipY!==t){this.unpackFlipY=t;var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t)}},i.setUnpackPremultiplyAlpha=function(t){if(this.unpackPremultiplyAlpha!==t){this.unpackPremultiplyAlpha=t;var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t)}},i.activeTexture=function(t){this.textureUnit!==t&&(this.gl.activeTexture(this.gl.TEXTURE0+t),this.textureUnit=t)},i.bindTexture=function(t){var e=t.impl,i=e._glTarget,n=e._glTexture,s=this.textureUnit,a=this.targetToSlot[i];this.textureUnits[s][a]!==n&&(this.gl.bindTexture(i,n),this.textureUnits[s][a]=n)},i.bindTextureOnUnit=function(t,e){var i=t.impl,n=i._glTarget,s=i._glTexture,a=this.targetToSlot[n];this.textureUnits[e][a]!==s&&(this.activeTexture(e),this.gl.bindTexture(n,s),this.textureUnits[e][a]=s)},i.setTextureParameters=function(t){var e=this.gl,i=t._parameterFlags,n=t.impl._glTarget;if(1&i){var s=t._minFilter;(!t.pot&&!this.webgl2||!t._mipmaps||t._compressed&&1===t._levels.length)&&(2===s||3===s?s=0:4!==s&&5!==s||(s=1)),e.texParameteri(n,e.TEXTURE_MIN_FILTER,this.glFilter[s])}if(2&i&&e.texParameteri(n,e.TEXTURE_MAG_FILTER,this.glFilter[t._magFilter]),4&i&&(this.webgl2?e.texParameteri(n,e.TEXTURE_WRAP_S,this.glAddress[t._addressU]):e.texParameteri(n,e.TEXTURE_WRAP_S,this.glAddress[t.pot?t._addressU:1])),8&i&&(this.webgl2?e.texParameteri(n,e.TEXTURE_WRAP_T,this.glAddress[t._addressV]):e.texParameteri(n,e.TEXTURE_WRAP_T,this.glAddress[t.pot?t._addressV:1])),16&i&&this.webgl2&&e.texParameteri(n,e.TEXTURE_WRAP_R,this.glAddress[t._addressW]),32&i&&this.webgl2&&e.texParameteri(n,e.TEXTURE_COMPARE_MODE,t._compareOnRead?e.COMPARE_REF_TO_TEXTURE:e.NONE),64&i&&this.webgl2&&e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,this.glComparison[t._compareFunc]),128&i){var a=this.extTextureFilterAnisotropic;a&&e.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.max(1,Math.min(Math.round(t._anisotropy),this.maxAnisotropy)))}},i.setTexture=function(t,e){(t.impl._glTexture||t.impl.initialize(this,t),t._parameterFlags>0||t._needsUpload||t._needsMipmapsUpload||t===this.grabPass.texture)?(this.activeTexture(e),this.bindTexture(t),t._parameterFlags&&(this.setTextureParameters(t),t._parameterFlags=0),t===this.grabPass.texture&&this.grabPass.prepareTexture()||!t._needsUpload&&!t._needsMipmapsUpload||(t.impl.upload(this,t),t._needsUpload=!1,t._needsMipmapsUpload=!1)):this.bindTextureOnUnit(t,e)},i.createVertexArray=function(t){var e,i,n=t.length>1;if(n){e="";for(var s=0;s0?u.drawElementsInstanced(b,S,T,A,e):u.drawElements(b,S,T,A)}else{var M=t.base;e>0?u.drawArraysInstanced(b,M,S,e):u.drawArrays(b,M,S)}this.webgl2&&this.transformFeedbackBuffer&&(u.endTransformFeedback(),u.bindBufferBase(u.TRANSFORM_FEEDBACK_BUFFER,0,null)),this._drawCallsPerFrame++}},i.clear=function(t){var e=this.defaultClearOptions,i=null==(t=t||e).flags?e.flags:t.flags;if(0!==i){var n=this.gl;if(1&i){var s=null==t.color?e.color:t.color;this.setClearColor(s[0],s[1],s[2],s[3])}if(2&i){var a=null==t.depth?e.depth:t.depth;this.setClearDepth(a),this.depthWrite||n.depthMask(!0)}if(4&i){var r=null==t.stencil?e.stencil:t.stencil;this.setClearStencil(r)}n.clear(this.glClearFlag[i]),2&i&&(this.depthWrite||n.depthMask(!1))}},i.readPixels=function(t,e,i,n,s){var a=this.gl;a.readPixels(t,e,i,n,a.RGBA,a.UNSIGNED_BYTE,s)},i.setClearDepth=function(t){t!==this.clearDepth&&(this.gl.clearDepth(t),this.clearDepth=t)},i.setClearColor=function(t,e,i,n){t===this.clearRed&&e===this.clearGreen&&i===this.clearBlue&&n===this.clearAlpha||(this.gl.clearColor(t,e,i,n),this.clearRed=t,this.clearGreen=e,this.clearBlue=i,this.clearAlpha=n)},i.setClearStencil=function(t){t!==this.clearStencil&&(this.gl.clearStencil(t),this.clearStencil=t)},i.getDepthTest=function(){return this.depthTest},i.setDepthTest=function(t){if(this.depthTest!==t){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.depthTest=t}},i.setDepthFunc=function(t){this.depthFunc!==t&&(this.gl.depthFunc(this.glComparison[t]),this.depthFunc=t)},i.getDepthWrite=function(){return this.depthWrite},i.setDepthWrite=function(t){this.depthWrite!==t&&(this.gl.depthMask(t),this.depthWrite=t)},i.setColorWrite=function(t,e,i,n){this.writeRed===t&&this.writeGreen===e&&this.writeBlue===i&&this.writeAlpha===n||(this.gl.colorMask(t,e,i,n),this.writeRed=t,this.writeGreen=e,this.writeBlue=i,this.writeAlpha=n)},i.setAlphaToCoverage=function(t){this.webgl2&&this.alphaToCoverage!==t&&(this.alphaToCoverage=t,t?this.gl.enable(this.gl.SAMPLE_ALPHA_TO_COVERAGE):this.gl.disable(this.gl.SAMPLE_ALPHA_TO_COVERAGE))},i.setTransformFeedbackBuffer=function(t){if(this.transformFeedbackBuffer!==t&&(this.transformFeedbackBuffer=t,this.webgl2)){var e=this.gl;t?(this.feedback||(this.feedback=e.createTransformFeedback()),e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,this.feedback)):e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null)}},i.setRaster=function(t){this.raster!==t&&(this.raster=t,this.webgl2&&(t?this.gl.disable(this.gl.RASTERIZER_DISCARD):this.gl.enable(this.gl.RASTERIZER_DISCARD)))},i.setDepthBias=function(t){this.depthBiasEnabled!==t&&(this.depthBiasEnabled=t,t?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL))},i.setDepthBiasValues=function(t,e){this.gl.polygonOffset(e,t)},i.getBlending=function(){return this.blending},i.setBlending=function(t){if(this.blending!==t){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.blending=t}},i.setStencilTest=function(t){if(this.stencil!==t){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.stencil=t}},i.setStencilFunc=function(t,e,i){this.stencilFuncFront===t&&this.stencilRefFront===e&&this.stencilMaskFront===i&&this.stencilFuncBack===t&&this.stencilRefBack===e&&this.stencilMaskBack===i||(this.gl.stencilFunc(this.glComparison[t],e,i),this.stencilFuncFront=this.stencilFuncBack=t,this.stencilRefFront=this.stencilRefBack=e,this.stencilMaskFront=this.stencilMaskBack=i)},i.setStencilFuncFront=function(t,e,i){if(this.stencilFuncFront!==t||this.stencilRefFront!==e||this.stencilMaskFront!==i){var n=this.gl;n.stencilFuncSeparate(n.FRONT,this.glComparison[t],e,i),this.stencilFuncFront=t,this.stencilRefFront=e,this.stencilMaskFront=i}},i.setStencilFuncBack=function(t,e,i){if(this.stencilFuncBack!==t||this.stencilRefBack!==e||this.stencilMaskBack!==i){var n=this.gl;n.stencilFuncSeparate(n.BACK,this.glComparison[t],e,i),this.stencilFuncBack=t,this.stencilRefBack=e,this.stencilMaskBack=i}},i.setStencilOperation=function(t,e,i,n){this.stencilFailFront===t&&this.stencilZfailFront===e&&this.stencilZpassFront===i&&this.stencilFailBack===t&&this.stencilZfailBack===e&&this.stencilZpassBack===i||(this.gl.stencilOp(this.glStencilOp[t],this.glStencilOp[e],this.glStencilOp[i]),this.stencilFailFront=this.stencilFailBack=t,this.stencilZfailFront=this.stencilZfailBack=e,this.stencilZpassFront=this.stencilZpassBack=i),this.stencilWriteMaskFront===n&&this.stencilWriteMaskBack===n||(this.gl.stencilMask(n),this.stencilWriteMaskFront=n,this.stencilWriteMaskBack=n)},i.setStencilOperationFront=function(t,e,i,n){this.stencilFailFront===t&&this.stencilZfailFront===e&&this.stencilZpassFront===i||(this.gl.stencilOpSeparate(this.gl.FRONT,this.glStencilOp[t],this.glStencilOp[e],this.glStencilOp[i]),this.stencilFailFront=t,this.stencilZfailFront=e,this.stencilZpassFront=i),this.stencilWriteMaskFront!==n&&(this.gl.stencilMaskSeparate(this.gl.FRONT,n),this.stencilWriteMaskFront=n)},i.setStencilOperationBack=function(t,e,i,n){this.stencilFailBack===t&&this.stencilZfailBack===e&&this.stencilZpassBack===i||(this.gl.stencilOpSeparate(this.gl.BACK,this.glStencilOp[t],this.glStencilOp[e],this.glStencilOp[i]),this.stencilFailBack=t,this.stencilZfailBack=e,this.stencilZpassBack=i),this.stencilWriteMaskBack!==n&&(this.gl.stencilMaskSeparate(this.gl.BACK,n),this.stencilWriteMaskBack=n)},i.setBlendFunction=function(t,e){(this.blendSrc!==t||this.blendDst!==e||this.separateAlphaBlend)&&(this.gl.blendFunc(this.glBlendFunction[t],this.glBlendFunction[e]),this.blendSrc=t,this.blendDst=e,this.separateAlphaBlend=!1)},i.setBlendFunctionSeparate=function(t,e,i,n){this.blendSrc===t&&this.blendDst===e&&this.blendSrcAlpha===i&&this.blendDstAlpha===n&&this.separateAlphaBlend||(this.gl.blendFuncSeparate(this.glBlendFunction[t],this.glBlendFunction[e],this.glBlendFunction[i],this.glBlendFunction[n]),this.blendSrc=t,this.blendDst=e,this.blendSrcAlpha=i,this.blendDstAlpha=n,this.separateAlphaBlend=!0)},i.setBlendEquation=function(t){(this.blendEquation!==t||this.separateAlphaEquation)&&(this.gl.blendEquation(this.glBlendEquation[t]),this.blendEquation=t,this.separateAlphaEquation=!1)},i.setBlendEquationSeparate=function(t,e){this.blendEquation===t&&this.blendAlphaEquation===e&&this.separateAlphaEquation||(this.gl.blendEquationSeparate(this.glBlendEquation[t],this.glBlendEquation[e]),this.blendEquation=t,this.blendAlphaEquation=e,this.separateAlphaEquation=!0)},i.setCullMode=function(t){if(this.cullMode!==t){if(0===t)this.gl.disable(this.gl.CULL_FACE);else{0===this.cullMode&&this.gl.enable(this.gl.CULL_FACE);var e=this.glCull[t];this.cullFace!==e&&(this.gl.cullFace(e),this.cullFace=e)}this.cullMode=t}},i.getCullMode=function(){return this.cullMode},i.setIndexBuffer=function(t){this.indexBuffer=t},i.setVertexBuffer=function(t){t&&this.vertexBuffers.push(t)},i.setShader=function(t){if(t!==this.shader){if(t.failed)return!1;if(!t.ready&&!t.impl.postLink(this,t))return t.failed=!0,!1;this.shader=t,this.gl.useProgram(t.impl.glProgram),this.attributesInvalidated=!0}return!0},i.getHdrFormat=function(){return this.textureHalfFloatRenderable?$t:this.textureFloatRenderable?Jt:7},i.getBoneLimit=function(){return this.boneLimit},i.setBoneLimit=function(t){this.boneLimit=t},i.clearShaderCache=function(){var t=this.gl;for(var e in this.fragmentShaderCache)t.deleteShader(this.fragmentShaderCache[e]),delete this.fragmentShaderCache[e];for(var i in this.vertexShaderCache)t.deleteShader(this.vertexShaderCache[i]),delete this.vertexShaderCache[i];this.programLib.clearCache()},i.clearVertexArrayObjectCache=function(){var t=this.gl;this._vaoMap.forEach((function(e,i,n){t.deleteVertexArray(e)})),this._vaoMap.clear()},i.removeShaderFromCache=function(t){this.programLib.removeFromCache(t)},W(e,[{key:"width",get:function(){return this.gl.drawingBufferWidth||this.canvas.width}},{key:"height",get:function(){return this.gl.drawingBufferHeight||this.canvas.height}},{key:"fullscreen",get:function(){return!!document.fullscreenElement},set:function(t){t?this.gl.canvas.requestFullscreen():document.exitFullscreen()}},{key:"textureFloatHighPrecision",get:function(){return void 0===this._textureFloatHighPrecision&&(this._textureFloatHighPrecision=function(t){if(!t.textureFloatRenderable)return!1;var e=vi(t,ri.fullscreenQuadVS,ri.precisionTestPS,"ptest1"),i=vi(t,ri.fullscreenQuadVS,ri.precisionTest2PS,"ptest2"),n={format:Jt,width:1,height:1,mipmaps:!1,minFilter:0,magFilter:0},s=new Di(t,n);s.name="testFHP";var a=new _s({colorBuffer:s,depth:!1});si(t,a,e),n.format=7;var r=new Di(t,n);r.name="testFHP";var o=new _s({colorBuffer:r,depth:!1});t.constantTexSource.setValue(s),si(t,o,i);var h=t.activeFramebuffer;t.setFramebuffer(o._glFrameBuffer);var l=new Uint8Array(4);t.readPixels(0,0,1,1,l),t.setFramebuffer(h);var c=l[0]/255/16777216+l[1]/255/65536+l[2]/255/256+l[3]/255;return s.destroy(),a.destroy(),r.destroy(),o.destroy(),0===c}(this)),this._textureFloatHighPrecision}},{key:"textureHalfFloatUpdatable",get:function(){return void 0===this._textureHalfFloatUpdatable&&(this.webgl2?this._textureHalfFloatUpdatable=!0:this._textureHalfFloatUpdatable=function(t,e){var i=!0,n=t.createTexture();t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE);var s=new Uint16Array(16);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,2,2,0,t.RGBA,e,s),t.getError()!==t.NO_ERROR&&(i=!1,console.log("Above error related to HALF_FLOAT_OES can be ignored, it was triggered by testing half float texture support")),t.bindTexture(t.TEXTURE_2D,null),t.deleteTexture(n),i}(this.gl,this.extTextureHalfFloat.HALF_FLOAT_OES)),this._textureHalfFloatUpdatable}}]),e}(ps),Zs=function(){function t(){this._refCount=0}var e=t.prototype;return e.incRefCount=function(){this._refCount++},e.decRefCount=function(){this._refCount--},W(t,[{key:"refCount",get:function(){return this._refCount}}]),t}();function $s(){return Ys}function Qs(t){Ys=t}var Js=0,ta=function(){function t(){this.initDefaults()}var e=t.prototype;return e.initDefaults=function(){this.recreate=!1,this.verticesUsage=0,this.indicesUsage=0,this.maxVertices=0,this.maxIndices=0,this.vertexCount=0,this.indexCount=0,this.vertexStreamsUpdated=!1,this.indexStreamUpdated=!1,this.vertexStreamDictionary={},this.indices=null},e._changeVertexCount=function(t,e){this.vertexCount||(this.vertexCount=t)},t}();ta.DEFAULT_COMPONENTS_POSITION=3,ta.DEFAULT_COMPONENTS_NORMAL=3,ta.DEFAULT_COMPONENTS_UV=2,ta.DEFAULT_COMPONENTS_COLORS=4;var ea=function(t,e,i,n){this.data=t,this.componentCount=e,this.dataType=i,this.dataTypeNormalize=n},ia=function(t){function e(e){var i;return(i=t.call(this)||this).id=Js++,i.device=e||$s().graphicsDevice,i.vertexBuffer=null,i.indexBuffer=[null],i.primitive=[{type:0,base:0,count:0}],i.skin=null,i._morph=null,i._geometryData=null,i._aabb=new At,i.boneAabb=null,i}H(e,t);var i=e.prototype;return i.destroy=function(){var t=this.morph;t&&(this.morph=null,t.refCount<1&&t.destroy()),this.vertexBuffer&&(this.vertexBuffer.destroy(),this.vertexBuffer=null);for(var e=0;e0){var b=g.array[g.index+x];if(u[b]=!0,e=m.array[m.index],i=m.array[m.index+1],n=m.array[m.index+2],s=c[b],(a=l[b]).x>e&&(a.x=e),a.y>i&&(a.y=i),a.z>n&&(a.z=n),s.xS&&(a.x=S),a.y>w&&(a.y=w),a.z>T&&(a.z=T),s.x0&&this.indexBuffer[0]&&(this._geometryData.indexCount=this.indexBuffer[0].numIndices,this._geometryData.maxIndices=this.indexBuffer[0].numIndices))},i.clear=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this._initGeometryData(),this._geometryData.initDefaults(),this._geometryData.recreate=!0,this._geometryData.maxVertices=i,this._geometryData.maxIndices=n,this._geometryData.verticesUsage=t?0:1,this._geometryData.indicesUsage=e?0:1},i.setVertexStream=function(t,e,i,n,s,a){void 0===s&&(s=6),void 0===a&&(a=!1),this._initGeometryData();var r=n||e.length/i;this._geometryData._changeVertexCount(r,t),this._geometryData.vertexStreamsUpdated=!0,this._geometryData.vertexStreamDictionary[t]=new ea(e,i,s,a)},i.getVertexStream=function(t,e){var i=0,n=!1;if(this._geometryData){var s=this._geometryData.vertexStreamDictionary[t];s&&(n=!0,i=this._geometryData.vertexCount,ArrayBuffer.isView(e)?e.set(s.data):(e.length=0,e.push(s.data)))}n||this.vertexBuffer&&(i=new Ds(this.vertexBuffer).readData(t,e));return i},i.setPositions=function(t,e,i){void 0===e&&(e=ta.DEFAULT_COMPONENTS_POSITION),this.setVertexStream(ae,t,e,i,6,!1)},i.setNormals=function(t,e,i){void 0===e&&(e=ta.DEFAULT_COMPONENTS_NORMAL),this.setVertexStream(re,t,e,i,6,!1)},i.setUvs=function(t,e,i,n){void 0===i&&(i=ta.DEFAULT_COMPONENTS_UV),this.setVertexStream(ue+t,e,i,n,6,!1)},i.setColors=function(t,e,i){void 0===e&&(e=ta.DEFAULT_COMPONENTS_COLORS),this.setVertexStream(ce,t,e,i,6,!1)},i.setColors32=function(t,e){this.setVertexStream(ce,t,ta.DEFAULT_COMPONENTS_COLORS,e,1,!0)},i.setIndices=function(t,e){this._initGeometryData(),this._geometryData.indexStreamUpdated=!0,this._geometryData.indices=t,this._geometryData.indexCount=e||t.length},i.getPositions=function(t){return this.getVertexStream(ae,t)},i.getNormals=function(t){return this.getVertexStream(re,t)},i.getUvs=function(t,e){return this.getVertexStream(ue+t,e)},i.getColors=function(t){return this.getVertexStream(ce,t)},i.getIndices=function(t){var e=0;if(this._geometryData&&this._geometryData.indices){var i=this._geometryData.indices;e=this._geometryData.indexCount,ArrayBuffer.isView(t)?t.set(i):(t.length=0,t.push(i))}else{if(this.indexBuffer.length>0&&this.indexBuffer[0])e=this.indexBuffer[0].readData(t)}return e},i.update=function(t,e){if(void 0===t&&(t=4),void 0===e&&(e=!0),this._geometryData){if(e){var i=this._geometryData.vertexStreamDictionary.POSITION;i&&3===i.componentCount&&this._aabb.compute(i.data,this._geometryData.vertexCount)}var n=this._geometryData.recreate;this._geometryData.vertexCount>this._geometryData.maxVertices&&(n=!0,this._geometryData.maxVertices=this._geometryData.vertexCount),n&&this.vertexBuffer&&(this.vertexBuffer.destroy(),this.vertexBuffer=null);var s=this._geometryData.recreate;this._geometryData.indexCount>this._geometryData.maxIndices&&(s=!0,this._geometryData.maxIndices=this._geometryData.indexCount),s&&this.indexBuffer.length>0&&this.indexBuffer[0]&&(this.indexBuffer[0].destroy(),this.indexBuffer[0]=null),this._geometryData.vertexStreamsUpdated&&this._updateVertexBuffer(),this._geometryData.indexStreamUpdated&&this._updateIndexBuffer(),this.primitive[0].type=t,this.indexBuffer.length>0&&this.indexBuffer[0]?this._geometryData.indexStreamUpdated&&(this.primitive[0].count=this._geometryData.indexCount,this.primitive[0].indexed=!0):this._geometryData.vertexStreamsUpdated&&(this.primitive[0].count=this._geometryData.vertexCount,this.primitive[0].indexed=!1),this._geometryData.vertexCount=0,this._geometryData.indexCount=0,this._geometryData.vertexStreamsUpdated=!1,this._geometryData.indexStreamUpdated=!1,this._geometryData.recreate=!1,this.updateRenderStates()}},i._buildVertexFormat=function(t){var e=[];for(var i in this._geometryData.vertexStreamDictionary){var n=this._geometryData.vertexStreamDictionary[i];e.push({semantic:i,components:n.componentCount,type:n.dataType,normalize:n.dataTypeNormalize})}return new ti(this.device,e,t)},i._updateVertexBuffer=function(){if(!this.vertexBuffer){var t=this._geometryData.maxVertices,e=this._buildVertexFormat(t);this.vertexBuffer=new Qe(this.device,e,t,this._geometryData.verticesUsage)}var i=new Ds(this.vertexBuffer),n=this._geometryData.vertexCount;for(var s in this._geometryData.vertexStreamDictionary){var a=this._geometryData.vertexStreamDictionary[s];i.writeData(s,a.data,n),delete this._geometryData.vertexStreamDictionary[s]}i.end()},i._updateIndexBuffer=function(){if(this.indexBuffer.length<=0||!this.indexBuffer[0]){var t=this._geometryData.maxVertices>65535?2:1;this.indexBuffer[0]=new ys(this.device,t,this._geometryData.maxIndices,this._geometryData.indicesUsage)}var e=this._geometryData.indices;e&&(this.indexBuffer[0].writeData(e,this._geometryData.indexCount),this._geometryData.indices=null)},i.prepareRenderState=function(t){1===t?this.generateWireframe():2===t&&(this.primitive[2]={type:0,base:0,count:this.vertexBuffer?this.vertexBuffer.numVertices:0,indexed:!1})},i.updateRenderStates=function(){this.primitive[2]&&this.prepareRenderState(2),this.primitive[1]&&this.prepareRenderState(1)},i.generateWireframe=function(){this._destroyIndexBuffer(1);var t,e=[];if(this.indexBuffer.length>0&&this.indexBuffer[0]){for(var i=[[0,1],[1,2],[2,0]],n=this.primitive[0].base,s=this.primitive[0].count,a=this.indexBuffer[0],r=new Ye[a.format](a.storage),o={},h=n;hu?u<<16|c:c<<16|u;void 0===o[d]&&(o[d]=0,e.push(c,u))}t=a.format}else{for(var f=0;f65535?2:1}var p=new ys(this.vertexBuffer.device,t,e.length);new Ye[p.format](p.storage).set(e),p.unlock(),this.primitive[1]={type:1,base:0,count:e.length,indexed:!0},this.indexBuffer[1]=p},W(e,[{key:"morph",get:function(){return this._morph},set:function(t){t!==this._morph&&(this._morph&&this._morph.decRefCount(),this._morph=t,t&&t.incRefCount())}},{key:"aabb",get:function(){return this._aabb},set:function(t){this._aabb=t}}]),e}(Zs),na=4/64,sa=.875,aa=[];function ra(t,e){for(var i=e.length/3,n=t.length/3,s=new lt,a=new lt,r=new lt,o=new lt,h=new lt,l=new lt,c=[],u=0;u0)for(var v=0;v<=n;v++)for(var y=0;y<=s;y++){var x=y/s*2*Math.PI-Math.PI,b=Math.sin(x),S=Math.cos(x);u.set(b*t,-i/2,S*t),c.set(b*e,i/2,S*e),o.lerp(u,c,v/n),h.sub2(c,u).normalize(),d.set(S,0,-b),l.cross(d,h).normalize(),f.push(o.x,o.y,o.z),p.push(l.x,l.y,l.z);var w=y/s,T=v/n;m.push(w,1-T);var A=T;if(T=w,w=(w=A)*sa+na,T=T*sa+na,w/=3,_.push(w,1-T),v0)for(var dt=0;dt1&&g.push(r,r+dt,r+dt-1)}if(r+=s,e>0)for(var yt=0;yt1&&g.push(r,r+yt-1,r+yt)}}return{positions:f,normals:p,uvs:m,uvs1:_,indices:g}}function ua(t,e){var i=e&&(e.radius||e.baseRadius);i=void 0!==i?i:.5;var n=e&&void 0!==e.height?e.height:1,s=e&&void 0!==e.heightSegments?e.heightSegments:5,a=e&&void 0!==e.capSegments?e.capSegments:20,r=!(!e||void 0===e.calculateTangents)&&e.calculateTangents,o=ca(i,i,n,s,a,!1);return r&&(o.tangents=oa(o.positions,o.normals,o.uvs,o.indices)),ha(t,o.positions,o)}function da(t,e){var i=e&&void 0!==e.radius?e.radius:.3,n=e&&void 0!==e.height?e.height:1,s=e&&void 0!==e.heightSegments?e.heightSegments:1,a=e&&void 0!==e.sides?e.sides:20,r=!(!e||void 0===e.calculateTangents)&&e.calculateTangents,o=ca(i,i,n-2*i,s,a,!0);return r&&(o.tangents=oa(o.positions,o.normals,o.uvs,o.indices)),ha(t,o.positions,o)}function fa(t,e){var i=e&&void 0!==e.baseRadius?e.baseRadius:.5,n=e&&void 0!==e.peakRadius?e.peakRadius:0,s=e&&void 0!==e.height?e.height:1,a=e&&void 0!==e.heightSegments?e.heightSegments:5,r=e&&void 0!==e.capSegments?e.capSegments:18,o=!(!e||void 0===e.calculateTangents)&&e.calculateTangents,h=ca(i,n,s,a,r,!1);return o&&(h.tangents=oa(h.positions,h.normals,h.uvs,h.indices)),ha(t,h.positions,h)}function pa(t,e){for(var i=e&&void 0!==e.radius?e.radius:.5,n=e&&void 0!==e.latitudeBands?e.latitudeBands:16,s=e&&void 0!==e.longitudeBands?e.longitudeBands:16,a=!(!e||void 0===e.calculateTangents)&&e.calculateTangents,r=[],o=[],h=[],l=[],c=0;c<=n;c++)for(var u=c*Math.PI/n,d=Math.sin(u),f=Math.cos(u),p=0;p<=s;p++){var m=2*p*Math.PI/s-Math.PI/2,_=Math.sin(m),g=Math.cos(m)*d,v=f,y=_*d,x=1-p/s,b=1-c/n;r.push(g*i,v*i,y*i),o.push(g,v,y),h.push(x,1-b)}for(var S=0;S=0;i--)this.matrices[i].mulAffine2(ba,this.bones[i].getWorldTransform()),this.matrices[i].mulAffine2(this.matrices[i],this.skin.inverseBindPose[i])}},e.updateMatrices=function(t,e){this._updateBeforeCull&&this._updateMatrices(t,e)},e.updateMatrixPalette=function(t,e){this._updateMatrices(t,e);for(var i=this.matrixPalette,n=this.bones.length,s=0;s>16},set:function(t){var e=65535&this._shaderDefs;this._shaderDefs=e|t<<16,this._shader[0]=null,this._shader[1]=null}},{key:"instancingCount",get:function(){return this.instancingData?this.instancingData.count:0},set:function(t){this.instancingData&&(this.instancingData.count=t)}}]),t}();function Da(t,e,i,n){return(15&t)<<27|(3===e?1:0)<<26|(i?1:0)<<25|(33554431&n)<<0}function ka(t,e){if(t&&!e)return!1;if(!t&&e)return!1;if((t=t.data)===(e=e.data))return!0;if(t instanceof Float32Array&&e instanceof Float32Array){if(t.length!==e.length)return!1;for(var i=0;i=0?1:-1}var Wa=function(){function t(t,e,i){this.device=t,this.rootNode=e,this.scene=i,this._init=!1,this._batchGroups={},this._batchGroupCounter=0,this._batchList=[],this._dirtyGroups=[]}var e=t.prototype;return e.destroy=function(){this.device=null,this.rootNode=null,this.scene=null,this._batchGroups={},this._batchList=[],this._dirtyGroups=[]},e.addGroup=function(t,e,i,n,s){if(void 0===n&&(n=this._batchGroupCounter,this._batchGroupCounter++),!this._batchGroups[n]){var a=new xa(n,t,e,i,s);return this._batchGroups[n]=a,a}},e.removeGroup=function(t){if(this._batchGroups[t]){for(var e=[],i=0;i=0&&(n._obj[t].splice(s,1),this.markGroupDirty(e))}},e._extractRender=function(t,e,i,n){if(t.render){if(t.render.isStatic){for(var s=this.scene.drawCalls,a=t.render.meshInstances,r=0;r=0&&e.push(a[o])}else e=n[t.render.batchGroupId]=e.concat(t.render.meshInstances);t.render.removeFromLayers()}return e},e._extractModel=function(t,e,i,n){if(t.model&&t.model.model){if(t.model.isStatic){for(var s=this.scene.drawCalls,a=t.model.meshInstances,r=0;r=0&&e.push(a[o])}else e=n[t.model.batchGroupId]=e.concat(t.model.meshInstances);t.model.removeModelFromLayers()}return e},e._extractElement=function(t,e,i){if(t.element){var n=!1;t.element._text&&t.element._text._model.meshInstances.length>0?(e.push(t.element._text._model.meshInstances[0]),t.element.removeModelFromLayers(t.element._text._model),n=!0):t.element._image&&(e.push(t.element._image._renderable.meshInstance),t.element.removeModelFromLayers(t.element._image._renderable.model),t.element._image._renderable.unmaskMeshInstance&&(e.push(t.element._image._renderable.unmaskMeshInstance),t.element._image._renderable.unmaskMeshInstance.stencilFront&&t.element._image._renderable.unmaskMeshInstance.stencilBack||(t.element._dirtifyMask(),t.element._onPrerender())),n=!0),n&&(i._ui=!0)}},e._collectAndRemoveMeshInstances=function(t,e){for(var i=0;i0;){u[d]=[p[0]],f=[];var _=p[0].material,g=p[0].layer,v=p[0]._shaderDefs,y=p[0].parameters,x=p[0].stencilFront,b=p[0]._staticLightList,S=p[0].mesh.vertexBuffer.getNumVertices(),w=p[0].drawOrder;h.copy(p[0].aabb);var T=Va(p[0]),A=p[0].mesh.vertexBuffer.format.batchingHash,M=p[0].mesh.primitive[0].indexed;c=null;for(var C=1;C=r){f=f.concat(p.slice(C));break}if(_!==E.material||g!==E.layer||A!==E.mesh.vertexBuffer.format.batchingHash||M!==E.mesh.primitive[0].indexed||v!==E._shaderDefs||S+E.mesh.vertexBuffer.getNumVertices()>o)m(E);else if(l.copy(h),l.add(E.aabb),l.halfExtents.x>a||l.halfExtents.y>a||l.halfExtents.z>a)m(E);else if(!x||(s=E.stencilFront)&&x.func===s.func&&x.zpass===s.zpass)if(T===Va(E))if(Oa(y,E.parameters)){var P=E._staticLightList;if(b&&P){if(!Fa(b,P)){m(E);continue}}else if(b||P){m(E);continue}n&&c&&c.intersects(E.aabb)&&E.drawOrder!==w?m(E):(h.add(E.aabb),S+=E.mesh.vertexBuffer.getNumVertices(),u[d].push(E))}else m(E);else m(E);else m(E)}d++,p=f}return u},e.collectBatchedMeshData=function(t,e){for(var i=null,n=0,s=0,a=null,r=0;r=3)if(s===ae)for(var A=0;A0&&a.setIndices(b),a.update(4,!1),e&&((p=p.clone()).chunks.transformVS=this.transformVS,p.chunks.skinTexVS=this.skinTexVS,p.chunks.skinConstVS=this.skinConstVS,p.update());var R=new La(a,p,this.rootNode);R.castShadow=h.origMeshInstances[0].castShadow,R.parameters=h.origMeshInstances[0].parameters,R.isStatic=h.origMeshInstances[0].isStatic,R.layer=h.origMeshInstances[0].layer,R._staticLightList=h.origMeshInstances[0]._staticLightList,R._shaderDefs=h.origMeshInstances[0]._shaderDefs,R.cull=h.origMeshInstances[0].cull;var I=this._batchGroups[i];if(I&&I._ui&&(R.cull=!1),e){for(var L=[],D=0;D0&&this.generate(this._dirtyGroups);for(var t=0;t0&&r){if(!(n1){e.copy(t[1].min),i.copy(t[1].max);for(var n=2;n1?this.shaderCube:this.shader2d,a=this.device;n>1&&this.initInvViewProjMatrices(),this.blitTextureId.setValue(e.cookie);for(var r=0;r1){var o=Za.z/3,h=this.lightTextureAtlas.cubeSlotsOffsets[r];Za.x+=o*h.x,Za.y+=o*h.y,Za.z=o,Za.w=o,this.invViewProjId.setValue(t._invViewProjMatrices[r].data)}Za.mulScalar(i.colorBuffer.width),si(a,i,s,Za)}}},W(t,[{key:"shader2d",get:function(){return this.getShader("blitShader2d","\n\t\tvarying vec2 uv0;\n\t\tuniform sampler2D blitTexture;\n\t\tvoid main(void) {\n\t\t\t\tgl_FragColor = texture2D(blitTexture, uv0);\n\t\t}")}},{key:"shaderCube",get:function(){return this.getShader("blitShaderCube","\n\t\tvarying vec2 uv0;\n\t\tuniform samplerCube blitTexture;\n\t\tuniform mat4 invViewProj;\n\t\tvoid main(void) {\n\t\t\t\tvec4 projPos = vec4(uv0 * 2.0 - 1.0, 0.5, 1.0);\n\t\t\t\tvec4 worldPos = invViewProj * projPos;\n\t\t\t\tgl_FragColor = textureCube(blitTexture, worldPos.xyz);\n\t\t}")}}]),t}();$a._invViewProjMatrices=null;var Qa=function(){function t(t,e){this.texture=t,this.cached=!1,this.renderTargets=e}return t.prototype.destroy=function(){this.texture&&(this.texture.destroy(),this.texture=null);for(var t=this.renderTargets,e=0;e1)for(var h=1/o,l=0;l1)for(var f=0;f0){for(var s=this.slots,a=0;as&&(s=r)}return or.min=n,or.max=s,or}function lr(t,e){return Math.exp(-t*t/(2*e*e))}var cr=new At,ur=new vt,dr=new vt,fr=new Float32Array(2),pr=new dt(1,1,0,0),mr={r:1,g:2,b:3,a:4},_r=new lt,gr=new vt;function vr(t){var e=t.material,i=t.skinInstance?10:0,n=0;if(e.opacityMap){var s=e.opacityMapChannel;s&&(n=mr[s])}return i+n}var yr=function(){function t(t,e){this.device=t.device,this.forwardRenderer=t,this.lightTextureAtlas=e;var i=this.device.scope;this.polygonOffsetId=i.resolve("polygonOffset"),this.polygonOffset=new Float32Array(2),this.sourceId=i.resolve("source"),this.pixelOffsetId=i.resolve("pixelOffset"),this.weightId=i.resolve("weight[0]"),this.blurVsmShaderCode=[ri.blurVSMPS,"#define GAUSS\n"+ri.blurVSMPS];var n="#define PACKED\n";this.blurPackedVsmShaderCode=[n+this.blurVsmShaderCode[0],n+this.blurVsmShaderCode[1]],this.blurVsmShader=[{},{}],this.blurPackedVsmShader=[{},{}],this.blurVsmWeights={},this.shadowMapLightRadiusId=i.resolve("light_radius"),this.shadowMapCache=new ar}var e=t.prototype;return e.destroy=function(){this.shadowMapCache.destroy(),this.shadowMapCache=null},t.createShadowCamera=function(t,e,i,n){var s=an.create("ShadowCamera",i,n);return s.clearColor=e>=1&&e<=3?new at(0,0,0,0):new at(1,1,1,1),s.clearDepthBuffer=!0,s.clearStencilBuffer=!1,s},t.setShadowCameraSettings=function(t,e,i,n,s){var a=4===i||0===i&&e.webgl2;1!==n||s||(a=!1),t.clearColorBuffer=!a},e.cullShadowCasters=function(t,e,i){for(var n=0,s=t.length,a=0;ap&&(p=_)}var g=o.right,v=o.up,y=o.forward,x=.25*t._shadowResolution/p,b=Math.ceil(_r.dot(v)*x)/x,S=Math.ceil(_r.dot(g)*x)/x,w=v.mulScalar(b),T=g.mulScalar(S),A=_r.dot(y),M=y.mulScalar(A);_r.add2(w,T).add(M),o.setPosition(_r),o.translateLocal(0,0,1e6),r.nearClip=0,r.farClip=2e6,r.orthoHeight=p,this.forwardRenderer.updateCameraFrustum(r),this.cullShadowCasters(e,a.visibleCasters,r);for(var C=!0,E=a.visibleCasters,P=0;P1)this.forwardRenderer.scene.clusteredLightingEnabled&&0!==s||this.applyVsmBlur(e,i);this.restoreRenderState(n)}},e.getVsmBlurShader=function(t,e,i){var n=(t?this.blurPackedVsmShader:this.blurVsmShader)[e][i];if(!n){this.blurVsmWeights[i]=function(t){t>25&&(t=25);for(var e=(t-1)/6,i=.5*(t-1),n=new Array(t),s=0,a=0;aU&&(U=H),X>z&&(z=X),q>V&&(V=q)}var j=6*O;p[j]=F,p[j+1]=B,p[j+2]=N,p[j+3]=U,p[j+4]=z,p[j+5]=V}for(var Y=0;Y=Z.x&&p[tt+1]<=$.y&&p[tt+4]>=Z.y&&p[tt+2]<=$.z&&p[tt+5]>=Z.z&&(d[J]|=Q,k=!0)}}if(k){for(var et={},it=0;itft&&(ft=yt),xt>pt&&(pt=xt),bt>mt&&(mt=bt)}h.set(ct,ut,dt),l.set(ft,pt,mt);var St=new At;St.setMinMax(h,l);var wt=new ia(e);wt.vertexBuffer=w,wt.indexBuffer[0]=ht,wt.primitive[0].type=4,wt.primitive[0].base=0,wt.primitive[0].count=ot.length,wt.primitive[0].indexed=!0,wt.aabb=St;var Tt=new La(wt,g.material,g.node);Tt.isStatic=g.isStatic,Tt.visible=g.visible,Tt.layer=g.layer,Tt.castShadow=g.castShadow,Tt._receiveShadow=g._receiveShadow,Tt.cull=g.cull,Tt.pick=g.pick,Tt.mask=g.mask,Tt.parameters=g.parameters,Tt._shaderDefs=g._shaderDefs,Tt._staticSource=g,g._staticLightList?Tt._staticLightList=g._staticLightList:Tt._staticLightList=[];for(var Mt=0;Mt0&&(this._instancedDrawCalls++,t.setVertexBuffer(Mr.vertexBuffer),t.draw(i.primitive[n],Mr.count)):(Cr=e.node.worldTransform,this.modelMatrixId.setValue(Cr.data),s&&(Er=e.node.normalMatrix,e.node._dirtyNormal&&(Cr.invertTo3x3(Er),Er.transpose(),e.node._dirtyNormal=!1),this.normalMatrixId.setValue(Er.data)),t.draw(i.primitive[n]))},e.drawInstance2=function(t,e,i,n){(Mr=e.instancingData)?Mr.count>0&&(this._instancedDrawCalls++,t.draw(i.primitive[n],Mr.count,!0)):t.draw(i.primitive[n],void 0,!0)},e.renderShadows=function(t,e){var i=this.scene.clusteredLightingEnabled,n=this.device;n.grabPassAvailable=!1;for(var s=0;s0&&n.cull<3){i.flipFaces&&(a*=-1),e&&(a*=-1);var r=i.node.worldTransform;r.getX(Qr),r.getY(Jr),r.getZ(to),Qr.cross(Qr,Jr),Qr.dot(to)<0&&(a*=-1)}s=a<0?2===n.cull?1:2:n.cull}if(this.device.setCullMode(s),0===s&&0===n.cull){var o=i.node.worldTransform;o.getX(Qr),o.getY(Jr),o.getZ(to),Qr.cross(Qr,Jr),Qr.dot(to)<0?this.twoSidedLightingNegScaleFactorId.setValue(-1):this.twoSidedLightingNegScaleFactorId.setValue(1)}},e.setVertexBuffers=function(t,e){t.setVertexBuffer(e.vertexBuffer)},e.setMorphing=function(t,e){if(e)if(e.morph.useTextureMorph)t.setVertexBuffer(e.morph.vertexBufferIds),this.morphPositionTex.setValue(e.texturePositions),this.morphNormalTex.setValue(e.textureNormals),this.morphTexParams.setValue(e._textureParams);else{for(var i=0;i0&&this.renderShadows(h.directionalLights,f.camera),c.enabled&&t.subLayerEnabled[l]){if(f&&(f.frameBegin(h.renderTarget),h.firstCameraUse&&f.onPreRender&&f.onPreRender()),!u&&c.onPreRenderOpaque?c.onPreRenderOpaque(d):u&&c.onPreRenderTransparent&&c.onPreRenderTransparent(d),c._preRenderCalledForCameras&1<=0&&r._shaderVersion!==i&&(r.updateShader!==Xn.prototype.updateShader&&(r.clearVariants(),r.shader=null),r._shaderVersion=i)}this.passThrough||(this._dirty=!0)},e.removeMeshInstanceFromArray=function(t,e){for(var i=-1,n=0,s=e.length,a=0;a=0)break}i>=0&&e.splice(i,n)},e.removeMeshInstances=function(t,e){for(var i=this.opaqueMeshInstances,n=this.transparentMeshInstances,s=this.shadowCasters,a=0;a=0&&s.splice(o,1)}}this._dirty=!0},e.clearMeshInstances=function(t){(0!==this.opaqueMeshInstances.length||0!==this.transparentMeshInstances.length||!t&&0!==this.shadowCasters.length)&&(this.opaqueMeshInstances.length=0,this.transparentMeshInstances.length=0,t||(this.shadowCasters.length=0),this.passThrough||(this._dirty=!0))},e.addLight=function(t){var e=t.light;this._lightsSet.has(e)||(this._lightsSet.add(e),0!==e.type&&this._clusteredLightsSet.add(e),this._lights.push(e),this._dirtyLights=!0,this._generateLightHash())},e.removeLight=function(t){var e=t.light;this._lightsSet.has(e)&&(this._lightsSet.delete(e),0!==e.type&&this._clusteredLightsSet.delete(e),this._lights.splice(this._lights.indexOf(e),1),this._dirtyLights=!0,this._generateLightHash())},e.clearLights=function(){this._lightsSet.clear(),this._clusteredLightsSet.clear(),this._lights.length=0,this._dirtyLights=!0},e.addShadowCasters=function(t){for(var e=this.shadowCasters,i=0;i=0&&e.splice(n,1)}this._dirtyLights=!0},e._generateLightHash=function(){if(this._lights.length>0){this._lights.sort(ho);for(var t="",e="",i=0;i=0||(this.cameras.push(t),this._dirtyCameras=!0)},e.removeCamera=function(t){var e=this.cameras.indexOf(t);e>=0&&(this.cameras.splice(e,1),this._dirtyCameras=!0,this.instances.delete(e))},e.clearCameras=function(){this.cameras.length=0,this._dirtyCameras=!0},e._calculateSortDistances=function(t,e,i,n){for(var s=0;s=0&&!this.directionalLightsSet.has(s)){this.directionalLightsSet.add(s),this.directionalLights.push(s);var r=i.indexOf(s);this.directionalLightsIndices.push(r)}}},t}(),vo=function(){function t(){this.shadowCastersSet=new Set,this.shadowCastersList=[]}var e=t.prototype;return e.clearShadowCasters=function(){this.shadowCastersSet.clear(),this.shadowCastersList.length=0},e.addShadowCasters=function(t){for(var e=0;e1&&_o(this.cameras);for(var _=[],g=0,v=0;v0&&y.layers.indexOf(A.id)>=0){_.push(A),w||A.id!==y.disablePostEffectsLayer||(w=!0,S&&(S.triggerPostprocess=!0));var M=A.cameras.indexOf(y);M>=0&&(S=this.addRenderAction(this._renderActions,g,A,T,M,x,w),g++,x=!1)}}b=0;u--)if(t[u].camera===l&&t[u].renderTarget===h){c=!0;break}var d=a||!c,f=!!d&&l.clearColorBuffer,p=!!d&&l.clearDepthBuffer,m=!!d&&l.clearStencilBuffer;return f|=i.clearColorBuffer,p|=i.clearDepthBuffer,m|=i.clearStencilBuffer,r&&l.postEffectsEnabled&&(h=null),o.reset(),o.triggerPostprocess=!1,o.layerIndex=n,o.cameraIndex=s,o.camera=l,o.renderTarget=h,o.clearColor=f,o.clearDepth=p,o.clearStencil=m,o.firstCameraUse=a,o.lastCameraUse=!1,o},i.propagateRenderTarget=function(t,e){for(var i=t;i>=0;i--){var n=this._renderActions[i],s=this.layerList[n.layerIndex];if(n.renderTarget&&1!==s.id)break;if(1!==s.id){var a=null==n?void 0:n.camera.camera;if(a&&(!e.camera.rect.equals(a.rect)||!e.camera.scissorRect.equals(a.scissorRect)))break;n.renderTarget=e.renderTarget}}},i._logRenderActions=function(){},i._isLayerAdded=function(t){return this.layerList.indexOf(t)>=0},i._isSublayerAdded=function(t,e){for(var i=0;i=0;)this.layerList.splice(e,1),this.subLayerList.splice(e,1),this.subLayerEnabled.splice(e,1),e=this.layerList.indexOf(t),this._dirty=!0,this._dirtyLights=!0,this._dirtyCameras=!0,this.fire("remove",t);var i=this.layerList.length;this._updateOpaqueOrder(0,i-1),this._updateTransparentOrder(0,i-1)},i.pushOpaque=function(t){this._isSublayerAdded(t,!1)||(this.layerList.push(t),this._opaqueOrder[t.id]=this.subLayerList.push(!1)-1,this.subLayerEnabled.push(!0),this._dirty=!0,this._dirtyLights=!0,this._dirtyCameras=!0,this.fire("add",t))},i.insertOpaque=function(t,e){if(!this._isSublayerAdded(t,!1)){this.layerList.splice(e,0,t),this.subLayerList.splice(e,0,!1);var i=this.subLayerList.length;this._updateOpaqueOrder(e,i-1),this.subLayerEnabled.splice(e,0,!0),this._dirty=!0,this._dirtyLights=!0,this._dirtyCameras=!0,this.fire("add",t)}},i.removeOpaque=function(t){for(var e=0,i=this.layerList.length;e=1?(r[0]=Math.pow(e,2.2)*s,r[1]=Math.pow(i,2.2)*s,r[2]=Math.pow(n,2.2)*s):(r[0]=Math.pow(a[0],2.2),r[1]=Math.pow(a[1],2.2),r[2]=Math.pow(a[2],2.2))},e.setColor=function(){1===arguments.length?this._color.set(arguments[0].r,arguments[0].g,arguments[0].b):3===arguments.length&&this._color.set(arguments[0],arguments[1],arguments[2]),this._updateFinalColor()},e.updateShadow=function(){2!==this.shadowUpdateMode&&(this.shadowUpdateMode=1)},e.layersDirty=function(){var t;null!=(t=this._scene)&&t.layers&&(this._scene.layers._dirtyLights=!0)},e.updateKey=function(){var t=this._type<<29|(this._castShadows?1:0)<<28|this._shadowType<<25|this._falloffMode<<23|(0!==this._normalOffsetBias?1:0)<<22|(this._cookie?1:0)<<21|(this._cookieFalloff?1:0)<<20|Mo[this._cookieChannel.charAt(0)]<<18|(this._cookieTransform?1:0)<<12|this._shape<<10|this.numCascades-1<<8;3===this._cookieChannel.length&&(t|=Mo[this._cookieChannel.charAt(1)]<<16,t|=Mo[this._cookieChannel.charAt(2)]<<14),t!==this.key&&null!==this._scene&&this.layersDirty(),this.key=t},W(t,[{key:"numCascades",get:function(){return this.cascades.length},set:function(t){this.cascades&&this.numCascades==t||(this.cascades=Co[t-1],this._shadowMatrixPalette=new Float32Array(64),this._shadowCascadeDistances=new Float32Array(4),this._destroyShadowMap(),this.updateKey())}},{key:"shadowMap",get:function(){return this._shadowMap},set:function(t){this._shadowMap!==t&&(this._destroyShadowMap(),this._shadowMap=t)}},{key:"numShadowFaces",get:function(){var t=this._type;return 0===t?this.numCascades:1===t?6:1}},{key:"type",get:function(){return this._type},set:function(t){if(this._type!==t){this._type=t,this._destroyShadowMap(),this.updateKey();var e=this._shadowType;this._shadowType=null,this.shadowType=e}}},{key:"shape",get:function(){return this._shape},set:function(t){if(this._shape!==t){this._shape=t,this._destroyShadowMap(),this.updateKey();var e=this._shadowType;this._shadowType=null,this.shadowType=e}}},{key:"shadowType",get:function(){return this._shadowType},set:function(t){if(this._shadowType!==t){var e=this.device;1===this._type&&(t=0),4!==t||e.webgl2||(t=0),3!==t||e.textureFloatRenderable||(t=2),2!==t||e.textureHalfFloatRenderable||(t=1),this._isVsm=t>=1&&t<=3,this._isPcf=4===t||0===t,this._shadowType=t,this._destroyShadowMap(),this.updateKey()}}},{key:"enabled",get:function(){return this._enabled},set:function(t){this._enabled!==t&&(this._enabled=t,this.layersDirty())}},{key:"castShadows",get:function(){return this._castShadows&&4!==this.mask&&0!==this.mask},set:function(t){this._castShadows!==t&&(this._castShadows=t,this._destroyShadowMap(),this.layersDirty(),this.updateKey())}},{key:"shadowResolution",get:function(){return this._shadowResolution},set:function(t){this._shadowResolution!==t&&(t=1===this._type?Math.min(t,this.device.maxCubeMapSize):Math.min(t,this.device.maxTextureSize),this._shadowResolution=t,this._destroyShadowMap())}},{key:"vsmBlurSize",get:function(){return this._vsmBlurSize},set:function(t){this._vsmBlurSize!==t&&(t%2==0&&t++,this._vsmBlurSize=t)}},{key:"normalOffsetBias",get:function(){return this._normalOffsetBias},set:function(t){this._normalOffsetBias!==t&&((!this._normalOffsetBias&&t||this._normalOffsetBias&&!t)&&this.updateKey(),this._normalOffsetBias=t)}},{key:"falloffMode",get:function(){return this._falloffMode},set:function(t){this._falloffMode!==t&&(this._falloffMode=t,this.updateKey())}},{key:"innerConeAngle",get:function(){return this._innerConeAngle},set:function(t){this._innerConeAngle!==t&&(this._innerConeAngle=t,this._innerConeAngleCos=Math.cos(t*Math.PI/180))}},{key:"outerConeAngle",get:function(){return this._outerConeAngle},set:function(t){this._outerConeAngle!==t&&(this._outerConeAngle=t,this._outerConeAngleCos=Math.cos(t*Math.PI/180))}},{key:"intensity",get:function(){return this._intensity},set:function(t){this._intensity!==t&&(this._intensity=t,this._updateFinalColor())}},{key:"cookieMatrix",get:function(){return this._cookieMatrix||(this._cookieMatrix=new vt),this._cookieMatrix}},{key:"atlasViewport",get:function(){return this._atlasViewport||(this._atlasViewport=new dt(0,0,1,1)),this._atlasViewport}},{key:"cookie",get:function(){return this._cookie},set:function(t){this._cookie!==t&&(this._cookie=t,this.updateKey())}},{key:"cookieFalloff",get:function(){return this._cookieFalloff},set:function(t){this._cookieFalloff!==t&&(this._cookieFalloff=t,this.updateKey())}},{key:"cookieChannel",get:function(){return this._cookieChannel},set:function(t){if(this._cookieChannel!==t){if(t.length<3)for(var e=t.charAt(t.length-1),i=3-t.length,n=0;n0){var n=i.bakeArea;vn(ko,t,e),ko.mulScalar(.5*n),i._node.rotateLocal(ko.x,0,ko.y)}i._node.getWorldTransform();var s=this.scene.gammaCorrection?2.2:1,a=Math.pow(this.intensity,s);i.intensity=Math.pow(a/e,1/s)},W(e,[{key:"numVirtualLights",get:function(){return 0===this.light.type?this.light.bakeNumSamples:1}}]),e}(Do),Fo=function(){function t(){}return t.createTexture=function(t,e,i){var n=new Di(t,{width:i,height:i,format:e,addressU:1,addressV:1,type:Be,magFilter:1,minFilter:0,anisotropy:1});return n.name="AreaLightLUT",n},t.setUniforms=function(t,e,i){t.scope.resolve("areaLightsLutTex1").setValue(e),t.scope.resolve("areaLightsLutTex2").setValue(i)},t.createPlaceholder=function(e){var i=t.createTexture(e,7,2);i.lock().fill(0),i.unlock(),t.setUniforms(e,i,i)},t.set=function(e,i){function n(e,i,n){var s=t.createTexture(e,n,64);return s.lock().set(i),s.unlock(),s.upload(),s}function s(t,e,i){for(var n=t.length,s=new Float32Array(n),a=0;af)return!1;this.morphTextureWidth=p,this.morphTextureHeight=m;var _=!1,g=3,v=Ri.float2Half;this._textureFormat===e.FORMAT_HALF_FLOAT&&(_=!0,g=4);for(var y=this.morphTextureWidth*this.morphTextureHeight*g,x=_?new Uint16Array(y):new Float32Array(y),b=0;b0&&(e+="varying vec2 uv0;\nuniform highp float morphFactor["+t+"];\n");for(var i=0;i=this.maxSubmitCount&&(s(a,r),a=0,r=!0))}(a>0||0===o&&!this.zeroTextures)&&s(a,r)},e._updateTextureMorph=function(){this.device,(this._activeTargets.length>0||!this.zeroTextures)&&(this._updateTextureRenderTarget(this.rtPositions,"texturePositions"),this._updateTextureRenderTarget(this.rtNormals,"textureNormals"),this.zeroTextures=0===this._activeTargets.length)},e._updateVertexMorph=function(){for(var t=this.maxSubmitCount,e=0;e1e-5){this._activeTargets.length<=e&&(this._activeTargets[e]={});var s=this._activeTargets[e++];s.absWeight=n,s.weight=this.getWeight(i),s.target=t[i]}}this._activeTargets.length=e;var a=this.morph.maxActiveTargets;this._activeTargets.length>a&&(this._activeTargets.sort((function(t,e){return t.absWeight0&&this.material.transparent===e&&(this.mesh.setPositions(this.positions),this.mesh.setColors(this.colors),this.mesh.update(1,!1),this.meshInstance||(this.meshInstance=new La(this.mesh,this.material,zo)),this.positions.length=0,this.colors.length=0,t.list.push(this.meshInstance),t.length++)},t}(),Wo=function(){function t(t){this.device=t,this.map=new Map}var e=t.prototype;return e.getBatch=function(t,e){var i=this.map.get(t);return i||(i=new Vo(this.device,t,e),this.map.set(t,i)),i},e.onPreRender=function(t,e){this.map.forEach((function(i){i.onPreRender(t,e)}))},t}(),Go=[],Ho=function(){function t(t){this.device=t,this.quadMesh=null,this.textureShader=null,this.depthTextureShader=null,this.cubeLocalPos=null,this.cubeWorldPos=null,this.batchesMap=new Map,this.allBatches=new Set,this.updatedLayers=new Set,this._materialDepth=null,this._materialNoDepth=null,this.layerMeshInstances=new Map}var e=t.prototype;return e.createMaterial=function(t){var e=new va;return e.vertexColors=!0,e.blend=!0,e.blendType=2,e.depthTest=t,e.update(),e},e.getBatch=function(t,e){var i=this.batchesMap.get(t);i||(i=new Wo(this.device),this.batchesMap.set(t,i)),this.allBatches.add(i);var n=e?this.materialDepth:this.materialNoDepth;return i.getBatch(n,t)},t.getTextureVS=function(){return"\n\t\t\t\t\t\tattribute vec2 aPosition;\n\t\t\t\t\t\tuniform mat4 matrix_model;\n\t\t\t\t\t\tvarying vec2 uv0;\n\t\t\t\t\t\tvoid main(void) {\n\t\t\t\t\t\t\t\tgl_Position = matrix_model * vec4(aPosition, 0, 1);\n\t\t\t\t\t\t\t\tuv0 = aPosition.xy + 0.5;\n\t\t\t\t\t\t}\n\t\t\t\t"},e.getTextureShader=function(){if(!this.textureShader){var e={attributes:{aPosition:ae},vshader:t.getTextureVS(),fshader:"\n\t\t\t\t\t\t\t\t\t\tprecision lowp float;\n\t\t\t\t\t\t\t\t\t\tvarying vec2 uv0;\n\t\t\t\t\t\t\t\t\t\tuniform sampler2D colorMap;\n\t\t\t\t\t\t\t\t\t\tvoid main (void) {\n\t\t\t\t\t\t\t\t\t\t\t\tgl_FragColor = vec4(texture2D(colorMap, uv0).xyz, 1);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t"};this.textureShader=new ai(this.device,e)}return this.textureShader},e.getDepthTextureShader=function(){if(!this.depthTextureShader){var e=this.device.webgl2?"#define GL2":"",i={attributes:{aPosition:ae},vshader:t.getTextureVS(),fshader:"\n\t\t\t\t\t\t\t\t\t\tprecision "+this.device.precision+" float;\n\t\t\t\t\t\t\t\t\t\t"+e+"\n\t\t\t\t\t\t\t\t\t\t"+ri.screenDepthPS+"\n\t\t\t\t\t\t\t\t\t\tvarying vec2 uv0;\n\t\t\t\t\t\t\t\t\t\tvoid main() {\n\t\t\t\t\t\t\t\t\t\t\t\tfloat depth = getLinearScreenDepth(uv0) * camera_params.x;\n\t\t\t\t\t\t\t\t\t\t\t\tgl_FragColor = vec4(vec3(depth), 1.0);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t"};this.depthTextureShader=new ai(this.device,i)}return this.depthTextureShader},e.getQuadMesh=function(){return this.quadMesh||(this.quadMesh=new ia(this.device),this.quadMesh.setPositions([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),this.quadMesh.update(5)),this.quadMesh},e.drawMesh=function(t,e,i,n,s){if(!n){var a=this.getGraphNode(e);n=new La(i,t,a)}var r=this.layerMeshInstances.get(s);r||(r=[],this.layerMeshInstances.set(s,r)),r.push(n)},e.drawWireAlignedBox=function(t,e,i,n,s){Go.push(t.x,t.y,t.z,t.x,e.y,t.z,t.x,e.y,t.z,e.x,e.y,t.z,e.x,e.y,t.z,e.x,t.y,t.z,e.x,t.y,t.z,t.x,t.y,t.z,t.x,t.y,e.z,t.x,e.y,e.z,t.x,e.y,e.z,e.x,e.y,e.z,e.x,e.y,e.z,e.x,t.y,e.z,e.x,t.y,e.z,t.x,t.y,e.z,t.x,t.y,t.z,t.x,t.y,e.z,t.x,e.y,t.z,t.x,e.y,e.z,e.x,e.y,t.z,e.x,e.y,e.z,e.x,t.y,t.z,e.x,t.y,e.z),this.getBatch(s,n).addLinesArrays(Go,i),Go.length=0},e.drawWireSphere=function(t,e,i,n,s,a){for(var r=2*Math.PI/n,o=0,h=0;h=0},i.getModels=function(t){return this._models},W(e,[{key:"defaultDrawLayer",get:function(){return this.layers.getLayerById(3)}},{key:"ambientBakeNumSamples",get:function(){return this._ambientBakeNumSamples},set:function(t){this._ambientBakeNumSamples=it.clamp(Math.floor(t),1,255)}},{key:"ambientBakeSpherePart",get:function(){return this._ambientBakeSpherePart},set:function(t){this._ambientBakeSpherePart=it.clamp(t,.001,1)}},{key:"clusteredLightingEnabled",get:function(){return this._clusteredLightingEnabled},set:function(t){!this._clusteredLightingEnabled||t?this._clusteredLightingEnabled=t:console.error("Turning off enabled clustered lighting is not currently supported")}},{key:"drawCalls",get:function(){var t=this.layers._meshInstances;return t.length||(this.layers._update(this.device,this.clusteredLightingEnabled),t=this.layers._meshInstances),t},set:function(t){}},{key:"envAtlas",get:function(){return this._envAtlas},set:function(t){t!==this._envAtlas&&(this._envAtlas=t,this.updateShaders=!0)}},{key:"fog",get:function(){return this._fog},set:function(t){t!==this._fog&&(this._fog=t,this.updateShaders=!0)}},{key:"gammaCorrection",get:function(){return this._gammaCorrection},set:function(t){t!==this._gammaCorrection&&(this._gammaCorrection=t,this.updateShaders=!0)}},{key:"layers",get:function(){return this._layers},set:function(t){var e=this._layers;this._layers=t,this.fire("set:layers",e,t)}},{key:"lighting",get:function(){return this._lightingParams}},{key:"lightmapFilterRange",get:function(){return this._lightmapFilterRange},set:function(t){this._lightmapFilterRange=Math.max(t,.001)}},{key:"lightmapFilterSmoothness",get:function(){return this._lightmapFilterSmoothness},set:function(t){this._lightmapFilterSmoothness=Math.max(t,.001)}},{key:"prefilteredCubemaps",get:function(){return this._prefilteredCubemaps},set:function(t){var e=this._prefilteredCubemaps;t=t||[];for(var i=!1,n=!0,s=0;s<6;++s){var a=t[s]||null;e[s]!==a&&(e[s]=a,i=!0),n=n&&!!e[s]}i&&(this._resetSkyboxModel(),n?(this._internalEnvAtlas=Vn.generatePrefilteredAtlas(e,{target:this._internalEnvAtlas}),this._envAtlas||(this.envAtlas=this._internalEnvAtlas)):this._internalEnvAtlas&&(this._envAtlas===this._internalEnvAtlas&&(this.envAtlas=null),this._internalEnvAtlas.destroy(),this._internalEnvAtlas=null))}},{key:"skybox",get:function(){return this._skyboxCubeMap},set:function(t){t!==this._skyboxCubeMap&&(this._skyboxCubeMap=t,this._resetSkyboxModel())}},{key:"skyboxIntensity",get:function(){return this._skyboxIntensity},set:function(t){t!==this._skyboxIntensity&&(this._skyboxIntensity=t,this._resetSkyboxModel())}},{key:"skyboxMip",get:function(){return this._skyboxMip},set:function(t){t!==this._skyboxMip&&(this._skyboxMip=t,this._resetSkyboxModel())}},{key:"skyboxRotation",get:function(){return this._skyboxRotation},set:function(t){this._skyboxRotation.equals(t)||(this._skyboxRotation.copy(t),this._resetSkyboxModel())}},{key:"toneMapping",get:function(){return this._toneMapping},set:function(t){t!==this._toneMapping&&(this._toneMapping=t,this.updateShaders=!0)}}]),e}(u);function qo(){return!("undefined"==typeof AudioContext&&"undefined"==typeof webkitAudioContext)}var jo=function(){function t(t,e,i){if(void 0===i&&(i={}),this.volume=void 0===i.volume?1:i.volume,this.loop=void 0!==i.loop&&i.loop,this.pitch=void 0===i.pitch?1:i.pitch,this.sound=e,this.paused=!1,this.suspended=!1,this.manager=t,this.source=null,qo()){this.startTime=0,this.startOffset=0;var n=t.context;this.gain=n.createGain()}else e.audio&&(this.source=e.audio.cloneNode(!1),this.source.pause())}var e=t.prototype;return e.getVolume=function(){return this.volume},e.getLoop=function(){return this.loop},e.setLoop=function(t){this.loop=t,this.source&&(this.source.loop=t)},e.getPitch=function(){return this.pitch},e.onManagerVolumeChange=function(){this.setVolume(this.getVolume())},e.onManagerSuspend=function(){this.isPlaying()&&!this.suspended&&(this.suspended=!0,this.pause())},e.onManagerResume=function(){this.suspended&&(this.suspended=!1,this.unpause())},e.play=function(){if(this.source)throw new Error("Call stop() before calling play()");this._createSource(),this.source&&(this.startTime=this.manager.context.currentTime,this.source.start(0,this.startOffset%this.source.buffer.duration),this.setVolume(this.volume),this.setLoop(this.loop),this.setPitch(this.pitch),this.manager.on("volumechange",this.onManagerVolumeChange,this),this.manager.on("suspend",this.onManagerSuspend,this),this.manager.on("resume",this.onManagerResume,this),this.manager.suspended&&this.onManagerSuspend())},e.pause=function(){this.source&&(this.paused=!0,this.startOffset+=this.manager.context.currentTime-this.startTime,this.source.stop(0),this.source=null)},e.unpause=function(){!this.source&&this.paused?(this._createSource(),this.source&&(this.startTime=this.manager.context.currentTime,this.source.start(0,this.startOffset%this.source.buffer.duration),this.setVolume(this.volume),this.setLoop(this.loop),this.setPitch(this.pitch),this.paused=!1)):console.warn("Call pause() before unpausing.")},e.stop=function(){this.source&&(this.source.stop(0),this.source=null),this.manager.off("volumechange",this.onManagerVolumeChange,this),this.manager.off("suspend",this.onManagerSuspend,this),this.manager.off("resume",this.onManagerResume,this)},e.setVolume=function(t){t=it.clamp(t,0,1),this.volume=t,this.gain&&(this.gain.gain.value=t*this.manager.volume)},e.setPitch=function(t){this.pitch=t,this.source&&(this.source.playbackRate.value=t)},e.isPlaying=function(){return!this.paused&&this.source.playbackState===this.source.PLAYING_STATE},e.getDuration=function(){return this.source?this.source.buffer.duration:0},e._createSource=function(){var t=this.manager.context;this.sound.buffer&&(this.source=t.createBufferSource(),this.source.buffer=this.sound.buffer,this.source.connect(this.gain),this.gain.connect(t.destination),this.loop||(this.source.onended=this.pause.bind(this)))},t}();qo()||Object.assign(jo.prototype,{play:function(){this.source&&(this.paused=!1,this.setVolume(this.volume),this.setLoop(this.loop),this.setPitch(this.pitch),this.source.play()),this.manager.on("volumechange",this.onManagerVolumeChange,this),this.manager.on("suspend",this.onManagerSuspend,this),this.manager.on("resume",this.onManagerResume,this),this.manager.suspended&&this.onManagerSuspend()},pause:function(){this.source&&(this.paused=!0,this.source.pause())},unpause:function(){this.source&&(this.paused=!1,this.source.play())},stop:function(){this.source&&this.source.pause(),this.manager.off("volumechange",this.onManagerVolumeChange,this),this.manager.off("suspend",this.onManagerSuspend,this),this.manager.off("resume",this.onManagerResume,this)},setVolume:function(t){t=it.clamp(t,0,1),this.volume=t,this.source&&(this.source.volume=t*this.manager.volume)},setPitch:function(t){this.pitch=t,this.source&&(this.source.playbackRate=t)},getDuration:function(){return this.source&&!isNaN(this.source.duration)?this.source.duration:0},isPlaying:function(){return!this.source.paused}});var Yo="linear",Ko="inverse",Zo="exponential",$o=function(t){function e(e,i,n){var s;return(s=t.call(this,e,i,n)||this).position=new lt,s.velocity=new lt,qo()?s.panner=e.context.createPanner():(s.maxDistance=1e4,s.minDistance=1,s.rollOffFactor=1,s.distanceModel=Ko),s}H(e,t);var i=e.prototype;return i.getPosition=function(){return this.position},i.setPosition=function(t){this.position.copy(t);var e=this.panner;"positionX"in e?(e.positionX.value=t.x,e.positionY.value=t.y,e.positionZ.value=t.z):e.setPosition&&e.setPosition(t.x,t.y,t.z)},i.getVelocity=function(){return this.velocity},i.setVelocity=function(t){this.velocity.copy(t)},i.getMaxDistance=function(){return this.panner.maxDistance},i.setMaxDistance=function(t){this.panner.maxDistance=t},i.getMinDistance=function(){return this.panner.refDistance},i.setMinDistance=function(t){this.panner.refDistance=t},i.getRollOffFactor=function(){return this.panner.rolloffFactor},i.setRollOffFactor=function(t){this.panner.rolloffFactor=t},i.getDistanceModel=function(){return this.panner.distanceModel},i.setDistanceModel=function(t){this.panner.distanceModel=t},i._createSource=function(){var t=this.manager.context;this.source=t.createBufferSource(),this.source.buffer=this.sound.buffer,this.source.connect(this.panner),this.panner.connect(this.gain),this.gain.connect(t.destination),this.loop||(this.source.onended=this.pause.bind(this))},e}(jo);if(!qo()){var Qo=new lt;Object.assign($o.prototype,{setPosition:function(t){if(this.position.copy(t),this.source){var e=function(t,e,i,n,s,a){var r=(Qo=Qo.sub2(t,e)).length();if(rn)return 0;var o=0;return a===Yo?o=1-s*(r-i)/(n-i):a===Ko?o=i/(i+s*(r-i)):a===Zo&&(o=Math.pow(r/i,-s)),it.clamp(o,0,1)}(this.manager.listener.getPosition(),this.position,this.minDistance,this.maxDistance,this.rollOffFactor,this.distanceModel),i=this.getVolume();this.source.volume=i*e}},getMaxDistance:function(){return this.maxDistance},setMaxDistance:function(t){this.maxDistance=t},getMinDistance:function(){return this.minDistance},setMinDistance:function(t){this.minDistance=t},getRollOffFactor:function(){return this.rollOffFactor},setRollOffFactor:function(t){this.rollOffFactor=t},getDistanceModel:function(){return this.distanceModel},setDistanceModel:function(t){this.distanceModel=t}})}var Jo=function(){function t(t){this._manager=t,this.position=new lt,this.velocity=new lt,this.orientation=new vt}var e=t.prototype;return e.getPosition=function(){return this.position},e.setPosition=function(t){this.position.copy(t);var e=this.listener;e&&("positionX"in e?(e.positionX.value=t.x,e.positionY.value=t.y,e.positionZ.value=t.z):e.setPosition&&e.setPosition(t.x,t.y,t.z))},e.getVelocity=function(){return this.velocity},e.setVelocity=function(t){},e.setOrientation=function(t){this.orientation.copy(t);var e=this.listener;if(e){var i=t.data;"forwardX"in e?(e.forwardX.value=-i[8],e.forwardY.value=-i[9],e.forwardZ.value=-i[10],e.upX.value=i[4],e.upY.value=i[5],e.upZ.value=i[6]):e.setOrientation&&e.setOrientation(-i[8],-i[9],-i[10],i[4],i[5],i[6])}},e.getOrientation=function(){return this.orientation},W(t,[{key:"listener",get:function(){var t=this._manager.context;return t?t.listener:null}}]),t}(),th="running",eh="suspended",ih="interrupted",nh=["click","contextmenu","auxclick","dblclick","mousedown","mouseup","pointerup","touchend","keydown","keyup"],sh=function(t){function e(e){var i;return(i=t.call(this)||this)._context=null,i._state="not created",i._forceWebAudioApi=e.forceWebAudioApi,i._resumeContext=null,i._resumeContextAttached=!1,i._unlock=null,i._unlockAttached=!1,qo()||i._forceWebAudioApi?i._addAudioContextUserInteractionListeners():console.warn("No support for 3D audio found"),i.listener=new Jo(q(i)),i._volume=1,i.suspended=!1,i}H(e,t);var i=e.prototype;return i.suspend=function(){this.suspended=!0,this.fire("suspend")},i.resume=function(){this.suspended=!1,this.fire("resume"),!this.context||this._state!==ih&&this._state!==eh||this._safelyResumeContext()},i.destroy=function(){var t=this;this._resumeContext&&this._resumeContextAttached&&nh.forEach((function(e){window.removeEventListener(e,t._resumeContext)})),this._unlock&&this._unlockAttached&&window.removeEventListener("touchend",this._unlock),this.fire("destroy"),this._context&&this._context.close&&(this._context.close(),this._context=null)},i.playSound=function(t,e){void 0===e&&(e={});var i=null;return jo&&(i=new jo(this,t,e)).play(),i},i.playSound3d=function(t,e,i){void 0===i&&(i={});var n=null;return $o&&((n=new $o(this,t,i)).setPosition(e),i.volume&&n.setVolume(i.volume),i.loop&&n.setLoop(i.loop),i.maxDistance&&n.setMaxDistance(i.maxDistance),i.minDistance&&n.setMinDistance(i.minDistance),i.rollOffFactor&&n.setRollOffFactor(i.rollOffFactor),i.distanceModel&&n.setDistanceModel(i.distanceModel),n.play()),n},i._safelyResumeContext=function(){var t=this;this._context&&this._context.resume().then((function(){t._context.state!==th&&t._addAudioContextUserInteractionListeners()})).catch((function(){t._addAudioContextUserInteractionListeners()}))},i._addAudioContextUserInteractionListeners=function(){var t=this;this._resumeContext||(this._resumeContext=function(){t.context&&t.context.state!==th?t.context.resume():(nh.forEach((function(e){window.removeEventListener(e,t._resumeContext)})),t._resumeContextAttached=!1)}),this._resumeContextAttached||(nh.forEach((function(e){window.addEventListener(e,t._resumeContext)})),this._resumeContextAttached=!0),E.ios&&(this._unlock||(this._unlock=function(){window.removeEventListener("touchend",t._unlock),t._unlockAttached=!1;var e=t.context;if(e){var i=e.createBuffer(1,1,44100),n=e.createBufferSource();n.buffer=i,n.connect(e.destination),n.start(0),n.disconnect()}}),this._unlockAttached||(window.addEventListener("touchend",this._unlock),this._unlockAttached=!0))},W(e,[{key:"volume",get:function(){return this._volume},set:function(t){t=it.clamp(t,0,1),this._volume=t,this.fire("volumechange",t)}},{key:"context",get:function(){var t=this;return this._context||(qo()||this._forceWebAudioApi)&&("undefined"!=typeof AudioContext?this._context=new AudioContext:"undefined"!=typeof webkitAudioContext&&(this._context=new webkitAudioContext),this._context&&(this._state=this._context.state,this._context.onstatechange=function(){t._context&&(t._state!==ih&&t._state!==eh||t._safelyResumeContext(),t._state=t._context.state)})),this._context}}]),e}(u),ah=function(t,e,i,n){this.time=t,this.position=e,this.rotation=i,this.scale=n},rh=function(){this._name="",this._keys=[]},oh=function(){function t(){this.name="",this.duration=0,this._nodes=[],this._nodeDict={}}var e=t.prototype;return e.getNode=function(t){return this._nodeDict[t]},e.addNode=function(t){this._nodes.push(t),this._nodeDict[t._name]=t},W(t,[{key:"nodes",get:function(){return this._nodes}}]),t}(),hh=function(){function t(t){2===arguments.length&&(t=arguments[1]),this.options=t,this._name=t.name,this._defaultWeight=t.defaultWeight||0,this.aabb=t.aabb,this.aabb||(this.aabb=new At,t.deltaPositions&&this.aabb.compute(t.deltaPositions)),this.deltaPositions=t.deltaPositions}var e=t.prototype;return e._postInit=function(){this.options=null},e._initVertexBuffers=function(t){var e=this.options;this._vertexBufferPositions=this._createVertexBuffer(t,e.deltaPositions,e.deltaPositionsType),this._vertexBufferNormals=this._createVertexBuffer(t,e.deltaNormals,e.deltaNormalsType),this._vertexBufferPositions&&(this.deltaPositions=this._vertexBufferPositions.lock())},e._createVertexBuffer=function(t,e,i){return void 0===i&&(i=6),e?new Qe(t,new ti(t,[{semantic:be,components:3,type:i}]),e.length/3,0,e):null},e._setTexture=function(t,e){this[t]=e},e.destroy=function(){this._vertexBufferPositions&&(this._vertexBufferPositions.destroy(),this._vertexBufferPositions=null),this._vertexBufferNormals&&(this._vertexBufferNormals.destroy(),this._vertexBufferNormals=null),this.texturePositions&&(this.texturePositions.destroy(),this.texturePositions=null),this.textureNormals&&(this.textureNormals.destroy(),this.textureNormals=null)},W(t,[{key:"name",get:function(){return this._name}},{key:"defaultWeight",get:function(){return this._defaultWeight}},{key:"morphPositions",get:function(){return!!this._vertexBufferPositions||!!this.texturePositions}},{key:"morphNormals",get:function(){return!!this._vertexBufferNormals||!!this.textureNormals}}]),t}(),lh=function(t,e,i){this.device=t,this.inverseBindPose=e,this.boneNames=i},ch=function(t){function e(){var e;return(e=t.call(this)||this)._meshes=null,e}H(e,t);var i=e.prototype;return i.destroy=function(){this.meshes=null},i.decRefMeshes=function(){if(this._meshes)for(var t=this._meshes.length,e=0;e=0&&t<=1?0:1})),vh(["fr","pt"],(function(t){return t>=0&&t<2?0:1})),vh(["da"],(function(t){return 1===t||!Number.isInteger(t)&&t>=0&&t<=1?0:1})),vh(["de","en","it","el","es","tr","fi","sv","nb","no","ur"],(function(t){return 1===t?0:1})),vh(["ru","uk"],(function(t){if(Number.isInteger(t)){var e=t%10,i=t%100;if(1===e&&11!==i)return 0;if(e>=2&&e<=4&&(i<12||i>14))return 1;if(0===e||e>=5&&e<=9||i>=11&&i<=14)return 2}return 3})),vh(["pl"],(function(t){if(Number.isInteger(t)){if(1===t)return 0;var e=t%10,i=t%100;if(e>=2&&e<=4&&(i<12||i>14))return 1;if(e>=0&&e<=1||e>=5&&e<=9||i>=12&&i<=14)return 2}return 3})),vh(["ar"],(function(t){if(0===t)return 0;if(1===t)return 1;if(2===t)return 2;if(Number.isInteger(t)){var e=t%100;if(e>=3&&e<=10)return 3;if(e>=11&&e<=99)return 4}return 5}));var bh=gh[yh(mh)];function Sh(t){return gh[t]||bh}var wh=new RegExp("^\\s*(?:(?:[a-z]+[a-z0-9\\-\\+\\.]*:)?//|data:|blob:)","i"),Th=function(){function t(t,e,i,n,s,a){this.url=t||"",this.filename=e||"",this.hash=void 0===i?null:i,this.size=void 0===n?null:n,this.opt=void 0===s?null:s,this.contents=a||null}return t.prototype.equals=function(t){return this.url===t.url&&this.filename===t.filename&&this.hash===t.hash&&this.size===t.size&&this.opt===t.opt&&this.contents===t.contents},t}(),Ah=-1,Mh={pvr:"extCompressedTexturePVRTC",dxt:"extCompressedTextureS3TC",etc2:"extCompressedTextureETC",etc1:"extCompressedTextureETC1",basis:"canvas"},Ch=["pvr","dxt","etc2","etc1","basis"],Eh=function(t){function e(e,i,n,s,a){var r;return(r=t.call(this)||this)._id=Ah--,r.name=e||"",r.type=i,r.tags=new $(q(r)),r._preload=!1,r._file=null,r._data=s||{},r.options=a||{},r._resources=[],r._i18n={},r.loaded=!1,r.loading=!1,r.registry=null,n&&(r.file=n),r}H(e,t);var i=e.prototype;return i.getFileUrl=function(){var t=this.file;if(!t||!t.url)return null;var e=t.url;if(this.registry&&this.registry.prefix&&!wh.test(e)&&(e=this.registry.prefix+e),"script"!==this.type&&t.hash){var i=-1!==e.indexOf("?")?"&":"?";e+=i+"t="+t.hash}return e},i.getAbsoluteUrl=function(t){if(t.startsWith("blob:")||t.startsWith("data:"))return t;var e=p.getDirectory(this.file.url);return p.join(e,t)},i.getLocalizedAssetId=function(t){return t=xh(t,this._i18n),this._i18n[t]||null},i.addLocalizedAssetId=function(t,e){this._i18n[t]=e,this.fire("add:localized",t,e)},i.removeLocalizedAssetId=function(t){var e=this._i18n[t];e&&(delete this._i18n[t],this.fire("remove:localized",t,e))},i.ready=function(t,e){e=e||this,this.resource?t.call(e,this):this.once("load",(function(i){t.call(e,i)}))},i.reload=function(){this.loaded&&(this.loaded=!1,this.registry.load(this))},i.unload=function(){if(this.loaded||0!==this._resources.length){this.fire("unload",this),this.registry.fire("unload:"+this.id,this);var t=this._resources;this.resources=[],this.loaded=!1,this.file&&this.registry._loader.clearCache(this.getFileUrl(),this.type);for(var e=0;e0,maxRetries:n},e)},W(e,[{key:"id",get:function(){return this._id},set:function(t){this._id=t}},{key:"file",get:function(){return this._file},set:function(t){var e=this;if(t&&t.variants&&-1!==["texture","textureatlas","bundle"].indexOf(this.type)){var i,n,s=(null==(i=this.registry)||null==(n=i._loader)?void 0:n._app)||$s(),a=null==s?void 0:s.graphicsDevice;if(a)for(var r=function(i,n){var r=Ch[i];if(t.variants[r]&&a[Mh[r]])return t=t.variants[r],"break";if(s.enableBundles){var o=s.bundles.listBundlesForAsset(e);if(o&&o.find((function(t){var e;return null==t||null==(e=t.file)?void 0:e.variants[r]})))return"break"}},o=0,h=Ch.length;o=0){var a=n[s];a.decRefCount(),0===a.refCount&&(n.splice(s,1),n.length||t._skinInstanceCache.delete(i),e&&(e.destroy(),a.skinInstance=null))}}}}},t}();Rh._skinInstanceCache=new Map;var Ih,Lh=function(){function t(e,i,n,s){for(var a=function(e,s,a){var r=t.createAsset(i.name,e,s,a);return n.add(r),r},r=[],o=0;o0&&o(n,Float32Array,1),s.length>0&&o(s,Uint16Array,65535),a.length>0&&o(a,Uint8Array,255)}(y),y.unlock(),y},qh=new vt,jh=new lt,Yh=function(t,e,i,n,s,a,r){var o=[];return e.primitives.forEach((function(h){var l,c,u,d=null,f=!0;if(h.hasOwnProperty("extensions")){var p=h.extensions;if(p.hasOwnProperty("KHR_draco_mesh_compression")){var m=window.DracoDecoderModule;if(m){var _=p.KHR_draco_mesh_compression;if(_.hasOwnProperty("attributes")){var g=n[_.bufferView],v=new m.DecoderBuffer;v.Init(g,g.length);var y,x,b=new m.Decoder,S=b.GetEncodedGeometryType(v);switch(S){case m.POINT_CLOUD:l=0,y=new m.PointCloud,x=b.DecodeBufferToPointCloud(v,y);break;case m.TRIANGULAR_MESH:l=4,y=new m.Mesh,x=b.DecodeBufferToMesh(v,y);break;case m.INVALID_GEOMETRY_TYPE:}if(!x||!x.ok()||0==y.ptr)return void s("Failed to decode draco compressed asset: "+(x?x.error_msg():"Mesh asset - invalid draco compressed geometry type: "+S));var w=y.num_faces();if(S===m.TRIANGULAR_MESH){var T=y.num_points()>65535,A=(u=3*w)*(T?4:2),M=m._malloc(A);T?(b.GetTrianglesUInt32Array(y,A,M),d=new Uint32Array(m.HEAPU32.buffer,M,u).slice()):(b.GetTrianglesUInt16Array(y,A,M),d=new Uint16Array(m.HEAPU16.buffer,M,u).slice()),m._free(M)}c=function(t,e,i,n,s,a,r){var o=e.num_points(),h=function(t){var i,a,r,h,l=n.GetAttributeByUniqueId(e,t),c=o*l.num_components();switch(l.data_type()){case s.DT_UINT8:h=1,r=1,i=s._malloc(c*r),n.GetAttributeDataArrayForAllPoints(e,l,s.DT_UINT8,c*r,i),a=new Uint8Array(s.HEAPU8.buffer,i,c).slice();break;case s.DT_UINT16:h=3,r=2,i=s._malloc(c*r),n.GetAttributeDataArrayForAllPoints(e,l,s.DT_UINT16,c*r,i),a=new Uint16Array(s.HEAPU16.buffer,i,c).slice();break;case s.DT_FLOAT32:default:h=6,r=4,i=s._malloc(c*r),n.GetAttributeDataArrayForAllPoints(e,l,s.DT_FLOAT32,c*r,i),a=new Float32Array(s.HEAPF32.buffer,i,c).slice()}return s._free(i),{values:a,numComponents:l.num_components(),componentSizeInBytes:r,storageType:h,normalized:l.normalized()}},l={},c=i.attributes;for(var u in c)if(c.hasOwnProperty(u)&&Nh.hasOwnProperty(u)){var d=Nh[u],f=h(c[u]),p=f.numComponents*f.componentSizeInBytes;l[d]={values:f.values,buffer:f.values.buffer,size:p,offset:0,stride:p,count:o,components:f.numComponents,type:f.storageType,normalize:f.normalized}}return l.hasOwnProperty(re)||Gh(l,a),Xh(t,l,r)}(t,y,_,b,m,d,a),m.destroy(y),m.destroy(b),m.destroy(v),f=!1}}}}c||(d=h.hasOwnProperty("indices")?zh(i[h.indices],n,!0):null,c=function(t,e,i,n,s,a,r){var o={},h=[];for(var l in e)e.hasOwnProperty(l)&&Nh.hasOwnProperty(l)&&(o[l]=e[l],h.push(l+":"+e[l]));h.sort();var c=h.join(),u=r[c];if(!u){var d={};for(var f in o){var p=n[e[f]],m=zh(p,s),_=s[p.bufferView],g=Nh[f],v=Oh(p.type)*Bh(p.componentType),y=_.hasOwnProperty("byteStride")?_.byteStride:v;d[g]={buffer:m.buffer,size:v,offset:m.byteOffset,stride:y,count:p.count,components:Oh(p.type),type:Fh(p.componentType),normalize:p.normalized}}d.hasOwnProperty(re)||Gh(d,i),u=Xh(t,d,a),r[c]=u}return u}(t,h.attributes,d,i,n,a,r),l=function(t){if(!t.hasOwnProperty("mode"))return 4;switch(t.mode){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;case 4:return 4;case 5:return 5;case 6:return 6;default:return 4}}(h));var C=null;if(c){if((C=new ia(t)).vertexBuffer=c,C.primitive[0].type=l,C.primitive[0].base=0,C.primitive[0].indexed=null!==d,null!==d){var E;2!==(E=d instanceof Uint8Array?0:d instanceof Uint16Array?1:2)||t.extUintElement||(E=1,d=new Uint16Array(d));var P=new ys(t,E,d.length,0,d);C.indexBuffer[0]=P,C.primitive[0].count=d.length}else C.primitive[0].count=c.numVertices;C.materialIndex=h.material;var R=i[h.attributes.POSITION];if(C.aabb=Wh(R),f&&h.hasOwnProperty("targets")){var I=[];h.targets.forEach((function(t,s){var a={};t.hasOwnProperty("POSITION")&&(R=i[t.POSITION],a.deltaPositions=Vh(R,n),a.deltaPositionsType=6,a.aabb=Wh(R)),t.hasOwnProperty("NORMAL")&&(R=i[t.NORMAL],a.deltaNormals=Vh(R,n),a.deltaNormalsType=6),e.hasOwnProperty("extras")&&e.extras.hasOwnProperty("targetNames")?a.name=e.extras.targetNames[s]:a.name=s.toString(10),e.hasOwnProperty("weights")&&(a.defaultWeight=e.weights[s]),I.push(new hh(a))})),C.morph=new Bo(I,t)}}o.push(C)})),o},Kh=function(t,e,i){var n,s,a=["#ifdef MAPFLOAT","uniform float material_shininess;","#endif","","#ifdef MAPTEXTURE","uniform sampler2D texture_glossMap;","#endif","","void getGlossiness() {","\t\tdGlossiness = 1.0;","","#ifdef MAPFLOAT","\t\tdGlossiness *= material_shininess;","#endif","","#ifdef MAPTEXTURE","\t\tdGlossiness *= texture2D(texture_glossMap, $UV).$CH;","#endif","","#ifdef MAPVERTEX","\t\tdGlossiness *= saturate(vVertexColor.$VC);","#endif","","\t\tdGlossiness = 1.0 - dGlossiness;","","\t\tdGlossiness += 0.0000001;","}"].join("\n"),r=["#ifdef MAPCOLOR","uniform vec3 material_specular;","#endif","","#ifdef MAPTEXTURE","uniform sampler2D texture_specularMap;","#endif","","void getSpecularity() {","\t\tdSpecularity = vec3(1.0);","","\t\t#ifdef MAPCOLOR","\t\t\t\tdSpecularity *= material_specular;","\t\t#endif","","\t\t#ifdef MAPTEXTURE","\t\t\t\tvec3 srgb = texture2D(texture_specularMap, $UV).$CH;","\t\t\t\tdSpecularity *= vec3(pow(srgb.r, 2.2), pow(srgb.g, 2.2), pow(srgb.b, 2.2));","\t\t#endif","","\t\t#ifdef MAPVERTEX","\t\t\t\tdSpecularity *= saturate(vVertexColor.$VC);","\t\t#endif","}"].join("\n"),o=["#ifdef MAPFLOAT","uniform float material_clearCoatGlossiness;","#endif","","#ifdef MAPTEXTURE","uniform sampler2D texture_clearCoatGlossMap;","#endif","","void getClearCoatGlossiness() {","\t\tccGlossiness = 1.0;","","#ifdef MAPFLOAT","\t\tccGlossiness *= material_clearCoatGlossiness;","#endif","","#ifdef MAPTEXTURE","\t\tccGlossiness *= texture2D(texture_clearCoatGlossMap, $UV).$CH;","#endif","","#ifdef MAPVERTEX","\t\tccGlossiness *= saturate(vVertexColor.$VC);","#endif","","\t\tccGlossiness = 1.0 - ccGlossiness;","","\t\tccGlossiness += 0.0000001;","}"].join("\n"),h=[0,0],l=[1,1],c=function(t,e,i){var n,s,a=t.texCoord;if(a)for(s=0;s0?i.name=t.name:i.name="node_"+e,t.hasOwnProperty("matrix")&&(qh.data.set(t.matrix),qh.getTranslation(jh),i.setLocalPosition(jh),qh.getEulerAngles(jh),i.setLocalEulerAngles(jh),qh.getScale(jh),i.setLocalScale(jh)),t.hasOwnProperty("rotation")){var n=t.rotation;i.setLocalRotation(n[0],n[1],n[2],n[3])}if(t.hasOwnProperty("translation")){var s=t.translation;i.setLocalPosition(s[0],s[1],s[2])}if(t.hasOwnProperty("scale")){var a=t.scale;i.setLocalScale(a[0],a[1],a[2])}return i},$h=function(t,e){var i="orthographic"===t.type?1:0,n=1===i?t.orthographic:t.perspective,s={enabled:!1,projection:i,nearClip:n.znear,aspectRatioMode:0};n.zfar&&(s.farClip=n.zfar),1===i?(s.orthoHeight=.5*n.ymag,n.ymag&&(s.aspectRatioMode=1,s.aspectRatio=n.xmag/n.ymag)):(s.fov=n.yfov*it.RAD_TO_DEG,n.aspectRatio&&(s.aspectRatioMode=1,s.aspectRatio=n.aspectRatio));var a=new Pv(t.name);return a.addComponent("camera",s),a},Qh=function(t,e){var i={enabled:!1,type:"point"===t.type?"omni":t.type,color:t.hasOwnProperty("color")?new at(t.color):at.WHITE,range:t.hasOwnProperty("range")?t.range:9999,falloffMode:1,intensity:t.hasOwnProperty("intensity")?it.clamp(t.intensity,0,2):1};t.hasOwnProperty("spot")&&(i.innerConeAngle=t.spot.hasOwnProperty("innerConeAngle")?t.spot.innerConeAngle*it.RAD_TO_DEG:0,i.outerConeAngle=t.spot.hasOwnProperty("outerConeAngle")?t.spot.outerConeAngle*it.RAD_TO_DEG:Math.PI/4);var n=new Pv(e.name);return n.rotateLocal(90,0,0),n.addComponent("light",i),n},Jh=function(t,e,i,n){if(!e.hasOwnProperty("skins")||0===e.skins.length)return[];var s=new Map;return e.skins.map((function(a){return function(t,e,i,n,s,a){var r,o,h,l=e.joints,c=l.length,u=[];if(e.hasOwnProperty("inverseBindMatrices")){var d=e.inverseBindMatrices,f=zh(i[d],n,!0),p=[];for(r=0;r0){var s=i&&i.camera&&i.camera.preprocess,a=i&&i.camera&&i.camera.process||$h,r=i&&i.camera&&i.camera.postprocess;t.nodes.forEach((function(i,o){if(i.hasOwnProperty("camera")){var h=t.cameras[i.camera];if(h){s&&s(h);var l=a(h,e[o]);r&&r(h,l),l&&(n||(n=new Map),n.set(i,l))}}}))}return n}(e,l,s),f=tl(e,l,i,s),p=function(t,e,i,n){if(!t.hasOwnProperty("materials")||0===t.materials.length)return[];var s=i&&i.material&&i.material.preprocess,a=i&&i.material&&i.material.process||Kh,r=i&&i.material&&i.material.postprocess;return t.materials.map((function(t){s&&s(t);var i=a(t,e,n);return r&&r(t,i),i}))}(e,n.map((function(t){return t.resource})),s,h),m=function(t,e,i,n,s){if(!e.hasOwnProperty("meshes")||0===e.meshes.length||!e.hasOwnProperty("accessors")||0===e.accessors.length||!e.hasOwnProperty("bufferViews")||0===e.bufferViews.length)return[];var a={};return e.meshes.map((function(r){return Yh(t,r,e.accessors,i,n,s,a)}))}(t,e,i,a,h),_=Jh(t,e,l,i),g=[],v=0;vi.byteLength)e("Invalid length found in glb header. Found "+a);else{for(var r=[],o=12;oi.byteLength)throw new Error("Invalid chunk length found in glb. Found "+h);var l=i.getUint32(o+4,!0),c=new Uint8Array(i.buffer,i.byteOffset+o+8,h);r.push({length:h,type:l,data:c}),o+=h+8}1===r.length||2===r.length?1313821514===r[0].type?r.length>1&&5130562!==r[1].type?e("Invalid chunk type found in glb file. Expected 0x004E4942, found 0x"+r[1].type.toString(16)):e(null,{gltfChunk:r[0].data,binaryChunk:2===r.length?r[1].data:null}):e("Invalid chunk type found in glb file. Expected 0x4E4F534A, found 0x"+r[0].type.toString(16)):e("Invalid number of chunks found in glb file.")}else e("Invalid version number found in glb header. Expected 2, found "+s);else e("Invalid magic number found in glb header. Expected 0x46546C67, found 0x"+n.toString(16))}(e,i):i(null,{gltfChunk:e,binaryChunk:null})},rl=function(t,e,i,n){var s=[],a=i&&i.bufferView&&i.bufferView.preprocess,r=i&&i.bufferView&&i.bufferView.processAsync||function(t,e,i){i(null,null)},o=i&&i.bufferView&&i.bufferView.postprocess,h=t.bufferViews?t.bufferViews.length:0;if(h)for(var l=function(e,i){var a=t.bufferViews[e];a.hasOwnProperty("byteStride")&&(i.byteStride=a.byteStride),s[e]=i,o&&o(a,i),0==--h&&n(null,s)},c=0;c=0?t.split("?")[0]:t},e.load=function(e,i,n){var s=this;Eh.fetchArrayBuffer(e.load,(function(a,r){a?i(a):t.parseAsync(s._getUrlWithoutParams(e.original),p.extractPath(e.load),r,s._device,n.registry,n.options,(function(t,e){t?i(t):i(null,new Lh(e,n,s._assets,s._defaultMaterial))}))}),n,this._maxRetries)},e.open=function(t,e,i){return e},e.patch=function(t,e){},t}(),hl=function(){function t(){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t});var i={retry:this.maxRetries>0,maxRetries:this.maxRetries};(t.load.startsWith("blob:")||t.load.startsWith("data:"))&&(".glb"===p.getExtension(t.original).toLowerCase()?i.responseType=nt.ResponseType.ARRAY_BUFFER:i.responseType=nt.ResponseType.JSON),st.get(t.load,i,(function(i,n){i?e("Error loading animation resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){if(".glb"===p.getExtension(t).toLowerCase()){var i=ol.parse("filename.glb",e,null);if(i){var n=i.animations;return i.destroy(),n}return null}return this["_parseAnimationV"+e.animation.version](e)},e.patch=function(t,e){},e._parseAnimationV3=function(t){var e=t.animation,i=new oh;i.name=e.name,i.duration=e.duration;for(var n=0;n0,maxRetries:this.maxRetries};t.load.startsWith("blob:")&&(i.responseType=nt.ResponseType.JSON),st.get(t.load,i,(function(i,n){i?e("Error loading animation clip resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){var i=e.name,n=e.duration,s=e.inputs.map((function(t){return new dh(1,t)})),a=e.outputs.map((function(t){return new dh(t.components,t.data)})),r=e.curves.map((function(t){return new uh([t.path],t.inputIndex,t.outputIndex,t.interpolation)}));return new ph(i,n,s,a,r)},e.patch=function(t,e){},t}(),cl=function(){function t(t){if(this._layers=[],this._parameters={},Array.isArray(t.layers))this._layers=t.layers;else for(var e in t.layers){for(var i=t.layers[e],n={name:i.name,blendType:i.blendType,weight:i.weight,states:[],transitions:[]},s=0;s0,maxRetries:this.maxRetries};t.load.startsWith("blob:")&&(i.responseType=nt.ResponseType.JSON),st.get(t.load,i,(function(i,n){i?e("Error loading animation state graph resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return new cl(e)},e.patch=function(t,e){},t}(),dl=function(){function t(t){this.audio=void 0,this.buffer=void 0,t instanceof Audio?this.audio=t:this.buffer=t}return W(t,[{key:"duration",get:function(){var t=0;return this.buffer?t=this.buffer.duration:this.audio&&(t=this.audio.duration),t||0}}]),t}(),fl=function(){if("undefined"==typeof window)return!1;var t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(e>0)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);if(t.indexOf("Trident/")>0){var i=t.indexOf("rv:");return parseInt(t.substring(i+3,t.indexOf(".",i)),10)}return!1}(),pl={".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/x-wav",".mp4a":"audio/mp4",".m4a":"audio/mp4",".mp4":"audio/mp4",".aac":"audio/aac"},ml=function(){function t(t){this.manager=t,this.maxRetries=0}var e=t.prototype;return e._isSupported=function(t){var e=p.getExtension(t);return!!pl[e]},e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t});var i=function(i){var n="Error loading audio url: "+t.original;i&&(n+=": "+(i.message||i)),console.warn(n),e(n)};if(this._createSound){if(!this._isSupported(t.original))return void i("Audio format for "+t.original+" not supported");this._createSound(t.load,(function(t){e(null,new dl(t))}),i)}else i(null)},e.open=function(t,e){return e},e.patch=function(t,e){},e._createSound=function(t,e,i){if(qo()){var n=this.manager;if(!n.context)return void i("Audio manager has no audio context");var s={retry:this.maxRetries>0,maxRetries:this.maxRetries};(t.startsWith("blob:")||t.startsWith("data:"))&&(s.responseType=nt.ResponseType.ARRAY_BUFFER),st.get(t,s,(function(t,s){t?i(t):n.context.decodeAudioData(s,e,i)}))}else{var a=null;try{a=new Audio}catch(t){return void i("No support for Audio element")}fl&&document.body.appendChild(a);a.onerror=function(){a.onerror=null,fl&&document.body.removeChild(a),i()},a.addEventListener("canplaythrough",(function t(){a.removeEventListener("canplaythrough",t),fl&&document.body.removeChild(a),e(a)})),a.src=t}},t}(),_l=function(){function t(){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t}),st.get(t.load,{responseType:nt.ResponseType.ARRAY_BUFFER,retry:this.maxRetries>0,maxRetries:this.maxRetries},(function(i,n){i?e("Error loading binary resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return e},e.patch=function(t,e){},t}(),gl=function(){function t(t){this._blobUrls={};for(var e=0,i=t.length;e=s)throw new Error("Invalid PAX header data format.");var l=parseInt(e.decode(new Uint8Array(t,i+r,h-r)),10),c=e.decode(new Uint8Array(t,i+h+1,l-(h-r)-2)).split("=");if(2!==c.length)throw new Error("Invalid PAX header data format.");0===c[1].length&&(c[1]=null),o.push({name:c[0],value:c[1]}),r+=l}return new n(o)},n.prototype.applyHeader=function(t){for(var e=0;e0&&(a=p.trim()+a.trim())}var m={name:a,start:l,size:o,url:c};return this._globalPaxHeader&&this._globalPaxHeader.applyHeader(m),this._paxHeader&&(this._paxHeader.applyHeader(m),this._paxHeader=null),m},s.prototype.untar=function(t){if(!e)return console.error("Cannot untar because TextDecoder interface is not available for this platform."),[];for(var i=[];this._hasNext();){var n=this._readNextFile();n&&(t&&n.name&&(n.name=t+n.name),i.push(n))}return i},t&&(self.onmessage=function(t){var e=t.data.id;try{var i=new s(t.data.arrayBuffer).untar(t.data.prefix);postMessage({id:e,files:i,arrayBuffer:t.data.arrayBuffer},[t.data.arrayBuffer])}catch(t){postMessage({id:e,error:t.toString()})}})}var yl=null;var xl=function(){function t(t){this._requestId=0,this._pendingRequests={},this._filenamePrefix=t,this._worker=new Worker(function(){if(!yl){var t="("+vl.toString()+")(true)\n\n",e=new Blob([t],{type:"application/javascript"});yl=URL.createObjectURL(e)}return yl}()),this._worker.addEventListener("message",this._onMessage.bind(this))}var e=t.prototype;return e._onMessage=function(t){var e=t.data.id;if(this._pendingRequests[e]){var i=this._pendingRequests[e];if(delete this._pendingRequests[e],t.data.error)i(t.data.error);else{for(var n=t.data.arrayBuffer,s=0,a=t.data.files.length;s0},e.destroy=function(){this._worker&&(this._worker.terminate(),this._worker=null,this._pendingRequests=null)},t}();vl();var bl=function(){function t(t){this._assets=t,this._worker=null,this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t});var i=this;st.get(t.load,{responseType:nt.ResponseType.ARRAY_BUFFER,retry:this.maxRetries>0,maxRetries:this.maxRetries},(function(n,s){if(n)e("Error loading bundle resource "+t.original+": "+n);else try{i._untar(s,e)}catch(i){e("Error loading bundle resource "+t.original+": "+i)}}))},e._untar=function(t,e){var i=this;if(E.workers)i._worker||(i._worker=new xl(i._assets.prefix)),i._worker.untar(t,(function(t,n){e(t,n),i._worker.hasPendingRequests()||(i._worker.destroy(),i._worker=null)}));else{var n=new Ih(t).untar(i._assets.prefix);e(null,n)}},e.open=function(t,e){return new gl(e)},e.patch=function(t,e){},t}(),Sl=function(){function t(){}var e=t.prototype;return e.instantiateModelEntity=function(t){return null},e.instantiateRenderEntity=function(t){return null},t}(),wl=function(){function t(t,e){this.glbParser=new ol(t,e,0),this.parsers={}}var e=t.prototype;return e._getUrlWithoutParams=function(t){return t.indexOf("?")>=0?t.split("?")[0]:t},e._getParser=function(t){var e=t?p.getExtension(this._getUrlWithoutParams(t)).toLowerCase().replace(".",""):null;return this.parsers[e]||this.glbParser},e.load=function(t,e,i){"string"==typeof t&&(t={load:t,original:t}),this._getParser(t.original).load(t,e,i)},e.open=function(t,e,i){return this._getParser(t).open(t,e,i)},e.patch=function(t,e){},t}(),Tl=function(){function t(){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t}),st.get(t.load,{retry:this.maxRetries>0,maxRetries:this.maxRetries},(function(i,n){i?e("Error loading css resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return e},e.patch=function(t,e){},t}();var Al=function(){function t(t,e,i){this._device=t,this._registry=e,this._loader=i}var e=t.prototype;return e.load=function(t,e,i){this.loadAssets(i,e)},e.open=function(t,e,i){return i?i.resource:null},e.patch=function(t,e){this.loadAssets(t,(function(i,n){i&&(e.fire("error",t),e.fire("error:"+t.id,i,t),t.fire("error",t))}))},e.getAssetIds=function(t){var e=[];if(e[0]=t.file,(t.loadFaces||!t.file)&&t.data&&t.data.textures)for(var i=0;i<6;++i)e[i+1]=t.data.textures[i];else e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=null;return e},e.compareAssetIds=function(t,e){return t&&e?parseInt(t,10)===t||"string"==typeof t?t===e:t.url===e.url:null!==t==(null!==e)},e.update=function(t,e,i){var n,s,a,r=t.data||{},o=t._handlerState.assets,h=t._resources,l=[null,null,null,null,null,null,null],c=function(){return r.hasOwnProperty("type")?r.type:r.hasOwnProperty("rgbm")?r.rgbm?Ne:Be:null};if(t.loaded&&i[0]===o[0])l[1]=h[1]||null,l[2]=h[2]||null,l[3]=h[3]||null,l[4]=h[4]||null,l[5]=h[5]||null,l[6]=h[6]||null;else if(i[0])for(n=i[0].resource,a=0;a<6;++a)l[a+1]=new Di(this._device,{name:t.name+"_prelitCubemap"+(n.width>>a),cubemap:!0,type:c()||n.type,width:n.width>>a,height:n.height>>a,format:n.format,levels:[n._levels[a]],fixCubemapSeams:!0,addressU:1,addressV:1,mipmaps:0===a});var u=i.slice(1);if(t.loaded&&this.cmpArrays(u,o.slice(1)))l[0]=h[0]||null;else if(-1===u.indexOf(null)){var d=u.map((function(t){return t.resource})),f=[];for(s=0;s0,maxRetries:this.maxRetries},(function(i,s){if(i)e("Error loading font resource: "+t.original+" ["+i+"]");else{var a=Rl(s);n._loadTextures(t.load.replace(".json",".png"),a,(function(t,i){if(t)return e(t);e(null,{data:a,textures:i})}))}})):(i&&i.data&&(i.data=Rl(i.data)),this._loadTextures(t.load,i&&i.data,e))},e._loadTextures=function(t,e,i){for(var n=e.info.maps.length,s=0,a=null,r=new Array(n),o=this._loader,h=function(e){var h=function(t,o){if(!a){if(t)return a=t,i(t);o.upload(),r[e]=o,++s===n&&i(null,r)}};0===e?o.load(t,"texture",h):o.load(t.replace(".png",e+".png"),"texture",h)},l=0;l0,maxRetries:e},(function(e,n){if(e){var s="Error while loading scene JSON "+t.original;e.message?(s+=": "+e.message,e.stack&&(s+="\n"+e.stack)):s+=": "+e,i(s)}else i(e,n)}))},Nl=function(){function t(t){this._app=t,this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){Bl(t,this.maxRetries,e)},e.open=function(t,e){this._app.systems.script.preloading=!0;var i=new Fl(this._app,!1).parse(e);return this._app.systems.script.preloading=!1,i},t}(),Ul=function(){function t(){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t}),st.get(t.load,{retry:this.maxRetries>0,maxRetries:this.maxRetries},(function(i,n){i?e("Error loading html resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return e},e.patch=function(t,e){},t}(),zl=function(){function t(){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t});var i={retry:this.maxRetries>0,maxRetries:this.maxRetries};t.load.startsWith("blob:")&&(i.responseType=nt.ResponseType.JSON),st.get(t.load,i,(function(i,n){i?e("Error loading JSON resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return e},e.patch=function(t,e){},t}(),Vl=function(){function t(t,e,i,n,s){this.propertyName=t,this.parent=e,this._scope=s,this._registry=i,this.id=null,this.url=null,this.asset=null,this._onAssetLoad=n.load,this._onAssetAdd=n.add,this._onAssetRemove=n.remove,this._onAssetUnload=n.unload}var e=t.prototype;return e._bind=function(){this.id&&(this._onAssetLoad&&this._registry.on("load:"+this.id,this._onLoad,this),this._onAssetAdd&&this._registry.once("add:"+this.id,this._onAdd,this),this._onAssetRemove&&this._registry.on("remove:"+this.id,this._onRemove,this),this._onAssetUnload&&this._registry.on("unload:"+this.id,this._onUnload,this)),this.url&&(this._onAssetLoad&&this._registry.on("load:url:"+this.url,this._onLoad,this),this._onAssetAdd&&this._registry.once("add:url:"+this.url,this._onAdd,this),this._onAssetRemove&&this._registry.on("remove:url:"+this.url,this._onRemove,this))},e._unbind=function(){this.id&&(this._onAssetLoad&&this._registry.off("load:"+this.id,this._onLoad,this),this._onAssetAdd&&this._registry.off("add:"+this.id,this._onAdd,this),this._onAssetRemove&&this._registry.off("remove:"+this.id,this._onRemove,this),this._onAssetUnload&&this._registry.off("unload:"+this.id,this._onUnload,this)),this.url&&(this._onAssetLoad&&this._registry.off("load:"+this.url,this._onLoad,this),this._onAssetAdd&&this._registry.off("add:"+this.url,this._onAdd,this),this._onAssetRemove&&this._registry.off("remove:"+this.url,this._onRemove,this))},e._onLoad=function(t){this._onAssetLoad.call(this._scope,this.propertyName,this.parent,t)},e._onAdd=function(t){this.asset=t,this._onAssetAdd.call(this._scope,this.propertyName,this.parent,t)},e._onRemove=function(t){this._onAssetRemove.call(this._scope,this.propertyName,this.parent,t),this.asset=null},e._onUnload=function(t){this._onAssetUnload.call(this._scope,this.propertyName,this.parent,t)},W(t,[{key:"id",get:function(){return this._id},set:function(t){if(this.url)throw Error("Can't set id and url");this._unbind(),this._id=t,this.asset=this._registry.get(this._id),this._bind()}},{key:"url",get:function(){return this._url},set:function(t){if(this.id)throw Error("Can't set id and url");this._unbind(),this._url=t,this.asset=this._registry.getByUrl(this._url),this._bind()}}]),t}(),Wl=function(){function t(){this.removeInvalid=!0,this.valid=!0,this.enumValidators={occludeSpecular:this._createEnumValidator([0,1,2]),cull:this._createEnumValidator([0,1,2,3]),blendType:this._createEnumValidator([0,1,2,3,4,5,6,7,8,9,10]),shadingModel:this._createEnumValidator([0,1])}}var e=t.prototype;return e.setInvalid=function(t,e){this.valid=!1,this.removeInvalid&&delete e[t]},e.validate=function(t){var e=Kn,i="path"===t.mappingFormat;for(var n in t){var s=e[n];if(s)if(s.startsWith("enum")){var a=s.split(":")[1];this.enumValidators[a]&&(this.enumValidators[a](t[n])||this.setInvalid(n,t))}else if("number"===s)"number"!=typeof t[n]&&this.setInvalid(n,t);else if("boolean"===s)"boolean"!=typeof t[n]&&this.setInvalid(n,t);else if("string"===s)"string"!=typeof t[n]&&this.setInvalid(n,t);else if("vec2"===s)t[n]instanceof Array&&2===t[n].length||this.setInvalid(n,t);else if("rgb"===s)t[n]instanceof Array&&3===t[n].length||this.setInvalid(n,t);else if("texture"===s)i?"string"!=typeof t[n]&&null!==t[n]&&(t[n]instanceof Di||this.setInvalid(n,t)):"number"!=typeof t[n]&&null!==t[n]&&(t[n]instanceof Di||this.setInvalid(n,t));else if("boundingbox"===s)t[n].center&&t[n].center instanceof Array&&3===t[n].center.length||this.setInvalid(n,t),t[n].halfExtents&&t[n].halfExtents instanceof Array&&3===t[n].halfExtents.length||this.setInvalid(n,t);else if("cubemap"===s)"number"!=typeof t[n]&&null!==t[n]&&void 0!==t[n]&&(t[n]instanceof Di&&t[n].cubemap||this.setInvalid(n,t));else if("chunks"===s)for(var r=Object.keys(t[n]),o=0;o=0}},t}(),Gl=function(){function t(){this._validator=null}var e=t.prototype;return e.parse=function(t){var e=this.migrate(t),i=this._validate(e),n=new ns;return this.initialize(n,i),n},e.initialize=function(t,e){for(var i in e.validated||(e=this._validate(e)),e.chunks&&(t.chunks=G({},e.chunks)),e){var n=Kn[i],s=e[i];if("vec2"===n)t[i]=new ut(s[0],s[1]);else if("rgb"===n)t[i]=new at(s[0],s[1],s[2]);else if("texture"===n)s instanceof Di?t[i]=s:t[i]instanceof Di&&"number"==typeof s&&s>0||(t[i]=null);else if("cubemap"===n)s instanceof Di?t[i]=s:t[i]instanceof Di&&"number"==typeof s&&s>0||(t[i]=null),"cubeMap"!==i||s||(t.prefilteredCubemaps=null);else if("boundingbox"===n){var a=new lt(s.center[0],s.center[1],s.center[2]),r=new lt(s.halfExtents[0],s.halfExtents[1],s.halfExtents[2]);t[i]=new At(a,r)}else t[i]=e[i]}t.update()},e.migrate=function(t){var e;void 0===t.shadingModel&&("blinn"===t.shader?t.shadingModel=1:t.shadingModel=0),t.shader&&delete t.shader,t.mapping_format&&(t.mappingFormat=t.mapping_format,delete t.mapping_format);var i=[["bumpMapFactor","bumpiness"],["aoUvSet","aoMapUv"],["aoMapVertexColor","aoVertexColor"],["diffuseMapVertexColor","diffuseVertexColor"],["emissiveMapVertexColor","emissiveVertexColor"],["specularMapVertexColor","specularVertexColor"],["metalnessMapVertexColor","metalnessVertexColor"],["opacityMapVertexColor","opacityVertexColor"],["glossMapVertexColor","glossVertexColor"],["lightMapVertexColor","lightVertexColor"],["diffuseMapTint","diffuseTint"],["specularMapTint","specularTint"],["emissiveMapTint","emissiveTint"],["metalnessMapTint","metalnessTint"]];for(e=0;e0,maxRetries:this.maxRetries},(function(i,n){i?e&&e("Error loading material: "+t.original+" ["+i+"]"):e&&(n._engine=!0,e(null,n))}))},e.open=function(t,e){var i=this._parser.parse(e);return e._engine&&(i._data=e,delete e._engine),i},e._createPlaceholders=function(){this._placeholderTextures={};var t={white:[255,255,255,255],gray:[128,128,128,255],black:[0,0,0,255],normal:[128,128,255,255]};for(var e in t)if(t.hasOwnProperty(e)){this._placeholderTextures[e]=new Di(this._device,{width:2,height:2,format:7}),this._placeholderTextures[e].name="placeholder";for(var i=this._placeholderTextures[e].lock(),n=0;n<4;n++)for(var s=0;s<4;s++)i[4*n+s]=t[e][s];this._placeholderTextures[e].unlock()}},e.patch=function(t,e){t.resource._data&&(t._data=t.resource._data,delete t.resource._data),t.data.name=t.name,t.resource.name=t.name,this._bindAndAssignAssets(t,e),t.off("unload",this._onAssetUnload,this),t.on("unload",this._onAssetUnload,this)},e._onAssetUnload=function(t){delete t.data.parameters,delete t.data.chunks,delete t.data.name},e._assignTexture=function(t,e,i){e.resource[t]=i},e._getPlaceholderTexture=function(t){this._placeholderTextures||this._createPlaceholders();var e=Hl[t];return this._placeholderTextures[e]},e._assignPlaceholderTexture=function(t,e){e.resource[t]=this._getPlaceholderTexture(t,e)},e._onTextureLoad=function(t,e,i){this._assignTexture(t,e,i.resource),e.resource.update()},e._onTextureAdd=function(t,e,i){this._assets.load(i)},e._onTextureRemoveOrUnload=function(t,e,i){var n=e.resource;n&&e.resource[t]===i.resource&&(this._assignPlaceholderTexture(t,e),n.update())},e._assignCubemap=function(t,e,i){e.resource[t]=i[0],"cubeMap"===t&&(e.resource.prefilteredCubemaps=i.slice(1))},e._onCubemapLoad=function(t,e,i){this._assignCubemap(t,e,i.resources),this._parser.initialize(e.resource,e.data)},e._onCubemapAdd=function(t,e,i){0===e.data.shadingModel&&(e.loadFaces=!0),this._assets.load(i)},e._onCubemapRemoveOrUnload=function(t,e,i){var n=e.resource;e.data.prefilteredCubeMap128===i.resources[1]&&(this._assignCubemap(t,e,[null,null,null,null,null,null,null]),n.update())},e._bindAndAssignAssets=function(t,e){var i,n,s,a=this._parser.migrate(t.data),r=t.resource,o="path"===a.mappingFormat,h=Zn;for(i=0;i0){for(var c=i.blendIndices.data[4*h+l],u=!0,d=0;dn)return!1;for(var f=0;f=0;n--)if(l[n].boneNames.length>i){var f=l.splice(n,1)[0],p=[];for(s=0;s=0;a--)u[a].mesh===_.originalMesh&&(u.push({mesh:o,node:u[a].node}),e&&e.push({material:e[a].material,path:e[a].path}));for(s=0;s=0;a--)u[a].mesh===_.originalMesh&&(u.splice(a,1),e&&e.splice(a,1))}!function(t){for(var e=t.vertices,i=t.skins,n=t.meshes,s=t.meshInstances,a=0;a0&&Kl(s,null,this._device.getBoneLimit());for(i=0;i0&&(h>65535&&this._device.extUintElement?(s=new ys(this._device,2,r),a=new Uint32Array(s.lock())):(s=new ys(this._device,1,r),a=new Uint16Array(s.lock()))),{buffer:s,data:a}},e._parseMeshes=function(t,e,i,n,s,a){for(var r=t.model,o=[],h=0,l=0;l0,maxRetries:this.maxRetries};(t.load.startsWith("blob:")||t.load.startsWith("data:"))&&(".glb"===p.getExtension(t.original).toLowerCase()?i.responseType=nt.ResponseType.ARRAY_BUFFER:i.responseType=nt.ResponseType.JSON),st.get(t.load,i,(function(i,n){e&&(i?e("Error loading model: "+t.original+" ["+i+"]"):e(null,n))}))},e.open=function(t,e){for(var i=0;i0?console.assert("Script Ordering Error. Contact support@playcanvas.com"):t._types.push(e)};var e=t.prototype;return e.load=function(e,i){var n=this;"string"==typeof e&&(e={load:e,original:e});var s=this;hc.app=this._app,this._loadScript(e.load,(function(e,a,r){if(e)i(e);else if(hc.legacy){var o=null;t._types.length&&(o=t._types.pop()),o?n._scripts[a]=o:o=null,i(null,o,r)}else{for(var h={},l=0;l0,maxRetries:this.maxRetries},(function(i,n){i?e("Error loading shader resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return e},e.patch=function(t,e){},t}(),uc=[0,0,1,0,0,1,0,0,1,0,0,1],dc=[0,1,3,2,3,1],fc=function(t){function e(e,i){var n;return(n=t.call(this)||this)._device=e,n._pixelsPerUnit=i&&void 0!==i.pixelsPerUnit?i.pixelsPerUnit:1,n._renderMode=i&&void 0!==i.renderMode?i.renderMode:0,n._atlas=i&&void 0!==i.atlas?i.atlas:null,n._frameKeys=i&&void 0!==i.frameKeys?i.frameKeys:null,n._meshes=[],n._updatingProperties=!1,n._meshesDirty=!1,n._atlas&&n._frameKeys&&n._createMeshes(),n}H(e,t);var i=e.prototype;return i._createMeshes=function(){for(var t=this._meshes.length,e=0;e0,maxRetries:this.maxRetries},(function(t,i){t?e(t):e(null,i)}))},e.open=function(t,e){var i=new fc(this._device);return t&&(i.__data=e),i},e.patch=function(t,e){var i=t.resource;if(i.__data&&(t.data.pixelsPerUnit=i.__data.pixelsPerUnit,t.data.renderMode=i.__data.renderMode,t.data.frameKeys=i.__data.frameKeys,i.__data.textureAtlasAsset)){var n=e.getByUrl(i.__data.textureAtlasAsset);n?t.data.textureAtlasAsset=n.id:console.warn("Could not find textureatlas with url: "+i.__data.textureAtlasAsset)}i.startUpdate(),i.renderMode=t.data.renderMode,i.pixelsPerUnit=t.data.pixelsPerUnit,i.frameKeys=t.data.frameKeys,this._updateAtlas(t),i.endUpdate(),t.off("change",this._onAssetChange,this),t.on("change",this._onAssetChange,this)},e._updateAtlas=function(t){var e=t.resource;if(t.data.textureAtlasAsset){this._assets.off("load:"+t.data.textureAtlasAsset,mc,t),this._assets.on("load:"+t.data.textureAtlasAsset,mc,t);var i=this._assets.get(t.data.textureAtlasAsset);i&&i.resource?e.atlas=i.resource:i?this._assets.load(i):(this._assets.off("add:"+t.data.textureAtlasAsset,_c,t),this._assets.on("add:"+t.data.textureAtlasAsset,_c,t))}else e.atlas=null},e._onAssetChange=function(t,e,i,n){"data"===e&&i&&i.textureAtlasAsset&&n&&i.textureAtlasAsset!==n.textureAtlasAsset&&(this._assets.off("load:"+n.textureAtlasAsset,mc,t),this._assets.off("add:"+n.textureAtlasAsset,_c,t))},t}(),vc=function(){function t(t,e){this._app=t,this._data=e,this._templateRoot=null}var e=t.prototype;return e.instantiate=function(){return this._templateRoot||this._parseTemplate(),this._templateRoot.clone()},e._parseTemplate=function(){var t=new Fl(this._app,!0);this._templateRoot=t.parse(this._data)},t}(),yc=function(){function t(t){this._app=t,this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t});var i={retry:this.maxRetries>0,maxRetries:this.maxRetries};st.get(t.load,i,(function(i,n){i?e("Error requesting template: "+t.original):e(i,n)}))},e.open=function(t,e){return new vc(this._app,e)},t}(),xc=function(){function t(){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t}),st.get(t.load,{retry:this.maxRetries>0,maxRetries:this.maxRetries},(function(i,n){i?e("Error loading text resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return e},e.patch=function(t,e){},t}(),bc=function(t){function e(){var e;return(e=t.call(this)||this)._texture=null,e._frames=null,e}H(e,t);var i=e.prototype;return i.setFrame=function(t,e){var i=this._frames[t];i?(i.rect.copy(e.rect),i.pivot.copy(e.pivot),i.border.copy(e.border)):(i={rect:e.rect.clone(),pivot:e.pivot.clone(),border:e.border.clone()},this._frames[t]=i),this.fire("set:frame",t.toString(),i)},i.removeFrame=function(t){var e=this._frames[t];e&&(delete this._frames[t],this.fire("remove:frame",t.toString(),e))},i.destroy=function(){this._texture&&this._texture.destroy()},W(e,[{key:"texture",get:function(){return this._texture},set:function(t){this._texture=t,this.fire("set:texture",t)}},{key:"frames",get:function(){return this._frames},set:function(t){this._frames=t,this.fire("set:frames",t)}}]),e}(u),Sc={repeat:0,clamp:1,mirror:2},wc={nearest:0,linear:1,nearest_mip_nearest:2,linear_mip_nearest:4,nearest_mip_linear:3,linear_mip_linear:5},Tc=/^data\.frames\.(\d+)$/,Ac=function(){function t(t){this._loader=t,this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t});var i=this,n=this._loader.getHandler("texture");if(".json"!==p.getExtension(t.original))return n.load(t,e);st.get(t.load,{retry:this.maxRetries>0,maxRetries:this.maxRetries},(function(n,s){if(n)e(n);else{var a=t.original.replace(".json",".png");i._loader.load(a,"texture",(function(t,i){t?e(t):e(null,{data:s,texture:i})}))}}))},e.open=function(t,e){var i=new bc;if(e.texture&&e.data)i.texture=e.texture,i.__data=e.data;else{var n=this._loader.getHandler("texture").open(t,e);if(!n)return null;i.texture=n}return i},e.patch=function(t,e){t.resource.__data&&(void 0!==t.resource.__data.minfilter&&(t.data.minfilter=t.resource.__data.minfilter),void 0!==t.resource.__data.magfilter&&(t.data.magfilter=t.resource.__data.magfilter),void 0!==t.resource.__data.addressu&&(t.data.addressu=t.resource.__data.addressu),void 0!==t.resource.__data.addressv&&(t.data.addressv=t.resource.__data.addressv),void 0!==t.resource.__data.mipmaps&&(t.data.mipmaps=t.resource.__data.mipmaps),void 0!==t.resource.__data.anisotropy&&(t.data.anisotropy=t.resource.__data.anisotropy),void 0!==t.resource.__data.rgbm&&(t.data.rgbm=!!t.resource.__data.rgbm),t.data.frames=t.resource.__data.frames,delete t.resource.__data);var i=t.resource.texture;if(i&&(i.name=t.name,t.data.hasOwnProperty("minfilter")&&i.minFilter!==wc[t.data.minfilter]&&(i.minFilter=wc[t.data.minfilter]),t.data.hasOwnProperty("magfilter")&&i.magFilter!==wc[t.data.magfilter]&&(i.magFilter=wc[t.data.magfilter]),t.data.hasOwnProperty("addressu")&&i.addressU!==Sc[t.data.addressu]&&(i.addressU=Sc[t.data.addressu]),t.data.hasOwnProperty("addressv")&&i.addressV!==Sc[t.data.addressv]&&(i.addressV=Sc[t.data.addressv]),t.data.hasOwnProperty("mipmaps")&&i.mipmaps!==t.data.mipmaps&&(i.mipmaps=t.data.mipmaps),t.data.hasOwnProperty("anisotropy")&&i.anisotropy!==t.data.anisotropy&&(i.anisotropy=t.data.anisotropy),t.data.hasOwnProperty("rgbm"))){var n=t.data.rgbm?Ne:Be;i.type!==n&&(i.type=n)}t.resource.texture=i;var s={};for(var a in t.data.frames){var r=t.data.frames[a];s[a]={rect:new dt(r.rect),pivot:new ut(r.pivot),border:new dt(r.border)}}t.resource.frames=s,t.off("change",this._onAssetChange,this),t.on("change",this._onAssetChange,this)},e._onAssetChange=function(t,e,i){var n;if("data"===e||"data.frames"===e){var s={};for(var a in i.frames)n=i.frames[a],s[a]={rect:new dt(n.rect),pivot:new ut(n.pivot),border:new dt(n.border)};t.resource.frames=s}else{var r=e.match(Tc);if(r){var o=r[1];i?(t.resource.frames[o]?((n=t.resource.frames[o]).rect.set(i.rect[0],i.rect[1],i.rect[2],i.rect[3]),n.pivot.set(i.pivot[0],i.pivot[1]),n.border.set(i.border[0],i.border[1],i.border[2],i.border[3])):t.resource.frames[o]={rect:new dt(i.rect),pivot:new ut(i.pivot),border:new dt(i.border)},t.resource.fire("set:frame",o,t.resource.frames[o])):t.resource.frames[o]&&(delete t.resource.frames[o],t.resource.fire("remove:frame",o))}}},t}();function Mc(){var t,e,i,n=0,s=1,a=2,r=3,o=8,h=9,l=10,c=11,u=12,d=13,f=14,p=16,m={astc:l,dxt:a,etc1:n,etc2:n,pvr:o,atc:c,none:f},_={astc:l,dxt:r,etc1:p,etc2:s,pvr:h,atc:u,none:p},g=21,v=22,y=23,x=8,b=10,S=26,w=27,T=28,A=29,M=30,C=7,E=3,P=5,R=function(t,e){switch(t){case n:return e.formats.etc1?g:v;case s:return y;case a:return x;case r:return b;case o:return S;case h:return w;case l:return T;case c:return A;case u:return M;case d:return C;case f:return E;case p:return P}},I=function(t){for(var e=function(t,e){var i=t*(2/255)-1,n=e*(2/255)-1,s=Math.sqrt(1-Math.min(1,i*i+n*n));return Math.max(0,Math.min(255,Math.floor(.5*(s+1)*255)))},i=0;i>3}return e},D=function(){return"undefined"!=typeof performance?performance.now():0},k=function(t,n,s){if(s){if(t.formats.astc)return"astc"}else if(n){if(t.formats.etc2)return"etc2"}else if(t.formats.etc1||t.formats.etc2)return"etc1";return function(e){for(var i=0;i0?this.clients.shift().run(s):this.queue.push(s)}},e.enqueueClient=function(t){this.queue.length>0?t.run(this.queue.shift()):this.clients.push(t)},e.handleResponse=function(t,e,i){var n=this.callbacks[t];if(e)for(var s=0;s0&&++r<=o){var i=100*Math.pow(2,r);console.log("Error loading Texture from: '"+e+"' - Retrying in "+i+"ms...");var h=t.indexOf("?")>=0?"&":"?";a=setTimeout((function(){s.src=t+h+"retry="+Date.now(),a=null}),i)}else n("Error loading Texture from: '"+e+"'")},s.src=t},e._loadImageBitmap=function(t,e,i,n){var s={cache:!0,responseType:"blob",retry:this.maxRetries>0,maxRetries:this.maxRetries};st.get(t,s,(function(t,e){t?n(t):createImageBitmap(e,{premultiplyAlpha:"none"}).then((function(t){n(null,t)})).catch((function(t){n(t)}))}))},t}(),zc=[1481919403,3140563232,169478669],Vc={33776:8,33778:9,33779:Kt,36196:ie,37492:22,37496:23,35840:26,35841:ne,35842:27,35843:se,32849:6,32856:7,35905:19,35907:20,35898:18,34843:Zt,34842:$t};var Wc=function(){function t(t){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e,i){Eh.fetchArrayBuffer(t.load,e,i,this.maxRetries)},e.open=function(t,e,i){var n=this.parse(e);if(!n)return null;var s=new Di(i,{name:t,addressU:n.cubemap?1:0,addressV:n.cubemap?1:0,width:n.width,height:n.height,format:n.format,cubemap:n.cubemap,levels:n.levels});return s.upload(),s},e.parse=function(t){var e=new Uint32Array(t);if(zc[0]!==e[0]||zc[1]!==e[1]||zc[2]!==e[2])return null;var i={endianness:e[3],glType:e[4],glTypeSize:e[5],glFormat:e[6],glInternalFormat:e[7],glBaseInternalFormat:e[8],pixelWidth:e[9],pixelHeight:e[10],pixelDepth:e[11],numberOfArrayElements:e[12],numberOfFaces:e[13],numberOfMipmapLevels:e[14],bytesOfKeyValueData:e[15]};if(i.pixelDepth>1)return null;if(0!==i.numberOfArrayElements)return null;var n=Vc[i.glInternalFormat];if(void 0===n)return null;for(var s,a,r,o=16+i.bytesOfKeyValueData/4,h=i.numberOfFaces>1,l=[],c=0;c<(i.numberOfMipmapLevels||1);c++){var u=e[o++];h&&l.push([]);for(var d=h?l[c]:l,f=0;f<(h?6:1);++f)d.push((s=t,a=4*o,r=u,18===n?new Uint32Array(s,a,r/4):new Uint8Array(s,a,r))),o+=u+3>>2}return{format:n,width:i.pixelWidth,height:i.pixelHeight,levels:l,cubemap:h}},t}(),Gc=166,Hc=function(){function t(t,e){this.maxRetries=0,this.device=e}var e=t.prototype;return e.load=function(t,e,i){var n=this;Eh.fetchArrayBuffer(t.load,(function(s,a){s?e(s,a):n.parse(a,t,e,i)}),i,this.maxRetries)},e.open=function(t,e,i){var n=new Di(i,{name:t,addressU:e.cubemap?1:0,addressV:e.cubemap?1:0,width:e.width,height:e.height,format:e.format,cubemap:e.cubemap,levels:e.levels});return n.upload(),n},e.parse=function(t,e,i,n){var s=new K(t),a=[s.readU32be(),s.readU32be(),s.readU32be()];if(2873840728!==a[0]||540160187!==a[1]||218765834!==a[2])return null;for(var r={vkFormat:s.readU32(),typeSize:s.readU32(),pixelWidth:s.readU32(),pixelHeight:s.readU32(),pixelDepth:s.readU32(),layerCount:s.readU32(),faceCount:s.readU32(),levelCount:s.readU32(),supercompressionScheme:s.readU32()},o={dfdByteOffset:s.readU32(),dfdByteLength:s.readU32(),kvdByteOffset:s.readU32(),kvdByteLength:s.readU32(),sgdByteOffset:s.readU64(),sgdByteLength:s.readU64()},h=[],l=0;l1});for(var b,S=128,w=u?6:1,T=l===d?8:16,A=0;A32767)return this._readPixelsFlat(t,e,i);var s=[0,0,0,0];if(t.readArray(s),2!==s[0]||2!==s[1]||0!=(128&s[2]))return t.skip(-4),this._readPixelsFlat(t,e,i);var a,r,o,h,l,c,u=new ArrayBuffer(e*i*4),d=new Uint8Array(u),f=n?0:4*e*(i-1);for(r=0;r128){if(a+(l-=128)>e)return null;for(c=t.readU8(),o=0;oe)return null;for(o=0;o=0?t.split("?")[0]:t},e._getParser=function(t){var e=p.getExtension(this._getUrlWithoutParams(t)).toLowerCase().replace(".","");return this.parsers[e]||this.imgParser},e.load=function(t,e,i){"string"==typeof t&&(t={load:t,original:t}),this._getParser(t.original).load(t,e,i)},e.open=function(t,e,i){if(t){var n=this._getParser(t).open(t,e,this._device);return null===n?n=new Di(this._device,{width:4,height:4,format:6}):(!function(t){var e=Math.log2(Math.max(t._width,t._height))+1;if(!(7!==t._format&&t._format!==Jt||t._volume||t._compressed||1===t._levels.length||t._levels.length===e||(i=t._cubemap?t._levels[0][0]:t._levels[0],i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement))){for(var i,n=function(t,e,i){for(var n=Math.max(1,t>>1),s=Math.max(1,e>>1),a=new i.constructor(n*s*4),r=Math.floor(t/n),o=Math.floor(e/s),h=r*o,l=0;l>s-1),r=Math.max(1,t._height>>s-1);if(t._cubemap){for(var o=[],h=0;h<6;++h)o.push(n(a,r,t._levels[s-1][h]));t._levels.push(o)}else t._levels.push(n(a,r,t._levels[s-1]))}t._levelsUpdated=t._cubemap?[[!0,!0,!0,!0,!0,!0]]:[!0]}}(n),e.unswizzledGGGR&&(i.file.variants.basis.opt&=-9)),n}},e.patch=function(t,e){var i=t.resource;if(i){t.name&&t.name.length>0&&(i.name=t.name);var n=t.data;n.hasOwnProperty("minfilter")&&(i.minFilter=Yc[n.minfilter]),n.hasOwnProperty("magfilter")&&(i.magFilter=Yc[n.magfilter]),i.cubemap||(n.hasOwnProperty("addressu")&&(i.addressU=jc[n.addressu]),n.hasOwnProperty("addressv")&&(i.addressV=jc[n.addressv])),n.hasOwnProperty("mipmaps")&&(i.mipmaps=n.mipmaps),n.hasOwnProperty("anisotropy")&&(i.anisotropy=n.anisotropy),n.hasOwnProperty("flipY")&&(i.flipY=!!n.flipY),n.hasOwnProperty("type")?i.type=Kc[n.type]:n.hasOwnProperty("rgbm")&&n.rgbm?i.type=Ne:t.file&&0!=(8&t.file.opt)&&(i.type=ze)}},W(t,[{key:"crossOrigin",get:function(){return this.imgParser.crossOrigin},set:function(t){this.imgParser.crossOrigin=t}},{key:"maxRetries",get:function(){return this.imgParser.maxRetries},set:function(t){for(var e in this.imgParser.maxRetries=t,this.parsers)this.parsers.hasOwnProperty(e)&&(this.parsers[e].maxRetries=t)}}]),t}(),Qc=function(){function t(t){void 0===t&&(t=null),this._index={},this._key=t}var e=t.prototype;return e.addItem=function(t){for(var e,i=Y(t.tags._list);!(e=i()).done;){var n=e.value;this.add(n,t)}},e.removeItem=function(t){for(var e,i=Y(t.tags._list);!(e=i()).done;){var n=e.value;this.remove(n,t)}},e.add=function(t,e){this._index[t]&&-1!==this._index[t].list.indexOf(e)||(this._index[t]||(this._index[t]={list:[]},this._key&&(this._index[t].keys={})),this._index[t].list.push(e),this._key&&(this._index[t].keys[e[this._key]]=e))},e.remove=function(t,e){if(this._index[t]&&(!this._key||this._index[t].keys[e[this._key]])){var i=this._index[t].list.indexOf(e);-1!==i&&(this._index[t].list.splice(i,1),this._key&&delete this._index[t].keys[e[this._key]],0===this._index[t].list.length&&delete this._index[t])}},e.find=function(t){for(var e,i,n,s,a,r=this,o={},h=[],l=function(t,e){return r._index[t].list.length-r._index[e].list.length},c=0;c0?i[0]:null},e}(u),tu=function(){function t(t){this._assets=t,this._bundleAssets={},this._assetsInBundles={},this._urlsInBundles={},this._fileRequests={},this._assets.on("add",this._onAssetAdded,this),this._assets.on("remove",this._onAssetRemoved,this)}var e=t.prototype;return e._onAssetAdded=function(t){if("bundle"===t.type){this._bundleAssets[t.id]=t,this._registerBundleEventListeners(t.id);for(var e=0,i=t.data.assets.length;e=3&&i.length<=4){for(var u=0;ui.ind&&(h=i.ind),this._insertScriptInstance(r,h,o),this._scriptsIndex[a]={instance:r,onSwap:function(){n.swap(a)}},this[a]=r,i.preloading||r.__initializeAttributes(),this.fire("create",a,r),this.fire("create:"+a,r),this.system.app.scripts.on("swap:"+a,this._scriptsIndex[a].onSwap),i.preloading||(r.enabled&&!r._initialized&&(r._initialized=!0,r.initialize&&this._scriptMethod(r,e.scriptMethods.initialize)),r.enabled&&!r._postInitialized&&(r._postInitialized=!0,r.postInitialize&&this._scriptMethod(r,e.scriptMethods.postInitialize))),r}}else this._scriptsIndex[a]={awaiting:!0,ind:this._scripts.length};return null},i.destroy=function(t){var e=t,i=t;"string"==typeof i?i=this.system.app.scripts.get(i):i&&(e=i.__name);var n=this._scriptsIndex[e];if(delete this._scriptsIndex[e],!n)return!1;var s=n.instance;if(s&&!s._destroyed)if(s.enabled=!1,s._destroyed=!0,this._isLoopingThroughScripts)this._destroyedScripts.push(s);else{var a=this._removeScriptInstance(s);a>=0&&this._resetExecutionOrder(a,this._scripts.length)}return this.system.app.scripts.off("swap:"+e,n.onSwap),delete this[e],this.fire("destroy",e,s||null),this.fire("destroy:"+e,s||null),s&&s.fire("destroy"),!0},i.swap=function(t){var i=t,n=t;"string"==typeof n?n=this.system.app.scripts.get(n):n&&(i=n.__name);var s=this._scriptsIndex[i];if(!s||!s.instance)return!1;var a=s.instance,r=this._scripts.indexOf(a),o=new n({app:this.system.app,entity:this.entity,enabled:a.enabled,attributes:a.__attributes});return!!o.swap&&(o.__initializeAttributes(),this._scripts[r]=o,this._scriptsIndex[i].instance=o,this[i]=o,o.__executionOrder=r,a.update&&this._updateList.remove(a),a.postUpdate&&this._postUpdateList.remove(a),o.update&&this._updateList.insert(o),o.postUpdate&&this._postUpdateList.insert(o),this._scriptMethod(o,e.scriptMethods.swap,a),this.fire("swap",i,o),this.fire("swap:"+i,o),!0)},i.resolveDuplicatedEntityReferenceProperties=function(t,e){var i=this.entity.script;for(var n in t._scriptsIndex){var s=this.system.app.scripts.get(n);if(s){var a=t._scriptsIndex[n];if(a&&a.instance){var r=i[n].__attributesRaw,o=i[n].__attributes;if(r||o){var h=!!r,l=a.instance.__attributes;for(var c in l)if(l[c]){var u=s.attributes.get(c);if(u)if("entity"===u.type)this._resolveEntityScriptAttribute(u,c,l[c],h,r||o,e);else if("json"===u.type&&Array.isArray(u.schema))for(var d=l[c],f=r?r[c]:o[c],p=0;p=i||e<0)return!1;var n=t,s=t;"string"!=typeof s?s=t.__name:n=null;var a=this._scriptsIndex[s];if(!a||!a.instance)return!1;var r=a.instance;if(n&&!(r instanceof n))return!1;var o=this._scripts.indexOf(r);return-1!==o&&o!==e&&(this._scripts.splice(e,0,this._scripts.splice(o,1)[0]),this._resetExecutionOrder(0,i),this._updateList.sort(),this._postUpdateList.sort(),this.fire("move",s,r,e,o),this.fire("move:"+s,r,e,o),!0)},W(e,[{key:"enabled",get:function(){return this._enabled},set:function(t){var e=this._enabled;this._enabled=t,this.fire("set","enabled",e,t)}},{key:"scripts",get:function(){return this._scripts},set:function(t){for(var e in this._scriptsData=t,t)if(t.hasOwnProperty(e)){var i=this._scriptsIndex[e];if(i){if("boolean"==typeof t[e].enabled&&(i.enabled=!!t[e].enabled),"object"==typeof t[e].attributes)for(var n in t[e].attributes)if(!su.reservedNames.has(n)){if(!i.__attributes.hasOwnProperty(n)){var s=this.system.app.scripts.get(e);s&&s.attributes.add(n,{})}i[n]=t[e].attributes[n]}}else console.log(this.order)}}}]),e}(au);ru.scriptMethods={initialize:"initialize",postInitialize:"postInitialize",update:"update",postUpdate:"postUpdate",swap:"swap"};var ou=new RegExp("^\\s*function(?:\\s|\\s*\\/\\*.*\\*\\/\\s*)+([^\\(\\s\\/]*)\\s*"),hu=function(t){function e(e){var i;return(i=t.call(this)||this).app=void 0,i.entity=void 0,i._enabled=void 0,i._enabledOld=void 0,i._initialized=void 0,i._postInitialized=void 0,i.__destroyed=void 0,i.__attributes=void 0,i.__attributesRaw=void 0,i.__scriptType=void 0,i.__executionOrder=void 0,i.initScriptType(e),i}H(e,t);var i=e.prototype;return i.initScriptType=function(t){var e=this.constructor;this.app=t.app,this.entity=t.entity,this._enabled="boolean"!=typeof t.enabled||t.enabled,this._enabledOld=this.enabled,this.__destroyed=!1,this.__attributes={},this.__attributesRaw=t.attributes||{},this.__scriptType=e,this.__executionOrder=-1},e.__getScriptName=function(t){if("function"==typeof t){if("name"in Function.prototype)return t.name;if(t===Function||t===Function.prototype.constructor)return"Function";var e=(""+t).match(ou);return e?e[1]:void 0}},i.__initializeAttributes=function(t){if(t||this.__attributesRaw){for(var e in this.__scriptType.attributes.index)this.__attributesRaw&&this.__attributesRaw.hasOwnProperty(e)?this[e]=this.__attributesRaw[e]:this.__attributes.hasOwnProperty(e)||(this.__scriptType.attributes.index[e].hasOwnProperty("default")?this[e]=this.__scriptType.attributes.index[e].default:this[e]=null);this.__attributesRaw=null}},e.extend=function(t){for(var e in t)t.hasOwnProperty(e)&&(this.prototype[e]=t[e])},W(e,[{key:"enabled",get:function(){return this._enabled&&!this._destroyed&&this.entity.script.enabled&&this.entity.enabled},set:function(t){this._enabled=!!t,this.enabled!==this._enabledOld&&(this._enabledOld=this.enabled,this.fire(this.enabled?"enable":"disable"),this.fire("state",this.enabled),!this._initialized&&this.enabled&&(this._initialized=!0,this.__initializeAttributes(!0),this.initialize&&this.entity.script._scriptMethod(this,ru.scriptMethods.initialize)),this._initialized&&!this._postInitialized&&this.enabled&&!this.entity.script._beingEnabled&&(this._postInitialized=!0,this.postInitialize&&this.entity.script._scriptMethod(this,ru.scriptMethods.postInitialize)))}}],[{key:"scriptName",get:function(){return this.__name}},{key:"attributes",get:function(){return this.hasOwnProperty("__attributes")||(this.__attributes=new su(this)),this.__attributes}}]),e}(u);hu.__name=null;var lu=function(t){function e(e){var i;return(i=t.call(this)||this).app=e,i._scripts={},i._list=[],i}H(e,t);var i=e.prototype;return i.destroy=function(){this.app=null,this.off()},i.add=function(t){var e=this,i=t.__name;return this._scripts.hasOwnProperty(i)?(setTimeout((function(){if(t.prototype.swap){var n=e._scripts[i],s=e._list.indexOf(n);e._list[s]=t,e._scripts[i]=t,e.fire("swap",i,t),e.fire("swap:"+i,t)}else console.warn("script registry already has '"+i+"' script, define 'swap' method for new script type to enable code hot swapping")})),!1):(this._scripts[i]=t,this._list.push(t),this.fire("add",i,t),this.fire("add:"+i,t),setTimeout((function(){if(e._scripts.hasOwnProperty(i)&&e.app&&e.app.systems&&e.app.systems.script){var t,n=e.app.systems.script._components,s=[],a=[];for(n.loopIndex=0;n.loopIndexthis.views.length)for(var a=0;a<=s-this.views.length;a++){var r=this.viewsPool.pop();r||(r={viewport:new dt,projMat:new vt,viewMat:new vt,viewOffMat:new vt,viewInvMat:new vt,viewInvOffMat:new vt,projViewOffMat:new vt,viewMat3:new ct,position:new Float32Array(3),rotation:new yt}),this.views.push(r)}else if(s<=this.views.length)for(var o=0;o=this._right){var i=e.length;if(i)if(t=e[i-1])this._left=e[i-1],this._right=1/0,this._len=0,this._recip=0,this._p0=this._p1=i-1;else{var n=this._findKey(t,e);this._left=e[n],this._right=e[n+1],this._len=this._right-this._left;var s=1/this._len;this._recip=isFinite(s)?s:0,this._p0=n,this._p1=n+1}else this._left=-1/0,this._right=1/0,this._len=0,this._recip=0,this._p0=this._p1=0}this._t=0===this._recip?0:(t-this._left)*this._recip,this._hermite.valid=!1},e._findKey=function(t,e){for(var i=0;t>=e[i+1];)i++;return i},e.eval=function(t,e,i){var n=i._data,s=i._components,a=this._p0*s;if(0===e)for(var r=0;rthis.track.duration&&(i=e-this.track.duration,e=this.track.duration);this.track.events[this.eventCursor]&&this.track.events[this.eventCursor].time>=t&&(e===this.track.duration?this.track.events[this.eventCursor].time<=e:this.track.events[this.eventCursor].time0&&i>0&&this.activeEventsForFrame(e,e+n*t),e+=n*t,n>=0?e>i&&(s?e=e%i||0:(e=this._track.duration,this.pause())):e<0&&(s?e=i+(e%i||0):(e=0,this.pause())),this._time=e}this._time!==this._snapshot._time&&this._track.eval(this._time,this._snapshot)},e.play=function(){this._playing=!0,this._time=0},e.stop=function(){this._playing=!1,this._time=0},e.pause=function(){this._playing=!1},e.resume=function(){this._playing=!0},e.reset=function(){this._time=0},W(t,[{key:"name",get:function(){return this._name},set:function(t){this._name=t}},{key:"track",get:function(){return this._track}},{key:"snapshot",get:function(){return this._snapshot}},{key:"time",get:function(){return this._time},set:function(t){this._time=t}},{key:"speed",get:function(){return this._speed},set:function(t){this._speed=t}},{key:"loop",get:function(){return this._loop},set:function(t){this._loop=t}},{key:"blendWeight",get:function(){return this._blendWeight},set:function(t){this._blendWeight=t}},{key:"blendOrder",get:function(){return this._blendOrder},set:function(t){this._blendOrder=t}},{key:"eventCursor",get:function(){return this._eventCursor},set:function(t){this._eventCursor=t}}]),t}(),ld="NONE",cd="PREV_STATE",ud="NEXT_STATE",dd="PREV_STATE_NEXT_STATE",fd="NEXT_STATE_PREV_STATE",pd="GREATER_THAN",md="LESS_THAN",_d="GREATER_THAN_EQUAL_TO",gd="LESS_THAN_EQUAL_TO",vd="EQUAL_TO",yd="NOT_EQUAL_TO",xd="INTEGER",bd="FLOAT",Sd="BOOLEAN",wd="TRIGGER",Td="2D_DIRECTIONAL",Ad="2D_CARTESIAN",Md="DIRECT",Cd="START",Ed="END",Pd="ANY",Rd=[Cd,Ed,Pd],Id="OVERWRITE",Ld=function(){function t(t,e){this._component=t,this.mask=new Int8Array(t.layers.length),this.weights=new Float32Array(t.layers.length),this.totalWeight=0,this.counter=0,this.layerCounter=0,this.valueType=e,this.dirty=!0,this.value=[0,0,0,1]}var e=t.prototype;return e.getWeight=function(t){return this.dirty&&this.updateWeights(),0!==this.totalWeight&&this.mask[t]?this.weights[t]/this.totalWeight:0},e.setMask=function(t,e){this.mask[t]=e,this._component.layers[t].blendType===Id&&(this.mask=this.mask.fill(0,0,t)),this.dirty=!0},e.updateWeights=function(){this.totalWeight=0;for(var t=0;t0){i=1/Math.sqrt(i);for(var n=e.length,s=0;s0&&(a=1/Math.sqrt(a));for(var r=0;r0;)this.removeClip(0)},e.findClip=function(t){for(var e=this._clips,i=0;i0&&r._update(e);var c=void 0,u=void 0,d=void 0;if(l>=1)for(var f=0;f0)for(var p=0;p0&&i.push(n),i},t.encode=function(t,e,i){return(Array.isArray(t)?t.join("/"):t)+"/"+e+"/"+(Array.isArray(i)?i.join("/"):i)};var e=t.prototype;return e.resolve=function(t){return null},e.unresolve=function(t){},e.update=function(t){},t}(),Od=function(){function t(t,e,i,n){this._func=t,this._type=e,this._components=i,this._targetPath=n,this._isTransform="localRotation"===this._targetPath.substring(this._targetPath.length-13)||"localPosition"===this._targetPath.substring(this._targetPath.length-13)||"localScale"===this._targetPath.substring(this._targetPath.length-10)}return W(t,[{key:"func",get:function(){return this._func}},{key:"type",get:function(){return this._type}},{key:"components",get:function(){return this._components}},{key:"targetPath",get:function(){return this._targetPath}},{key:"isTransform",get:function(){return this._isTransform}}]),t}(),Fd=function(){function t(e){var i=this;if(this._isPathInMask=function(t,e){var n=i._mask[t];return!!n&&!!(n.children||e&&!1!==n.value)},this.graph=e,e){this._mask=null;var n={};!function t(e){n[e.name]=e;for(var i=0;i0){return t.createAnimTarget((function(t){for(var e=0;ei){this._time=this.looping?0:i;for(var n=0;n=0?1:-1,l=0;l=0;m+=h){var _=d[m],g=d[m+1];if(_.time<=this._time&&g.time>=this._time){var v=(this._time-_.time)/(g.time-_.time);f._pos.lerp(_.position,g.position,v),f._quat.slerp(_.rotation,g.rotation,v),f._scale.lerp(_.scale,g.scale,v),f._written=!0,this._currKeyIndices[u]=m,p=!0;break}}(1===d.length||!p&&0===this._time&&this.looping)&&(f._pos.copy(d[0].position),f._quat.copy(d[0].rotation),f._scale.copy(d[0].scale),f._written=!0)}}}},e.blend=function(t,e,i){for(var n=this._interpolatedKeys.length,s=0;s0&&i.prevAnim,i.blending&&(i.blend=0,i.blendSpeed=1/e),i.skeleton&&(i.blending?(i.fromSkel.animation=n,i.fromSkel.addTime(i.skeleton._time),i.toSkel.animation=s):i.skeleton.animation=s),i.animEvaluator){var a=i.animEvaluator;if(i.blending)for(;a.clips.length>1;)a.removeClip(0);else i.animEvaluator.removeClips();var r=new hd(i.animations[i.currAnim],0,1,!0,i.loop);r.name=i.currAnim,r.blendWeight=i.blending?0:1,r.reset(),i.animEvaluator.addClip(r)}}i.playing=!0}}},i.getAnimation=function(t){return this.data.animations[t]},i.setModel=function(t){var e=this.data;t!==e.model&&(this._resetAnimationController(),e.model=t,e.animations&&e.currAnim&&e.animations[e.currAnim]&&this.play(e.currAnim))},i._resetAnimationController=function(){var t=this.data;t.skeleton=null,t.fromSkel=null,t.toSkel=null,t.animEvaluator=null},i._createAnimationController=function(){var t=this.data,e=t.model,i=t.animations,n=!1,s=!1;for(var a in i){if(i.hasOwnProperty(a))i[a].constructor===ph?s=!0:n=!0}var r=e.getGraph();n?(t.fromSkel=new Nd(r),t.toSkel=new Nd(r),t.skeleton=new Nd(r),t.skeleton.looping=t.loop,t.skeleton.setGraph(r)):s&&(t.animEvaluator=new Dd(new Fd(this.entity)))},i.loadAnimationAssets=function(t){var e=this;if(t&&t.length)for(var i=this.system.app.assets,n=function(t){if(t.resources.length>1)for(var i=0;i1){if(n&&n.length>1)for(var a=0;a1)for(var o=0;o1)for(var h=0;h1)for(var e=0;e0&&this.play(r[0])}},i.onSetAssets=function(t,e,i){if(e&&e.length)for(var n=0;n0&&this.play(o[0])}},i.onBeforeRemove=function(){for(var t=0;t0)return e[e.length-1].time}return 0},set:function(t){var e=this.data;if(e.skeleton){var i=e.skeleton;i.currentTime=t,i.addTime(0),i.updateGraph()}if(e.animEvaluator)for(var n=e.animEvaluator,s=0;s=1&&(s.blend=1)),s.playing){var a=s.skeleton;if(null!==a&&null!==s.model){if(s.blending)a.blend(s.fromSkel,s.toSkel,s.blend);else{var r=t*s.speed;a.addTime(r),(s.speed>0&&a._time===a._animation.duration&&!s.loop||s.speed<0&&0===a._time&&!s.loop)&&(s.playing=!1)}s.blending&&1===s.blend&&(a.animation=s.toSkel._animation),a.updateGraph()}}var o=s.animEvaluator;if(o){for(var h=0;h1&&(o.clips[1].blendWeight=s.blend),o.update(t)}s.blending&&1===s.blend&&(s.blending=!1)}}},i.destroy=function(){t.prototype.destroy.call(this),this.app.systems.off("update",this.onUpdate,this)},e}(sd);au._buildAccessors(Ud.prototype,Vd);var Gd=function(){function t(t,e,i,n,s){void 0===s&&(s=1),this._state=t,this._parent=e,this._name=i,Array.isArray(n)?(this._point=new ut(n[0],n[1]),this._pointLength=this._point.length()):(this._point=n,this._pointLength=n),this._speed=s,this._weightedSpeed=1,this._weight=1,this._animTrack=null}return W(t,[{key:"parent",get:function(){return this._parent}},{key:"name",get:function(){return this._name}},{key:"path",get:function(){return this._parent?this._parent.path+"."+this._name:this._name}},{key:"point",get:function(){return this._point}},{key:"pointLength",get:function(){return this._pointLength}},{key:"weight",get:function(){return this._parent?this._parent.weight*this._weight:this._weight},set:function(t){this._weight=t}},{key:"normalizedWeight",get:function(){var t=this._state.totalWeight;return 0===t?0:this.weight/t}},{key:"speed",get:function(){return this._weightedSpeed*this._speed}},{key:"absoluteSpeed",get:function(){return Math.abs(this._speed)}},{key:"weightedSpeed",get:function(){return this._weightedSpeed},set:function(t){this._weightedSpeed=t}},{key:"animTrack",get:function(){return this._animTrack},set:function(t){this._animTrack=t}}]),t}(),Hd=function(t){function e(e,i,n,s,a,r,o,h,l){var c;(c=t.call(this,e,i,n,s)||this)._parameters=a,c._parameterValues=new Array(a.length),c._children=[],c._findParameter=l,c._syncAnimations=!1!==o,c._pointCache={};for(var u=0;u=0)this._animationList[n].animTrack=e;else{var s=this._getNodeFromPath(t);s.animTrack=e,this._animationList.push(s)}},W(t,[{key:"name",get:function(){return this._name}},{key:"animations",get:function(){return this._animationList},set:function(t){this._animationList=t}},{key:"speed",get:function(){return this._speed},set:function(t){this._speed=t}},{key:"loop",get:function(){return this._loop},set:function(t){this._loop=t}},{key:"nodeCount",get:function(){return this._blendTree&&this._blendTree.constructor!==Gd?this._blendTree.getNodeCount():1}},{key:"playable",get:function(){return-1!==Rd.indexOf(this.name)||this.animations.length===this.nodeCount}},{key:"looping",get:function(){if(this.animations.length>0){var t=this.name+"."+this.animations[0].animTrack.name,e=this._controller.animEvaluator.findClip(t);if(e)return e.loop}return!1}},{key:"totalWeight",get:function(){for(var t=0,e=0;et&&(t=i.animTrack.duration)}return t}}]),t}(),Zd=function(){function t(t){var e=t.from,i=t.to,n=t.time,s=void 0===n?0:n,a=t.priority,r=void 0===a?0:a,o=t.conditions,h=void 0===o?[]:o,l=t.exitTime,c=void 0===l?null:l,u=t.transitionOffset,d=void 0===u?null:u,f=t.interruptionSource,p=void 0===f?ld:f;this._from=e,this._to=i,this._time=s,this._priority=r,this._conditions=h,this._exitTime=c,this._transitionOffset=d,this._interruptionSource=p}return W(t,[{key:"from",get:function(){return this._from}},{key:"to",get:function(){return this._to},set:function(t){this._to=t}},{key:"time",get:function(){return this._time}},{key:"priority",get:function(){return this._priority}},{key:"conditions",get:function(){return this._conditions}},{key:"exitTime",get:function(){return this._exitTime}},{key:"transitionOffset",get:function(){return this._transitionOffset}},{key:"interruptionSource",get:function(){return this._interruptionSource}},{key:"hasExitTime",get:function(){return!!this.exitTime}}]),t}(),$d=function(){function t(t,e,i,n,s,a,r){this._animEvaluator=t,this._states={},this._stateNames=[],this._eventHandler=a,this._consumedTriggers=r;for(var o=0;o"+e];return i||(i=this._transitions.filter((function(i){return i.from===t&&i.to===e})),_o(i),this._findTransitionsBetweenStatesCache[t+"->"+e]=i),i},e._transitionHasConditionsMet=function(t){for(var e=t.conditions,i=0;in.value))return!1;break;case md:if(!(s.value=n.value))return!1;break;case gd:if(!(s.value<=n.value))return!1;break;case vd:if(s.value!==n.value)return!1;break;case yd:if(s.value===n.value)return!1}}return!0},e._findTransition=function(t,e){var i=this,n=[];if(t&&e)n=n.concat(this._findTransitionsBetweenStates(t,e));else if(this._isTransitioning)switch(this._transitionInterruptionSource){case cd:n=(n=n.concat(this._findTransitionsFromState(this._previousStateName))).concat(this._findTransitionsFromState(Pd));break;case ud:n=(n=n.concat(this._findTransitionsFromState(this._activeStateName))).concat(this._findTransitionsFromState(Pd));break;case dd:n=(n=(n=n.concat(this._findTransitionsFromState(this._previousStateName))).concat(this._findTransitionsFromState(this._activeStateName))).concat(this._findTransitionsFromState(Pd));break;case fd:n=(n=(n=n.concat(this._findTransitionsFromState(this._activeStateName))).concat(this._findTransitionsFromState(this._previousStateName))).concat(this._findTransitionsFromState(Pd))}else n=(n=n.concat(this._findTransitionsFromState(this._activeStateName))).concat(this._findTransitionsFromState(Pd));if((n=n.filter((function(t){if(t.to===i.activeStateName)return!1;if(t.hasExitTime){var e=i._getActiveStateProgressForTime(i._timeInStateBefore),n=i._getActiveStateProgressForTime(i._timeInState);if(t.exitTime<1&&i.activeState.loop&&(e-=Math.floor(e),n-=Math.floor(n)),!(t.exitTime>e&&t.exitTime<=n))return null}return i._transitionHasConditionsMet(t)}))).length>0){var s=n[0];if(s.to===Ed){var a=this._findTransitionsFromState(Cd)[0];s.to=a.to}return s}return null},e.updateStateFromTransition=function(t){var e,i,n;this.previousState=t.from?this.activeStateName:null,this.activeState=t.to;for(var s=0;s0&&t.transitionOffset<1,u=0,d=0;if(c){var f=l.timelineDuration*t.transitionOffset;u=f,d=f}this._timeInState=u,this._timeInStateBefore=d;for(var p=0;p0?n.blendWeight=0:n.blendWeight=l.animations[p].normalizedWeight,n.play(),c)n.time=l.timelineDuration*t.transitionOffset;else{var _=l.speed>=0?0:this.activeStateDuration;n.time=_}}},e._transitionToState=function(t){if(this._findState(t)){var e=this._findTransition(this._activeStateName,t);e||(this._animEvaluator.removeClips(),e=new Zd({from:null,to:t})),this.updateStateFromTransition(e)}},e.assignAnimation=function(t,e,i,n){var s=t.split("."),a=this._findState(s[0]);a||(a=new Kd(this,s[0],1),this._states[s[0]]=a,this._stateNames.push(s[0])),a.addAnimation(s,e),void 0!==i&&(a.speed=i),void 0!==n&&(a.loop=n),!this._playing&&this._activate&&this.playable&&this.play()},e.removeNodeAnimations=function(t){if(-1===Rd.indexOf(t)){var e=this._findState(t);if(e)return e.animations=[],!0}},e.play=function(t){t&&this._transitionToState(t),this._playing=!0},e.pause=function(){this._playing=!1},e.reset=function(){this._previousStateName=null,this._activeStateName=Cd,this._playing=!1,this._currTransitionTime=1,this._totalTransitionTime=1,this._isTransitioning=!1,this._timeInState=0,this._timeInStateBefore=0,this._animEvaluator.removeClips()},e.rebind=function(){this._animEvaluator.rebind()},e.update=function(t){if(this._playing){var e,i,n;this._timeInStateBefore=this._timeInState,this._timeInState+=t;var s=this._findTransition(this._activeStateName);if(s&&this.updateStateFromTransition(s),this._isTransitioning)if(this._currTransitionTime+=t,this._currTransitionTime<=this._totalTransitionTime){for(var a=0!==this._totalTransitionTime?this._currTransitionTime/this._totalTransitionTime:1,r=0;r1){var h=e.length>2?this._resolvePath(t,e.slice(0,-1)):t,l=e[e.length-2];return function(t){n[s]=i(t),h[l]=n}}return function(t){n[s]=i(t)}},i._createAnimTargetForProperty=function(t,i,n){if(this.handlers&&"weights"===i[0])return this.handlers.weights(t);if(this.handlers&&"material"===i[0]&&2===i.length){var s=i[1];if(s.endsWith("Map"))return this.handlers.materialTexture(t,s)}var a,r,o,h=this._resolvePath(t,i,!0);if(void 0===h)return null;if("number"==typeof h)a=this._setter(t,i,e._packFloat),r="vector",o=1;else if("boolean"==typeof h)a=this._setter(t,i,e._packBoolean),r="vector",o=1;else if("object"==typeof h)switch(h.constructor){case ut:a=this._setter(t,i,e._packVec2),r="vector",o=2;break;case lt:a=this._setter(t,i,e._packVec3),r="vector",o=3;break;case dt:a=this._setter(t,i,e._packVec4),r="vector",o=4;break;case at:a=this._setter(t,i,e._packColor),r="vector",o=4;break;case yt:a=this._setter(t,i,e._packQuat),r="quaternion",o=4;break;default:return null}return-1!==i.indexOf("material")?new Od((function(e){a(e),t.material.update()}),r,o,n):new Od(a,r,o,n)},i.rebind=function(){this.targetCache={},this.animComponent.rootBone?this.graph=this.animComponent.rootBone:this.graph=this.animComponent.entity;var t={};!function e(i){t[i.name]=i;for(var n=0;n0?this._layers[0]:null}}]),e}(au),of=function(){this.enabled=!0},hf=["enabled"],lf=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="anim",i.ComponentType=rf,i.DataType=of,i.schema=hf,i.on("beforeremove",i.onBeforeRemove,q(i)),i.app.systems.on("animationUpdate",i.onAnimationUpdate,q(i)),i}H(e,t);var i=e.prototype;return i.initializeComponentData=function(e,i,n){t.prototype.initializeComponentData.call(this,e,i,hf);var s=["animationAssets","stateGraph","layers","masks"];Object.keys(i).forEach((function(t){s.includes(t)||(e[t]=i[t])})),i.stateGraph&&(e.stateGraph=i.stateGraph,e.loadStateGraph(e.stateGraph)),i.layers?i.layers.forEach((function(t,i){t._controller.states.forEach((function(n){t._controller._states[n]._animationList.forEach((function(t){e.layers[i].assignAnimation(t.name,t.animTrack)}))}))})):i.animationAssets&&(e.animationAssets=Object.assign(e.animationAssets,i.animationAssets)),i.masks&&Object.keys(i.masks).forEach((function(t){if(e.layers[t]){var n=i.masks[t].mask,s={};Object.keys(n).forEach((function(t){s[decodeURI(t)]=n[t]})),e.layers[t].mask=s}}))},i.onAnimationUpdate=function(t){var e=this.store;for(var i in e)if(e.hasOwnProperty(i)){var n=e[i].entity.anim;n.data.enabled&&n.entity.enabled&&n.playing&&n.update(t)}},i.cloneComponent=function(t,e){var i;t.anim.rootBone&&t.anim.rootBone!==t||(i={},t.anim.layers.forEach((function(t,n){if(t.mask){var s={};Object.keys(t.mask).forEach((function(i){var n=i.split("/");n.shift();var a=[e.name].concat(n).join("/");s[a]=t.mask[i]})),i[n]={mask:s}}})));var n={stateGraphAsset:t.anim.stateGraphAsset,animationAssets:t.anim.animationAssets,speed:t.anim.speed,activate:t.anim.activate,playing:t.anim.playing,rootBone:t.anim.rootBone,stateGraph:t.anim.stateGraph,layers:t.anim.layers,layerIndices:t.anim.layerIndices,parameters:t.anim.parameters,masks:i};return this.addComponent(e,n)},i.onBeforeRemove=function(t,e){e.onBeforeRemove()},i.destroy=function(){t.prototype.destroy.call(this),this.app.systems.off("animationUpdate",this.onAnimationUpdate,this)},e}(sd);au._buildAccessors(rf.prototype,hf);var cf=function(t){function e(e,i){return t.call(this,e,i)||this}H(e,t);var i=e.prototype;return i.setCurrentListener=function(){if(this.enabled&&this.entity.audiolistener&&this.entity.enabled){this.system.current=this.entity;var t=this.system.current.getPosition();this.system.manager.listener.setPosition(t)}},i.onEnable=function(){this.setCurrentListener()},i.onDisable=function(){this.system.current===this.entity&&(this.system.current=null)},e}(au),uf=function(){this.enabled=!0},df=["enabled"],ff=function(t){function e(e,i){var n;return(n=t.call(this,e)||this).id="audiolistener",n.ComponentType=cf,n.DataType=uf,n.schema=df,n.manager=i,n.current=null,n.app.systems.on("update",n.onUpdate,q(n)),n}H(e,t);var i=e.prototype;return i.initializeComponentData=function(e,i,n){n=["enabled"],t.prototype.initializeComponentData.call(this,e,i,n)},i.onUpdate=function(t){if(this.current){var e=this.current.getPosition();this.manager.listener.setPosition(e);var i=this.current.getWorldTransform();this.manager.listener.setOrientation(i)}},i.destroy=function(){t.prototype.destroy.call(this),this.app.systems.off("update",this.onUpdate,this)},e}(sd);au._buildAccessors(cf.prototype,df);var pf=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this).on("set_assets",n.onSetAssets,q(n)),n.on("set_loop",n.onSetLoop,q(n)),n.on("set_volume",n.onSetVolume,q(n)),n.on("set_pitch",n.onSetPitch,q(n)),n.on("set_minDistance",n.onSetMinDistance,q(n)),n.on("set_maxDistance",n.onSetMaxDistance,q(n)),n.on("set_rollOffFactor",n.onSetRollOffFactor,q(n)),n.on("set_distanceModel",n.onSetDistanceModel,q(n)),n.on("set_3d",n.onSet3d,q(n)),n}H(e,t);var i=e.prototype;return i.play=function(t){if(this.enabled&&this.entity.enabled){var e;this.channel&&this.stop();var i=this.data;if(i.sources[t])if(i["3d"]){var n=this.entity.getPosition();e=this.system.manager.playSound3d(i.sources[t],n,i),i.currentSource=t,i.channel=e}else e=this.system.manager.playSound(i.sources[t],i),i.currentSource=t,i.channel=e}},i.pause=function(){this.channel&&this.channel.pause()},i.unpause=function(){this.channel&&this.channel.paused&&this.channel.unpause()},i.stop=function(){this.channel&&(this.channel.stop(),this.channel=null)},i.onSetAssets=function(t,e,i){var n=[],s=i.length;if(e&&e.length)for(var a=0;a1e-5){var i=this._tweenInfo.lerpColor;i.lerp(this._tweenInfo.from,this._tweenInfo.to,e),this._applyTintImmediately(new at(i.r,i.g,i.b,i.a))}else this._applyTintImmediately(this._tweenInfo.to),this._cancelTween()},i._cancelTween=function(){delete this._tweenInfo},i.onUpdate=function(){this._tweenInfo&&this._updateTintTween()},i.onEnable=function(){this._isHovering=!1,this._hoveringCounter=0,this._isPressed=!1,this._imageReference.onParentComponentEnable(),this._toggleHitElementListeners("on"),this._forceReapplyVisualState()},i.onDisable=function(){this._toggleHitElementListeners("off"),this._resetToDefaultVisualState(this.transitionMode)},i.onRemove=function(){this._toggleLifecycleListeners("off",this.system),this.onDisable()},e}(au);function Rf(t){return new at(t.r,t.g,t.b)}var If,Lf=function(){this.enabled=!0,this.active=!0,this.imageEntity=null,this.hitPadding=new dt,this.transitionMode=0,this.hoverTint=new at(.75,.75,.75),this.pressedTint=new at(.5,.5,.5),this.inactiveTint=new at(.25,.25,.25),this.fadeDuration=0,this.hoverSpriteAsset=null,this.hoverSpriteFrame=0,this.pressedSpriteAsset=null,this.pressedSpriteFrame=0,this.inactiveSpriteAsset=null,this.inactiveSpriteFrame=0},Df=["enabled","active",{name:"imageEntity",type:"entity"},{name:"hitPadding",type:"vec4"},"transitionMode",{name:"hoverTint",type:"rgba"},{name:"pressedTint",type:"rgba"},{name:"inactiveTint",type:"rgba"},"fadeDuration","hoverSpriteAsset","hoverSpriteFrame","pressedSpriteAsset","pressedSpriteFrame","inactiveSpriteAsset","inactiveSpriteFrame"],kf=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="button",i.ComponentType=Pf,i.DataType=Lf,i.schema=Df,i.on("beforeremove",i._onRemoveComponent,q(i)),i.app.systems.on("update",i.onUpdate,q(i)),i}H(e,t);var i=e.prototype;return i.initializeComponentData=function(e,i,n){t.prototype.initializeComponentData.call(this,e,i,Df)},i.onUpdate=function(t){var e=this.store;for(var i in e){var n=e[i].entity,s=n.button;s.enabled&&n.enabled&&s.onUpdate()}},i._onRemoveComponent=function(t,e){e.onRemove()},i.destroy=function(){t.prototype.destroy.call(this),this.app.systems.off("update",this.onUpdate,this)},e}(sd);au._buildAccessors(Pf.prototype,Df);var Of=function(t,e){this.effect=t,this.inputTarget=e,this.outputTarget=null,this.name=t.constructor.name},Ff=function(){function t(t,e){var i=this;this.app=t,this.camera=e,this.destinationRenderTarget=null,this.effects=[],this.enabled=!1,this.depthTarget=null,this.renderTargetScale=1,this.resizeTimeout=null,this.resizeLast=0,this._resizeTimeoutCallback=function(){i.resizeRenderTargets()},e.on("set:rect",this.onCameraRectChanged,this)}var e=t.prototype;return e._allocateColorBuffer=function(t,e){var i=this.camera.rect,n=Math.floor(i.z*this.app.graphicsDevice.width*this.renderTargetScale),s=Math.floor(i.w*this.app.graphicsDevice.height*this.renderTargetScale);return new Di(this.app.graphicsDevice,{name:e,format:t,width:n,height:s,mipmaps:!1,minFilter:0,magFilter:0,addressU:1,addressV:1})},e._createOffscreenTarget=function(t,e){var i=this.app.graphicsDevice,n=e?i.getHdrFormat():7,s=this.camera.entity.name+"-posteffect-"+this.effects.length,a=this._allocateColorBuffer(n,s),r=this.app.graphicsDevice.supportsStencil,o=t?i.samples:1;return new _s({colorBuffer:a,depth:t,stencil:r,samples:o})},e._resizeOffscreenTarget=function(t){var e=t.colorBuffer.format,i=t.colorBuffer.name;t.destroyFrameBuffers(),t.destroyTextureBuffers(),t._colorBuffer=this._allocateColorBuffer(e,i)},e._destroyOffscreenTarget=function(t){t.destroyTextureBuffers(),t.destroy()},e.setRenderTargetScale=function(t){this.renderTargetScale=t,this.resizeRenderTargets()},e.addEffect=function(t){var e=this.effects,i=0===e.length,n=this._createOffscreenTarget(i,t.hdr),s=new Of(t,n);e.push(s),this._sourceTarget=s.inputTarget,e.length>1&&(e[e.length-2].outputTarget=s.inputTarget),this._newPostEffect=t,t.needsDepthBuffer&&this._requestDepthMap(),this.enable(),this._newPostEffect=void 0},e.removeEffect=function(t){for(var e=-1,i=0,n=this.effects.length;i=0&&(e>0?this.effects[e-1].outputTarget=e+11&&(this.effects[1].inputTarget._depth||(this._destroyOffscreenTarget(this.effects[1].inputTarget),this.effects[1].inputTarget=this._createOffscreenTarget(!0,this.effects[1].hdr),this._sourceTarget=this.effects[1].inputTarget),this.camera.renderTarget=this.effects[1].inputTarget),this._destroyOffscreenTarget(this.effects[e].inputTarget),this.effects.splice(e,1)),this.enabled&&t.needsDepthBuffer&&this._releaseDepthMap(),0===this.effects.length&&this.disable()},e._requestDepthMaps=function(){for(var t=0,e=this.effects.length;t100?this.resizeRenderTargets():this.resizeTimeout=setTimeout(this._resizeTimeoutCallback,100))},e.resizeRenderTargets=function(){this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),this.resizeLast=Q();for(var t=this.camera.rect,e=Math.floor(t.z*this.app.graphicsDevice.width*this.renderTargetScale),i=Math.floor(t.w*this.app.graphicsDevice.height*this.renderTargetScale),n=this.effects,s=0,a=n.length;s=0&&(this.cameras.splice(e,1),_o(this.cameras))},i.destroy=function(){t.prototype.destroy.call(this),this.app.systems.off("update",this.onUpdate,this)},e}(sd);au._buildAccessors(Nf.prototype,zf);var Wf,Gf,Hf,Xf=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._compoundParent=null,n.entity.on("insert",n._onInsert,q(n)),n.on("set_type",n.onSetType,q(n)),n.on("set_halfExtents",n.onSetHalfExtents,q(n)),n.on("set_radius",n.onSetRadius,q(n)),n.on("set_height",n.onSetHeight,q(n)),n.on("set_axis",n.onSetAxis,q(n)),n.on("set_asset",n.onSetAsset,q(n)),n.on("set_renderAsset",n.onSetRenderAsset,q(n)),n.on("set_model",n.onSetModel,q(n)),n.on("set_render",n.onSetRender,q(n)),n}H(e,t);var i=e.prototype;return i.onSetType=function(t,e,i){e!==i&&this.system.changeType(this,e,i)},i.onSetHalfExtents=function(t,e,i){var n=this.data.type;this.data.initialized&&"box"===n&&this.system.recreatePhysicalShapes(this)},i.onSetRadius=function(t,e,i){var n=this.data.type;!this.data.initialized||"sphere"!==n&&"capsule"!==n&&"cylinder"!==n&&"cone"!==n||this.system.recreatePhysicalShapes(this)},i.onSetHeight=function(t,e,i){var n=this.data.type;!this.data.initialized||"capsule"!==n&&"cylinder"!==n&&"cone"!==n||this.system.recreatePhysicalShapes(this)},i.onSetAxis=function(t,e,i){var n=this.data.type;!this.data.initialized||"capsule"!==n&&"cylinder"!==n&&"cone"!==n||this.system.recreatePhysicalShapes(this)},i.onSetAsset=function(t,e,i){var n=this.system.app.assets;if(e){var s=n.get(e);s&&s.off("remove",this.onAssetRemoved,this)}if(i){i instanceof Eh&&(this.data.asset=i.id);var a=n.get(this.data.asset);a&&(a.off("remove",this.onAssetRemoved,this),a.on("remove",this.onAssetRemoved,this))}this.data.initialized&&"mesh"===this.data.type&&(i||(this.data.model=null),this.system.recreatePhysicalShapes(this))},i.onSetRenderAsset=function(t,e,i){var n=this.system.app.assets;if(e){var s=n.get(e);s&&s.off("remove",this.onRenderAssetRemoved,this)}if(i){i instanceof Eh&&(this.data.renderAsset=i.id);var a=n.get(this.data.renderAsset);a&&(a.off("remove",this.onRenderAssetRemoved,this),a.on("remove",this.onRenderAssetRemoved,this))}this.data.initialized&&"mesh"===this.data.type&&(i||(this.data.render=null),this.system.recreatePhysicalShapes(this))},i.onSetModel=function(t,e,i){this.data.initialized&&"mesh"===this.data.type&&this.system.implementations.mesh.doRecreatePhysicalShape(this)},i.onSetRender=function(t,e,i){this.onSetModel(t,e,i)},i.onAssetRemoved=function(t){t.off("remove",this.onAssetRemoved,this),this.data.asset===t.id&&(this.asset=null)},i.onRenderAssetRemoved=function(t){t.off("remove",this.onRenderAssetRemoved,this),this.data.renderAsset===t.id&&(this.renderAsset=null)},i._getCompoundChildShapeIndex=function(t){for(var e=this.data.shape,i=e.getNumChildShapes(),n=0;n-1&&e.rigidbody._triggers.splice(i,1),e.rigidbody.removeBody(t),t.forceActivationState(5)}},t}(),Jf=new vt,tp=new lt,ep=new yt,ip=new tn,np=["enabled","type","halfExtents","radius","axis","height","asset","renderAsset","shape","model","render"],sp=function(){function t(t){this.system=t}var e=t.prototype;return e.beforeInitialize=function(t,e){e.shape=null,e.model=new Uo,e.model.graph=new tn},e.afterInitialize=function(t,e){this.recreatePhysicalShapes(t),t.data.initialized=!0},e.reset=function(t,e){this.beforeInitialize(t,e),this.afterInitialize(t,e)},e.recreatePhysicalShapes=function(t){var e=t.entity,i=t.data;if("undefined"!=typeof Ammo){e.trigger&&(e.trigger.destroy(),delete e.trigger),i.shape&&(t._compoundParent&&(this.system._removeCompoundChild(t._compoundParent,i.shape),t._compoundParent.entity.rigidbody&&t._compoundParent.entity.rigidbody.activate()),Ammo.destroy(i.shape),i.shape=null),i.shape=this.createPhysicalShape(t.entity,i);var n=!t._compoundParent;if("compound"!==i.type||t._compoundParent&&t!==t._compoundParent){if("compound"!==i.type&&(t._compoundParent&&t===t._compoundParent&&e.forEach(this.system.implementations.compound._updateEachDescendant,t),!t.rigidbody)){t._compoundParent=null;for(var s=e.parent;s;){if(s.collision&&"compound"===s.collision.type){t._compoundParent=s.collision;break}s=s.parent}}}else t._compoundParent=t,e.forEach(this._addEachDescendant,t);t._compoundParent&&t!==t._compoundParent&&(n&&0===t._compoundParent.shape.getNumChildShapes()?this.system.recreatePhysicalShapes(t._compoundParent):(this.system.updateCompoundChildTransform(e),t._compoundParent.entity.rigidbody&&t._compoundParent.entity.rigidbody.activate())),e.rigidbody?(e.rigidbody.disableSimulation(),e.rigidbody.createBody(),e.enabled&&e.rigidbody.enabled&&e.rigidbody.enableSimulation()):t._compoundParent||(e.trigger?e.trigger.initialize(i):e.trigger=new Qf(this.system.app,t,i))}},e.createPhysicalShape=function(t,e){},e.updateTransform=function(t,e,i,n){t.entity.trigger&&t.entity.trigger.updateTransform()},e.beforeRemove=function(t,e){e.data.shape&&(e._compoundParent&&!e._compoundParent.entity._destroying&&(this.system._removeCompoundChild(e._compoundParent,e.data.shape),e._compoundParent.entity.rigidbody&&e._compoundParent.entity.rigidbody.activate()),e._compoundParent=null,Ammo.destroy(e.data.shape),e.data.shape=null)},e.remove=function(t,e){var i=this.system.app;t.rigidbody&&t.rigidbody.body&&t.rigidbody.disableSimulation(),t.trigger&&(t.trigger.destroy(),delete t.trigger),i.scene.containsModel(e.model)&&(i.root.removeChild(e.model.graph),i.scene.removeModel(e.model))},e.clone=function(t,e){var i=this.system.store[t.getGuid()],n={enabled:i.data.enabled,type:i.data.type,halfExtents:[i.data.halfExtents.x,i.data.halfExtents.y,i.data.halfExtents.z],radius:i.data.radius,axis:i.data.axis,height:i.data.height,asset:i.data.asset,renderAsset:i.data.renderAsset,model:i.data.model,render:i.data.render};return this.system.addComponent(e,n)},t}(),ap=function(t){function e(){return t.apply(this,arguments)||this}return H(e,t),e.prototype.createPhysicalShape=function(t,e){if("undefined"!=typeof Ammo){var i=e.halfExtents,n=new Ammo.btVector3(i?i.x:.5,i?i.y:.5,i?i.z:.5),s=new Ammo.btBoxShape(n);return Ammo.destroy(n),s}},e}(sp),rp=function(t){function e(){return t.apply(this,arguments)||this}return H(e,t),e.prototype.createPhysicalShape=function(t,e){if("undefined"!=typeof Ammo)return new Ammo.btSphereShape(e.radius)},e}(sp),op=function(t){function e(){return t.apply(this,arguments)||this}return H(e,t),e.prototype.createPhysicalShape=function(t,e){var i=void 0!==e.axis?e.axis:1,n=e.radius||.5,s=Math.max((e.height||2)-2*n,0),a=null;if("undefined"!=typeof Ammo)switch(i){case 0:a=new Ammo.btCapsuleShapeX(n,s);break;case 1:a=new Ammo.btCapsuleShape(n,s);break;case 2:a=new Ammo.btCapsuleShapeZ(n,s)}return a},e}(sp),hp=function(t){function e(){return t.apply(this,arguments)||this}return H(e,t),e.prototype.createPhysicalShape=function(t,e){var i=void 0!==e.axis?e.axis:1,n=void 0!==e.radius?e.radius:.5,s=void 0!==e.height?e.height:1,a=null,r=null;if("undefined"!=typeof Ammo)switch(i){case 0:a=new Ammo.btVector3(.5*s,n,n),r=new Ammo.btCylinderShapeX(a);break;case 1:a=new Ammo.btVector3(n,.5*s,n),r=new Ammo.btCylinderShape(a);break;case 2:a=new Ammo.btVector3(n,n,.5*s),r=new Ammo.btCylinderShapeZ(a)}return a&&Ammo.destroy(a),r},e}(sp),lp=function(t){function e(){return t.apply(this,arguments)||this}return H(e,t),e.prototype.createPhysicalShape=function(t,e){var i=void 0!==e.axis?e.axis:1,n=void 0!==e.radius?e.radius:.5,s=void 0!==e.height?e.height:1,a=null;if("undefined"!=typeof Ammo)switch(i){case 0:a=new Ammo.btConeShapeX(n,s);break;case 1:a=new Ammo.btConeShape(n,s);break;case 2:a=new Ammo.btConeShapeZ(n,s)}return a},e}(sp),cp=function(t){function e(){return t.apply(this,arguments)||this}H(e,t);var i=e.prototype;return i.beforeInitialize=function(t,e){},i.createAmmoMesh=function(t,e,i){var n;if(this.system._triMeshCache[t.id])n=this.system._triMeshCache[t.id];else{for(var s,a,r=t.vertexBuffer,o=r.getFormat(),h=0;h=0&&this.model.meshInstances.splice(i,1),this.unmaskMeshInstance=null}this._entity.enabled&&this._element.enabled&&(this._element.removeModelFromLayers(this.model),this._element.addModelToLayers(this.model))}},e.setMaterial=function(t){this.meshInstance&&(this.meshInstance.material=t,this.unmaskMeshInstance&&(this.unmaskMeshInstance.material=t))},e.setParameter=function(t,e){this.meshInstance&&(this.meshInstance.setParameter(t,e),this.unmaskMeshInstance&&this.unmaskMeshInstance.setParameter(t,e))},e.deleteParameter=function(t){this.meshInstance&&(this.meshInstance.deleteParameter(t),this.unmaskMeshInstance&&this.unmaskMeshInstance.deleteParameter(t))},e.setUnmaskDrawOrder=function(){if(this.meshInstance){if(this.unmaskMeshInstance){var t=function t(e){var i,n=e.children,s=n.length;if(s){for(var a=0;a0?this._symbols[0]:null,this._buf=[],this._mode="text",this._error=null}var e=t.prototype;return e.read=function(){for(var t=this._read();8===t;)t=this._read();return 0!==t&&1!==t&&(this._last=this._index),t},e.buf=function(){return this._buf},e.last=function(){return this._last},e.error=function(){return this._error},e.debugPrint=function(){for(var t=["EOF","ERROR","TEXT","OPEN_BRACKET","CLOSE_BRACKET","EQUALS","STRING","IDENTIFIER","WHITESPACE"],e=this.read(),i="";i+=(i.length>0?"\n":"")+t[e]+" '"+this.buf().join("")+"'",0!==e&&1!==e;)e=this.read();return i},e._read=function(){return this._buf=[],this._eof()?0:"text"===this._mode?this._text():this._tag()},e._text=function(){for(;;)switch(this._cur){case null:return this._buf.length>0?2:0;case"[":return this._mode="tag",this._buf.length>0?2:this._tag();case"\\":switch(this._next(),this._cur){case"[":this._store();break;default:this._output("\\")}break;default:this._store()}},e._tag=function(){switch(this._cur){case null:return this._error="unexpected end of input reading tag",1;case"[":return this._store(),3;case"]":return this._store(),this._mode="text",4;case"=":return this._store(),5;case" ":case"\t":case"\n":case"\r":case"\v":case"\f":return this._whitespace();case'"':return this._string();default:return this._isIdentifierSymbol(this._cur)?this._identifier():(this._error="unrecognized character",1)}},e._whitespace=function(){for(this._store();-1!==" \t\n\r\v\f".indexOf(this._cur);)this._store();return 8},e._string=function(){for(this._next();;)switch(this._cur){case null:return this._error="unexpected end of input reading string",1;case'"':return this._next(),6;default:this._store()}},e._identifier=function(){for(this._store();null!==this._cur&&this._isIdentifierSymbol(this._cur);)this._store();return 7},e._isIdentifierSymbol=function(t){return 1===t.length&&null!==t.match(vp)},e._eof=function(){return null===this._cur},e._next=function(){return this._eof()||(this._index++,this._cur=this._index=0;--s)if(n==="/"+e[s].name&&null===e[s].end)return e[s].end=t.length,4===(i=this._scanner.read())||(this._error="expected close bracket",!1);return this._error="failed to find matching tag",!1}var a={name:n,value:null,attributes:{},start:t.length,end:null};if(5===(i=this._scanner.read())){if(6!==(i=this._scanner.read()))return this._error="expected string",!1;a.value=this._scanner.buf().join(""),i=this._scanner.read()}for(;;){switch(i){case 4:return e.push(a),!0;case 7:var r=this._scanner.buf().join("");if(5!==(i=this._scanner.read()))return this._error="expected equals",!1;if(6!==(i=this._scanner.read()))return this._error="expected string",!1;var o=this._scanner.buf().join("");a.attributes[r]=o;break;default:return this._error="expected close bracket or identifier",!1}i=this._scanner.read()}},t}();function bp(t,e){for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];n instanceof Object?(t.hasOwnProperty(i)||(t[i]={}),bp(t[i],e[i])):t[i]=n}}function Sp(t){if(0===t.length)return null;for(var e={},i=0;i=1e-4,v=this._element.calculatedWidth;(this.autoWidth&&!g||!this._wrapLines)&&(v=Number.POSITIVE_INFINITY);var y,x,b,S,w=0,T=0;function A(t,i,n){e._lineWidths.push(Math.abs(n));var s=f>i?i+1:f,a=f>i?f+1:i,h=t.slice(s,a);if(_)for(var l=h.length;l--&&_>0;)Mp.test(h[l])&&(h.splice(l,1),_--);e._lineContents.push(h.join("")),r=0,o-=e._scaledLineHeight,c++,p=0,m=0,_=0,u=0,f=i}for(var M=!0;M;){M=!1,this._scaledLineHeight=s?this._lineHeight*this._fontSize/(this._maxFontSize||1e-4):this._lineHeight,this.width=0,this.height=0,this._lineWidths=[],this._lineContents=[],r=0,o=0,h=0,l=0,c=1,u=0,d=0,f=0,p=0,m=0,_=0;var C=this._fontSize/32;w=this._fontMinY*C,T=this._fontMaxY*C;for(var E=0;E=a?null:this._symbols[L+1],Mp.test(y))_++,(!this._wrapLines||this._maxLines<0||c0){var V=this._font.data.kerning;if(V){var W=V[U.getCodePoint(this._symbols[L-1])||0];W&&(z=W[U.getCodePoint(this._symbols[L])||0]||0)}}B=x.scale||1,F=C*((x.width+x.height)/2)/B,O=(x.xadvance+z)*C,D=(x.xoffset-z)*C,k=x.yoffset*C}else console.error("Couldn't substitute missing character: '"+y+"'");var G=Cp.test(y),H=this._meshInfo[x&&x.map||0],X=r+this._spacing*O;if(X>v&&m>0&&!G&&(this._maxLines<0||cthis._element.calculatedWidth&&(st=Math.floor(this._element.fontSize*this._element.calculatedWidth/(this.width||1e-4)),(st=it.clamp(st,i,n))!==this._element.fontSize)){this._fontSize=st,M=!0;break}if(this.height=Math.max(this.height,T-(o+w)),this._shouldAutoFitHeight()&&this.height>this._element.calculatedHeight&&(st=it.clamp(this._fontSize-1,i,n))!==this._element.fontSize){this._fontSize=st,M=!0;break}r+=this._spacing*O,G||(l=r),(this._isWordBoundary(y)||this._isValidNextChar(S)&&(this._isNextCJKBoundary(y,S)||this._isNextCJKWholeWord(S)))&&(p++,u=l,d=L+1),m++;var at=this._getUv(y);if(H.uvs[4*b*2+0]=at[0],H.uvs[4*b*2+1]=1-at[1],H.uvs[4*b*2+2]=at[2],H.uvs[4*b*2+3]=1-at[1],H.uvs[4*b*2+4]=at[2],H.uvs[4*b*2+5]=1-at[3],H.uvs[4*b*2+6]=at[0],H.uvs[4*b*2+7]=1-at[3],this._symbolColors){var rt=3*this._symbolColors[L];P=this._colorPalette[rt],R=this._colorPalette[rt+1],I=this._colorPalette[rt+2]}H.colors[4*b*4+0]=P,H.colors[4*b*4+1]=R,H.colors[4*b*4+2]=I,H.colors[4*b*4+3]=255,H.colors[4*b*4+4]=P,H.colors[4*b*4+5]=R,H.colors[4*b*4+6]=I,H.colors[4*b*4+7]=255,H.colors[4*b*4+8]=P,H.colors[4*b*4+9]=R,H.colors[4*b*4+10]=I,H.colors[4*b*4+11]=255,H.colors[4*b*4+12]=P,H.colors[4*b*4+13]=R,H.colors[4*b*4+14]=I,H.colors[4*b*4+15]=255,H.quad++}}M||f=At?(Mt.element.POSITION.set(0,0,0),Mt.element.TEXCOORD0.set(0,0),Mt.element.COLOR.set(0,0,0,0)):(Mt.element.POSITION.set(this._meshInfo[ut].positions[3*Ct+0],this._meshInfo[ut].positions[3*Ct+1],this._meshInfo[ut].positions[3*Ct+2]),Mt.element.TEXCOORD0.set(this._meshInfo[ut].uvs[2*Ct+0],this._meshInfo[ut].uvs[2*Ct+1]),Mt.element.COLOR.set(this._meshInfo[ut].colors[4*Ct+0],this._meshInfo[ut].colors[4*Ct+1],this._meshInfo[ut].colors[4*Ct+2],this._meshInfo[ut].colors[4*Ct+3])),Mt.next();Mt.end(),this._meshInfo[ut].meshInstance.mesh.aabb.compute(this._meshInfo[ut].positions),this._meshInfo[ut].meshInstance._aabbVer=-1}this._aabbDirty=!0},e._onFontRender=function(){this.font=this._font},e._onFontLoad=function(t){this.font!==t.resource&&(this.font=t.resource)},e._onFontChange=function(t,e,i,n){if("data"===e){this._font.data=i;for(var s=this._font.data.info.maps.length,a=0;athis._font.textures.length&&(this._meshInfo.length=this._font.textures.length),this._updateText()}}},{key:"alignment",get:function(){return this._alignment},set:function(t){t instanceof ut?this._alignment.set(t.x,t.y):this._alignment.set(t[0],t[1]),this._font&&this._updateText()}},{key:"autoWidth",get:function(){return this._autoWidth},set:function(t){var e=this._autoWidth;if(this._autoWidth=t,t&&Math.abs(this._element.anchor.x-this._element.anchor.z)<1e-4&&(this._element.width=this.width),e!==t){var i=this._shouldAutoFit()?this._maxFontSize:this._originalFontSize;i!==this._fontSize&&(this._fontSize=i,this._font&&this._updateText())}}},{key:"autoHeight",get:function(){return this._autoHeight},set:function(t){var e=this._autoHeight;if(this._autoHeight=t,t&&Math.abs(this._element.anchor.y-this._element.anchor.w)<1e-4&&(this._element.height=this.height),e!==t){var i=this._shouldAutoFit()?this._maxFontSize:this._originalFontSize;i!==this._fontSize&&(this._fontSize=i,this._font&&this._updateText())}}},{key:"rtlReorder",get:function(){return this._rtlReorder},set:function(t){this._rtlReorder!==t&&(this._rtlReorder=t,this._font&&this._updateText())}},{key:"unicodeConverter",get:function(){return this._unicodeConverter},set:function(t){this._unicodeConverter!==t&&(this._unicodeConverter=t,this._setText(this._text))}},{key:"aabb",get:function(){if(this._aabbDirty){for(var t=!1,e=0;e=0&&this.system._prerender.splice(i,1),this.system._prerender.indexOf(t)<0&&this.system._prerender.push(t)}t=e}},i._onPrerender=function(){for(var t=0;t=0&&this.system.app.batcher.insert(xa.ELEMENT,this.batchGroupId,this.entity),this.fire("enableelement")},i.onDisable=function(){this.system.app.scene.off("set:layers",this.onLayersChanged,this),this.system.app.scene.layers&&(this.system.app.scene.layers.off("add",this.onLayerAdded,this),this.system.app.scene.layers.off("remove",this.onLayerRemoved,this)),this._image&&this._image.onDisable(),this._text&&this._text.onDisable(),this._group&&this._group.onDisable(),this.system.app.elementInput&&this.useInput&&this.system.app.elementInput.removeElement(this),this._batchGroupId>=0&&this.system.app.batcher.remove(xa.ELEMENT,this.batchGroupId,this.entity),this.fire("disableelement")},i.onRemove=function(){this.entity.off("insert",this._onInsert,this),this._unpatch(),this._image&&this._image.destroy(),this._text&&this._text.destroy(),this.system.app.elementInput&&this.useInput&&this.system.app.elementInput.removeElement(this),this.screen&&this.screen.screen&&(this._unbindScreen(this.screen.screen),this.screen.screen.syncDrawOrder()),this.off()},i._calculateSize=function(t,e){if(this.entity._parent||this.screen){this._calculateLocalAnchors();var i=this._absRight-this._absLeft,n=this._absTop-this._absBottom;t?this._setWidth(i):this._setCalculatedWidth(i,!1),e?this._setHeight(n):this._setCalculatedHeight(n,!1);var s=this.entity.getLocalPosition();s.x=this._margin.x+this._calculatedWidth*this._pivot.x,s.y=this._margin.y+this._calculatedHeight*this._pivot.y,this.entity.setLocalPosition(s),this._sizeDirty=!1}},i._setWidth=function(t){this._width=t,this._setCalculatedWidth(t,!1),this.fire("set:width",this._width)},i._setHeight=function(t){this._height=t,this._setCalculatedHeight(t,!1),this.fire("set:height",this._height)},i._setCalculatedWidth=function(t,e){if(!(Math.abs(t-this._calculatedWidth)<=1e-4)){if(this._calculatedWidth=t,this.entity._dirtifyLocal(),e){var i=this.entity.getLocalPosition(),n=this._pivot;this._margin.x=i.x-this._calculatedWidth*n.x,this._margin.z=this._localAnchor.z-this._localAnchor.x-this._calculatedWidth-this._margin.x}this._flagChildrenAsDirty(),this.fire("set:calculatedWidth",this._calculatedWidth),this.fire("resize",this._calculatedWidth,this._calculatedHeight)}},i._setCalculatedHeight=function(t,e){if(!(Math.abs(t-this._calculatedHeight)<=1e-4)){if(this._calculatedHeight=t,this.entity._dirtifyLocal(),e){var i=this.entity.getLocalPosition(),n=this._pivot;this._margin.y=i.y-this._calculatedHeight*n.y,this._margin.w=this._localAnchor.w-this._localAnchor.y-this._calculatedHeight-this._margin.y}this._flagChildrenAsDirty(),this.fire("set:calculatedHeight",this._calculatedHeight),this.fire("resize",this._calculatedWidth,this._calculatedHeight)}},i._flagChildrenAsDirty=function(){for(var t=this.entity._children,e=0,i=t.length;e=0&&this._addedModels.splice(e,1);for(var i=0;ii||f>n||p.001}},{key:"_hasSplitAnchorsY",get:function(){return Math.abs(this._anchor.y-this._anchor.w)>.001}},{key:"aabb",get:function(){return this._image?this._image.aabb:this._text?this._text.aabb:null}},{key:"anchor",get:function(){return this._anchor},set:function(t){t instanceof dt?this._anchor.set(t.x,t.y,t.z,t.w):this._anchor.set(t[0],t[1],t[2],t[3]),this.entity._parent||this.screen?this._calculateSize(this._hasSplitAnchorsX,this._hasSplitAnchorsY):this._calculateLocalAnchors(),this._anchorDirty=!0,this.entity._dirtyLocal||this.entity._dirtifyLocal(),this.fire("set:anchor",this._anchor)}},{key:"batchGroupId",get:function(){return this._batchGroupId},set:function(t){this._batchGroupId!==t&&(this.entity.enabled&&this._batchGroupId>=0&&this.system.app.batcher.remove(xa.ELEMENT,this.batchGroupId,this.entity),this.entity.enabled&&t>=0&&this.system.app.batcher.insert(xa.ELEMENT,t,this.entity),t<0&&this._batchGroupId>=0&&this.enabled&&this.entity.enabled&&(this._image&&this._image._renderable.model?this.addModelToLayers(this._image._renderable.model):this._text&&this._text._model&&this.addModelToLayers(this._text._model)),this._batchGroupId=t)}},{key:"bottom",get:function(){return this._margin.y},set:function(t){this._margin.y=t;var e=this.entity.getLocalPosition(),i=this._absTop,n=this._localAnchor.y+t;this._setHeight(i-n),e.y=t+this._calculatedHeight*this._pivot.y,this.entity.setLocalPosition(e)}},{key:"calculatedWidth",get:function(){return this._calculatedWidth},set:function(t){this._setCalculatedWidth(t,!0)}},{key:"calculatedHeight",get:function(){return this._calculatedHeight},set:function(t){this._setCalculatedHeight(t,!0)}},{key:"canvasCorners",get:function(){if(!this._canvasCornersDirty||!this.screen||!this.screen.screen.screenSpace)return this._canvasCorners;for(var t=this.system.app.graphicsDevice,e=this.screenCorners,i=t.canvas.clientWidth/t.width,n=t.canvas.clientHeight/t.height,s=0;s<4;s++)this._canvasCorners[s].set(e[s].x*i,(t.height-e[s].y)*n);return this._canvasCornersDirty=!1,this._canvasCorners}},{key:"drawOrder",get:function(){return this._drawOrder},set:function(t){var e=0;this.screen&&(e=this.screen.screen.priority),t>16777215&&(t=16777215),this._drawOrder=(e<<24)+t,this.fire("set:draworder",this._drawOrder)}},{key:"height",get:function(){return this._height},set:function(t){this._height=t,this._hasSplitAnchorsY||this._setCalculatedHeight(t,!0),this.fire("set:height",this._height)}},{key:"layers",get:function(){return this._layers},set:function(t){if(this._addedModels.length)for(var e=0;e.001,r=Math.abs(e.anchor.y-e.anchor.w)>.001,o=!1;void 0!==i.margin&&(i.margin instanceof dt?e.margin.copy(i.margin):e._margin.set(i.margin[0],i.margin[1],i.margin[2],i.margin[3]),o=!0),void 0!==i.left&&(e._margin.x=i.left,o=!0),void 0!==i.bottom&&(e._margin.y=i.bottom,o=!0),void 0!==i.right&&(e._margin.z=i.right,o=!0),void 0!==i.top&&(e._margin.w=i.top,o=!0),o&&(e.margin=e._margin);var h=!1;void 0===i.width||a?a&&(h=!0):e.width=i.width,void 0===i.height||r?r&&(h=!0):e.height=i.height,h&&(e.anchor=e.anchor),void 0!==i.enabled&&(e.enabled=i.enabled),void 0!==i.useInput&&(e.useInput=i.useInput),e.batchGroupId=void 0===i.batchGroupId||null===i.batchGroupId?-1:i.batchGroupId,i.layers&&Array.isArray(i.layers)&&(e.layers=i.layers.slice(0)),void 0!==i.type&&(e.type=i.type),e.type===xf?(void 0!==i.rect&&(e.rect=i.rect),void 0!==i.color&&((s=i.color)instanceof at||(s=new at(i.color[0],i.color[1],i.color[2])),e.color=s),void 0!==i.opacity&&(e.opacity=i.opacity),void 0!==i.textureAsset&&(e.textureAsset=i.textureAsset),i.texture&&(e.texture=i.texture),void 0!==i.spriteAsset&&(e.spriteAsset=i.spriteAsset),i.sprite&&(e.sprite=i.sprite),void 0!==i.spriteFrame&&(e.spriteFrame=i.spriteFrame),void 0!==i.pixelsPerUnit&&null!==i.pixelsPerUnit&&(e.pixelsPerUnit=i.pixelsPerUnit),void 0!==i.materialAsset&&(e.materialAsset=i.materialAsset),i.material&&(e.material=i.material),void 0!==i.mask&&(e.mask=i.mask)):e.type===bf&&(void 0!==i.autoWidth&&(e.autoWidth=i.autoWidth),void 0!==i.autoHeight&&(e.autoHeight=i.autoHeight),void 0!==i.rtlReorder&&(e.rtlReorder=i.rtlReorder),void 0!==i.unicodeConverter&&(e.unicodeConverter=i.unicodeConverter),null!==i.text&&void 0!==i.text?e.text=i.text:null!==i.key&&void 0!==i.key&&(e.key=i.key),void 0!==i.color&&((s=i.color)instanceof at||(s=new at(s[0],s[1],s[2])),e.color=s),void 0!==i.opacity&&(e.opacity=i.opacity),void 0!==i.spacing&&(e.spacing=i.spacing),void 0!==i.fontSize&&(e.fontSize=i.fontSize,i.lineHeight||(e.lineHeight=i.fontSize)),void 0!==i.lineHeight&&(e.lineHeight=i.lineHeight),void 0!==i.maxLines&&(e.maxLines=i.maxLines),void 0!==i.wrapLines&&(e.wrapLines=i.wrapLines),void 0!==i.minFontSize&&(e.minFontSize=i.minFontSize),void 0!==i.maxFontSize&&(e.maxFontSize=i.maxFontSize),i.autoFitWidth&&(e.autoFitWidth=i.autoFitWidth),i.autoFitHeight&&(e.autoFitHeight=i.autoFitHeight),void 0!==i.fontAsset&&(e.fontAsset=i.fontAsset),void 0!==i.font&&(e.font=i.font),void 0!==i.alignment&&(e.alignment=i.alignment),void 0!==i.outlineColor&&(e.outlineColor=i.outlineColor),void 0!==i.outlineThickness&&(e.outlineThickness=i.outlineThickness),void 0!==i.shadowColor&&(e.shadowColor=i.shadowColor),void 0!==i.shadowOffset&&(e.shadowOffset=i.shadowOffset),void 0!==i.enableMarkup&&(e.enableMarkup=i.enableMarkup));var l=e._parseUpToScreen();l.screen&&e._updateScreen(l.screen),t.prototype.initializeComponentData.call(this,e,i,n),e._beingInitialized=!1,e.type===xf&&e._image._meshDirty&&e._image._updateMesh(e._image.mesh)},i.onRemoveComponent=function(t,e){e.onRemove()},i.cloneComponent=function(t,e){var i=t.element,n={enabled:i.enabled,width:i.width,height:i.height,anchor:i.anchor.clone(),pivot:i.pivot.clone(),margin:i.margin.clone(),alignment:i.alignment&&i.alignment.clone()||i.alignment,autoWidth:i.autoWidth,autoHeight:i.autoHeight,type:i.type,rect:i.rect&&i.rect.clone()||i.rect,rtlReorder:i.rtlReorder,unicodeConverter:i.unicodeConverter,materialAsset:i.materialAsset,material:i.material,color:i.color&&i.color.clone()||i.color,opacity:i.opacity,textureAsset:i.textureAsset,texture:i.texture,spriteAsset:i.spriteAsset,sprite:i.sprite,spriteFrame:i.spriteFrame,pixelsPerUnit:i.pixelsPerUnit,spacing:i.spacing,lineHeight:i.lineHeight,wrapLines:i.wrapLines,layers:i.layers,fontSize:i.fontSize,minFontSize:i.minFontSize,maxFontSize:i.maxFontSize,autoFitWidth:i.autoFitWidth,autoFitHeight:i.autoFitHeight,maxLines:i.maxLines,fontAsset:i.fontAsset,font:i.font,useInput:i.useInput,batchGroupId:i.batchGroupId,mask:i.mask,outlineColor:i.outlineColor&&i.outlineColor.clone()||i.outlineColor,outlineThickness:i.outlineThickness,shadowColor:i.shadowColor&&i.shadowColor.clone()||i.shadowColor,shadowOffset:i.shadowOffset&&i.shadowOffset.clone()||i.shadowOffset,enableMarkup:i.enableMarkup};return void 0!==i.key&&null!==i.key?n.key=i.key:n.text=i.text,this.addComponent(e,n)},i.getTextElementMaterial=function(t,e){return t?e?(this.defaultScreenSpaceTextMaterial||(this.defaultScreenSpaceTextMaterial=new ns,this.defaultScreenSpaceTextMaterial.name="defaultScreenSpaceTextMaterial",this.defaultScreenSpaceTextMaterial.msdfMap=this._defaultTexture,this.defaultScreenSpaceTextMaterial.useLighting=!1,this.defaultScreenSpaceTextMaterial.useGammaTonemap=!1,this.defaultScreenSpaceTextMaterial.useFog=!1,this.defaultScreenSpaceTextMaterial.useSkybox=!1,this.defaultScreenSpaceTextMaterial.diffuse.set(0,0,0),this.defaultScreenSpaceTextMaterial.emissive.set(1,1,1),this.defaultScreenSpaceTextMaterial.opacity=.5,this.defaultScreenSpaceTextMaterial.blendType=4,this.defaultScreenSpaceTextMaterial.depthWrite=!1,this.defaultScreenSpaceTextMaterial.depthTest=!1,this.defaultScreenSpaceTextMaterial.emissiveVertexColor=!0,this.defaultScreenSpaceTextMaterial.update()),this.defaultScreenSpaceTextMaterial):(this.defaultScreenSpaceBitmapTextMaterial||(this.defaultScreenSpaceBitmapTextMaterial=new ns,this.defaultScreenSpaceBitmapTextMaterial.name="defaultScreenSpaceBitmapTextMaterial",this.defaultScreenSpaceBitmapTextMaterial.emissive.set(.5,.5,.5),this.defaultScreenSpaceBitmapTextMaterial.emissiveMap=this._defaultTexture,this.defaultScreenSpaceBitmapTextMaterial.emissiveTint=!0,this.defaultScreenSpaceBitmapTextMaterial.opacity=.5,this.defaultScreenSpaceBitmapTextMaterial.opacityMap=this._defaultTexture,this.defaultScreenSpaceBitmapTextMaterial.opacityMapChannel="a",this.defaultScreenSpaceBitmapTextMaterial.useLighting=!1,this.defaultScreenSpaceBitmapTextMaterial.useGammaTonemap=!1,this.defaultScreenSpaceBitmapTextMaterial.useFog=!1,this.defaultScreenSpaceBitmapTextMaterial.useSkybox=!1,this.defaultScreenSpaceBitmapTextMaterial.diffuse.set(0,0,0),this.defaultScreenSpaceBitmapTextMaterial.blendType=4,this.defaultScreenSpaceBitmapTextMaterial.depthWrite=!1,this.defaultScreenSpaceBitmapTextMaterial.depthTest=!1,this.defaultScreenSpaceBitmapTextMaterial.emissiveVertexColor=!0,this.defaultScreenSpaceBitmapTextMaterial.update()),this.defaultScreenSpaceBitmapTextMaterial):e?(this.defaultTextMaterial||(this.defaultTextMaterial=new ns,this.defaultTextMaterial.name="defaultTextMaterial",this.defaultTextMaterial.msdfMap=this._defaultTexture,this.defaultTextMaterial.useLighting=!1,this.defaultTextMaterial.useGammaTonemap=!1,this.defaultTextMaterial.useFog=!1,this.defaultTextMaterial.useSkybox=!1,this.defaultTextMaterial.diffuse.set(0,0,0),this.defaultTextMaterial.emissive.set(1,1,1),this.defaultTextMaterial.opacity=.5,this.defaultTextMaterial.blendType=4,this.defaultTextMaterial.depthWrite=!1,this.defaultTextMaterial.emissiveVertexColor=!0,this.defaultTextMaterial.update()),this.defaultTextMaterial):(this.defaultBitmapTextMaterial||(this.defaultBitmapTextMaterial=new ns,this.defaultBitmapTextMaterial.name="defaultBitmapTextMaterial",this.defaultBitmapTextMaterial.emissive.set(.5,.5,.5),this.defaultBitmapTextMaterial.emissiveTint=!0,this.defaultBitmapTextMaterial.emissiveMap=this._defaultTexture,this.defaultBitmapTextMaterial.opacity=.5,this.defaultBitmapTextMaterial.opacityMap=this._defaultTexture,this.defaultBitmapTextMaterial.opacityMapChannel="a",this.defaultBitmapTextMaterial.useLighting=!1,this.defaultBitmapTextMaterial.useGammaTonemap=!1,this.defaultBitmapTextMaterial.useFog=!1,this.defaultBitmapTextMaterial.useSkybox=!1,this.defaultBitmapTextMaterial.diffuse.set(0,0,0),this.defaultBitmapTextMaterial.blendType=4,this.defaultBitmapTextMaterial.depthWrite=!1,this.defaultBitmapTextMaterial.emissiveVertexColor=!0,this.defaultBitmapTextMaterial.update()),this.defaultBitmapTextMaterial)},i._createBaseImageMaterial=function(){var t=new ns;return t.diffuse.set(0,0,0),t.emissive.set(.5,.5,.5),t.emissiveMap=this._defaultTexture,t.emissiveTint=!0,t.opacityMap=this._defaultTexture,t.opacityMapChannel="a",t.opacityTint=!0,t.opacity=0,t.useLighting=!1,t.useGammaTonemap=!1,t.useFog=!1,t.useSkybox=!1,t.blendType=4,t.depthWrite=!1,t},i.getImageElementMaterial=function(t,e,i,n){return t?e?i?(this.defaultScreenSpaceImageMask9SlicedMaterial||(this.defaultScreenSpaceImageMask9SlicedMaterial=this._createBaseImageMaterial(),this.defaultScreenSpaceImageMask9SlicedMaterial.name="defaultScreenSpaceImageMask9SlicedMaterial",this.defaultScreenSpaceImageMask9SlicedMaterial.nineSlicedMode=1,this.defaultScreenSpaceImageMask9SlicedMaterial.depthTest=!1,this.defaultScreenSpaceImageMask9SlicedMaterial.alphaTest=1,this.defaultScreenSpaceImageMask9SlicedMaterial.redWrite=!1,this.defaultScreenSpaceImageMask9SlicedMaterial.greenWrite=!1,this.defaultScreenSpaceImageMask9SlicedMaterial.blueWrite=!1,this.defaultScreenSpaceImageMask9SlicedMaterial.alphaWrite=!1,this.defaultScreenSpaceImageMask9SlicedMaterial.update(),this.defaultImageMaterials.push(this.defaultScreenSpaceImageMask9SlicedMaterial)),this.defaultScreenSpaceImageMask9SlicedMaterial):n?(this.defaultScreenSpaceImageMask9TiledMaterial||(this.defaultScreenSpaceImageMask9TiledMaterial=this.defaultScreenSpaceImage9TiledMaterial.clone(),this.defaultScreenSpaceImageMask9TiledMaterial.name="defaultScreenSpaceImageMask9TiledMaterial",this.defaultScreenSpaceImageMask9TiledMaterial.nineSlicedMode=2,this.defaultScreenSpaceImageMask9TiledMaterial.depthTest=!1,this.defaultScreenSpaceImageMask9TiledMaterial.alphaTest=1,this.defaultScreenSpaceImageMask9TiledMaterial.redWrite=!1,this.defaultScreenSpaceImageMask9TiledMaterial.greenWrite=!1,this.defaultScreenSpaceImageMask9TiledMaterial.blueWrite=!1,this.defaultScreenSpaceImageMask9TiledMaterial.alphaWrite=!1,this.defaultScreenSpaceImageMask9TiledMaterial.update(),this.defaultImageMaterials.push(this.defaultScreenSpaceImageMask9TiledMaterial)),this.defaultScreenSpaceImageMask9TiledMaterial):(this.defaultScreenSpaceImageMaskMaterial||(this.defaultScreenSpaceImageMaskMaterial=this._createBaseImageMaterial(),this.defaultScreenSpaceImageMaskMaterial.name="defaultScreenSpaceImageMaskMaterial",this.defaultScreenSpaceImageMaskMaterial.depthTest=!1,this.defaultScreenSpaceImageMaskMaterial.alphaTest=1,this.defaultScreenSpaceImageMaskMaterial.redWrite=!1,this.defaultScreenSpaceImageMaskMaterial.greenWrite=!1,this.defaultScreenSpaceImageMaskMaterial.blueWrite=!1,this.defaultScreenSpaceImageMaskMaterial.alphaWrite=!1,this.defaultScreenSpaceImageMaskMaterial.update(),this.defaultImageMaterials.push(this.defaultScreenSpaceImageMaskMaterial)),this.defaultScreenSpaceImageMaskMaterial):i?(this.defaultScreenSpaceImage9SlicedMaterial||(this.defaultScreenSpaceImage9SlicedMaterial=this._createBaseImageMaterial(),this.defaultScreenSpaceImage9SlicedMaterial.name="defaultScreenSpaceImage9SlicedMaterial",this.defaultScreenSpaceImage9SlicedMaterial.nineSlicedMode=1,this.defaultScreenSpaceImage9SlicedMaterial.depthTest=!1,this.defaultScreenSpaceImage9SlicedMaterial.update(),this.defaultImageMaterials.push(this.defaultScreenSpaceImage9SlicedMaterial)),this.defaultScreenSpaceImage9SlicedMaterial):n?(this.defaultScreenSpaceImage9TiledMaterial||(this.defaultScreenSpaceImage9TiledMaterial=this._createBaseImageMaterial(),this.defaultScreenSpaceImage9TiledMaterial.name="defaultScreenSpaceImage9TiledMaterial",this.defaultScreenSpaceImage9TiledMaterial.nineSlicedMode=2,this.defaultScreenSpaceImage9TiledMaterial.depthTest=!1,this.defaultScreenSpaceImage9TiledMaterial.update(),this.defaultImageMaterials.push(this.defaultScreenSpaceImage9TiledMaterial)),this.defaultScreenSpaceImage9TiledMaterial):(this.defaultScreenSpaceImageMaterial||(this.defaultScreenSpaceImageMaterial=this._createBaseImageMaterial(),this.defaultScreenSpaceImageMaterial.name="defaultScreenSpaceImageMaterial",this.defaultScreenSpaceImageMaterial.depthTest=!1,this.defaultScreenSpaceImageMaterial.update(),this.defaultImageMaterials.push(this.defaultScreenSpaceImageMaterial)),this.defaultScreenSpaceImageMaterial):e?i?(this.defaultImage9SlicedMaskMaterial||(this.defaultImage9SlicedMaskMaterial=this._createBaseImageMaterial(),this.defaultImage9SlicedMaskMaterial.name="defaultImage9SlicedMaskMaterial",this.defaultImage9SlicedMaskMaterial.nineSlicedMode=1,this.defaultImage9SlicedMaskMaterial.alphaTest=1,this.defaultImage9SlicedMaskMaterial.redWrite=!1,this.defaultImage9SlicedMaskMaterial.greenWrite=!1,this.defaultImage9SlicedMaskMaterial.blueWrite=!1,this.defaultImage9SlicedMaskMaterial.alphaWrite=!1,this.defaultImage9SlicedMaskMaterial.update(),this.defaultImageMaterials.push(this.defaultImage9SlicedMaskMaterial)),this.defaultImage9SlicedMaskMaterial):n?(this.defaultImage9TiledMaskMaterial||(this.defaultImage9TiledMaskMaterial=this._createBaseImageMaterial(),this.defaultImage9TiledMaskMaterial.name="defaultImage9TiledMaskMaterial",this.defaultImage9TiledMaskMaterial.nineSlicedMode=2,this.defaultImage9TiledMaskMaterial.alphaTest=1,this.defaultImage9TiledMaskMaterial.redWrite=!1,this.defaultImage9TiledMaskMaterial.greenWrite=!1,this.defaultImage9TiledMaskMaterial.blueWrite=!1,this.defaultImage9TiledMaskMaterial.alphaWrite=!1,this.defaultImage9TiledMaskMaterial.update(),this.defaultImageMaterials.push(this.defaultImage9TiledMaskMaterial)),this.defaultImage9TiledMaskMaterial):(this.defaultImageMaskMaterial||(this.defaultImageMaskMaterial=this._createBaseImageMaterial(),this.defaultImageMaskMaterial.name="defaultImageMaskMaterial",this.defaultImageMaskMaterial.alphaTest=1,this.defaultImageMaskMaterial.redWrite=!1,this.defaultImageMaskMaterial.greenWrite=!1,this.defaultImageMaskMaterial.blueWrite=!1,this.defaultImageMaskMaterial.alphaWrite=!1,this.defaultImageMaskMaterial.update(),this.defaultImageMaterials.push(this.defaultImageMaskMaterial)),this.defaultImageMaskMaterial):i?(this.defaultImage9SlicedMaterial||(this.defaultImage9SlicedMaterial=this._createBaseImageMaterial(),this.defaultImage9SlicedMaterial.name="defaultImage9SlicedMaterial",this.defaultImage9SlicedMaterial.nineSlicedMode=1,this.defaultImage9SlicedMaterial.update(),this.defaultImageMaterials.push(this.defaultImage9SlicedMaterial)),this.defaultImage9SlicedMaterial):n?(this.defaultImage9TiledMaterial||(this.defaultImage9TiledMaterial=this._createBaseImageMaterial(),this.defaultImage9TiledMaterial.name="defaultImage9TiledMaterial",this.defaultImage9TiledMaterial.nineSlicedMode=2,this.defaultImage9TiledMaterial.update(),this.defaultImageMaterials.push(this.defaultImage9TiledMaterial)),this.defaultImage9TiledMaterial):(this.defaultImageMaterial||(this.defaultImageMaterial=this._createBaseImageMaterial(),this.defaultImageMaterial.name="defaultImageMaterial",this.defaultImageMaterial.update(),this.defaultImageMaterials.push(this.defaultImageMaterial)),this.defaultImageMaterial)},i.registerUnicodeConverter=function(t){this._unicodeConverter=t},i.registerRtlReorder=function(t){this._rtlReorder=t},i.getUnicodeConverter=function(){return this._unicodeConverter},i.getRtlReorder=function(){return this._rtlReorder},e}(sd);au._buildAccessors(Gp.prototype,qp);var Yp="free",Kp="limited",Zp="locked",$p=["angularDampingX","angularDampingY","angularDampingZ","angularEquilibriumX","angularEquilibriumY","angularEquilibriumZ","angularLimitsX","angularLimitsY","angularLimitsZ","angularMotionX","angularMotionY","angularMotionZ","angularSpringX","angularSpringY","angularSpringZ","angularStiffnessX","angularStiffnessY","angularStiffnessZ","breakForce","enableCollision","enabled","entityA","entityB","linearDampingX","linearDampingY","linearDampingZ","linearEquilibriumX","linearEquilibriumY","linearEquilibriumZ","linearLimitsX","linearLimitsY","linearLimitsZ","linearMotionX","linearMotionY","linearMotionZ","linearSpringX","linearSpringY","linearSpringZ","linearStiffnessX","linearStiffnessY","linearStiffnessZ"],Qp=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._constraint=null,n._entityA=null,n._entityB=null,n._breakForce=34e37,n._enableCollision=!0,n._linearMotionX=Zp,n._linearLimitsX=new ut(0,0),n._linearSpringX=!1,n._linearStiffnessX=0,n._linearDampingX=1,n._linearEquilibriumX=0,n._linearMotionY=Zp,n._linearLimitsY=new ut(0,0),n._linearSpringY=!1,n._linearStiffnessY=0,n._linearDampingY=1,n._linearEquilibriumY=0,n._linearMotionZ=Zp,n._linearLimitsZ=new ut(0,0),n._linearSpringZ=!1,n._linearStiffnessZ=0,n._linearDampingZ=1,n._linearEquilibriumZ=0,n._angularMotionX=Zp,n._angularLimitsX=new ut(0,0),n._angularSpringX=!1,n._angularStiffnessX=0,n._angularDampingX=1,n._angularEquilibriumX=0,n._angularMotionY=Zp,n._angularLimitsY=new ut(0,0),n._angularSpringY=!1,n._angularStiffnessY=0,n._angularDampingY=1,n._angularEquilibriumY=0,n._angularMotionZ=Zp,n._angularLimitsZ=new ut(0,0),n._angularSpringZ=!1,n._angularEquilibriumZ=0,n._angularDampingZ=1,n._angularStiffnessZ=0,n.on("set_enabled",n._onSetEnabled,q(n)),n}H(e,t);var i=e.prototype;return i._convertTransform=function(t,e){var i=t.getTranslation(),n=new yt;n.setFromMat4(t);var s=new Ammo.btVector3(i.x,i.y,i.z),a=new Ammo.btQuaternion(n.x,n.y,n.z,n.w);e.setOrigin(s),e.setRotation(a),Ammo.destroy(s),Ammo.destroy(a)},i._updateAngularLimits=function(){var t=this._constraint;if(t){var e,i,n,s,a,r;this._angularMotionX===Kp?(e=this._angularLimitsX.x*it.DEG_TO_RAD,s=this._angularLimitsX.y*it.DEG_TO_RAD):this._angularMotionX===Yp?(e=1,s=0):e=s=0,this._angularMotionY===Kp?(i=this._angularLimitsY.x*it.DEG_TO_RAD,a=this._angularLimitsY.y*it.DEG_TO_RAD):this._angularMotionY===Yp?(i=1,a=0):i=a=0,this._angularMotionZ===Kp?(n=this._angularLimitsZ.x*it.DEG_TO_RAD,r=this._angularLimitsZ.y*it.DEG_TO_RAD):this._angularMotionZ===Yp?(n=1,r=0):n=r=0;var o=new Ammo.btVector3(e,i,n);t.setAngularLowerLimit(o),o.setValue(s,a,r),t.setAngularUpperLimit(o),Ammo.destroy(o)}},i._updateLinearLimits=function(){var t=this._constraint;if(t){var e,i,n,s,a,r;this._linearMotionX===Kp?(e=this._linearLimitsX.x,s=this._linearLimitsX.y):this._linearMotionX===Yp?(e=1,s=0):e=s=0,this._linearMotionY===Kp?(i=this._linearLimitsY.x,a=this._linearLimitsY.y):this._linearMotionY===Yp?(i=1,a=0):i=a=0,this._linearMotionZ===Kp?(n=this._linearLimitsZ.x,r=this._linearLimitsZ.y):this._linearMotionZ===Yp?(n=1,r=0):n=r=0;var o=new Ammo.btVector3(e,i,n);t.setLinearLowerLimit(o),o.setValue(s,a,r),t.setLinearUpperLimit(o),Ammo.destroy(o)}},i._createConstraint=function(){if(this._entityA&&this._entityA.rigidbody){this._destroyConstraint();var t=new vt,e=this._entityA.rigidbody.body;e.activate();var i=this.entity.getWorldTransform(),n=this._entityA.getWorldTransform().clone().invert();t.mul2(n,i);var s=new Ammo.btTransform;if(this._convertTransform(t,s),this._entityB&&this._entityB.rigidbody){var a=this._entityB.rigidbody.body;a.activate();var r=this._entityB.getWorldTransform().clone().invert();t.mul2(r,i);var o=new Ammo.btTransform;this._convertTransform(t,o),this._constraint=new Ammo.btGeneric6DofSpringConstraint(e,a,s,o,!this._enableCollision),Ammo.destroy(o)}else this._constraint=new Ammo.btGeneric6DofSpringConstraint(e,s,!this._enableCollision);Ammo.destroy(s);for(var h=["X","Y","Z","X","Y","Z"],l=0;l<6;l++){var c=l<3?"_linear":"_angular";this._constraint.enableSpring(l,this[c+"Spring"+h[l]]),this._constraint.setDamping(l,this[c+"Damping"+h[l]]),this._constraint.setEquilibriumPoint(l,this[c+"Equilibrium"+h[l]]),this._constraint.setStiffness(l,this[c+"Stiffness"+h[l]])}this._constraint.setBreakingImpulseThreshold(this._breakForce),this._updateLinearLimits(),this._updateAngularLimits(),this.system.app.systems.rigidbody.dynamicsWorld.addConstraint(this._constraint,!this._enableCollision)}},i._destroyConstraint=function(){this._constraint&&(this.system.app.systems.rigidbody.dynamicsWorld.removeConstraint(this._constraint),Ammo.destroy(this._constraint),this._constraint=null)},i.initFromData=function(t){for(var e,i=Y($p);!(e=i()).done;){var n=e.value;t.hasOwnProperty(n)&&(t[n]instanceof ut?this["_"+n].copy(t[n]):this["_"+n]=t[n])}this._createConstraint()},i.onEnable=function(){this._createConstraint()},i.onDisable=function(){this._destroyConstraint()},i._onSetEnabled=function(t,e,i){},i._onBeforeRemove=function(){this.fire("remove")},W(e,[{key:"entityA",get:function(){return this._entityA},set:function(t){this._destroyConstraint(),this._entityA=t,this._createConstraint()}},{key:"entityB",get:function(){return this._entityB},set:function(t){this._destroyConstraint(),this._entityB=t,this._createConstraint()}},{key:"breakForce",get:function(){return this._breakForce},set:function(t){this._constraint&&this._breakForce!==t&&(this._constraint.setBreakingImpulseThreshold(t),this._breakForce=t)}},{key:"enableCollision",get:function(){return this._enableCollision},set:function(t){this._destroyConstraint(),this._enableCollision=t,this._createConstraint()}},{key:"angularLimitsX",get:function(){return this._angularLimitsX},set:function(t){this._angularLimitsX.equals(t)||(this._angularLimitsX.copy(t),this._updateAngularLimits())}},{key:"angularMotionX",get:function(){return this._angularMotionX},set:function(t){this._angularMotionX!==t&&(this._angularMotionX=t,this._updateAngularLimits())}},{key:"angularLimitsY",get:function(){return this._angularLimitsY},set:function(t){this._angularLimitsY.equals(t)||(this._angularLimitsY.copy(t),this._updateAngularLimits())}},{key:"angularMotionY",get:function(){return this._angularMotionY},set:function(t){this._angularMotionY!==t&&(this._angularMotionY=t,this._updateAngularLimits())}},{key:"angularLimitsZ",get:function(){return this._angularLimitsZ},set:function(t){this._angularLimitsZ.equals(t)||(this._angularLimitsZ.copy(t),this._updateAngularLimits())}},{key:"angularMotionZ",get:function(){return this._angularMotionZ},set:function(t){this._angularMotionZ!==t&&(this._angularMotionZ=t,this._updateAngularLimits())}},{key:"linearLimitsX",get:function(){return this._linearLimitsX},set:function(t){this._linearLimitsX.equals(t)||(this._linearLimitsX.copy(t),this._updateLinearLimits())}},{key:"linearMotionX",get:function(){return this._linearMotionX},set:function(t){this._linearMotionX!==t&&(this._linearMotionX=t,this._updateLinearLimits())}},{key:"linearLimitsY",get:function(){return this._linearLimitsY},set:function(t){this._linearLimitsY.equals(t)||(this._linearLimitsY.copy(t),this._updateLinearLimits())}},{key:"linearMotionY",get:function(){return this._linearMotionY},set:function(t){this._linearMotionY!==t&&(this._linearMotionY=t,this._updateLinearLimits())}},{key:"linearLimitsZ",get:function(){return this._linearLimitsZ},set:function(t){this._linearLimitsZ.equals(t)||(this._linearLimitsZ.copy(t),this._updateLinearLimits())}},{key:"linearMotionZ",get:function(){return this._linearMotionZ},set:function(t){this._linearMotionZ!==t&&(this._linearMotionZ=t,this._updateLinearLimits())}}]),e}(au),Jp={Damping:"setDamping",Equilibrium:"setEquilibriumPoint",Spring:"enableSpring",Stiffness:"setStiffness"};["linear","angular"].forEach((function(t){["Damping","Equilibrium","Spring","Stiffness"].forEach((function(e){["X","Y","Z"].forEach((function(i){var n=t+e+i,s="_"+n,a="linear"===t?0:3;"Y"===i&&(a+=1),"Z"===i&&(a+=2),Object.defineProperty(Qp.prototype,n,{get:function(){return this[s]},set:function(t){this[s]!==t&&(this[s]=t,this._constraint[Jp[e]](a,t))}})}))}))}));var tm=function(){this.enabled=!0},em=["enabled"],im=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="joint",i.app=e,i.ComponentType=Qp,i.DataType=tm,i.schema=em,i}return H(e,t),e.prototype.initializeComponentData=function(t,e,i){t.initFromData(e)},e}(sd);au._buildAccessors(Qp.prototype,em);var nm=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._minWidth=0,n._minHeight=0,n._maxWidth=null,n._maxHeight=null,n._fitWidthProportion=0,n._fitHeightProportion=0,n._excludeFromLayout=!1,n}return H(e,t),W(e,[{key:"minWidth",get:function(){return this._minWidth},set:function(t){t!==this._minWidth&&(this._minWidth=t,this.fire("resize"))}},{key:"minHeight",get:function(){return this._minHeight},set:function(t){t!==this._minHeight&&(this._minHeight=t,this.fire("resize"))}},{key:"maxWidth",get:function(){return this._maxWidth},set:function(t){t!==this._maxWidth&&(this._maxWidth=t,this.fire("resize"))}},{key:"maxHeight",get:function(){return this._maxHeight},set:function(t){t!==this._maxHeight&&(this._maxHeight=t,this.fire("resize"))}},{key:"fitWidthProportion",get:function(){return this._fitWidthProportion},set:function(t){t!==this._fitWidthProportion&&(this._fitWidthProportion=t,this.fire("resize"))}},{key:"fitHeightProportion",get:function(){return this._fitHeightProportion},set:function(t){t!==this._fitHeightProportion&&(this._fitHeightProportion=t,this.fire("resize"))}},{key:"excludeFromLayout",get:function(){return this._excludeFromLayout},set:function(t){t!==this._excludeFromLayout&&(this._excludeFromLayout=t,this.fire("resize"))}}]),e}(au),sm=function(){this.enabled=!0},am=["enabled"],rm=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="layoutchild",i.ComponentType=nm,i.DataType=sm,i.schema=am,i}H(e,t);var i=e.prototype;return i.initializeComponentData=function(e,i,n){void 0!==i.enabled&&(e.enabled=i.enabled),void 0!==i.minWidth&&(e.minWidth=i.minWidth),void 0!==i.minHeight&&(e.minHeight=i.minHeight),void 0!==i.maxWidth&&(e.maxWidth=i.maxWidth),void 0!==i.maxHeight&&(e.maxHeight=i.maxHeight),void 0!==i.fitWidthProportion&&(e.fitWidthProportion=i.fitWidthProportion),void 0!==i.fitHeightProportion&&(e.fitHeightProportion=i.fitHeightProportion),void 0!==i.excludeFromLayout&&(e.excludeFromLayout=i.excludeFromLayout),t.prototype.initializeComponentData.call(this,e,i,n)},i.cloneComponent=function(t,e){var i=t.layoutchild;return this.addComponent(e,{enabled:i.enabled,minWidth:i.minWidth,minHeight:i.minHeight,maxWidth:i.maxWidth,maxHeight:i.maxHeight,fitWidthProportion:i.fitWidthProportion,fitHeightProportion:i.fitHeightProportion,excludeFromLayout:i.excludeFromLayout})},e}(sd);au._buildAccessors(nm.prototype,am);var om={0:{axis:"x",size:"width",calculatedSize:"calculatedWidth",minSize:"minWidth",maxSize:"maxWidth",fitting:"widthFitting",fittingProportion:"fitWidthProportion"},1:{axis:"y",size:"height",calculatedSize:"calculatedHeight",minSize:"minHeight",maxSize:"maxHeight",fitting:"heightFitting",fittingProportion:"fitHeightProportion"}},hm={0:1,1:0},lm={minWidth:0,minHeight:0,maxWidth:Number.POSITIVE_INFINITY,maxHeight:Number.POSITIVE_INFINITY,width:null,height:null,fitWidthProportion:0,fitHeightProportion:0},cm="NONE",um="APPLY_STRETCHING",dm="APPLY_SHRINKING",fm=new ut;function pm(t){var e,i=om[t],n=om[hm[t]];function s(t,e){return-e[i.size]*t.pivot[i.axis]}function a(t,e){return-e[n.size]*t.pivot[n.axis]}function r(t,e){return e[i.size]*(1-t.pivot[i.axis])}function o(t){var e=t.entity.layoutchild;return!e||!e.enabled||!e.excludeFromLayout}function h(t,e,i){switch(t){case 0:return cm;case 1:return e=i?dm:cm;case 3:return e=0;--n)i[e[n]]=i[e[n+1]]+t[e[n]];return i}return function(t,d){t=t.filter(o),e=d,fm.x=e.containerSize.x-e.padding.x-e.padding.z,fm.y=e.containerSize.y-e.padding.y-e.padding.w,function(t){for(var e=0;e0&&(a+=e.spacing[i.axis]);var h=s[o][i.size];a+=h,!r&&a>fm[i.axis]&&0!==n[n.length-1].length&&(a=h,n.push([])),n[n.length-1].push(t[o]),r&&a>fm[i.axis]&&o!==t.length-1&&(a=0,n.push([]))}return n}(t)),m=function(t,i){for(var s=[],a=[],r=0;ro.largestSize[n.size]&&(o.largestElement=o[d],o.largestSize=f)}s.push(o.largestElement),a.push(o.largestSize)}var p=l(a,n),m=h(e[n.fitting],p,fm[n.axis]);m===um?c(a,p,n):m===dm&&u(a,p,n);for(var _=0;_0;){var e=this._reflowQueue.slice();this._reflowQueue.length=0,e.sort((function(t,e){return t.entity.graphDepth-e.entity.graphDepth}));for(var i=0;i=100){console.warn("Max reflow iterations limit reached, bailing.");break}}},i._onRemoveComponent=function(t,e){e.onRemove()},i.destroy=function(){t.prototype.destroy.call(this),this.app.systems.off("postUpdate",this._onPostUpdate,this)},e}(sd);au._buildAccessors(ym.prototype,bm);var wm=[],Tm=[],Am=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._cookieAsset=null,n._cookieAssetId=null,n._cookieAssetAdd=!1,n._cookieMatrix=null,n}H(e,t);var i=e.prototype;return i.addLightToLayers=function(){for(var t=0;t=0&&this.enabled&&this.entity.enabled&&t.addLight(this)},i.onLayerRemoved=function(t){this.layers.indexOf(t.id)>=0&&t.removeLight(this)},i.refreshProperties=function(){for(var t=0;t=0&&t.batcher.insert(xa.MODEL,this.batchGroupId,this.entity)},i.onDisable=function(){var t=this.system.app,e=t.scene;e.off("set:layers",this.onLayersChanged,this),e.layers&&(e.layers.off("add",this.onLayerAdded,this),e.layers.off("remove",this.onLayerRemoved,this)),this._batchGroupId>=0&&t.batcher.remove(xa.MODEL,this.batchGroupId,this.entity),this._model&&this.removeModelFromLayers()},i.hide=function(){if(this._model)for(var t=this._model.meshInstances,e=0,i=t.length;e=0&&e.remove(xa.MODEL,this.batchGroupId,this.entity),this.entity.enabled&&t>=0&&e.insert(xa.MODEL,t,this.entity),t<0&&this._batchGroupId>=0&&this.enabled&&this.entity.enabled&&this.addModelToLayers(),this._batchGroupId=t}}},{key:"materialAsset",get:function(){return this._materialAsset},set:function(t){var e=t;t instanceof Eh&&(e=t.id);var i=this.system.app.assets;if(e!==this._materialAsset){if(this._materialAsset){i.off("add:"+this._materialAsset,this._onMaterialAssetAdd,this);var n=i.get(this._materialAsset);n&&this._unbindMaterialAsset(n)}if(this._materialAsset=e,this._materialAsset){var s=i.get(this._materialAsset);s?this._bindMaterialAsset(s):(this._setMaterial(this.system.defaultMaterial),i.on("add:"+this._materialAsset,this._onMaterialAssetAdd,this))}else this._setMaterial(this.system.defaultMaterial)}}},{key:"material",get:function(){return this._material},set:function(t){this._material!==t&&(this.materialAsset=null,this._setMaterial(t))}},{key:"mapping",get:function(){return this._mapping},set:function(t){if("asset"===this._type&&(this._unsetMaterialEvents(),t||(t={}),this._mapping=t,this._model))for(var e=this._model.meshInstances,i=this.asset?this.system.app.assets.get(this.asset):null,n=i?i.data.mapping:null,s=null,a=0,r=e.length;a=0&&t.batcher.insert(xa.RENDER,this.batchGroupId,this.entity)},i.onDisable=function(){var t=this.system.app,e=t.scene;e.off("set:layers",this.onLayersChanged,this),e.layers&&(e.layers.off("add",this.onLayerAdded,this),e.layers.off("remove",this.onLayerRemoved,this)),this._batchGroupId>=0&&t.batcher.remove(xa.RENDER,this.batchGroupId,this.entity),this.removeFromLayers()},i.hide=function(){if(this._meshInstances)for(var t=0;t=0&&e.remove(xa.RENDER,this.batchGroupId,this.entity),this.entity.enabled&&t>=0&&e.insert(xa.RENDER,t,this.entity),t<0&&this._batchGroupId>=0&&this.enabled&&this.entity.enabled&&this.addToLayers(),this._batchGroupId=t}}},{key:"material",get:function(){return this._material},set:function(t){if(this._material!==t&&(this._material=t,this._meshInstances&&"asset"!==this._type))for(var e=0;et.length){for(var e=t.length;e=P)&&this.calcSpawnPosition(i,n,s,a,M);var k=R>0&&R0&&(1===u.emitterShape?(Hm.copy(Xm).mulScalar(2).sub(lt.ONE).normalize(),Ym.add(Hm.mulScalar(u.initialVelocity))):Ym.add(lt.FORWARD.mulScalar(u.initialVelocity))),jm.x+=(Km.x-jm.x)*Xm.x,jm.y+=(Km.y-jm.y)*Xm.y,jm.z+=(Km.z-jm.z)*Xm.z,_+=(g-_)*Xm.y,L=(L+1e4*C%1*(v-L))*zm,D=1e3*C%1*(x-y),u.meshInstance.node&&(u.localSpace?(Ym.x/=km.x,Ym.y/=km.y,Ym.z/=km.z):Vm.transformPoint(Ym,Ym)),u.localSpace?(Wm.transformPoint(jm,jm),Ym.add(jm).add($m)):(Ym.add(jm.mul(km)),Ym.add($m.mul(km))),t_.copy(Ym),Qm.copy(qm).add(Ym.mulScalar(r)),Jm.copy(Qm),i[4*M]=Jm.x,i[4*M+1]=Jm.y,i[4*M+2]=Jm.z,i[4*M+3]+=_*r,u.wrap&&u.wrapBounds&&(u.localSpace||Jm.sub(a),Jm.x=s_(Jm.x,u.wrapBounds.x)-.5*u.wrapBounds.x,Jm.y=s_(Jm.y,u.wrapBounds.y)-.5*u.wrapBounds.y,Jm.z=s_(Jm.z,u.wrapBounds.z)-.5*u.wrapBounds.z,u.localSpace||Jm.add(a)),u.sort>0&&(1===u.sort?(e_.copy(Jm).sub(S),u.particleDistance[M]=-(e_.x*e_.x+e_.y*e_.y+e_.z*e_.z)):2===u.sort?u.particleDistance[M]=R:3===u.sort&&(u.particleDistance[M]=-R))),o?R<0&&(i[4*M+3+2*u.numParticlesPot*4]=-1):(R>=P&&(R-=Math.max(P,(u.numParticles-1)*E),i[4*M+3+2*u.numParticlesPot*4]=u.loop?1:-1),R<0&&u.loop&&(i[4*M+3+2*u.numParticlesPot*4]=1)),i[4*M+3+2*u.numParticlesPot*4]<0&&(k=!1),i[4*M+3+4*u.numParticlesPot]=R;for(var O=0;O0&&u.camera){for(var V=u.useMesh?6:4,W=u.particleDistance,G=0;Gt.maxTextureSize&&(this.numParticles=t.maxTextureSize),M_("rate",1),M_("rate2",this.rate),M_("lifetime",50),M_("emitterExtents",new lt(0,0,0)),M_("emitterExtentsInner",new lt(0,0,0)),M_("emitterRadius",0),M_("emitterRadiusInner",0),M_("emitterShape",0),M_("initialVelocity",1),M_("wrap",!1),M_("localSpace",!1),M_("screenSpace",!1),M_("wrapBounds",null),M_("colorMap",this.defaultParamTexture),M_("normalMap",null),M_("loop",!0),M_("preWarm",!1),M_("sort",0),M_("mode",0),M_("scene",null),M_("lighting",!1),M_("halfLambert",!1),M_("intensity",1),M_("stretch",0),M_("alignToMotion",!1),M_("depthSoftening",0),M_("mesh",null),M_("particleNormal",new lt(0,1,0)),M_("orientation",0),M_("depthWrite",!1),M_("noFog",!1),M_("blendType",2),M_("node",null),M_("startAngle",0),M_("startAngle2",this.startAngle),M_("animTilesX",1),M_("animTilesY",1),M_("animStartFrame",0),M_("animNumFrames",1),M_("animNumAnimations",1),M_("animIndex",0),M_("randomizeAnimIndex",!1),M_("animSpeed",1),M_("animLoop",!0),this._gpuUpdater=new c_(this,i),this._cpuUpdater=new r_(this),this.constantLightCube=i.scope.resolve("lightCube[0]"),this.emitterPosUniform=new Float32Array(3),this.wrapBoundsUniform=new Float32Array(3),this.emitterScaleUniform=new Float32Array([1,1,1]),M_("colorGraph",y_),M_("colorGraph2",this.colorGraph),M_("scaleGraph",g_),M_("scaleGraph2",this.scaleGraph),M_("alphaGraph",g_),M_("alphaGraph2",this.alphaGraph),M_("localVelocityGraph",v_),M_("localVelocityGraph2",this.localVelocityGraph),M_("velocityGraph",v_),M_("velocityGraph2",this.velocityGraph),M_("rotationSpeedGraph",__),M_("rotationSpeedGraph2",this.rotationSpeedGraph),M_("radialSpeedGraph",__),M_("radialSpeedGraph2",this.radialSpeedGraph),this.lightCube=new Float32Array(18),this.lightCubeDir=new Array(6),this.lightCubeDir[0]=new lt(-1,0,0),this.lightCubeDir[1]=new lt(1,0,0),this.lightCubeDir[2]=new lt(0,-1,0),this.lightCubeDir[3]=new lt(0,1,0),this.lightCubeDir[4]=new lt(0,0,-1),this.lightCubeDir[5]=new lt(0,0,1),this.animTilesParams=new Float32Array(2),this.animParams=new Float32Array(4),this.animIndexParams=new Float32Array(2),this.internalTex0=null,this.internalTex1=null,this.internalTex2=null,this.colorParam=null,this.vbToSort=null,this.vbOld=null,this.particleDistance=null,this.camera=null,this.swapTex=!1,this.useMesh=!0,this.useCpu=!1,this.pack8=!0,this.localBounds=new At,this.worldBoundsNoTrail=new At,this.worldBoundsTrail=[new At,new At],this.worldBounds=new At,this.worldBoundsSize=new lt,this.prevWorldBoundsSize=new lt,this.prevWorldBoundsCenter=new lt,this.prevEmitterExtents=this.emitterExtents,this.prevEmitterRadius=this.emitterRadius,this.worldBoundsMul=new lt,this.worldBoundsAdd=new lt,this.timeToSwitchBounds=0,this.shaderParticleUpdateRespawn=null,this.shaderParticleUpdateNoRespawn=null,this.shaderParticleUpdateOnStop=null,this.numParticleVerts=0,this.numParticleIndices=0,this.material=null,this.meshInstance=null,this.drawOrder=0,this.seed=Math.random(),this.fixedTimeStep=1/60,this.maxSubSteps=10,this.simTime=0,this.simTimeTotal=0,this.beenReset=!1,this._layer=null,this.rebuild()}var e=t.prototype;return e.onChangeCamera=function(){this.regenShader(),this.resetMaterial()},e.calculateBoundsMad=function(){this.worldBoundsMul.x=1/this.worldBoundsSize.x,this.worldBoundsMul.y=1/this.worldBoundsSize.y,this.worldBoundsMul.z=1/this.worldBoundsSize.z,this.worldBoundsAdd.copy(this.worldBounds.center).mul(this.worldBoundsMul).mulScalar(-1),this.worldBoundsAdd.x+=.5,this.worldBoundsAdd.y+=.5,this.worldBoundsAdd.z+=.5},e.calculateWorldBounds=function(){if(this.node){if(this.prevWorldBoundsSize.copy(this.worldBoundsSize),this.prevWorldBoundsCenter.copy(this.worldBounds.center),!this.useCpu){(0===this.emitterShape?!this.emitterExtents.equals(this.prevEmitterExtents):!(this.emitterRadius===this.prevEmitterRadius))&&this.calculateLocalBounds()}var t=this.node.getWorldTransform();this.localSpace?this.worldBoundsNoTrail.copy(this.localBounds):this.worldBoundsNoTrail.setFromTransformedAabb(this.localBounds,t),this.worldBoundsTrail[0].add(this.worldBoundsNoTrail),this.worldBoundsTrail[1].add(this.worldBoundsNoTrail);var e=this.simTimeTotal;e>=this.timeToSwitchBounds&&(this.worldBoundsTrail[0].copy(this.worldBoundsTrail[1]),this.worldBoundsTrail[1].copy(this.worldBoundsNoTrail),this.timeToSwitchBounds=e+this.lifetime),this.worldBounds.copy(this.worldBoundsTrail[0]),this.worldBoundsSize.copy(this.worldBounds.halfExtents).mulScalar(2),this.localSpace?(this.meshInstance.aabb.setFromTransformedAabb(this.worldBounds,t),this.meshInstance.mesh.aabb.setFromTransformedAabb(this.worldBounds,t)):(this.meshInstance.aabb.copy(this.worldBounds),this.meshInstance.mesh.aabb.copy(this.worldBounds)),this.meshInstance._aabbVer=1-this.meshInstance._aabbVer,this.pack8&&this.calculateBoundsMad()}},e.resetWorldBounds=function(){this.node&&(this.worldBoundsNoTrail.setFromTransformedAabb(this.localBounds,this.localSpace?vt.IDENTITY:this.node.getWorldTransform()),this.worldBoundsTrail[0].copy(this.worldBoundsNoTrail),this.worldBoundsTrail[1].copy(this.worldBoundsNoTrail),this.worldBounds.copy(this.worldBoundsTrail[0]),this.worldBoundsSize.copy(this.worldBounds.halfExtents).mulScalar(2),this.prevWorldBoundsSize.copy(this.worldBoundsSize),this.prevWorldBoundsCenter.copy(this.worldBounds.center),this.simTimeTotal=0,this.timeToSwitchBounds=0)},e.calculateLocalBounds=function(){for(var t,e,i,n=Number.MAX_VALUE,s=Number.MAX_VALUE,a=Number.MAX_VALUE,r=-Number.MAX_VALUE,o=-Number.MAX_VALUE,h=-Number.MAX_VALUE,l=0,c=0,u=this.lifetime/this.precision,d=[this.qVelocity,this.qVelocity2],f=[this.qLocalVelocity,this.qLocalVelocity2],p=[0,0],m=[0,0],_=[0,0],g=[0,0],v=[0,0],y=0;y0||t.maxVertexTextures<=1||t.fragmentUniformsCount<64||t.forceCpuParticles||!t.extTextureFloat,this._destroyResources(),this.pack8=(this.pack8||!t.textureFloatRenderable)&&!this.useCpu,x_=this.useCpu||this.pack8?4:2,this.useMesh=!1,this.mesh)&&(this.numParticles*this.mesh.vertexBuffer.numVertices>65535||(this.useMesh=!0));this.numParticlesPot=it.nextPowerOfTwo(this.numParticles),this.rebuildGraphs(),this.calculateLocalBounds(),this.resetWorldBounds(),this.node&&(this.worldBounds.setFromTransformedAabb(this.localBounds,this.localSpace?vt.IDENTITY:this.node.getWorldTransform()),this.worldBoundsTrail[0].copy(this.worldBounds),this.worldBoundsTrail[1].copy(this.worldBounds),this.worldBoundsSize.copy(this.worldBounds.halfExtents).mulScalar(2),this.prevWorldBoundsSize.copy(this.worldBoundsSize),this.prevWorldBoundsCenter.copy(this.worldBounds.center),this.pack8&&this.calculateBoundsMad()),this.vbToSort=new Array(this.numParticles);for(var e=0;e=1&&(this.animTilesX>1||this.animTilesY>1)&&(this.colorMap&&this.colorMap!==this.defaultParamTexture||this.normalMap)},e.rebuildGraphs=function(){var t=this.precision,e=this.graphicsDevice;this.qLocalVelocity=this.localVelocityGraph.quantize(t),this.qVelocity=this.velocityGraph.quantize(t),this.qColor=this.colorGraph.quantizeClamped(t,0,1),this.qRotSpeed=this.rotationSpeedGraph.quantize(t),this.qScale=this.scaleGraph.quantize(t),this.qAlpha=this.alphaGraph.quantize(t),this.qRadialSpeed=this.radialSpeedGraph.quantize(t),this.qLocalVelocity2=this.localVelocityGraph2.quantize(t),this.qVelocity2=this.velocityGraph2.quantize(t),this.qColor2=this.colorGraph2.quantizeClamped(t,0,1),this.qRotSpeed2=this.rotationSpeedGraph2.quantize(t),this.qScale2=this.scaleGraph2.quantize(t),this.qAlpha2=this.alphaGraph2.quantize(t),this.qRadialSpeed2=this.radialSpeedGraph2.quantize(t);for(var i=0;i0&&t.setParameter("softening",1/(this.depthSoftening*this.depthSoftening*100)),this.stretch>0&&(t.cull=0),this._compParticleFaceParams()},e._compParticleFaceParams=function(){var t,e;if(0===this.orientation)t=new Float32Array([1,0,0]),e=new Float32Array([0,0,1]);else{var i;if(1===this.orientation)i=this.particleNormal.normalize();else i=(null===this.node?vt.IDENTITY:this.node.getWorldTransform()).transformVector(this.particleNormal).normalize();var n=new lt(1,0,0);1===Math.abs(n.dot(i))&&n.set(0,0,1);var s=(new lt).cross(i,n).normalize();n.cross(s,i).normalize(),t=new Float32Array([n.x,n.y,n.z]),e=new Float32Array([s.x,s.y,s.z])}this.material.setParameter("faceTangent",t),this.material.setParameter("faceBinorm",e)},e._allocate=function(t){var e=t*this.numParticleVerts,i=t*this.numParticleIndices;if(void 0===this.vertexBuffer||this.vertexBuffer.getNumVertices()!==e){if(this.useCpu){var n=[{semantic:be,components:4,type:6},{semantic:Se,components:4,type:6},{semantic:we,components:4,type:6},{semantic:Te,components:1,type:6},{semantic:Ae,components:this.useMesh?4:2,type:6}],s=new ti(this.graphicsDevice,n);this.vertexBuffer=new Qe(this.graphicsDevice,s,e,1),this.indexBuffer=new ys(this.graphicsDevice,1,i)}else{var a=[{semantic:be,components:4,type:6}];this.useMesh&&a.push({semantic:Se,components:2,type:6});var r=new ti(this.graphicsDevice,a);this.vertexBuffer=new Qe(this.graphicsDevice,r,e,1),this.indexBuffer=new ys(this.graphicsDevice,1,i)}var o,h,l,c=new Float32Array(this.vertexBuffer.lock());if(this.useMesh){h=(o=new Float32Array(this.mesh.vertexBuffer.lock())).length/this.mesh.vertexBuffer.numVertices;for(var u=0;uthis.endTime&&(this.onFinished&&this.onFinished(),this.meshInstance.visible=!1),this.meshInstance&&(this.meshInstance.drawOrder=this.drawOrder)},e._destroyResources=function(){this.particleTexIN&&(this.particleTexIN.destroy(),this.particleTexIN=null),this.particleTexOUT&&(this.particleTexOUT.destroy(),this.particleTexOUT=null),this.particleTexStart&&this.particleTexStart.destroy&&(this.particleTexStart.destroy(),this.particleTexStart=null),this.rtParticleTexIN&&(this.rtParticleTexIN.destroy(),this.rtParticleTexIN=null),this.rtParticleTexOUT&&(this.rtParticleTexOUT.destroy(),this.rtParticleTexOUT=null),this.internalTex0&&(this.internalTex0.destroy(),this.internalTex0=null),this.internalTex1&&(this.internalTex1.destroy(),this.internalTex1=null),this.internalTex2&&(this.internalTex2.destroy(),this.internalTex2=null),this.internalTex3&&(this.internalTex3.destroy(),this.internalTex3=null),this.colorParam&&(this.colorParam.destroy(),this.colorParam=null),this.vertexBuffer&&(this.vertexBuffer.destroy(),this.vertexBuffer=void 0),this.indexBuffer&&(this.indexBuffer.destroy(),this.indexBuffer=void 0),this.material&&(this.material.destroy(),this.material=null)},e.destroy=function(){this.camera=null,this._destroyResources()},W(t,[{key:"defaultParamTexture",get:function(){var t=this;return L_.get(this.graphicsDevice,(function(){for(var e=16,i=new Float32Array(1024),n=0;n=0))continue;n=this.system.app.assets.get(n)}n&&!n.resource&&this.system.app.assets.load(n)}}if(!this.emitter){var s=t.mesh;s instanceof ia||(s=null),this.emitter=new D_(this.system.app.graphicsDevice,{numParticles:t.numParticles,emitterExtents:t.emitterExtents,emitterExtentsInner:t.emitterExtentsInner,emitterRadius:t.emitterRadius,emitterRadiusInner:t.emitterRadiusInner,emitterShape:t.emitterShape,initialVelocity:t.initialVelocity,wrap:t.wrap,localSpace:t.localSpace,screenSpace:t.screenSpace,wrapBounds:t.wrapBounds,lifetime:t.lifetime,rate:t.rate,rate2:t.rate2,orientation:t.orientation,particleNormal:t.particleNormal,animTilesX:t.animTilesX,animTilesY:t.animTilesY,animStartFrame:t.animStartFrame,animNumFrames:t.animNumFrames,animNumAnimations:t.animNumAnimations,animIndex:t.animIndex,randomizeAnimIndex:t.randomizeAnimIndex,animSpeed:t.animSpeed,animLoop:t.animLoop,startAngle:t.startAngle,startAngle2:t.startAngle2,scaleGraph:t.scaleGraph,scaleGraph2:t.scaleGraph2,colorGraph:t.colorGraph,colorGraph2:t.colorGraph2,alphaGraph:t.alphaGraph,alphaGraph2:t.alphaGraph2,localVelocityGraph:t.localVelocityGraph,localVelocityGraph2:t.localVelocityGraph2,velocityGraph:t.velocityGraph,velocityGraph2:t.velocityGraph2,rotationSpeedGraph:t.rotationSpeedGraph,rotationSpeedGraph2:t.rotationSpeedGraph2,radialSpeedGraph:t.radialSpeedGraph,radialSpeedGraph2:t.radialSpeedGraph2,colorMap:t.colorMap,normalMap:t.normalMap,loop:t.loop,preWarm:t.preWarm,sort:t.sort,stretch:t.stretch,alignToMotion:t.alignToMotion,lighting:t.lighting,halfLambert:t.halfLambert,intensity:t.intensity,depthSoftening:t.depthSoftening,scene:this.system.app.scene,mesh:s,depthWrite:t.depthWrite,noFog:t.noFog,node:this.entity,blendType:t.blendType}),this.emitter.meshInstance.node=this.entity,this.emitter.drawOrder=this.drawOrder,t.autoPlay||(this.pause(),this.emitter.meshInstance.visible=!1)}this.emitter.colorMap&&this.addMeshInstanceToLayers(),this.system.app.scene.on("set:layers",this.onLayersChanged,this),this.system.app.scene.layers&&(this.system.app.scene.layers.on("add",this.onLayerAdded,this),this.system.app.scene.layers.on("remove",this.onLayerRemoved,this)),this.enabled&&this.entity.enabled&&t.depthSoftening&&this._requestDepth()},i.onDisable=function(){this.system.app.scene.off("set:layers",this.onLayersChanged,this),this.system.app.scene.layers&&(this.system.app.scene.layers.off("add",this.onLayerAdded,this),this.system.app.scene.layers.off("remove",this.onLayerRemoved,this)),this.emitter&&(this.removeMeshInstanceFromLayers(),this.data.depthSoftening&&this._releaseDepth(),this.emitter.camera=null)},i.onBeforeRemove=function(){this.enabled&&(this.enabled=!1),this.emitter&&(this.emitter.destroy(),this.emitter=null);for(var t=0;th.fixedTimeStep&&(e=Math.floor(h.simTime/h.fixedTimeStep),h.simTime-=e*h.fixedTimeStep),e){e=Math.min(e,h.maxSubSteps);for(var v=0;vthis._pool.length)for(var e=this._pool.length;e=this._pool.length&&this._resize(2*this._pool.length),this._pool[this._count++]},e.freeAll=function(){this._count=0},t}(),Z_=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._angularDamping=0,n._angularFactor=new lt(1,1,1),n._angularVelocity=new lt,n._body=null,n._friction=.5,n._group=2,n._linearDamping=0,n._linearFactor=new lt(1,1,1),n._linearVelocity=new lt,n._mask=$f,n._mass=1,n._restitution=0,n._rollingFriction=0,n._simulationEnabled=!1,n._type=jf,n}H(e,t),e.onLibraryLoaded=function(){"undefined"==typeof Ammo||W_||(W_=new Ammo.btTransform,G_=new Ammo.btVector3,H_=new Ammo.btVector3,X_=new Ammo.btQuaternion,q_=new Ammo.btVector3(0,0,0))};var i=e.prototype;return i.createBody=function(){var t,e=this.entity;if(e.collision&&(t=e.collision.shape,e.trigger&&(e.trigger.destroy(),delete e.trigger)),t){this._body&&this.system.onRemove(e,this);var i=this._type===Yf?this._mass:0;this._getEntityTransform(W_);var n=this.system.createBody(i,t,W_);if(n.setRestitution(this._restitution),n.setFriction(this._friction),n.setRollingFriction(this._rollingFriction),n.setDamping(this._linearDamping,this._angularDamping),this._type===Yf){var s=this._linearFactor;G_.setValue(s.x,s.y,s.z),n.setLinearFactor(G_);var a=this._angularFactor;G_.setValue(a.x,a.y,a.z),n.setAngularFactor(G_)}else this._type===Kf&&(n.setCollisionFlags(2|n.getCollisionFlags()),n.setActivationState(4));n.entity=e,this.body=n,this.enabled&&e.enabled&&this.enableSimulation()}},i.isActive=function(){return!!this._body&&this._body.isActive()},i.activate=function(){this._body&&this._body.activate()},i.enableSimulation=function(){var t=this.entity;if(t.collision&&t.collision.enabled&&!this._simulationEnabled){var e=this._body;if(e){switch(this.system.addBody(e,this._group,this._mask),this._type){case Yf:this.system._dynamic.push(this),e.forceActivationState(1),this.syncEntityToBody();break;case Kf:this.system._kinematic.push(this),e.forceActivationState(4);break;case jf:e.forceActivationState(1),this.syncEntityToBody()}"compound"===t.collision.type&&this.system._compounds.push(t.collision),e.activate(),this._simulationEnabled=!0}}},i.disableSimulation=function(){var t=this._body;if(t&&this._simulationEnabled){var e=this.system,i=e._compounds.indexOf(this.entity.collision);i>-1&&e._compounds.splice(i,1),(i=e._dynamic.indexOf(this))>-1&&e._dynamic.splice(i,1),(i=e._kinematic.indexOf(this))>-1&&e._kinematic.splice(i,1),e.removeBody(t),t.forceActivationState(5),this._simulationEnabled=!1}},i.applyForce=function(){var t,e,i,n,s,a;switch(arguments.length){case 1:t=arguments[0].x,e=arguments[0].y,i=arguments[0].z;break;case 2:t=arguments[0].x,e=arguments[0].y,i=arguments[0].z,n=arguments[1].x,s=arguments[1].y,a=arguments[1].z;break;case 3:t=arguments[0],e=arguments[1],i=arguments[2];break;case 6:t=arguments[0],e=arguments[1],i=arguments[2],n=arguments[3],s=arguments[4],a=arguments[5]}var r=this._body;r&&(r.activate(),G_.setValue(t,e,i),void 0!==n?(H_.setValue(n,s,a),r.applyForce(G_,H_)):r.applyForce(G_,q_))},i.applyTorque=function(){var t,e,i;switch(arguments.length){case 1:t=arguments[0].x,e=arguments[0].y,i=arguments[0].z;break;case 3:t=arguments[0],e=arguments[1],i=arguments[2];break;default:return}var n=this._body;n&&(n.activate(),G_.setValue(t,e,i),n.applyTorque(G_))},i.applyImpulse=function(){var t,e,i,n,s,a;switch(arguments.length){case 1:t=arguments[0].x,e=arguments[0].y,i=arguments[0].z;break;case 2:t=arguments[0].x,e=arguments[0].y,i=arguments[0].z,n=arguments[1].x,s=arguments[1].y,a=arguments[1].z;break;case 3:t=arguments[0],e=arguments[1],i=arguments[2];break;case 6:t=arguments[0],e=arguments[1],i=arguments[2],n=arguments[3],s=arguments[4],a=arguments[5];break;default:return}var r=this._body;r&&(r.activate(),G_.setValue(t,e,i),void 0!==n?(H_.setValue(n,s,a),r.applyImpulse(G_,H_)):r.applyImpulse(G_,q_))},i.applyTorqueImpulse=function(){var t,e,i;switch(arguments.length){case 1:t=arguments[0].x,e=arguments[0].y,i=arguments[0].z;break;case 3:t=arguments[0],e=arguments[1],i=arguments[2];break;default:return}var n=this._body;n&&(n.activate(),G_.setValue(t,e,i),n.applyTorqueImpulse(G_))},i.isStatic=function(){return this._type===jf},i.isStaticOrKinematic=function(){return this._type===jf||this._type===Kf},i.isKinematic=function(){return this._type===Kf},i._getEntityTransform=function(t){var e=this.entity,i=e.getPosition(),n=e.getRotation();G_.setValue(i.x,i.y,i.z),X_.setValue(n.x,n.y,n.z,n.w),t.setOrigin(G_),t.setRotation(X_)},i.syncEntityToBody=function(){var t=this._body;if(t){if(this._getEntityTransform(W_),t.setWorldTransform(W_),this._type===Kf){var e=t.getMotionState();e&&e.setWorldTransform(W_)}t.activate()}},i._updateDynamic=function(){var t=this._body;if(t.isActive()){var e=t.getMotionState();if(e){e.getWorldTransform(W_);var i=W_.getOrigin(),n=W_.getRotation();this.entity.setPosition(i.x(),i.y(),i.z()),this.entity.setRotation(n.x(),n.y(),n.z(),n.w())}}},i._updateKinematic=function(){var t=this._body.getMotionState();t&&(this._getEntityTransform(W_),t.setWorldTransform(W_))},i.teleport=function(){arguments.length<3?(arguments[0]&&this.entity.setPosition(arguments[0]),arguments[1]&&(arguments[1]instanceof yt?this.entity.setRotation(arguments[1]):this.entity.setEulerAngles(arguments[1]))):(6===arguments.length&&this.entity.setEulerAngles(arguments[3],arguments[4],arguments[5]),this.entity.setPosition(arguments[0],arguments[1],arguments[2])),this.syncEntityToBody()},i.onEnable=function(){this._body||this.createBody(),this.enableSimulation()},i.onDisable=function(){this.disableSimulation()},W(e,[{key:"angularDamping",get:function(){return this._angularDamping},set:function(t){this._angularDamping!==t&&(this._angularDamping=t,this._body&&this._body.setDamping(this._linearDamping,t))}},{key:"angularFactor",get:function(){return this._angularFactor},set:function(t){this._angularFactor.equals(t)||(this._angularFactor.copy(t),this._body&&this._type===Yf&&(G_.setValue(t.x,t.y,t.z),this._body.setAngularFactor(G_)))}},{key:"angularVelocity",get:function(){if(this._body&&this._type===Yf){var t=this._body.getAngularVelocity();this._angularVelocity.set(t.x(),t.y(),t.z())}return this._angularVelocity},set:function(t){this._body&&this._type===Yf&&(this._body.activate(),G_.setValue(t.x,t.y,t.z),this._body.setAngularVelocity(G_),this._angularVelocity.copy(t))}},{key:"body",get:function(){return this._body},set:function(t){this._body!==t&&(this._body=t,t&&this._simulationEnabled&&t.activate())}},{key:"friction",get:function(){return this._friction},set:function(t){this._friction!==t&&(this._friction=t,this._body&&this._body.setFriction(t))}},{key:"group",get:function(){return this._group},set:function(t){this._group!==t&&(this._group=t,this.enabled&&this.entity.enabled&&(this.disableSimulation(),this.enableSimulation()))}},{key:"linearDamping",get:function(){return this._linearDamping},set:function(t){this._linearDamping!==t&&(this._linearDamping=t,this._body&&this._body.setDamping(t,this._angularDamping))}},{key:"linearFactor",get:function(){return this._linearFactor},set:function(t){this._linearFactor.equals(t)||(this._linearFactor.copy(t),this._body&&this._type===Yf&&(G_.setValue(t.x,t.y,t.z),this._body.setLinearFactor(G_)))}},{key:"linearVelocity",get:function(){if(this._body&&this._type===Yf){var t=this._body.getLinearVelocity();this._linearVelocity.set(t.x(),t.y(),t.z())}return this._linearVelocity},set:function(t){this._body&&this._type===Yf&&(this._body.activate(),G_.setValue(t.x,t.y,t.z),this._body.setLinearVelocity(G_),this._linearVelocity.copy(t))}},{key:"mask",get:function(){return this._mask},set:function(t){this._mask!==t&&(this._mask=t,this.enabled&&this.entity.enabled&&(this.disableSimulation(),this.enableSimulation()))}},{key:"mass",get:function(){return this._mass},set:function(t){if(this._mass!==t&&(this._mass=t,this._body&&this._type===Yf)){var e=this.enabled&&this.entity.enabled;e&&this.disableSimulation(),this._body.getCollisionShape().calculateLocalInertia(t,G_),this._body.setMassProps(t,G_),this._body.updateInertiaTensor(),e&&this.enableSimulation()}}},{key:"restitution",get:function(){return this._restitution},set:function(t){this._restitution!==t&&(this._restitution=t,this._body&&this._body.setRestitution(t))}},{key:"rollingFriction",get:function(){return this._rollingFriction},set:function(t){this._rollingFriction!==t&&(this._rollingFriction=t,this._body&&this._body.setRollingFriction(t))}},{key:"type",get:function(){return this._type},set:function(t){if(this._type!==t){switch(this._type=t,this.disableSimulation(),t){case Yf:this._group=1,this._mask=Zf;break;case Kf:this._group=4,this._mask=Zf;break;case jf:default:this._group=2,this._mask=$f}this.createBody()}}}]),e}(au),$_=function(){this.enabled=!0},Q_=function(t,e,i){this.entity=t,this.point=e,this.normal=i},J_=function(t,e,i){0===arguments.length?(this.a=null,this.b=null,this.impulse=0,this.localPointA=new lt,this.localPointB=new lt,this.pointA=new lt,this.pointB=new lt,this.normal=new lt):(this.a=t,this.b=e,this.impulse=i.impulse,this.localPointA=i.localPoint,this.localPointB=i.localPointOther,this.pointA=i.point,this.pointB=i.pointOther,this.normal=i.normal)},tg=function(t,e,i,n,s,a){void 0===t&&(t=new lt),void 0===e&&(e=new lt),void 0===i&&(i=new lt),void 0===n&&(n=new lt),void 0===s&&(s=new lt),void 0===a&&(a=0),this.localPoint=t,this.localPointOther=e,this.point=i,this.pointOther=n,this.normal=s,this.impulse=a},eg=function(t,e){this.other=t,this.contacts=e},ig=["enabled"],ng=function(t){function e(e){var i;return(i=t.call(this,e)||this).maxSubSteps=10,i.fixedTimeStep=1/60,i.gravity=new lt(0,-9.81,0),i._dynamic=[],i._kinematic=[],i._triggers=[],i._compounds=[],i.id="rigidbody",i._stats=e.stats.frame,i.ComponentType=Z_,i.DataType=$_,i.contactPointPool=null,i.contactResultPool=null,i.singleContactResultPool=null,i.schema=ig,i.collisions={},i.frameCollisions={},i.on("beforeremove",i.onBeforeRemove,q(i)),i.on("remove",i.onRemove,q(i)),i}H(e,t);var i=e.prototype;return i.onLibraryLoaded=function(){if("undefined"!=typeof Ammo){if(this.collisionConfiguration=new Ammo.btDefaultCollisionConfiguration,this.dispatcher=new Ammo.btCollisionDispatcher(this.collisionConfiguration),this.overlappingPairCache=new Ammo.btDbvtBroadphase,this.solver=new Ammo.btSequentialImpulseConstraintSolver,this.dynamicsWorld=new Ammo.btDiscreteDynamicsWorld(this.dispatcher,this.overlappingPairCache,this.solver,this.collisionConfiguration),this.dynamicsWorld.setInternalTickCallback){var t=Ammo.addFunction(this._checkForCollisions.bind(this),"vif");this.dynamicsWorld.setInternalTickCallback(t)}j_=new Ammo.btVector3,Y_=new Ammo.btVector3,Z_.onLibraryLoaded(),this.contactPointPool=new K_(tg,1),this.contactResultPool=new K_(eg,1),this.singleContactResultPool=new K_(J_,1),this.app.systems.on("update",this.onUpdate,this)}else this.app.systems.off("update",this.onUpdate,this)},i.initializeComponentData=function(e,i,n){for(var s=0,a=["mass","linearDamping","angularDamping","linearFactor","angularFactor","friction","rollingFriction","restitution","type","group","mask"];s2){var h=arguments[2];h(i)}}}return Ammo.destroy(n),i},i.raycastAll=function(t,e){var i=[];j_.setValue(t.x,t.y,t.z),Y_.setValue(e.x,e.y,e.z);var n=new Ammo.AllHitsRayResultCallback(j_,Y_);if(this.dynamicsWorld.rayTest(j_,Y_,n),n.hasHit())for(var s=n.get_m_collisionObjects(),a=n.get_m_hitPointWorld(),r=n.get_m_hitNormalWorld(),o=s.size(),h=0;h0)if(4&d||4&f){var v=c.collision&&(c.collision.hasEvent("triggerenter")||c.collision.hasEvent("triggerleave")),y=u.collision&&(u.collision.hasEvent("triggerenter")||u.collision.hasEvent("triggerleave")),x=c.rigidbody&&(c.rigidbody.hasEvent("triggerenter")||c.rigidbody.hasEvent("triggerleave")),b=u.rigidbody&&(u.rigidbody.hasEvent("triggerenter")||u.rigidbody.hasEvent("triggerleave"));v&&(!(g=this._storeCollision(c,u))||4&f||c.collision.fire("triggerenter",u)),y&&(!(g=this._storeCollision(u,c))||4&d||u.collision.fire("triggerenter",c)),x&&(g||(g=this._storeCollision(u,c)),g&&c.rigidbody.fire("triggerenter",u)),b&&(g||(g=this._storeCollision(c,u)),g&&u.rigidbody.fire("triggerenter",c))}else{var S=this._hasContactEvent(c),w=this._hasContactEvent(u),T=this.hasEvent("contact");if(T||S||w){for(var A=0;A=0&&i!==t.element.drawOrder&&this.system.app.batcher.markGroupDirty(t.element._batchGroupId)}t.particlesystem&&(t.particlesystem.drawOrder=e++);for(var n=t.children,s=0;s255&&(t=255),this._priority=t}}]),e}(au),hg=function(){this.enabled=!0},lg=["enabled"],cg=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="screen",i.ComponentType=og,i.DataType=hg,i.schema=lg,i.windowResolution=new ut,i._drawOrderSyncQueue=new z,i.app.graphicsDevice.on("resizecanvas",i._onResize,q(i)),i.app.systems.on("update",i._onUpdate,q(i)),i.on("beforeremove",i.onRemoveComponent,q(i)),i}H(e,t);var i=e.prototype;return i.initializeComponentData=function(e,i,n){void 0!==i.priority&&(e.priority=i.priority),void 0!==i.screenSpace&&(e.screenSpace=i.screenSpace),e.cull=e.screenSpace,void 0!==i.scaleMode&&(e.scaleMode=i.scaleMode),void 0!==i.scaleBlend&&(e.scaleBlend=i.scaleBlend),void 0!==i.resolution&&(i.resolution instanceof ut?e._resolution.copy(i.resolution):e._resolution.set(i.resolution[0],i.resolution[1]),e.resolution=e._resolution),void 0!==i.referenceResolution&&(i.referenceResolution instanceof ut?e._referenceResolution.copy(i.referenceResolution):e._referenceResolution.set(i.referenceResolution[0],i.referenceResolution[1]),e.referenceResolution=e._referenceResolution),e.syncDrawOrder(),t.prototype.initializeComponentData.call(this,e,i,n)},i.destroy=function(){t.prototype.destroy.call(this),this.app.graphicsDevice.off("resizecanvas",this._onResize,this),this.app.systems.off("update",this._onUpdate,this)},i._onUpdate=function(t){var e=this.store;for(var i in e)e[i].entity.screen.update&&e[i].entity.screen.update(t)},i._onResize=function(t,e){this.windowResolution.x=t,this.windowResolution.y=e},i.cloneComponent=function(t,e){var i=t.screen;return this.addComponent(e,{enabled:i.enabled,screenSpace:i.screenSpace,scaleMode:i.scaleMode,resolution:i.resolution.clone(),referenceResolution:i.referenceResolution.clone()})},i.onRemoveComponent=function(t,e){e.onRemove()},i.processDrawOrderSyncQueue=function(){for(var t=this._drawOrderSyncQueue.list(),e=0;eNumber.MAX_SAFE_INTEGER&&this._resetExecutionOrder(),t.enabled=!e.hasOwnProperty("enabled")||!!e.enabled,t.enabled&&t.entity.enabled&&this._enabledComponents.append(t),e.hasOwnProperty("order")&&e.hasOwnProperty("scripts")){t._scriptsData=e.scripts;for(var i=0;i=0&&e._onBeforeRemove(),this._removeComponentFromEnabled(e),this._components.remove(e)},i.destroy=function(){t.prototype.destroy.call(this),this.app.systems.off("initialize",this._onInitialize,this),this.app.systems.off("postInitialize",this._onPostInitialize,this),this.app.systems.off("update",this._onUpdate,this),this.app.systems.off("postUpdate",this._onPostUpdate,this)},e}(sd),pg=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this).on("set_scripts",n.onSetScripts,q(n)),n}H(e,t);var i=e.prototype;return i.send=function(t,e){var i,n=Array.prototype.slice.call(arguments,2),s=this.entity.script.instances;if(s&&s[t]&&(i=s[t].instance[e]))return i.apply(s[t].instance,n)},i.onEnable=function(){this.data.areScriptsLoaded&&!this.system.preloading&&(this.data.initialized?this.system._enableScriptComponent(this):this.system._initializeScriptComponent(this),this.data.postInitialized||this.system._postInitializeScriptComponent(this))},i.onDisable=function(){this.system._disableScriptComponent(this)},i.onSetScripts=function(t,e,i){if(!this.system._inTools||this.runInTools){if(this._updateScriptAttributes(e,i))return;this.enabled&&this.system._disableScriptComponent(this),this.system._destroyScriptComponent(this),this.data.areScriptsLoaded=!1;var n=i.map((function(t){return t.url}));if(this._loadFromCache(n))return;this._loadScripts(n)}},i._updateScriptAttributes=function(t,e){var i=!0;if(t.length!==e.length)i=!1;else for(var n=0,s=e.length;n=0&&this.instancesWithUpdate.splice(s,1)}if(n.fixedUpdate){var a=this.instancesWithFixedUpdate.indexOf(n);a>=0&&this.instancesWithFixedUpdate.splice(a,1)}if(n.postUpdate){var r=this.instancesWithPostUpdate.indexOf(n);r>=0&&this.instancesWithPostUpdate.splice(r,1)}if(n.toolsUpdate){var o=this.instancesWithToolsUpdate.indexOf(n);o>=0&&this.instancesWithToolsUpdate.splice(o,1)}t.instances[i].instance===t[i]&&delete t[i],delete t.instances[i]}},i._postInitializeScriptComponent=function(t){this._callInstancesMethod(t,vg),t.data.postInitialized=!0},i._updateInstances=function(t,e,i){for(var n=0,s=e.length;n0){var i=Eg.sub(Mg).dot(Pg)/e,n=Mg.add(Cg.mulScalar(i));return Rg.copy(this._element.entity.getRotation()).invert().transformVector(n,n),n.mul(this._dragScale),n}return null},i._determineInputPosition=function(t){var e=this._app.graphicsDevice.maxPixelRatio;void 0!==t.x&&void 0!==t.y?(Tg.x=t.x*e,Tg.y=t.y*e):t.changedTouches?(Tg.x=t.changedTouches[0].x*e,Tg.y=t.changedTouches[0].y*e):console.warn("Could not determine position from input event")},i._chooseRayOriginAndDirection=function(){this._element.screen&&this._element.screen.screen.screenSpace?(Mg.set(Tg.x,-Tg.y,0),Cg.set(0,0,-1)):(Ag.copy(this._dragCamera.screenToWorld(Tg.x,Tg.y,1)),Mg.copy(this._dragCamera.entity.getPosition()),Cg.copy(Ag).sub(Mg).normalize())},i._calculateDragScale=function(){var t=this._element.entity.parent,e=this._element.screen&&this._element.screen.screen,i=e&&e.screenSpace,n=i?e.scale:1,s=this._dragScale;for(s.set(n,n,n);t&&(s.mul(t.getLocalScale()),t=t.parent,!i||!t.screen););s.x=1/s.x,s.y=1/s.y,s.z=1/s.z},i._onMove=function(t){if(this._element&&this._isDragging&&this.enabled&&this._element.enabled&&this._element.entity.enabled){var e=this._screenToLocal(t);if(this._dragStartMousePosition&&e){if(this._deltaMousePosition.copy(e).sub(this._dragStartMousePosition),this._deltaHandlePosition.copy(this._dragStartHandlePosition).add(this._deltaMousePosition),this._axis){var i=this._element.entity.getLocalPosition(),n=Ig[this._axis];this._deltaHandlePosition[n]=i[n]}this._element.entity.setLocalPosition(this._deltaHandlePosition),this.fire("drag:move",this._deltaHandlePosition)}}},i.destroy=function(){this._toggleLifecycleListeners("off"),this._toggleDragListeners("off")},W(e,[{key:"enabled",get:function(){return this._enabled},set:function(t){this._enabled=t}},{key:"isDragging",get:function(){return this._isDragging}}]),e}(u),Dg="mouse",kg="keyboard",Og="gamepad",Fg="mousedown",Bg="mousemove",Ng="mouseup",Ug="mousewheel",zg=new ut,Vg=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._viewportReference=new vf(q(n),"viewportEntity",{"element#gain":n._onViewportElementGain,"element#resize":n._onSetContentOrViewportSize}),n._contentReference=new vf(q(n),"contentEntity",{"element#gain":n._onContentElementGain,"element#lose":n._onContentElementLose,"element#resize":n._onSetContentOrViewportSize}),n._scrollbarUpdateFlags={},n._scrollbarReferences={},n._scrollbarReferences[0]=new vf(q(n),"horizontalScrollbarEntity",{"scrollbar#set:value":n._onSetHorizontalScrollbarValue,"scrollbar#gain":n._onHorizontalScrollbarGain}),n._scrollbarReferences[1]=new vf(q(n),"verticalScrollbarEntity",{"scrollbar#set:value":n._onSetVerticalScrollbarValue,"scrollbar#gain":n._onVerticalScrollbarGain}),n._prevContentSizes={},n._prevContentSizes[0]=null,n._prevContentSizes[1]=null,n._scroll=new ut,n._velocity=new lt,n._dragStartPosition=new lt,n._disabledContentInput=!1,n._disabledContentInputEntities=[],n._toggleLifecycleListeners("on",e),n._toggleElementListeners("on"),n}H(e,t);var i=e.prototype;return i._toggleLifecycleListeners=function(t,e){this[t]("set_horizontal",this._onSetHorizontalScrollingEnabled,this),this[t]("set_vertical",this._onSetVerticalScrollingEnabled,this),e.app.systems.element[t]("add",this._onElementComponentAdd,this),e.app.systems.element[t]("beforeremove",this._onElementComponentRemove,this)},i._toggleElementListeners=function(t){if(this.entity.element){if("on"===t&&this._hasElementListeners)return;this.entity.element[t]("resize",this._onSetContentOrViewportSize,this),this.entity.element[t](Ug,this._onMouseWheel,this),this._hasElementListeners="on"===t}},i._onElementComponentAdd=function(t){this.entity===t&&this._toggleElementListeners("on")},i._onElementComponentRemove=function(t){this.entity===t&&this._toggleElementListeners("off")},i._onViewportElementGain=function(){this._syncAll()},i._onContentElementGain=function(){this._destroyDragHelper(),this._contentDragHelper=new Lg(this._contentReference.entity.element),this._contentDragHelper.on("drag:start",this._onContentDragStart,this),this._contentDragHelper.on("drag:end",this._onContentDragEnd,this),this._contentDragHelper.on("drag:move",this._onContentDragMove,this),this._prevContentSizes[0]=null,this._prevContentSizes[1]=null,this._syncAll()},i._onContentElementLose=function(){this._destroyDragHelper()},i._onContentDragStart=function(){this._contentReference.entity&&this.enabled&&this.entity.enabled&&this._dragStartPosition.copy(this._contentReference.entity.getLocalPosition())},i._onContentDragEnd=function(){this._prevContentDragPosition=null,this._enableContentInput()},i._onContentDragMove=function(t){if(this._contentReference.entity&&this.enabled&&this.entity.enabled&&(this._wasDragged=!0,this._setScrollFromContentPosition(t),this._setVelocityFromContentPositionDelta(t),!this._disabledContentInput)){var e=t.x-this._dragStartPosition.x,i=t.y-this._dragStartPosition.y;(Math.abs(e)>this.dragThreshold||Math.abs(i)>this.dragThreshold)&&this._disableContentInput()}},i._onSetContentOrViewportSize=function(){this._syncAll()},i._onSetHorizontalScrollbarValue=function(t){!this._scrollbarUpdateFlags[0]&&this.enabled&&this.entity.enabled&&this._onSetScroll(t,null)},i._onSetVerticalScrollbarValue=function(t){!this._scrollbarUpdateFlags[1]&&this.enabled&&this.entity.enabled&&this._onSetScroll(null,t)},i._onSetHorizontalScrollingEnabled=function(){this._syncScrollbarEnabledState(0)},i._onSetVerticalScrollingEnabled=function(){this._syncScrollbarEnabledState(1)},i._onHorizontalScrollbarGain=function(){this._syncScrollbarEnabledState(0),this._syncScrollbarPosition(0)},i._onVerticalScrollbarGain=function(){this._syncScrollbarEnabledState(1),this._syncScrollbarPosition(1)},i._onSetScroll=function(t,e,i){!1!==i&&this._velocity.set(0,0,0);var n=!1;n|=this._updateAxis(t,"x",0),(n|=this._updateAxis(e,"y",1))&&this.fire("set:scroll",this._scroll)},i._updateAxis=function(t,e,i){var n=null!==t&&Math.abs(t-this._scroll[e])>1e-5;return(n||this._isDragging()||0===t)&&(this._scroll[e]=this._determineNewScrollValue(t,e,i),this._syncContentPosition(i),this._syncScrollbarPosition(i)),n},i._determineNewScrollValue=function(t,e,i){if(!this._getScrollingEnabled(i))return this._scroll[e];switch(this.scrollMode){case 0:return it.clamp(t,0,this._getMaxScrollValue(i));case 1:return this._setVelocityFromOvershoot(t,e,i),t;case 2:return t;default:return console.warn("Unhandled scroll mode:"+this.scrollMode),t}},i._syncAll=function(){this._syncContentPosition(0),this._syncContentPosition(1),this._syncScrollbarPosition(0),this._syncScrollbarPosition(1),this._syncScrollbarEnabledState(0),this._syncScrollbarEnabledState(1)},i._syncContentPosition=function(t){var e=this._getAxis(t),i=this._getSign(t),n=this._contentReference.entity;if(n){var s=this._prevContentSizes[t],a=this._getContentSize(t);if(null!==s&&Math.abs(s-a)>1e-4){var r=this._getMaxOffset(t,s),o=this._getMaxOffset(t,a);this._scroll[e]=0===o?1:it.clamp(this._scroll[e]*r/o,0,1)}var h=this._scroll[e]*this._getMaxOffset(t),l=n.getLocalPosition();l[e]=h*i,n.setLocalPosition(l),this._prevContentSizes[t]=a}},i._syncScrollbarPosition=function(t){var e=this._getAxis(t),i=this._scrollbarReferences[t].entity;i&&i.scrollbar&&(this._scrollbarUpdateFlags[t]=!0,i.scrollbar.value=this._scroll[e],i.scrollbar.handleSize=this._getScrollbarHandleSize(e,t),this._scrollbarUpdateFlags[t]=!1)},i._syncScrollbarEnabledState=function(t){var e=this._scrollbarReferences[t].entity;if(e){var i=this._getScrollingEnabled(t),n=this._getScrollbarVisibility(t);switch(n){case 0:return void(e.enabled=i);case 1:return void(e.enabled=i&&this._contentIsLargerThanViewport(t));default:console.warn("Unhandled scrollbar visibility:"+n),e.enabled=i}}},i._contentIsLargerThanViewport=function(t){return this._getContentSize(t)>this._getViewportSize(t)},i._contentPositionToScrollValue=function(t){var e=this._getMaxOffset(0),i=this._getMaxOffset(1);return zg.x=0===e?0:t.x/e,zg.y=0===i?0:t.y/-i,zg},i._getMaxOffset=function(t,e){e=void 0===e?this._getContentSize(t):e;var i=this._getViewportSize(t);return e1e-4||Math.abs(this._velocity.y)>1e-4){var t=this._contentReference.entity.getLocalPosition();t.x+=this._velocity.x,t.y+=this._velocity.y,this._contentReference.entity.setLocalPosition(t),this._setScrollFromContentPosition(t)}this._velocity.x*=1-this.friction,this._velocity.y*=1-this.friction}},i._hasOvershoot=function(t,e){return Math.abs(this._toOvershoot(this.scroll[t],e))>.001},i._toOvershoot=function(t,e){var i=this._getMaxScrollValue(e);return t<0?t:t>i?t-i:0},i._setVelocityFromOvershoot=function(t,e,i){var n=this._toOvershoot(t,i)*this._getMaxOffset(i)*this._getSign(i);Math.abs(n)>0&&(this._velocity[e]=-n/(50*this.bounceAmount+1))},i._setVelocityFromContentPositionDelta=function(t){this._prevContentDragPosition?(this._velocity.sub2(t,this._prevContentDragPosition),this._prevContentDragPosition.copy(t)):(this._velocity.set(0,0,0),this._prevContentDragPosition=t.clone())},i._setScrollFromContentPosition=function(t){var e=this._contentPositionToScrollValue(t);this._isDragging()&&(e=this._applyScrollValueTension(e)),this._onSetScroll(e.x,e.y,!1)},i._applyScrollValueTension=function(t){var e=this._getMaxScrollValue(0),i=this._toOvershoot(t.x,0);return i>0?t.x=e+1*Math.log10(1+i):i<0&&(t.x=-1*Math.log10(1-i)),e=this._getMaxScrollValue(1),(i=this._toOvershoot(t.y,1))>0?t.y=e+1*Math.log10(1+i):i<0&&(t.y=-1*Math.log10(1-i)),t},i._isDragging=function(){return this._contentDragHelper&&this._contentDragHelper.isDragging},i._setScrollbarComponentsEnabled=function(t){this._scrollbarReferences[0].hasComponent("scrollbar")&&(this._scrollbarReferences[0].entity.scrollbar.enabled=t),this._scrollbarReferences[1].hasComponent("scrollbar")&&(this._scrollbarReferences[1].entity.scrollbar.enabled=t)},i._setContentDraggingEnabled=function(t){this._contentDragHelper&&(this._contentDragHelper.enabled=t)},i._onMouseWheel=function(t){if(this.useMouseWheel){var e=t.event,i=e.deltaX/this._contentReference.entity.element.calculatedWidth*this.mouseWheelSensitivity.x,n=e.deltaY/this._contentReference.entity.element.calculatedHeight*this.mouseWheelSensitivity.y,s=it.clamp(this._scroll.x+i,0,this._getMaxScrollValue(0)),a=it.clamp(this._scroll.y+n,0,this._getMaxScrollValue(1));this.scroll=new ut(s,a)}},i._enableContentInput=function(){for(;this._disabledContentInputEntities.length;){var t=this._disabledContentInputEntities.pop();t.element&&(t.element.useInput=!0)}this._disabledContentInput=!1},i._disableContentInput=function(){var t=this,e=function e(i){i.element&&i.element.useInput&&(t._disabledContentInputEntities.push(i),i.element.useInput=!1);for(var n=i.children,s=0,a=n.length;s1e-5&&(this.data.value=it.clamp(i,0,1),this._updateHandlePositionAndSize(),this.fire("set:value",this.data.value))},i._onSetHandleSize=function(t,e,i){Math.abs(i-e)>1e-5&&(this.data.handleSize=it.clamp(i,0,1),this._updateHandlePositionAndSize())},i._onSetHandleAlignment=function(){this._updateHandlePositionAndSize()},i._onSetOrientation=function(t,e,i){i!==e&&this._handleReference.hasComponent("element")&&(this._handleReference.entity.element[this._getOppositeDimension()]=0)},i._updateHandlePositionAndSize=function(){var t=this._handleReference.entity,e=t&&t.element;if(t){var i=t.getLocalPosition();i[this._getAxis()]=this._getHandlePosition(),this._handleReference.entity.setLocalPosition(i)}e&&(e[this._getDimension()]=this._getHandleLength())},i._handlePositionToScrollValue=function(t){return t*this._getSign()/this._getUsableTrackLength()},i._scrollValueToHandlePosition=function(t){return t*this._getSign()*this._getUsableTrackLength()},i._getUsableTrackLength=function(){return Math.max(this._getTrackLength()-this._getHandleLength(),.001)},i._getTrackLength=function(){return this.entity.element?0===this.orientation?this.entity.element.calculatedWidth:this.entity.element.calculatedHeight:0},i._getHandleLength=function(){return this._getTrackLength()*this.handleSize},i._getHandlePosition=function(){return this._scrollValueToHandlePosition(this.value)},i._getSign=function(){return 0===this.orientation?1:-1},i._getAxis=function(){return 0===this.orientation?"x":"y"},i._getDimension=function(){return 0===this.orientation?"width":"height"},i._getOppositeDimension=function(){return 0===this.orientation?"height":"width"},i._destroyDragHelper=function(){this._handleDragHelper&&this._handleDragHelper.destroy()},i._setHandleDraggingEnabled=function(t){this._handleDragHelper&&(this._handleDragHelper.enabled=t)},i.onEnable=function(){this._handleReference.onParentComponentEnable(),this._setHandleDraggingEnabled(!0)},i.onDisable=function(){this._setHandleDraggingEnabled(!1)},i.onRemove=function(){this._destroyDragHelper(),this._toggleLifecycleListeners("off")},e}(au),qg=function(){this.enabled=!0},jg=[{name:"enabled",type:"boolean"},{name:"orientation",type:"number"},{name:"value",type:"number"},{name:"handleSize",type:"number"},{name:"handleEntity",type:"entity"}],Yg=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="scrollbar",i.ComponentType=Xg,i.DataType=qg,i.schema=jg,i.on("beforeremove",i._onRemoveComponent,q(i)),i}H(e,t);var i=e.prototype;return i.initializeComponentData=function(e,i,n){t.prototype.initializeComponentData.call(this,e,i,jg)},i._onRemoveComponent=function(t,e){e.onRemove()},e}(sd);au._buildAccessors(Xg.prototype,jg);function Kg(t,e){return t%e||0}var Zg=function(t){function e(e,i,n){var s;return(s=t.call(this)||this).source=null,s._manager=e,s._volume=void 0!==n.volume?it.clamp(Number(n.volume)||0,0,1):1,s._pitch=void 0!==n.pitch?Math.max(.01,Number(n.pitch)||0):1,s._loop=!(void 0===n.loop||!n.loop),s._sound=i,s._state=2,s._suspended=!1,s._suspendEndEvent=!1,s._suspendInstanceEvents=!1,s._playWhenLoaded=!0,s._startTime=Math.max(0,Number(n.startTime)||0),s._duration=Math.max(0,Number(n.duration)||0),s._startOffset=null,s._onPlayCallback=n.onPlay,s._onPauseCallback=n.onPause,s._onResumeCallback=n.onResume,s._onStopCallback=n.onStop,s._onEndCallback=n.onEnd,qo()?(s._startedAt=0,s._currentTime=0,s._currentOffset=0,s._inputNode=null,s._connectorNode=null,s._firstNode=null,s._lastNode=null,s._initializeNodes(),s._endedHandler=s._onEnded.bind(q(s))):(s._isReady=!1,s._loadedMetadataHandler=s._onLoadedMetadata.bind(q(s)),s._timeUpdateHandler=s._onTimeUpdate.bind(q(s)),s._endedHandler=s._onEnded.bind(q(s)),s._createSource()),s}H(e,t);var i=e.prototype;return i._onPlay=function(){this.fire("play"),this._onPlayCallback&&this._onPlayCallback(this)},i._onPause=function(){this.fire("pause"),this._onPauseCallback&&this._onPauseCallback(this)},i._onResume=function(){this.fire("resume"),this._onResumeCallback&&this._onResumeCallback(this)},i._onStop=function(){this.fire("stop"),this._onStopCallback&&this._onStopCallback(this)},i._onEnded=function(){this._suspendEndEvent?this._suspendEndEvent=!1:(this.fire("end"),this._onEndCallback&&this._onEndCallback(this),this.stop())},i._onManagerVolumeChange=function(){this.volume=this._volume},i._onManagerSuspend=function(){0!==this._state||this._suspended||(this._suspended=!0,this.pause())},i._onManagerResume=function(){this._suspended&&(this._suspended=!1,this.resume())},i._initializeNodes=function(){this.gain=this._manager.context.createGain(),this._inputNode=this.gain,this._connectorNode=this.gain,this._connectorNode.connect(this._manager.context.destination)},i.play=function(){2!==this._state&&this.stop(),this.source||this._createSource();var t=Kg(this._startOffset,this.duration);return t=Kg(this._startTime+t,this._sound.duration),this._startOffset=null,this._duration?this.source.start(0,t,this._duration):this.source.start(0,t),this._startedAt=this._manager.context.currentTime,this._currentTime=0,this._currentOffset=t,this._state=0,this._playWhenLoaded=!1,this.volume=this._volume,this.loop=this._loop,this.pitch=this._pitch,this._manager.on("volumechange",this._onManagerVolumeChange,this),this._manager.on("suspend",this._onManagerSuspend,this),this._manager.on("resume",this._onManagerResume,this),this._manager.on("destroy",this._onManagerDestroy,this),this._manager.suspended&&this._onManagerSuspend(),this._suspendInstanceEvents||this._onPlay(),!0},i.pause=function(){return this._playWhenLoaded=!1,!(0!==this._state||!this.source)&&(this._updateCurrentTime(),this._state=1,this._suspendEndEvent=!0,this.source.stop(0),this.source=null,this._startOffset=null,this._suspendInstanceEvents||this._onPause(),!0)},i.resume=function(){if(1!==this._state)return!1;this.source||this._createSource();var t=this.currentTime;return null!==this._startOffset&&(t=Kg(this._startOffset,this.duration),t=Kg(this._startTime+t,this._sound.duration),this._startOffset=null),this._duration?this.source.start(0,t,this._duration):this.source.start(0,t),this._state=0,this._startedAt=this._manager.context.currentTime,this._currentOffset=t,this.volume=this._volume,this.loop=this._loop,this.pitch=this._pitch,this._playWhenLoaded=!1,this._suspendInstanceEvents||this._onResume(),!0},i.stop=function(){return this._playWhenLoaded=!1,!(2===this._state||!this.source)&&(this._manager.off("volumechange",this._onManagerVolumeChange,this),this._manager.off("suspend",this._onManagerSuspend,this),this._manager.off("resume",this._onManagerResume,this),this._manager.off("destroy",this._onManagerDestroy,this),this._startedAt=0,this._currentTime=0,this._currentOffset=0,this._startOffset=null,this._suspendEndEvent=!0,0===this._state&&this.source.stop(0),this.source=null,this._state=2,this._suspendInstanceEvents||this._onStop(),!0)},i.setExternalNodes=function(t,e){if(t){e||(e=t);var i=this._manager.context.destination;this._firstNode!==t&&(this._firstNode?this._connectorNode.disconnect(this._firstNode):this._connectorNode.disconnect(i),this._firstNode=t,this._connectorNode.connect(t)),this._lastNode!==e&&(this._lastNode&&this._lastNode.disconnect(i),this._lastNode=e,this._lastNode.connect(i))}else console.error("The firstNode must be a valid Audio Node")},i.clearExternalNodes=function(){var t=this._manager.context.destination;this._firstNode&&(this._connectorNode.disconnect(this._firstNode),this._firstNode=null),this._lastNode&&(this._lastNode.disconnect(t),this._lastNode=null),this._connectorNode.connect(t)},i.getExternalNodes=function(){return[this._firstNode,this._lastNode]},i._createSource=function(){if(!this._sound)return null;var t=this._manager.context;return this._sound.buffer&&(this.source=t.createBufferSource(),this.source.buffer=this._sound.buffer,this.source.connect(this._inputNode),this.source.onended=this._endedHandler,this.source.loopStart=Kg(this._startTime,this.source.buffer.duration),this._duration&&(this.source.loopEnd=Math.max(this.source.loopStart,Kg(this._startTime+this._duration,this.source.buffer.duration)))),this.source},i._updateCurrentTime=function(){this._currentTime=Kg((this._manager.context.currentTime-this._startedAt)*this._pitch+this._currentOffset,this.duration)},i._onManagerDestroy=function(){this.source&&0===this._state&&(this.source.stop(0),this.source=null)},W(e,[{key:"currentTime",get:function(){return null!==this._startOffset?this._startOffset:1===this._state?this._currentTime:2!==this._state&&this.source?(this._updateCurrentTime(),this._currentTime):0},set:function(t){if(!(t<0))if(0===this._state){var e=this._suspendInstanceEvents;this._suspendInstanceEvents=!0,this.stop(),this._startOffset=t,this.play(),this._suspendInstanceEvents=e}else this._startOffset=t,this._currentTime=t}},{key:"duration",get:function(){return this._sound?this._duration?Kg(this._duration,this._sound.duration):this._sound.duration:0},set:function(t){this._duration=Math.max(0,Number(t)||0);var e=0===this._state;this.stop(),e&&this.play()}},{key:"isPaused",get:function(){return 1===this._state}},{key:"isPlaying",get:function(){return 0===this._state}},{key:"isStopped",get:function(){return 2===this._state}},{key:"isSuspended",get:function(){return this._suspended}},{key:"loop",get:function(){return this._loop},set:function(t){this._loop=!!t,this.source&&(this.source.loop=this._loop)}},{key:"pitch",get:function(){return this._pitch},set:function(t){this._currentOffset=this.currentTime,this._startedAt=this._manager.context.currentTime,this._pitch=Math.max(Number(t)||0,.01),this.source&&(this.source.playbackRate.value=this._pitch)}},{key:"sound",get:function(){return this._sound},set:function(t){this._sound=t,2!==this._state?this.stop():this._createSource()}},{key:"startTime",get:function(){return this._startTime},set:function(t){this._startTime=Math.max(0,Number(t)||0);var e=0===this._state;this.stop(),e&&this.play()}},{key:"volume",get:function(){return this._volume},set:function(t){t=it.clamp(t,0,1),this._volume=t,this.gain&&(this.gain.gain.value=t*this._manager.volume)}}]),e}(u);qo()||(Object.assign(Zg.prototype,{play:function(){return 2!==this._state&&this.stop(),!(!this.source&&!this._createSource())&&(this.volume=this._volume,this.pitch=this._pitch,this.loop=this._loop,this.source.play(),this._state=0,this._playWhenLoaded=!1,this._manager.on("volumechange",this._onManagerVolumeChange,this),this._manager.on("suspend",this._onManagerSuspend,this),this._manager.on("resume",this._onManagerResume,this),this._manager.on("destroy",this._onManagerDestroy,this),this._manager.suspended&&this._onManagerSuspend(),this._suspendInstanceEvents||this._onPlay(),!0)},pause:function(){return!(!this.source||0!==this._state)&&(this._suspendEndEvent=!0,this.source.pause(),this._playWhenLoaded=!1,this._state=1,this._startOffset=null,this._suspendInstanceEvents||this._onPause(),!0)},resume:function(){return!(!this.source||1!==this._state)&&(this._state=0,this._playWhenLoaded=!1,this.source.paused&&(this.source.play(),this._suspendInstanceEvents||this._onResume()),!0)},stop:function(){return!(!this.source||2===this._state)&&(this._manager.off("volumechange",this._onManagerVolumeChange,this),this._manager.off("suspend",this._onManagerSuspend,this),this._manager.off("resume",this._onManagerResume,this),this._manager.off("destroy",this._onManagerDestroy,this),this._suspendEndEvent=!0,this.source.pause(),this._playWhenLoaded=!1,this._state=2,this._startOffset=null,this._suspendInstanceEvents||this._onStop(),!0)},setExternalNodes:function(){},clearExternalNodes:function(){},getExternalNodes:function(){return[null,null]},_onLoadedMetadata:function(){this.source.removeEventListener("loadedmetadata",this._loadedMetadataHandler),this._isReady=!0;var t=Kg(this._startOffset,this.duration);t=Kg(this._startTime+t,this._sound.duration),this._startOffset=null,this.source.currentTime=t},_createSource:function(){return this._sound&&this._sound.audio&&(this._isReady=!1,this.source=this._sound.audio.cloneNode(!0),this.source.addEventListener("loadedmetadata",this._loadedMetadataHandler),this.source.addEventListener("timeupdate",this._timeUpdateHandler),this.source.onended=this._endedHandler),this.source},_onTimeUpdate:function(){this._duration&&this.source.currentTime>Kg(this._startTime+this._duration,this.source.duration)&&(this.loop?this.source.currentTime=Kg(this._startTime,this.source.duration):(this.source.removeEventListener("timeupdate",this._timeUpdateHandler),this.source.pause(),this._onEnded()))},_onManagerDestroy:function(){this.source&&this.source.pause()}}),Object.defineProperty(Zg.prototype,"volume",{get:function(){return this._volume},set:function(t){t=it.clamp(t,0,1),this._volume=t,this.source&&(this.source.volume=t*this._manager.volume)}}),Object.defineProperty(Zg.prototype,"pitch",{get:function(){return this._pitch},set:function(t){this._pitch=Math.max(Number(t)||0,.01),this.source&&(this.source.playbackRate=this._pitch)}}),Object.defineProperty(Zg.prototype,"sound",{get:function(){return this._sound},set:function(t){this.stop(),this._sound=t}}),Object.defineProperty(Zg.prototype,"currentTime",{get:function(){return null!==this._startOffset?this._startOffset:2!==this._state&&this.source?this.source.currentTime-this._startTime:0},set:function(t){t<0||(this._startOffset=t,this.source&&this._isReady&&(this.source.currentTime=Kg(this._startTime+Kg(t,this.duration),this._sound.duration),this._startOffset=null))}}));var $g=function(t){function e(e,i,n){var s;return void 0===n&&(n={}),(s=t.call(this,e,i,n)||this)._position=new lt,s._velocity=new lt,n.position&&(s.position=n.position),s.maxDistance=void 0!==n.maxDistance?Number(n.maxDistance):1e4,s.refDistance=void 0!==n.refDistance?Number(n.refDistance):1,s.rollOffFactor=void 0!==n.rollOffFactor?Number(n.rollOffFactor):1,s.distanceModel=void 0!==n.distanceModel?n.distanceModel:Yo,s}return H(e,t),e.prototype._initializeNodes=function(){this.gain=this._manager.context.createGain(),this.panner=this._manager.context.createPanner(),this.panner.connect(this.gain),this._inputNode=this.panner,this._connectorNode=this.gain,this._connectorNode.connect(this._manager.context.destination)},W(e,[{key:"position",get:function(){return this._position},set:function(t){this._position.copy(t);var e=this.panner;"positionX"in e?(e.positionX.value=t.x,e.positionY.value=t.y,e.positionZ.value=t.z):e.setPosition&&e.setPosition(t.x,t.y,t.z)}},{key:"velocity",get:function(){return this._velocity},set:function(t){this._velocity.copy(t)}},{key:"maxDistance",get:function(){return this.panner.maxDistance},set:function(t){this.panner.maxDistance=t}},{key:"refDistance",get:function(){return this.panner.refDistance},set:function(t){this.panner.refDistance=t}},{key:"rollOffFactor",get:function(){return this.panner.rolloffFactor},set:function(t){this.panner.rolloffFactor=t}},{key:"distanceModel",get:function(){return this.panner.distanceModel},set:function(t){this.panner.distanceModel=t}}]),e}(Zg);if(!qo()){var Qg=new lt;Object.defineProperty($g.prototype,"position",{get:function(){return this._position},set:function(t){if(this._position.copy(t),this.source){var e=function(t,e,i,n,s,a){var r=(Qg=Qg.sub2(t,e)).length();if(rn)return 0;var o=0;return a===Yo?o=1-s*(r-i)/(n-i):a===Ko?o=i/(i+s*(r-i)):a===Zo&&(o=Math.pow(r/i,-s)),it.clamp(o,0,1)}(this._manager.listener.getPosition(),this._position,this.refDistance,this.maxDistance,this.rollOffFactor,this.distanceModel),i=this.volume;this.source.volume=i*e*this._manager.volume}}}),Object.defineProperty($g.prototype,"maxDistance",{get:function(){return this._maxDistance},set:function(t){this._maxDistance=t}}),Object.defineProperty($g.prototype,"refDistance",{get:function(){return this._refDistance},set:function(t){this._refDistance=t}}),Object.defineProperty($g.prototype,"rollOffFactor",{get:function(){return this._rollOffFactor},set:function(t){this._rollOffFactor=t}}),Object.defineProperty($g.prototype,"distanceModel",{get:function(){return this._distanceModel},set:function(t){this._distanceModel=t}})}var Jg={volume:0,pitch:0,loop:!1,startTime:0,duration:0,position:new lt,maxDistance:0,refDistance:0,rollOffFactor:0,distanceModel:0,onPlay:null,onPause:null,onResume:null,onStop:null,onEnd:null},tv=function(t){function e(e,i,n){var s;return void 0===i&&(i="Untitled"),void 0===n&&(n={}),(s=t.call(this)||this).name=void 0,s.instances=[],s._component=e,s._assets=e.system.app.assets,s._manager=e.system.manager,s.name=i,s._volume=void 0!==n.volume?it.clamp(Number(n.volume)||0,0,1):1,s._pitch=void 0!==n.pitch?Math.max(.01,Number(n.pitch)||0):1,s._loop=!(void 0===n.loop||!n.loop),s._duration=n.duration>0?n.duration:null,s._startTime=Math.max(0,Number(n.startTime)||0),s._overlap=!!n.overlap,s._autoPlay=!!n.autoPlay,s._firstNode=null,s._lastNode=null,s._asset=n.asset,s._asset instanceof Eh&&(s._asset=s._asset.id),s._onInstancePlayHandler=s._onInstancePlay.bind(q(s)),s._onInstancePauseHandler=s._onInstancePause.bind(q(s)),s._onInstanceResumeHandler=s._onInstanceResume.bind(q(s)),s._onInstanceStopHandler=s._onInstanceStop.bind(q(s)),s._onInstanceEndHandler=s._onInstanceEnd.bind(q(s)),s}H(e,t);var i=e.prototype;return i.play=function(){if(this.overlap||this.stop(),this.isLoaded||this._hasAsset()){var t=this._createInstance();if(this.instances.push(t),this.isLoaded)t.play();else{var e=function(e){var i=t._playWhenLoaded;t.sound=e,i&&t.play()};this.off("load",e),this.once("load",e),this.load()}return t}},i.pause=function(){for(var t=!1,e=this.instances,i=0,n=e.length;i=0;a--){var r=s[a].isPlaying||s[a].isSuspended,o=s[a].currentTime;r&&s[a].stop();var h=n._createInstance();r&&(h.play(),h.currentTime=o),s.push(h)}}}},{key:"slots",get:function(){return this._slots},set:function(t){var e=this._slots;if(e)for(var i in e)e[i].stop();var n={};for(var s in t)t[s]instanceof tv?n[t[s].name]=t[s]:t[s].name&&(n[t[s].name]=new tv(this,t[s].name,t[s]));this._slots=n,this.enabled&&this.entity.enabled&&this.onEnable()}}]),e}(au),iv=function(){this.enabled=!0},nv=["enabled"],sv=function(t){function e(e,i){var n;return(n=t.call(this,e)||this).id="sound",n.ComponentType=ev,n.DataType=iv,n.schema=nv,n.manager=i,n.app.systems.on("update",n.onUpdate,q(n)),n.on("beforeremove",n.onBeforeRemove,q(n)),n}H(e,t);var i=e.prototype;return i.initializeComponentData=function(e,i,n){n=["volume","pitch","positional","refDistance","maxDistance","rollOffFactor","distanceModel","slots"];for(var s=0;sn||i<0;this._setTime(i);var a=this.frame;(a=this._sprite?Math.floor(this._sprite.frameKeys.length*this._time/n):0)!==this._frame&&this._setFrame(a),s&&(this.loop?(this.fire("loop"),this._component.fire("loop",this)):(this._playing=!1,this._paused=!1,this.fire("end"),this._component.fire("end",this)))}},i._setTime=function(t){this._time=t;var e=this.duration;this._time<0?this.loop?this._time=this._time%e+e:this._time=0:this._time>e&&(this.loop?this._time%=e:this._time=e)},i._setFrame=function(t){this._sprite?this._frame=it.clamp(t,0,this._sprite.frameKeys.length-1):this._frame=t,this._component.currentClip===this&&this._component._showFrame(this._frame)},i._destroy=function(){this._sprite&&(this.sprite=null),this._spriteAsset&&(this.spriteAsset=null)},i.play=function(){this._playing||(this._playing=!0,this._paused=!1,this.frame=0,this.fire("play"),this._component.fire("play",this))},i.pause=function(){this._playing&&!this._paused&&(this._paused=!0,this.fire("pause"),this._component.fire("pause",this))},i.resume=function(){this._paused&&(this._paused=!1,this.fire("resume"),this._component.fire("resume",this))},i.stop=function(){this._playing&&(this._playing=!1,this._paused=!1,this._time=0,this.frame=0,this.fire("stop"),this._component.fire("stop",this))},W(e,[{key:"duration",get:function(){if(this._sprite){var t=this.fps||Number.MIN_VALUE;return this._sprite.frameKeys.length/Math.abs(t)}return 0}},{key:"frame",get:function(){return this._frame},set:function(t){this._setFrame(t);var e=this.fps||Number.MIN_VALUE;this._setTime(this._frame/e)}},{key:"isPaused",get:function(){return this._paused}},{key:"isPlaying",get:function(){return this._playing}},{key:"sprite",get:function(){return this._sprite},set:function(t){var e;(this._sprite&&(this._sprite.off("set:meshes",this._onSpriteMeshesChange,this),this._sprite.off("set:pixelsPerUnit",this._onSpritePpuChanged,this),this._sprite.off("set:atlas",this._onSpriteMeshesChange,this),this._sprite.atlas&&this._sprite.atlas.off("set:texture",this._onSpriteMeshesChange,this)),this._sprite=t,this._sprite&&(this._sprite.on("set:meshes",this._onSpriteMeshesChange,this),this._sprite.on("set:pixelsPerUnit",this._onSpritePpuChanged,this),this._sprite.on("set:atlas",this._onSpriteMeshesChange,this),this._sprite.atlas&&this._sprite.atlas.on("set:texture",this._onSpriteMeshesChange,this)),this._component.currentClip===this)&&(t&&t.atlas?(t.atlas.texture&&((e=this._component._meshInstance)&&(e.setParameter("texture_emissiveMap",t.atlas.texture),e.setParameter("texture_opacityMap",t.atlas.texture)),this._component.enabled&&this._component.entity.enabled&&this._component._showModel()),this.time&&this.fps?this.time=this.time:this.frame=this.frame):((e=this._component._meshInstance)&&(e.deleteParameter("texture_emissiveMap"),e.deleteParameter("texture_opacityMap")),this._component._hideModel()))}},{key:"spriteAsset",get:function(){return this._spriteAsset},set:function(t){var e=this._component.system.app.assets,i=t;if(t instanceof Eh&&(i=t.id),this._spriteAsset!==i){if(this._spriteAsset){var n=e.get(this._spriteAsset);n&&this._unbindSpriteAsset(n)}if(this._spriteAsset=i,this._spriteAsset){var s=e.get(this._spriteAsset);s?this._bindSpriteAsset(s):(this.sprite=null,e.on("add:"+this._spriteAsset,this._onSpriteAssetAdded,this))}else this.sprite=null}}},{key:"time",get:function(){return this._time},set:function(t){this._setTime(t),this._sprite?this.frame=Math.min(this._sprite.frameKeys.length-1,Math.floor(this._time*Math.abs(this.fps))):this.frame=0}}]),e}(u),hv="texture_emissiveMap",lv="texture_opacityMap",cv="material_emissive",uv="material_opacity",dv=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._type=av,n._material=e.defaultMaterial,n._color=new at(1,1,1,1),n._colorUniform=new Float32Array(3),n._speed=1,n._flipX=!1,n._flipY=!1,n._width=1,n._height=1,n._drawOrder=0,n._layers=[0],n._outerScale=new ut(1,1),n._outerScaleUniform=new Float32Array(2),n._innerOffset=new dt,n._innerOffsetUniform=new Float32Array(4),n._atlasRect=new dt,n._atlasRectUniform=new Float32Array(4),n._batchGroupId=-1,n._batchGroup=null,n._node=new tn,n._model=new Uo,n._model.graph=n._node,n._meshInstance=null,i.addChild(n._model.graph),n._model._entity=i,n._updateAabbFunc=n._updateAabb.bind(q(n)),n._addedModel=!1,n._autoPlayClip=null,n._clips={},n._defaultClip=new ov(q(n),{name:n.entity.name,fps:0,loop:!1,spriteAsset:null}),n._currentClip=n._defaultClip,n}H(e,t);var i=e.prototype;return i.onEnable=function(){var t=this.system.app,e=t.scene;e.on("set:layers",this._onLayersChanged,this),e.layers&&(e.layers.on("add",this._onLayerAdded,this),e.layers.on("remove",this._onLayerRemoved,this)),this._showModel(),this._autoPlayClip&&this._tryAutoPlay(),this._batchGroupId>=0&&t.batcher.insert(xa.SPRITE,this._batchGroupId,this.entity)},i.onDisable=function(){var t=this.system.app,e=t.scene;e.off("set:layers",this._onLayersChanged,this),e.layers&&(e.layers.off("add",this._onLayerAdded,this),e.layers.off("remove",this._onLayerRemoved,this)),this.stop(),this._hideModel(),this._batchGroupId>=0&&t.batcher.remove(xa.SPRITE,this._batchGroupId,this.entity)},i.onDestroy=function(){for(var t in this._currentClip=null,this._defaultClip&&(this._defaultClip._destroy(),this._defaultClip=null),this._clips)this._clips[t]._destroy();this._clips=null,this._hideModel(),this._model=null,this._node&&(this._node.parent&&this._node.parent.removeChild(this._node),this._node=null),this._meshInstance&&(this._meshInstance.material=null,this._meshInstance.mesh=null,this._meshInstance=null)},i._showModel=function(){if(!this._addedModel&&this._meshInstance){for(var t=[this._meshInstance],e=0,i=this._layers.length;e=0&&this.system.app.batcher.remove(xa.SPRITE,e,this.entity),this.entity.enabled&&t>=0?this.system.app.batcher.insert(xa.SPRITE,t,this.entity):e>=0&&this._currentClip&&this._currentClip.sprite&&this.enabled&&this.entity.enabled&&this._showModel()}}},{key:"autoPlayClip",get:function(){return this._autoPlayClip},set:function(t){this._autoPlayClip=t instanceof ov?t.name:t,this._tryAutoPlay()}},{key:"drawOrder",get:function(){return this._drawOrder},set:function(t){this._drawOrder=t,this._meshInstance&&(this._meshInstance.drawOrder=t)}},{key:"layers",get:function(){return this._layers},set:function(t){this._addedModel&&this._hideModel(),this._layers=t,this._meshInstance&&this.enabled&&this.entity.enabled&&this._showModel()}},{key:"aabb",get:function(){return this._meshInstance?this._meshInstance.aabb:null}}]),e}(au),fv=function(){this.enabled=!0},pv=["enabled"],mv=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="sprite",i.ComponentType=dv,i.DataType=fv,i.schema=pv,i._defaultTexture=null,i._defaultMaterial=null,i._default9SlicedMaterialSlicedMode=null,i._default9SlicedMaterialTiledMode=null,i.app.systems.on("update",i.onUpdate,q(i)),i.on("beforeremove",i.onBeforeRemove,q(i)),i}H(e,t);var i=e.prototype;return i.destroy=function(){t.prototype.destroy.call(this),this.app.systems.off("update",this.onUpdate,this),this._defaultTexture&&(this._defaultTexture.destroy(),this._defaultTexture=null)},i.initializeComponentData=function(e,i,n){if(void 0!==i.enabled&&(e.enabled=i.enabled),e.type=i.type,i.layers&&Array.isArray(i.layers)&&(e.layers=i.layers.slice(0)),void 0!==i.drawOrder&&(e.drawOrder=i.drawOrder),void 0!==i.color&&(i.color instanceof at?e.color.set(i.color.r,i.color.g,i.color.b,void 0!==i.opacity?i.opacity:1):e.color.set(i.color[0],i.color[1],i.color[2],void 0!==i.opacity?i.opacity:1),e.color=e.color),void 0!==i.opacity&&(e.opacity=i.opacity),void 0!==i.flipX&&(e.flipX=i.flipX),void 0!==i.flipY&&(e.flipY=i.flipY),void 0!==i.width&&(e.width=i.width),void 0!==i.height&&(e.height=i.height),void 0!==i.spriteAsset&&(e.spriteAsset=i.spriteAsset),i.sprite&&(e.sprite=i.sprite),void 0!==i.frame&&(e.frame=i.frame),i.clips)for(var s in i.clips)e.addClip(i.clips[s]);void 0!==i.speed&&(e.speed=i.speed),i.autoPlayClip&&(e.autoPlayClip=i.autoPlayClip),e.batchGroupId=void 0===i.batchGroupId||null===i.batchGroupId?-1:i.batchGroupId,t.prototype.initializeComponentData.call(this,e,i,n)},i.cloneComponent=function(t,e){var i=t.sprite;return this.addComponent(e,{enabled:i.enabled,type:i.type,spriteAsset:i.spriteAsset,sprite:i.sprite,frame:i.frame,color:i.color.clone(),opacity:i.opacity,flipX:i.flipX,flipY:i.flipY,speed:i.speed,clips:i.clips,autoPlayClip:i.autoPlayClip,batchGroupId:i.batchGroupId,drawOrder:i.drawOrder,layers:i.layers.slice(0)})},i.onUpdate=function(t){var e=this.store;for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(n.data.enabled&&n.entity.enabled){var s=n.entity.sprite;s._currentClip&&s._currentClip._update(t)}}},i.onBeforeRemove=function(t,e){e.onDestroy()},W(e,[{key:"defaultMaterial",get:function(){if(!this._defaultMaterial){var t=new Di(this.app.graphicsDevice,{width:1,height:1,format:7}),e=new Uint8Array(t.lock());e[0]=e[1]=e[2]=e[3]=255,t.name="sprite",t.unlock();var i=new ns;i.diffuse.set(0,0,0),i.emissive.set(.5,.5,.5),i.emissiveMap=t,i.emissiveMapTint=!0,i.opacityMap=t,i.opacityMapChannel="a",i.opacityTint=!0,i.opacity=0,i.useLighting=!1,i.useGammaTonemap=!1,i.useFog=!1,i.useSkybox=!1,i.blendType=4,i.depthWrite=!1,i.pixelSnap=!1,i.cull=0,i.update(),this._defaultTexture=t,this._defaultMaterial=i}return this._defaultMaterial},set:function(t){this._defaultMaterial=t}},{key:"default9SlicedMaterialSlicedMode",get:function(){if(!this._default9SlicedMaterialSlicedMode){var t=this.defaultMaterial.clone();t.nineSlicedMode=1,t.update(),this._default9SlicedMaterialSlicedMode=t}return this._default9SlicedMaterialSlicedMode},set:function(t){this._default9SlicedMaterialSlicedMode=t}},{key:"default9SlicedMaterialTiledMode",get:function(){if(!this._default9SlicedMaterialTiledMode){var t=this.defaultMaterial.clone();t.nineSlicedMode=2,t.update(),this._default9SlicedMaterialTiledMode=t}return this._default9SlicedMaterialTiledMode},set:function(t){this._default9SlicedMaterialTiledMode=t}}]),e}(sd);au._buildAccessors(dv.prototype,pv);var _v=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._oldState=!0,n._size=new lt,n.on("set_enabled",n._onSetEnabled,q(n)),n}H(e,t);var i=e.prototype;return i.onEnable=function(){this._checkState()},i.onDisable=function(){this._checkState()},i._onSetEnabled=function(t,e,i){this._checkState()},i._checkState=function(){var t=this.enabled&&this.entity.enabled;t!==this._oldState&&(this._oldState=t,this.fire("enable"),this.fire("state",this.enabled))},i._onBeforeRemove=function(){this.fire("remove")},W(e,[{key:"size",get:function(){return this._size},set:function(t){t instanceof lt?this._size.copy(t):t instanceof Array&&t.length>=3&&this.size.set(t[0],t[1],t[2])}}]),e}(au),gv=function(){this.enabled=!0},vv=["enabled"],yv=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="zone",i.ComponentType=_v,i.DataType=gv,i.schema=vv,i.on("beforeremove",i._onBeforeRemove,q(i)),i}H(e,t);var i=e.prototype;return i.initializeComponentData=function(t,e,i){t.enabled=!e.hasOwnProperty("enabled")||!!e.enabled,e.size&&(e.size instanceof lt?t.size.copy(e.size):e.size instanceof Array&&e.size.length>=3&&t.size.set(e.size[0],e.size[1],e.size[2]))},i.cloneComponent=function(t,e){var i={size:t.zone.size};return this.addComponent(e,i)},i._onBeforeRemove=function(t,e){e._onBeforeRemove()},e}(sd);au._buildAccessors(_v.prototype,vv);var xv=function(){function t(t){this.frame={fps:0,ms:0,dt:0,updateStart:0,updateTime:0,renderStart:0,renderTime:0,physicsStart:0,physicsTime:0,cullTime:0,sortTime:0,skinTime:0,morphTime:0,instancingTime:0,triangles:0,otherPrimitives:0,shaders:0,materials:0,cameras:0,shadowMapUpdates:0,shadowMapTime:0,depthMapTime:0,forwardTime:0,lightClustersTime:0,lightClusters:0,_timeToCountFrames:0,_fpsAccum:0},this.drawCalls={forward:0,depth:0,shadow:0,immediate:0,misc:0,total:0,skinned:0,instanced:0,removedByInstancing:0},this.misc={renderTargetCreationTime:0},this.particles={updatesPerFrame:0,_updatesPerFrame:0,frameTime:0,_frameTime:0},this.shaders=t._shaderStats,this.vram=t._vram,Object.defineProperty(this.vram,"totalUsed",{get:function(){return this.tex+this.vb+this.ib}}),Object.defineProperty(this.vram,"geom",{get:function(){return this.vb+this.ib}})}return W(t,[{key:"scene",get:function(){return $s().scene._stats}},{key:"lightmapper",get:function(){return $s().lightmapper.stats}},{key:"batcher",get:function(){return $s().batcher._stats}}]),t}(),bv=function(){function t(t,e){this.name=t,this.url=e,this.data=null,this._loading=!1,this._onLoadedCallbacks=[]}return W(t,[{key:"loaded",get:function(){return!!this.data}},{key:"loading",get:function(){return this._loading}}]),t}(),Sv=function(){function t(t){this._app=t,this._list=[],this._index={},this._urlIndex={}}var e=t.prototype;return e.destroy=function(){this._app=null},e.list=function(){return this._list},e.add=function(t,e){if(this._index.hasOwnProperty(t))return!1;var i=new bv(t,e),n=this._list.push(i);return this._index[i.name]=n-1,this._urlIndex[i.url]=n-1,!0},e.find=function(t){return this._index.hasOwnProperty(t)?this._list[this._index[t]]:null},e.findByUrl=function(t){return this._urlIndex.hasOwnProperty(t)?this._list[this._urlIndex[t]]:null},e.remove=function(t){if(this._index.hasOwnProperty(t)){var e=this._index[t],i=this._list[e];delete this._urlIndex[i.url],delete this._index[t],this._list.splice(e,1);for(var n=0;n0&&this.loader.enableRetry(t.maxAssetRetries),t.useDevicePixelRatio||(t.useDevicePixelRatio=t.use_device_pixel_ratio),t.resolutionMode||(t.resolutionMode=t.resolution_mode),t.fillMode||(t.fillMode=t.fill_mode),this._width=t.width,this._height=t.height,t.useDevicePixelRatio&&(this.graphicsDevice.maxPixelRatio=window.devicePixelRatio),this.setCanvasResolution(t.resolutionMode,this._width,this._height),this.setCanvasFillMode(t.fillMode,this._width,this._height),t.layers&&t.layerOrder){var i=new bo("application"),n={};for(var s in t.layers){var a=t.layers[s];a.id=parseInt(s,10),a.enabled=1!==a.id,n[s]=new fo(a)}for(var r=0,o=t.layerOrder.length;r0,d.tags.add(u.tags),u.i18n)for(var f in u.i18n)d.addLocalizedAssetId(f,u.i18n[f]);this.assets.add(d)}},n._getScriptReferences=function(t){var e=[];t.settings.priority_scripts&&(e=t.settings.priority_scripts);for(var i=[],n={},s=0;sn._timeToCountFrames?(n.fps=n._fpsAccum,n._fpsAccum=0,n._timeToCountFrames=t+1e3):n._fpsAccum++,this.stats.drawCalls.total=this.graphicsDevice._drawCallsPerFrame,this.graphicsDevice._drawCallsPerFrame=0},n._fillFrameStats=function(){var t=this.stats.frame;t.cameras=this.renderer._camerasRendered,t.materials=this.renderer._materialSwitches,t.shaders=this.graphicsDevice._shaderSwitchesPerFrame,t.shadowMapUpdates=this.renderer._shadowMapUpdates,t.shadowMapTime=this.renderer._shadowMapTime,t.depthMapTime=this.renderer._depthMapTime,t.forwardTime=this.renderer._forwardTime;var e=this.graphicsDevice._primsPerFrame;t.triangles=e[4]/3+Math.max(e[5]-2,0)+Math.max(e[6]-2,0),t.cullTime=this.renderer._cullTime,t.sortTime=this.renderer._sortTime,t.skinTime=this.renderer._skinTime,t.morphTime=this.renderer._morphTime,t.lightClusters=this.renderer._lightClusters,t.lightClustersTime=this.renderer._lightClustersTime,t.otherPrimitives=0;for(var i=0;ii/n?e=(t=i)/s:t=(e=n)*s}else this._fillMode===fu&&(t=i,e=n);return this.graphicsDevice.canvas.style.width=t+"px",this.graphicsDevice.canvas.style.height=e+"px",this.updateCanvasSize(),{width:t,height:e}}},n.updateCanvasSize=function(){if(this._allowResize&&!this.xr.active&&this._resolutionMode===mu){var t=this.graphicsDevice.canvas;this.graphicsDevice.resizeCanvas(t.clientWidth,t.clientHeight)}},n.onLibrariesLoaded=function(){this._librariesLoaded=!0,this.systems.rigidbody.onLibraryLoaded()},n.applySceneSettings=function(t){var e;if(this.systems.rigidbody&&"undefined"!=typeof Ammo){var i=t.physics.gravity;this.systems.rigidbody.gravity.set(i[0],i[1],i[2])}this.scene.applySettings(t),t.render.hasOwnProperty("skybox")&&(t.render.skybox?(e=this.assets.get(t.render.skybox))?this.setSkybox(e):this.assets.once("add:"+t.render.skybox,this.setSkybox,this):this.setSkybox(null))},n.setAreaLightLuts=function(t){if(t){var e=this.graphicsDevice;t.ready((function(t){Fo.set(e,t.resource)})),this.assets.load(t)}},n.setSkybox=function(t){var e=this;if(t!==this._skyboxAsset){var i=function(){e.setSkybox(null)},n=function(){e.scene.setSkybox(e._skyboxAsset?e._skyboxAsset.resources:null)};this._skyboxAsset&&(this.assets.off("load:"+this._skyboxAsset.id,n,this),this.assets.off("remove:"+this._skyboxAsset.id,i,this),this._skyboxAsset.off("change",n,this)),this._skyboxAsset=t,this._skyboxAsset&&(this.assets.on("load:"+this._skyboxAsset.id,n,this),this.assets.once("remove:"+this._skyboxAsset.id,i,this),this._skyboxAsset.on("change",n,this),0!==this.scene.skyboxMip||this._skyboxAsset.loadFaces||(this._skyboxAsset.loadFaces=!0),this.assets.load(this._skyboxAsset)),n()}},n.enableVr=function(){this.vr||(this.vr=new vu(this))},n.disableVr=function(){this.vr&&(this.vr.destroy(),this.vr=null)},n._firstBake=function(){this.lightmapper.bake(null,this.scene.lightmapMode)},n._firstBatch=function(){this.batcher.generate()},n._processTimestamp=function(t){return t},n.drawLine=function(t,e,i,n,s){this.scene.drawLine(t,e,i,n,s)},n.drawLines=function(t,e,i,n){void 0===i&&(i=!0),void 0===n&&(n=this.scene.defaultDrawLayer),this.scene.drawLines(t,e,i,n)},n.drawLineArrays=function(t,e,i,n){void 0===i&&(i=!0),void 0===n&&(n=this.scene.defaultDrawLayer),this.scene.drawLineArrays(t,e,i,n)},n.drawWireSphere=function(t,e,i,n,s,a){void 0===i&&(i=at.WHITE),void 0===n&&(n=20),void 0===s&&(s=!0),void 0===a&&(a=this.scene.defaultDrawLayer),this.scene.immediate.drawWireSphere(t,e,i,n,s,a)},n.drawWireAlignedBox=function(t,e,i,n,s){void 0===i&&(i=at.WHITE),void 0===n&&(n=!0),void 0===s&&(s=this.scene.defaultDrawLayer),this.scene.immediate.drawWireAlignedBox(t,e,i,n,s)},n.drawMeshInstance=function(t,e){void 0===e&&(e=this.scene.defaultDrawLayer),this.scene.immediate.drawMesh(null,null,null,t,e)},n.drawMesh=function(t,e,i,n){void 0===n&&(n=this.scene.defaultDrawLayer),this.scene.immediate.drawMesh(e,i,t,null,n)},n.drawQuad=function(t,e,i){void 0===i&&(i=this.scene.defaultDrawLayer),this.scene.immediate.drawMesh(e,t,this.scene.immediate.getQuadMesh(),null,i)},n.drawTexture=function(t,e,i,n,s,a,r){void 0===r&&(r=this.scene.defaultDrawLayer);var o=new vt;o.setTRS(new lt(t,e,0),yt.IDENTITY,new lt(i,n,0)),a||((a=new Xn).setParameter("colorMap",s),a.shader=this.scene.immediate.getTextureShader(),a.update()),this.drawQuad(o,a,r)},n.drawDepthTexture=function(t,e,i,n,s){void 0===s&&(s=this.scene.defaultDrawLayer);var a=new Xn;a.shader=this.scene.immediate.getDepthTextureShader(),a.update(),this.drawTexture(t,e,i,n,null,a,s)},n.destroy=function(){if(this._inFrameUpdate)this._destroyRequested=!0;else{var t=this.graphicsDevice.canvas.id;this.off("librariesloaded"),"undefined"!=typeof document&&(document.removeEventListener("visibilitychange",this._visibilityChangeHandler,!1),document.removeEventListener("mozvisibilitychange",this._visibilityChangeHandler,!1),document.removeEventListener("msvisibilitychange",this._visibilityChangeHandler,!1),document.removeEventListener("webkitvisibilitychange",this._visibilityChangeHandler,!1)),this._visibilityChangeHandler=null,this.root.destroy(),this.root=null,this.mouse&&(this.mouse.off(),this.mouse.detach(),this.mouse=null),this.keyboard&&(this.keyboard.off(),this.keyboard.detach(),this.keyboard=null),this.touch&&(this.touch.off(),this.touch.detach(),this.touch=null),this.elementInput&&(this.elementInput.detach(),this.elementInput=null),this.controller&&(this.controller=null),this.systems.destroy(),this.scene.layers&&this.scene.layers.destroy();for(var e=this.assets.list(),n=0;n0&&e.push(new Dv(t,l))}}for(var d=0;d0){var c=1===e?2:1;this.setLightmapping(o,!1,c),this.initBake(i),this.bakeInternal(c,o,h);var u=64;1===e&&(u|=Lt),this.scene.ambientBake&&(u|=Bt),this.setLightmapping(o,!0,c,u),this.finishBake(o)}var d=Q();this.stats.totalRenderTime=d-n,this.stats.shadersLinked=i._shaderStats.linked-s,this.stats.compileTime=i._shaderStats.compileTime-r,this.stats.fboTime=i._renderTargetCreationTime-a,this.stats.lightmapCount=o.length},e.allocateTextures=function(t,e){for(var i=0;i0){e.copy(t[0].aabb);for(var i=1;i1&&x>1&&v.light.bakeDir&&(x=1);for(var b=0;b1&&v.prepareVirtualLight(b,x),v.startBake();var S=!1,w=this.lightCameraPrepare(s,v);for(m=0;m0&&b>0)&&!(y&&p>0);p++){var M=T.renderTargets[p],C=T.renderTargets[p].colorBuffer.width,E=this.renderTargets.get(C),P=E.colorBuffer;0===p?g=n.updateShaders:g&&(n.updateShaders=!0);var R=this.passMaterials[p];for(y&&b+1===x&&0===p&&(R=this.ambientAOMaterial),c=0;c>16&255)/255,e.pickColor[1]=(s>>8&255)/255,e.pickColor[2]=(255&s)/255,i.setValue(e.pickColor),t.setBlending(!1),e.mapping[s]=n}}),this.layer.addCamera(this.cameraEntity.camera),this.layerComp=new bo("picker"),this.layerComp.pushOpaque(this.layer)},e.prepare=function(t,e,i){t instanceof Ni&&(t=t.node.camera),i instanceof fo&&(i=[i]),this.layer.clearMeshInstances();for(var n=this.layer.opaqueMeshInstances,s=e.layers.layerList,a=e.layers.subLayerEnabled,r=e.layers.subLayerList,o=0;o=0){h._clearDepthBuffer&&n.push(this.clearDepthCommand);for(var l=r[o]?h.instances.transparentMeshInstances:h.instances.opaqueMeshInstances,c=0;czv?zv:i.width||512,a=i.height>zv?zv:i.height||512,r=document.createElement("canvas");r.height=a,r.width=s;var o=new Di(n.app.graphicsDevice,{name:"font",format:7,minFilter:5,magFilter:1,addressU:1,addressV:1,mipmaps:!0});return o.setSource(r),n.textures=[o],n.chars="",n.data={},n}H(e,t);var i=e.prototype;return i.createTextures=function(t){var e=this._normalizeCharsSet(t);if(e.length===this.chars.length){for(var i=0;i0&&this._renderAtlas(this.chars.concat(i))},i.destroy=function(){for(var t=0;tC&&(C=this.fontSize*this.fontSize/E,c.font=this.fontWeight+" "+C.toString()+"px "+this.fontName,E=this.fontSize),this.renderCharacter(c,A,S+x,w+b,a);var P=this.padding+(this.glyphSize-E)/2,R=-this.padding+m[A].descent-p,I=E;if(this._addChar(this.data,A,M,S,w,v,y,P,R,I,e-1,n,s),(S+=v)+v>n&&(S=0,(w+=y)+y>s))if(this.textures[e-1].upload(),w=0,++e>d){(i=document.createElement("canvas")).height=s,i.width=n,c=this._getAndClearContext(i,o);var L=new Di(this.app.graphicsDevice,{format:7,mipmaps:!0});L.name="font-atlas",L.setSource(i),L.minFilter=5,L.magFilter=1,L.addressU=1,L.addressV=1,this.textures.push(L)}else i=this.textures[e-1].getSource(),c=this._getAndClearContext(i,o)}if(this.textures[e-1].upload(),e0?this.wheelDelta=1:i.deltaY<0&&(this.wheelDelta=-1)),ty()?(this.dx=i.movementX||i.webkitMovementX||i.mozMovementX||0,this.dy=i.movementY||i.webkitMovementY||i.mozMovementY||0):(this.dx=this.x-e._lastX,this.dy=this.y-e._lastY),"mousedown"===i.type||"mouseup"===i.type?this.button=i.button:this.button=-1,this.buttons=e._buttons.slice(0),this.element=i.target,this.ctrlKey=i.ctrlKey||!1,this.altKey=i.altKey||!1,this.shiftKey=i.shiftKey||!1,this.metaKey=i.metaKey||!1,this.event=i},sy=function(t){function e(e){var i;return(i=t.call(this)||this)._lastX=0,i._lastY=0,i._buttons=[!1,!1,!1],i._lastbuttons=[!1,!1,!1],i._upHandler=i._handleUp.bind(q(i)),i._downHandler=i._handleDown.bind(q(i)),i._moveHandler=i._handleMove.bind(q(i)),i._wheelHandler=i._handleWheel.bind(q(i)),i._contextMenuHandler=function(t){t.preventDefault()},i._target=null,i._attached=!1,i.attach(e),i}H(e,t),e.isPointerLocked=function(){return ty()};var i=e.prototype;return i.attach=function(t){if(this._target=t,!this._attached){this._attached=!0;var e=!!E.passiveEvents&&{passive:!1};window.addEventListener("mouseup",this._upHandler,e),window.addEventListener("mousedown",this._downHandler,e),window.addEventListener("mousemove",this._moveHandler,e),window.addEventListener("wheel",this._wheelHandler,e)}},i.detach=function(){if(this._attached){this._attached=!1,this._target=null;var t=!!E.passiveEvents&&{passive:!1};window.removeEventListener("mouseup",this._upHandler,t),window.removeEventListener("mousedown",this._downHandler,t),window.removeEventListener("mousemove",this._moveHandler,t),window.removeEventListener("wheel",this._wheelHandler,t)}},i.disableContextMenu=function(){this._target&&this._target.addEventListener("contextmenu",this._contextMenuHandler)},i.enableContextMenu=function(){this._target&&this._target.removeEventListener("contextmenu",this._contextMenuHandler)},i.enablePointerLock=function(t,e){if(document.body.requestPointerLock){t&&document.addEventListener("pointerlockchange",(function e(){t(),document.removeEventListener("pointerlockchange",e)}),!1),e&&document.addEventListener("pointerlockerror",(function t(){e(),document.removeEventListener("pointerlockerror",t)}),!1),document.body.requestPointerLock()}else e&&e()},i.disablePointerLock=function(t){if(document.exitPointerLock){t&&document.addEventListener("pointerlockchange",(function e(){t(),document.removeEventListener("pointerlockchange",e)}),!1),document.exitPointerLock()}},i.update=function(){this._lastbuttons[0]=this._buttons[0],this._lastbuttons[1]=this._buttons[1],this._lastbuttons[2]=this._buttons[2]},i.isPressed=function(t){return this._buttons[t]},i.wasPressed=function(t){return this._buttons[t]&&!this._lastbuttons[t]},i.wasReleased=function(t){return!this._buttons[t]&&this._lastbuttons[t]},i._handleUp=function(t){this._buttons[t.button]=!1;var e=new ny(this,t);e.event&&this.fire(Ng,e)},i._handleDown=function(t){this._buttons[t.button]=!0;var e=new ny(this,t);e.event&&this.fire(Fg,e)},i._handleMove=function(t){var e=new ny(this,t);e.event&&(this.fire(Bg,e),this._lastX=e.x,this._lastY=e.y)},i._handleWheel=function(t){var e=new ny(this,t);e.event&&this.fire(Ug,e)},i._getTargetCoords=function(t){var e=this._target.getBoundingClientRect(),i=Math.floor(e.left),n=Math.floor(e.top);return t.clientX=i+this._target.clientWidth||t.clientY=n+this._target.clientHeight?null:{x:t.clientX-i,y:t.clientY-n}},e}(u),ay=function(){function t(t,e){void 0===e&&(e={}),this._keyboard=e.keyboard||null,this._mouse=e.mouse||null,this._gamepads=e.gamepads||null,this._element=null,this._actions={},this._axes={},this._axesValues={},t&&this.attach(t)}var e=t.prototype;return e.attach=function(t){this._element=t,this._keyboard&&this._keyboard.attach(t),this._mouse&&this._mouse.attach(t)},e.detach=function(){this._keyboard&&this._keyboard.detach(),this._mouse&&this._mouse.detach(),this._element=null},e.disableContextMenu=function(){this._mouse||this._enableMouse(),this._mouse.disableContextMenu()},e.enableContextMenu=function(){this._mouse||this._enableMouse(),this._mouse.enableContextMenu()},e.update=function(t){for(var e in this._keyboard&&this._keyboard.update(t),this._mouse&&this._mouse.update(t),this._gamepads&&this._gamepads.update(t),this._axesValues={},this._axes)this._axesValues[e]=[]},e.registerKeys=function(t,e){if(this._keyboard||this._enableKeyboard(),this._actions[t])throw new Error("Action: "+t+" already registered");if(void 0===e)throw new Error("Invalid button");e.length||(e=[e]),this._actions[t]?this._actions[t].push({type:kg,keys:e}):this._actions[t]=[{type:kg,keys:e}]},e.registerMouse=function(t,e){if(this._mouse||this._enableMouse(),void 0===e)throw new Error("Invalid button");this._actions[t]?this._actions[t].push({type:Dg,button:e}):this._actions[t]=[{type:Dg,button:-e}]},e.registerPadButton=function(t,e,i){if(void 0===i)throw new Error("Invalid button");this._actions[t]?this._actions[t].push({type:Og,button:i,pad:e}):this._actions[t]=[{type:Og,button:i,pad:e}]},e.registerAxis=function(t){var e=t.name;this._axes[e]||(this._axes[e]=[]);var i=this._axes[e].push(e);(t=t||{}).pad=t.pad||0;var n=function(n,s,a,r){switch(s){case"mousex":n._mouse.on(Bg,(function(t){n._axesValues[e][i]=t.dx/10}));break;case"mousey":n._mouse.on(Bg,(function(t){n._axesValues[e][i]=t.dy/10}));break;case"key":n._axes[e].push((function(){return n._keyboard.isPressed(r)?a:0}));break;case"padrx":n._axes[e].push((function(){return n._gamepads.getAxis(t.pad,2)}));break;case"padry":n._axes[e].push((function(){return n._gamepads.getAxis(t.pad,3)}));break;case"padlx":n._axes[e].push((function(){return n._gamepads.getAxis(t.pad,0)}));break;case"padly":n._axes[e].push((function(){return n._gamepads.getAxis(t.pad,1)}));break;default:throw new Error("Unknown axis")}};n(this,t.positive,1,t.positiveKey),(t.negativeKey||t.negative!==t.positive)&&n(this,t.negative,-1,t.negativeKey)},e.isPressed=function(t){if(!this._actions[t])return!1;for(var e=this._actions[t].length,i=0;iMath.abs(e)&&(e=s)}else this._axesValues[t]&&Math.abs(this._axesValues[t][n])>Math.abs(e)&&(e=this._axesValues[t][n]);return e},e._enableMouse=function(){if(this._mouse=new sy,!this._element)throw new Error("Controller must be attached to an Element");this._mouse.attach(this._element)},e._enableKeyboard=function(){if(this._keyboard=new Jv,!this._element)throw new Error("Controller must be attached to an Element");this._keyboard.attach(this._element)},t}(),ry=new lt,oy=new lt,hy=new Vt,ly=new Vt,cy=new Vt;hy.end=new lt,ly.end=new lt,cy.end=new lt;var uy=new lt,dy=new lt,fy=new lt,py=new lt,my=new lt,_y=new lt,gy=new lt,vy=new lt,yy=new lt,xy=new lt,by=new lt,Sy=new lt,wy=new lt,Ty=new lt,Ay=new lt,My=new lt,Cy=new lt,Ey=new lt,Py=new lt,Ry=new lt,Iy=new dt;function Ly(t,e,i){return by.cross(t,e).dot(i)}var Dy=function(){function t(t,e,i){this.event=t,this.element=e,this.camera=i,this._stopPropagation=!1}return t.prototype.stopPropagation=function(){this._stopPropagation=!0,this.event&&(this.event.stopImmediatePropagation(),this.event.stopPropagation())},t}(),ky=function(t){function e(e,i,n,s,a,r,o){var h;return(h=t.call(this,e,i,n)||this).x=s,h.y=a,h.ctrlKey=e.ctrlKey||!1,h.altKey=e.altKey||!1,h.shiftKey=e.shiftKey||!1,h.metaKey=e.metaKey||!1,h.button=e.button,sy.isPointerLocked()?(h.dx=e.movementX||e.webkitMovementX||e.mozMovementX||0,h.dy=e.movementY||e.webkitMovementY||e.mozMovementY||0):(h.dx=s-r,h.dy=a-o),h.wheelDelta=0,"wheel"===e.type&&(e.deltaY>0?h.wheelDelta=1:e.deltaY<0&&(h.wheelDelta=-1)),h}return H(e,t),e}(Dy),Oy=function(t){function e(e,i,n,s,a,r){var o;return(o=t.call(this,e,i,n)||this).touches=e.touches,o.changedTouches=e.changedTouches,o.x=s,o.y=a,o.touch=r,o}return H(e,t),e}(Dy),Fy=function(t){function e(e,i,n,s){var a;return(a=t.call(this,e,i,n)||this).inputSource=s,a}return H(e,t),e}(Dy),By=function(){function t(t,e){this._app=null,this._attached=!1,this._target=null,this._enabled=!0,this._lastX=0,this._lastY=0,this._upHandler=this._handleUp.bind(this),this._downHandler=this._handleDown.bind(this),this._moveHandler=this._handleMove.bind(this),this._wheelHandler=this._handleWheel.bind(this),this._touchstartHandler=this._handleTouchStart.bind(this),this._touchendHandler=this._handleTouchEnd.bind(this),this._touchcancelHandler=this._touchendHandler,this._touchmoveHandler=this._handleTouchMove.bind(this),this._sortHandler=this._sortElements.bind(this),this._elements=[],this._hoveredElement=null,this._pressedElement=null,this._touchedElements={},this._touchesForWhichTouchLeaveHasFired={},this._selectedElements={},this._selectedPressedElements={},this._useMouse=!e||!1!==e.useMouse,this._useTouch=!e||!1!==e.useTouch,this._useXr=!e||!1!==e.useXr,this._selectEventsAttached=!1,E.touch&&(this._clickedEntities={}),this.attach(t)}var e=t.prototype;return e.attach=function(t){this._attached&&(this._attached=!1,this.detach()),this._target=t,this._attached=!0;var e=!!E.passiveEvents&&{passive:!0};this._useMouse&&(window.addEventListener("mouseup",this._upHandler,e),window.addEventListener("mousedown",this._downHandler,e),window.addEventListener("mousemove",this._moveHandler,e),window.addEventListener("wheel",this._wheelHandler,e)),this._useTouch&&E.touch&&(this._target.addEventListener("touchstart",this._touchstartHandler,e),this._target.addEventListener("touchend",this._touchendHandler,!1),this._target.addEventListener("touchmove",this._touchmoveHandler,!1),this._target.addEventListener("touchcancel",this._touchcancelHandler,!1)),this.attachSelectEvents()},e.attachSelectEvents=function(){!this._selectEventsAttached&&this._useXr&&this.app&&this.app.xr&&this.app.xr.supported&&(this._clickedEntities||(this._clickedEntities={}),this._selectEventsAttached=!0,this.app.xr.on("start",this._onXrStart,this))},e.detach=function(){if(this._attached){this._attached=!1;var t=!!E.passiveEvents&&{passive:!0};this._useMouse&&(window.removeEventListener("mouseup",this._upHandler,t),window.removeEventListener("mousedown",this._downHandler,t),window.removeEventListener("mousemove",this._moveHandler,t),window.removeEventListener("wheel",this._wheelHandler,t)),this._useTouch&&(this._target.removeEventListener("touchstart",this._touchstartHandler,t),this._target.removeEventListener("touchend",this._touchendHandler,!1),this._target.removeEventListener("touchmove",this._touchmoveHandler,!1),this._target.removeEventListener("touchcancel",this._touchcancelHandler,!1)),this._selectEventsAttached&&(this._selectEventsAttached=!1,this.app.xr.off("start",this._onXrStart,this),this.app.xr.off("end",this._onXrEnd,this),this.app.xr.off("update",this._onXrUpdate,this),this.app.xr.input.off("selectstart",this._onSelectStart,this),this.app.xr.input.off("selectend",this._onSelectEnd,this),this.app.xr.input.off("remove",this._onXrInputRemove,this)),this._target=null}},e.addElement=function(t){-1===this._elements.indexOf(t)&&this._elements.push(t)},e.removeElement=function(t){var e=this._elements.indexOf(t);-1!==e&&this._elements.splice(e,1)},e._handleUp=function(t){this._enabled&&(sy.isPointerLocked()||(this._calcMouseCoords(t),null!==ey&&this._onElementMouseEvent("mouseup",t)))},e._handleDown=function(t){this._enabled&&(sy.isPointerLocked()||(this._calcMouseCoords(t),null!==ey&&this._onElementMouseEvent("mousedown",t)))},e._handleMove=function(t){this._enabled&&(this._calcMouseCoords(t),null!==ey&&(this._onElementMouseEvent("mousemove",t),this._lastX=ey,this._lastY=iy))},e._handleWheel=function(t){this._enabled&&(this._calcMouseCoords(t),null!==ey&&this._onElementMouseEvent("mousewheel",t))},e._determineTouchedElements=function(t){for(var e={},i=this.app.systems.camera.cameras,n=i.length-1;n>=0;n--){for(var s=i[n],a=0,r=t.changedTouches.length,o=0;o=0;d--){this._getTargetElement(e[d],u.x,u.y)===o&&(this._clickedEntities[o.entity.getGuid()]||(this._fireEvent("click",new Oy(t,o,h,l,c,a)),this._clickedEntities[o.entity.getGuid()]=!0))}}}}},e._handleTouchMove=function(t){if(t.preventDefault(),this._enabled)for(var e=this._determineTouchedElements(t),i=0,n=t.changedTouches.length;i=0&&(s=a[r],!(i=this._getTargetElement(s,ey,iy)));r--);i&&(this._fireEvent(t,new ky(e,i,s,ey,iy,this._lastX,this._lastY)),this._hoveredElement=i,"mousedown"===t&&(this._pressedElement=i)),n!==this._hoveredElement&&(n&&this._fireEvent("mouseleave",new ky(e,n,s,ey,iy,this._lastX,this._lastY)),this._hoveredElement&&this._fireEvent("mouseenter",new ky(e,this._hoveredElement,s,ey,iy,this._lastX,this._lastY))),"mouseup"===t&&this._pressedElement&&(this._pressedElement===this._hoveredElement?(this._pressedElement=null,this._clickedEntities&&this._clickedEntities[this._hoveredElement.entity.getGuid()]||this._fireEvent("click",new ky(e,this._hoveredElement,s,ey,iy,this._lastX,this._lastY))):this._pressedElement=null)},e._onXrStart=function(){this.app.xr.on("end",this._onXrEnd,this),this.app.xr.on("update",this._onXrUpdate,this),this.app.xr.input.on("selectstart",this._onSelectStart,this),this.app.xr.input.on("selectend",this._onSelectEnd,this),this.app.xr.input.on("remove",this._onXrInputRemove,this)},e._onXrEnd=function(){this.app.xr.off("update",this._onXrUpdate,this),this.app.xr.input.off("selectstart",this._onSelectStart,this),this.app.xr.input.off("selectend",this._onSelectEnd,this),this.app.xr.input.off("remove",this._onXrInputRemove,this)},e._onXrUpdate=function(){if(this._enabled)for(var t=this.app.xr.input.inputSources,e=0;e=0&&(a=o[h],!(n=this._getTargetElementByRay(cy,a)));h--);}e._elementEntity=n||null,n?(this._selectedElements[e.id]=n,s=n):delete this._selectedElements[e.id],r!==s&&(r&&this._fireEvent("selectleave",new Fy(i,r,a,e)),s&&this._fireEvent("selectenter",new Fy(i,s,a,e))),"selectstart"===t&&(this._selectedPressedElements[e.id]=s,s&&this._fireEvent("selectstart",new Fy(i,s,a,e)));var l=this._selectedPressedElements[e.id];!e.elementInput&&l&&(delete this._selectedPressedElements[e.id],r&&this._fireEvent("selectend",new Fy(i,r,a,e))),"selectend"===t&&e.elementInput&&(delete this._selectedPressedElements[e.id],r&&this._fireEvent("selectend",new Fy(i,r,a,e)),l&&l===r&&this._fireEvent("click",new Fy(i,l,a,e)))},e._fireEvent=function(t,e){for(var i=e.element;i.fire(t,e),!e._stopPropagation&&i.entity.parent&&(i=i.entity.parent.element););},e._calcMouseCoords=function(t){var e=this._target.getBoundingClientRect(),i=Math.floor(e.left),n=Math.floor(e.top);t.clientX=i+this._target.clientWidth||t.clientY=n+this._target.clientHeight?(ey=null,iy=null):(ey=t.clientX-i,iy=t.clientY-n)},e._calcTouchCoords=function(t){for(var e=0,i=0,n=t.target;!(n instanceof HTMLElement);)n=n.parentNode;var s=n;do{e+=s.offsetLeft-s.scrollLeft,i+=s.offsetTop-s.scrollTop,s=s.offsetParent}while(s);return{x:t.pageX-e,y:t.pageY-i}},e._sortElements=function(t,e){var i=this.app.scene.layers.sortTransparentLayers(t.layers,e.layers);return 0!==i?i:t.screen&&!e.screen?-1:!t.screen&&e.screen?1:t.screen||e.screen?t.screen.screen.screenSpace&&!e.screen.screen.screenSpace?-1:e.screen.screen.screenSpace&&!t.screen.screen.screenSpace?1:e.drawOrder-t.drawOrder:0},e._getTargetElement=function(t,e,i){var n,s,a=null,r=1/0;this._elements.sort(this._sortHandler);for(var o=0,h=this._elements.length;o=0){a=l;break}}else{if(void 0===s&&(s=this._calculateRay3d(e,i,t,ly)?ly:null),!s)continue;var c=this._checkElement(s,l,!1);if(c>=0&&(c=0){i=a;break}}return i},e._buildHitCorners=function(t,e,i,n,s){var a=e;if(t.entity&&t.entity.button){var r=t.entity.button.hitPadding||Iy;wy.copy(t.entity.up),Ty.copy(wy).mulScalar(-1),My.copy(t.entity.right),Ay.copy(My).mulScalar(-1),wy.mulScalar(r.w*n),Ty.mulScalar(r.y*n),My.mulScalar(r.z*i),Ay.mulScalar(r.x*i),Cy.copy(a[0]).add(Ty).add(Ay),Ey.copy(a[1]).add(Ty).add(My),Py.copy(a[2]).add(wy).add(My),Ry.copy(a[3]).add(wy).add(Ay),a=[Cy,Ey,Py,Ry]}if(i<0){var o=a[2].x,h=a[0].x;a[0].x=o,a[1].x=h,a[2].x=h,a[3].x=o}if(n<0){var l=a[2].y,c=a[0].y;a[0].y=l,a[1].y=l,a[2].y=c,a[3].y=c}if(s<0){var u=a[2].x,d=a[2].y,f=a[2].z;a[2].x=a[0].x,a[2].y=a[0].y,a[2].z=a[0].z,a[0].x=u,a[0].y=d,a[0].z=f}return a},e._calculateScaleToScreen=function(t){var e=t.entity,i=t.screen.screen.scale;for(Sy.set(i,i,i);e&&!e.screen;)Sy.mul(e.getLocalScale()),e=e.parent;return Sy},e._calculateScaleToWorld=function(t){var e=t.entity;for(Sy.set(1,1,1);e;)Sy.mul(e.getLocalScale()),e=e.parent;return Sy},e._calculateRayScreen=function(t,e,i,n){var s=this.app.graphicsDevice.width,a=this.app.graphicsDevice.height,r=i.rect.z*s,o=i.rect.w*a,h=i.rect.x*s,l=h+r,c=(1-i.rect.y)*a,u=c-o,d=t*s/this._target.clientWidth,f=e*a/this._target.clientHeight;return d>=h&&d<=l&&f<=c&&f>=u&&(d=s*(d-h)/r,f=a-(f=a*(f-u)/o),n.origin.set(d,f,1),n.direction.set(0,0,-1),n.end.copy(n.direction).mulScalar(2).add(n.origin),!0)},e._calculateRay3d=function(t,e,i,n){var s=this._target.clientWidth,a=this._target.clientHeight,r=i.rect.z*s,o=i.rect.w*a,h=i.rect.x*s,l=h+r,c=(1-i.rect.y)*a,u=c-o,d=t,f=e;return t>=h&&t<=l&&e<=c&&f>=u&&(d=s*(d-h)/r,f=a*(f-u)/o,i.screenToWorld(d,f,i.nearClip,ry),i.screenToWorld(d,f,i.farClip,oy),n.origin.copy(ry),n.direction.set(0,0,-1),n.end.copy(oy),!0)},e._checkElement=function(t,e,i){if(e.maskedBy&&this._checkElement(t,e.maskedBy.element,i)<0)return-1;var n;n=i?this._calculateScaleToScreen(e):this._calculateScaleToWorld(e);var s=this._buildHitCorners(e,i?e.screenCorners:e.worldCorners,n.x,n.y,n.z);return function(t,e,i){uy.sub2(e,t),dy.sub2(i[0],t),fy.sub2(i[1],t),py.sub2(i[2],t),_y.cross(py,uy);var n,s,a=dy.dot(_y);if(a>=0){if((n=-fy.dot(_y))<0)return-1;if((s=Ly(uy,fy,dy))<0)return-1;var r=1/(n+a+s);gy.copy(i[0]).mulScalar(n*r),vy.copy(i[1]).mulScalar(a*r),yy.copy(i[2]).mulScalar(s*r),xy.copy(gy).add(vy).add(yy)}else{if(my.sub2(i[3],t),(n=my.dot(_y))<0)return-1;if((s=Ly(uy,dy,my))<0)return-1;var o=1/(n+(a=-a)+s);gy.copy(i[0]).mulScalar(n*o),vy.copy(i[3]).mulScalar(a*o),yy.copy(i[2]).mulScalar(s*o),xy.copy(gy).add(vy).add(yy)}return uy.sub2(i[0],i[2]).lengthSq()<1e-8||uy.sub2(i[1],i[3]).lengthSq()<1e-8?-1:xy.sub(t).lengthSq()}(t.origin,t.end,s)},W(t,[{key:"enabled",get:function(){return this._enabled},set:function(t){this._enabled=t}},{key:"app",get:function(){return this._app||$s()},set:function(t){this._app=t}}]),t}(),Ny={DEFAULT:{buttons:["PAD_FACE_1","PAD_FACE_2","PAD_FACE_3","PAD_FACE_4","PAD_L_SHOULDER_1","PAD_R_SHOULDER_1","PAD_L_SHOULDER_2","PAD_R_SHOULDER_2","PAD_SELECT","PAD_START","PAD_L_STICK_BUTTON","PAD_R_STICK_BUTTON","PAD_UP","PAD_DOWN","PAD_LEFT","PAD_RIGHT","PAD_VENDOR"],axes:["PAD_L_STICK_X","PAD_L_STICK_Y","PAD_R_STICK_X","PAD_R_STICK_Y"]},PS3:{buttons:["PAD_FACE_1","PAD_FACE_2","PAD_FACE_4","PAD_FACE_3","PAD_L_SHOULDER_1","PAD_R_SHOULDER_1","PAD_L_SHOULDER_2","PAD_R_SHOULDER_2","PAD_SELECT","PAD_START","PAD_L_STICK_BUTTON","PAD_R_STICK_BUTTON","PAD_UP","PAD_DOWN","PAD_LEFT","PAD_RIGHT","PAD_VENDOR"],axes:["PAD_L_STICK_X","PAD_L_STICK_Y","PAD_R_STICK_X","PAD_R_STICK_Y"]}},Uy={"Product: 0268":"PS3"},zy=function(){function t(){this.gamepadsSupported=!!navigator.getGamepads||!!navigator.webkitGetGamepads,this.current=[],this.previous=[],this.deadZone=.25}var e=t.prototype;return e.update=function(){for(var t=0,e=this.current.length;t0&&(t.length=0),this.gamepadsSupported)for(var e=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads(),i=0,n=e.length;i=0)return Ny[Uy[e]];return Ny.DEFAULT},e.isPressed=function(t,e){if(!this.current[t])return!1;var i=this.current[t].map.buttons[e];return this.current[t].pad.buttons[pc[i]].pressed},e.wasPressed=function(t,e){if(!this.current[t])return!1;var i=this.current[t].map.buttons[e],n=pc[i];return this.current[t].pad.buttons[n].pressed&&!(this.previous[t]&&this.previous[t][n])},e.wasReleased=function(t,e){if(!this.current[t])return!1;var i=this.current[t].map.buttons[e],n=pc[i];return!this.current[t].pad.buttons[n].pressed&&this.previous[t]&&this.previous[t][n]},e.getAxis=function(t,e){if(!this.current[t])return 0;var i=this.current[t].map.axes[e],n=this.current[t].pad.axes[pc[i]];return Math.abs(n)=0&&(this._count++,this.fire("progress",t)),this._count===this._total&&setTimeout((function(){e._loadingComplete(e._failed)}),0)},i._onError=function(t,e){var i=this;this._assets.indexOf(e)>=0&&(this._count++,this._failed.push(e)),this._count===this._total&&setTimeout((function(){i._loadingComplete(i._failed)}),0)},i._onAddAsset=function(t){var e=this._waitingAssets.indexOf(t);e>=0&&this._waitingAssets.splice(e,1),this._assets.push(t);for(var i=0,n=this._assets.length;i>>0,n=arguments[1],s=n>>0,a=s<0?Math.max(i+s,0):Math.min(s,i),r=arguments[2],o=void 0===r?i:r>>0,h=o<0?Math.max(i+o,0):Math.min(o,i);a>>0;if("function"!=typeof t)throw TypeError("predicate must be a function");for(var n=arguments[1],s=0;s>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var n=arguments[1],s=0;s0)-(t<0)||+t}),void 0===Number.isFinite&&(Number.isFinite=function(t){return"number"==typeof t&&isFinite(t)}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),n=1;nthis.length)&&(e=this.length),this.substring(e-t.length,e)===t})),e(String,"includes",(function(t,e){return"number"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)})),e(String,"startsWith",(function(t,e){return this.substr(!e||e<0?0:+e,t.length)===t}));for(var i=0,n=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array];i0?a=a.slice(0,a.length-2):(r>0&&a.push(v.delimiter),a.push(n[r])));return s=a.join(""),e||s[0]!==v.delimiter||(s=s.slice(1)),i&&s[s.length-1]!==v.delimiter&&(s+=v.delimiter),s},split:function(t){var e=t.split(v.delimiter),i=e.slice(e.length-1)[0];return[e.slice(0,e.length-1).join(v.delimiter),i]},getBasename:function(t){return v.split(t)[1]},getDirectory:function(t){var e=t.split(v.delimiter);return e.slice(0,e.length-1).join(v.delimiter)},getExtension:function(t){var e=t.split("?")[0].split(".").pop();return e!==t?"."+e:""},isRelativePath:function(t){return"/"!==t.charAt(0)&&null===t.match(/:\/\//)},extractPath:function(t){var e="",i=t.split("/"),n=0;if(i.length>1)if(v.isRelativePath(t))if("."===i[0])for(n=0;n0),M="getGamepads"in navigator,C="undefined"!=typeof Worker;try{var R=Object.defineProperty({},"passive",{get:function(){return E=!0,!1}});window.addEventListener("testpassive",null,R),window.removeEventListener("testpassive",null,R)}catch(t){}}var I="undefined"!=typeof window?"browser":"node",L={environment:I,global:"browser"===I?window:global,browser:"browser"===I,desktop:y,mobile:x,ios:T,android:w,windows:b,xbox:S,gamepads:M,touch:A,workers:C,passiveEvents:E},D="abcdefghijklmnopqrstuvwxyz",k="ABCDEFGHIJKLMNOPQRSTUVWXYZ",O=55296,F=127462,B=127487,N=65024,U=65039;function z(t,e){void 0===e&&(e=0);var i=t.length;if(e<0||e>=i)return null;var n=t.charCodeAt(e);if(i>1&&n>=O&&n<=56319){var s=t.charCodeAt(e+1);if(s>=56320&&s<=57343)return{code:1024*(n-O)+s-56320+65536,long:!0}}return{code:n,long:!1}}function V(t,e,i){if(!t)return!1;var n=z(t);if(n){var s=n.code;return s>=e&&s<=i}return!1}function W(t,e){if(e===t.length-1)return 1;if(V(t[e],O,56319)){var i=t.substring(e,e+2),n=t.substring(e+2,e+4);return V(n,127995,127999)||V(i,F,B)&&V(n,F,B)?4:V(n,N,U)?3:2}return V(t[e+1],N,U)?2:1}var G={ASCII_LOWERCASE:D,ASCII_UPPERCASE:k,ASCII_LETTERS:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",format:function(t){for(var e=1;e65535?[55296+(e>>10),e%1024+56320]:[t],n.push(String.fromCharCode.apply(null,i));return n.join("")}},H=function(){function t(){this._list=[],this._index={}}var e=t.prototype;return e.push=function(t,e){if(this._index[t])throw Error("Key already in index "+t);var i=this._list.push(e)-1;this._index[t]=i},e.has=function(t){return void 0!==this._index[t]},e.get=function(t){var e=this._index[t];return void 0!==e?this._list[e]:null},e.remove=function(t){var e=this._index[t];if(void 0!==e){for(t in this._list.splice(e,1),delete this._index[t],this._index){var i=this._index[t];i>e&&(this._index[t]=i-1)}return!0}return!1},e.list=function(){return this._list},e.clear=function(){for(var t in this._list.length=0,this._index)delete this._index[t]},t}();function X(t,e){for(var i=0;it.length)&&(e=t.length);for(var i=0,n=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var J=function(){function t(t){this.arraybuffer=t,this.dataView=new DataView(t),this.offset=0,this.stack=[]}var e=t.prototype;return e.reset=function(t){void 0===t&&(t=0),this.offset=t},e.skip=function(t){this.offset+=t},e.align=function(t){this.offset=this.offset+t-1&~(t-1)},e._inc=function(t){return this.offset+=t,this.offset-t},e.readChar=function(){return String.fromCharCode(this.dataView.getUint8(this.offset++))},e.readChars=function(t){for(var e="",i=0;i=t.byteLength);){var i=String.fromCharCode(this.readU8());if("\n"===i)break;e+=i}return e},q(t,[{key:"remainingBytes",get:function(){return this.dataView.byteLength-this.offset}}]),t}(),tt=function(){function t(t){this.items=[],this.length=0,this.loopIndex=-1,this._sortBy=t.sortBy,this._sortHandler=this._doSort.bind(this)}var e=t.prototype;return e._binarySearch=function(t){for(var e,i,n=0,s=this.items.length-1,a=t[this._sortBy];n<=s;)e=Math.floor((n+s)/2),(i=this.items[e][this._sortBy])<=a?n=e+1:i>a&&(s=e-1);return n},e._doSort=function(t,e){var i=this._sortBy;return t[i]-e[i]},e.insert=function(t){var e=this._binarySearch(t);this.items.splice(e,0,t),this.length++,this.loopIndex>=e&&this.loopIndex++},e.append=function(t){this.items.push(t),this.length++},e.remove=function(t){var e=this.items.indexOf(t);e<0||(this.items.splice(e,1),this.length--,this.loopIndex>=e&&this.loopIndex--)},e.sort=function(){var t=this.loopIndex>=0?this.items[this.loopIndex]:null;this.items.sort(this._sortHandler),null!==t&&(this.loopIndex=this.items.indexOf(t))},t}(),et=function(t){function e(e){var i;return(i=t.call(this)||this)._index={},i._list=[],i._parent=e,i}Y(e,t);var i=e.prototype;return i.add=function(){var t=!1,e=this._processArguments(arguments,!0);if(!e.length)return t;for(var i=0;i=i?i:t<=e?e:t},intToBytes24:function(t){return[t>>16&255,t>>8&255,255&t]},intToBytes32:function(t){return[t>>24&255,t>>16&255,t>>8&255,255&t]},bytesToInt24:function(t,e,i){return t.length&&(i=t[2],e=t[1],t=t[0]),t<<16|e<<8|i},bytesToInt32:function(t,e,i,n){return t.length&&(n=t[3],i=t[2],e=t[1],t=t[0]),(t<<24|e<<16|i<<8|n)>>>0},lerp:function(t,e,i){return t+(e-t)*rt.clamp(i,0,1)},lerpAngle:function(t,e,i){return e-t>180&&(e-=360),e-t<-180&&(e+=360),rt.lerp(t,e,rt.clamp(i,0,1))},powerOfTwo:function(t){return 0!==t&&!(t&t-1)},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t},random:function(t,e){var i=e-t;return Math.random()*i+t},smoothstep:function(t,e,i){return i<=t?0:i>=e?1:(i=(i-t)/(e-t))*i*(3-2*i)},smootherstep:function(t,e,i){return i<=t?0:i>=e?1:(i=(i-t)/(e-t))*i*i*(i*(6*i-15)+10)},roundUp:function(t,e){return 0===e?t:Math.ceil(t/e)*e},between:function(t,e,i,n){var s=Math.min(e,i),a=Math.max(e,i);return n?t>=s&&t<=a:t>s&&t=0?t.ResponseType.ARRAY_BUFFER:".xml"===n?t.ResponseType.DOCUMENT:t.ResponseType.TEXT},e._isBinaryContentType=function(e){return[t.ContentType.MP4,t.ContentType.WAV,t.ContentType.OGG,t.ContentType.MP3,t.ContentType.BIN,t.ContentType.DDS,t.ContentType.BASIS,t.ContentType.GLB].indexOf(e)>=0},e._onReadyStateChange=function(t,e,i,n){if(4===n.readyState)switch(n.status){case 0:n.responseURL&&n.responseURL.startsWith("file:///")?this._onSuccess(t,e,i,n):this._onError(t,e,i,n);break;case 200:case 201:case 206:case 304:this._onSuccess(t,e,i,n);break;default:this._onError(t,e,i,n)}},e._onSuccess=function(e,i,n,s){var a,r,o=s.getResponseHeader("Content-Type");o&&(r=o.split(";")[0].trim());try{a=r===t.ContentType.JSON||i.split("?")[0].endsWith(".json")?JSON.parse(s.responseText):this._isBinaryContentType(r)||s.responseType===t.ResponseType.ARRAY_BUFFER||s.responseType===t.ResponseType.BLOB||s.responseType===t.ResponseType.JSON?s.response:s.responseType===t.ResponseType.DOCUMENT||r===t.ContentType.XML?s.responseXML:s.responseText,n.callback(null,a)}catch(t){n.callback(t)}},e._onError=function(e,i,n,s){var a=this;if(!n.retrying)if(n.retry&&n.retries7?e=rt.intToBytes32(i):(e=rt.intToBytes24(i))[3]=255,this.set(e[0]/255,e[1]/255,e[2]/255,e[3]/255),this},e.toString=function(t){var e="#"+((1<<24)+(Math.round(255*this.r)<<16)+(Math.round(255*this.g)<<8)+Math.round(255*this.b)).toString(16).slice(1);if(!0===t){var i=Math.round(255*this.a).toString(16);this.a<16/255?e+="0"+i:e+=i}return e},t}();lt.BLACK=Object.freeze(new lt(0,0,0,1)),lt.BLUE=Object.freeze(new lt(0,0,1,1)),lt.CYAN=Object.freeze(new lt(0,1,1,1)),lt.GRAY=Object.freeze(new lt(.5,.5,.5,1)),lt.GREEN=Object.freeze(new lt(0,1,0,1)),lt.MAGENTA=Object.freeze(new lt(1,0,1,1)),lt.RED=Object.freeze(new lt(1,0,0,1)),lt.WHITE=Object.freeze(new lt(1,1,1,1)),lt.YELLOW=Object.freeze(new lt(1,1,0,1));var ct=function(){function t(t,e){void 0===e&&(e=0),this._curve=t,this._left=-1/0,this._right=1/0,this._recip=0,this._p0=0,this._p1=0,this._m0=0,this._m1=0,this._reset(e)}var e=t.prototype;return e.evaluate=function(t,e){var i;void 0===e&&(e=!1),(e||t=this._right)&&this._reset(t);var n=this._curve.type;if(5===n)i=this._p0;else{var s=0===this._recip?0:(t-this._left)*this._recip;i=0===n?rt.lerp(this._p0,this._p1,s):1===n?rt.lerp(this._p0,this._p1,s*s*(3-2*s)):this._evaluateHermite(this._p0,this._p1,this._m0,this._m1,s)}return i},e._reset=function(t){var e=this._curve.keys,i=e.length;if(i)if(t=e[i-1][0])this._left=e[i-1][0],this._right=1/0,this._recip=0,this._p0=this._p1=e[i-1][1],this._m0=this._m1=0;else{for(var n=0;t>=e[n+1][0];)n++;this._left=e[n][0],this._right=e[n+1][0];var s=1/(this._right-this._left);this._recip=isFinite(s)?s:0,this._p0=e[n][1],this._p1=e[n+1][1],this._isHermite()&&this._calcTangents(e,n)}else this._left=-1/0,this._right=1/0,this._recip=0,this._p0=this._p1=this._m0=this._m1=0},e._isHermite=function(){return 2===this._curve.type||3===this._curve.type||4===this._curve.type},e._calcTangents=function(t,e){var i,n,s=t[e],a=t[e+1];if(i=0===e?[t[0][0]+(t[0][0]-t[1][0]),t[0][1]+(t[0][1]-t[1][1])]:t[e-1],n=e===t.length-2?[t[e+1][0]+(t[e+1][0]-t[e][0]),t[e+1][1]+(t[e+1][1]-t[e][1])]:t[e+2],4===this._curve.type){var r=2*(a[0]-s[0])/(a[0]-i[0]),o=2*(a[0]-s[0])/(n[0]-s[0]);this._m0=this._curve.tension*(isFinite(r)?r:0)*(a[1]-i[1]),this._m1=this._curve.tension*(isFinite(o)?o:0)*(n[1]-s[1])}else{var h=(a[0]-s[0])/(s[0]-i[0]),l=(a[0]-s[0])/(n[0]-a[0]),c=s[1]+(i[1]-s[1])*(isFinite(h)?h:0),u=a[1]+(n[1]-a[1])*(isFinite(l)?l:0),d=2===this._curve.type?.5:this._curve.tension;this._m0=d*(a[1]-c),this._m1=d*(u-s[1])}},e._evaluateHermite=function(t,e,i,n,s){var a=s*s,r=s+s,o=1-s,h=o*o;return t*((1+r)*h)+i*(s*h)+e*(a*(3-r))+n*(a*(s-1))},t}(),ut=function(){function t(t){if(this.keys=[],this.type=1,this.tension=.5,this._eval=new ct(this),t)for(var e=0;et);s++);var a=[t,e];return this.keys.splice(s,0,a),a},e.get=function(t){return this.keys[t]},e.sort=function(){this.keys.sort((function(t,e){return t[0]-e[0]}))},e.value=function(t){return this._eval.evaluate(t,!0)},e.closest=function(t){for(var e=this.keys,i=e.length,n=2,s=null,a=0;a=r))break;n=r,s=e[a]}return s},e.clone=function(){var e=new t;return e.keys=f(e.keys,this.keys),e.type=this.type,e.tension=this.tension,e},e.quantize=function(t){t=Math.max(t,2);var e=new Float32Array(t),i=1/(t-1);e[0]=this._eval.evaluate(0,!0);for(var n=1;n1)for(var t=0;t0){var e=1/Math.sqrt(t);this.x*=e,this.y*=e,this.z*=e}return this},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},e.min=function(t){return t.xthis.x&&(this.x=t.x),t.y>this.y&&(this.y=t.y),t.z>this.z&&(this.z=t.z),this},e.project=function(t){var e=(this.x*t.x+this.y*t.y+this.z*t.z)/(t.x*t.x+t.y*t.y+t.z*t.z);return this.x=t.x*e,this.y=t.y*e,this.z=t.z*e,this},e.set=function(t,e,i){return this.x=t,this.y=e,this.z=i,this},e.sub=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this},e.sub2=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},e.subScalar=function(t){return this.x-=t,this.y-=t,this.z-=t,this},e.toString=function(){return"["+this.x+", "+this.y+", "+this.z+"]"},t}();ft.ZERO=Object.freeze(new ft(0,0,0)),ft.ONE=Object.freeze(new ft(1,1,1)),ft.UP=Object.freeze(new ft(0,1,0)),ft.DOWN=Object.freeze(new ft(0,-1,0)),ft.RIGHT=Object.freeze(new ft(1,0,0)),ft.LEFT=Object.freeze(new ft(-1,0,0)),ft.FORWARD=Object.freeze(new ft(0,0,-1)),ft.BACK=Object.freeze(new ft(0,0,1));var pt=function(){function t(){var t=new Float32Array(9);t[0]=t[4]=t[8]=1,this.data=t}var e=t.prototype;return e.clone=function(){return(new t).copy(this)},e.copy=function(t){var e=t.data,i=this.data;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],this},e.set=function(t){var e=this.data;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},e.equals=function(t){var e=this.data,i=t.data;return e[0]===i[0]&&e[1]===i[1]&&e[2]===i[2]&&e[3]===i[3]&&e[4]===i[4]&&e[5]===i[5]&&e[6]===i[6]&&e[7]===i[7]&&e[8]===i[8]},e.isIdentity=function(){var t=this.data;return 1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&1===t[4]&&0===t[5]&&0===t[6]&&0===t[7]&&1===t[8]},e.setIdentity=function(){var t=this.data;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},e.toString=function(){return"["+this.data.join(", ")+"]"},e.transpose=function(){var t,e=this.data;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},e.setFromMat4=function(t){var e=t.data,i=this.data;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},e.transformVector=function(t,e){void 0===e&&(e=new ft);var i=this.data,n=t.x,s=t.y,a=t.z;return e.x=n*i[0]+s*i[3]+a*i[6],e.y=n*i[1]+s*i[4]+a*i[7],e.z=n*i[2]+s*i[5]+a*i[8],e},t}();pt.IDENTITY=Object.freeze(new pt),pt.ZERO=Object.freeze((new pt).set([0,0,0,0,0,0,0,0,0]));var mt=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),2===t.length?(this.x=t[0],this.y=t[1]):(this.x=t,this.y=e)}var e=t.prototype;return e.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.add2=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},e.addScalar=function(t){return this.x+=t,this.y+=t,this},e.clone=function(){return new t(this.x,this.y)},e.copy=function(t){return this.x=t.x,this.y=t.y,this},e.cross=function(t){return this.x*t.y-this.y*t.x},e.distance=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},e.div=function(t){return this.x/=t.x,this.y/=t.y,this},e.div2=function(t,e){return this.x=t.x/e.x,this.y=t.y/e.y,this},e.divScalar=function(t){return this.x/=t,this.y/=t,this},e.dot=function(t){return this.x*t.x+this.y*t.y},e.equals=function(t){return this.x===t.x&&this.y===t.y},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.lengthSq=function(){return this.x*this.x+this.y*this.y},e.lerp=function(t,e,i){return this.x=t.x+i*(e.x-t.x),this.y=t.y+i*(e.y-t.y),this},e.mul=function(t){return this.x*=t.x,this.y*=t.y,this},e.mul2=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this},e.mulScalar=function(t){return this.x*=t,this.y*=t,this},e.normalize=function(){var t=this.x*this.x+this.y*this.y;if(t>0){var e=1/Math.sqrt(t);this.x*=e,this.y*=e}return this},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},e.min=function(t){return t.xthis.x&&(this.x=t.x),t.y>this.y&&(this.y=t.y),this},e.set=function(t,e){return this.x=t,this.y=e,this},e.sub=function(t){return this.x-=t.x,this.y-=t.y,this},e.sub2=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},e.subScalar=function(t){return this.x-=t,this.y-=t,this},e.toString=function(){return"["+this.x+", "+this.y+"]"},t.angleRad=function(t,e){return Math.atan2(t.x*e.y-t.y*e.x,t.x*e.x+t.y*e.y)},t}();mt.ZERO=Object.freeze(new mt(0,0)),mt.ONE=Object.freeze(new mt(1,1)),mt.UP=Object.freeze(new mt(0,1)),mt.DOWN=Object.freeze(new mt(0,-1)),mt.RIGHT=Object.freeze(new mt(1,0)),mt.LEFT=Object.freeze(new mt(-1,0));var _t=function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),4===t.length?(this.x=t[0],this.y=t[1],this.z=t[2],this.w=t[3]):(this.x=t,this.y=e,this.z=i,this.w=n)}var e=t.prototype;return e.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},e.add2=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},e.addScalar=function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},e.clone=function(){return new t(this.x,this.y,this.z,this.w)},e.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},e.div=function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this},e.div2=function(t,e){return this.x=t.x/e.x,this.y=t.y/e.y,this.z=t.z/e.z,this.w=t.w/e.w,this},e.divScalar=function(t){return this.x/=t,this.y/=t,this.z/=t,this.w/=t,this},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},e.equals=function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},e.lerp=function(t,e,i){return this.x=t.x+i*(e.x-t.x),this.y=t.y+i*(e.y-t.y),this.z=t.z+i*(e.z-t.z),this.w=t.w+i*(e.w-t.w),this},e.mul=function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this},e.mul2=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this.w=t.w*e.w,this},e.mulScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},e.normalize=function(){var t=this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w;if(t>0){var e=1/Math.sqrt(t);this.x*=e,this.y*=e,this.z*=e,this.w*=e}return this},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},e.min=function(t){return t.xthis.x&&(this.x=t.x),t.y>this.y&&(this.y=t.y),t.z>this.z&&(this.z=t.z),t.w>this.w&&(this.w=t.w),this},e.set=function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this},e.sub=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this},e.sub2=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},e.subScalar=function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},e.toString=function(){return"["+this.x+", "+this.y+", "+this.z+", "+this.w+"]"},t}();_t.ZERO=Object.freeze(new _t(0,0,0,0)),_t.ONE=Object.freeze(new _t(1,1,1,1));var gt=new mt,vt=new ft,yt=new ft,xt=new ft,bt=new ft,St=function(){function t(){var t=new Float32Array(16);t[0]=t[5]=t[10]=t[15]=1,this.data=t}t._getPerspectiveHalfSize=function(t,e,i,n,s){s?(t.x=n*Math.tan(e*Math.PI/360),t.y=t.x/i):(t.y=n*Math.tan(e*Math.PI/360),t.x=t.y*i)};var e=t.prototype;return e.add2=function(t,e){var i=t.data,n=e.data,s=this.data;return s[0]=i[0]+n[0],s[1]=i[1]+n[1],s[2]=i[2]+n[2],s[3]=i[3]+n[3],s[4]=i[4]+n[4],s[5]=i[5]+n[5],s[6]=i[6]+n[6],s[7]=i[7]+n[7],s[8]=i[8]+n[8],s[9]=i[9]+n[9],s[10]=i[10]+n[10],s[11]=i[11]+n[11],s[12]=i[12]+n[12],s[13]=i[13]+n[13],s[14]=i[14]+n[14],s[15]=i[15]+n[15],this},e.add=function(t){return this.add2(this,t)},e.clone=function(){return(new t).copy(this)},e.copy=function(t){var e=t.data,i=this.data;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],this},e.equals=function(t){var e=this.data,i=t.data;return e[0]===i[0]&&e[1]===i[1]&&e[2]===i[2]&&e[3]===i[3]&&e[4]===i[4]&&e[5]===i[5]&&e[6]===i[6]&&e[7]===i[7]&&e[8]===i[8]&&e[9]===i[9]&&e[10]===i[10]&&e[11]===i[11]&&e[12]===i[12]&&e[13]===i[13]&&e[14]===i[14]&&e[15]===i[15]},e.isIdentity=function(){var t=this.data;return 1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&0===t[4]&&1===t[5]&&0===t[6]&&0===t[7]&&0===t[8]&&0===t[9]&&1===t[10]&&0===t[11]&&0===t[12]&&0===t[13]&&0===t[14]&&1===t[15]},e.mul2=function(t,e){var i,n,s,a,r=t.data,o=e.data,h=this.data,l=r[0],c=r[1],u=r[2],d=r[3],f=r[4],p=r[5],m=r[6],_=r[7],g=r[8],v=r[9],y=r[10],x=r[11],b=r[12],S=r[13],w=r[14],T=r[15];return i=o[0],n=o[1],s=o[2],a=o[3],h[0]=l*i+f*n+g*s+b*a,h[1]=c*i+p*n+v*s+S*a,h[2]=u*i+m*n+y*s+w*a,h[3]=d*i+_*n+x*s+T*a,i=o[4],n=o[5],s=o[6],a=o[7],h[4]=l*i+f*n+g*s+b*a,h[5]=c*i+p*n+v*s+S*a,h[6]=u*i+m*n+y*s+w*a,h[7]=d*i+_*n+x*s+T*a,i=o[8],n=o[9],s=o[10],a=o[11],h[8]=l*i+f*n+g*s+b*a,h[9]=c*i+p*n+v*s+S*a,h[10]=u*i+m*n+y*s+w*a,h[11]=d*i+_*n+x*s+T*a,i=o[12],n=o[13],s=o[14],a=o[15],h[12]=l*i+f*n+g*s+b*a,h[13]=c*i+p*n+v*s+S*a,h[14]=u*i+m*n+y*s+w*a,h[15]=d*i+_*n+x*s+T*a,this},e.mulAffine2=function(t,e){var i,n,s,a=t.data,r=e.data,o=this.data,h=a[0],l=a[1],c=a[2],u=a[4],d=a[5],f=a[6],p=a[8],m=a[9],_=a[10],g=a[12],v=a[13],y=a[14];return i=r[0],n=r[1],s=r[2],o[0]=h*i+u*n+p*s,o[1]=l*i+d*n+m*s,o[2]=c*i+f*n+_*s,o[3]=0,i=r[4],n=r[5],s=r[6],o[4]=h*i+u*n+p*s,o[5]=l*i+d*n+m*s,o[6]=c*i+f*n+_*s,o[7]=0,i=r[8],n=r[9],s=r[10],o[8]=h*i+u*n+p*s,o[9]=l*i+d*n+m*s,o[10]=c*i+f*n+_*s,o[11]=0,i=r[12],n=r[13],s=r[14],o[12]=h*i+u*n+p*s+g,o[13]=l*i+d*n+m*s+v,o[14]=c*i+f*n+_*s+y,o[15]=1,this},e.mul=function(t){return this.mul2(this,t)},e.transformPoint=function(t,e){void 0===e&&(e=new ft);var i=this.data,n=t.x,s=t.y,a=t.z;return e.x=n*i[0]+s*i[4]+a*i[8]+i[12],e.y=n*i[1]+s*i[5]+a*i[9]+i[13],e.z=n*i[2]+s*i[6]+a*i[10]+i[14],e},e.transformVector=function(t,e){void 0===e&&(e=new ft);var i=this.data,n=t.x,s=t.y,a=t.z;return e.x=n*i[0]+s*i[4]+a*i[8],e.y=n*i[1]+s*i[5]+a*i[9],e.z=n*i[2]+s*i[6]+a*i[10],e},e.transformVec4=function(t,e){void 0===e&&(e=new _t);var i=this.data,n=t.x,s=t.y,a=t.z,r=t.w;return e.x=n*i[0]+s*i[4]+a*i[8]+r*i[12],e.y=n*i[1]+s*i[5]+a*i[9]+r*i[13],e.z=n*i[2]+s*i[6]+a*i[10]+r*i[14],e.w=n*i[3]+s*i[7]+a*i[11]+r*i[15],e},e.setLookAt=function(t,e,i){xt.sub2(t,e).normalize(),yt.copy(i).normalize(),vt.cross(yt,xt).normalize(),yt.cross(xt,vt);var n=this.data;return n[0]=vt.x,n[1]=vt.y,n[2]=vt.z,n[3]=0,n[4]=yt.x,n[5]=yt.y,n[6]=yt.z,n[7]=0,n[8]=xt.x,n[9]=xt.y,n[10]=xt.z,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this},e.setFrustum=function(t,e,i,n,s,a){var r=2*s,o=e-t,h=n-i,l=a-s,c=this.data;return c[0]=r/o,c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=r/h,c[6]=0,c[7]=0,c[8]=(e+t)/o,c[9]=(n+i)/h,c[10]=(-a-s)/l,c[11]=-1,c[12]=0,c[13]=0,c[14]=-r*a/l,c[15]=0,this},e.setPerspective=function(e,i,n,s,a){return t._getPerspectiveHalfSize(gt,e,i,n,a),this.setFrustum(-gt.x,gt.x,-gt.y,gt.y,n,s)},e.setOrtho=function(t,e,i,n,s,a){var r=this.data;return r[0]=2/(e-t),r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=2/(n-i),r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-2/(a-s),r[11]=0,r[12]=-(e+t)/(e-t),r[13]=-(n+i)/(n-i),r[14]=-(a+s)/(a-s),r[15]=1,this},e.setFromAxisAngle=function(t,e){e*=rt.DEG_TO_RAD;var i=t.x,n=t.y,s=t.z,a=Math.cos(e),r=Math.sin(e),o=1-a,h=o*i,l=o*n,c=this.data;return c[0]=h*i+a,c[1]=h*n+r*s,c[2]=h*s-r*n,c[3]=0,c[4]=h*n-r*s,c[5]=l*n+a,c[6]=l*s+r*i,c[7]=0,c[8]=h*s+r*n,c[9]=l*s-i*r,c[10]=o*s*s+a,c[11]=0,c[12]=0,c[13]=0,c[14]=0,c[15]=1,this},e.setTranslate=function(t,e,i){var n=this.data;return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=t,n[13]=e,n[14]=i,n[15]=1,this},e.setScale=function(t,e,i){var n=this.data;return n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=e,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=i,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this},e.setViewport=function(t,e,i,n){var s=this.data;return s[0]=.5*i,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=.5*n,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=.5,s[11]=0,s[12]=t+.5*i,s[13]=e+.5*n,s[14]=.5,s[15]=1,this},e.invert=function(){var t=this.data,e=t[0],i=t[1],n=t[2],s=t[3],a=t[4],r=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],f=t[12],p=t[13],m=t[14],_=t[15],g=e*r-i*a,v=e*o-n*a,y=e*h-s*a,x=i*o-n*r,b=i*h-s*r,S=n*h-s*o,w=l*p-c*f,T=l*m-u*f,A=l*_-d*f,M=c*m-u*p,C=c*_-d*p,E=u*_-d*m,P=g*E-v*C+y*M+x*A-b*T+S*w;if(0===P)this.setIdentity();else{var R=1/P;t[0]=(r*E-o*C+h*M)*R,t[1]=(-i*E+n*C-s*M)*R,t[2]=(p*S-m*b+_*x)*R,t[3]=(-c*S+u*b-d*x)*R,t[4]=(-a*E+o*A-h*T)*R,t[5]=(e*E-n*A+s*T)*R,t[6]=(-f*S+m*y-_*v)*R,t[7]=(l*S-u*y+d*v)*R,t[8]=(a*C-r*A+h*w)*R,t[9]=(-e*C+i*A-s*w)*R,t[10]=(f*b-p*y+_*g)*R,t[11]=(-l*b+c*y-d*g)*R,t[12]=(-a*M+r*T-o*w)*R,t[13]=(e*M-i*T+n*w)*R,t[14]=(-f*x+p*v-m*g)*R,t[15]=(l*x-c*v+u*g)*R}return this},e.set=function(t){var e=this.data;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},e.setIdentity=function(){var t=this.data;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},e.setTRS=function(t,e,i){var n=e.x,s=e.y,a=e.z,r=e.w,o=i.x,h=i.y,l=i.z,c=n+n,u=s+s,d=a+a,f=n*c,p=n*u,m=n*d,_=s*u,g=s*d,v=a*d,y=r*c,x=r*u,b=r*d,S=this.data;return S[0]=(1-(_+v))*o,S[1]=(p+b)*o,S[2]=(m-x)*o,S[3]=0,S[4]=(p-b)*h,S[5]=(1-(f+v))*h,S[6]=(g+y)*h,S[7]=0,S[8]=(m+x)*l,S[9]=(g-y)*l,S[10]=(1-(f+_))*l,S[11]=0,S[12]=t.x,S[13]=t.y,S[14]=t.z,S[15]=1,this},e.transpose=function(){var t,e=this.data;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},e.invertTo3x3=function(t){var e=this.data,i=t.data,n=e[0],s=e[1],a=e[2],r=e[4],o=e[5],h=e[6],l=e[8],c=e[9],u=e[10],d=u*o-h*c,f=-u*s+a*c,p=h*s-a*o,m=-u*r+h*l,_=u*n-a*l,g=-h*n+a*r,v=c*r-o*l,y=-c*n+s*l,x=o*n-s*r,b=n*d+s*m+a*v;if(0===b)return this;var S=1/b;return i[0]=S*d,i[1]=S*f,i[2]=S*p,i[3]=S*m,i[4]=S*_,i[5]=S*g,i[6]=S*v,i[7]=S*y,i[8]=S*x,this},e.getTranslation=function(t){return void 0===t&&(t=new ft),t.set(this.data[12],this.data[13],this.data[14])},e.getX=function(t){return void 0===t&&(t=new ft),t.set(this.data[0],this.data[1],this.data[2])},e.getY=function(t){return void 0===t&&(t=new ft),t.set(this.data[4],this.data[5],this.data[6])},e.getZ=function(t){return void 0===t&&(t=new ft),t.set(this.data[8],this.data[9],this.data[10])},e.getScale=function(t){return void 0===t&&(t=new ft),this.getX(vt),this.getY(yt),this.getZ(xt),t.set(vt.length(),yt.length(),xt.length()),t},e.setFromEulerAngles=function(t,e,i){t*=rt.DEG_TO_RAD,e*=rt.DEG_TO_RAD,i*=rt.DEG_TO_RAD;var n=Math.sin(-t),s=Math.cos(-t),a=Math.sin(-e),r=Math.cos(-e),o=Math.sin(-i),h=Math.cos(-i),l=this.data;return l[0]=r*h,l[1]=-r*o,l[2]=a,l[3]=0,l[4]=s*o+h*n*a,l[5]=s*h-n*a*o,l[6]=-r*n,l[7]=0,l[8]=n*o-s*h*a,l[9]=h*n+s*a*o,l[10]=s*r,l[11]=0,l[12]=0,l[13]=0,l[14]=0,l[15]=1,this},e.getEulerAngles=function(t){void 0===t&&(t=new ft),this.getScale(bt);var e=bt.x,i=bt.y,n=bt.z;if(0===e||0===i||0===n)return t.set(0,0,0);var s,a,r=this.data,o=Math.asin(-r[2]/e),h=.5*Math.PI;return o-h?(s=Math.atan2(r[6]/i,r[10]/n),a=Math.atan2(r[1]/e,r[0]/e)):(a=0,s=-Math.atan2(r[4]/i,r[5]/i)):(a=0,s=Math.atan2(r[4]/i,r[5]/i)),t.set(s,o,a).mulScalar(rt.RAD_TO_DEG)},e.toString=function(){return"["+this.data.join(", ")+"]"},t}();St.IDENTITY=Object.freeze(new St),St.ZERO=Object.freeze((new St).set([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]));var wt=function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),4===t.length?(this.x=t[0],this.y=t[1],this.z=t[2],this.w=t[3]):(this.x=t,this.y=e,this.z=i,this.w=n)}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y,this.z,this.w)},e.conjugate=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},e.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},e.equals=function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},e.getAxisAngle=function(t){var e=2*Math.acos(this.w),i=Math.sin(e/2);return 0!==i?(t.x=this.x/i,t.y=this.y/i,t.z=this.z/i,(t.x<0||t.y<0||t.z<0)&&(t.x*=-1,t.y*=-1,t.z*=-1,e*=-1)):(t.x=1,t.y=0,t.z=0),e*rt.RAD_TO_DEG},e.getEulerAngles=function(t){var e,i,n;void 0===t&&(t=new ft);var s=this.x,a=this.y,r=this.z,o=this.w,h=2*(o*a-s*r);return h<=-.99999?(e=2*Math.atan2(s,o),i=-Math.PI/2,n=0):h>=.99999?(e=2*Math.atan2(s,o),i=Math.PI/2,n=0):(e=Math.atan2(2*(o*s+a*r),1-2*(s*s+a*a)),i=Math.asin(h),n=Math.atan2(2*(o*r+s*a),1-2*(a*a+r*r))),t.set(e,i,n).mulScalar(rt.RAD_TO_DEG)},e.invert=function(){return this.conjugate().normalize()},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},e.mul=function(t){var e=this.x,i=this.y,n=this.z,s=this.w,a=t.x,r=t.y,o=t.z,h=t.w;return this.x=s*a+e*h+i*o-n*r,this.y=s*r+i*h+n*a-e*o,this.z=s*o+n*h+e*r-i*a,this.w=s*h-e*a-i*r-n*o,this},e.mul2=function(t,e){var i=t.x,n=t.y,s=t.z,a=t.w,r=e.x,o=e.y,h=e.z,l=e.w;return this.x=a*r+i*l+n*h-s*o,this.y=a*o+n*l+s*r-i*h,this.z=a*h+s*l+i*o-n*r,this.w=a*l-i*r-n*o-s*h,this},e.normalize=function(){var t=this.length();return 0===t?(this.x=this.y=this.z=0,this.w=1):(t=1/t,this.x*=t,this.y*=t,this.z*=t,this.w*=t),this},e.set=function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this},e.setFromAxisAngle=function(t,e){e*=.5*rt.DEG_TO_RAD;var i=Math.sin(e),n=Math.cos(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=n,this},e.setFromEulerAngles=function(t,e,i){if(t instanceof ft){var n=t;t=n.x,e=n.y,i=n.z}var s=.5*rt.DEG_TO_RAD;t*=s,e*=s,i*=s;var a=Math.sin(t),r=Math.cos(t),o=Math.sin(e),h=Math.cos(e),l=Math.sin(i),c=Math.cos(i);return this.x=a*h*c-r*o*l,this.y=r*o*c+a*h*l,this.z=r*h*l-a*o*c,this.w=r*h*c+a*o*l,this},e.setFromMat4=function(t){var e,i,n,s,a,r,o,h,l,c,u,d,f,p;if(e=(t=t.data)[0],i=t[1],n=t[2],s=t[4],a=t[5],r=t[6],o=t[8],h=t[9],l=t[10],0===(d=e*e+i*i+n*n))return this;if(d=1/Math.sqrt(d),0===(f=s*s+a*a+r*r))return this;if(f=1/Math.sqrt(f),0===(p=o*o+h*h+l*l))return this;i*=d,n*=d,s*=f,r*=f,o*=p=1/Math.sqrt(p),h*=p;var m=(e*=d)+(a*=f)+(l*=p);return m>=0?(c=Math.sqrt(m+1),this.w=.5*c,c=.5/c,this.x=(r-h)*c,this.y=(o-n)*c,this.z=(i-s)*c):e>a?e>l?(u=e-(a+l)+1,u=Math.sqrt(u),this.x=.5*u,u=.5/u,this.w=(r-h)*u,this.y=(i+s)*u,this.z=(n+o)*u):(u=l-(e+a)+1,u=Math.sqrt(u),this.z=.5*u,u=.5/u,this.w=(i-s)*u,this.x=(o+n)*u,this.y=(h+r)*u):a>l?(u=a-(l+e)+1,u=Math.sqrt(u),this.y=.5*u,u=.5/u,this.w=(o-n)*u,this.z=(r+h)*u,this.x=(s+i)*u):(u=l-(e+a)+1,u=Math.sqrt(u),this.z=.5*u,u=.5/u,this.w=(i-s)*u,this.x=(o+n)*u,this.y=(h+r)*u),this},e.slerp=function(t,e,i){var n=t.x,s=t.y,a=t.z,r=t.w,o=e.x,h=e.y,l=e.z,c=e.w,u=r*c+n*o+s*h+a*l;if(u<0&&(c=-c,o=-o,h=-h,l=-l,u=-u),Math.abs(u)>=1)return this.w=r,this.x=n,this.y=s,this.z=a,this;var d=Math.acos(u),f=Math.sqrt(1-u*u);if(Math.abs(f)<.001)return this.w=.5*r+.5*c,this.x=.5*n+.5*o,this.y=.5*s+.5*h,this.z=.5*a+.5*l,this;var p=Math.sin((1-i)*d)/f,m=Math.sin(i*d)/f;return this.w=r*p+c*m,this.x=n*p+o*m,this.y=s*p+h*m,this.z=a*p+l*m,this},e.transformVector=function(t,e){void 0===e&&(e=new ft);var i=t.x,n=t.y,s=t.z,a=this.x,r=this.y,o=this.z,h=this.w,l=h*i+r*s-o*n,c=h*n+o*i-a*s,u=h*s+a*n-r*i,d=-a*i-r*n-o*s;return e.x=l*h+d*-a+c*-o-u*-r,e.y=c*h+d*-r+u*-a-l*-o,e.z=u*h+d*-o+l*-r-c*-a,e},e.toString=function(){return"["+this.x+", "+this.y+", "+this.z+", "+this.w+"]"},t}();wt.IDENTITY=Object.freeze(new wt(0,0,0,1)),wt.ZERO=Object.freeze(new wt(0,0,0,0));var Tt=new ft,At=new ft,Mt=new ft,Ct=new ft,Et=new ft,Pt=function(){function t(t,e){void 0===t&&(t=new ft),void 0===e&&(e=new ft(.5,.5,.5)),this.center=t,this.halfExtents=e,this._min=new ft,this._max=new ft}var e=t.prototype;return e.add=function(t){var e=this.center,i=e.x,n=e.y,s=e.z,a=this.halfExtents,r=a.x,o=a.y,h=a.z,l=i-r,c=i+r,u=n-o,d=n+o,f=s-h,p=s+h,m=t.center,_=m.x,g=m.y,v=m.z,y=t.halfExtents,x=y.x,b=y.y,S=y.z,w=_-x,T=_+x,A=g-b,M=g+b,C=v-S,E=v+S;wc&&(c=T),Ad&&(d=M),Cp&&(p=E),e.x=.5*(l+c),e.y=.5*(u+d),e.z=.5*(f+p),a.x=.5*(c-l),a.y=.5*(d-u),a.z=.5*(p-f)},e.copy=function(t){this.center.copy(t.center),this.halfExtents.copy(t.halfExtents)},e.clone=function(){return new t(this.center.clone(),this.halfExtents.clone())},e.intersects=function(t){var e=this.getMax(),i=this.getMin(),n=t.getMax(),s=t.getMin();return i.x<=n.x&&e.x>=s.x&&i.y<=n.y&&e.y>=s.y&&i.z<=n.z&&e.z>=s.z},e._intersectsRay=function(t,e){var i=Tt.copy(this.getMin()).sub(t.origin),n=At.copy(this.getMax()).sub(t.origin),s=t.direction;0===s.x?(i.x=i.x<0?-Number.MAX_VALUE:Number.MAX_VALUE,n.x=n.x<0?-Number.MAX_VALUE:Number.MAX_VALUE):(i.x/=s.x,n.x/=s.x),0===s.y?(i.y=i.y<0?-Number.MAX_VALUE:Number.MAX_VALUE,n.y=n.y<0?-Number.MAX_VALUE:Number.MAX_VALUE):(i.y/=s.y,n.y/=s.y),0===s.z?(i.z=i.z<0?-Number.MAX_VALUE:Number.MAX_VALUE,n.z=n.z<0?-Number.MAX_VALUE:Number.MAX_VALUE):(i.z/=s.z,n.z/=s.z);var a=Mt.set(Math.min(i.x,n.x),Math.min(i.y,n.y),Math.min(i.z,n.z)),r=Ct.set(Math.max(i.x,n.x),Math.max(i.y,n.y),Math.max(i.z,n.z)),o=Math.min(Math.min(r.x,r.y),r.z),h=Math.max(Math.max(a.x,a.y),a.z),l=o>=h&&h>=0;return l&&e.copy(t.direction).mulScalar(h).add(t.origin),l},e._fastIntersectsRay=function(t){var e=Tt,i=At,n=Mt,s=Ct,a=Et,r=t.direction;return e.sub2(t.origin,this.center),s.set(Math.abs(e.x),Math.abs(e.y),Math.abs(e.z)),n.mul2(e,r),!(s.x>this.halfExtents.x&&n.x>=0)&&(!(s.y>this.halfExtents.y&&n.y>=0)&&(!(s.z>this.halfExtents.z&&n.z>=0)&&(a.set(Math.abs(r.x),Math.abs(r.y),Math.abs(r.z)),i.cross(r,e),i.set(Math.abs(i.x),Math.abs(i.y),Math.abs(i.z)),!(i.x>this.halfExtents.y*a.z+this.halfExtents.z*a.y)&&(!(i.y>this.halfExtents.x*a.z+this.halfExtents.z*a.x)&&!(i.z>this.halfExtents.x*a.y+this.halfExtents.y*a.x)))))},e.intersectsRay=function(t,e){return e?this._intersectsRay(t,e):this._fastIntersectsRay(t)},e.setMinMax=function(t,e){this.center.add2(e,t).mulScalar(.5),this.halfExtents.sub2(e,t).mulScalar(.5)},e.getMin=function(){return this._min.copy(this.center).sub(this.halfExtents)},e.getMax=function(){return this._max.copy(this.center).add(this.halfExtents)},e.containsPoint=function(t){var e=this.getMin(),i=this.getMax();return!(t.xi.x||t.yi.y||t.zi.z)},e.setFromTransformedAabb=function(t,e,i){void 0===i&&(i=!1);var n=t.center,s=t.halfExtents,a=e.data,r=a[0],o=a[4],h=a[8],l=a[1],c=a[5],u=a[9],d=a[2],f=a[6],p=a[10];if(i){var m=r*r+o*o+h*h;if(m>0){var _=1/Math.sqrt(m);r*=_,o*=_,h*=_}if((m=l*l+c*c+u*u)>0){var g=1/Math.sqrt(m);l*=g,c*=g,u*=g}if((m=d*d+f*f+p*p)>0){var v=1/Math.sqrt(m);d*=v,f*=v,p*=v}}this.center.set(a[12]+r*n.x+o*n.y+h*n.z,a[13]+l*n.x+c*n.y+u*n.z,a[14]+d*n.x+f*n.y+p*n.z),this.halfExtents.set(Math.abs(r)*s.x+Math.abs(o)*s.y+Math.abs(h)*s.z,Math.abs(l)*s.x+Math.abs(c)*s.y+Math.abs(u)*s.z,Math.abs(d)*s.x+Math.abs(f)*s.y+Math.abs(p)*s.z)},e.compute=function(t,e){if((e=void 0===e?t.length/3:e)>0){for(var i=Tt.set(t[0],t[1],t[2]),n=At.set(t[0],t[1],t[2]),s=1;sn.x&&(n.x=a),r>n.y&&(n.y=r),o>n.z&&(n.z=o)}this.setMinMax(i,n)}},e.intersectsBoundingSphere=function(t){return this._distanceToBoundingSphereSq(t)<=t.radius*t.radius},e._distanceToBoundingSphereSq=function(t){for(var e=this.getMin(),i=this.getMax(),n=0,s=["x","y","z"],a=0;a<3;++a){var r=0,o=t.center[s[a]],h=e[s[a]],l=i[s[a]],c=0;ol&&(r+=(c=o-l)*c),n+=r}return n},e._expand=function(t,e){Tt.add2(this.getMin(),t),At.add2(this.getMax(),e),this.setMinMax(Tt,At)},t}(),Rt=new ft,It=new ft,Lt=function(){function t(t,e){void 0===t&&(t=new ft),void 0===e&&(e=.5),this.center=t,this.radius=e}var e=t.prototype;return e.containsPoint=function(t){var e=Rt.sub2(t,this.center).lengthSq(),i=this.radius;return e0&&n>0)return!1;var a=n*n-s;if(a<0)return!1;var r=Math.abs(-n-Math.sqrt(a));return e&&e.copy(t.direction).mulScalar(r).add(t.origin),!0},e.intersectsBoundingSphere=function(t){Rt.sub2(t.center,this.center);var e=t.radius+this.radius;return Rt.lengthSq()<=e*e},t}(),Dt="none",kt="linear",Ot={0:"PCF3",1:"VSM8",2:"VSM16",3:"VSM32",4:"PCF5",5:"PCF1"},Ft=128,Bt=256,Nt=1024,Ut=2048,zt=4096,Vt=8192,Wt=18,Gt=[new ft,new ft,new ft,new ft,new ft,new ft,new ft,new ft],Ht=function(){function t(){this.planes=[];for(var t=0;t<6;t++)this.planes[t]=[]}var e=t.prototype;return e.setFromMat4=function(t){var e,i=t.data,n=this.planes;(e=n[0])[0]=i[3]-i[0],e[1]=i[7]-i[4],e[2]=i[11]-i[8],e[3]=i[15]-i[12];var s=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=s,e[1]/=s,e[2]/=s,e[3]/=s,(e=n[1])[0]=i[3]+i[0],e[1]=i[7]+i[4],e[2]=i[11]+i[8],e[3]=i[15]+i[12],s=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),e[0]/=s,e[1]/=s,e[2]/=s,e[3]/=s,(e=n[2])[0]=i[3]+i[1],e[1]=i[7]+i[5],e[2]=i[11]+i[9],e[3]=i[15]+i[13],s=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),e[0]/=s,e[1]/=s,e[2]/=s,e[3]/=s,(e=n[3])[0]=i[3]-i[1],e[1]=i[7]-i[5],e[2]=i[11]-i[9],e[3]=i[15]-i[13],s=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),e[0]/=s,e[1]/=s,e[2]/=s,e[3]/=s,(e=n[4])[0]=i[3]-i[2],e[1]=i[7]-i[6],e[2]=i[11]-i[10],e[3]=i[15]-i[14],s=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),e[0]/=s,e[1]/=s,e[2]/=s,e[3]/=s,(e=n[5])[0]=i[3]+i[2],e[1]=i[7]+i[6],e[2]=i[11]+i[10],e[3]=i[15]+i[14],s=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),e[0]/=s,e[1]/=s,e[2]/=s,e[3]/=s},e.containsPoint=function(t){var e,i;for(e=0;e<6;e++)if((i=this.planes[e])[0]*t.x+i[1]*t.y+i[2]*t.z+i[3]<=0)return!1;return!0},e.containsSphere=function(t){var e,i,n,s=0,a=t.radius,r=t.center,o=r.x,h=r.y,l=r.z,c=this.planes;for(i=0;i<6;i++){if((e=(n=c[i])[0]*o+n[1]*h+n[2]*l+n[3])<=-a)return 0;e>a&&s++}return 6===s?2:1},t.getPoints=function(t,e,i){e=e||t._nearClip,i=i||t._farClip;var n=t._fov*Math.PI/180,s=0===t._projection?Math.tan(n/2)*e:t._orthoHeight,a=s*t._aspectRatio,r=Gt;return r[0].x=a,r[0].y=-s,r[0].z=-e,r[1].x=a,r[1].y=s,r[1].z=-e,r[2].x=-a,r[2].y=s,r[2].z=-e,r[3].x=-a,r[3].y=-s,r[3].z=-e,0===t._projection&&(a=(s=Math.tan(n/2)*i)*t._aspectRatio),r[4].x=a,r[4].y=-s,r[4].z=-i,r[5].x=a,r[5].y=s,r[5].z=-i,r[6].x=-a,r[6].y=s,r[6].z=-i,r[7].x=-a,r[7].y=-s,r[7].z=-i,r},t}(),Xt=function(){function t(t,e){void 0===t&&(t=new ft),void 0===e&&(e=new ft(0,0,-1)),this.origin=t,this.direction=e}return t.prototype.set=function(t,e){return this.origin.copy(t),this.direction.copy(e),this},t}(),qt=new Xt,jt=new ft,Yt=new Lt,Kt=new St,Zt=function(){function t(t,e){void 0===t&&(t=new St),void 0===e&&(e=new ft(.5,.5,.5)),this.halfExtents=e,this._modelTransform=t.clone().invert(),this._worldTransform=t.clone(),this._aabb=new Pt(new ft,this.halfExtents)}var e=t.prototype;return e.intersectsRay=function(t,e){if(this._modelTransform.transformPoint(t.origin,qt.origin),this._modelTransform.transformVector(t.direction,qt.direction),e){var i=this._aabb._intersectsRay(qt,e);return Kt.copy(this._modelTransform).invert().transformPoint(e,e),i}return this._aabb._fastIntersectsRay(qt)},e.containsPoint=function(t){return this._modelTransform.transformPoint(t,jt),this._aabb.containsPoint(jt)},e.intersectsBoundingSphere=function(t){return this._modelTransform.transformPoint(t.center,Yt.center),Yt.radius=t.radius,!!this._aabb.intersectsBoundingSphere(Yt)},q(t,[{key:"worldTransform",get:function(){return this._worldTransform},set:function(t){this._worldTransform.copy(t),this._modelTransform.copy(t).invert()}}]),t}(),$t=new ft,Qt=function(){function t(t,e){void 0===t&&(t=new ft),void 0===e&&(e=new ft(0,0,1)),this.normal=e,this.point=t}var e=t.prototype;return e.intersectsLine=function(t,e,i){var n=-this.normal.dot(this.point),s=this.normal.dot(t)+n,a=s/(s-(this.normal.dot(e)+n)),r=a>=0&&a<=1;return r&&i&&i.lerp(t,e,a),r},e.intersectsRay=function(t,e){var i=$t.sub2(this.point,t.origin),n=this.normal.dot(i)/this.normal.dot(t.direction),s=n>=0;return s&&e&&e.copy(t.direction).mulScalar(n).add(t.origin),s},t}(),Jt=10,te=11,ee=12,ie=13,ne=14,se=16,ae=17,re=21,oe=24,he=25,le="POSITION",ce="NORMAL",ue="TANGENT",de="BLENDWEIGHT",fe="BLENDINDICES",pe="COLOR",me="TEXCOORD",_e="TEXCOORD0",ge="TEXCOORD1",ve="TEXCOORD2",ye="TEXCOORD3",xe="TEXCOORD4",be="TEXCOORD5",Se="TEXCOORD6",we="TEXCOORD7",Te="ATTR",Ae="ATTR0",Me="ATTR1",Ce="ATTR2",Ee="ATTR3",Pe="ATTR4",Re="ATTR5",Ie="ATTR6",Le="ATTR7",De="ATTR8",ke="ATTR9",Oe="ATTR10",Fe="ATTR11",Be="ATTR12",Ne="ATTR13",Ue="ATTR14",ze="ATTR15",Ve="default",We="rgbm",Ge="rgbe",He="swizzleGGGR",Xe="none",qe="cube",je="equirect",Ye="octahedral",Ke=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array],Ze=[1,1,2,2,4,4,4],$e={Int8Array:0,Uint8Array:1,Int16Array:2,Uint16Array:3,Int32Array:4,Uint32Array:5,Float32Array:6},Qe=[Uint8Array,Uint16Array,Uint32Array],Je=[1,2,4],ti={POSITION:0,NORMAL:1,BLENDWEIGHT:2,BLENDINDICES:3,COLOR:4,TEXCOORD0:5,TEXCOORD1:6,TEXCOORD2:7,TEXCOORD3:8,TEXCOORD4:9,TEXCOORD5:10,TEXCOORD6:11,TEXCOORD7:12,TANGENT:13,ATTR0:0,ATTR1:1,ATTR2:2,ATTR3:3,ATTR4:4,ATTR5:5,ATTR6:6,ATTR7:7,ATTR8:8,ATTR9:9,ATTR10:10,ATTR11:11,ATTR12:12,ATTR13:13,ATTR14:14,ATTR15:15},ei=0,ii=function(){function t(t,e,i,n,s){void 0===n&&(n=0),this.device=t,this.format=e,this.numVertices=i,this.usage=n,this.id=ei++,this.impl=t.createVertexBufferImpl(this,e),this.instancing=!1,this.numBytes=e.verticesByteSize?e.verticesByteSize:e.size*i,t._vram.vb+=this.numBytes,s?this.setData(s):this.storage=new ArrayBuffer(this.numBytes),this.device.buffers.push(this)}var e=t.prototype;return e.destroy=function(){var t=this.device,e=t.buffers.indexOf(this);-1!==e&&t.buffers.splice(e,1),this.impl.destroy(t),t._vram.vb-=this.storage.byteLength},e.loseContext=function(){this.impl.loseContext()},e.getFormat=function(){return this.format},e.getUsage=function(){return this.usage},e.getNumVertices=function(){return this.numVertices},e.lock=function(){return this.storage},e.unlock=function(){this.impl.unlock(this)},e.setData=function(t){return t.byteLength===this.numBytes&&(this.storage=t,this.unlock(),!0)},t}();function ni(t){for(var e=0,i=0,n=t.length;i 0.5) {\n\t\tif (dAtten > 0.00001) {\n\t\t\tdirLm.xyz = dirLm.xyz * 2.0 - vec3(1.0);\n\t\t\tdAtten = saturate(dAtten);\n\t\t\tgl_FragColor.rgb = normalize(dLightDirNormW.xyz*dAtten + dirLm.xyz*dirLm.w) * 0.5 + vec3(0.5);\n\t\t\tgl_FragColor.a = dirLm.w + dAtten;\n\t\t\tgl_FragColor.a = max(gl_FragColor.a, 1.0 / 255.0);\n\t\t} else {\n\t\t\tgl_FragColor = dirLm;\n\t\t}\n\t} else {\n\t\tgl_FragColor.rgb = dirLm.xyz;\n\t\tgl_FragColor.a = max(dirLm.w, dAtten > 0.00001? (1.0/255.0) : 0.0);\n\t}\n",bakeLmEndPS:"\tgl_FragColor.rgb = dDiffuseLight;\n\tgl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(0.5));\n\tgl_FragColor.rgb /= 8.0;\n\tgl_FragColor.a = clamp( max( max( gl_FragColor.r, gl_FragColor.g ), max( gl_FragColor.b, 1.0 / 255.0 ) ), 0.0,1.0 );\n\tgl_FragColor.a = ceil(gl_FragColor.a * 255.0) / 255.0;\n\tgl_FragColor.rgb /= gl_FragColor.a;\n",basePS:"uniform vec3 view_position;\nuniform vec3 light_globalAmbient;\nfloat square(float x) {\n\treturn x*x;\n}\nfloat saturate(float x) {\n\treturn clamp(x, 0.0, 1.0);\n}\nvec3 saturate(vec3 x) {\n\treturn clamp(x, vec3(0.0), vec3(1.0));\n}\n",baseVS:"attribute vec3 vertex_position;\nattribute vec3 vertex_normal;\nattribute vec4 vertex_tangent;\nattribute vec2 vertex_texCoord0;\nattribute vec2 vertex_texCoord1;\nattribute vec4 vertex_color;\nuniform mat4 matrix_viewProjection;\nuniform mat4 matrix_model;\nuniform mat3 matrix_normal;\nvec3 dPositionW;\nmat4 dModelMatrix;\nmat3 dNormalMatrix;\n",baseNineSlicedPS:"#define NINESLICED\nvarying vec2 vMask;\nvarying vec2 vTiledUv;\nuniform mediump vec4 innerOffset;\nuniform mediump vec2 outerScale;\nuniform mediump vec4 atlasRect;\nvec2 nineSlicedUv;\n",baseNineSlicedVS:"#define NINESLICED\nvarying vec2 vMask;\nvarying vec2 vTiledUv;\nuniform mediump vec4 innerOffset;\nuniform mediump vec2 outerScale;\nuniform mediump vec4 atlasRect;\n",baseNineSlicedTiledPS:"#define NINESLICED\n#define NINESLICETILED\nvarying vec2 vMask;\nvarying vec2 vTiledUv;\nuniform mediump vec4 innerOffset;\nuniform mediump vec2 outerScale;\nuniform mediump vec4 atlasRect;\nvec2 nineSlicedUv;\n",biasConstPS:"#define SHADOWBIAS\nfloat getShadowBias(float resolution, float maxBias) {\n\treturn maxBias;\n}\n",blurVSMPS:"varying vec2 vUv0;\nuniform sampler2D source;\nuniform vec2 pixelOffset;\n#ifdef GAUSS\nuniform float weight[SAMPLES];\n#endif\n#ifdef PACKED\nfloat decodeFloatRG(vec2 rg) {\n\treturn rg.y*(1.0/255.0) + rg.x;\n}\nvec2 encodeFloatRG( float v ) {\n\tvec2 enc = vec2(1.0, 255.0) * v;\n\tenc = fract(enc);\n\tenc -= enc.yy * vec2(1.0/255.0, 1.0/255.0);\n\treturn enc;\n}\n#endif\nvoid main(void) {\n\tvec3 moments = vec3(0.0);\n\tvec2 uv = vUv0 - pixelOffset * (float(SAMPLES) * 0.5);\n\tfor (int i=0; i shadowZ ? 1.0 : 0.0;\n\t}\n\t#endif\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF3) || defined(CLUSTER_SHADOW_TYPE_PCF5)\n\tfloat getShadowOmniClusteredPCF3(sampler2D shadowMap, vec4 shadowParams, vec3 omniAtlasViewport, float shadowEdgePixels, vec3 dir) {\n\t\tfloat shadowTextureResolution = shadowParams.x;\n\t\tvec2 uv = getCubemapAtlasCoordinates(omniAtlasViewport, shadowEdgePixels, shadowTextureResolution, dir);\n\t\tfloat shadowZ = length(dir) * shadowParams.w + shadowParams.z;\n\t\tdShadowCoord = vec3(uv, shadowZ);\n\t\treturn getShadowPCF3x3(shadowMap, shadowParams.xyz);\n\t}\n\t#endif\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF5)\n\tfloat getShadowOmniClusteredPCF5(sampler2D shadowMap, vec4 shadowParams, vec3 omniAtlasViewport, float shadowEdgePixels, vec3 dir) {\n\t\treturn getShadowOmniClusteredPCF3(shadowMap, shadowParams, omniAtlasViewport, shadowEdgePixels, dir);\n\t}\n\t#endif\n#endif\n#ifdef GL2\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF1)\n\tfloat getShadowSpotClusteredPCF1(sampler2DShadow shadowMap, vec4 shadowParams) {\n\t\treturn texture(shadowMap, dShadowCoord);\n\t}\n\t#endif\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF3)\n\tfloat getShadowSpotClusteredPCF3(sampler2DShadow shadowMap, vec4 shadowParams) {\n\t\treturn getShadowSpotPCF3x3(shadowMap, shadowParams);\n\t}\n\t#endif\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF5)\n\tfloat getShadowSpotClusteredPCF5(sampler2DShadow shadowMap, vec4 shadowParams) {\n\t\treturn getShadowPCF5x5(shadowMap, shadowParams.xyz);\n\t}\n\t#endif\n#else\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF1)\n\tfloat getShadowSpotClusteredPCF1(sampler2D shadowMap, vec4 shadowParams) {\n\t\tfloat depth = unpackFloat(texture2D(shadowMap, dShadowCoord.xy));\n\t\treturn depth > dShadowCoord.z ? 1.0 : 0.0;\n\t}\n\t#endif\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF3) || defined(CLUSTER_SHADOW_TYPE_PCF5)\n\tfloat getShadowSpotClusteredPCF3(sampler2D shadowMap, vec4 shadowParams) {\n\t\treturn getShadowSpotPCF3x3(shadowMap, shadowParams);\n\t}\n\t#endif\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF5)\n\tfloat getShadowSpotClusteredPCF5(sampler2D shadowMap, vec4 shadowParams) {\n\t\treturn getShadowSpotClusteredPCF3(shadowMap, shadowParams);\n\t}\n\t#endif\n#endif\n",clusteredLightUtilsPS:"vec2 getCubemapFaceCoordinates(const vec3 dir, out float faceIndex, out vec2 tileOffset)\n{\n\tvec3 vAbs = abs(dir);\n\tfloat ma;\n\tvec2 uv;\n\tif (vAbs.z >= vAbs.x && vAbs.z >= vAbs.y) {\n\t\tfaceIndex = dir.z < 0.0 ? 5.0 : 4.0;\n\t\tma = 0.5 / vAbs.z;\n\t\tuv = vec2(dir.z < 0.0 ? -dir.x : dir.x, -dir.y);\n\t\ttileOffset.x = 2.0;\n\t\ttileOffset.y = dir.z < 0.0 ? 1.0 : 0.0;\n\t} else if(vAbs.y >= vAbs.x) {\n\t\tfaceIndex = dir.y < 0.0 ? 3.0 : 2.0;\n\t\tma = 0.5 / vAbs.y;\n\t\tuv = vec2(dir.x, dir.y < 0.0 ? -dir.z : dir.z);\n\t\ttileOffset.x = 1.0;\n\t\ttileOffset.y = dir.y < 0.0 ? 1.0 : 0.0;\n\t} else {\n\t\tfaceIndex = dir.x < 0.0 ? 1.0 : 0.0;\n\t\tma = 0.5 / vAbs.x;\n\t\tuv = vec2(dir.x < 0.0 ? dir.z : -dir.z, -dir.y);\n\t\ttileOffset.x = 0.0;\n\t\ttileOffset.y = dir.x < 0.0 ? 1.0 : 0.0;\n\t}\n\treturn uv * ma + 0.5;\n}\nvec2 getCubemapAtlasCoordinates(const vec3 omniAtlasViewport, float shadowEdgePixels, float shadowTextureResolution, const vec3 dir) {\n\tfloat faceIndex;\n\tvec2 tileOffset;\n\tvec2 uv = getCubemapFaceCoordinates(dir, faceIndex, tileOffset);\n\tfloat atlasFaceSize = omniAtlasViewport.z;\n\tfloat tileSize = shadowTextureResolution * atlasFaceSize;\n\tfloat offset = shadowEdgePixels / tileSize;\n\tuv = uv * vec2(1.0 - offset * 2.0) + vec2(offset * 1.0);\n\tuv *= atlasFaceSize;\n\tuv += tileOffset * atlasFaceSize;\n\tuv += omniAtlasViewport.xy;\n\treturn uv;\n}\n",clusteredLightPS:"uniform sampler2D clusterWorldTexture;\nuniform sampler2D lightsTexture8;\nuniform highp sampler2D lightsTextureFloat;\n#ifdef CLUSTER_SHADOWS\n\t#ifdef GL2\n\t\tuniform sampler2DShadow shadowAtlasTexture;\n\t#else\n\t\tuniform sampler2D shadowAtlasTexture;\n\t#endif\n#endif\n#ifdef CLUSTER_COOKIES\n\tuniform sampler2D cookieAtlasTexture;\n#endif\nuniform float clusterPixelsPerCell;\nuniform vec3 clusterCellsCountByBoundsSize;\nuniform vec4 lightsTextureInvSize;\nuniform vec3 clusterTextureSize;\nuniform vec3 clusterBoundsMin;\nuniform vec3 clusterBoundsDelta;\nuniform vec3 clusterCellsDot;\nuniform vec3 clusterCellsMax;\nuniform vec2 clusterCompressionLimit0;\nuniform vec2 shadowAtlasParams;\nfloat LTCLightValuesEvaluated = 0.0;\nstruct ClusterLightData {\n\tfloat lightV;\n\tfloat type;\n\tfloat shape;\n\tvec3 halfWidth;\n\tvec3 halfHeight;\n\tfloat falloffMode;\n\tfloat castShadows;\n\tfloat shadowBias;\n\tfloat shadowNormalBias;\n\tvec3 position;\n\tvec3 direction;\n\tfloat range;\n\tfloat innerConeAngleCos;\n\tfloat outerConeAngleCos;\n\tvec3 color;\n\tvec3 omniAtlasViewport;\n\tfloat cookie;\n\tfloat cookieRgb;\n\tfloat cookieIntensity;\n\tvec4 cookieChannelMask;\n\tfloat mask;\n};\nmat4 lightProjectionMatrix;\n#define isClusteredLightCastShadow(light) ( light.castShadows > 0.5 )\n#define isClusteredLightCookie(light) (light.cookie > 0.5 )\n#define isClusteredLightCookieRgb(light) (light.cookieRgb > 0.5 )\n#define isClusteredLightSpot(light) ( light.type > 0.5 )\n#define isClusteredLightFalloffLinear(light) ( light.falloffMode < 0.5 )\n#define isClusteredLightArea(light) ( light.shape > 0.1 )\n#define isClusteredLightRect(light) ( light.shape < 0.3 )\n#define isClusteredLightDisk(light) ( light.shape < 0.6 )\n#ifdef CLUSTER_MESH_DYNAMIC_LIGHTS\n\t#define acceptLightMask(light) ( light.mask < 0.75)\n#else\n\t#define acceptLightMask(light) ( light.mask > 0.25)\n#endif\nvec4 decodeClusterLowRange4Vec4(vec4 d0, vec4 d1, vec4 d2, vec4 d3) {\n\treturn vec4(\n\t\tbytes2floatRange4(d0, -2.0, 2.0),\n\t\tbytes2floatRange4(d1, -2.0, 2.0),\n\t\tbytes2floatRange4(d2, -2.0, 2.0),\n\t\tbytes2floatRange4(d3, -2.0, 2.0)\n\t);\n}\n#ifdef SUPPORTS_TEXLOD\n\t#define textureData(texture, uv) texture2DLodEXT(texture, uv, 0.0)\n#else\n\t#define textureData(texture, uv) texture2D(texture, uv)\n#endif\nvec4 sampleLightsTexture8(const ClusterLightData clusterLightData, float index) {\n\treturn textureData(lightsTexture8, vec2(index * lightsTextureInvSize.z, clusterLightData.lightV));\n}\nvec4 sampleLightTextureF(const ClusterLightData clusterLightData, float index) {\n\treturn textureData(lightsTextureFloat, vec2(index * lightsTextureInvSize.x, clusterLightData.lightV));\n}\nvoid decodeClusterLightCore(inout ClusterLightData clusterLightData, float lightIndex) {\n\tclusterLightData.lightV = (lightIndex + 0.5) * lightsTextureInvSize.w;\n\tvec4 lightInfo = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_FLAGS);\n\tclusterLightData.type = lightInfo.x;\n\tclusterLightData.shape = lightInfo.y;\n\tclusterLightData.falloffMode = lightInfo.z;\n\tclusterLightData.castShadows = lightInfo.w;\n\tvec4 colorA = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_COLOR_A);\n\tvec4 colorB = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_COLOR_B);\n\tclusterLightData.color = vec3(bytes2float2(colorA.xy), bytes2float2(colorA.zw), bytes2float2(colorB.xy)) * clusterCompressionLimit0.y;\n\tclusterLightData.cookie = colorB.z;\n\tclusterLightData.mask = colorB.w;\n\t#ifdef CLUSTER_TEXTURE_FLOAT\n\t\tvec4 lightPosRange = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_POSITION_RANGE);\n\t\tclusterLightData.position = lightPosRange.xyz;\n\t\tclusterLightData.range = lightPosRange.w;\n\t\tvec4 lightDir_Unused = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_SPOT_DIRECTION);\n\t\tclusterLightData.direction = lightDir_Unused.xyz;\n\t#else\n\t\tvec4 encPosX = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_POSITION_X);\n\t\tvec4 encPosY = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_POSITION_Y);\n\t\tvec4 encPosZ = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_POSITION_Z);\n\t\tclusterLightData.position = vec3(bytes2float4(encPosX), bytes2float4(encPosY), bytes2float4(encPosZ)) * clusterBoundsDelta + clusterBoundsMin;\n\t\tvec4 encRange = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_RANGE);\n\t\tclusterLightData.range = bytes2float4(encRange) * clusterCompressionLimit0.x;\n\t\tvec4 encDirX = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_SPOT_DIRECTION_X);\n\t\tvec4 encDirY = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_SPOT_DIRECTION_Y);\n\t\tvec4 encDirZ = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_SPOT_DIRECTION_Z);\n\t\tclusterLightData.direction = vec3(bytes2float4(encDirX), bytes2float4(encDirY), bytes2float4(encDirZ)) * 2.0 - 1.0;\n\t#endif\n}\nvoid decodeClusterLightSpot(inout ClusterLightData clusterLightData) {\n\tvec4 coneAngle = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_SPOT_ANGLES);\n\tclusterLightData.innerConeAngleCos = bytes2float2(coneAngle.xy) * 2.0 - 1.0;\n\tclusterLightData.outerConeAngleCos = bytes2float2(coneAngle.zw) * 2.0 - 1.0;\n}\nvoid decodeClusterLightOmniAtlasViewport(inout ClusterLightData clusterLightData) {\n\t#ifdef CLUSTER_TEXTURE_FLOAT\n\t\tclusterLightData.omniAtlasViewport = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_PROJ_MAT_0).xyz;\n\t#else\n\t\tvec4 viewportA = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_ATLAS_VIEWPORT_A);\n\t\tvec4 viewportB = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_ATLAS_VIEWPORT_B);\n\t\tclusterLightData.omniAtlasViewport = vec3(bytes2float2(viewportA.xy), bytes2float2(viewportA.zw), bytes2float2(viewportB.xy));\n\t#endif\n}\nvoid decodeClusterLightAreaData(inout ClusterLightData clusterLightData) {\n\t#ifdef CLUSTER_TEXTURE_FLOAT\n\t\tclusterLightData.halfWidth = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_AREA_DATA_WIDTH).xyz;\n\t\tclusterLightData.halfHeight = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_AREA_DATA_HEIGHT).xyz;\n\t#else\n\t\tvec4 areaWidthX = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_WIDTH_X);\n\t\tvec4 areaWidthY = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_WIDTH_Y);\n\t\tvec4 areaWidthZ = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_WIDTH_Z);\n\t\tclusterLightData.halfWidth = vec3(mantissaExponent2Float(areaWidthX), mantissaExponent2Float(areaWidthY), mantissaExponent2Float(areaWidthZ));\n\t\tvec4 areaHeightX = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_HEIGHT_X);\n\t\tvec4 areaHeightY = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_HEIGHT_Y);\n\t\tvec4 areaHeightZ = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_HEIGHT_Z);\n\t\tclusterLightData.halfHeight = vec3(mantissaExponent2Float(areaHeightX), mantissaExponent2Float(areaHeightY), mantissaExponent2Float(areaHeightZ));\n\t#endif\n}\nvoid decodeClusterLightProjectionMatrixData(inout ClusterLightData clusterLightData) {\n\t#ifdef CLUSTER_TEXTURE_FLOAT\n\t\tvec4 m0 = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_PROJ_MAT_0);\n\t\tvec4 m1 = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_PROJ_MAT_1);\n\t\tvec4 m2 = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_PROJ_MAT_2);\n\t\tvec4 m3 = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_PROJ_MAT_3);\n\t#else\n\t\tvec4 m00 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_00);\n\t\tvec4 m01 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_01);\n\t\tvec4 m02 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_02);\n\t\tvec4 m03 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_03);\n\t\tvec4 m0 = decodeClusterLowRange4Vec4(m00, m01, m02, m03);\n\t\tvec4 m10 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_10);\n\t\tvec4 m11 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_11);\n\t\tvec4 m12 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_12);\n\t\tvec4 m13 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_13);\n\t\tvec4 m1 = decodeClusterLowRange4Vec4(m10, m11, m12, m13);\n\t\tvec4 m20 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_20);\n\t\tvec4 m21 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_21);\n\t\tvec4 m22 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_22);\n\t\tvec4 m23 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_23);\n\t\tvec4 m2 = decodeClusterLowRange4Vec4(m20, m21, m22, m23);\n\t\tvec4 m30 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_30);\n\t\tvec4 m31 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_31);\n\t\tvec4 m32 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_32);\n\t\tvec4 m33 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_33);\n\t\tvec4 m3 = vec4(mantissaExponent2Float(m30), mantissaExponent2Float(m31), mantissaExponent2Float(m32), mantissaExponent2Float(m33));\n\t#endif\n\tlightProjectionMatrix = mat4(m0, m1, m2, m3);\n}\nvoid decodeClusterLightShadowData(inout ClusterLightData clusterLightData) {\n\tvec4 biases = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_SHADOW_BIAS);\n\tclusterLightData.shadowBias = bytes2floatRange2(biases.xy, -1.0, 20.0),\n\tclusterLightData.shadowNormalBias = bytes2float2(biases.zw);\n}\nvoid decodeClusterLightCookieData(inout ClusterLightData clusterLightData) {\n\tvec4 cookieA = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_COOKIE_A);\n\tclusterLightData.cookieIntensity = cookieA.x;\n\tclusterLightData.cookieRgb = cookieA.y;\n\tclusterLightData.cookieChannelMask = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_COOKIE_B);\n}\nvoid evaluateLight(ClusterLightData light) {\n\tdAtten3 = vec3(1.0);\n\tgetLightDirPoint(light.position);\n\t#ifdef CLUSTER_AREALIGHTS\n\tif (isClusteredLightArea(light)) {\n\t\tdecodeClusterLightAreaData(light);\n\t\tif (LTCLightValuesEvaluated < 0.5) {\n\t\t\tLTCLightValuesEvaluated = 1.0;\n\t\t\tcalcLTCLightValues();\n\t\t}\n\t\tif (isClusteredLightRect(light)) {\n\t\t\tcalcRectLightValues(light.position, light.halfWidth, light.halfHeight);\n\t\t} else if (isClusteredLightDisk(light)) {\n\t\t\tcalcDiskLightValues(light.position, light.halfWidth, light.halfHeight);\n\t\t} else {\n\t\t\tcalcSphereLightValues(light.position, light.halfWidth, light.halfHeight);\n\t\t}\n\t\tdAtten = getFalloffWindow(light.range);\n\t} else\n\t#endif\n\t{\n\t\tif (isClusteredLightFalloffLinear(light))\n\t\t\tdAtten = getFalloffLinear(light.range);\n\t\telse\n\t\t\tdAtten = getFalloffInvSquared(light.range);\n\t}\n\tif (dAtten > 0.00001) {\n\t\t#ifdef CLUSTER_AREALIGHTS\n\t\tif (isClusteredLightArea(light)) {\n\t\t\tif (isClusteredLightRect(light)) {\n\t\t\t\tdAttenD = getRectLightDiffuse() * 16.0;\n\t\t\t} else if (isClusteredLightDisk(light)) {\n\t\t\t\tdAttenD = getDiskLightDiffuse() * 16.0;\n\t\t\t} else {\n\t\t\t\tdAttenD = getSphereLightDiffuse() * 16.0;\n\t\t\t}\n\t\t} else\n\t\t#endif\n\t\t{\n\t\t\tdAtten *= getLightDiffuse();\n\t\t}\n\t\tif (isClusteredLightSpot(light)) {\n\t\t\tdecodeClusterLightSpot(light);\n\t\t\tdAtten *= getSpotEffect(light.direction, light.innerConeAngleCos, light.outerConeAngleCos);\n\t\t}\n\t\t#if defined(CLUSTER_COOKIES) || defined(CLUSTER_SHADOWS)\n\t\tif (dAtten > 0.00001) {\n\t\t\tif (isClusteredLightCastShadow(light) || isClusteredLightCookie(light)) {\n\t\t\t\tif (isClusteredLightSpot(light)) {\n\t\t\t\t\tdecodeClusterLightProjectionMatrixData(light);\n\t\t\t\t} else {\n\t\t\t\t\tdecodeClusterLightOmniAtlasViewport(light);\n\t\t\t\t}\n\t\t\t\tfloat shadowTextureResolution = shadowAtlasParams.x;\n\t\t\t\tfloat shadowEdgePixels = shadowAtlasParams.y;\n\t\t\t\t#ifdef CLUSTER_COOKIES\n\t\t\t\tif (isClusteredLightCookie(light)) {\n\t\t\t\t\tdecodeClusterLightCookieData(light);\n\t\t\t\t\tif (isClusteredLightSpot(light)) {\n\t\t\t\t\t\tdAtten3 = getCookie2DClustered(cookieAtlasTexture, lightProjectionMatrix, vPositionW, light.cookieIntensity, isClusteredLightCookieRgb(light), light.cookieChannelMask);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdAtten3 = getCookieCubeClustered(cookieAtlasTexture, dLightDirW, light.cookieIntensity, isClusteredLightCookieRgb(light), light.cookieChannelMask, shadowTextureResolution, shadowEdgePixels, light.omniAtlasViewport);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t#endif\n\t\t\t\t#ifdef CLUSTER_SHADOWS\n\t\t\t\tif (isClusteredLightCastShadow(light)) {\n\t\t\t\t\tdecodeClusterLightShadowData(light);\n\t\t\t\t\tvec4 shadowParams = vec4(shadowTextureResolution, light.shadowNormalBias, light.shadowBias, 1.0 / light.range);\n\t\t\t\t\tif (isClusteredLightSpot(light)) {\n\t\t\t\t\t\tgetShadowCoordPerspZbufferNormalOffset(lightProjectionMatrix, shadowParams);\n\t\t\t\t\t\t#if defined(CLUSTER_SHADOW_TYPE_PCF1)\n\t\t\t\t\t\t\tdAtten *= getShadowSpotClusteredPCF1(shadowAtlasTexture, shadowParams);\n\t\t\t\t\t\t#elif defined(CLUSTER_SHADOW_TYPE_PCF3)\n\t\t\t\t\t\t\tdAtten *= getShadowSpotClusteredPCF3(shadowAtlasTexture, shadowParams);\n\t\t\t\t\t\t#elif defined(CLUSTER_SHADOW_TYPE_PCF5)\n\t\t\t\t\t\t\tdAtten *= getShadowSpotClusteredPCF5(shadowAtlasTexture, shadowParams);\n\t\t\t\t\t\t#endif\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnormalOffsetPointShadow(shadowParams);\n\t\t\t\t\t\t#if defined(CLUSTER_SHADOW_TYPE_PCF1)\n\t\t\t\t\t\t\tdAtten *= getShadowOmniClusteredPCF1(shadowAtlasTexture, shadowParams, light.omniAtlasViewport, shadowEdgePixels, dLightDirW);\n\t\t\t\t\t\t#elif defined(CLUSTER_SHADOW_TYPE_PCF3)\n\t\t\t\t\t\t\tdAtten *= getShadowOmniClusteredPCF3(shadowAtlasTexture, shadowParams, light.omniAtlasViewport, shadowEdgePixels, dLightDirW);\n\t\t\t\t\t\t#elif defined(CLUSTER_SHADOW_TYPE_PCF5)\n\t\t\t\t\t\t\tdAtten *= getShadowOmniClusteredPCF5(shadowAtlasTexture, shadowParams, light.omniAtlasViewport, shadowEdgePixels, dLightDirW);\n\t\t\t\t\t\t#endif\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t#endif\n\t\t\t}\n\t\t}\n\t\t#endif\n\t\t#ifdef CLUSTER_AREALIGHTS\n\t\tif (isClusteredLightArea(light)) {\n\t\t\t{\n\t\t\t\tvec3 areaDiffuse = (dAttenD * dAtten) * light.color * dAtten3;\n\t\t\t\t#if defined(CLUSTER_SPECULAR) && defined(CLUSTER_CONSERVE_ENERGY)\n\t\t\t\t\tareaDiffuse = mix(areaDiffuse, vec3(0), dLTCSpecFres);\n\t\t\t\t#endif\n\t\t\t\tdDiffuseLight += areaDiffuse;\n\t\t\t}\n\t\t\t#ifdef CLUSTER_SPECULAR\n\t\t\t\tfloat areaLightSpecular;\n\t\t\t\tif (isClusteredLightRect(light)) {\n\t\t\t\t\tareaLightSpecular = getRectLightSpecular();\n\t\t\t\t} else if (isClusteredLightDisk(light)) {\n\t\t\t\t\tareaLightSpecular = getDiskLightSpecular();\n\t\t\t\t} else {\n\t\t\t\t\tareaLightSpecular = getSphereLightSpecular();\n\t\t\t\t}\n\t\t\t\tdSpecularLight += dLTCSpecFres * areaLightSpecular * dAtten * light.color * dAtten3;\n\t\t\t\t#ifdef CLUSTER_CLEAR_COAT\n\t\t\t\t\tfloat areaLightSpecularCC;\n\t\t\t\t\tif (isClusteredLightRect(light)) {\n\t\t\t\t\t\tareaLightSpecularCC = getRectLightSpecularCC();\n\t\t\t\t\t} else if (isClusteredLightDisk(light)) {\n\t\t\t\t\t\tareaLightSpecularCC = getDiskLightSpecularCC();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tareaLightSpecularCC = getSphereLightSpecularCC();\n\t\t\t\t\t}\n\t\t\t\t\tccSpecularLight += ccLTCSpecFres * areaLightSpecularCC * dAtten * light.color\t* dAtten3;\n\t\t\t\t#endif\n\t\t\t#endif\n\t\t} else\n\t\t#endif\n\t\t{\n\t\t\t{\n\t\t\t\tvec3 punctualDiffuse = dAtten * light.color * dAtten3;\n\t\t\t\t#if defined(CLUSTER_AREALIGHTS) && defined(CLUSTER_SPECULAR) && defined(CLUSTER_CONSERVE_ENERGY)\n\t\t\t\t\tpunctualDiffuse = mix(punctualDiffuse, vec3(0), dSpecularity);\n\t\t\t\t#endif\n\t\t\t\tdDiffuseLight += punctualDiffuse;\n\t\t\t}\n\t\t\t#ifdef CLUSTER_SPECULAR\n\t\t\t\t{\n\t\t\t\t\tvec3 punctualSpecular = getLightSpecular() * dAtten * light.color * dAtten3;\n\t\t\t\t\t#if defined(CLUSTER_AREALIGHTS)\n\t\t\t\t\t\tpunctualSpecular *= dSpecularity;\n\t\t\t\t\t#endif\n\t\t\t\t\tdSpecularLight += punctualSpecular;\n\t\t\t\t}\n\t\t\t\t#ifdef CLUSTER_CLEAR_COAT\n\t\t\t\t\tvec3 punctualCC = getLightSpecularCC() * dAtten * light.color * dAtten3;\n\t\t\t\t\t#if defined(CLUSTER_AREALIGHTS)\n\t\t\t\t\t\tpunctualCC *= ccSpecularity;\n\t\t\t\t\t#endif\n\t\t\t\t\tccSpecularLight += punctualCC;\n\t\t\t\t#endif\n\t\t\t#endif\n\t\t}\n\t}\n}\nvoid evaluateClusterLight(float lightIndex) {\n\tClusterLightData clusterLightData;\n\tdecodeClusterLightCore(clusterLightData, lightIndex);\n\tif (acceptLightMask(clusterLightData))\n\t\tevaluateLight(clusterLightData);\n}\nvoid addClusteredLights() {\n\tvec3 cellCoords = floor((vPositionW - clusterBoundsMin) * clusterCellsCountByBoundsSize);\n\tif (!(any(lessThan(cellCoords, vec3(0.0))) || any(greaterThanEqual(cellCoords, clusterCellsMax)))) {\n\t\tfloat cellIndex = dot(clusterCellsDot, cellCoords);\n\t\tfloat clusterV = floor(cellIndex * clusterTextureSize.y);\n\t\tfloat clusterU = cellIndex - (clusterV * clusterTextureSize.x);\n\t\tclusterV = (clusterV + 0.5) * clusterTextureSize.z;\n\t\tconst float maxLightCells = 256.0 / 4.0;\n\t\tfor (float lightCellIndex = 0.5; lightCellIndex < maxLightCells; lightCellIndex++) {\n\t\t\tvec4 lightIndices = textureData(clusterWorldTexture, vec2(clusterTextureSize.y * (clusterU + lightCellIndex), clusterV));\n\t\t\tvec4 indices = lightIndices * 255.0;\n\t\t\tfor (int i = 0; i < 4; i++) {\n\t\t\t\tif (indices.x <= 0.0)\n\t\t\t\t\treturn;\n\t\t\t\tevaluateClusterLight(indices.x);\n\t\t\t\tindices = indices.yzwx;\n\t\t\t}\n\t\t\tif (lightCellIndex > clusterPixelsPerCell) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n",combineClearCoatPS:"vec3 combineColorCC() {\n\treturn combineColor()+(ccSpecularLight*ccSpecularity+ccReflection.rgb*ccSpecularity*ccReflection.a);\n}\n",combineDiffusePS:"vec3 combineColor() {\n\treturn dAlbedo * dDiffuseLight;\n}\n",combineDiffuseSpecularPS:"vec3 combineColor() {\n\treturn mix(dAlbedo * dDiffuseLight, dSpecularLight + dReflection.rgb * dReflection.a, dSpecularity);\n}\n",combineDiffuseSpecularNoConservePS:"vec3 combineColor() {\n\treturn dAlbedo * dDiffuseLight + (dSpecularLight + dReflection.rgb * dReflection.a) * dSpecularity;\n}\n",combineDiffuseSpecularNoReflPS:"vec3 combineColor() {\n\treturn dAlbedo * dDiffuseLight + dSpecularLight * dSpecularity;\n}\n",combineDiffuseSpecularNoReflSeparateAmbientPS:"uniform vec3 material_ambient;\nvec3 combineColor() {\n\treturn (dDiffuseLight - light_globalAmbient) * dAlbedo + dSpecularLight * dSpecularity + material_ambient * light_globalAmbient;\n}\n",combineDiffuseSpecularOldPS:"vec3 combineColor() {\n\treturn mix(dAlbedo * dDiffuseLight + dSpecularLight * dSpecularity, dReflection.rgb, dReflection.a);\n}\n",cookiePS:"vec4 getCookie2D(sampler2D tex, mat4 transform, float intensity) {\n\tvec4 projPos = transform * vec4(vPositionW, 1.0);\n\tprojPos.xy /= projPos.w;\n\treturn mix(vec4(1.0), texture2D(tex, projPos.xy), intensity);\n}\nvec4 getCookie2DClip(sampler2D tex, mat4 transform, float intensity) {\n\tvec4 projPos = transform * vec4(vPositionW, 1.0);\n\tprojPos.xy /= projPos.w;\n\tif (projPos.x < 0.0 || projPos.x > 1.0 || projPos.y < 0.0 || projPos.y > 1.0 || projPos.z < 0.0) return vec4(0.0);\n\treturn mix(vec4(1.0), texture2D(tex, projPos.xy), intensity);\n}\nvec4 getCookie2DXform(sampler2D tex, mat4 transform, float intensity, vec4 cookieMatrix, vec2 cookieOffset) {\n\tvec4 projPos = transform * vec4(vPositionW, 1.0);\n\tprojPos.xy /= projPos.w;\n\tprojPos.xy += cookieOffset;\n\tvec2 uv = mat2(cookieMatrix) * (projPos.xy-vec2(0.5)) + vec2(0.5);\n\treturn mix(vec4(1.0), texture2D(tex, uv), intensity);\n}\nvec4 getCookie2DClipXform(sampler2D tex, mat4 transform, float intensity, vec4 cookieMatrix, vec2 cookieOffset) {\n\tvec4 projPos = transform * vec4(vPositionW, 1.0);\n\tprojPos.xy /= projPos.w;\n\tprojPos.xy += cookieOffset;\n\tif (projPos.x < 0.0 || projPos.x > 1.0 || projPos.y < 0.0 || projPos.y > 1.0 || projPos.z < 0.0) return vec4(0.0);\n\tvec2 uv = mat2(cookieMatrix) * (projPos.xy-vec2(0.5)) + vec2(0.5);\n\treturn mix(vec4(1.0), texture2D(tex, uv), intensity);\n}\nvec4 getCookieCube(samplerCube tex, mat4 transform, float intensity) {\n\treturn mix(vec4(1.0), textureCube(tex, dLightDirNormW * mat3(transform)), intensity);\n}\n",cubeMapProjectBoxPS:"uniform vec3 envBoxMin, envBoxMax;\nvec3 cubeMapProject(vec3 nrdir) {\n\tnrdir = cubeMapRotate(nrdir);\n\tvec3 rbmax = (envBoxMax - vPositionW) / nrdir;\n\tvec3 rbmin = (envBoxMin - vPositionW) / nrdir;\n\tvec3 rbminmax;\n\trbminmax.x = nrdir.x>0.0? rbmax.x : rbmin.x;\n\trbminmax.y = nrdir.y>0.0? rbmax.y : rbmin.y;\n\trbminmax.z = nrdir.z>0.0? rbmax.z : rbmin.z;\n\tfloat fa = min(min(rbminmax.x, rbminmax.y), rbminmax.z);\n\tvec3 posonbox = vPositionW + nrdir * fa;\n\tvec3 envBoxPos = (envBoxMin + envBoxMax) * 0.5;\n\treturn normalize(posonbox - envBoxPos);\n}\n",cubeMapProjectNonePS:"vec3 cubeMapProject(vec3 dir) {\n\treturn cubeMapRotate(dir);\n}\n",cubeMapRotatePS:"#ifdef CUBEMAP_ROTATION\nuniform mat3 cubeMapRotationMatrix;\n#endif\nvec3 cubeMapRotate(vec3 refDir) {\n#ifdef CUBEMAP_ROTATION\n\treturn refDir * cubeMapRotationMatrix;\n#else\n\treturn refDir;\n#endif\n}\n",detailModesPS:"vec3 detailMode_mul(vec3 c1, vec3 c2) {\n\treturn c1 * c2;\n}\nvec3 detailMode_add(vec3 c1, vec3 c2) {\n\treturn c1 + c2;\n}\nvec3 detailMode_screen(vec3 c1, vec3 c2) {\n\treturn 1.0 - (1.0 - c1)*(1.0 - c2);\n}\nvec3 detailMode_overlay(vec3 c1, vec3 c2) {\n\treturn mix(1.0 - 2.0*(1.0 - c1)*(1.0 - c2), 2.0*c1*c2, step(c1, vec3(0.5)));\n}\nvec3 detailMode_min(vec3 c1, vec3 c2) {\n\treturn min(c1, c2);\n}\nvec3 detailMode_max(vec3 c1, vec3 c2) {\n\treturn max(c1, c2);\n}\n",diffusePS:"#ifdef MAPCOLOR\nuniform vec3 material_diffuse;\n#endif\n#ifdef MAPTEXTURE\nuniform sampler2D texture_diffuseMap;\n#endif\nvoid getAlbedo() {\n\tdAlbedo = vec3(1.0);\n\t#ifdef MAPCOLOR\n\tdAlbedo *= material_diffuse.rgb;\n\t#endif\n\t#ifdef MAPTEXTURE\n\tdAlbedo *= gammaCorrectInput(addAlbedoDetail(texture2D(texture_diffuseMap, $UV, textureBias).$CH));\n\t#endif\n\t#ifdef MAPVERTEX\n\tdAlbedo *= gammaCorrectInput(saturate(vVertexColor.$VC));\n\t#endif\n}\n",diffuseDetailMapPS:"#ifdef MAPTEXTURE\nuniform sampler2D texture_diffuseDetailMap;\n#endif\nvec3 addAlbedoDetail(vec3 albedo) {\n\t#ifdef MAPTEXTURE\n\tvec3 albedoDetail = vec3(texture2D(texture_diffuseDetailMap, $UV, textureBias).$CH);\n\treturn detailMode_$DETAILMODE(albedo, albedoDetail);\n\t#else\n\treturn albedo;\n\t#endif\n}\n",dilatePS:"#define SHADER_NAME Dilate\nvarying vec2 vUv0;\nuniform sampler2D source;\nuniform vec2 pixelOffset;\nvoid main(void) {\n\tvec4 c = texture2D(source, vUv0);\n\tc = c.a>0.0? c : texture2D(source, vUv0 - pixelOffset);\n\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(0, -pixelOffset.y));\n\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(pixelOffset.x, -pixelOffset.y));\n\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(-pixelOffset.x, 0));\n\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(pixelOffset.x, 0));\n\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(-pixelOffset.x, pixelOffset.y));\n\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(0, pixelOffset.y));\n\tc = c.a>0.0? c : texture2D(source, vUv0 + pixelOffset);\n\tgl_FragColor = c;\n}\n",bilateralDeNoisePS:"#define SHADER_NAME BilateralDeNoise\nfloat normpdf3(in vec3 v, in float sigma) {\n\treturn 0.39894 * exp(-0.5 * dot(v, v) / (sigma * sigma)) / sigma;\n}\nvec3 decodeRGBM(vec4 rgbm) {\n\tvec3 color = (8.0 * rgbm.a) * rgbm.rgb;\n\treturn color * color;\n}\nfloat saturate(float x) {\n\treturn clamp(x, 0.0, 1.0);\n}\nvec4 encodeRGBM(vec3 color) {\n\tvec4 encoded;\n\tencoded.rgb = pow(color.rgb, vec3(0.5));\n\tencoded.rgb *= 1.0 / 8.0;\n\tencoded.a = saturate( max( max( encoded.r, encoded.g ), max( encoded.b, 1.0 / 255.0 ) ) );\n\tencoded.a = ceil(encoded.a * 255.0) / 255.0;\n\tencoded.rgb /= encoded.a;\n\treturn encoded;\n}\n#define MSIZE 15\nvarying vec2 vUv0;\nuniform sampler2D source;\nuniform vec2 pixelOffset;\nuniform vec2 sigmas;\nuniform float bZnorm;\nuniform float kernel[MSIZE];\nvoid main(void) {\n\tvec4 pixelRgbm = texture2D(source, vUv0);\n\tif (pixelRgbm.a <= 0.0) {\n\t\tgl_FragColor = pixelRgbm;\n\t\treturn ;\n\t}\n\tfloat sigma = sigmas.x;\n\tfloat bSigma = sigmas.y;\n\tvec3 pixelHdr = decodeRGBM(pixelRgbm);\n\tvec3 accumulatedHdr = vec3(0.0);\n\tfloat accumulatedFactor = 0.0;\n\tconst int kSize = (MSIZE-1)/2;\n\tfor (int i = -kSize; i <= kSize; ++i) {\n\t\tfor (int j = -kSize; j <= kSize; ++j) {\n\t\t\tvec2 coord = vUv0 + vec2(float(i), float(j)) * pixelOffset;\n\t\t\tvec4 rgbm = texture2D(source, coord);\n\t\t\tif (rgbm.a > 0.0) {\n\t\t\t\tvec3 hdr = decodeRGBM(rgbm);\n\t\t\t\tfloat factor = kernel[kSize + j] * kernel[kSize + i];\n\t\t\t\tfactor *= normpdf3(hdr - pixelHdr, bSigma) * bZnorm;\n\t\t\t\taccumulatedHdr += factor * hdr;\n\t\t\t\taccumulatedFactor += factor;\n\t\t\t}\n\t\t}\n\t}\n\tgl_FragColor = encodeRGBM(accumulatedHdr / accumulatedFactor);\n}\n",decodePS:"vec3 decodeLinear(vec4 raw) {\n\treturn raw.rgb;\n}\nvec3 decodeGamma(vec4 raw) {\n\treturn pow(raw.xyz, vec3(2.2));\n}\nvec3 decodeRGBM(vec4 raw) {\n\tvec3 color = (8.0 * raw.a) * raw.rgb;\n\treturn color * color;\n}\nvec3 decodeRGBE(vec4 raw) {\n\tif (raw.a == 0.0) {\n\t\treturn vec3(0.0, 0.0, 0.0);\n\t} else {\n\t\treturn raw.xyz * pow(2.0, raw.w * 255.0 - 128.0);\n\t}\n}\nconst float PI = 3.141592653589793;\nvec2 toSpherical(vec3 dir) {\n\treturn vec2(dir.xz == vec2(0.0) ? 0.0 : atan(dir.x, dir.z), asin(dir.y));\n}\nvec2 toSphericalUv(vec3 dir) {\n\tvec2 uv = toSpherical(dir) / vec2(PI * 2.0, PI) + 0.5;\n\treturn vec2(uv.x, 1.0 - uv.y);\n}\nconst float atlasSize = 512.0;\nconst float seamSize = 1.0 / atlasSize;\nvec2 mapUv(vec2 uv, vec4 rect) {\n\treturn vec2(mix(rect.x + seamSize, rect.x + rect.z - seamSize, uv.x),\n\t\t\t\tmix(rect.y + seamSize, rect.y + rect.w - seamSize, uv.y));\n}\nvec2 mapRoughnessUv(vec2 uv, float level) {\n\tfloat t = 1.0 / exp2(level);\n\treturn mapUv(uv, vec4(0, 1.0 - t, t, t * 0.5));\n}\nvec2 mapMip(vec2 uv, float level) {\n\tfloat t = 1.0 / exp2(level);\n\treturn mapUv(uv, vec4(1.0 - t, 1.0 - t, t, t * 0.5));\n}\n",emissivePS:"#ifdef MAPCOLOR\nuniform vec3 material_emissive;\n#endif\n#ifdef MAPFLOAT\nuniform float material_emissiveIntensity;\n#endif\n#ifdef MAPTEXTURE\nuniform sampler2D texture_emissiveMap;\n#endif\nvec3 getEmission() {\n\tvec3 emission = vec3(1.0);\n\t#ifdef MAPFLOAT\n\temission *= material_emissiveIntensity;\n\t#endif\n\t#ifdef MAPCOLOR\n\temission *= material_emissive;\n\t#endif\n\t#ifdef MAPTEXTURE\n\temission *= $texture2DSAMPLE(texture_emissiveMap, $UV, textureBias).$CH;\n\t#endif\n\t#ifdef MAPVERTEX\n\temission *= gammaCorrectInput(saturate(vVertexColor.$VC));\n\t#endif\n\treturn emission;\n}\n",endPS:"\t#ifdef CLEARCOAT\n\tgl_FragColor.rgb = combineColorCC();\n\t#else\n\tgl_FragColor.rgb = combineColor();\n\t#endif\n\tgl_FragColor.rgb += getEmission();\n\tgl_FragColor.rgb = addFog(gl_FragColor.rgb);\n\t#ifndef HDR\n\tgl_FragColor.rgb = toneMap(gl_FragColor.rgb);\n\tgl_FragColor.rgb = gammaCorrectOutput(gl_FragColor.rgb);\n\t#endif\n",endVS:"\n",envConstPS:"vec3 processEnvironment(vec3 color) {\n\treturn color;\n}\n",envMultiplyPS:"uniform float skyboxIntensity;\nvec3 processEnvironment(vec3 color) {\n\treturn color * skyboxIntensity;\n}\n",extensionPS:"\n",extensionVS:"\n",falloffInvSquaredPS:"float getFalloffWindow(float lightRadius) {\n\tfloat sqrDist = dot(dLightDirW, dLightDirW);\n\tfloat invRadius = 1.0 / lightRadius;\n\treturn square( saturate( 1.0 - square( sqrDist * square(invRadius) ) ) );\n}\nfloat getFalloffInvSquared(float lightRadius) {\n\tfloat sqrDist = dot(dLightDirW, dLightDirW);\n\tfloat falloff = 1.0 / (sqrDist + 1.0);\n\tfloat invRadius = 1.0 / lightRadius;\n\tfalloff *= 16.0;\n\tfalloff *= square( saturate( 1.0 - square( sqrDist * square(invRadius) ) ) );\n\treturn falloff;\n}\n",falloffLinearPS:"float getFalloffLinear(float lightRadius) {\n\tfloat d = length(dLightDirW);\n\treturn max(((lightRadius - d) / lightRadius), 0.0);\n}\n",fixCubemapSeamsNonePS:"vec3 fixSeams(vec3 vec, float mipmapIndex) {\n\treturn vec;\n}\nvec3 fixSeams(vec3 vec) {\n\treturn vec;\n}\nvec3 fixSeamsStatic(vec3 vec, float invRecMipSize) {\n\treturn vec;\n}\nvec3 calcSeam(vec3 vec) {\n\treturn vec3(0);\n}\nvec3 applySeam(vec3 vec, vec3 seam, float scale) {\n\treturn vec;\n}\n",fixCubemapSeamsStretchPS:"vec3 fixSeams(vec3 vec, float mipmapIndex) {\n\tvec3 avec = abs(vec);\n\tfloat scale = 1.0 - exp2(mipmapIndex) / 128.0;\n\tfloat M = max(max(avec.x, avec.y), avec.z);\n\tif (avec.x != M) vec.x *= scale;\n\tif (avec.y != M) vec.y *= scale;\n\tif (avec.z != M) vec.z *= scale;\n\treturn vec;\n}\nvec3 fixSeams(vec3 vec) {\n\tvec3 avec = abs(vec);\n\tfloat scale = 1.0 - 1.0 / 128.0;\n\tfloat M = max(max(avec.x, avec.y), avec.z);\n\tif (avec.x != M) vec.x *= scale;\n\tif (avec.y != M) vec.y *= scale;\n\tif (avec.z != M) vec.z *= scale;\n\treturn vec;\n}\nvec3 fixSeamsStatic(vec3 vec, float invRecMipSize) {\n\tvec3 avec = abs(vec);\n\tfloat scale = invRecMipSize;\n\tfloat M = max(max(avec.x, avec.y), avec.z);\n\tif (avec.x != M) vec.x *= scale;\n\tif (avec.y != M) vec.y *= scale;\n\tif (avec.z != M) vec.z *= scale;\n\treturn vec;\n}\nvec3 calcSeam(vec3 vec) {\n\tvec3 avec = abs(vec);\n\tfloat M = max(avec.x, max(avec.y, avec.z));\n\treturn vec3(avec.x != M ? 1.0 : 0.0,\n\t\t\t\tavec.y != M ? 1.0 : 0.0,\n\t\t\t\tavec.z != M ? 1.0 : 0.0);\n}\nvec3 applySeam(vec3 vec, vec3 seam, float scale) {\n\treturn vec * (seam * -scale + vec3(1.0));\n}\n",floatUnpackingPS:"float bytes2float2(vec2 data) {\n\treturn dot(data, vec2(1.0, 1.0 / 255.0));\n}\nfloat bytes2float3(vec3 data) {\n\treturn dot(data, vec3(1.0, 1.0 / 255.0, 1.0 / 65025.0));\n}\nfloat bytes2float4(vec4 data) {\n\treturn dot(data, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));\n}\nfloat bytes2floatRange2(vec2 data, float min, float max) {\n\treturn mix(min, max, bytes2float2(data));\n}\nfloat bytes2floatRange3(vec3 data, float min, float max) {\n\treturn mix(min, max, bytes2float3(data));\n}\nfloat bytes2floatRange4(vec4 data, float min, float max) {\n\treturn mix(min, max, bytes2float4(data));\n}\nfloat mantissaExponent2Float(vec4 pack)\n{\n\tfloat value = bytes2floatRange3(pack.xyz, -1.0, 1.0);\n\tfloat exponent = floor(pack.w * 255.0 - 127.0);\n\treturn value * exp2(exponent);\n}\n",fogExpPS:"uniform vec3 fog_color;\nuniform float fog_density;\nfloat dBlendModeFogFactor = 1.0;\nvec3 addFog(vec3 color) {\n\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\tfloat fogFactor = exp(-depth * fog_density);\n\tfogFactor = clamp(fogFactor, 0.0, 1.0);\n\treturn mix(fog_color * dBlendModeFogFactor, color, fogFactor);\n}\n",fogExp2PS:"uniform vec3 fog_color;\nuniform float fog_density;\nfloat dBlendModeFogFactor = 1.0;\nvec3 addFog(vec3 color) {\n\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\tfloat fogFactor = exp(-depth * depth * fog_density * fog_density);\n\tfogFactor = clamp(fogFactor, 0.0, 1.0);\n\treturn mix(fog_color * dBlendModeFogFactor, color, fogFactor);\n}\n",fogLinearPS:"uniform vec3 fog_color;\nuniform float fog_start;\nuniform float fog_end;\nfloat dBlendModeFogFactor = 1.0;\nvec3 addFog(vec3 color) {\n\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\tfloat fogFactor = (fog_end - depth) / (fog_end - fog_start);\n\tfogFactor = clamp(fogFactor, 0.0, 1.0);\n\tfogFactor = gammaCorrectInput(fogFactor);\n\treturn mix(fog_color * dBlendModeFogFactor, color, fogFactor);\n}\n",fogNonePS:"float dBlendModeFogFactor = 1.0;\nvec3 addFog(vec3 color) {\n\treturn color;\n}\n",fresnelSchlickPS:"uniform float material_fresnelFactor;\nvoid getFresnel() {\n\tfloat fresnel = 1.0 - max(dot(dNormalW, dViewDirW), 0.0);\n\tfloat fresnel2 = fresnel * fresnel;\n\tfresnel *= fresnel2 * fresnel2;\n\tfresnel *= dGlossiness * dGlossiness;\n\tdSpecularity = dSpecularity + (1.0 - dSpecularity) * fresnel;\n\t#ifdef CLEARCOAT\n\tfresnel = 1.0 - max(dot(ccNormalW, dViewDirW), 0.0);\n\tfresnel2 = fresnel * fresnel;\n\tfresnel *= fresnel2 * fresnel2;\n\tfresnel *= ccGlossiness * ccGlossiness;\n\tccSpecularity = ccSpecularity + (1.0 - ccSpecularity) * fresnel;\n\t#endif\n}\n",fullscreenQuadPS:"varying vec2 vUv0;\nuniform sampler2D source;\nvoid main(void) {\n\tgl_FragColor = texture2D(source, vUv0);\n}\n",fullscreenQuadVS:"attribute vec2 vertex_position;\nvarying vec2 vUv0;\nvoid main(void)\n{\n\tgl_Position = vec4(vertex_position, 0.5, 1.0);\n\tvUv0 = vertex_position.xy*0.5+0.5;\n}\n",gamma1_0PS:"vec4 texture2DSRGB(sampler2D tex, vec2 uv) {\n\treturn texture2D(tex, uv);\n}\nvec4 texture2DSRGB(sampler2D tex, vec2 uv, float bias) {\n\treturn texture2D(tex, uv, bias);\n}\nvec4 textureCubeSRGB(samplerCube tex, vec3 uvw) {\n\treturn textureCube(tex, uvw);\n}\nvec3 gammaCorrectOutput(vec3 color) {\n\treturn color;\n}\nvec3 gammaCorrectInput(vec3 color) {\n\treturn color;\n}\nfloat gammaCorrectInput(float color) {\n\treturn color;\n}\nvec4 gammaCorrectInput(vec4 color) {\n\treturn color;\n}\n",gamma2_2PS:"vec3 gammaCorrectInput(vec3 color) {\n\treturn pow(color, vec3(2.2));\n}\nfloat gammaCorrectInput(float color) {\n\treturn pow(color, 2.2);\n}\nvec4 gammaCorrectInput(vec4 color) {\n\treturn vec4(pow(color.rgb, vec3(2.2)), color.a);\n}\nvec4 texture2DSRGB(sampler2D tex, vec2 uv) {\n\tvec4 rgba = texture2D(tex, uv);\n\trgba.rgb = gammaCorrectInput(rgba.rgb);\n\treturn rgba;\n}\nvec4 texture2DSRGB(sampler2D tex, vec2 uv, float bias) {\n\tvec4 rgba = texture2D(tex, uv, bias);\n\trgba.rgb = gammaCorrectInput(rgba.rgb);\n\treturn rgba;\n}\nvec4 textureCubeSRGB(samplerCube tex, vec3 uvw) {\n\tvec4 rgba = textureCube(tex, uvw);\n\trgba.rgb = gammaCorrectInput(rgba.rgb);\n\treturn rgba;\n}\nvec3 gammaCorrectOutput(vec3 color) {\n\t#ifdef HDR\n\treturn color;\n\t#else\n\tcolor += vec3(0.0000001);\n\treturn pow(color, vec3(0.45));\n\t#endif\n}\n",gles3PS:"#define varying in\nout highp vec4 pc_fragColor;\n#define gl_FragColor pc_fragColor\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad\n#define GL2\n#define SUPPORTS_TEXLOD\n",gles3VS:"#define attribute in\n#define varying out\n#define texture2D texture\n#define GL2\n#define VERTEXSHADER\n",glossPS:"#ifdef MAPFLOAT\nuniform float material_shininess;\n#endif\n#ifdef MAPTEXTURE\nuniform sampler2D texture_glossMap;\n#endif\nvoid getGlossiness() {\n\tdGlossiness = 1.0;\n\t#ifdef MAPFLOAT\n\tdGlossiness *= material_shininess;\n\t#endif\n\t#ifdef MAPTEXTURE\n\tdGlossiness *= texture2D(texture_glossMap, $UV, textureBias).$CH;\n\t#endif\n\t#ifdef MAPVERTEX\n\tdGlossiness *= saturate(vVertexColor.$VC);\n\t#endif\n\tdGlossiness += 0.0000001;\n}\n",instancingVS:"attribute vec4 instance_line1;\nattribute vec4 instance_line2;\nattribute vec4 instance_line3;\nattribute vec4 instance_line4;\n",lightDiffuseLambertPS:"float getLightDiffuse() {\n\treturn max(dot(dNormalW, -dLightDirNormW), 0.0);\n}\n",lightDirPointPS:"void getLightDirPoint(vec3 lightPosW) {\n\tdLightDirW = vPositionW - lightPosW;\n\tdLightDirNormW = normalize(dLightDirW);\n\tdLightPosW = lightPosW;\n}\n",lightmapDirPS:"uniform sampler2D texture_lightMap;\nuniform sampler2D texture_dirLightMap;\nvoid addLightMap() {\n\tvec3 color = $texture2DSAMPLE(texture_lightMap, $UV, textureBias).$CH;\n\tvec3 dir = texture2D(texture_dirLightMap, $UV, textureBias).xyz;\n\tif (dot(dir, vec3(1.0)) < 0.00001) {\n\t\tdDiffuseLight += color;\n\t} else {\n\t\tdLightDirNormW = normalize(dir * 2.0 - vec3(1.0));\n\t\tfloat vlight = saturate(dot(dLightDirNormW, -dVertexNormalW));\n\t\tfloat flight = saturate(dot(dLightDirNormW, -dNormalW));\n\t\tfloat nlight = (flight / max(vlight, 0.01)) * 0.5;\n\t\tdDiffuseLight += color * nlight * 2.0;\n\t}\n\tdSpecularLight += color * getLightSpecular();\n}\n",lightmapSinglePS:"#ifdef MAPTEXTURE\nuniform sampler2D texture_lightMap;\n#endif\nvoid addLightMap() {\n\tvec3 lm = vec3(1.0);\n\t#ifdef MAPTEXTURE\n\tlm *= $texture2DSAMPLE(texture_lightMap, $UV, textureBias).$CH;\n\t#endif\n\t#ifdef MAPVERTEX\n\tlm *= saturate(vVertexColor.$VC);\n\t#endif\n\tdDiffuseLight += lm;\n}\n",lightmapSingleVertPS:"void addLightMap() {\n\tdDiffuseLight += saturate(vVertexColor.$CH);\n}\n",lightSpecularAnisoGGXPS:"float calcLightSpecular(float tGlossiness, vec3 tNormalW) {\n\tfloat PI = 3.141592653589793;\n\tfloat roughness = max((1.0 - tGlossiness) * (1.0 - tGlossiness), 0.001);\n\tfloat anisotropy = material_anisotropy * roughness;\n\tfloat at = max((roughness + anisotropy), roughness / 4.0);\n\tfloat ab = max((roughness - anisotropy), roughness / 4.0);\n\tvec3 h = normalize(normalize(-dLightDirNormW) + normalize(dViewDirW));\n\tfloat NoH = dot(tNormalW, h);\n\tfloat ToH = dot(dTBN[0], h);\n\tfloat BoH = dot(dTBN[1], h);\n\tfloat a2 = at * ab;\n\tvec3 v = vec3(ab * ToH, at * BoH, a2 * NoH);\n\tfloat v2 = dot(v, v);\n\tfloat w2 = a2 / v2;\n\tfloat D = a2 * w2 * w2 * (1.0 / PI);\n\tfloat ToV = dot(dTBN[0], dViewDirW);\n\tfloat BoV = dot(dTBN[1], dViewDirW);\n\tfloat ToL = dot(dTBN[0], -dLightDirNormW);\n\tfloat BoL = dot(dTBN[1], -dLightDirNormW);\n\tfloat NoV = dot(tNormalW, dViewDirW);\n\tfloat NoL = dot(tNormalW, -dLightDirNormW);\n\tfloat lambdaV = NoL * length(vec3(at * ToV, ab * BoV, NoV));\n\tfloat lambdaL = NoV * length(vec3(at * ToL, ab * BoL, NoL));\n\tfloat G = 0.5 / (lambdaV + lambdaL);\n\treturn D * G;\n}\nfloat getLightSpecular() {\n\treturn calcLightSpecular(dGlossiness, dNormalW);\n}\nfloat getLightSpecularCC() {\n\treturn calcLightSpecular(ccGlossiness, ccNormalW);\n}\n",lightSpecularBlinnPS:"float calcLightSpecular(float tGlossiness, vec3 tNormalW) {\n\tvec3 h = normalize( -dLightDirNormW + dViewDirW );\n\tfloat nh = max( dot( h, tNormalW ), 0.0 );\n\tfloat specPow = exp2(tGlossiness * 11.0);\n\tspecPow = antiAliasGlossiness(specPow);\n\tspecPow = max(specPow, 0.0001);\n\treturn pow(nh, specPow) * (specPow + 2.0) / 8.0;\n}\nfloat getLightSpecular() {\n\treturn calcLightSpecular(dGlossiness, dNormalW);\n}\nfloat getLightSpecularCC() {\n\treturn calcLightSpecular(ccGlossiness, ccNormalW);\n}\n",lightSpecularPhongPS:"float calcLightSpecular(float tGlossiness, vec3 tReflDirW) {\n\tfloat specPow = tGlossiness;\n\tspecPow = antiAliasGlossiness(specPow);\n\treturn pow(max(dot(tReflDirW, -dLightDirNormW), 0.0), specPow + 0.0001);\n}\nfloat getLightSpecular() {\n\treturn calcLightSpecular(dGlossiness, dReflDirW);\n}\nfloat getLightSpecularCC() {\n\treturn calcLightSpecular(ccGlossiness, ccReflDirW);\n}\n",ltc:"mat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nstruct Coords {\n\tvec3 coord0;\n\tvec3 coord1;\n\tvec3 coord2;\n\tvec3 coord3;\n};\nfloat LTC_EvaluateRect( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in Coords rectCoords) {\n\tvec3 v1 = rectCoords.coord1 - rectCoords.coord0;\n\tvec3 v2 = rectCoords.coord3 - rectCoords.coord0;\n\tvec3 lightNormal = cross( v1, v2 );\n\tfloat factor = sign(-dot( lightNormal, P - rectCoords.coord0 ));\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 =\tfactor * cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords.coord0 - P );\n\tcoords[ 1 ] = mat * ( rectCoords.coord1 - P );\n\tcoords[ 2 ] = mat * ( rectCoords.coord2 - P );\n\tcoords[ 3 ] = mat * ( rectCoords.coord3 - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn result;\n}\nCoords dLTCCoords;\nCoords getLTCLightCoords(vec3 lightPos, vec3 halfWidth, vec3 halfHeight){\n\tCoords coords;\n\tcoords.coord0 = lightPos + halfWidth - halfHeight;\n\tcoords.coord1 = lightPos - halfWidth - halfHeight;\n\tcoords.coord2 = lightPos - halfWidth + halfHeight;\n\tcoords.coord3 = lightPos + halfWidth + halfHeight;\n\treturn coords;\n}\nfloat dSphereRadius;\nCoords getSphereLightCoords(vec3 lightPos, vec3 halfWidth, vec3 halfHeight){\n\tdSphereRadius = max(length(halfWidth), length(halfHeight));\n\tvec3 f = reflect(normalize(lightPos - view_position), vNormalW);\n\tvec3 w = normalize(cross(f, halfHeight));\n\tvec3 h = normalize(cross(f, w));\n\treturn getLTCLightCoords(lightPos, w * dSphereRadius, h * dSphereRadius);\n}\nvec2 dLTCUV;\n#ifdef CLEARCOAT\nvec2 ccLTCUV;\n#endif\nvec2 getLTCLightUV(float tGlossiness, vec3 tNormalW)\n{\n\tfloat roughness = max((1.0 - tGlossiness) * (1.0 - tGlossiness), 0.001);\n\treturn LTC_Uv( tNormalW, dViewDirW, roughness );\n}\nvec3 dLTCSpecFres;\n#ifdef CLEARCOAT\nvec3 ccLTCSpecFres;\n#endif\nvec3 getLTCLightSpecFres(vec2 uv, vec3 tSpecularity)\n{\n\tvec4 t2 = texture2D( areaLightsLutTex2, uv );\n\t#ifdef AREA_R8_G8_B8_A8_LUTS\n\tt2 *= vec4(0.693103,1,1,1);\n\tt2 += vec4(0.306897,0,0,0);\n\t#endif\n\treturn tSpecularity * t2.x + ( vec3( 1.0 ) - tSpecularity) * t2.y;\n}\nvoid calcLTCLightValues()\n{\n\tdLTCUV = getLTCLightUV(dGlossiness, dNormalW);\n\tdLTCSpecFres = getLTCLightSpecFres(dLTCUV, dSpecularityNoFres);\n#ifdef CLEARCOAT\n\tccLTCUV = getLTCLightUV(ccGlossiness, ccNormalW);\n\tccLTCSpecFres = getLTCLightSpecFres(ccLTCUV, vec3(ccSpecularityNoFres));\n#endif\n}\nvoid calcRectLightValues(vec3 lightPos, vec3 halfWidth, vec3 halfHeight)\n{\n\tdLTCCoords = getLTCLightCoords(lightPos, halfWidth, halfHeight);\n}\nvoid calcDiskLightValues(vec3 lightPos, vec3 halfWidth, vec3 halfHeight)\n{\n\tcalcRectLightValues(lightPos, halfWidth, halfHeight);\n}\nvoid calcSphereLightValues(vec3 lightPos, vec3 halfWidth, vec3 halfHeight)\n{\n\tdLTCCoords = getSphereLightCoords(lightPos, halfWidth, halfHeight);\n}\nvec3 SolveCubic(vec4 Coefficient)\n{\n\tfloat pi = 3.14159;\n\tCoefficient.xyz /= Coefficient.w;\n\tCoefficient.yz /= 3.0;\n\tfloat A = Coefficient.w;\n\tfloat B = Coefficient.z;\n\tfloat C = Coefficient.y;\n\tfloat D = Coefficient.x;\n\tvec3 Delta = vec3(\n\t\t-Coefficient.z * Coefficient.z + Coefficient.y,\n\t\t-Coefficient.y * Coefficient.z + Coefficient.x,\n\t\tdot(vec2(Coefficient.z, -Coefficient.y), Coefficient.xy)\n\t);\n\tfloat Discriminant = dot(vec2(4.0 * Delta.x, -Delta.y), Delta.zy);\n\tvec3 RootsA, RootsD;\n\tvec2 xlc, xsc;\n\t{\n\t\tfloat A_a = 1.0;\n\t\tfloat C_a = Delta.x;\n\t\tfloat D_a = -2.0 * B * Delta.x + Delta.y;\n\t\tfloat Theta = atan(sqrt(Discriminant), -D_a) / 3.0;\n\t\tfloat x_1a = 2.0 * sqrt(-C_a) * cos(Theta);\n\t\tfloat x_3a = 2.0 * sqrt(-C_a) * cos(Theta + (2.0 / 3.0) * pi);\n\t\tfloat xl;\n\t\tif ((x_1a + x_3a) > 2.0 * B)\n\t\t\txl = x_1a;\n\t\telse\n\t\t\txl = x_3a;\n\t\txlc = vec2(xl - B, A);\n\t}\n\t{\n\t\tfloat A_d = D;\n\t\tfloat C_d = Delta.z;\n\t\tfloat D_d = -D * Delta.y + 2.0 * C * Delta.z;\n\t\tfloat Theta = atan(D * sqrt(Discriminant), -D_d) / 3.0;\n\t\tfloat x_1d = 2.0 * sqrt(-C_d) * cos(Theta);\n\t\tfloat x_3d = 2.0 * sqrt(-C_d) * cos(Theta + (2.0 / 3.0) * pi);\n\t\tfloat xs;\n\t\tif (x_1d + x_3d < 2.0 * C)\n\t\t\txs = x_1d;\n\t\telse\n\t\t\txs = x_3d;\n\t\txsc = vec2(-D, xs + C);\n\t}\n\tfloat E =\txlc.y * xsc.y;\n\tfloat F = -xlc.x * xsc.y - xlc.y * xsc.x;\n\tfloat G =\txlc.x * xsc.x;\n\tvec2 xmc = vec2(C * F - B * G, -B * F + C * E);\n\tvec3 Root = vec3(xsc.x / xsc.y, xmc.x / xmc.y, xlc.x / xlc.y);\n\tif (Root.x < Root.y && Root.x < Root.z)\n\t\tRoot.xyz = Root.yxz;\n\telse if (Root.z < Root.x && Root.z < Root.y)\n\t\tRoot.xyz = Root.xzy;\n\treturn Root;\n}\nfloat LTC_EvaluateDisk(vec3 N, vec3 V, vec3 P, mat3 Minv, Coords points)\n{\n\tvec3 T1, T2;\n\tT1 = normalize(V - N * dot(V, N));\n\tT2 = cross(N, T1);\n\tmat3 R = transposeMat3( mat3( T1, T2, N ) );\n\tvec3 L_[ 3 ];\n\tL_[ 0 ] = R * ( points.coord0 - P );\n\tL_[ 1 ] = R * ( points.coord1 - P );\n\tL_[ 2 ] = R * ( points.coord2 - P );\n\tvec3 Lo_i = vec3(0);\n\tvec3 C\t= 0.5 * (L_[0] + L_[2]);\n\tvec3 V1 = 0.5 * (L_[1] - L_[2]);\n\tvec3 V2 = 0.5 * (L_[1] - L_[0]);\n\tC\t= Minv * C;\n\tV1 = Minv * V1;\n\tV2 = Minv * V2;\n\tfloat a, b;\n\tfloat d11 = dot(V1, V1);\n\tfloat d22 = dot(V2, V2);\n\tfloat d12 = dot(V1, V2);\n\tif (abs(d12) / sqrt(d11 * d22) > 0.0001)\n\t{\n\t\tfloat tr = d11 + d22;\n\t\tfloat det = -d12 * d12 + d11 * d22;\n\t\tdet = sqrt(det);\n\t\tfloat u = 0.5 * sqrt(tr - 2.0 * det);\n\t\tfloat v = 0.5 * sqrt(tr + 2.0 * det);\n\t\tfloat e_max = (u + v) * (u + v);\n\t\tfloat e_min = (u - v) * (u - v);\n\t\tvec3 V1_, V2_;\n\t\tif (d11 > d22)\n\t\t{\n\t\t\tV1_ = d12 * V1 + (e_max - d11) * V2;\n\t\t\tV2_ = d12 * V1 + (e_min - d11) * V2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tV1_ = d12*V2 + (e_max - d22)*V1;\n\t\t\tV2_ = d12*V2 + (e_min - d22)*V1;\n\t\t}\n\t\ta = 1.0 / e_max;\n\t\tb = 1.0 / e_min;\n\t\tV1 = normalize(V1_);\n\t\tV2 = normalize(V2_);\n\t}\n\telse\n\t{\n\t\ta = 1.0 / dot(V1, V1);\n\t\tb = 1.0 / dot(V2, V2);\n\t\tV1 *= sqrt(a);\n\t\tV2 *= sqrt(b);\n\t}\n\tvec3 V3 = cross(V1, V2);\n\tif (dot(C, V3) < 0.0)\n\t\tV3 *= -1.0;\n\tfloat L\t= dot(V3, C);\n\tfloat x0 = dot(V1, C) / L;\n\tfloat y0 = dot(V2, C) / L;\n\tfloat E1 = inversesqrt(a);\n\tfloat E2 = inversesqrt(b);\n\ta *= L * L;\n\tb *= L * L;\n\tfloat c0 = a * b;\n\tfloat c1 = a * b * (1.0 + x0 * x0 + y0 * y0) - a - b;\n\tfloat c2 = 1.0 - a * (1.0 + x0 * x0) - b * (1.0 + y0 * y0);\n\tfloat c3 = 1.0;\n\tvec3 roots = SolveCubic(vec4(c0, c1, c2, c3));\n\tfloat e1 = roots.x;\n\tfloat e2 = roots.y;\n\tfloat e3 = roots.z;\n\tvec3 avgDir = vec3(a * x0 / (a - e2), b * y0 / (b - e2), 1.0);\n\tmat3 rotate = mat3(V1, V2, V3);\n\tavgDir = rotate * avgDir;\n\tavgDir = normalize(avgDir);\n\tfloat L1 = sqrt(-e2 / e3);\n\tfloat L2 = sqrt(-e2 / e1);\n\tfloat formFactor = L1 * L2 * inversesqrt((1.0 + L1 * L1) * (1.0 + L2 * L2));\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tvec2 uv = vec2(avgDir.z * 0.5 + 0.5, formFactor);\n\tuv = uv*LUT_SCALE + LUT_BIAS;\n\tfloat scale = texture2D( areaLightsLutTex2, uv ).w;\n\treturn formFactor*scale;\n}\nfloat getRectLightDiffuse() {\n\treturn LTC_EvaluateRect( dNormalW, dViewDirW, vPositionW, mat3( 1.0 ), dLTCCoords );\n}\nfloat getDiskLightDiffuse() {\n\treturn LTC_EvaluateDisk( dNormalW, dViewDirW, vPositionW, mat3( 1.0 ), dLTCCoords );\n}\nfloat getSphereLightDiffuse() {\n\tfloat falloff = dSphereRadius / (dot(dLightDirW, dLightDirW) + dSphereRadius);\n\treturn getLightDiffuse()*falloff;\n}\nmat3 getLTCLightInvMat(vec2 uv)\n{\n\tvec4 t1 = texture2D( areaLightsLutTex1, uv );\n\t#ifdef AREA_R8_G8_B8_A8_LUTS\n\tt1 *= vec4(1.001, 0.3239, 0.60437568, 1.0);\n\tt1 += vec4(0.0, -0.2976, -0.01381, 0.0);\n\t#endif\n\treturn mat3(\n\t\tvec3( t1.x, 0, t1.y ),\n\t\tvec3(\t0, 1,\t0 ),\n\t\tvec3( t1.z, 0, t1.w )\n\t);\n}\nfloat calcRectLightSpecular(vec3 tNormalW, vec2 uv) {\n\tmat3 mInv = getLTCLightInvMat(uv);\n\treturn LTC_EvaluateRect( tNormalW, dViewDirW, vPositionW, mInv, dLTCCoords );\n}\nfloat getRectLightSpecular() {\n\treturn calcRectLightSpecular(dNormalW, dLTCUV);\n}\n#ifdef CLEARCOAT\nfloat getRectLightSpecularCC() {\n\treturn calcRectLightSpecular(ccNormalW, ccLTCUV);\n}\n#endif\nfloat calcDiskLightSpecular(vec3 tNormalW, vec2 uv) {\n\tmat3 mInv = getLTCLightInvMat(uv);\n\treturn LTC_EvaluateDisk( tNormalW, dViewDirW, vPositionW, mInv, dLTCCoords );\n}\nfloat getDiskLightSpecular() {\n\treturn calcDiskLightSpecular(dNormalW, dLTCUV);\n}\n#ifdef CLEARCOAT\nfloat getDiskLightSpecularCC() {\n\treturn calcDiskLightSpecular(ccNormalW, ccLTCUV);\n}\n#endif\nfloat getSphereLightSpecular() {\n\treturn calcDiskLightSpecular(dNormalW, dLTCUV);\n}\n#ifdef CLEARCOAT\nfloat getSphereLightSpecularCC() {\n\treturn calcDiskLightSpecular(ccNormalW, ccLTCUV);\n}\n#endif\n",metalnessPS:"void processMetalness(float metalness) {\n\tconst float dielectricF0 = 0.04;\n\tdSpecularity = mix(vec3(dielectricF0), dAlbedo, metalness);\n\tdAlbedo *= 1.0 - metalness;\n}\n#ifdef MAPFLOAT\nuniform float material_metalness;\n#endif\n#ifdef MAPTEXTURE\nuniform sampler2D texture_metalnessMap;\n#endif\nvoid getSpecularity() {\n\tfloat metalness = 1.0;\n\t#ifdef MAPFLOAT\n\tmetalness *= material_metalness;\n\t#endif\n\t#ifdef MAPTEXTURE\n\tmetalness *= texture2D(texture_metalnessMap, $UV, textureBias).$CH;\n\t#endif\n\t#ifdef MAPVERTEX\n\tmetalness *= saturate(vVertexColor.$VC);\n\t#endif\n\tprocessMetalness(metalness);\n}\n",msdfPS:"uniform sampler2D texture_msdfMap;\n#ifdef GL_OES_standard_derivatives\n#define USE_FWIDTH\n#endif\n#ifdef GL2\n#define USE_FWIDTH\n#endif\nfloat median(float r, float g, float b) {\n\treturn max(min(r, g), min(max(r, g), b));\n}\nfloat map (float min, float max, float v) {\n\treturn (v - min) / (max - min);\n}\nuniform float font_sdfIntensity;\nuniform float font_pxrange;\nuniform float font_textureWidth;\nuniform vec4 outline_color;\nuniform float outline_thickness;\nuniform vec4 shadow_color;\nuniform vec2 shadow_offset;\nvec4 applyMsdf(vec4 color) {\n\tvec3 tsample = texture2D(texture_msdfMap, vUv0).rgb;\n\tvec2 uvShdw = vUv0 - shadow_offset;\n\tvec3 ssample = texture2D(texture_msdfMap, uvShdw).rgb;\n\tfloat sigDist = median(tsample.r, tsample.g, tsample.b);\n\tfloat sigDistShdw = median(ssample.r, ssample.g, ssample.b);\n\tfloat smoothingMax = 0.2;\n\t#ifdef USE_FWIDTH\n\tvec2 w = fwidth(vUv0);\n\tfloat smoothing = clamp(w.x * font_textureWidth / font_pxrange, 0.0, smoothingMax);\n\t#else\n\tfloat font_size = 16.0;\n\tfloat smoothing = clamp(font_pxrange / font_size, 0.0, smoothingMax);\n\t#endif\n\tfloat mapMin = 0.05;\n\tfloat mapMax = clamp(1.0 - font_sdfIntensity, mapMin, 1.0);\n\tfloat sigDistInner = map(mapMin, mapMax, sigDist);\n\tfloat sigDistOutline = map(mapMin, mapMax, sigDist + outline_thickness);\n\tsigDistShdw = map(mapMin, mapMax, sigDistShdw + outline_thickness);\n\tfloat center = 0.5;\n\tfloat inside = smoothstep(center-smoothing, center+smoothing, sigDistInner);\n\tfloat outline = smoothstep(center-smoothing, center+smoothing, sigDistOutline);\n\tfloat shadow = smoothstep(center-smoothing, center+smoothing, sigDistShdw);\n\tvec4 tcolor = (outline > inside) ? outline * vec4(outline_color.a * outline_color.rgb, outline_color.a) : vec4(0.0);\n\ttcolor = mix(tcolor, color, inside);\n\tvec4 scolor = (shadow > outline) ? shadow * vec4(shadow_color.a * shadow_color.rgb, shadow_color.a) : tcolor;\n\ttcolor = mix(scolor, tcolor, outline);\n\treturn tcolor;\n}\n",normalVS:"#ifdef MORPHING_TEXTURE_BASED_NORMAL\nuniform highp sampler2D morphNormalTex;\n#endif\nvec3 getNormal() {\n\t#ifdef SKIN\n\tdNormalMatrix = mat3(dModelMatrix[0].xyz, dModelMatrix[1].xyz, dModelMatrix[2].xyz);\n\t#elif defined(INSTANCING)\n\tdNormalMatrix = mat3(instance_line1.xyz, instance_line2.xyz, instance_line3.xyz);\n\t#else\n\tdNormalMatrix = matrix_normal;\n\t#endif\n\tvec3 tempNormal = vertex_normal;\n\t#ifdef MORPHING\n\t#ifdef MORPHING_NRM03\n\ttempNormal += morph_weights_a[0] * morph_nrm0;\n\ttempNormal += morph_weights_a[1] * morph_nrm1;\n\ttempNormal += morph_weights_a[2] * morph_nrm2;\n\ttempNormal += morph_weights_a[3] * morph_nrm3;\n\t#endif\n\t#ifdef MORPHING_NRM47\n\ttempNormal += morph_weights_b[0] * morph_nrm4;\n\ttempNormal += morph_weights_b[1] * morph_nrm5;\n\ttempNormal += morph_weights_b[2] * morph_nrm6;\n\ttempNormal += morph_weights_b[3] * morph_nrm7;\n\t#endif\n\t#endif\n\t#ifdef MORPHING_TEXTURE_BASED_NORMAL\n\tvec2 morphUV = getTextureMorphCoords();\n\tvec3 morphNormal = texture2D(morphNormalTex, morphUV).xyz;\n\ttempNormal += morphNormal;\n\t#endif\n\treturn normalize(dNormalMatrix * tempNormal);\n}\n",normalDetailMapPS:"#ifdef MAPTEXTURE\nuniform sampler2D texture_normalDetailMap;\nuniform float material_normalDetailMapBumpiness;\nvec3 blendNormals(vec3 n1, vec3 n2) {\n\tn1 += vec3(0, 0, 1);\n\tn2 *= vec3(-1, -1, 1);\n\treturn normalize(n1*dot(n1, n2)/n1.z - n2);\n}\n#endif\nvec3 addNormalDetail(vec3 normalMap) {\n\t#ifdef MAPTEXTURE\n\tvec3 normalDetailMap = unpackNormal(texture2D(texture_normalDetailMap, $UV, textureBias));\n\tnormalDetailMap = normalize(mix(vec3(0.0, 0.0, 1.0), normalDetailMap, material_normalDetailMapBumpiness));\n\treturn blendNormals(normalMap, normalDetailMap);\n\t#else\n\treturn normalMap;\n\t#endif\n}\n",normalInstancedVS:"vec3 getNormal() {\n\tdNormalMatrix = mat3(instance_line1.xyz, instance_line2.xyz, instance_line3.xyz);\n\treturn normalize(dNormalMatrix * vertex_normal);\n}\n",normalMapPS:"uniform sampler2D texture_normalMap;\nuniform float material_bumpiness;\nvoid getNormal() {\n\tvec3 normalMap = unpackNormal(texture2D(texture_normalMap, $UV, textureBias));\n\tnormalMap = normalize(mix(vec3(0.0, 0.0, 1.0), normalMap, material_bumpiness));\n\tdNormalMap = addNormalDetail(normalMap);\n\tdNormalW = dTBN * dNormalMap;\n}\n",normalMapFastPS:"uniform sampler2D texture_normalMap;\nvoid getNormal() {\n\tvec3 normalMap = unpackNormal(texture2D(texture_normalMap, $UV, textureBias));\n\tdNormalMap = addNormalDetail(normalMap);\n\tdNormalW = dTBN * dNormalMap;\n}\n",normalSkinnedVS:"vec3 getNormal() {\n\tdNormalMatrix = mat3(dModelMatrix[0].xyz, dModelMatrix[1].xyz, dModelMatrix[2].xyz);\n\treturn normalize(dNormalMatrix * vertex_normal);\n}\n",normalVertexPS:"void getNormal() {\n\tdNormalW = normalize(dVertexNormalW);\n}\n",normalXYPS:"vec3 unpackNormal(vec4 nmap) {\n\tvec3 normal;\n\tnormal.xy = nmap.wy * 2.0 - 1.0;\n\tnormal.z = sqrt(1.0 - saturate(dot(normal.xy, normal.xy)));\n\treturn normal;\n}\n",normalXYZPS:"vec3 unpackNormal(vec4 nmap) {\n\treturn nmap.xyz * 2.0 - 1.0;\n}\n",opacityPS:"#ifdef MAPFLOAT\nuniform float material_opacity;\n#endif\n#ifdef MAPTEXTURE\nuniform sampler2D texture_opacityMap;\n#endif\nvoid getOpacity() {\n\tdAlpha = 1.0;\n\t#ifdef MAPFLOAT\n\tdAlpha *= material_opacity;\n\t#endif\n\t#ifdef MAPTEXTURE\n\tdAlpha *= texture2D(texture_opacityMap, $UV, textureBias).$CH;\n\t#endif\n\t#ifdef MAPVERTEX\n\tdAlpha *= clamp(vVertexColor.$VC, 0.0, 1.0);\n\t#endif\n}\n",outputAlphaPS:"gl_FragColor.a = dAlpha;\n",outputAlphaOpaquePS:"gl_FragColor.a = 1.0;\n",outputAlphaPremulPS:"gl_FragColor.rgb *= dAlpha;\ngl_FragColor.a = dAlpha;\n",outputTex2DPS:"varying vec2 vUv0;\nuniform sampler2D source;\nvoid main(void) {\n\tgl_FragColor = texture2D(source, vUv0);\n}\n",packDepthPS:"vec4 packFloat(float depth) {\n\tconst vec4 bit_shift = vec4(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0);\n\tconst vec4 bit_mask\t= vec4(0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0);\n\tvec4 res = mod(depth * bit_shift * vec4(255), vec4(256) ) / vec4(255);\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\n",parallaxPS:"uniform sampler2D texture_heightMap;\nuniform float material_heightMapFactor;\nvoid getParallax() {\n\tfloat parallaxScale = material_heightMapFactor;\n\tfloat height = texture2D(texture_heightMap, $UV, textureBias).$CH;\n\theight = height * parallaxScale - parallaxScale*0.5;\n\tvec3 viewDirT = dViewDirW * dTBN;\n\tviewDirT.z += 0.42;\n\tdUvOffset = height * (viewDirT.xy / viewDirT.z);\n}\n",particlePS:"varying vec4 texCoordsAlphaLife;\nuniform sampler2D colorMap;\nuniform sampler2D colorParam;\nuniform float graphSampleSize;\nuniform float graphNumSamples;\n#ifndef CAMERAPLANES\n#define CAMERAPLANES\nuniform vec4 camera_params;\n#endif\nuniform float softening;\nuniform float colorMult;\nfloat saturate(float x) {\n\treturn clamp(x, 0.0, 1.0);\n}\n#ifndef UNPACKFLOAT\n#define UNPACKFLOAT\nfloat unpackFloat(vec4 rgbaDepth) {\n\tconst vec4 bitShift = vec4(1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0);\n\tfloat depth = dot(rgbaDepth, bitShift);\n\treturn depth;\n}\n#endif\nvoid main(void) {\n\tvec4 tex\t= texture2DSRGB(colorMap, vec2(texCoordsAlphaLife.x, 1.0 - texCoordsAlphaLife.y));\n\tvec4 ramp = texture2DSRGB(colorParam, vec2(texCoordsAlphaLife.w, 0.0));\n\tramp.rgb *= colorMult;\n\tramp.a += texCoordsAlphaLife.z;\n\tvec3 rgb = tex.rgb * ramp.rgb;\n\tfloat a\t= tex.a * ramp.a;\n",particleVS:"vec3 unpack3NFloats(float src) {\n\tfloat r = fract(src);\n\tfloat g = fract(src * 256.0);\n\tfloat b = fract(src * 65536.0);\n\treturn vec3(r, g, b);\n}\nfloat saturate(float x) {\n\treturn clamp(x, 0.0, 1.0);\n}\nvec4 tex1Dlod_lerp(highp sampler2D tex, vec2 tc) {\n\treturn mix( texture2D(tex,tc), texture2D(tex,tc + graphSampleSize), fract(tc.x*graphNumSamples) );\n}\nvec4 tex1Dlod_lerp(highp sampler2D tex, vec2 tc, out vec3 w) {\n\tvec4 a = texture2D(tex,tc);\n\tvec4 b = texture2D(tex,tc + graphSampleSize);\n\tfloat c = fract(tc.x*graphNumSamples);\n\tvec3 unpackedA = unpack3NFloats(a.w);\n\tvec3 unpackedB = unpack3NFloats(b.w);\n\tw = mix(unpackedA, unpackedB, c);\n\treturn mix(a, b, c);\n}\nvec2 rotate(vec2 quadXY, float pRotation, out mat2 rotMatrix) {\n\tfloat c = cos(pRotation);\n\tfloat s = sin(pRotation);\n\tmat2 m = mat2(c, -s, s, c);\n\trotMatrix = m;\n\treturn m * quadXY;\n}\nvec3 billboard(vec3 InstanceCoords, vec2 quadXY) {\n\t#ifdef SCREEN_SPACE\n\t\tvec3 pos = vec3(-1, 0, 0) * quadXY.x + vec3(0, -1, 0) * quadXY.y;\n\t#else\n\t\tvec3 pos = -matrix_viewInverse[0].xyz * quadXY.x + -matrix_viewInverse[1].xyz * quadXY.y;\n\t#endif\n\treturn pos;\n}\nvec3 customFace(vec3 InstanceCoords, vec2 quadXY) {\n\tvec3 pos = faceTangent * quadXY.x + faceBinorm * quadXY.y;\n\treturn pos;\n}\nvec2 safeNormalize(vec2 v) {\n\tfloat l = length(v);\n\treturn (l > 1e-06) ? v / l : v;\n}\nvoid main(void) {\n\tvec3 meshLocalPos = particle_vertexData.xyz;\n\tfloat id = floor(particle_vertexData.w);\n\tfloat rndFactor = fract(sin(id + 1.0 + seed));\n\tvec3 rndFactor3 = vec3(rndFactor, fract(rndFactor*10.0), fract(rndFactor*100.0));\n\tfloat uv = id / numParticlesPot;\n\treadInput(uv);\n#ifdef LOCAL_SPACE\n\tinVel = mat3(matrix_model) * inVel;\n#endif\n\tvec2 velocityV = safeNormalize((mat3(matrix_view) * inVel).xy);\n\tfloat particleLifetime = lifetime;\n\tif (inLife <= 0.0 || inLife > particleLifetime || !inShow) meshLocalPos = vec3(0.0);\n\tvec2 quadXY = meshLocalPos.xy;\n\tfloat nlife = clamp(inLife / particleLifetime, 0.0, 1.0);\n\tvec3 paramDiv;\n\tvec4 params = tex1Dlod_lerp(internalTex2, vec2(nlife, 0), paramDiv);\n\tfloat scale = params.y;\n\tfloat scaleDiv = paramDiv.x;\n\tfloat alphaDiv = paramDiv.z;\n\tscale += (scaleDiv * 2.0 - 1.0) * scaleDivMult * fract(rndFactor*10000.0);\n#ifndef USE_MESH\n\ttexCoordsAlphaLife = vec4(quadXY * -0.5 + 0.5, (alphaDiv * 2.0 - 1.0) * alphaDivMult * fract(rndFactor*1000.0), nlife);\n#else\n\ttexCoordsAlphaLife = vec4(particle_uv, (alphaDiv * 2.0 - 1.0) * alphaDivMult * fract(rndFactor*1000.0), nlife);\n#endif\n\tvec3 particlePos = inPos;\n\tvec3 particlePosMoved = vec3(0.0);\n\tmat2 rotMatrix;\n",particleAnimFrameClampVS:"\tfloat animFrame = min(floor(texCoordsAlphaLife.w * animTexParams.y) + animTexParams.x, animTexParams.z);\n",particleAnimFrameLoopVS:"\tfloat animFrame = floor(mod(texCoordsAlphaLife.w * animTexParams.y + animTexParams.x, animTexParams.z + 1.0));\n",particleAnimTexVS:"\tfloat animationIndex;\n\tif (animTexIndexParams.y == 1.0) {\n\t\tanimationIndex = floor((animTexParams.w + 1.0) * rndFactor3.z) * (animTexParams.z + 1.0);\n\t} else {\n\t\tanimationIndex = animTexIndexParams.x * (animTexParams.z + 1.0);\n\t}\n\tfloat atlasX = (animationIndex + animFrame) * animTexTilesParams.x;\n\tfloat atlasY = 1.0 - floor(atlasX + 1.0) * animTexTilesParams.y;\n\tatlasX = fract(atlasX);\n\ttexCoordsAlphaLife.xy *= animTexTilesParams.xy;\n\ttexCoordsAlphaLife.xy += vec2(atlasX, atlasY);\n",particleInputFloatPS:"void readInput(float uv) {\n\tvec4 tex = texture2D(particleTexIN, vec2(uv, 0.25));\n\tvec4 tex2 = texture2D(particleTexIN, vec2(uv, 0.75));\n\tinPos = tex.xyz;\n\tinVel = tex2.xyz;\n\tinAngle = (tex.w < 0.0? -tex.w : tex.w) - 1000.0;\n\tinShow = tex.w >= 0.0;\n\tinLife = tex2.w;\n}\n",particleInputRgba8PS:"#define PI2 6.283185307179586\nuniform vec3 inBoundsSize;\nuniform vec3 inBoundsCenter;\nuniform float maxVel;\nfloat decodeFloatRG(vec2 rg) {\n\treturn rg.y*(1.0/255.0) + rg.x;\n}\nfloat decodeFloatRGBA( vec4 rgba ) {\n\treturn dot( rgba, vec4(1.0, 1.0/255.0, 1.0/65025.0, 1.0/160581375.0) );\n}\nvoid readInput(float uv) {\n\tvec4 tex0 = texture2D(particleTexIN, vec2(uv, 0.125));\n\tvec4 tex1 = texture2D(particleTexIN, vec2(uv, 0.375));\n\tvec4 tex2 = texture2D(particleTexIN, vec2(uv, 0.625));\n\tvec4 tex3 = texture2D(particleTexIN, vec2(uv, 0.875));\n\tinPos = vec3(decodeFloatRG(tex0.rg), decodeFloatRG(tex0.ba), decodeFloatRG(tex1.rg));\n\tinPos = (inPos - vec3(0.5)) * inBoundsSize + inBoundsCenter;\n\tinVel = tex2.xyz;\n\tinVel = (inVel - vec3(0.5)) * maxVel;\n\tinAngle = decodeFloatRG(tex1.ba) * PI2;\n\tinShow = tex2.a > 0.5;\n\tinLife = decodeFloatRGBA(tex3);\n\tfloat maxNegLife = max(lifetime, (numParticles - 1.0) * (rate+rateDiv));\n\tfloat maxPosLife = lifetime+1.0;\n\tinLife = inLife * (maxNegLife + maxPosLife) - maxNegLife;\n}\n",particleOutputFloatPS:"void writeOutput() {\n\tif (gl_FragCoord.y<1.0) {\n\t\tgl_FragColor = vec4(outPos, (outAngle + 1000.0) * visMode);\n\t} else {\n\t\tgl_FragColor = vec4(outVel, outLife);\n\t}\n}\n",particleOutputRgba8PS:"uniform vec3 outBoundsMul;\nuniform vec3 outBoundsAdd;\nvec2 encodeFloatRG( float v ) {\n\tvec2 enc = vec2(1.0, 255.0) * v;\n\tenc = fract(enc);\n\tenc -= enc.yy * vec2(1.0/255.0, 1.0/255.0);\n\treturn enc;\n}\nvec4 encodeFloatRGBA( float v ) {\n\tvec4 enc = vec4(1.0, 255.0, 65025.0, 160581375.0) * v;\n\tenc = fract(enc);\n\tenc -= enc.yzww * vec4(1.0/255.0,1.0/255.0,1.0/255.0,0.0);\n\treturn enc;\n}\nvoid writeOutput() {\n\toutPos = outPos * outBoundsMul + outBoundsAdd;\n\toutAngle = fract(outAngle / PI2);\n\toutVel = (outVel / maxVel) + vec3(0.5);\n\tfloat maxNegLife = max(lifetime, (numParticles - 1.0) * (rate+rateDiv));\n\tfloat maxPosLife = lifetime+1.0;\n\toutLife = (outLife + maxNegLife) / (maxNegLife + maxPosLife);\n\tif (gl_FragCoord.y < 1.0) {\n\t\tgl_FragColor = vec4(encodeFloatRG(outPos.x), encodeFloatRG(outPos.y));\n\t} else if (gl_FragCoord.y < 2.0) {\n\t\tgl_FragColor = vec4(encodeFloatRG(outPos.z), encodeFloatRG(outAngle));\n\t} else if (gl_FragCoord.y < 3.0) {\n\t\tgl_FragColor = vec4(outVel, visMode*0.5+0.5);\n\t} else {\n\t\tgl_FragColor = encodeFloatRGBA(outLife);\n\t}\n}\n",particleUpdaterAABBPS:"uniform mat3 spawnBounds;\nuniform vec3 spawnPosInnerRatio;\nvec3 calcSpawnPosition(vec3 inBounds, float rndFactor) {\n\tvec3 pos = inBounds - vec3(0.5);\n\tvec3 posAbs = abs(pos);\n\tvec3 maxPos = vec3(max(posAbs.x, max(posAbs.y, posAbs.z)));\n\tvec3 edge = maxPos + (vec3(0.5) - maxPos) * spawnPosInnerRatio;\n\tpos.x = edge.x * (maxPos.x == posAbs.x ? sign(pos.x) : 2.0 * pos.x);\n\tpos.y = edge.y * (maxPos.y == posAbs.y ? sign(pos.y) : 2.0 * pos.y);\n\tpos.z = edge.z * (maxPos.z == posAbs.z ? sign(pos.z) : 2.0 * pos.z);\n#ifndef LOCAL_SPACE\n\treturn emitterPos + spawnBounds * pos;\n#else\n\treturn spawnBounds * pos;\n#endif\n}\nvoid addInitialVelocity(inout vec3 localVelocity, vec3 inBounds) {\n\tlocalVelocity -= vec3(0, 0, initialVelocity);\n}\n",particleUpdaterEndPS:"\twriteOutput();\n}\n",particleUpdaterInitPS:"varying vec2 vUv0;\nuniform highp sampler2D particleTexIN;\nuniform highp sampler2D internalTex0;\nuniform highp sampler2D internalTex1;\nuniform highp sampler2D internalTex2;\nuniform highp sampler2D internalTex3;\nuniform mat3 emitterMatrix, emitterMatrixInv;\nuniform vec3 emitterScale;\nuniform vec3 emitterPos, frameRandom, localVelocityDivMult, velocityDivMult;\nuniform float delta, rate, rateDiv, lifetime, numParticles, rotSpeedDivMult, radialSpeedDivMult, seed;\nuniform float startAngle, startAngle2;\nuniform float initialVelocity;\nuniform float graphSampleSize;\nuniform float graphNumSamples;\nvec3 inPos;\nvec3 inVel;\nfloat inAngle;\nbool inShow;\nfloat inLife;\nfloat visMode;\nvec3 outPos;\nvec3 outVel;\nfloat outAngle;\nbool outShow;\nfloat outLife;\n",particleUpdaterNoRespawnPS:"\tif (outLife >= lifetime) {\n\t\toutLife -= max(lifetime, (numParticles - 1.0) * particleRate);\n\t\tvisMode = -1.0;\n\t}\n",particleUpdaterOnStopPS:"\tvisMode = outLife < 0.0? -1.0: visMode;\n",particleUpdaterRespawnPS:"\tif (outLife >= lifetime) {\n\t\toutLife -= max(lifetime, (numParticles - 1.0) * particleRate);\n\t\tvisMode = 1.0;\n\t}\n\tvisMode = outLife < 0.0? 1.0: visMode;\n",particleUpdaterSpherePS:"uniform float spawnBoundsSphere;\nuniform float spawnBoundsSphereInnerRatio;\nvec3 calcSpawnPosition(vec3 inBounds, float rndFactor) {\n\tfloat rnd4 = fract(rndFactor * 1000.0);\n\tvec3 norm = normalize(inBounds.xyz - vec3(0.5));\n\tfloat r = rnd4 * (1.0 - spawnBoundsSphereInnerRatio) + spawnBoundsSphereInnerRatio;\n#ifndef LOCAL_SPACE\n\treturn emitterPos + norm * r * spawnBoundsSphere;\n#else\n\treturn norm * r * spawnBoundsSphere;\n#endif\n}\nvoid addInitialVelocity(inout vec3 localVelocity, vec3 inBounds) {\n\tlocalVelocity += normalize(inBounds - vec3(0.5)) * initialVelocity;\n}\n",particleUpdaterStartPS:"float saturate(float x) {\n\treturn clamp(x, 0.0, 1.0);\n}\nvec3 unpack3NFloats(float src) {\n\tfloat r = fract(src);\n\tfloat g = fract(src * 256.0);\n\tfloat b = fract(src * 65536.0);\n\treturn vec3(r, g, b);\n}\nvec3 tex1Dlod_lerp(highp sampler2D tex, vec2 tc, out vec3 w) {\n\tvec4 a = texture2D(tex, tc);\n\tvec4 b = texture2D(tex, tc + graphSampleSize);\n\tfloat c = fract(tc.x * graphNumSamples);\n\tvec3 unpackedA = unpack3NFloats(a.w);\n\tvec3 unpackedB = unpack3NFloats(b.w);\n\tw = mix(unpackedA, unpackedB, c);\n\treturn mix(a.xyz, b.xyz, c);\n}\n#define HASHSCALE4 vec4(1031, .1030, .0973, .1099)\nvec4 hash41(float p) {\n\tvec4 p4 = fract(vec4(p) * HASHSCALE4);\n\tp4 += dot(p4, p4.wzxy+19.19);\n\treturn fract(vec4((p4.x + p4.y)*p4.z, (p4.x + p4.z)*p4.y, (p4.y + p4.z)*p4.w, (p4.z + p4.w)*p4.x));\n}\nvoid main(void) {\n\tif (gl_FragCoord.x > numParticles) discard;\n\treadInput(vUv0.x);\n\tvisMode = inShow? 1.0 : -1.0;\n\tvec4 rndFactor = hash41(gl_FragCoord.x + seed);\n\tfloat particleRate = rate + rateDiv * rndFactor.x;\n\toutLife = inLife + delta;\n\tfloat nlife = clamp(outLife / lifetime, 0.0, 1.0);\n\tvec3 localVelocityDiv;\n\tvec3 velocityDiv;\n\tvec3 paramDiv;\n\tvec3 localVelocity = tex1Dlod_lerp(internalTex0, vec2(nlife, 0), localVelocityDiv);\n\tvec3 velocity =\t\ttex1Dlod_lerp(internalTex1, vec2(nlife, 0), velocityDiv);\n\tvec3 params =\t\ttex1Dlod_lerp(internalTex2, vec2(nlife, 0), paramDiv);\n\tfloat rotSpeed = params.x;\n\tfloat rotSpeedDiv = paramDiv.y;\n\tvec3 radialParams = tex1Dlod_lerp(internalTex3, vec2(nlife, 0), paramDiv);\n\tfloat radialSpeed = radialParams.x;\n\tfloat radialSpeedDiv = radialParams.y;\n\tbool respawn = inLife <= 0.0 || outLife >= lifetime;\n\tinPos = respawn ? calcSpawnPosition(rndFactor.xyz, rndFactor.x) : inPos;\n\tinAngle = respawn ? mix(startAngle, startAngle2, rndFactor.x) : inAngle;\n#ifndef LOCAL_SPACE\n\tvec3 radialVel = inPos - emitterPos;\n#else\n\tvec3 radialVel = inPos;\n#endif\n\tradialVel = (dot(radialVel, radialVel) > 1.0E-8) ? radialSpeed * normalize(radialVel) : vec3(0.0);\n\tradialVel += (radialSpeedDiv * vec3(2.0) - vec3(1.0)) * radialSpeedDivMult * rndFactor.xyz;\n\tlocalVelocity +=\t(localVelocityDiv * vec3(2.0) - vec3(1.0)) * localVelocityDivMult * rndFactor.xyz;\n\tvelocity +=\t\t (velocityDiv * vec3(2.0) - vec3(1.0)) * velocityDivMult * rndFactor.xyz;\n\trotSpeed +=\t\t (rotSpeedDiv * 2.0 - 1.0) * rotSpeedDivMult * rndFactor.y;\n\taddInitialVelocity(localVelocity, rndFactor.xyz);\n#ifndef LOCAL_SPACE\n\toutVel = emitterMatrix * localVelocity + (radialVel + velocity) * emitterScale;\n#else\n\toutVel = (localVelocity + radialVel) / emitterScale + emitterMatrixInv * velocity;\n#endif\n\toutPos = inPos + outVel * delta;\n\toutAngle = inAngle + rotSpeed * delta;\n",particle_billboardVS:"\tquadXY = rotate(quadXY, inAngle, rotMatrix);\n\tvec3 localPos = billboard(particlePos, quadXY);\n",particle_blendAddPS:"\tdBlendModeFogFactor = 0.0;\n\trgb *= saturate(gammaCorrectInput(max(a, 0.0)));\n\tif ((rgb.r + rgb.g + rgb.b) < 0.000001) discard;\n",particle_blendMultiplyPS:"\trgb = mix(vec3(1.0), rgb, vec3(a));\n\tif (rgb.r + rgb.g + rgb.b > 2.99) discard;\n",particle_blendNormalPS:"\tif (a < 0.01) discard;\n",particle_cpuVS:"attribute vec4 particle_vertexData;\nattribute vec4 particle_vertexData2;\nattribute vec4 particle_vertexData3;\nattribute float particle_vertexData4;\n#ifndef USE_MESH\n#define VDATA5TYPE vec2\n#else\n#define VDATA5TYPE vec4\n#endif\nattribute VDATA5TYPE particle_vertexData5;\nuniform mat4 matrix_viewProjection;\nuniform mat4 matrix_model;\n#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\nuniform mat3 matrix_normal;\nuniform mat4 matrix_viewInverse;\nuniform float numParticles;\nuniform float lifetime;\nuniform float stretch;\nuniform float seed;\nuniform vec3 wrapBounds, emitterScale, faceTangent, faceBinorm;\nuniform sampler2D texLifeAndSourcePosOUT;\nuniform highp sampler2D internalTex0;\nuniform highp sampler2D internalTex1;\nuniform highp sampler2D internalTex2;\nuniform vec3 emitterPos;\nvarying vec4 texCoordsAlphaLife;\nvec2 rotate(vec2 quadXY, float pRotation, out mat2 rotMatrix)\n{\n\tfloat c = cos(pRotation);\n\tfloat s = sin(pRotation);\n\tmat2 m = mat2(c, -s, s, c);\n\trotMatrix = m;\n\treturn m * quadXY;\n}\nvec3 billboard(vec3 InstanceCoords, vec2 quadXY)\n{\n\tvec3 pos = -matrix_viewInverse[0].xyz * quadXY.x + -matrix_viewInverse[1].xyz * quadXY.y;\n\treturn pos;\n}\nvec3 customFace(vec3 InstanceCoords, vec2 quadXY)\n{\n\tvec3 pos = faceTangent * quadXY.x + faceBinorm * quadXY.y;\n\treturn pos;\n}\nvoid main(void)\n{\n\tvec3 particlePos = particle_vertexData.xyz;\n\tvec3 inPos = particlePos;\n\tvec3 vertPos = particle_vertexData3.xyz;\n\tvec3 inVel = vec3(particle_vertexData2.w, particle_vertexData3.w, particle_vertexData5.x);\n\tfloat id = floor(particle_vertexData4);\n\tfloat rndFactor = fract(sin(id + 1.0 + seed));\n\tvec3 rndFactor3 = vec3(rndFactor, fract(rndFactor*10.0), fract(rndFactor*100.0));\n#ifdef LOCAL_SPACE\n\tinVel = mat3(matrix_model) * inVel;\n#endif\n\tvec2 velocityV = normalize((mat3(matrix_view) * inVel).xy);\n\tvec2 quadXY = vertPos.xy;\n#ifdef USE_MESH\n\ttexCoordsAlphaLife = vec4(particle_vertexData5.zw, particle_vertexData2.z, particle_vertexData.w);\n#else\n\ttexCoordsAlphaLife = vec4(quadXY * -0.5 + 0.5, particle_vertexData2.z, particle_vertexData.w);\n#endif\n\tmat2 rotMatrix;\n\tfloat inAngle = particle_vertexData2.x;\n\tvec3 particlePosMoved = vec3(0.0);\n\tvec3 meshLocalPos = particle_vertexData3.xyz;\n",particle_cpu_endVS:"\tlocalPos *= particle_vertexData2.y * emitterScale;\n\tlocalPos += particlePos;\n\tgl_Position = matrix_viewProjection * vec4(localPos, 1.0);\n",particle_customFaceVS:"\tquadXY = rotate(quadXY, inAngle, rotMatrix);\n\tvec3 localPos = customFace(particlePos, quadXY);\n",particle_endPS:"\trgb = addFog(rgb);\n\trgb = toneMap(rgb);\n\trgb = gammaCorrectOutput(rgb);\n\tgl_FragColor = vec4(rgb, a);\n}\n",particle_endVS:"\tlocalPos *= scale * emitterScale;\n\tlocalPos += particlePos;\n\t#ifdef SCREEN_SPACE\n\tgl_Position = vec4(localPos.x, localPos.y, 0.0, 1.0);\n\t#else\n\tgl_Position = matrix_viewProjection * vec4(localPos.xyz, 1.0);\n\t#endif\n",particle_halflambertPS:"\tvec3 negNormal = normal*0.5+0.5;\n\tvec3 posNormal = -normal*0.5+0.5;\n\tnegNormal *= negNormal;\n\tposNormal *= posNormal;\n",particle_initVS:"attribute vec4 particle_vertexData;\n#ifdef USE_MESH\nattribute vec2 particle_uv;\n#endif\nuniform mat4 matrix_viewProjection;\nuniform mat4 matrix_model;\nuniform mat3 matrix_normal;\nuniform mat4 matrix_viewInverse;\n#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\nuniform float numParticles, numParticlesPot;\nuniform float graphSampleSize;\nuniform float graphNumSamples;\nuniform float stretch;\nuniform vec3 wrapBounds;\nuniform vec3 emitterScale, emitterPos, faceTangent, faceBinorm;\nuniform float rate, rateDiv, lifetime, deltaRandomnessStatic, scaleDivMult, alphaDivMult, seed, delta;\nuniform sampler2D particleTexOUT, particleTexIN;\nuniform highp sampler2D internalTex0;\nuniform highp sampler2D internalTex1;\nuniform highp sampler2D internalTex2;\n#ifndef CAMERAPLANES\n#define CAMERAPLANES\nuniform vec4 camera_params;\n#endif\nvarying vec4 texCoordsAlphaLife;\nvec3 inPos;\nvec3 inVel;\nfloat inAngle;\nbool inShow;\nfloat inLife;\n",particle_lambertPS:"\tvec3 negNormal = max(normal, vec3(0.0));\n\tvec3 posNormal = max(-normal, vec3(0.0));\n",particle_lightingPS:"\tvec3 light = negNormal.x*lightCube[0] + posNormal.x*lightCube[1] +\n\t\t\t\t\t\tnegNormal.y*lightCube[2] + posNormal.y*lightCube[3] +\n\t\t\t\t\t\tnegNormal.z*lightCube[4] + posNormal.z*lightCube[5];\n\trgb *= light;\n",particle_localShiftVS:"\tparticlePos = (matrix_model * vec4(particlePos, 1.0)).xyz;\n",particle_meshVS:"\tvec3 localPos = meshLocalPos;\n\tlocalPos.xy = rotate(localPos.xy, inAngle, rotMatrix);\n\tlocalPos.yz = rotate(localPos.yz, inAngle, rotMatrix);\n\tbillboard(particlePos, quadXY);\n",particle_normalVS:"\tNormal = normalize(localPos + matrix_viewInverse[2].xyz);\n",particle_normalMapPS:"\tvec3 normalMap = normalize(texture2D(normalMap, vec2(texCoordsAlphaLife.x, 1.0 - texCoordsAlphaLife.y)).xyz * 2.0 - 1.0);\n\tvec3 normal = ParticleMat * normalMap;\n",particle_pointAlongVS:"\tinAngle = atan(velocityV.x, velocityV.y);\n",particle_softPS:"\tfloat depth = getLinearScreenDepth();\n\tfloat particleDepth = vDepth;\n\tfloat depthDiff = saturate(abs(particleDepth - depth) * softening);\n\ta *= depthDiff;\n",particle_softVS:"\tvDepth = getLinearDepth(localPos);\n",particle_stretchVS:"\tvec3 moveDir = inVel * stretch;\n\tvec3 posPrev = particlePos - moveDir;\n\tposPrev += particlePosMoved;\n\tvec2 centerToVertexV = normalize((mat3(matrix_view) * localPos).xy);\n\tfloat interpolation = dot(-velocityV, centerToVertexV) * 0.5 + 0.5;\n\tparticlePos = mix(particlePos, posPrev, interpolation);\n",particle_TBNVS:"\tmat3 rot3 = mat3(rotMatrix[0][0], rotMatrix[0][1], 0.0, rotMatrix[1][0], rotMatrix[1][1], 0.0, 0.0, 0.0, 1.0);\n\tParticleMat = mat3(-matrix_viewInverse[0].xyz, -matrix_viewInverse[1].xyz, matrix_viewInverse[2].xyz) * rot3;\n",particle_wrapVS:"\tvec3 origParticlePos = particlePos;\n\tparticlePos -= matrix_model[3].xyz;\n\tparticlePos = mod(particlePos, wrapBounds) - wrapBounds * 0.5;\n\tparticlePos += matrix_model[3].xyz;\n\tparticlePosMoved = particlePos - origParticlePos;\n",precisionTestPS:"void main(void) {\n\tgl_FragColor = vec4(2147483648.0);\n}\n",precisionTest2PS:"uniform sampler2D source;\nvec4 packFloat(float depth) {\n\tconst vec4 bit_shift = vec4(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0);\n\tconst vec4 bit_mask\t= vec4(0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0);\n\tvec4 res = mod(depth * bit_shift * vec4(255), vec4(256) ) / vec4(255);\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main(void) {\n\tfloat c = texture2D(source, vec2(0.0)).r;\n\tfloat diff = abs(c - 2147483648.0) / 2147483648.0;\n\tgl_FragColor = packFloat(diff);\n}\n",reflDirPS:"void getReflDir() {\n\tdReflDirW = normalize(-reflect(dViewDirW, dNormalW));\n}\n",reflDirAnisoPS:"void getReflDir() {\n\tfloat roughness = sqrt(1.0 - min(dGlossiness, 1.0));\n\tfloat anisotropy = material_anisotropy * roughness;\n\tvec3 anisotropicDirection = anisotropy >= 0.0 ? dTBN[1] : dTBN[0];\n\tvec3 anisotropicTangent = cross(anisotropicDirection, dViewDirW);\n\tvec3 anisotropicNormal = cross(anisotropicTangent, anisotropicDirection);\n\tvec3 bentNormal = normalize(mix(normalize(dNormalW), normalize(anisotropicNormal), anisotropy));\n\tdReflDirW = reflect(-dViewDirW, bentNormal);\n}\n",reflectionCCPS:"#ifdef CLEARCOAT\nuniform float material_clearCoatReflectivity;\nvoid addReflectionCC() {\n\tccReflection += vec4(calcReflection(ccReflDirW, ccGlossiness), material_clearCoatReflectivity);\n}\n#endif\n",reflectionCubePS:"uniform samplerCube texture_cubeMap;\nuniform float material_reflectivity;\nvec3 calcReflection(vec3 tReflDirW, float tGlossiness) {\n\tvec3 lookupVec = fixSeams(cubeMapProject(tReflDirW));\n\tlookupVec.x *= -1.0;\n\treturn $DECODE(textureCube(texture_cubeMap, lookupVec));\n}\nvoid addReflection() {\n\tdReflection += vec4(calcReflection(dReflDirW, dGlossiness), material_reflectivity);\n}\n",reflectionEnvPS:"#ifndef ENV_ATLAS\n#define ENV_ATLAS\nuniform sampler2D texture_envAtlas;\n#endif\nuniform float material_reflectivity;\nfloat shinyMipLevel(vec2 uv) {\n\tvec2 dx = dFdx(uv);\n\tvec2 dy = dFdy(uv);\n\tvec2 uv2 = vec2(fract(uv.x + 0.5), uv.y);\n\tvec2 dx2 = dFdx(uv2);\n\tvec2 dy2 = dFdy(uv2);\n\tfloat maxd = min(max(dot(dx, dx), dot(dy, dy)), max(dot(dx2, dx2), dot(dy2, dy2)));\n\treturn clamp(0.5 * log2(maxd) - 1.0 + textureBias, 0.0, 5.0);\n}\nvec3 calcReflection(vec3 tReflDirW, float tGlossiness) {\n\tvec3 dir = cubeMapProject(tReflDirW) * vec3(-1.0, 1.0, 1.0);\n\tvec2 uv = toSphericalUv(dir);\n\tfloat level = saturate(1.0 - tGlossiness) * 5.0;\n\tfloat ilevel = floor(level);\n\tfloat level2 = shinyMipLevel(uv * atlasSize);\n\tfloat ilevel2 = floor(level2);\n\tvec2 uv0, uv1;\n\tfloat weight;\n\tif (ilevel == 0.0) {\n\t\tuv0 = mapMip(uv, ilevel2);\n\t\tuv1 = mapMip(uv, ilevel2 + 1.0);\n\t\tweight = level2 - ilevel2;\n\t} else {\n\t\tuv0 = uv1 = mapRoughnessUv(uv, ilevel);\n\t\tweight = 0.0;\n\t}\n\tvec3 linearA = $DECODE(texture2D(texture_envAtlas, uv0));\n\tvec3 linearB = $DECODE(texture2D(texture_envAtlas, uv1));\n\tvec3 linear0 = mix(linearA, linearB, weight);\n\tvec3 linear1 = $DECODE(texture2D(texture_envAtlas, mapRoughnessUv(uv, ilevel + 1.0)));\n\treturn processEnvironment(mix(linear0, linear1, level - ilevel));\n}\nvoid addReflection() {\n\tdReflection += vec4(calcReflection(dReflDirW, dGlossiness), material_reflectivity);\n}\n",reflectionSpherePS:"#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\nuniform sampler2D texture_sphereMap;\nuniform float material_reflectivity;\nvec3 calcReflection(vec3 tReflDirW, float tGlossiness) {\n\tvec3 reflDirV = (mat3(matrix_view) * tReflDirW).xyz;\n\tfloat m = 2.0 * sqrt( dot(reflDirV.xy, reflDirV.xy) + (reflDirV.z+1.0)*(reflDirV.z+1.0) );\n\tvec2 sphereMapUv = reflDirV.xy / m + 0.5;\n\treturn $DECODE(texture2D(texture_sphereMap, sphereMapUv));\n}\nvoid addReflection() {\n\tdReflection += vec4(calcReflection(dReflDirW, dGlossiness), material_reflectivity);\n}\n",reflectionSphereLowPS:"uniform sampler2D texture_sphereMap;\nuniform float material_reflectivity;\nvec3 calcReflection(vec3 tReflDirW, float tGlossiness) {\n\tvec3 reflDirV = vNormalV;\n\tvec2 sphereMapUv = reflDirV.xy * 0.5 + 0.5;\n\treturn $DECODE(texture2D(texture_sphereMap, sphereMapUv));\n}\nvoid addReflection() {\n\tdReflection += vec4(calcReflection(dReflDirW, dGlossiness), material_reflectivity);\n}\n",refractionPS:"uniform float material_refraction, material_refractionIndex;\nvec3 refract2(vec3 viewVec, vec3 Normal, float IOR) {\n\tfloat vn = dot(viewVec, Normal);\n\tfloat k = 1.0 - IOR * IOR * (1.0 - vn * vn);\n\tvec3 refrVec = IOR * viewVec - (IOR * vn + sqrt(k)) * Normal;\n\treturn refrVec;\n}\nvoid addRefraction() {\n\tvec3 tmp = dReflDirW;\n\tvec4 tmp2 = dReflection;\n\tdReflection = vec4(0.0);\n\tdReflDirW = refract2(-dViewDirW, dNormalW, material_refractionIndex);\n\taddReflection();\n\tdDiffuseLight = mix(dDiffuseLight, dReflection.rgb * dAlbedo, material_refraction);\n\tdReflDirW = tmp;\n\tdReflection = tmp2;\n}\n",reprojectPS:"varying vec2 vUv0;\nuniform sampler2D sourceTex;\nuniform samplerCube sourceCube;\nuniform sampler2D samplesTex;\nuniform vec2 samplesTexInverseSize;\nuniform vec4 params;\nuniform vec2 params2;\nfloat targetFace() { return params.x; }\nfloat specularPower() { return params.y; }\nfloat sourceCubeSeamScale() { return params.z; }\nfloat targetCubeSeamScale() { return params.w; }\nfloat targetTotalPixels() { return params2.x; }\nfloat sourceTotalPixels() { return params2.y; }\nfloat PI = 3.141592653589793;\nfloat saturate(float x) {\n\treturn clamp(x, 0.0, 1.0);\n}\nvec3 decodeLinear(vec4 source) {\n\treturn source.rgb;\n}\nvec4 encodeLinear(vec3 source) {\n\treturn vec4(source, 1.0);\n}\nvec3 decodeGamma(vec4 source) {\n\treturn pow(source.xyz, vec3(2.2));\n}\nvec4 encodeGamma(vec3 source) {\n\treturn vec4(pow(source + 0.0000001, vec3(1.0 / 2.2)), 1.0);\n}\nvec3 decodeRGBM(vec4 rgbm) {\n\tvec3 color = (8.0 * rgbm.a) * rgbm.rgb;\n\treturn color * color;\n}\nvec4 encodeRGBM(vec3 source) {\n\tvec4 result;\n\tresult.rgb = pow(source.rgb, vec3(0.5));\n\tresult.rgb *= 1.0 / 8.0;\n\tresult.a = saturate( max( max( result.r, result.g ), max( result.b, 1.0 / 255.0 ) ) );\n\tresult.a = ceil(result.a * 255.0) / 255.0;\n\tresult.rgb /= result.a;\n\treturn result;\n}\nvec3 decodeRGBE(vec4 source) {\n\tif (source.a == 0.0) {\n\t\treturn vec3(0.0, 0.0, 0.0);\n\t} else {\n\t\treturn source.xyz * pow(2.0, source.w * 255.0 - 128.0);\n\t}\n}\nvec4 encodeRGBE(vec3 source) {\n\tfloat maxVal = max(source.x, max(source.y, source.z));\n\tif (maxVal < 1e-32) {\n\t\treturn vec4(0, 0, 0, 0);\n\t} else {\n\t\tfloat e = ceil(log2(maxVal));\n\t\treturn vec4(source / pow(2.0, e), (e + 128.0) / 255.0);\n\t}\n}\nvec3 modifySeams(vec3 dir, float scale) {\n\tvec3 adir = abs(dir);\n\tfloat M = max(max(adir.x, adir.y), adir.z);\n\treturn dir / M * vec3(\n\t\tadir.x == M ? 1.0 : scale,\n\t\tadir.y == M ? 1.0 : scale,\n\t\tadir.z == M ? 1.0 : scale\n\t);\n}\nvec2 toSpherical(vec3 dir) {\n\treturn vec2(dir.xz == vec2(0.0) ? 0.0 : atan(dir.x, dir.z), asin(dir.y));\n}\nvec3 fromSpherical(vec2 uv) {\n\treturn vec3(cos(uv.y) * sin(uv.x),\n\t\t\t\tsin(uv.y),\n\t\t\t\tcos(uv.y) * cos(uv.x));\n}\nvec3 getDirectionEquirect() {\n\treturn fromSpherical((vec2(vUv0.x, 1.0 - vUv0.y) * 2.0 - 1.0) * vec2(PI, PI * 0.5));\n}\nvec4 sampleEquirect(vec2 sph) {\n\tvec2 uv = sph / vec2(PI * 2.0, PI) + 0.5;\n\treturn texture2D(sourceTex, vec2(uv.x, 1.0 - uv.y));\n}\nvec4 sampleEquirect(vec3 dir) {\n\treturn sampleEquirect(toSpherical(dir));\n}\nvec4 sampleCubemap(vec3 dir) {\n\treturn textureCube(sourceCube, modifySeams(dir, 1.0 - sourceCubeSeamScale()));\n}\nvec4 sampleCubemap(vec2 sph) {\n\treturn sampleCubemap(fromSpherical(sph));\n}\nvec4 sampleEquirect(vec2 sph, float mipLevel) {\n\tvec2 uv = sph / vec2(PI * 2.0, PI) + 0.5;\n#ifdef SUPPORTS_TEXLOD\n\treturn texture2DLodEXT(sourceTex, vec2(uv.x, 1.0 - uv.y), mipLevel);\n#else\n\treturn texture2D(sourceTex, vec2(uv.x, 1.0 - uv.y));\n#endif\n}\nvec4 sampleEquirect(vec3 dir, float mipLevel) {\n\treturn sampleEquirect(toSpherical(dir), mipLevel);\n}\nvec4 sampleCubemap(vec3 dir, float mipLevel) {\n#ifdef SUPPORTS_TEXLOD\n\treturn textureCubeLodEXT(sourceCube, modifySeams(dir, 1.0 - exp2(mipLevel) * sourceCubeSeamScale()), mipLevel);\n#else\n\treturn textureCube(sourceCube, modifySeams(dir, 1.0 - exp2(mipLevel) * sourceCubeSeamScale()));\n#endif\n}\nvec4 sampleCubemap(vec2 sph, float mipLevel) {\n\treturn sampleCubemap(fromSpherical(sph), mipLevel);\n}\nfloat signNotZero(float k){\n\treturn(k >= 0.0) ? 1.0 : -1.0;\n}\nvec2 signNotZero(vec2 v) {\n\treturn vec2(signNotZero(v.x), signNotZero(v.y));\n}\nvec3 octDecode(vec2 o) {\n\tvec3 v = vec3(o.x, 1.0 - abs(o.x) - abs(o.y), o.y);\n\tif (v.y < 0.0) {\n\t\tv.xz = (1.0 - abs(v.zx)) * signNotZero(v.xz);\n\t}\n\treturn normalize(v);\n}\nvec3 getDirectionOctahedral() {\n\treturn octDecode(vec2(vUv0.x, 1.0 - vUv0.y) * 2.0 - 1.0);\n}\nvec2 octEncode(in vec3 v) {\n\tfloat l1norm = abs(v.x) + abs(v.y) + abs(v.z);\n\tvec2 result = v.xz * (1.0 / l1norm);\n\tif (v.y < 0.0) {\n\t\tresult = (1.0 - abs(result.yx)) * signNotZero(result.xy);\n\t}\n\treturn result;\n}\nvec4 sampleOctahedral(vec3 dir) {\n\tvec2 uv = octEncode(dir) * 0.5 + 0.5;\n\treturn texture2D(sourceTex, vec2(uv.x, 1.0 - uv.y));\n}\nvec4 sampleOctahedral(vec2 sph) {\n\treturn sampleOctahedral(fromSpherical(sph));\n}\nvec4 sampleOctahedral(vec3 dir, float mipLevel) {\n\tvec2 uv = octEncode(dir) * 0.5 + 0.5;\n#ifdef SUPPORTS_TEXLOD\n\treturn texture2DLodEXT(sourceTex, vec2(uv.x, 1.0 - uv.y), mipLevel);\n#else\n\treturn texture2D(sourceTex, vec2(uv.x, 1.0 - uv.y));\n#endif\n}\nvec4 sampleOctahedral(vec2 sph, float mipLevel) {\n\treturn sampleOctahedral(fromSpherical(sph), mipLevel);\n}\nvec3 getDirectionCubemap() {\n\tvec2 st = vUv0 * 2.0 - 1.0;\n\tfloat face = targetFace();\n\tvec3 vec;\n\tif (face == 0.0) {\n\t\tvec = vec3(1, -st.y, -st.x);\n\t} else if (face == 1.0) {\n\t\tvec = vec3(-1, -st.y, st.x);\n\t} else if (face == 2.0) {\n\t\tvec = vec3(st.x, 1, st.y);\n\t} else if (face == 3.0) {\n\t\tvec = vec3(st.x, -1, -st.y);\n\t} else if (face == 4.0) {\n\t\tvec = vec3(st.x, -st.y, 1);\n\t} else {\n\t\tvec = vec3(-st.x, -st.y, -1);\n\t}\n\treturn normalize(modifySeams(vec, 1.0 / (1.0 - targetCubeSeamScale())));\n}\nmat3 matrixFromVector(vec3 n) {\n\tfloat a = 1.0 / (1.0 + n.z);\n\tfloat b = -n.x * n.y * a;\n\tvec3 b1 = vec3(1.0 - n.x * n.x * a, b, -n.x);\n\tvec3 b2 = vec3(b, 1.0 - n.y * n.y * a, -n.y);\n\treturn mat3(b1, b2, n);\n}\nmat3 matrixFromVectorSlow(vec3 n) {\n\tvec3 up = (1.0 - abs(n.y) <= 0.0000001) ? vec3(0.0, 0.0, n.y > 0.0 ? 1.0 : -1.0) : vec3(0.0, 1.0, 0.0);\n\tvec3 x = normalize(cross(up, n));\n\tvec3 y = cross(n, x);\n\treturn mat3(x, y, n);\n}\nvec4 reproject() {\n\tif (NUM_SAMPLES <= 1) {\n\t\treturn ENCODE_FUNC(DECODE_FUNC(SOURCE_FUNC(TARGET_FUNC())));\n\t} else {\n\t\tvec2 sph = toSpherical(TARGET_FUNC());\n\t\tvec2 sphu = dFdx(sph);\n\t\tvec2 sphv = dFdy(sph);\n\t\tconst float NUM_SAMPLES_SQRT = sqrt(float(NUM_SAMPLES));\n\t\tvec3 result = vec3(0.0);\n\t\tfor (float u = 0.0; u < NUM_SAMPLES_SQRT; ++u) {\n\t\t\tfor (float v = 0.0; v < NUM_SAMPLES_SQRT; ++v) {\n\t\t\t\tresult += DECODE_FUNC(SOURCE_FUNC(sph +\n\t\t\t\t\t\t\t\t\t\t\t\t\tsphu * (u / NUM_SAMPLES_SQRT - 0.5) +\n\t\t\t\t\t\t\t\t\t\t\t\t\tsphv * (v / NUM_SAMPLES_SQRT - 0.5)));\n\t\t\t}\n\t\t}\n\t\treturn ENCODE_FUNC(result / (NUM_SAMPLES_SQRT * NUM_SAMPLES_SQRT));\n\t}\n}\nvec4 unpackFloat = vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0);\nvoid unpackSample(int i, out vec3 L, out float mipLevel) {\n\tfloat u = (float(i * 4) + 0.5) * samplesTexInverseSize.x;\n\tfloat v = (floor(u) + 0.5) * samplesTexInverseSize.y;\n\tvec4 raw;\n\traw.x = dot(texture2D(samplesTex, vec2(u, v)), unpackFloat); u += samplesTexInverseSize.x;\n\traw.y = dot(texture2D(samplesTex, vec2(u, v)), unpackFloat); u += samplesTexInverseSize.x;\n\traw.z = dot(texture2D(samplesTex, vec2(u, v)), unpackFloat); u += samplesTexInverseSize.x;\n\traw.w = dot(texture2D(samplesTex, vec2(u, v)), unpackFloat);\n\tL.xyz = raw.xyz * 2.0 - 1.0;\n\tmipLevel = raw.w * 8.0;\n}\nvec4 prefilterSamples() {\n\tmat3 vecSpace = matrixFromVectorSlow(TARGET_FUNC());\n\tvec3 L;\n\tfloat mipLevel;\n\tvec3 result = vec3(0.0);\n\tfloat totalWeight = 0.0;\n\tfor (int i = 0; i < NUM_SAMPLES; ++i) {\n\t\tunpackSample(i, L, mipLevel);\n\t\tresult += DECODE_FUNC(SOURCE_FUNC(vecSpace * L, mipLevel)) * L.z;\n\t\ttotalWeight += L.z;\n\t}\n\treturn ENCODE_FUNC(result / totalWeight);\n}\nvec4 prefilterSamplesUnweighted() {\n\tmat3 vecSpace = matrixFromVectorSlow(TARGET_FUNC());\n\tvec3 L;\n\tfloat mipLevel;\n\tvec3 result = vec3(0.0);\n\tfloat totalWeight = 0.0;\n\tfor (int i = 0; i < NUM_SAMPLES; ++i) {\n\t\tunpackSample(i, L, mipLevel);\n\t\tresult += DECODE_FUNC(SOURCE_FUNC(vecSpace * L, mipLevel));\n\t}\n\treturn ENCODE_FUNC(result / float(NUM_SAMPLES));\n}\nvoid main(void) {\n\tgl_FragColor = PROCESS_FUNC();\n}\n",rgbmPS:"vec3 texture2DRGBM(sampler2D tex, vec2 uv) {\n\treturn decodeRGBM(texture2D(tex, uv));\n}\nvec3 texture2DRGBM(sampler2D tex, vec2 uv, float bias) {\n\treturn decodeRGBM(texture2D(tex, uv, bias));\n}\nvec3 textureCubeRGBM(samplerCube tex, vec3 uvw) {\n\treturn decodeRGBM(textureCube(tex, uvw));\n}\n",screenDepthPS:"uniform highp sampler2D uDepthMap;\n#ifndef SCREENSIZE\n#define SCREENSIZE\nuniform vec4 uScreenSize;\n#endif\n#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\n#ifndef CAMERAPLANES\n#define CAMERAPLANES\nuniform vec4 camera_params;\n#endif\n#ifdef GL2\nfloat linearizeDepth(float z) {\n\tz = z * 2.0 - 1.0;\n\treturn 1.0 / (camera_params.z * z + camera_params.w);\n}\n#else\n#ifndef UNPACKFLOAT\n#define UNPACKFLOAT\nfloat unpackFloat(vec4 rgbaDepth) {\n\tconst vec4 bitShift = vec4(1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0);\n\treturn dot(rgbaDepth, bitShift);\n}\n#endif\n#endif\nfloat getLinearScreenDepth(vec2 uv) {\n\t#ifdef GL2\n\treturn linearizeDepth(texture2D(uDepthMap, uv).r) * camera_params.y;\n\t#else\n\treturn unpackFloat(texture2D(uDepthMap, uv)) * camera_params.y;\n\t#endif\n}\n#ifndef VERTEXSHADER\nfloat getLinearScreenDepth() {\n\tvec2 uv = gl_FragCoord.xy * uScreenSize.zw;\n\treturn getLinearScreenDepth(uv);\n}\n#endif\nfloat getLinearDepth(vec3 pos) {\n\treturn -(matrix_view * vec4(pos, 1.0)).z;\n}\n",shadowCascadesPS:"const float maxCascades = 4.0;\nmat4 cascadeShadowMat;\nvoid getShadowCascadeMatrix(mat4 shadowMatrixPalette[4], float shadowCascadeDistances[4], float shadowCascadeCount) {\n\tfloat depth = 1.0 / gl_FragCoord.w;\n\tfloat cascadeIndex = 0.0;\n\tfor (float i = 0.0; i < maxCascades; i++) {\n\t\tif (depth < shadowCascadeDistances[int(i)]) {\n\t\t\tcascadeIndex = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\tcascadeIndex = min(cascadeIndex, shadowCascadeCount - 1.0);\n\t#ifdef GL2\n\t\tcascadeShadowMat = shadowMatrixPalette[int(cascadeIndex)];\n\t#else\n\t\tif (cascadeIndex == 0.0) {\n\t\t\tcascadeShadowMat = shadowMatrixPalette[0];\n\t\t}\n\t\telse if (cascadeIndex == 1.0) {\n\t\t\tcascadeShadowMat = shadowMatrixPalette[1];\n\t\t}\n\t\telse if (cascadeIndex == 2.0) {\n\t\t\tcascadeShadowMat = shadowMatrixPalette[2];\n\t\t}\n\t\telse {\n\t\t\tcascadeShadowMat = shadowMatrixPalette[3];\n\t\t}\n\t#endif\n}\nvoid fadeShadow(float shadowCascadeDistances[4]) {\n\tfloat depth = 1.0 / gl_FragCoord.w;\n\tif (depth > shadowCascadeDistances[int(maxCascades - 1.0)]) {\n\t\tdShadowCoord.z = -9999999.0;\n\t}\n}\n",shadowCommonPS:"void normalOffsetPointShadow(vec4 shadowParams) {\n\tfloat distScale = length(dLightDirW);\n\tvec3 wPos = vPositionW + dVertexNormalW * shadowParams.y * clamp(1.0 - dot(dVertexNormalW, -dLightDirNormW), 0.0, 1.0) * distScale;\n\tvec3 dir = wPos - dLightPosW;\n\tdLightDirW = dir;\n}\n",shadowCoordPS:"void _getShadowCoordOrtho(mat4 shadowMatrix, vec3 shadowParams, vec3 wPos) {\n\tdShadowCoord = (shadowMatrix * vec4(wPos, 1.0)).xyz;\n\tdShadowCoord.z = saturate(dShadowCoord.z) - 0.0001;\n\t#ifdef SHADOWBIAS\n\tdShadowCoord.z += getShadowBias(shadowParams.x, shadowParams.z);\n\t#endif\n}\nvoid _getShadowCoordPersp(mat4 shadowMatrix, vec4 shadowParams, vec3 wPos) {\n\tvec4 projPos = shadowMatrix * vec4(wPos, 1.0);\n\tprojPos.xy /= projPos.w;\n\tdShadowCoord.xy = projPos.xy;\n\tdShadowCoord.z = length(dLightDirW) * shadowParams.w;\n\t#ifdef SHADOWBIAS\n\tdShadowCoord.z += getShadowBias(shadowParams.x, shadowParams.z);\n\t#endif\n}\nvoid getShadowCoordOrtho(mat4 shadowMatrix, vec3 shadowParams) {\n\t_getShadowCoordOrtho(shadowMatrix, shadowParams, vPositionW);\n}\nvoid getShadowCoordPersp(mat4 shadowMatrix, vec4 shadowParams) {\n\t_getShadowCoordPersp(shadowMatrix, shadowParams, vPositionW);\n}\nvoid getShadowCoordPerspNormalOffset(mat4 shadowMatrix, vec4 shadowParams) {\n\tfloat distScale = abs(dot(vPositionW - dLightPosW, dLightDirNormW));\n\tvec3 wPos = vPositionW + dVertexNormalW * shadowParams.y * clamp(1.0 - dot(dVertexNormalW, -dLightDirNormW), 0.0, 1.0) * distScale;\n\t_getShadowCoordPersp(shadowMatrix, shadowParams, wPos);\n}\nvoid getShadowCoordOrthoNormalOffset(mat4 shadowMatrix, vec3 shadowParams) {\n\tvec3 wPos = vPositionW + dVertexNormalW * shadowParams.y * clamp(1.0 - dot(dVertexNormalW, -dLightDirNormW), 0.0, 1.0);\n\t_getShadowCoordOrtho(shadowMatrix, shadowParams, wPos);\n}\n",shadowCoordPerspZbufferPS:"void _getShadowCoordPerspZbuffer(mat4 shadowMatrix, vec4 shadowParams, vec3 wPos) {\n\tvec4 projPos = shadowMatrix * vec4(wPos, 1.0);\n\tprojPos.xyz /= projPos.w;\n\tdShadowCoord = projPos.xyz;\n}\nvoid getShadowCoordPerspZbufferNormalOffset(mat4 shadowMatrix, vec4 shadowParams) {\n\tfloat distScale = abs(dot(vPositionW - dLightPosW, dLightDirNormW));\n\tvec3 wPos = vPositionW + dVertexNormalW * shadowParams.y * clamp(1.0 - dot(dVertexNormalW, -dLightDirNormW), 0.0, 1.0) * distScale;\n\t_getShadowCoordPerspZbuffer(shadowMatrix, shadowParams, wPos);\n}\nvoid getShadowCoordPerspZbuffer(mat4 shadowMatrix, vec4 shadowParams) {\n\t_getShadowCoordPerspZbuffer(shadowMatrix, shadowParams, vPositionW);\n}\n",shadowEVSMPS:"float VSM$(sampler2D tex, vec2 texCoords, float resolution, float Z, float vsmBias, float exponent) {\n\tvec3 moments = texture2D(tex, texCoords).xyz;\n\treturn calculateEVSM(moments, Z, vsmBias, exponent);\n}\nfloat getShadowVSM$(sampler2D shadowMap, vec3 shadowParams, float exponent) {\n\treturn VSM$(shadowMap, dShadowCoord.xy, shadowParams.x, dShadowCoord.z, shadowParams.y, exponent);\n}\nfloat getShadowSpotVSM$(sampler2D shadowMap, vec4 shadowParams, float exponent) {\n\treturn VSM$(shadowMap, dShadowCoord.xy, shadowParams.x, length(dLightDirW) * shadowParams.w + shadowParams.z, shadowParams.y, exponent);\n}\n",shadowEVSMnPS:"float VSM$(sampler2D tex, vec2 texCoords, float resolution, float Z, float vsmBias, float exponent) {\n\tfloat pixelSize = 1.0 / resolution;\n\ttexCoords -= vec2(pixelSize);\n\tvec3 s00 = texture2D(tex, texCoords).xyz;\n\tvec3 s10 = texture2D(tex, texCoords + vec2(pixelSize, 0)).xyz;\n\tvec3 s01 = texture2D(tex, texCoords + vec2(0, pixelSize)).xyz;\n\tvec3 s11 = texture2D(tex, texCoords + vec2(pixelSize)).xyz;\n\tvec2 fr = fract(texCoords * resolution);\n\tvec3 h0 = mix(s00, s10, fr.x);\n\tvec3 h1 = mix(s01, s11, fr.x);\n\tvec3 moments = mix(h0, h1, fr.y);\n\treturn calculateEVSM(moments, Z, vsmBias, exponent);\n}\nfloat getShadowVSM$(sampler2D shadowMap, vec3 shadowParams, float exponent) {\n\treturn VSM$(shadowMap, dShadowCoord.xy, shadowParams.x, dShadowCoord.z, shadowParams.y, exponent);\n}\nfloat getShadowSpotVSM$(sampler2D shadowMap, vec4 shadowParams, float exponent) {\n\treturn VSM$(shadowMap, dShadowCoord.xy, shadowParams.x, length(dLightDirW) * shadowParams.w + shadowParams.z, shadowParams.y, exponent);\n}\n",shadowStandardPS:"vec3 lessThan2(vec3 a, vec3 b) {\n\treturn clamp((b - a)*1000.0, 0.0, 1.0);\n}\n#ifndef UNPACKFLOAT\n#define UNPACKFLOAT\nfloat unpackFloat(vec4 rgbaDepth) {\n\tconst vec4 bitShift = vec4(1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0);\n\treturn dot(rgbaDepth, bitShift);\n}\n#endif\n#ifdef GL2\nfloat _getShadowPCF3x3(sampler2DShadow shadowMap, vec3 shadowParams) {\n\tfloat z = dShadowCoord.z;\n\tvec2 uv = dShadowCoord.xy * shadowParams.x;\n\tfloat shadowMapSizeInv = 1.0 / shadowParams.x;\n\tvec2 base_uv = floor(uv + 0.5);\n\tfloat s = (uv.x + 0.5 - base_uv.x);\n\tfloat t = (uv.y + 0.5 - base_uv.y);\n\tbase_uv -= vec2(0.5);\n\tbase_uv *= shadowMapSizeInv;\n\tfloat sum = 0.0;\n\tfloat uw0 = (3.0 - 2.0 * s);\n\tfloat uw1 = (1.0 + 2.0 * s);\n\tfloat u0 = (2.0 - s) / uw0 - 1.0;\n\tfloat u1 = s / uw1 + 1.0;\n\tfloat vw0 = (3.0 - 2.0 * t);\n\tfloat vw1 = (1.0 + 2.0 * t);\n\tfloat v0 = (2.0 - t) / vw0 - 1.0;\n\tfloat v1 = t / vw1 + 1.0;\n\tu0 = u0 * shadowMapSizeInv + base_uv.x;\n\tv0 = v0 * shadowMapSizeInv + base_uv.y;\n\tu1 = u1 * shadowMapSizeInv + base_uv.x;\n\tv1 = v1 * shadowMapSizeInv + base_uv.y;\n\tsum += uw0 * vw0 * texture(shadowMap, vec3(u0, v0, z));\n\tsum += uw1 * vw0 * texture(shadowMap, vec3(u1, v0, z));\n\tsum += uw0 * vw1 * texture(shadowMap, vec3(u0, v1, z));\n\tsum += uw1 * vw1 * texture(shadowMap, vec3(u1, v1, z));\n\tsum *= 1.0f / 16.0;\n\treturn sum;\n}\nfloat getShadowPCF3x3(sampler2DShadow shadowMap, vec3 shadowParams) {\n\treturn _getShadowPCF3x3(shadowMap, shadowParams);\n}\nfloat getShadowSpotPCF3x3(sampler2DShadow shadowMap, vec4 shadowParams) {\n\treturn _getShadowPCF3x3(shadowMap, shadowParams.xyz);\n}\n#else\nfloat _xgetShadowPCF3x3(mat3 depthKernel, sampler2D shadowMap, vec3 shadowParams) {\n\tmat3 shadowKernel;\n\tvec3 shadowCoord = dShadowCoord;\n\tvec3 shadowZ = vec3(shadowCoord.z);\n\tshadowKernel[0] = vec3(greaterThan(depthKernel[0], shadowZ));\n\tshadowKernel[1] = vec3(greaterThan(depthKernel[1], shadowZ));\n\tshadowKernel[2] = vec3(greaterThan(depthKernel[2], shadowZ));\n\tvec2 fractionalCoord = fract( shadowCoord.xy * shadowParams.x );\n\tshadowKernel[0] = mix(shadowKernel[0], shadowKernel[1], fractionalCoord.x);\n\tshadowKernel[1] = mix(shadowKernel[1], shadowKernel[2], fractionalCoord.x);\n\tvec4 shadowValues;\n\tshadowValues.x = mix(shadowKernel[0][0], shadowKernel[0][1], fractionalCoord.y);\n\tshadowValues.y = mix(shadowKernel[0][1], shadowKernel[0][2], fractionalCoord.y);\n\tshadowValues.z = mix(shadowKernel[1][0], shadowKernel[1][1], fractionalCoord.y);\n\tshadowValues.w = mix(shadowKernel[1][1], shadowKernel[1][2], fractionalCoord.y);\n\treturn dot( shadowValues, vec4( 1.0 ) ) * 0.25;\n}\nfloat _getShadowPCF3x3(sampler2D shadowMap, vec3 shadowParams) {\n\tvec3 shadowCoord = dShadowCoord;\n\tfloat xoffset = 1.0 / shadowParams.x;\n\tfloat dx0 = -xoffset;\n\tfloat dx1 = xoffset;\n\tmat3 depthKernel;\n\tdepthKernel[0][0] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx0, dx0)));\n\tdepthKernel[0][1] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx0, 0.0)));\n\tdepthKernel[0][2] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx0, dx1)));\n\tdepthKernel[1][0] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(0.0, dx0)));\n\tdepthKernel[1][1] = unpackFloat(texture2D(shadowMap, shadowCoord.xy));\n\tdepthKernel[1][2] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(0.0, dx1)));\n\tdepthKernel[2][0] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx1, dx0)));\n\tdepthKernel[2][1] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx1, 0.0)));\n\tdepthKernel[2][2] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx1, dx1)));\n\treturn _xgetShadowPCF3x3(depthKernel, shadowMap, shadowParams);\n}\nfloat getShadowPCF3x3(sampler2D shadowMap, vec3 shadowParams) {\n\treturn _getShadowPCF3x3(shadowMap, shadowParams);\n}\nfloat getShadowSpotPCF3x3(sampler2D shadowMap, vec4 shadowParams) {\n\treturn _getShadowPCF3x3(shadowMap, shadowParams.xyz);\n}\n#endif\nfloat _getShadowPoint(samplerCube shadowMap, vec4 shadowParams, vec3 dir) {\n\tvec3 tc = normalize(dir);\n\tvec3 tcAbs = abs(tc);\n\tvec4 dirX = vec4(1,0,0, tc.x);\n\tvec4 dirY = vec4(0,1,0, tc.y);\n\tfloat majorAxisLength = tc.z;\n\tif ((tcAbs.x > tcAbs.y) && (tcAbs.x > tcAbs.z)) {\n\t\tdirX = vec4(0,0,1, tc.z);\n\t\tdirY = vec4(0,1,0, tc.y);\n\t\tmajorAxisLength = tc.x;\n\t} else if ((tcAbs.y > tcAbs.x) && (tcAbs.y > tcAbs.z)) {\n\t\tdirX = vec4(1,0,0, tc.x);\n\t\tdirY = vec4(0,0,1, tc.z);\n\t\tmajorAxisLength = tc.y;\n\t}\n\tfloat shadowParamsInFaceSpace = ((1.0/shadowParams.x) * 2.0) * abs(majorAxisLength);\n\tvec3 xoffset = (dirX.xyz * shadowParamsInFaceSpace);\n\tvec3 yoffset = (dirY.xyz * shadowParamsInFaceSpace);\n\tvec3 dx0 = -xoffset;\n\tvec3 dy0 = -yoffset;\n\tvec3 dx1 = xoffset;\n\tvec3 dy1 = yoffset;\n\tmat3 shadowKernel;\n\tmat3 depthKernel;\n\tdepthKernel[0][0] = unpackFloat(textureCube(shadowMap, tc + dx0 + dy0));\n\tdepthKernel[0][1] = unpackFloat(textureCube(shadowMap, tc + dx0));\n\tdepthKernel[0][2] = unpackFloat(textureCube(shadowMap, tc + dx0 + dy1));\n\tdepthKernel[1][0] = unpackFloat(textureCube(shadowMap, tc + dy0));\n\tdepthKernel[1][1] = unpackFloat(textureCube(shadowMap, tc));\n\tdepthKernel[1][2] = unpackFloat(textureCube(shadowMap, tc + dy1));\n\tdepthKernel[2][0] = unpackFloat(textureCube(shadowMap, tc + dx1 + dy0));\n\tdepthKernel[2][1] = unpackFloat(textureCube(shadowMap, tc + dx1));\n\tdepthKernel[2][2] = unpackFloat(textureCube(shadowMap, tc + dx1 + dy1));\n\tvec3 shadowZ = vec3(length(dir) * shadowParams.w + shadowParams.z);\n\tshadowKernel[0] = vec3(lessThan2(depthKernel[0], shadowZ));\n\tshadowKernel[1] = vec3(lessThan2(depthKernel[1], shadowZ));\n\tshadowKernel[2] = vec3(lessThan2(depthKernel[2], shadowZ));\n\tvec2 uv = (vec2(dirX.w, dirY.w) / abs(majorAxisLength)) * 0.5;\n\tvec2 fractionalCoord = fract( uv * shadowParams.x );\n\tshadowKernel[0] = mix(shadowKernel[0], shadowKernel[1], fractionalCoord.x);\n\tshadowKernel[1] = mix(shadowKernel[1], shadowKernel[2], fractionalCoord.x);\n\tvec4 shadowValues;\n\tshadowValues.x = mix(shadowKernel[0][0], shadowKernel[0][1], fractionalCoord.y);\n\tshadowValues.y = mix(shadowKernel[0][1], shadowKernel[0][2], fractionalCoord.y);\n\tshadowValues.z = mix(shadowKernel[1][0], shadowKernel[1][1], fractionalCoord.y);\n\tshadowValues.w = mix(shadowKernel[1][1], shadowKernel[1][2], fractionalCoord.y);\n\treturn 1.0 - dot( shadowValues, vec4( 1.0 ) ) * 0.25;\n}\nfloat getShadowPointPCF3x3(samplerCube shadowMap, vec4 shadowParams) {\n\treturn _getShadowPoint(shadowMap, shadowParams, dLightDirW);\n}\n",shadowStandardGL2PS:"float _getShadowPCF5x5(sampler2DShadow shadowMap, vec3 shadowParams) {\n\tfloat z = dShadowCoord.z;\n\tvec2 uv = dShadowCoord.xy * shadowParams.x;\n\tfloat shadowMapSizeInv = 1.0 / shadowParams.x;\n\tvec2 base_uv = floor(uv + 0.5);\n\tfloat s = (uv.x + 0.5 - base_uv.x);\n\tfloat t = (uv.y + 0.5 - base_uv.y);\n\tbase_uv -= vec2(0.5);\n\tbase_uv *= shadowMapSizeInv;\n\tfloat uw0 = (4.0 - 3.0 * s);\n\tfloat uw1 = 7.0;\n\tfloat uw2 = (1.0 + 3.0 * s);\n\tfloat u0 = (3.0 - 2.0 * s) / uw0 - 2.0;\n\tfloat u1 = (3.0 + s) / uw1;\n\tfloat u2 = s / uw2 + 2.0;\n\tfloat vw0 = (4.0 - 3.0 * t);\n\tfloat vw1 = 7.0;\n\tfloat vw2 = (1.0 + 3.0 * t);\n\tfloat v0 = (3.0 - 2.0 * t) / vw0 - 2.0;\n\tfloat v1 = (3.0 + t) / vw1;\n\tfloat v2 = t / vw2 + 2.0;\n\tfloat sum = 0.0;\n\tu0 = u0 * shadowMapSizeInv + base_uv.x;\n\tv0 = v0 * shadowMapSizeInv + base_uv.y;\n\tu1 = u1 * shadowMapSizeInv + base_uv.x;\n\tv1 = v1 * shadowMapSizeInv + base_uv.y;\n\tu2 = u2 * shadowMapSizeInv + base_uv.x;\n\tv2 = v2 * shadowMapSizeInv + base_uv.y;\n\tsum += uw0 * vw0 * texture(shadowMap, vec3(u0, v0, z));\n\tsum += uw1 * vw0 * texture(shadowMap, vec3(u1, v0, z));\n\tsum += uw2 * vw0 * texture(shadowMap, vec3(u2, v0, z));\n\tsum += uw0 * vw1 * texture(shadowMap, vec3(u0, v1, z));\n\tsum += uw1 * vw1 * texture(shadowMap, vec3(u1, v1, z));\n\tsum += uw2 * vw1 * texture(shadowMap, vec3(u2, v1, z));\n\tsum += uw0 * vw2 * texture(shadowMap, vec3(u0, v2, z));\n\tsum += uw1 * vw2 * texture(shadowMap, vec3(u1, v2, z));\n\tsum += uw2 * vw2 * texture(shadowMap, vec3(u2, v2, z));\n\tsum *= 1.0f / 144.0;\n\tsum = gammaCorrectInput(sum);\n\tsum = saturate(sum);\n\treturn sum;\n}\nfloat getShadowPCF5x5(sampler2DShadow shadowMap, vec3 shadowParams) {\n\treturn _getShadowPCF5x5(shadowMap, shadowParams);\n}\nfloat getShadowSpotPCF5x5(sampler2DShadow shadowMap, vec4 shadowParams) {\n\treturn _getShadowPCF5x5(shadowMap, shadowParams.xyz);\n}\n",shadowVSM8PS:"float calculateVSM8(vec3 moments, float Z, float vsmBias) {\n\tfloat VSMBias = vsmBias;\n\tfloat depthScale = VSMBias * Z;\n\tfloat minVariance1 = depthScale * depthScale;\n\treturn chebyshevUpperBound(moments.xy, Z, minVariance1, 0.1);\n}\nfloat decodeFloatRG(vec2 rg) {\n\treturn rg.y*(1.0/255.0) + rg.x;\n}\nfloat VSM8(sampler2D tex, vec2 texCoords, float resolution, float Z, float vsmBias, float exponent) {\n\tvec4 c = texture2D(tex, texCoords);\n\tvec3 moments = vec3(decodeFloatRG(c.xy), decodeFloatRG(c.zw), 0.0);\n\treturn calculateVSM8(moments, Z, vsmBias);\n}\nfloat getShadowVSM8(sampler2D shadowMap, vec3 shadowParams, float exponent) {\n\treturn VSM8(shadowMap, dShadowCoord.xy, shadowParams.x, dShadowCoord.z, shadowParams.y, 0.0);\n}\nfloat getShadowSpotVSM8(sampler2D shadowMap, vec4 shadowParams, float exponent) {\n\treturn VSM8(shadowMap, dShadowCoord.xy, shadowParams.x, length(dLightDirW) * shadowParams.w + shadowParams.z, shadowParams.y, 0.0);\n}\n",shadowVSM_commonPS:"float linstep(float a, float b, float v) {\n\treturn saturate((v - a) / (b - a));\n}\nfloat reduceLightBleeding(float pMax, float amount) {\n\t return linstep(amount, 1.0, pMax);\n}\nfloat chebyshevUpperBound(vec2 moments, float mean, float minVariance, float lightBleedingReduction) {\n\tfloat variance = moments.y - (moments.x * moments.x);\n\tvariance = max(variance, minVariance);\n\tfloat d = mean - moments.x;\n\tfloat pMax = variance / (variance + (d * d));\n\tpMax = reduceLightBleeding(pMax, lightBleedingReduction);\n\treturn (mean <= moments.x ? 1.0 : pMax);\n}\nfloat calculateEVSM(vec3 moments, float Z, float vsmBias, float exponent) {\n\tZ = 2.0 * Z - 1.0;\n\tfloat warpedDepth = exp(exponent * Z);\n\tmoments.xy += vec2(warpedDepth, warpedDepth*warpedDepth) * (1.0 - moments.z);\n\tfloat VSMBias = vsmBias;\n\tfloat depthScale = VSMBias * exponent * warpedDepth;\n\tfloat minVariance1 = depthScale * depthScale;\n\treturn chebyshevUpperBound(moments.xy, warpedDepth, minVariance1, 0.1);\n}\n",skinBatchConstVS:"attribute float vertex_boneIndices;\nuniform vec4 matrix_pose[BONE_LIMIT * 3];\nmat4 getBoneMatrix(const in float i) {\n\tvec4 v1 = matrix_pose[int(3.0 * i)];\n\tvec4 v2 = matrix_pose[int(3.0 * i + 1.0)];\n\tvec4 v3 = matrix_pose[int(3.0 * i + 2.0)];\n\treturn mat4(\n\t\tv1.x, v2.x, v3.x, 0,\n\t\tv1.y, v2.y, v3.y, 0,\n\t\tv1.z, v2.z, v3.z, 0,\n\t\tv1.w, v2.w, v3.w, 1\n\t);\n}\n",skinBatchTexVS:"attribute float vertex_boneIndices;\nuniform highp sampler2D texture_poseMap;\nuniform vec4 texture_poseMapSize;\nmat4 getBoneMatrix(const in float i) {\n\tfloat j = i * 3.0;\n\tfloat dx = texture_poseMapSize.z;\n\tfloat dy = texture_poseMapSize.w;\n\tfloat y = floor(j * dx);\n\tfloat x = j - (y * texture_poseMapSize.x);\n\ty = dy * (y + 0.5);\n\tvec4 v1 = texture2D(texture_poseMap, vec2(dx * (x + 0.5), y));\n\tvec4 v2 = texture2D(texture_poseMap, vec2(dx * (x + 1.5), y));\n\tvec4 v3 = texture2D(texture_poseMap, vec2(dx * (x + 2.5), y));\n\treturn mat4(\n\t\tv1.x, v2.x, v3.x, 0,\n\t\tv1.y, v2.y, v3.y, 0,\n\t\tv1.z, v2.z, v3.z, 0,\n\t\tv1.w, v2.w, v3.w, 1\n\t);\n}\n",skinConstVS:"attribute vec4 vertex_boneWeights;\nattribute vec4 vertex_boneIndices;\nuniform vec4 matrix_pose[BONE_LIMIT * 3];\nvoid getBoneMatrix(const in float i, out vec4 v1, out vec4 v2, out vec4 v3) {\n\tv1 = matrix_pose[int(3.0 * i)];\n\tv2 = matrix_pose[int(3.0 * i + 1.0)];\n\tv3 = matrix_pose[int(3.0 * i + 2.0)];\n}\nmat4 getSkinMatrix(const in vec4 indices, const in vec4 weights) {\n\tvec4 a1, a2, a3;\n\tgetBoneMatrix(indices.x, a1, a2, a3);\n\tvec4 b1, b2, b3;\n\tgetBoneMatrix(indices.y, b1, b2, b3);\n\tvec4 c1, c2, c3;\n\tgetBoneMatrix(indices.z, c1, c2, c3);\n\tvec4 d1, d2, d3;\n\tgetBoneMatrix(indices.w, d1, d2, d3);\n\tvec4 v1 = a1 * weights.x + b1 * weights.y + c1 * weights.z + d1 * weights.w;\n\tvec4 v2 = a2 * weights.x + b2 * weights.y + c2 * weights.z + d2 * weights.w;\n\tvec4 v3 = a3 * weights.x + b3 * weights.y + c3 * weights.z + d3 * weights.w;\n\tfloat one = dot(weights, vec4(1.0));\n\treturn mat4(\n\t\tv1.x, v2.x, v3.x, 0,\n\t\tv1.y, v2.y, v3.y, 0,\n\t\tv1.z, v2.z, v3.z, 0,\n\t\tv1.w, v2.w, v3.w, one\n\t);\n}\n",skinTexVS:"attribute vec4 vertex_boneWeights;\nattribute vec4 vertex_boneIndices;\nuniform highp sampler2D texture_poseMap;\nuniform vec4 texture_poseMapSize;\nvoid getBoneMatrix(const in float i, out vec4 v1, out vec4 v2, out vec4 v3) {\n\tfloat j = i * 3.0;\n\tfloat dx = texture_poseMapSize.z;\n\tfloat dy = texture_poseMapSize.w;\n\tfloat y = floor(j * dx);\n\tfloat x = j - (y * texture_poseMapSize.x);\n\ty = dy * (y + 0.5);\n\tv1 = texture2D(texture_poseMap, vec2(dx * (x + 0.5), y));\n\tv2 = texture2D(texture_poseMap, vec2(dx * (x + 1.5), y));\n\tv3 = texture2D(texture_poseMap, vec2(dx * (x + 2.5), y));\n}\nmat4 getSkinMatrix(const in vec4 indices, const in vec4 weights) {\n\tvec4 a1, a2, a3;\n\tgetBoneMatrix(indices.x, a1, a2, a3);\n\tvec4 b1, b2, b3;\n\tgetBoneMatrix(indices.y, b1, b2, b3);\n\tvec4 c1, c2, c3;\n\tgetBoneMatrix(indices.z, c1, c2, c3);\n\tvec4 d1, d2, d3;\n\tgetBoneMatrix(indices.w, d1, d2, d3);\n\tvec4 v1 = a1 * weights.x + b1 * weights.y + c1 * weights.z + d1 * weights.w;\n\tvec4 v2 = a2 * weights.x + b2 * weights.y + c2 * weights.z + d2 * weights.w;\n\tvec4 v3 = a3 * weights.x + b3 * weights.y + c3 * weights.z + d3 * weights.w;\n\tfloat one = dot(weights, vec4(1.0));\n\treturn mat4(\n\t\tv1.x, v2.x, v3.x, 0,\n\t\tv1.y, v2.y, v3.y, 0,\n\t\tv1.z, v2.z, v3.z, 0,\n\t\tv1.w, v2.w, v3.w, one\n\t);\n}\n",skyboxEnvPS:"varying vec3 vViewDir;\nuniform sampler2D texture_envAtlas;\nuniform float mipLevel;\nvoid main(void) {\n\tvec3 dir = vViewDir * vec3(-1.0, 1.0, 1.0);\n\tvec2 uv = toSphericalUv(normalize(dir));\n\tvec3 linear = $DECODE(texture2D(texture_envAtlas, mapRoughnessUv(uv, mipLevel)));\n\tgl_FragColor = vec4(gammaCorrectOutput(toneMap(processEnvironment(linear))), 1.0);\n}\n",skyboxHDRPS:"varying vec3 vViewDir;\nuniform samplerCube texture_cubeMap;\nvoid main(void) {\n\tvec3 dir=vViewDir;\n\tdir.x *= -1.0;\n\tvec3 color = processEnvironment($textureCubeSAMPLE(texture_cubeMap, fixSeamsStatic(dir, $FIXCONST)).rgb);\n\tcolor = toneMap(color);\n\tcolor = gammaCorrectOutput(color);\n\tgl_FragColor = vec4(color, 1.0);\n}\n",skyboxVS:"attribute vec3 aPosition;\n#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\nuniform mat4 matrix_projectionSkybox;\nuniform mat3 cubeMapRotationMatrix;\nvarying vec3 vViewDir;\nvoid main(void) {\n\tmat4 view = matrix_view;\n\tview[3][0] = view[3][1] = view[3][2] = 0.0;\n\tgl_Position = matrix_projectionSkybox * view * vec4(aPosition, 1.0);\n\tgl_Position.z = gl_Position.w - 0.00001;\n\tvViewDir = aPosition * cubeMapRotationMatrix;\n}\n",specularPS:"#ifdef MAPCOLOR\nuniform vec3 material_specular;\n#endif\n#ifdef MAPTEXTURE\nuniform sampler2D texture_specularMap;\n#endif\nvoid getSpecularity() {\n\tdSpecularity = vec3(1.0);\n\t#ifdef MAPCOLOR\n\tdSpecularity *= material_specular;\n\t#endif\n\t#ifdef MAPTEXTURE\n\tdSpecularity *= texture2D(texture_specularMap, $UV, textureBias).$CH;\n\t#endif\n\t#ifdef MAPVERTEX\n\tdSpecularity *= saturate(vVertexColor.$VC);\n\t#endif\n}\n",specularAaNonePS:"float antiAliasGlossiness(float power) {\n\treturn power;\n}\n",specularAaToksvigPS:"float antiAliasGlossiness(float power) {\n\tfloat rlen = 1.0 / saturate(length(dNormalMap));\n\tfloat toksvig = 1.0 / (1.0 + power * (rlen - 1.0));\n\treturn power * mix(1.0, toksvig, material_bumpiness);\n}\n",specularAaToksvigFastPS:"float antiAliasGlossiness(float power) {\n\tfloat rlen = 1.0 / saturate(length(dNormalMap));\n\tfloat toksvig = 1.0 / (1.0 + power * (rlen - 1.0));\n\treturn power * toksvig;\n}\n",spotPS:"float getSpotEffect(vec3 lightSpotDirW, float lightInnerConeAngle, float lightOuterConeAngle) {\n\tfloat cosAngle = dot(dLightDirNormW, lightSpotDirW);\n\treturn smoothstep(lightOuterConeAngle, lightInnerConeAngle, cosAngle);\n}\n",startPS:"void main(void) {\n\tdDiffuseLight = vec3(0);\n\tdSpecularLight = vec3(0);\n\tdReflection = vec4(0);\n\tdSpecularity = vec3(0);\n\t#ifdef CLEARCOAT\n\tccSpecularLight = vec3(0);\n\tccReflection = vec4(0);\n\t#endif\n",startVS:"void main(void) {\n\tgl_Position = getPosition();\n",startNineSlicedPS:"\tnineSlicedUv = vUv0;\n\tnineSlicedUv.y = 1.0 - nineSlicedUv.y;\n",startNineSlicedTiledPS:"\tvec2 tileMask = step(vMask, vec2(0.99999));\n\tvec2 tileSize = 0.5 * (innerOffset.xy + innerOffset.zw);\n\tvec2 tileScale = vec2(1.0) / (vec2(1.0) - tileSize);\n\tvec2 clampedUv = mix(innerOffset.xy * 0.5, vec2(1.0) - innerOffset.zw * 0.5, fract((vTiledUv - tileSize) * tileScale));\n\tclampedUv = clampedUv * atlasRect.zw + atlasRect.xy;\n\tnineSlicedUv = vUv0 * tileMask + clampedUv * (vec2(1.0) - tileMask);\n\tnineSlicedUv.y = 1.0 - nineSlicedUv.y;\n",storeEVSMPS:"float exponent = VSM_EXPONENT;\ndepth = 2.0 * depth - 1.0;\ndepth =\texp(exponent * depth);\ngl_FragColor = vec4(depth, depth*depth, 1.0, 1.0);\n",tangentBinormalVS:"vec3 getTangent() {\n\treturn normalize(dNormalMatrix * vertex_tangent.xyz);\n}\nvec3 getBinormal() {\n\treturn cross(vNormalW, vTangentW) * vertex_tangent.w;\n}\nvec3 getObjectSpaceUp() {\n\treturn normalize(dNormalMatrix * vec3(0, 1, 0));\n}\n",TBNPS:"void getTBN() {\n\tdTBN = mat3(normalize(dTangentW), normalize(dBinormalW), normalize(dVertexNormalW));\n}\n",TBNderivativePS:"uniform float tbnBasis;\nvoid getTBN() {\n\tvec2 uv = $UV;\n\tvec3 dp1 = dFdx( vPositionW );\n\tvec3 dp2 = dFdy( vPositionW );\n\tvec2 duv1 = dFdx( uv );\n\tvec2 duv2 = dFdy( uv );\n\tvec3 dp2perp = cross( dp2, dVertexNormalW );\n\tvec3 dp1perp = cross( dVertexNormalW, dp1 );\n\tvec3 T = dp2perp * duv1.x + dp1perp * duv2.x;\n\tvec3 B = dp2perp * duv1.y + dp1perp * duv2.y;\n\tfloat denom = max( dot(T,T), dot(B,B) );\n\tfloat invmax = (denom == 0.0) ? 0.0 : tbnBasis / sqrt( denom );\n\tdTBN = mat3(T * invmax, -B * invmax, dVertexNormalW );\n}\n",TBNfastPS:"void getTBN() {\n\tdTBN = mat3(dTangentW, dBinormalW, dVertexNormalW);\n}\n",TBNObjectSpacePS:"void getTBN() {\n\tvec3 B = cross(dVertexNormalW, vObjectSpaceUpW);\n\tvec3 T = cross(dVertexNormalW, B);\n\tif (dot(B,B)==0.0)\n\t{\n\t\tfloat major=max(max(dVertexNormalW.x, dVertexNormalW.y),dVertexNormalW.z);\n\t\tif (dVertexNormalW.x==major)\n\t\t{\n\t\t\tB=cross(dVertexNormalW, vec3(0,1,0));\n\t\t\tT=cross(dVertexNormalW, B);\n\t\t}\n\t\telse if (dVertexNormalW.y==major)\n\t\t{\n\t\t\tB=cross(dVertexNormalW, vec3(0,0,1));\n\t\t\tT=cross(dVertexNormalW, B);\n\t\t}\n\t\telse if (dVertexNormalW.z==major)\n\t\t{\n\t\t\tB=cross(dVertexNormalW, vec3(1,0,0));\n\t\t\tT=cross(dVertexNormalW, B);\n\t\t}\n\t}\n\tdTBN = mat3(normalize(T), normalize(B), normalize(dVertexNormalW));\n}\n",tonemappingAcesPS:"uniform float exposure;\nvec3 toneMap(vec3 color) {\n\tfloat tA = 2.51;\n\tfloat tB = 0.03;\n\tfloat tC = 2.43;\n\tfloat tD = 0.59;\n\tfloat tE = 0.14;\n\tvec3 x = color * exposure;\n\treturn (x*(tA*x+tB))/(x*(tC*x+tD)+tE);\n}\n",tonemappingAces2PS:"uniform float exposure;\nconst mat3 ACESInputMat = mat3(\n\t0.59719, 0.35458, 0.04823,\n\t0.07600, 0.90834, 0.01566,\n\t0.02840, 0.13383, 0.83777\n);\nconst mat3 ACESOutputMat = mat3(\n\t 1.60475, -0.53108, -0.07367,\n\t-0.10208,\t1.10813, -0.00605,\n\t-0.00327, -0.07276,\t1.07602\n);\nvec3 RRTAndODTFit(vec3 v) {\n\tvec3 a = v * (v + 0.0245786) - 0.000090537;\n\tvec3 b = v * (0.983729 * v + 0.4329510) + 0.238081;\n\treturn a / b;\n}\nvec3 toneMap(vec3 color) {\n\tcolor *= exposure;\n\tcolor = color * ACESInputMat;\n\tcolor = RRTAndODTFit(color);\n\tcolor = color * ACESOutputMat;\n\tcolor = clamp(color, 0.0, 1.0);\n\treturn color;\n}\n",tonemappingFilmicPS:"const float A =\t0.15;\nconst float B =\t0.50;\nconst float C =\t0.10;\nconst float D =\t0.20;\nconst float E =\t0.02;\nconst float F =\t0.30;\nconst float W =\t11.2;\nuniform float exposure;\nvec3 uncharted2Tonemap(vec3 x) {\n\t return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;\n}\nvec3 toneMap(vec3 color) {\n\tcolor = uncharted2Tonemap(color * exposure);\n\tvec3 whiteScale = 1.0 / uncharted2Tonemap(vec3(W,W,W));\n\tcolor = color * whiteScale;\n\treturn color;\n}\n",tonemappingHejlPS:"uniform float exposure;\nvec3 toneMap(vec3 color) {\n\tcolor *= exposure;\n\tconst float\tA = 0.22, B = 0.3, C = .1, D = 0.2, E = .01, F = 0.3;\n\tconst float Scl = 1.25;\n\tvec3 h = max( vec3(0.0), color - vec3(0.004) );\n\treturn (h*((Scl*A)*h+Scl*vec3(C*B,C*B,C*B))+Scl*vec3(D*E,D*E,D*E)) / (h*(A*h+vec3(B,B,B))+vec3(D*F,D*F,D*F)) - Scl*vec3(E/F,E/F,E/F);\n}\n",tonemappingLinearPS:"uniform float exposure;\nvec3 toneMap(vec3 color) {\n\treturn color * exposure;\n}\n",tonemappingNonePS:"vec3 toneMap(vec3 color) {\n\treturn color;\n}\n",transformVS:"#ifdef PIXELSNAP\nuniform vec4 uScreenSize;\n#endif\n#ifdef MORPHING\nuniform vec4 morph_weights_a;\nuniform vec4 morph_weights_b;\n#endif\n#ifdef MORPHING_TEXTURE_BASED\nuniform vec4 morph_tex_params;\nvec2 getTextureMorphCoords() {\n\tfloat vertexId = morph_vertex_id;\n\tvec2 textureSize = morph_tex_params.xy;\n\tvec2 invTextureSize = morph_tex_params.zw;\n\tfloat morphGridV = floor(vertexId * invTextureSize.x);\n\tfloat morphGridU = vertexId - (morphGridV * textureSize.x);\n\treturn (vec2(morphGridU, morphGridV) * invTextureSize) + (0.5 * invTextureSize);\n}\n#endif\n#ifdef MORPHING_TEXTURE_BASED_POSITION\nuniform highp sampler2D morphPositionTex;\n#endif\nmat4 getModelMatrix() {\n\t#ifdef DYNAMICBATCH\n\treturn getBoneMatrix(vertex_boneIndices);\n\t#elif defined(SKIN)\n\treturn matrix_model * getSkinMatrix(vertex_boneIndices, vertex_boneWeights);\n\t#elif defined(INSTANCING)\n\treturn mat4(instance_line1, instance_line2, instance_line3, instance_line4);\n\t#else\n\treturn matrix_model;\n\t#endif\n}\nvec4 getPosition() {\n\tdModelMatrix = getModelMatrix();\n\tvec3 localPos = vertex_position;\n\t#ifdef NINESLICED\n\tlocalPos.xz *= outerScale;\n\tvec2 positiveUnitOffset = clamp(vertex_position.xz, vec2(0.0), vec2(1.0));\n\tvec2 negativeUnitOffset = clamp(-vertex_position.xz, vec2(0.0), vec2(1.0));\n\tlocalPos.xz += (-positiveUnitOffset * innerOffset.xy + negativeUnitOffset * innerOffset.zw) * vertex_texCoord0.xy;\n\tvTiledUv = (localPos.xz - outerScale + innerOffset.xy) * -0.5 + 1.0;\n\tlocalPos.xz *= -0.5;\n\tlocalPos = localPos.xzy;\n\t#endif\n\t#ifdef MORPHING\n\t#ifdef MORPHING_POS03\n\tlocalPos.xyz += morph_weights_a[0] * morph_pos0;\n\tlocalPos.xyz += morph_weights_a[1] * morph_pos1;\n\tlocalPos.xyz += morph_weights_a[2] * morph_pos2;\n\tlocalPos.xyz += morph_weights_a[3] * morph_pos3;\n\t#endif\n\t#ifdef MORPHING_POS47\n\tlocalPos.xyz += morph_weights_b[0] * morph_pos4;\n\tlocalPos.xyz += morph_weights_b[1] * morph_pos5;\n\tlocalPos.xyz += morph_weights_b[2] * morph_pos6;\n\tlocalPos.xyz += morph_weights_b[3] * morph_pos7;\n\t#endif\n\t#endif\n\t#ifdef MORPHING_TEXTURE_BASED_POSITION\n\tvec2 morphUV = getTextureMorphCoords();\n\tvec3 morphPos = texture2D(morphPositionTex, morphUV).xyz;\n\tlocalPos += morphPos;\n\t#endif\n\tvec4 posW = dModelMatrix * vec4(localPos, 1.0);\n\t#ifdef SCREENSPACE\n\tposW.zw = vec2(0.0, 1.0);\n\t#endif\n\tdPositionW = posW.xyz;\n\tvec4 screenPos;\n\t#ifdef UV1LAYOUT\n\tscreenPos = vec4(vertex_texCoord1.xy * 2.0 - 1.0, 0.5, 1);\n\t#else\n\t#ifdef SCREENSPACE\n\tscreenPos = posW;\n\t#else\n\tscreenPos = matrix_viewProjection * posW;\n\t#endif\n\t#ifdef PIXELSNAP\n\tscreenPos.xy = (screenPos.xy * 0.5) + 0.5;\n\tscreenPos.xy *= uScreenSize.xy;\n\tscreenPos.xy = floor(screenPos.xy);\n\tscreenPos.xy *= uScreenSize.zw;\n\tscreenPos.xy = (screenPos.xy * 2.0) - 1.0;\n\t#endif\n\t#endif\n\treturn screenPos;\n}\nvec3 getWorldPosition() {\n\treturn dPositionW;\n}\n",transformDeclVS:"attribute vec3 vertex_position;\nuniform mat4 matrix_model;\nuniform mat4 matrix_viewProjection;\nvec3 dPositionW;\nmat4 dModelMatrix;\n",uv0VS:"#ifdef NINESLICED\nvec2 getUv0() {\n\tvec2 uv = vertex_position.xz;\n\tvec2 positiveUnitOffset = clamp(vertex_position.xz, vec2(0.0), vec2(1.0));\n\tvec2 negativeUnitOffset = clamp(-vertex_position.xz, vec2(0.0), vec2(1.0));\n\tuv += (-positiveUnitOffset * innerOffset.xy + negativeUnitOffset * innerOffset.zw) * vertex_texCoord0.xy;\n\tuv = uv * -0.5 + 0.5;\n\tuv = uv * atlasRect.zw + atlasRect.xy;\n\tvMask = vertex_texCoord0.xy;\n\treturn uv;\n}\n#else\nvec2 getUv0() {\n\treturn vertex_texCoord0;\n}\n#endif\n",uv1VS:"vec2 getUv1() {\n\treturn vertex_texCoord1;\n}\n",viewDirPS:"void getViewDir() {\n\tdViewDirW = normalize(view_position - vPositionW);\n}\n",viewNormalVS:"#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\nvec3 getViewNormal() {\n\treturn mat3(matrix_view) * vNormalW;\n}\n"};function ui(t,e){return e||(e=ci),1===t||2===t?e.gamma2_2PS?e.gamma2_2PS:ci.gamma2_2PS:3===t?"#define HDR\n"+(e.gamma2_2PS?e.gamma2_2PS:ci.gamma2_2PS):e.gamma1_0PS?e.gamma1_0PS:ci.gamma1_0PS}function di(t,e){return e||(e=ci),1===t?e.tonemappingFilmicPS?e.tonemappingFilmicPS:ci.tonemappingFilmicPS:0===t?e.tonemappingLinearPS?e.tonemappingLinearPS:ci.tonemappingLinearPS:2===t?e.tonemappingHejlPS?e.tonemappingHejlPS:ci.tonemappingHejlPS:3===t?e.tonemappingAcesPS?e.tonemappingAcesPS:ci.tonemappingAcesPS:4===t?e.tonemappingAces2PS?e.tonemappingAces2PS:ci.tonemappingAces2PS:e.tonemapingNonePS?e.tonemapingNonePS:ci.tonemappingNonePS}function fi(t,e){return e||(e=ci),"linear"===t?e.fogLinearPS?e.fogLinearPS:ci.fogLinearPS:"exp"===t?e.fogExpPS?e.fogExpPS:ci.fogExpPS:"exp2"===t?e.fogExp2PS?e.fogExp2PS:ci.fogExp2PS:e.fogNonePS?e.fogNonePS:ci.fogNonePS}function pi(t,e){return e||(e=ci),t.supportsBoneTextures?e.skinTexVS:"#define BONE_LIMIT "+t.getBoneLimit()+"\n"+e.skinConstVS}function mi(t){var e="precision "+t.precision+" float;\n";return t.webgl2&&(e+="#ifdef GL2\nprecision "+t.precision+" sampler2DShadow;\n#endif\n"),e}function _i(t){return t.webgl2?"#version 300 es\n":""}function gi(){return"void main(void) {gl_FragColor = vec4(0.0);}"}function vi(){return"void main(void)\n{\n"}function yi(){return"}\n"}var xi={vertex_position:le,vertex_normal:ce,vertex_tangent:ue,vertex_texCoord0:_e,vertex_texCoord1:ge,vertex_texCoord2:ve,vertex_texCoord3:ye,vertex_texCoord4:xe,vertex_texCoord5:be,vertex_texCoord6:Se,vertex_texCoord7:we,vertex_color:pe,vertex_boneIndices:fe,vertex_boneWeights:de};function bi(t){for(var e={},i=0,n=t.indexOf("attribute");n>=0&&!(n>0&&"/"===t[n-1]);){var s=t.indexOf(";",n),a=t.lastIndexOf(" ",s),r=t.substr(a+1,s-(a+1)),o=xi[r];void 0!==o?e[r]=o:(e[r]="ATTR"+i,i++),n=t.indexOf("attribute",n+1)}return e}function Si(t,e,i,n,s,a){void 0===s&&(s=!1),void 0===a&&(a="");var r=t.programLib._cache,o=r[n];if(void 0!==o)return o;i=mi(t)+"\n"+(i||"void main(void) {gl_FragColor = vec4(0.0);}");var h=bi(e);return t.webgl2&&(e=_i(t)+ci.gles3VS+e,i=_i(t)+ci.gles3PS+i),r[n]=new li(t,{attributes:h,vshader:e,fshader:a+i,useTransformFeedback:s}),r[n]}ci.collectAttribs=bi,ci.createShader=function(t,e,i,n){void 0===n&&(n=!1);var s=ci[e],a=mi(t)+"\n"+ci[i],r=bi(s);return t.webgl2&&(s=_i(t)+ci.gles3VS+s,a=_i(t)+ci.gles3PS+a),new li(t,{attributes:r,vshader:s,fshader:a,useTransformFeedback:n})},ci.createShaderFromCode=Si;var wi=function(){function t(){this.globalId=0,this.revision=0}var e=t.prototype;return e.equals=function(t){return this.globalId===t.globalId&&this.revision===t.revision},e.copy=function(t){this.globalId=t.globalId,this.revision=t.revision},e.reset=function(){this.globalId=0,this.revision=0},t}(),Ti=0,Ai=function(){function t(){Ti++,this.version=new wi,this.version.globalId=Ti}return t.prototype.increment=function(){this.version.revision++},t}(),Mi=function(){function t(t){this.name=t,this.value=null,this.versionObject=new Ai}var e=t.prototype;return e.setValue=function(t){this.value=t,this.versionObject.increment()},e.getValue=function(){return this.value},t}(),Ci=function(){function t(t){this.name=t,this.variables=new Map}var e=t.prototype;return e.resolve=function(t){return this.variables.has(t)||this.variables.set(t,new Mi(t)),this.variables.get(t)},e.removeValue=function(t){for(var e in this.variables){var i=this.variables[e];i.value===t&&(i.value=null)}},t}(),Ei={generateKey:function(t){var e="basic";return t.fog&&(e+="_fog"),t.alphaTest&&(e+="_atst"),t.vertexColors&&(e+="_vcol"),t.diffuseMap&&(e+="_diff"),t.skin&&(e+="_skin"),t.screenSpace&&(e+="_ss"),t.useInstancing&&(e+="_inst"),t.useMorphPosition&&(e+="_morphp"),t.useMorphNormal&&(e+="_morphn"),t.useMorphTextureBased&&(e+="_morpht"),e+="_"+t.pass},createShaderDefinition:function(t,e){var i={vertex_position:le};e.skin&&(i.vertex_boneWeights=de,i.vertex_boneIndices=fe),e.vertexColors&&(i.vertex_color=pe),e.diffuseMap&&(i.vertex_texCoord0=_e);var n="";n+=ci.transformDeclVS,e.skin?(n+=pi(t),n+=ci.transformSkinnedVS):n+=ci.transformVS,e.vertexColors&&(n+="attribute vec4 vertex_color;\n",n+="varying vec4 vColor;\n"),e.diffuseMap&&(n+="attribute vec2 vertex_texCoord0;\n",n+="varying vec2 vUv0;\n"),2===e.pass&&(n+="varying float vDepth;\n",n+="#ifndef VIEWMATRIX\n",n+="#define VIEWMATRIX\n",n+="uniform mat4 matrix_view;\n",n+="#endif\n",n+="#ifndef CAMERAPLANES\n",n+="#define CAMERAPLANES\n",n+="uniform vec4 camera_params;\n\n",n+="#endif\n"),n+="void main(void)\n{\n",n+="\t gl_Position = getPosition();\n",2===e.pass&&(n+="\t\tvDepth = -(matrix_view * vec4(getWorldPosition(),1.0)).z * camera_params.x;\n"),e.vertexColors&&(n+="\t\tvColor = vertex_color;\n"),e.diffuseMap&&(n+="\t\tvUv0 = vertex_texCoord0;\n");var s=n+="}\n";return n=mi(t),e.vertexColors?n+="varying vec4 vColor;\n":n+="uniform vec4 uColor;\n",e.diffuseMap&&(n+="varying vec2 vUv0;\n",n+="uniform sampler2D texture_diffuseMap;\n"),e.fog&&(n+=fi(e.fog)),e.alphatest&&(n+=ci.alphaTestPS),2===e.pass&&(n+="varying float vDepth;\n",n+=ci.packDepthPS),n+="void main(void)\n{\n",e.vertexColors?n+="\t\tgl_FragColor = vColor;\n":n+="\t\tgl_FragColor = uColor;\n",e.diffuseMap&&(n+="\t\tgl_FragColor *= texture2D(texture_diffuseMap, vUv0);\n"),e.alphatest&&(n+="\t alphaTest(gl_FragColor.a);\n"),e.pass!==Wt&&(2===e.pass?n+="\t\tgl_FragColor = packFloat(vDepth);\n":e.fog&&(n+="\t glFragColor.rgb = addFog(gl_FragColor.rgb);\n")),{attributes:i,vshader:s,fshader:n+="}\n"}}},Pi={generateKey:function(t){var e="particle";for(var i in t)t.hasOwnProperty(i)&&(e+=t[i]);return e},_animTex:function(t){var e="";return e+=t.animTexLoop?ci.particleAnimFrameLoopVS:ci.particleAnimFrameClampVS,e+=ci.particleAnimTexVS},createShaderDefinition:function(t,e){var i="",n=mi(t)+"\n";n+="#define PARTICLE\n",t.webgl2&&(i+="#define GL2\n",n+="#define GL2\n"),i+="#define VERTEXSHADER\n",e.mesh&&(i+="#define USE_MESH\n"),e.localSpace&&(i+="#define LOCAL_SPACE\n"),e.screenSpace&&(i+="#define SCREEN_SPACE\n"),e.animTex&&(i+="\nuniform vec2 animTexTilesParams;\n"),e.animTex&&(i+="\nuniform vec4 animTexParams;\n"),e.animTex&&(i+="\nuniform vec2 animTexIndexParams;\n"),2===e.normal&&(i+="\nvarying mat3 ParticleMat;\n"),1===e.normal&&(i+="\nvarying vec3 Normal;\n"),e.soft&&(i+="\nvarying float vDepth;\n");var s=e.customFace?ci.particle_customFaceVS:ci.particle_billboardVS;return e.useCpu?(e.soft>0&&(i+=ci.screenDepthPS),i+=ci.particle_cpuVS,e.localSpace&&(i+=ci.particle_localShiftVS),e.animTex&&(i+=this._animTex(e)),e.alignToMotion&&(i+=ci.particle_pointAlongVS),i+=e.mesh?ci.particle_meshVS:s,1===e.normal&&(i+=ci.particle_normalVS),2===e.normal&&(i+=ci.particle_TBNVS),e.stretch>0&&(i+=ci.particle_stretchVS),i+=ci.particle_cpu_endVS,e.soft>0&&(i+=ci.particle_softVS)):(i+=ci.particle_initVS,i+=e.pack8?ci.particleInputRgba8PS:ci.particleInputFloatPS,e.soft>0&&(i+=ci.screenDepthPS),i+=ci.particleVS,e.localSpace&&(i+=ci.particle_localShiftVS),e.animTex&&(i+=this._animTex(e)),e.wrap&&(i+=ci.particle_wrapVS),e.alignToMotion&&(i+=ci.particle_pointAlongVS),i+=e.mesh?ci.particle_meshVS:s,1===e.normal&&(i+=ci.particle_normalVS),2===e.normal&&(i+=ci.particle_TBNVS),e.stretch>0&&(i+=ci.particle_stretchVS),i+=ci.particle_endVS,e.soft>0&&(i+=ci.particle_softVS)),i+="}\n",e.normal>0&&(1===e.normal?n+="\nvarying vec3 Normal;\n":2===e.normal&&(n+="\nvarying mat3 ParticleMat;\n"),n+="\nuniform vec3 lightCube[6];\n"),e.soft&&(n+="\nvarying float vDepth;\n"),0===e.normal&&"none"===e.fog&&(e.srgb=!1),n+=ui(e.gamma),n+=di(e.toneMap),"linear"===e.fog?n+=ci.fogLinearPS:"exp"===e.fog?n+=ci.fogExpPS:"exp2"===e.fog?n+=ci.fogExp2PS:n+=ci.fogNonePS,2===e.normal&&(n+="\nuniform sampler2D normalMap;\n"),e.soft>0&&(n+=ci.screenDepthPS),n+=ci.particlePS,e.soft>0&&(n+=ci.particle_softPS),1===e.normal&&(n+="\nvec3 normal = Normal;\n"),2===e.normal&&(n+=ci.particle_normalMapPS),e.normal>0&&(n+=e.halflambert?ci.particle_halflambertPS:ci.particle_lambertPS),e.normal>0&&(n+=ci.particle_lightingPS),2===e.blend?n+=ci.particle_blendNormalPS:1===e.blend?n+=ci.particle_blendAddPS:5===e.blend&&(n+=ci.particle_blendMultiplyPS),n+=ci.particle_endPS,{attributes:bi(i),vshader:i,fshader:n}}},Ri={generateKey:function(t){return"cubemap"===t.type?"skybox-"+t.type+"-"+t.rgbm+"-"+t.hdr+"-"+t.fixSeams+"-"+t.toneMapping+"-"+t.gamma+"-"+t.useIntensity+"-"+t.mip:"skybox-"+t.type+"-"+t.encoding+"-"+t.useIntensity+"-"+t.gamma+"-"+t.toneMapping},createShaderDefinition:function(t,e){var i;if("cubemap"===e.type){i=mi(t),i+=e.mip?ci.fixCubemapSeamsStretchPS:ci.fixCubemapSeamsNonePS,i+=e.useIntensity?ci.envMultiplyPS:ci.envConstPS,i+=ui(e.gamma),i+=di(e.toneMapping),i+=ci.decodePS,i+=ci.rgbmPS,i+=ci.skyboxHDRPS.replace(/\$textureCubeSAMPLE/g,e.rgbm?"textureCubeRGBM":e.hdr?"textureCube":"textureCubeSRGB").replace(/\$FIXCONST/g,1-1/[128,64,16,8,4,2][e.mip]+"")}else{i=mi(t),i+=e.useIntensity?ci.envMultiplyPS:ci.envConstPS,i+=ui(e.gamma),i+=di(e.toneMapping),i+=ci.decodePS,i+=ci.skyboxEnvPS.replace(/\$DECODE/g,{rgbm:"decodeRGBM",rgbe:"decodeRGBE",linear:"decodeLinear"}[e.encoding]||"decodeGamma")}return{attributes:{aPosition:le},vshader:ci.skyboxVS,fshader:i}}},Ii=1/255,Li=new Float32Array(1),Di=new Int32Array(Li.buffer),ki=function(){function t(){}return t.float2Half=function(t){Li[0]=t;var e=Di[0],i=e>>16&32768,n=e>>12&2047,s=e>>23&255;return s<103?i:s>142?(i|=31744,i|=(255===s?0:1)&&8388607&e):s<113?i|=((n|=2048)>>114-s)+(n>>113-s&1):(i|=s-112<<10|n>>1,i+=1&n)},t.float2Bytes=function(t,e,i,n){var s=255*t%1;if(e[i+0]=Math.round(255*(t%1-Ii*s)),n>1){var a=65025*t%1;if(e[i+1]=Math.round(255*(s-Ii*a)),n>2){var r=16581375*t%1;e[i+2]=Math.round(255*(a-Ii*r)),n>3&&(e[i+3]=Math.round(255*r))}}},t.float2BytesRange=function(e,i,n,s,a,r){e=rt.clamp((e-s)/(a-s),0,1),t.float2Bytes(e,i,n,r)},t.float2MantissaExponent=function(e,i,n,s){var a=Math.floor(Math.log2(Math.abs(e)))+1;e/=Math.pow(2,a),t.float2BytesRange(e,i,n,-1,1,s-1),i[n+s-1]=Math.round(a+127)},t}(),Oi=null,Fi=null,Bi=function(){function t(t,e){this.device=t,this.name=null,this._width=4,this._height=4,this._depth=1,this._format=7,this.type=Ve,this.projection=Xe,this._cubemap=!1,this._volume=!1,this.fixCubemapSeams=!1,this._flipY=!1,this._premultiplyAlpha=!1,this._isRenderTarget=!1,this._mipmaps=!0,this._minFilter=5,this._magFilter=1,this._anisotropy=1,this._addressU=0,this._addressV=0,this._addressW=0,this._compareOnRead=!1,this._compareFunc=1,void 0!==e&&(void 0!==e.name&&(this.name=e.name),this._width=void 0!==e.width?e.width:this._width,this._height=void 0!==e.height?e.height:this._height,this._format=void 0!==e.format?e.format:this._format,e.hasOwnProperty("type")?this.type=e.type:e.hasOwnProperty("rgbm")?this.type=e.rgbm?We:Ve:e.hasOwnProperty("swizzleGGGR")&&(this.type=e.swizzleGGGR?He:Ve),void 0!==e.mipmaps?this._mipmaps=e.mipmaps:this._mipmaps=void 0!==e.autoMipmap?e.autoMipmap:this._mipmaps,this._levels=e.levels,this._cubemap=void 0!==e.cubemap?e.cubemap:this._cubemap,this.fixCubemapSeams=void 0!==e.fixCubemapSeams?e.fixCubemapSeams:this.fixCubemapSeams,this._cubemap?this.projection=qe:e.projection&&e.projection!==qe&&(this.projection=e.projection),this._minFilter=void 0!==e.minFilter?e.minFilter:this._minFilter,this._magFilter=void 0!==e.magFilter?e.magFilter:this._magFilter,this._anisotropy=void 0!==e.anisotropy?e.anisotropy:this._anisotropy,this._addressU=void 0!==e.addressU?e.addressU:this._addressU,this._addressV=void 0!==e.addressV?e.addressV:this._addressV,this._compareOnRead=void 0!==e.compareOnRead?e.compareOnRead:this._compareOnRead,this._compareFunc=void 0!==e._compareFunc?e._compareFunc:this._compareFunc,this._flipY=void 0!==e.flipY?e.flipY:this._flipY,this._premultiplyAlpha=void 0!==e.premultiplyAlpha?e.premultiplyAlpha:this._premultiplyAlpha,t.webgl2&&(this._depth=void 0!==e.depth?e.depth:this._depth,this._volume=void 0!==e.volume?e.volume:this._volume,this._addressW=void 0!==e.addressW?e.addressW:this._addressW)),this._compressed=8===this._format||9===this._format||this._format===Jt||this._format>=re,this._invalid=!1,this._lockedLevel=-1,this._levels||(this._levels=this._cubemap?[[null,null,null,null,null,null]]:[null]),this.dirtyAll(),this._gpuSize=0,this.impl=t.createTextureImpl(),t.textures.push(this)}var e=t.prototype;return e.destroy=function(){if(this.device){var t=this.device,e=t.textures.indexOf(this);-1!==e&&t.textures.splice(e,1),t.scope.removeValue(this),this.impl.destroy(t),this.adjustVramSizeTracking(t._vram,-this._gpuSize),this._levels=null,this.device=null}},e.loseContext=function(){this.impl.loseContext(),this.dirtyAll()},e.adjustVramSizeTracking=function(t,e){t.tex+=e},t.calcGpuSize=function(t,e,i,n,s,a){Oi||((Oi=[])[0]=1,Oi[1]=1,Oi[2]=2,Oi[3]=2,Oi[4]=2,Oi[5]=2,Oi[6]=4,Oi[7]=4,Oi[11]=8,Oi[12]=8,Oi[13]=16,Oi[14]=16,Oi[15]=4,Oi[16]=4,Oi[17]=4,Oi[18]=4,Oi[19]=4,Oi[20]=4),Fi||((Fi=[])[21]=8,Fi[22]=8,Fi[24]=8,Fi[25]=8,Fi[26]=8,Fi[27]=8,Fi[8]=8,Fi[29]=8,Fi[23]=16,Fi[9]=16,Fi[10]=16,Fi[28]=16,Fi[30]=16);for(var r=Oi.hasOwnProperty(n)?Oi[n]:0,o=Fi.hasOwnProperty(n)?Fi[n]:0,h=0;;){if(r>0)h+=t*e*i*r;else{var l=Math.floor((t+3)/4),c=Math.floor((e+3)/4),u=Math.floor((i+3)/4);n!==oe&&n!==he||(l=Math.max(Math.floor(l/2),1)),h+=l*c*u*o}if(!s||1===t&&1===e&&1===i)break;t=Math.max(Math.floor(t/2),1),e=Math.max(Math.floor(e/2),1),i=Math.max(Math.floor(i/2),1)}return h*(a?6:1)},e.dirtyAll=function(){this._levelsUpdated=this._cubemap?[[!0,!0,!0,!0,!0,!0]]:[!0],this._needsUpload=!0,this._needsMipmapsUpload=this._mipmaps,this._mipmapsUploaded=!1,this._parameterFlags=255},e.lock=function(t){if(void 0===t&&(t={}),void 0===t.level&&(t.level=0),void 0===t.face&&(t.face=0),void 0===t.mode&&(t.mode=2),this._lockedLevel=t.level,null===this._levels[t.level])switch(this._format){case 0:case 1:this._levels[t.level]=new Uint8Array(this._width*this._height*this._depth);break;case 2:this._levels[t.level]=new Uint8Array(this._width*this._height*this._depth*2);break;case 3:case 4:case 5:this._levels[t.level]=new Uint16Array(this._width*this._height*this._depth);break;case 6:this._levels[t.level]=new Uint8Array(this._width*this._height*this._depth*3);break;case 7:this._levels[t.level]=new Uint8Array(this._width*this._height*this._depth*4);break;case 8:this._levels[t.level]=new Uint8Array(Math.floor((this._width+3)/4)*Math.floor((this._height+3)/4)*8*this._depth);break;case 9:case Jt:this._levels[t.level]=new Uint8Array(Math.floor((this._width+3)/4)*Math.floor((this._height+3)/4)*16*this._depth);break;case te:this._levels[t.level]=new Uint16Array(this._width*this._height*this._depth*3);break;case ie:this._levels[t.level]=new Float32Array(this._width*this._height*this._depth*3);break;case ee:this._levels[t.level]=new Uint16Array(this._width*this._height*this._depth*4);break;case ne:this._levels[t.level]=new Float32Array(this._width*this._height*this._depth*4)}return this._levels[t.level]},e.setSource=function(t,e){void 0===e&&(e=0);var i,n,s=!1;if(this._cubemap){if(t[0]){i=t[0].width||0,n=t[0].height||0;for(var a=0;a<6;a++){var r=t[a];if(!r||r.width!==i||r.height!==n||!this.device._isBrowserInterface(r)){s=!0;break}}}else s=!0;if(!s)for(var o=0;o<6;o++)this._levels[e][o]!==t[o]&&(this._levelsUpdated[e][o]=!0)}else this.device._isBrowserInterface(t)||(s=!0),s||(t!==this._levels[e]&&(this._levelsUpdated[e]=!0),i=t.width,n=t.height);if(s)if(this._width=4,this._height=4,this._cubemap)for(var h=0;h<6;h++)this._levels[e][h]=null,this._levelsUpdated[e][h]=!0;else this._levels[e]=null,this._levelsUpdated[e]=!0;else 0===e&&(this._width=i,this._height=n),this._levels[e]=t;this._invalid===s&&s||(this._invalid=s,this.upload())},e.getSource=function(t){return void 0===t&&(t=0),this._levels[t]},e.unlock=function(){this._lockedLevel,this.upload(),this._lockedLevel=-1},e.upload=function(){this._needsUpload=!0,this._needsMipmapsUpload=this._mipmaps},e.getDds=function(){for(var t=128,e=0;this._levels[e];){if(this.cubemap)for(var i=0;i<6;i++){if(!this._levels[e][i])return;var n=this._levels[e][i].length;if(!n)return;t+=n}else{var s=this._levels[e].length;if(!s)return;t+=s}t+=this._levels[e].length,e++}var a=new ArrayBuffer(t),r=new Uint32Array(a,0,32),o=528391;this._levels.length>1&&(o|=131072);var h=4096;this._levels.length>1&&(h|=4194304),(this._levels.length>1||this.cubemap)&&(h|=8);var l=this.cubemap?65024:0;r[0]=542327876,r[1]=124,r[2]=o,r[3]=this.height,r[4]=this.width,r[5]=this.width*this.height*4,r[6]=0,r[7]=this._levels.length;for(var c=0;c<11;c++)r[8+c]=0;r[19]=32,r[20]=65,r[21]=0,r[22]=32,r[23]=16711680,r[24]=65280,r[25]=255,r[26]=4278190080,r[27]=h,r[28]=l,r[29]=0,r[30]=0,r[31]=0;var u=128;if(this.cubemap)for(var d=0;d<6;d++)for(var f=0;f=0?t.insertChild(this,e):t.addChild(this))},i.setLocalEulerAngles=function(t,e,i){this.localRotation.setFromEulerAngles(t,e,i),this._dirtyLocal||this._dirtifyLocal()},i.setLocalPosition=function(t,e,i){t instanceof ft?this.localPosition.copy(t):this.localPosition.set(t,e,i),this._dirtyLocal||this._dirtifyLocal()},i.setLocalRotation=function(t,e,i,n){t instanceof wt?this.localRotation.copy(t):this.localRotation.set(t,e,i,n),this._dirtyLocal||this._dirtifyLocal()},i.setLocalScale=function(t,e,i){t instanceof ft?this.localScale.copy(t):this.localScale.set(t,e,i),this._dirtyLocal||this._dirtifyLocal()},i._dirtifyLocal=function(){this._dirtyLocal||(this._dirtyLocal=!0,this._dirtyWorld||this._dirtifyWorld())},i._unfreezeParentToRoot=function(){for(var t=this._parent;t;)t._frozen=!1,t=t._parent},i._dirtifyWorld=function(){this._dirtyWorld||this._unfreezeParentToRoot(),this._dirtifyWorldInternal()},i._dirtifyWorldInternal=function(){if(!this._dirtyWorld){this._frozen=!1,this._dirtyWorld=!0;for(var t=0;t8?t.FORMAT_FLOAT:t.FORMAT_8BIT,t.initShaderDefines()},t.createTexture=function(t,e,i,n,s){return new Bi(t,{name:s,width:e,height:i,mipmaps:!1,format:n,addressU:1,addressV:1,type:Ve,magFilter:0,minFilter:0,anisotropy:1})};var e=t.prototype;return e.destroy=function(){this.lightsTexture8&&(this.lightsTexture8.destroy(),this.lightsTexture8=null),this.lightsTextureFloat&&(this.lightsTextureFloat.destroy(),this.lightsTextureFloat=null)},e.setCompressionRanges=function(t,e){this.invMaxColorValue=1/e,this.invMaxAttenuation=1/t},e.setBounds=function(t,e){this.boundsMin.copy(t),this.boundsDelta.copy(e)},e.uploadTextures=function(){this.lightsTextureFloat&&(this.lightsTextureFloat.lock().set(this.lightsFloat),this.lightsTextureFloat.unlock()),this.lightsTexture8.lock().set(this.lights8),this.lightsTexture8.unlock()},e.updateUniforms=function(){this._lightsTexture8Id.setValue(this.lightsTexture8),t.lightTextureFormat===t.FORMAT_FLOAT&&this._lightsTextureFloatId.setValue(this.lightsTextureFloat),this._lightsTextureInvSizeId.setValue(this._lightsTextureInvSizeData)},e.getSpotDirection=function(t,e){e._node.getWorldTransform().getY(t).mulScalar(-1),t.normalize()},e.getLightAreaSizes=function(t){var e=t._node.getWorldTransform();return e.transformVector(dn,cn),un[0]=cn.x,un[1]=cn.y,un[2]=cn.z,e.transformVector(fn,cn),un[3]=cn.x,un[4]=cn.y,un[5]=cn.z,un},e.addLightDataFlags=function(t,e,i,n,s){t[e+0]=n?255:0,t[e+1]=64*i._shape,t[e+2]=255*i._falloffMode,t[e+3]=s?255:0},e.addLightDataColor=function(t,e,i,n,s){var a=this.invMaxColorValue,r=n?i._linearFinalColor:i._finalColor;ki.float2Bytes(r[0]*a,t,e+0,2),ki.float2Bytes(r[1]*a,t,e+2,2),ki.float2Bytes(r[2]*a,t,e+4,2),t[e+6]=s?255:0;var o=!!(1&i.mask),h=!!(2&i.mask);t[e+7]=o&&h?127:h?255:0},e.addLightDataSpotAngles=function(t,e,i){ki.float2Bytes(.499999*i._innerConeAngleCos+.5,t,e+0,2),ki.float2Bytes(.499999*i._outerConeAngleCos+.5,t,e+2,2)},e.addLightDataShadowBias=function(t,e,i){var n=i.getRenderData(null,0),s=i._getUniformBiasValues(n);ki.float2BytesRange(s.bias,t,e,-1,20,2),ki.float2Bytes(s.normalBias,t,e+2,2)},e.addLightDataPositionRange=function(t,e,i,n){var s=cn.sub2(n,this.boundsMin).div(this.boundsDelta);ki.float2Bytes(s.x,t,e+0,4),ki.float2Bytes(s.y,t,e+4,4),ki.float2Bytes(s.z,t,e+8,4),ki.float2Bytes(i.attenuationEnd*this.invMaxAttenuation,t,e+12,4)},e.addLightDataSpotDirection=function(t,e,i){this.getSpotDirection(cn,i),ki.float2Bytes(.499999*cn.x+.5,t,e+0,4),ki.float2Bytes(.499999*cn.y+.5,t,e+4,4),ki.float2Bytes(.499999*cn.z+.5,t,e+8,4)},e.addLightDataLightProjMatrix=function(t,e,i){for(var n=i.data,s=0;s<12;s++)ki.float2BytesRange(n[s],t,e+4*s,-2,2,4);for(var a=12;a<16;a++)ki.float2MantissaExponent(n[a],t,e+4*a,4)},e.addLightDataCookies=function(t,e,i){var n="rgb"===i._cookieChannel;if(t[e+0]=Math.floor(255*i.cookieIntensity),t[e+1]=n?255:0,!n){var s=i._cookieChannel;t[e+4]="rrr"===s?255:0,t[e+5]="ggg"===s?255:0,t[e+6]="bbb"===s?255:0,t[e+7]="aaa"===s?255:0}},e.addLightAtlasViewport=function(t,e,i){ki.float2Bytes(i.x,t,e+0,2),ki.float2Bytes(i.y,t,e+2,2),ki.float2Bytes(i.z/3,t,e+4,2)},e.addLightAreaSizes=function(t,e,i){for(var n=this.getLightAreaSizes(i),s=0;s<6;s++)ki.float2MantissaExponent(n[s],t,e+4*s,4)},e.addLightData=function(e,i,n){var s=2===e._type,a=e.atlasViewportAllocated,r=this.cookiesEnabled&&!!e._cookie&&a,o=this.areaLightsEnabled&&0!==e.shape,h=this.shadowsEnabled&&e.castShadows&&a,l=e._node.getPosition(),c=null,u=null;s?h?c=e.getRenderData(null,0).shadowMatrix:r&&(c=ln.evalSpotCookieMatrix(e)):(h||r)&&(u=e.atlasViewport);var d=this.lights8,f=i*this.lightsTexture8.width*4;if(this.addLightDataFlags(d,f+4*pn.FLAGS,e,s,h),this.addLightDataColor(d,f+4*pn.COLOR_A,e,n,r),s&&this.addLightDataSpotAngles(d,f+4*pn.SPOT_ANGLES,e),e.castShadows&&this.addLightDataShadowBias(d,f+4*pn.SHADOW_BIAS,e),r&&this.addLightDataCookies(d,f+4*pn.COOKIE_A,e),t.lightTextureFormat===t.FORMAT_FLOAT){var p=this.lightsFloat,m=i*this.lightsTextureFloat.width*4;if(p[m+4*mn.POSITION_RANGE+0]=l.x,p[m+4*mn.POSITION_RANGE+1]=l.y,p[m+4*mn.POSITION_RANGE+2]=l.z,p[m+4*mn.POSITION_RANGE+3]=e.attenuationEnd,s&&(this.getSpotDirection(cn,e),p[m+4*mn.SPOT_DIRECTION+0]=cn.x,p[m+4*mn.SPOT_DIRECTION+1]=cn.y,p[m+4*mn.SPOT_DIRECTION+2]=cn.z),c)for(var _=c.data,g=0;g<16;g++)p[m+4*mn.PROJ_MAT_0+g]=_[g];if(u&&(p[m+4*mn.ATLAS_VIEWPORT+0]=u.x,p[m+4*mn.ATLAS_VIEWPORT+1]=u.y,p[m+4*mn.ATLAS_VIEWPORT+2]=u.z/3),o){var v=this.getLightAreaSizes(e);p[m+4*mn.AREA_DATA_WIDTH+0]=v[0],p[m+4*mn.AREA_DATA_WIDTH+1]=v[1],p[m+4*mn.AREA_DATA_WIDTH+2]=v[2],p[m+4*mn.AREA_DATA_HEIGHT+0]=v[3],p[m+4*mn.AREA_DATA_HEIGHT+1]=v[4],p[m+4*mn.AREA_DATA_HEIGHT+2]=v[5]}}else this.addLightDataPositionRange(d,f+4*pn.POSITION_X,e,l),s&&this.addLightDataSpotDirection(d,f+4*pn.SPOT_DIRECTION_X,e),c&&this.addLightDataLightProjMatrix(d,f+4*pn.PROJ_MAT_00,c),u&&this.addLightAtlasViewport(d,f+4*pn.ATLAS_VIEWPORT_A,u),o&&this.addLightAreaSizes(d,f+4*pn.AREA_DATA_WIDTH_X,e)},t}();_n.FORMAT_FLOAT=0,_n.FORMAT_8BIT=1,_n.lightTextureFormat=_n.FORMAT_8BIT,_n.shaderDefines="";var gn=[],vn={rgbm:"decodeRGBM",rgbe:"decodeRGBE",linear:"decodeLinear"},yn={optionsContext:{},optionsContextMin:{},generateKey:function(t){var e,i=function(t){var e=[];for(var i in t)t.hasOwnProperty(i)&&"chunks"!==i&&"lights"!==i&&e.push(i);return e.sort()};t===this.optionsContextMin?(this.propsMin||(this.propsMin=i(t)),e=this.propsMin):t===this.optionsContext?(this.props||(this.props=i(t)),e=this.props):e=i(t);for(var n="standard",s=0;s0){if(gn[t]e.length){for(var i=e,n=i.charAt(i.length-1),s=gn[t]-i.length,a=0;a1&&(a+="getShadowCascadeMatrix(light"+n+"_shadowMatrixPalette, light"+n+"_shadowCascadeDistances, light"+n+"_shadowCascadeCount);\n",e="(cascadeShadowMat, "+i+");\n"),a+=s+e,a+="fadeShadow(light"+n+"_shadowCascadeDistances);\n"},_nonPointShadowMapProjection:function(t,e,i,n,s){var a="("+i+", "+n+");\n";return!e._normalOffsetBias||e._isVsm?2===e._type?e._isPcf&&(t.webgl2||t.extStandardDerivatives)?"\t\t\t getShadowCoordPerspZbuffer"+a:"\t\t\t getShadowCoordPersp"+a:this._directionalShadowMapProjection(e,a,n,s,"getShadowCoordOrtho"):2===e._type?e._isPcf&&(t.webgl2||t.extStandardDerivatives)?"\t\t\t getShadowCoordPerspZbufferNormalOffset"+a:"\t\t\t getShadowCoordPerspNormalOffset"+a:this._directionalShadowMapProjection(e,a,n,s,"getShadowCoordOrthoNormalOffset")},_addVaryingIfNeeded:function(t,e,i){return t.indexOf(i)>=0?"varying "+e+" "+i+";\n":""},_getLightSourceShapeString:function(t){switch(t){case 1:return"Rect";case 2:return"Disk";case 3:return"Sphere";default:return""}},_getPassDefineString:function(t){return t===Wt?"#define PICK_PASS\n":2===t?"#define DEPTH_PASS\n":t>=3&&t<=17?"#define SHADOW_PASS\n":""},_vsAddTransformCode:function(t,e,i,n){return t+=i.transformVS},_vsAddBaseCode:function(t,e,i,n){return t+=i.baseVS,1!==n.nineSlicedMode&&2!==n.nineSlicedMode||(t+=i.baseNineSlicedVS),t},_fsAddBaseCode:function(t,e,i,n){return t+=i.basePS,1===n.nineSlicedMode?t+=i.baseNineSlicedPS:2===n.nineSlicedMode&&(t+=i.baseNineSlicedTiledPS),2===n.nineSlicedMode?t+="const float textureBias = -1000.0;\n":t+="uniform float textureBias;\n",t},_decodeFunc:function(t){return vn[t]||"decodeGamma"},_fsAddStartCode:function(t,e,i,n){return t+=i.startPS,1===n.nineSlicedMode?t+=i.startNineSlicedPS:2===n.nineSlicedMode&&(t+=i.startNineSlicedTiledPS),t},_buildShadowPassFragmentCode:function(t,e,i,n,s){var a=n.pass-3,r=Math.floor(a/6),o=a-6*r;return e.extStandardDerivatives&&!e.webgl2&&(t+="uniform vec2 polygonOffset;\n"),3===o?e.textureFloatHighPrecision?t+="#define VSM_EXPONENT 15.0\n\n":t+="#define VSM_EXPONENT 5.54\n\n":2===o&&(t+="#define VSM_EXPONENT 5.54\n\n"),0!==r&&(t+="uniform vec3 view_position;\n",t+="uniform float light_radius;\n"),t+=s,n.alphaTest&&(t+="uniform float textureBias;",t+="float dAlpha;\n",t+=this._addMap("opacity","opacityPS",n,i),t+=i.alphaTestPS),0!==o||e.webgl2&&1!==r?1===o&&(t+="vec2 encodeFloatRG( float v ) {\n",t+="\t\tvec2 enc = vec2(1.0, 255.0) * v;\n",t+="\t\tenc = fract(enc);\n",t+="\t\tenc -= enc.yy * vec2(1.0/255.0, 1.0/255.0);\n",t+="\t\treturn enc;\n",t+="}\n\n"):t+=i.packDepthPS,t+="void main(void)\n{\n",n.alphaTest&&(t+="\t getOpacity();\n",t+="\t alphaTest(dAlpha);\n"),t+=1===r||(1===o||2===o||3===o)&&0!==r?"\t float depth = min(distance(view_position, vPositionW) / light_radius, 0.99999);\n":"\t float depth = gl_FragCoord.z;\n",0!==o||e.webgl2&&(1!==r||n.clusteredLightingEnabled)?0===o||4===o?(t+="\t gl_FragColor = vec4(1.0);\n",n.clusteredLightingEnabled&&1===r&&e.webgl2&&(t+="\t gl_FragDepth = depth;\n")):t+=1===o?"\t gl_FragColor = vec4(encodeFloatRG(depth), encodeFloatRG(depth*depth));\n":i.storeEVSMPS:e.extStandardDerivatives&&!e.webgl2?(t+="\t float minValue = 2.3374370500153186e-10; //(1.0 / 255.0) / (256.0 * 256.0 * 256.0);\n",t+="\t depth += polygonOffset.x * max(abs(dFdx(depth)), abs(dFdy(depth))) + minValue * polygonOffset.y;\n",t+="\t gl_FragColor = packFloat(depth);\n"):t+="\t gl_FragColor = packFloat(depth);\n",t+="}\n"},createShaderDefinition:function(t,e){var i=e.lights.length>0;e.dirLightMap&&(i=!0),e.clusteredLightingEnabled&&(i=!0),0===e.shadingModel?(e.fresnelModel=0,e.specularAntialias=!1,e.ambientSH=!1):e.fresnelModel=0===e.fresnelModel?2:e.fresnelModel;var n=!!e.reflectionSource;e.useSpecular||(e.specularMap=e.glossMap=null);var s=e.pass>=3&&e.pass<=17,a=i||n||e.ambientSH||e.heightMap||e.enableGGXSpecular||e.clusteredLightingEnabled&&!s||e.clearCoatNormalMap;this.options=e;var r,o,h="",l="",c="",u=ci,d={vertex_position:le};if(e.chunks){var f={};for(var p in u)u.hasOwnProperty(p)&&(e.chunks[p]?((o=e.chunks[p]).indexOf("vertex_normal")>=0&&(d.vertex_normal=ce),o.indexOf("vertex_tangent")>=0&&(d.vertex_tangent=ue),o.indexOf("vertex_texCoord0")>=0&&(d.vertex_texCoord0=_e),o.indexOf("vertex_texCoord1")>=0&&(d.vertex_texCoord1=ge),o.indexOf("vertex_color")>=0&&(d.vertex_color=pe),o.indexOf("vertex_boneWeights")>=0&&(d.vertex_boneWeights=de),o.indexOf("vertex_boneIndices")>=0&&(d.vertex_boneIndices=fe),f[p]=o):f[p]=u[p]);u=f}h+=this._getPassDefineString(e.pass),h=this._vsAddBaseCode(h,t,u,e),l+="\t vPositionW\t\t= getWorldPosition();\n",2===e.pass&&(h+="varying float vDepth;\n",h+="#ifndef VIEWMATRIX\n",h+="#define VIEWMATRIX\n",h+="uniform mat4 matrix_view;\n",h+="#endif\n",h+="#ifndef CAMERAPLANES\n",h+="#define CAMERAPLANES\n",h+="uniform vec4 camera_params;\n\n",h+="#endif\n",l+="\t\tvDepth = -(matrix_view * vec4(vPositionW,1.0)).z * camera_params.x;\n"),e.useInstancing&&(d.instance_line1=Be,d.instance_line2=Ne,d.instance_line3=Ue,d.instance_line4=ze,h+=u.instancingVS),a&&(d.vertex_normal=ce,l+="\t vNormalW = getNormal();\n","sphereMap"===e.reflectionSource&&t.fragmentUniformsCount<=16&&(h+=u.viewNormalVS,l+="\t vNormalV\t\t= getViewNormal();\n"),(e.heightMap||e.normalMap||e.enableGGXSpecular)&&e.hasTangents?(d.vertex_tangent=ue,h+=u.tangentBinormalVS,l+="\t vTangentW\t = getTangent();\n",l+="\t vBinormalW\t= getBinormal();\n"):e.enableGGXSpecular&&(h+=u.tangentBinormalVS,l+="\t vObjectSpaceUpW\t= getObjectSpaceUp();\n"));var m=[],_=[];for(var g in gn){var v=g+"Map";if(e[g+"VertexColor"]){var y=g+"VertexColorChannel";e[y]=this._correctChannel(g,e[y])}if(e[v]){var x=v+"Channel",b=v+"Transform",S=v+"Uv";e[S]=Math.min(e[S],1),e[x]=this._correctChannel(g,e[x]);var w=e[S];m[w]=!0,_[w]=_[w]||e[v]&&!e[b]}}e.forceUv1&&(m[1]=!0,_[1]=void 0===_[1]||_[1]);for(var T=0;T<2;T++)m[T]&&(d["vertex_texCoord"+T]="TEXCOORD"+T,h+=u["uv"+T+"VS"],l+="\t vec2 uv"+T+" = getUv"+T+"();\n"),_[T]&&(l+="\t vUv"+T+" = uv"+T+";\n");var A=[h,c,l,[]];for(var M in gn){var C=M+"Map";if(e[C]){var E=C+"Transform";if(e[E]){var P=C+"Uv";this._setMapTransform(A,M,e[E],e[P])}}}h=A[0],c=A[1],l=A[2],e.vertexColors&&(d.vertex_color=pe,l+="\t vVertexColor = vertex_color;\n"),(e.useMorphPosition||e.useMorphNormal)&&(e.useMorphTextureBased?(h+="#define MORPHING_TEXTURE_BASED\n",e.useMorphPosition&&(h+="#define MORPHING_TEXTURE_BASED_POSITION\n"),e.useMorphNormal&&(h+="#define MORPHING_TEXTURE_BASED_NORMAL\n"),d.morph_vertex_id=ze,h+="attribute float morph_vertex_id;\n"):(h+="#define MORPHING\n",e.useMorphPosition?(d.morph_pos0=De,d.morph_pos1=ke,d.morph_pos2=Oe,d.morph_pos3=Fe,h+="#define MORPHING_POS03\n",h+="attribute vec3 morph_pos0;\n",h+="attribute vec3 morph_pos1;\n",h+="attribute vec3 morph_pos2;\n",h+="attribute vec3 morph_pos3;\n"):e.useMorphNormal&&(d.morph_nrm0=De,d.morph_nrm1=ke,d.morph_nrm2=Oe,d.morph_nrm3=Fe,h+="#define MORPHING_NRM03\n",h+="attribute vec3 morph_nrm0;\n",h+="attribute vec3 morph_nrm1;\n",h+="attribute vec3 morph_nrm2;\n",h+="attribute vec3 morph_nrm3;\n"),e.useMorphNormal?(d.morph_nrm4=Be,d.morph_nrm5=Ne,d.morph_nrm6=Ue,d.morph_nrm7=ze,h+="#define MORPHING_NRM47\n",h+="attribute vec3 morph_nrm4;\n",h+="attribute vec3 morph_nrm5;\n",h+="attribute vec3 morph_nrm6;\n",h+="attribute vec3 morph_nrm7;\n"):(d.morph_pos4=Be,d.morph_pos5=Ne,d.morph_pos6=Ue,d.morph_pos7=ze,h+="#define MORPHING_POS47\n",h+="attribute vec3 morph_pos4;\n",h+="attribute vec3 morph_pos5;\n",h+="attribute vec3 morph_pos6;\n",h+="attribute vec3 morph_pos7;\n"))),e.skin?(d.vertex_boneWeights=de,d.vertex_boneIndices=fe,h+=pi(t,u),h+="#define SKIN\n"):e.useInstancing&&(h+="#define INSTANCING\n"),e.screenSpace&&(h+="#define SCREENSPACE\n"),e.pixelSnap&&(h+="#define PIXELSNAP\n"),h=this._vsAddTransformCode(h,t,u,e),a&&(h+=u.normalVS),h+="\n",h+=u.startVS,h+=l,h+=u.endVS;var R=h+="}",I=c;c="",c+=this._addVaryingIfNeeded(h,"vec4","vVertexColor"),c+=this._addVaryingIfNeeded(h,"vec3","vPositionW"),c+=this._addVaryingIfNeeded(h,"vec3","vNormalV"),c+=this._addVaryingIfNeeded(h,"vec3","vNormalW"),c+=this._addVaryingIfNeeded(h,"vec3","vTangentW"),c+=this._addVaryingIfNeeded(h,"vec3","vBinormalW"),c+=this._addVaryingIfNeeded(h,"vec3","vObjectSpaceUpW"),c+=this._addVaryingIfNeeded(h,"vec2","vUv0"),c+=this._addVaryingIfNeeded(h,"vec2","vUv1"),R=(c+=I)+R;var L="";if(t.webgl2?(L=_i(t),u.extensionVS&&(L+=u.extensionVS+"\n"),R=L+u.gles3VS+R):(u.extensionVS&&(L=u.extensionVS+"\n"),R=L+R),e.forceFragmentPrecision&&"highp"!==e.forceFragmentPrecision&&"mediump"!==e.forceFragmentPrecision&&"lowp"!==e.forceFragmentPrecision&&(e.forceFragmentPrecision=null),e.forceFragmentPrecision&&("highp"===e.forceFragmentPrecision&&"highp"!==t.maxPrecision&&(e.forceFragmentPrecision="mediump"),"mediump"===e.forceFragmentPrecision&&"lowp"===t.maxPrecision&&(e.forceFragmentPrecision="lowp")),h="",t.webgl2&&(h+=_i(t)),t.webgl2||(t.extStandardDerivatives&&(h+="#extension GL_OES_standard_derivatives : enable\n"),t.extTextureLod&&(h+="#extension GL_EXT_shader_texture_lod : enable\n",h+="#define SUPPORTS_TEXLOD\n")),u.extensionPS&&(h+=u.extensionPS+"\n"),t.webgl2&&(h+=u.gles3PS),h+=e.forceFragmentPrecision?"precision "+e.forceFragmentPrecision+" float;\n\n":mi(t),h+=this._getPassDefineString(e.pass),e.pass===Wt)return h+="uniform vec4 uColor;\n",h+=c,e.alphaTest&&(h+="uniform float textureBias;",h+="float dAlpha;\n",h+=this._addMap("opacity","opacityPS",e,u),h+=u.alphaTestPS),h+="void main(void)\n{\n",e.alphaTest&&(h+="\t getOpacity();\n",h+="\t alphaTest(dAlpha);\n"),h+="\t\tgl_FragColor = uColor;\n",{attributes:d,vshader:R,fshader:h+="}\n"};if(2===e.pass)return h+="varying float vDepth;\n",h+=c,h+=u.packDepthPS,e.alphaTest&&(h+="uniform float textureBias;",h+="float dAlpha;\n",h+=this._addMap("opacity","opacityPS",e,u),h+=u.alphaTestPS),h+="void main(void)\n{\n",e.alphaTest&&(h+="\t getOpacity();\n",h+="\t alphaTest(dAlpha);\n"),h+="\t\tgl_FragColor = packFloat(vDepth);\n",{attributes:d,vshader:R,fshader:h+="}\n"};if(s)return{attributes:d,vshader:R,fshader:this._buildShadowPassFragmentCode(h,t,u,e,c)};if(e.customFragmentShader)return{attributes:d,vshader:R,fshader:h+e.customFragmentShader,tag:1};h+=c,h=this._fsAddBaseCode(h,t,u,e),e.detailModes&&(h+=u.detailModesPS);var D=h;h="",e.clearCoat>0&&(h+="#define CLEARCOAT\n",h+="#define CLUSTER_CLEAR_COAT\n"),!1===e.opacityFadesSpecular&&(h+="uniform float material_alphaFade;\n");var k,O=0,F=[],B=!1,N=!1,U=!1,z=e.lights.some((function(t){return t._shape&&0!==t._shape}));e.clusteredLightingEnabled&&e.clusteredLightingAreaLightsEnabled&&(z=!0),7===t.areaLightLutFormat?(h+="#define AREA_R8_G8_B8_A8_LUTS\n",h+="#define AREA_LUTS_PRECISION lowp\n"):h+="#define AREA_LUTS_PRECISION highp\n",(z||e.clusteredLightingEnabled)&&(h+="#define AREA_LIGHTS\n",h+="uniform AREA_LUTS_PRECISION sampler2D areaLightsLutTex1;\n",h+="uniform AREA_LUTS_PRECISION sampler2D areaLightsLutTex2;\n");for(var V=0;V0?u.cubeMapProjectBoxPS:u.cubeMapProjectNonePS,h+=e.skyboxIntensity?u.envMultiplyPS:u.envConstPS),e.diffuseDetail&&(h+=this._addMap("diffuseDetail","diffuseDetailMapPS",e,u)),h+=this._addMap("diffuse","diffusePS",e,u),(3!==e.blendType||e.alphaTest||e.alphaToCoverage)&&(h+=this._addMap("opacity","opacityPS",e,u)),h+=this._addMap("emissive","emissivePS",e,u,e.emissiveFormat),i&&e.useSpecular||n){e.specularAntialias&&e.normalMap?e.normalizeNormalMap&&a?h+=u.specularAaToksvigPS:h+=u.specularAaToksvigFastPS:h+=u.specularAaNonePS;var j=e.useMetalness?"metalness":"specular";h+=this._addMap(j,j+"PS",e,u),h+=this._addMap("gloss","glossPS",e,u),2===e.fresnelModel&&(h+=u.fresnelSchlickPS)}if(e.clearCoat>0&&(h+=this._addMap("clearCoat","clearCoatPS",e,u),h+=this._addMap("clearCoatGloss","clearCoatGlossPS",e,u),h+=this._addMap("clearCoatNormal","clearCoatNormalPS",e,u)),e.heightMap){if(!e.normalMap){var Y=this._getUvSourceExpression("heightMapTransform","heightMapUv",e);e.hasTangents||(k=k.replace(/\$UV/g,Y)),h+=k}h+=this._addMap("height","parallaxPS",e,u)}var K=e.aoMap||e.aoVertexColor;if(K&&(h+=this._addMap("ao","aoPS",e,u),h+=u.aoDiffuseOccPS,e.occludeSpecular&&(1===e.occludeSpecular?h+=e.occludeSpecularFloat?u.aoSpecOccSimplePS:u.aoSpecOccConstSimplePS:h+=e.occludeSpecularFloat?u.aoSpecOccPS:u.aoSpecOccConstPS)),"envAtlas"===e.reflectionSource)h+=u.reflectionEnvPS.replace(/\$DECODE/g,this._decodeFunc(e.reflectionEncoding));else if("cubeMap"===e.reflectionSource)h+=e.fixSeams?u.fixCubemapSeamsStretchPS:u.fixCubemapSeamsNonePS,h+=u.reflectionCubePS.replace(/\$DECODE/g,this._decodeFunc(e.reflectionEncoding));else if("sphereMap"===e.reflectionSource){h+=(t.fragmentUniformsCount>16?u.reflectionSpherePS:u.reflectionSphereLowPS).replace(/\$DECODE/g,this._decodeFunc(e.reflectionEncoding))}n&&(e.clearCoat>0&&(h+=u.reflectionCCPS),e.refraction&&(h+=u.refractionPS)),e.clusteredLightingEnabled&&(h+=u.clusteredLightUtilsPS,h+=u.clusteredLightCookiesPS,F[0]=!0,F[4]=!0,U=!0),(O>0||e.clusteredLightingEnabled)&&(B&&(h+=u.shadowCascadesPS),F[0]&&(h+=u.shadowStandardPS),F[4]&&t.webgl2&&(h+=u.shadowStandardGL2PS),N&&(h+=u.shadowVSM_commonPS,F[1]&&(h+=u.shadowVSM8PS),F[2]&&(h+=t.extTextureHalfFloatLinear?u.shadowEVSMPS.replace(/\$/g,"16"):u.shadowEVSMnPS.replace(/\$/g,"16")),F[3]&&(h+=t.extTextureFloatLinear?u.shadowEVSMPS.replace(/\$/g,"32"):u.shadowEVSMnPS.replace(/\$/g,"32"))),t.webgl2||t.extStandardDerivatives||(h+=u.biasConstPS),h+=u.shadowCoordPS+u.shadowCommonPS,U&&(h+=u.shadowCoordPerspZbufferPS)),e.enableGGXSpecular&&(h+="uniform float material_anisotropy;\n"),i&&(h+=u.lightDiffuseLambertPS,(z||e.clusteredLightingEnabled)&&(h+=u.ltc)),h+="\n";var Z=!1;e.useSpecular?(h+="#define CLUSTER_SPECULAR\n",e.conserveEnergy&&(h+="#define CLUSTER_CONSERVE_ENERGY\n"),i&&(h+=0===e.shadingModel?u.lightSpecularPhongPS:e.enableGGXSpecular?u.lightSpecularAnisoGGXPS:u.lightSpecularBlinnPS),e.fresnelModel>0?e.conserveEnergy&&!z?h+=u.combineDiffuseSpecularPS:h+=u.combineDiffuseSpecularNoConservePS:n?h+=u.combineDiffuseSpecularOldPS:e.diffuseMap?h+=u.combineDiffuseSpecularNoReflPS:(h+=u.combineDiffuseSpecularNoReflSeparateAmbientPS,Z=!0)):h+=u.combineDiffusePS,e.clearCoat>0&&(h+=u.combineClearCoatPS);var $=!0;if(e.lightMap||e.lightVertexColor){var Q=e.dirLightMap&&e.useSpecular?"lightmapDirPS":"lightmapSinglePS";h+=this._addMap("light",Q,e,u,e.lightMapFormat),$=e.lightMapWithoutAmbient}$&&("ambientSH"===e.ambientSource?h+=u.ambientSHPS:"envAtlas"===e.ambientSource?h+=u.ambientEnvPS.replace(/\$DECODE/g,this._decodeFunc(e.ambientEncoding)):h+=u.ambientConstantPS),e.ambientTint&&!Z&&(h+="uniform vec3 material_ambient;\n"),e.alphaTest&&(h+=u.alphaTestPS),e.msdf&&(h+=u.msdfPS),a&&(h+=u.viewDirPS,e.useSpecular&&(h+=e.enableGGXSpecular?u.reflDirAnisoPS:u.reflDirPS));var J,tt=!1,et=!1,it=!1,nt=!1,st=!1;e.clusteredLightingEnabled&&i&&(nt=!0,tt=!0,et=!0,st=!0,h+=u.floatUnpackingPS,e.lightMaskDynamic&&(h+="\n#define CLUSTER_MESH_DYNAMIC_LIGHTS"),e.clusteredLightingCookiesEnabled&&(h+="\n#define CLUSTER_COOKIES"),e.clusteredLightingShadowsEnabled&&!e.noShadow&&(h+="\n#define CLUSTER_SHADOWS",h+="\n#define CLUSTER_SHADOW_TYPE_"+Ot[e.clusteredLightingShadowType]),e.clusteredLightingAreaLightsEnabled&&(h+="\n#define CLUSTER_AREALIGHTS"),h+=_n.shaderDefines,h+=u.clusteredLightShadowsPS,h+=u.clusteredLightPS),e.twoSidedLighting&&(h+="uniform float twoSidedLightingNegScaleFactor;\n"),h=this._fsAddStartCode(h,t,u,e),a&&(e.hasTangents||!t.extStandardDerivatives||e.fastTbn?e.twoSidedLighting?h+="\t dVertexNormalW = gl_FrontFacing ? vNormalW * twoSidedLightingNegScaleFactor : -vNormalW * twoSidedLightingNegScaleFactor;\n":h+="\t dVertexNormalW = vNormalW;\n":e.twoSidedLighting?h+="\t dVertexNormalW = normalize(gl_FrontFacing ? vNormalW * twoSidedLightingNegScaleFactor : -vNormalW * twoSidedLightingNegScaleFactor);\n":h+="\t dVertexNormalW = normalize(vNormalW);\n",(e.heightMap||e.normalMap)&&e.hasTangents&&(e.twoSidedLighting?(h+="\t dTangentW = gl_FrontFacing ? vTangentW * twoSidedLightingNegScaleFactor : -vTangentW * twoSidedLightingNegScaleFactor;\n",h+="\t dBinormalW = gl_FrontFacing ? vBinormalW * twoSidedLightingNegScaleFactor : -vBinormalW * twoSidedLightingNegScaleFactor;\n"):(h+="\t dTangentW = vTangentW;\n",h+="\t dBinormalW = vBinormalW;\n")));var at=!1;3!==e.blendType||e.alphaTest||e.alphaToCoverage?e.heightMap&&e.opacityMap?at=!0:(h+="\t getOpacity();\n",e.alphaTest&&(h+="\t alphaTest(dAlpha);\n")):h+="\t dAlpha = 1.0;\n";var rt=!1;if(a&&(h+="\t getViewDir();\n",(e.heightMap||e.normalMap||e.clearCoatNormalMap||e.enableGGXSpecular)&&(h+="\t getTBN();\n"),e.heightMap&&(h+="\t getParallax();\n"),at&&(h+="\t getOpacity();\n",e.alphaTest&&(h+="\t alphaTest(dAlpha);\n")),h+="\t getNormal();\n",e.useSpecular&&(i&&e.enableGGXSpecular&&(h+="\t getGlossiness();\n",rt=!0),h+="\t getReflDir();\n")),h+="\t getAlbedo();\n",e.clearCoat>0&&(h+="\t getClearCoat();\n",h+="\t getClearCoatGlossiness();\n",h+="\t getClearCoatNormal();\n"),(i&&e.useSpecular||n)&&(h+="\t getSpecularity();\n",rt||(h+="\t getGlossiness();\n"),z&&(h+="\t #ifdef AREA_LIGHTS\n",h+="\t dSpecularityNoFres = dSpecularity;\n",h+="\t #ifdef CLEARCOAT\n",h+="\t ccSpecularityNoFres = ccSpecularity;\n",h+="\t #endif\n",h+="\t #endif\n"),e.fresnelModel>0&&(h+="\t getFresnel();\n")),K&&(h+="\tgetAO();\n"),$&&(h+="\t addAmbient();\n",e.separateAmbient&&(h+="\n\t\t\t\t\t\t\t\t\t\tvec3 dAmbientLight = dDiffuseLight;\n\t\t\t\t\t\t\t\t\t\tdDiffuseLight = vec3(0);\n\t\t\t\t\t\t\t\t")),e.ambientTint&&!Z&&(h+="\t dDiffuseLight *= material_ambient;\n"),K&&!e.occludeDirect&&(h+="\t\toccludeDiffuse();\n"),(e.lightMap||e.lightVertexColor)&&(h+="\t addLightMap();\n"),i||n){n&&(e.clearCoat>0&&(h+="\t addReflectionCC();\n"),h+="\t addReflection();\n"),z&&(h+="\t ccReflection.rgb *= ccSpecularity;\n",h+="\t dReflection.rgb *= dSpecularity;\n",h+="\t dSpecularLight *= dSpecularity;\n",h+="\t float roughness = max((1.0 - dGlossiness) * (1.0 - dGlossiness), 0.001);\n",h+="\t calcLTCLightValues();\n");for(var ot=0;ot 0.00001) {\n",2===lt&&(J&&!ht._cookieFalloff||(h+="\t\t\t dAtten *= getSpotEffect(light"+ot+"_direction, light"+ot+"_innerConeAngle, light"+ot+"_outerConeAngle);\n",nt=!0))),h+=0!==ct?0===lt?"\t\t\t dAttenD = getLightDiffuse();\n":"\t\t\t dAttenD = get"+ut+"LightDiffuse() * 16.0;\n":"\t\t\t dAtten *= getLightDiffuse();\n",ht.castShadows&&!e.noShadow){var dt=null,ft=void 0;if(1===ht._shadowType?(dt="VSM8",ft="0.0"):2===ht._shadowType?(dt="VSM16",ft="5.54"):3===ht._shadowType?(dt="VSM32",ft=t.textureFloatHighPrecision?"15.0":"5.54"):dt=4===ht._shadowType?"PCF5x5":"PCF3x3",null!==dt)if(1===lt)r="(light"+ot+"_shadowMap, light"+ot+"_shadowParams);\n",ht._normalOffsetBias&&(h+="\t\t\t normalOffsetPointShadow(light"+ot+"_shadowParams);\n"),h+="\t\t\t dAtten *= getShadowPoint"+dt+r;else{var pt="light"+ot+"_shadowMatrix",mt="light"+ot+"_shadowParams";h+=this._nonPointShadowMapProjection(t,e.lights[ot],pt,mt,ot),2===lt&&(dt="Spot"+dt),h+="\t\t\t dAtten *= getShadow"+dt+"(light"+ot+"_shadowMap, light"+ot+"_shadowParams"+(ht._isVsm?", "+ft:"")+");\n"}}0!==ct?e.conserveEnergy&&e.useSpecular?h+="\t\t\t dDiffuseLight += mix((dAttenD * dAtten) * light"+ot+"_color"+(J?" * dAtten3":"")+", vec3(0), dLTCSpecFres);\n":h+="\t\t\t dDiffuseLight += (dAttenD * dAtten) * light"+ot+"_color"+(J?" * dAtten3":"")+";\n":z&&e.conserveEnergy&&e.useSpecular?h+="\t\t\t dDiffuseLight += mix(dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+", vec3(0), dSpecularity);\n":h+="\t\t\t dDiffuseLight += dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n",0!==ct?(e.clearCoat>0&&(h+="\t\t\t ccSpecularLight += ccLTCSpecFres * get"+ut+"LightSpecularCC() * dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n"),e.useSpecular&&(h+="\t\t\t dSpecularLight += dLTCSpecFres * get"+ut+"LightSpecular() * dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n")):z?(e.clearCoat>0&&(h+="\t\t\t ccSpecularLight += ccSpecularity * getLightSpecularCC() * dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n"),e.useSpecular&&(h+="\t\t\t dSpecularLight += dSpecularity * getLightSpecular() * dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n")):(e.clearCoat>0&&(h+="\t\t\t ccSpecularLight += getLightSpecularCC() * dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n"),e.useSpecular&&(h+="\t\t\t dSpecularLight += getLightSpecular() * dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n")),0!==lt&&(h+="\t }\n"),h+="\n"}}e.clusteredLightingEnabled&&i&&(et=!0,it=!0,tt=!0,h+="\t addClusteredLights();\n"),z&&(e.clearCoat>0&&(h+="\t ccSpecularity = 1.0;\n"),e.useSpecular&&(h+="\t dSpecularity = vec3(1);\n")),n&&e.refraction&&(h+="\t addRefraction();\n")}h+="\n",K&&(e.occludeDirect&&(h+="\t\toccludeDiffuse();\n"),e.occludeSpecular&&(h+="\t\toccludeSpecular();\n")),!1===e.opacityFadesSpecular&&(2!==e.blendType&&4!==e.blendType||(h+="float specLum = dot((dSpecularLight + dReflection.rgb * dReflection.a) * dSpecularity, vec3( 0.2126, 0.7152, 0.0722 ));\n",h+="#ifdef CLEARCOAT\n specLum += dot(ccSpecularLight * ccSpecularity + ccReflection.rgb * ccReflection.a * ccSpecularity, vec3( 0.2126, 0.7152, 0.0722 ));\n#endif\n",h+="dAlpha = clamp(dAlpha + gammaCorrectInput(specLum), 0.0, 1.0);\n"),h+="dAlpha *= material_alphaFade;\n"),h+=u.endPS,2===e.blendType||6===e.blendType||e.alphaToCoverage?h+=u.outputAlphaPS:4===e.blendType?h+=u.outputAlphaPremulPS:h+=u.outputAlphaOpaquePS,e.msdf&&(h+="\t gl_FragColor = applyMsdf(gl_FragColor);\n"),h+="\n",h+="}\n",tt&&(h=u.lightDirPointPS+h),et&&(h=u.falloffLinearPS+h),it&&(h=u.falloffInvSquaredPS+h),nt&&(h=u.spotPS+h),st&&(h=u.cookiePS+h);var _t="";return h.includes("dReflection")&&(_t+="vec4 dReflection;\n"),h.includes("dTBN")&&(_t+="mat3 dTBN;\n"),h.includes("dAlbedo")&&(_t+="vec3 dAlbedo;\n"),h.includes("dEmission")&&(_t+="vec3 dEmission;\n"),h.includes("dNormalW")&&(_t+="vec3 dNormalW;\n"),h.includes("dVertexNormalW")&&(_t+="vec3 dVertexNormalW;\n"),h.includes("dTangentW")&&(_t+="vec3 dTangentW;\n"),h.includes("dBinormalW")&&(_t+="vec3 dBinormalW;\n"),h.includes("dViewDirW")&&(_t+="vec3 dViewDirW;\n"),h.includes("dReflDirW")&&(_t+="vec3 dReflDirW;\n"),h.includes("dDiffuseLight")&&(_t+="vec3 dDiffuseLight;\n"),h.includes("dSpecularLight")&&(_t+="vec3 dSpecularLight;\n"),h.includes("dLightDirNormW")&&(_t+="vec3 dLightDirNormW;\n"),h.includes("dLightDirW")&&(_t+="vec3 dLightDirW;\n"),h.includes("dLightPosW")&&(_t+="vec3 dLightPosW;\n"),h.includes("dShadowCoord")&&(_t+="vec3 dShadowCoord;\n"),h.includes("dNormalMap")&&(_t+="vec3 dNormalMap;\n"),h.includes("dSpecularity")&&(_t+="vec3 dSpecularity;\n"),h.includes("dSpecularityNoFres")&&(_t+="vec3 dSpecularityNoFres;\n"),h.includes("dUvOffset")&&(_t+="vec2 dUvOffset;\n"),h.includes("dGlossiness")&&(_t+="float dGlossiness;\n"),h.includes("dAlpha")&&(_t+="float dAlpha;\n"),h.includes("dAtten")&&(_t+="float dAtten;\n"),h.includes("dAttenD")&&(_t+="float dAttenD;\n"),h.includes("dAtten3")&&(_t+="vec3 dAtten3;\n"),h.includes("dAo")&&(_t+="float dAo;\n"),h.includes("dMsdf")&&(_t+="vec4 dMsdf;\n"),h.includes("ccReflection")&&(_t+="vec4 ccReflection;\n"),h.includes("ccNormalW")&&(_t+="vec3 ccNormalW;\n"),h.includes("ccReflDirW")&&(_t+="vec3 ccReflDirW;\n"),h.includes("ccSpecularLight")&&(_t+="vec3 ccSpecularLight;\n"),h.includes("ccSpecularity")&&(_t+="float ccSpecularity;\n"),h.includes("ccSpecularityNoFres")&&(_t+="float ccSpecularityNoFres;\n"),h.includes("ccGlossiness")&&(_t+="float ccGlossiness;\n"),{attributes:d,vshader:R,fshader:h=D+_t+h,tag:1}}},xn={begin:vi,dummyFragmentCode:gi,end:yi,fogCode:fi,gammaCode:ui,precisionCode:mi,skinCode:pi,tonemapCode:di,versionCode:_i,basic:Ei,particle:Pi,skybox:Ri,standard:yn},bn=2.399963229728653,Sn=function(t,e,i){var n=e*bn,s=Math.sqrt(e)/Math.sqrt(i);t.x=s*Math.cos(n),t.y=s*Math.sin(n)},wn=function(t,e,i,n,s){void 0===n&&(n=0),void 0===s&&(s=1),n=1-2*n,s=1-2*s;var a=rt.lerp(n,s,e/i),r=Math.sqrt(1-a*a),o=bn*e;t.x=Math.cos(o)*r,t.y=a,t.z=Math.sin(o)*r},Tn=function(t){var e=(t<<16|t>>>16)>>>0;return 2.3283064365386963e-10*(e=((16711935&(e=((252645135&(e=((858993459&(e=((1431655765&e)<<1|(2863311530&e)>>>1)>>>0))<<2|(3435973836&e)>>>2)>>>0))<<4|(4042322160&e)>>>4)>>>0))<<8|(4278255360&e)>>>8)>>>0)},An=function(t){switch(t.type){case We:return"RGBM";case Ge:return"RGBE";default:switch(t.format){case te:case ie:case ee:case ne:return"Linear";default:return"Gamma"}}},Mn=function(t){switch(t===Xe&&(t=je),t){case qe:return"Cubemap";case je:return"Equirect";case Ye:return"Octahedral"}},Cn=function(t,e,i){if(t<=0)e[i+0]=0,e[i+1]=0,e[i+2]=0,e[i+3]=0;else if(t>=1)e[i+0]=255,e[i+1]=0,e[i+2]=0,e[i+3]=0;else{var n=1*t%1,s=255*t%1,a=65025*t%1,r=16581375*t%1;n-=s/255,s-=a/255,a-=r/255,e[i+0]=Math.min(255,Math.floor(256*n)),e[i+1]=Math.min(255,Math.floor(256*s)),e[i+2]=Math.min(255,Math.floor(256*a)),e[i+3]=Math.min(255,Math.floor(256*r))}},En=function(t,e,i,n){var s=2*i*Math.PI,a=Math.pow(1-e,1/(n+1)),r=Math.sqrt(1-a*a);t.set(Math.cos(s)*r,Math.sin(s)*r,a).normalize()},Pn=function(t,e,i){var n=2*i*Math.PI,s=Math.sqrt(1-e),a=Math.sqrt(e);t.set(Math.cos(n)*a,Math.sin(n)*a,s).normalize()},Rn=function(t,e,i,n){var s=2*i*Math.PI,a=Math.sqrt((1-e)/(1+(n*n-1)*e)),r=Math.sqrt(1-a*a);t.set(Math.cos(s)*r,Math.sin(s)*r,a).normalize()},In=function(t,e){var i=t*e,n=e/(1-t*t+i*i);return n*n*(1/Math.PI)},Ln={16:{2:26,8:20,32:17,128:16,512:16},32:{2:53,8:40,32:34,128:32,512:32},128:{2:214,8:163,32:139,128:130,512:128},1024:{2:1722,8:1310,32:1114,128:1041,512:1025}},Dn=function(t,e,i){for(var n=i/t,s=1-Math.log2(e)/11,a=s*s,r=new ft,o=new ft,h=new ft(0,0,1),l=[],c=function(t,e){var i=Ln[t];return i&&i[e]||t}(t,e),u=0;u0){var f=In(Math.min(1,d),a)/4+.001,p=.5*Math.log2(n/f);l.push(o.x,o.y,o.z,p)}}for(;l.length<4*t;)l.push(0,0,0,0);return l},kn=function(t,e,i){var n=function(t){for(var e=t.length,i=Math.min(e,512),n=Math.ceil(e/i),s=new Uint8Array(i*n*4),a=0,r=0;r>2*d),rect:l,seamPixels:h}),l.y+=l.w,l.z=Math.max(1,Math.floor(.5*l.z)),l.w=Math.max(1,Math.floor(.5*l.w))}return l.set(128*h,384*h,64*h,32*h),Gn(t,o,{numSamples:(null==(a=e)?void 0:a.numAmbientSamples)||2048,distribution:"lambert",rect:l,seamPixels:h}),o},t.generatePrefilteredAtlas=function(t,e){var i,n,s,a;void 0===e&&(e=null);for(var r,o=t[0].device,h=(null==(i=e)?void 0:i.target)||new Bi(o,{width:(null==(n=e)?void 0:n.size)||512,height:(null==(s=e)?void 0:s.size)||512,format:7,type:We,projection:je,addressU:1,addressV:1,mipmaps:!1}),l=h.width/512,c=new _t(0,0,512*l,256*l),u=Hn(512),d=0;d0,t.forceFragmentPrecision=i.forceFragmentPrecision||"",t.chunks=i.chunks||"",t.blendType=i.blendType,t.forceUv1=i.forceUv1,t.separateAmbient=!1,t.screenSpace=n&&0!=(n&Bt),t.skin=n&&0!=(2&n),t.useInstancing=n&&0!=(32&n),t.useMorphPosition=n&&0!=(n&Nt),t.useMorphNormal=n&&0!=(n&Ut),t.useMorphTextureBased=n&&0!=(n&zt),t.nineSlicedMode=i.nineSlicedMode||0,e.clusteredLightingEnabled&&(t.clusteredLightingEnabled=!0,t.clusteredLightingCookiesEnabled=e.lighting.cookiesEnabled,t.clusteredLightingShadowsEnabled=e.lighting.shadowsEnabled,t.clusteredLightingShadowType=e.lighting.shadowType,t.clusteredLightingAreaLightsEnabled=e.lighting.areaLightsEnabled)},e._updateUVOptions=function(t,e,i,n){var s=!1,a=!1,r=!1;for(var o in i&&(s=0!=(4&i),a=0!=(8&i),r=0!=(16&i)),t.vertexColors=!1,this._mapXForms=[],gn)this._updateTexOptions(t,e,o,s,a,r,n);this._mapXForms=null},e._updateMinOptions=function(t,e){t.opacityTint=1!==e.opacity&&3!==e.blendType,t.lights=[]},e._updateMaterialOptions=function(t,e){var i,n=(e.diffuseTint||!e.diffuseMap&&!e.diffuseVertexColor)&&$n(e.diffuse),s=!!(e.useMetalness||e.specularMap||e.sphereMap||e.cubeMap||(i=e.specular,0!==i.r||0!==i.g||0!==i.b)||e.enableGGXSpecular||e.clearCoat>0),a=s&&!e.useMetalness&&(e.specularTint||!e.specularMap&&!e.specularVertexColor)&&$n(e.specular),r=!e.emissiveMap||$n(e.emissive)&&e.emissiveTint,o=1!==e.emissiveIntensity,h=!!e.normalMap&&(e.normalMap.format===Jt||e.normalMap.type===He);t.opacityTint=1!==e.opacity&&3!==e.blendType?1:0,t.blendMapsWithColors=!0,t.ambientTint=e.ambientTint,t.diffuseTint=n?2:0,t.specularTint=a?2:0,t.metalnessTint=e.useMetalness&&e.metalness<1?1:0,t.glossTint=1,t.emissiveTint=(r?2:0)+(o?1:0),t.alphaToCoverage=e.alphaToCoverage,t.normalizeNormalMap=e.normalizeNormalMap,t.ambientSH=!!e.ambientSH,t.useSpecular=s,t.emissiveFormat=e.emissiveMap?e.emissiveMap.type===We?1:e.emissiveMap.format===ne?2:0:null,t.lightMapFormat=e.lightMap?e.lightMap.type===We?1:e.lightMap.format===ne?2:0:null,t.specularAntialias=e.specularAntialias&&!!e.normalMap&&!!e.normalMap.mipmaps&&!h,t.conserveEnergy=e.conserveEnergy,t.opacityFadesSpecular=e.opacityFadesSpecular,t.alphaFade=e.alphaFade,t.occludeSpecular=e.occludeSpecular,t.occludeSpecularFloat=1!==e.occludeSpecularIntensity,t.occludeDirect=e.occludeDirect,t.shadingModel=e.shadingModel,t.fresnelModel=e.fresnelModel,t.packedNormal=h,t.fastTbn=e.fastTbn,t.cubeMapProjection=e.cubeMapProjection,t.customFragmentShader=e.customFragmentShader,t.refraction=!!e.refraction,t.useMetalness=e.useMetalness,t.enableGGXSpecular=e.enableGGXSpecular,t.msdf=!!e.msdfMap,t.twoSidedLighting=e.twoSidedLighting,t.pixelSnap=e.pixelSnap,t.aoMapUv=e.aoUvSet,t.diffuseDetail=!!e.diffuseMap,t.normalDetail=!!e.normalMap,t.diffuseDetailMode=e.diffuseDetailMode,t.detailModes=!!t.diffuseDetail,t.clearCoat=!!e.clearCoat,t.clearCoatTint=1!==e.clearCoat?1:0,t.clearCoatGlossiness=!!e.clearCoatGlossiness,t.clearCoatGlossTint=1!==e.clearCoatGlossiness?1:0},e._updateEnvOptions=function(t,e,i,n){t.fog=i.useFog?n.fog:"none",t.gamma=i.useGammaTonemap?n.gammaCorrection:0,t.toneMap=i.useGammaTonemap?n.toneMapping:-1,t.useRgbm=i.emissiveMap&&i.emissiveMap.type===We||i.lightMap&&i.lightMap.type===We,t.fixSeams=!!i.cubeMap&&i.cubeMap.fixCubemapSeams;var s=0===i.shadingModel,a=!1;if(i.envAtlas&&!s?(t.reflectionSource="envAtlas",t.reflectionEncoding=i.envAtlas.encoding):i.cubeMap?(t.reflectionSource="cubeMap",t.reflectionEncoding=i.cubeMap.encoding):i.sphereMap?(t.reflectionSource="sphereMap",t.reflectionEncoding=i.sphereMap.encoding):i.useSkybox&&n.envAtlas&&!s?(t.reflectionSource="envAtlas",t.reflectionEncoding=n.envAtlas.encoding,a=!0):(t.reflectionSource=null,t.reflectionEncoding=null),i.ambientSH&&!s)t.ambientSource="ambientSH",t.ambientEncoding=null;else{var r=i.envAtlas||(i.useSkybox&&n.envAtlas?n.envAtlas:null);r&&!s?(t.ambientSource="envAtlas",t.ambientEncoding=r.encoding):(t.ambientSource="constant",t.ambientEncoding=null)}t.skyboxIntensity=a&&1!==n.skyboxIntensity,t.useCubeMapRotation=a&&n.skyboxRotation&&!n.skyboxRotation.equals(wt.IDENTITY)},e._updateLightOptions=function(t,e,i,n,s){if(t.lightMap=!1,t.lightMapChannel="",t.lightMapUv=0,t.lightMapTransform=0,t.lightMapWithoutAmbient=!1,t.dirLightMap=!1,i&&(t.noShadow=0!=(1&i),0!=(64&i)&&(t.lightMapFormat=1,t.lightMap=!0,t.lightMapChannel="rgb",t.lightMapUv=1,t.lightMapTransform=0,t.lightMapWithoutAmbient=!e.lightMap,t.useRgbm=!0,0!=(i&Ft)&&(t.dirLightMap=!0),0!=(i&Vt)&&(t.lightMapWithoutAmbient=!1))),e.useLighting){var a=[],r=i?i>>16:1;t.lightMaskDynamic=!!(1&r),n&&(this._collectLights(0,n[0],a,r),this._collectLights(1,n[1],a,r,s),this._collectLights(2,n[2],a,r,s)),t.lights=a}else t.lights=[];0===t.lights.length&&(t.noShadow=!0)},e._updateTexOptions=function(t,e,i,n,s,a,r){var o=i+"Map",h=i+"VertexColor",l=i+"VertexColorChannel",c=o+"Channel",u=o+"Transform",d=o+"Uv";"light"!==i&&(t[o]=!1,t[c]="",t[u]=0,t[d]=0),t[h]=!1,t[l]="";var f="opacity"===i;if(f&&3===e.blendType&&0===e.alphaTest&&!e.alphaToCoverage)return t;if((!r||f)&&("height"!==i&&e[h]&&a&&(t[h]=e[h],t[l]=e[l],t.vertexColors=!0),e[o])){var p=!0;0!==e[d]||n||(p=!1),1!==e[d]||s||(p=!1),p&&(t[o]=!!e[o],t[u]=this._getMapTransformID(e.getUniform(u),e[d]),t[c]=e[c],t[d]=e[d])}},e._collectLights=function(t,e,i,n,s){for(var a=0;a0&&(this._setParameter("material_clearCoat",this.clearCoat),this._setParameter("material_clearCoatGlossiness",this.clearCoatGlossiness),this._setParameter("material_clearCoatReflectivity",this.clearCoat),this._setParameter("material_clearCoatBumpiness",this.clearCoatBumpiness)),this._setParameter("material_shininess",n("shininess")),this.emissiveMap&&!this.emissiveTint||this._setParameter("material_emissive",n("emissive")),1!==this.emissiveIntensity&&this._setParameter("material_emissiveIntensity",this.emissiveIntensity),this.refraction>0&&(this._setParameter("material_refraction",this.refraction),this._setParameter("material_refractionIndex",this.refractionIndex)),this._setParameter("material_opacity",this.opacity),!1===this.opacityFadesSpecular&&this._setParameter("material_alphaFade",this.alphaFade),this.occludeSpecular&&this._setParameter("material_occludeSpecularIntensity",this.occludeSpecularIntensity),1===this.cubeMapProjection&&this._setParameter(n("cubeMapProjectionBox")),gn)this._updateMap(s);this.ambientSH&&this._setParameter("ambientSH[0]",this.ambientSH),this.normalMap&&this._setParameter("material_bumpiness",this.bumpiness),this.normalMap&&this.normalDetailMap&&this._setParameter("material_normalDetailMapBumpiness",this.normalDetailMapBumpiness),this.heightMap&&this._setParameter("material_heightMapFactor",n("heightMapFactor")),this.cubeMap&&this._setParameter("texture_cubeMap",this.cubeMap),this.sphereMap&&this._setParameter("texture_sphereMap",this.sphereMap),this._setParameter("material_reflectivity",this.reflectivity),this._processParameters("_activeParams"),this._dirtyShader&&(this.shader=null,this.clearVariants())},i.updateEnvUniforms=function(t,e){var i=this.envAtlas||(this.useSkybox?e.envAtlas:null);i&&(this._setParameter("texture_envAtlas",i),this.useSkybox&&!e.skyboxRotation.equals(wt.IDENTITY)&&e._skyboxRotationMat3&&this._setParameter("cubeMapRotationMatrix",e._skyboxRotationMat3.data)),this._processParameters("_activeLightingParams")},i.updateShader=function(t,e,i,n,s,a){this.updateEnvUniforms(t,e);var r=s>1&&s<=Wt,o=r?yn.optionsContextMin:yn.optionsContext;r?this.shaderOptBuilder.updateMinRef(o,t,e,this,i,n,s,a):this.shaderOptBuilder.updateRef(o,t,e,this,i,n,s,a),this.onUpdateShader&&(o=this.onUpdateShader(o));var h=t.getProgramLibrary();this.shader=h.getProgram("standard",o),i||(this.clearVariants(),this.variants[0]=this.shader),this._dirtyShader=!1},i.destroy=function(){for(var e in this._assetReferences)this._assetReferences[e]._unbind();this._assetReferences=null,t.prototype.destroy.call(this)},q(e,[{key:"chunks",get:function(){return this._dirtyShader=!0,this._chunks},set:function(t){this._dirtyShader=!0,this._chunks=t}}]),e}(Kn);os.TEXTURE_PARAMETERS=ts,os.CUBEMAP_PARAMETERS=is;var hs=function(t,e){as[t]=e},ls=function(t,e,i,n){Object.defineProperty(os.prototype,t,{get:n||function(){return this["_"+t]},set:i}),ss[t]={value:e}},cs=function(t){return t.defaultValue&&t.defaultValue.clone?function(t){var e="_"+t.name,i=t.dirtyShaderFunc||function(){return!0};ls(t.name,(function(){return t.defaultValue.clone()}),(function(t){var n=this[e];n.equals(t)||(this._dirtyShader=this._dirtyShader||i(n,t),this[e]=n.copy(t))}),t.getterFunc)}(t):function(t){var e="_"+t.name,i=t.dirtyShaderFunc||function(){return!0};ls(t.name,(function(){return t.defaultValue}),(function(t){var n=this[e];n!==t&&(this._dirtyShader=this._dirtyShader||i(n,t),this[e]=t)}),t.getterFunc)}(t)};function us(t,e,i,n,s,a){gn[t]=i,cs({name:t+"Map",defaultValue:null,dirtyShaderFunc:function(t,e){return!!t!=!!e||t&&(t.type!==e.type||t.fixCubemapSeams!==e.fixCubemapSeams||t.format!==e.format)}}),cs({name:t+"MapTiling",defaultValue:new mt(1,1)}),cs({name:t+"MapOffset",defaultValue:new mt(0,0)}),cs({name:t+"MapRotation",defaultValue:0}),cs({name:t+"MapUv",defaultValue:e}),i>0&&cs({name:t+"MapChannel",defaultValue:n||(i>1?"rgb":"g")}),s&&(cs({name:t+"VertexColor",defaultValue:!1}),i>0&&cs({name:t+"VertexColorChannel",defaultValue:n||(i>1?"rgb":"g")})),a&&cs({name:t+"Mode",defaultValue:"mul"});var r=t+"MapTiling",o=t+"MapOffset",h=t+"MapRotation",l=t+"MapTransform";hs(l,(function(t,e,i){var n=t[r],s=t[o],a=t[h];if(1===n.x&&1===n.y&&0===s.x&&0===s.y&&0===a)return null;var c=t._allocUniform(l,(function(){return[{name:"texture_"+l+"0",value:new Float32Array(3)},{name:"texture_"+l+"1",value:new Float32Array(3)}]})),u=Math.cos(a*rt.DEG_TO_RAD),d=Math.sin(a*rt.DEG_TO_RAD),f=c[0].value;f[0]=u*n.x,f[1]=-d*n.y,f[2]=s.x;var p=c[1].value;return p[0]=d*n.x,p[1]=u*n.y,p[2]=1-n.y-s.y,c}))}function ds(t,e){cs({name:t,defaultValue:e,getterFunc:function(){return this._dirtyShader=!0,this["_"+t]}}),hs(t,(function(e,i,n){var s=e._allocUniform(t,(function(){return new Float32Array(3)})),a=e[t];return e.useGammaTonemap&&n.gammaCorrection?(s[0]=Math.pow(a.r,2.2),s[1]=Math.pow(a.g,2.2),s[2]=Math.pow(a.b,2.2)):(s[0]=a.r,s[1]=a.g,s[2]=a.b),s}))}function fs(t,e,i){cs({name:t,defaultValue:e,dirtyShaderFunc:function(t,e){return(0===t||1===t)!=(0===e||1===e)}}),hs(t,i)}function ps(t,e){cs({name:t,defaultValue:null,dirtyShaderFunc:function(t,e){return!!t==!!e}}),hs(t,e)}function ms(t,e){cs({name:t,defaultValue:e})}!function(){ds("ambient",new lt(.7,.7,.7)),ds("diffuse",new lt(1,1,1)),ds("specular",new lt(0,0,0)),ds("emissive",new lt(0,0,0)),fs("emissiveIntensity",1),fs("shininess",25,(function(t,e,i){return 0===t.shadingModel?Math.pow(2,.01*t.shininess*11):.01*t.shininess})),fs("heightMapFactor",1,(function(t,e,i){return.025*t.heightMapFactor})),fs("opacity",1),fs("alphaFade",1),fs("alphaTest",0),fs("bumpiness",1),fs("normalDetailMapBumpiness",1),fs("reflectivity",1),fs("occludeSpecularIntensity",1),fs("refraction",0),fs("refractionIndex",1/1.5),fs("metalness",1),fs("anisotropy",0),fs("clearCoat",0),fs("clearCoatGlossiness",1),fs("clearCoatBumpiness",1),fs("aoUvSet",0,null),ps("ambientSH"),ps("cubeMapProjectionBox",(function(t,e,i){var n=t._allocUniform("cubeMapProjectionBox",(function(){return[{name:"envBoxMin",value:new Float32Array(3)},{name:"envBoxMax",value:new Float32Array(3)}]})),s=t.cubeMapProjectionBox.getMin(),a=n[0].value;a[0]=s.x,a[1]=s.y,a[2]=s.z;var r=t.cubeMapProjectionBox.getMax(),o=n[1].value;return o[0]=r.x,o[1]=r.y,o[2]=r.z,n})),ms("ambientTint",!1),ms("diffuseTint",!1),ms("specularTint",!1),ms("emissiveTint",!1),ms("fastTbn",!1),ms("specularAntialias",!1),ms("useMetalness",!1),ms("enableGGXSpecular",!1),ms("occludeDirect",!1),ms("normalizeNormalMap",!0),ms("conserveEnergy",!0),ms("opacityFadesSpecular",!0),ms("occludeSpecular",1),ms("shadingModel",1),ms("fresnelModel",2),ms("cubeMapProjection",0),ms("customFragmentShader",null),ms("forceFragmentPrecision",null),ms("useFog",!0),ms("useLighting",!0),ms("useGammaTonemap",!0),ms("useSkybox",!0),ms("forceUv1",!1),ms("pixelSnap",!1),ms("twoSidedLighting",!1),ms("nineSlicedMode",void 0),us("diffuse",0,3,"",!0),us("specular",0,3,"",!0),us("emissive",0,3,"",!0),us("normal",0,-1,"",!1),us("metalness",0,1,"",!0),us("gloss",0,1,"",!0),us("opacity",0,1,"a",!0),us("height",0,1,"",!1),us("ao",0,1,"",!0),us("light",1,3,"",!0),us("msdf",0,3,"",!1),us("diffuseDetail",0,3,"",!1,!0),us("normalDetail",0,-1,"",!1),us("clearCoat",0,1,"",!0),us("clearCoatGloss",0,1,"",!0),us("clearCoatNormal",0,-1,"",!1),ps("cubeMap"),ps("sphereMap"),ps("envAtlas");var t=[null,null,null,null,null,null];ls("prefilteredCubemaps",(function(){return t.slice()}),(function(t){var e=this._prefilteredCubemaps;t=t||[];for(var i=!1,n=!0,s=0;s<6;++s){var a=t[s]||null;e[s]!==a&&(e[s]=a,i=!0),n=n&&!!e[s]}i&&(n?this.envAtlas=Xn.generatePrefilteredAtlas(e,{target:this.envAtlas}):this.envAtlas&&(this.envAtlas.destroy(),this.envAtlas=null),this._dirtyShader=!0)}),(function(){return this._prefilteredCubemaps}))}();var _s=function(){function t(t){this._device=t,this._cache={},this._generators={},this._isClearingCache=!1,this._precached=!1,this._programsCollection=[],this._defaultStdMatOption={},this._defaultStdMatOptionMin={};var e=new os;e.shaderOptBuilder.updateRef(this._defaultStdMatOption,t,{},e,null,[],0,null,null),e.shaderOptBuilder.updateMinRef(this._defaultStdMatOptionMin,t,{},e,null,[],3,null,null)}var e=t.prototype;return e.register=function(t,e){this.isRegistered(t)||(this._generators[t]=e)},e.unregister=function(t){this.isRegistered(t)&&delete this._generators[t]},e.isRegistered=function(t){return void 0!==this._generators[t]},e.getProgram=function(t,e){var i=this._generators[t];if(void 0===i)return null;var n=this._device,s=i.generateKey(e),a=this._cache[s];if(!a){var r;e.lights&&(r=e.lights,e.lights=r.map((function(t){var e=t.clone?t.clone():t;return e.key=t.key,e}))),this.storeNewProgram(t,e),e.lights&&(e.lights=r),this._precached&&console.warn("ProgramLibrary#getProgram: Cache miss for shader "+t+" key "+s+" after shaders precaching");var o=i.createShaderDefinition(n,e);a=this._cache[s]=new li(n,o)}return a},e.storeNewProgram=function(t,e){var i={};if("standard"===t){var n=this._getDefaultStdMatOptions(e.pass);for(var s in e)(e.hasOwnProperty(s)&&n[s]!==e[s]||"pass"===s)&&(i[s]=e[s])}else i=e;this._programsCollection.push(JSON.stringify({name:t,options:i}))},e.dumpPrograms=function(){var t="let device = pc.app ? pc.app.graphicsDevice : pc.Application.getApplication().graphicsDevice;\n";t+="let shaders = [",this._programsCollection[0]&&(t+="\n\t"+this._programsCollection[0]);for(var e=1;e1&&t<=Wt?this._defaultStdMatOptionMin:this._defaultStdMatOption},e.precompile=function(t){if(t)for(var e=new Array(t.length),i=0;ie)if(ArrayBuffer.isView(t))t=t.subarray(0,e),i.set(t);else for(var n=0;nthis.vertexBuffer.numVertices&&(i=this.vertexBuffer.numVertices);var s=n.numComponents;if(this.vertexBuffer.getFormat().interleaved)for(var a=0,r=0;ri*s){var o=i*s;if(ArrayBuffer.isView(e))e=e.subarray(0,o),n.array.set(e);else for(var h=0;he||n>e){var s=e/Math.max(i,n),a=Math.floor(i*s),r=Math.floor(n*s),o=document.createElement("canvas");return o.width=a,o.height=r,o.getContext("2d").drawImage(t,0,0,i,n,0,0,a,r),o}return t}var Zs=function(){function t(){this._glTexture=null,this._glTarget=void 0,this._glFormat=void 0,this._glInternalFormat=void 0,this._glPixelType=void 0}var e=t.prototype;return e.destroy=function(t){if(this._glTexture){for(var e=0;et.maxCubeMapSize||h.height>t.maxCubeMapSize)&&(h=Ks(h,t.maxCubeMapSize),0===a&&(e._width=h.width,e._height=h.height)),t.setUnpackFlipY(!1),t.setUnpackPremultiplyAlpha(e._premultiplyAlpha),i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+o,a,this._glInternalFormat,this._glFormat,this._glPixelType,h)}}else for(s=1/Math.pow(2,a),o=0;o<6;o++)if(e._levelsUpdated[0][o]){var l=n[o];e._compressed?i.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+o,a,this._glInternalFormat,Math.max(e._width*s,1),Math.max(e._height*s,1),0,l):(t.setUnpackFlipY(!1),t.setUnpackPremultiplyAlpha(e._premultiplyAlpha),i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+o,a,this._glInternalFormat,Math.max(e._width*s,1),Math.max(e._height*s,1),0,this._glFormat,this._glPixelType,l))}}else e._volume?(s=1/Math.pow(2,a),e._compressed?i.compressedTexImage3D(i.TEXTURE_3D,a,this._glInternalFormat,Math.max(e._width*s,1),Math.max(e._height*s,1),Math.max(e._depth*s,1),0,n):(t.setUnpackFlipY(!1),t.setUnpackPremultiplyAlpha(e._premultiplyAlpha),i.texImage3D(i.TEXTURE_3D,a,this._glInternalFormat,Math.max(e._width*s,1),Math.max(e._height*s,1),Math.max(e._depth*s,1),0,this._glFormat,this._glPixelType,n))):(t._isBrowserInterface(n)?(n instanceof HTMLImageElement&&(n.width>t.maxTextureSize||n.height>t.maxTextureSize)&&(n=Ks(n,t.maxTextureSize),0===a&&(e._width=n.width,e._height=n.height)),t.setUnpackFlipY(e._flipY),t.setUnpackPremultiplyAlpha(e._premultiplyAlpha),i.texImage2D(i.TEXTURE_2D,a,this._glInternalFormat,this._glFormat,this._glPixelType,n)):(s=1/Math.pow(2,a),e._compressed?i.compressedTexImage2D(i.TEXTURE_2D,a,this._glInternalFormat,Math.max(Math.floor(e._width*s),1),Math.max(Math.floor(e._height*s),1),0,n):(t.setUnpackFlipY(!1),t.setUnpackPremultiplyAlpha(e._premultiplyAlpha),i.texImage2D(i.TEXTURE_2D,a,this._glInternalFormat,Math.max(e._width*s,1),Math.max(e._height*s,1),0,this._glFormat,this._glPixelType,n))),e._mipmapsUploaded=0!==a);a++}else a++;if(e._needsUpload)if(e._cubemap)for(var c=0;c<6;c++)e._levelsUpdated[0][c]=!1;else e._levelsUpdated[0]=!1;!e._compressed&&e._mipmaps&&e._needsMipmapsUpload&&(e.pot||t.webgl2)&&1===e._levels.length&&(i.generateMipmap(this._glTarget),e._mipmapsUploaded=!0),e._gpuSize&&e.adjustVramSizeTracking(t._vram,-e._gpuSize),e._gpuSize=e.gpuSize,e.adjustVramSizeTracking(t._vram,e._gpuSize)}},t}(),$s=function(){function t(){this._glFrameBuffer=null,this._glDepthBuffer=null,this._glResolveFrameBuffer=null,this._glMsaaColorBuffer=null,this._glMsaaDepthBuffer=null}var e=t.prototype;return e.destroy=function(t){var e=t.gl;this._glFrameBuffer&&(e.deleteFramebuffer(this._glFrameBuffer),this._glFrameBuffer=null),this._glDepthBuffer&&(e.deleteRenderbuffer(this._glDepthBuffer),this._glDepthBuffer=null),this._glResolveFrameBuffer&&(e.deleteFramebuffer(this._glResolveFrameBuffer),this._glResolveFrameBuffer=null),this._glMsaaColorBuffer&&(e.deleteRenderbuffer(this._glMsaaColorBuffer),this._glMsaaColorBuffer=null),this._glMsaaDepthBuffer&&(e.deleteRenderbuffer(this._glMsaaDepthBuffer),this._glMsaaDepthBuffer=null)},e.init=function(t,e){var i=t.gl;this._glFrameBuffer=i.createFramebuffer(),t.setFramebuffer(this._glFrameBuffer);var n=e._colorBuffer;n&&(n.impl._glTexture||(n._width=Math.min(n.width,t.maxRenderBufferSize),n._height=Math.min(n.height,t.maxRenderBufferSize),t.setTexture(n,0)),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,n._cubemap?i.TEXTURE_CUBE_MAP_POSITIVE_X+e._face:i.TEXTURE_2D,n.impl._glTexture,0));var s=e._depthBuffer;if(s&&t.webgl2)s.impl._glTexture||(s._width=Math.min(s.width,t.maxRenderBufferSize),s._height=Math.min(s.height,t.maxRenderBufferSize),t.setTexture(s,0)),e._stencil?i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,s._cubemap?i.TEXTURE_CUBE_MAP_POSITIVE_X+e._face:i.TEXTURE_2D,e._depthBuffer.impl._glTexture,0):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,s._cubemap?i.TEXTURE_CUBE_MAP_POSITIVE_X+e._face:i.TEXTURE_2D,e._depthBuffer.impl._glTexture,0);else if(e._depth){if(!(e._samples>1&&t.webgl2)){if(this._glDepthBuffer||(this._glDepthBuffer=i.createRenderbuffer()),i.bindRenderbuffer(i.RENDERBUFFER,this._glDepthBuffer),e._stencil)i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,this._glDepthBuffer);else{var a=t.webgl2?i.DEPTH_COMPONENT32F:i.DEPTH_COMPONENT16;i.renderbufferStorage(i.RENDERBUFFER,a,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.RENDERBUFFER,this._glDepthBuffer)}i.bindRenderbuffer(i.RENDERBUFFER,null)}}t.webgl2&&e._samples>1&&(this._glResolveFrameBuffer=this._glFrameBuffer,this._glFrameBuffer=i.createFramebuffer(),t.setFramebuffer(this._glFrameBuffer),n&&(this._glMsaaColorBuffer||(this._glMsaaColorBuffer=i.createRenderbuffer()),i.bindRenderbuffer(i.RENDERBUFFER,this._glMsaaColorBuffer),i.renderbufferStorageMultisample(i.RENDERBUFFER,e._samples,n.impl._glInternalFormat,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,this._glMsaaColorBuffer)),e._depth&&(this._glMsaaDepthBuffer||(this._glMsaaDepthBuffer=i.createRenderbuffer()),i.bindRenderbuffer(i.RENDERBUFFER,this._glMsaaDepthBuffer),e._stencil?(i.renderbufferStorageMultisample(i.RENDERBUFFER,e._samples,i.DEPTH24_STENCIL8,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,this._glMsaaDepthBuffer)):(i.renderbufferStorageMultisample(i.RENDERBUFFER,e._samples,i.DEPTH_COMPONENT32F,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.RENDERBUFFER,this._glMsaaDepthBuffer))))},e._checkFbo=function(t){var e=t.gl;switch(e.checkFramebufferStatus(e.FRAMEBUFFER)){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:console.error("ERROR: FRAMEBUFFER_INCOMPLETE_ATTACHMENT");break;case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:console.error("ERROR: FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT");break;case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:console.error("ERROR: FRAMEBUFFER_INCOMPLETE_DIMENSIONS");break;case e.FRAMEBUFFER_UNSUPPORTED:console.error("ERROR: FRAMEBUFFER_UNSUPPORTED");break;case e.FRAMEBUFFER_COMPLETE:}},e.loseContext=function(){this._glFrameBuffer=null,this._glDepthBuffer=null,this._glResolveFrameBuffer=null,this._glMsaaColorBuffer=null,this._glMsaaDepthBuffer=null},e.resolve=function(t,e,i,n){if(t.webgl2){var s=t.gl;s.bindFramebuffer(s.READ_FRAMEBUFFER,this._glFrameBuffer),s.bindFramebuffer(s.DRAW_FRAMEBUFFER,this._glResolveFrameBuffer),s.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,(i?s.COLOR_BUFFER_BIT:0)|(n?s.DEPTH_BUFFER_BIT:0),s.NEAREST),s.bindFramebuffer(s.FRAMEBUFFER,this._glFrameBuffer)}},t}();function Qs(t,e){var i=!0,n=t.createTexture();t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,2,2,0,t.RGBA,e,null);var s=t.createFramebuffer();return t.bindFramebuffer(t.FRAMEBUFFER,s),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0),t.checkFramebufferStatus(t.FRAMEBUFFER)!==t.FRAMEBUFFER_COMPLETE&&(i=!1),t.bindTexture(t.TEXTURE_2D,null),t.deleteTexture(n),t.bindFramebuffer(t.FRAMEBUFFER,null),t.deleteFramebuffer(s),i}var Js,ta=function(t){function e(e,i){var n;void 0===i&&(i={}),(n=t.call(this,e)||this).gl=void 0,n.webgl2=void 0,n.defaultFramebuffer=null,n.updateClientRect(),n.contextLost=!1,n._contextLostHandler=function(t){t.preventDefault(),n.contextLost=!0,n.loseContext(),n.fire("devicelost")},n._contextRestoredHandler=function(){n.restoreContext(),n.contextLost=!1,n.fire("devicerestored")},i.stencil=!0,i.powerPreference||(i.powerPreference="high-performance");var s="undefined"!=typeof navigator&&navigator.userAgent;n.forceDisableMultisampling=s&&s.includes("AppleWebKit")&&(s.includes("15.4")||s.includes("15_4")),n.forceDisableMultisampling&&(i.antialias=!1);for(var a=void 0===i.preferWebGl2||i.preferWebGl2?["webgl2","webgl","experimental-webgl"]:["webgl","experimental-webgl"],r=null,o=0;o0;var _=n.vertexUniformsCount;return _-=16,_-=8,_-=1,_-=16,n.boneLimit=Math.floor(_/3),n.boneLimit=Math.min(n.boneLimit,128),"Mali-450 MP"===n.unmaskedRenderer&&(n.boneLimit=34),n.constantTexSource=n.scope.resolve("source"),n.textureBias=n.scope.resolve("textureBias"),n.textureBias.setValue(0),n.extTextureFloat?n.webgl2?n.textureFloatRenderable=!!n.extColorBufferFloat:n.textureFloatRenderable=Qs(r,r.FLOAT):n.textureFloatRenderable=!1,n.extColorBufferHalfFloat?n.textureHalfFloatRenderable=!!n.extColorBufferHalfFloat:n.extTextureHalfFloat?n.webgl2?n.textureHalfFloatRenderable=!!n.extColorBufferFloat:n.textureHalfFloatRenderable=Qs(r,n.extTextureHalfFloat.HALF_FLOAT_OES):n.textureHalfFloatRenderable=!1,n.supportsMorphTargetTexturesCore="highp"===n.maxPrecision&&n.maxVertexTextures>=2,n._textureFloatHighPrecision=void 0,n._textureHalfFloatUpdatable=void 0,n.grabPassAvailable=!0,n.grabPass=new Gs(Z(n),i.alpha),n.grabPass.create(),n.areaLightLutFormat=7,n.extTextureHalfFloat&&n.textureHalfFloatUpdatable&&n.extTextureHalfFloatLinear?n.areaLightLutFormat=ee:n.extTextureFloat&&n.extTextureFloatLinear&&(n.areaLightLutFormat=ne),n}Y(e,t);var i=e.prototype;return i.destroy=function(){t.prototype.destroy.call(this);var e=this.gl;this.grabPass.destroy(),this.webgl2&&this.feedback&&e.deleteTransformFeedback(this.feedback),this.clearShaderCache(),this.clearVertexArrayObjectCache(),this.canvas.removeEventListener("webglcontextlost",this._contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this._contextRestoredHandler,!1),this._contextLostHandler=null,this._contextRestoredHandler=null,this.gl=null,t.prototype.postDestroy.call(this)},i.createVertexBufferImpl=function(t,e){return new Xs},i.createIndexBufferImpl=function(t){return new qs(t)},i.createShaderImpl=function(t){return new Ys(t)},i.createTextureImpl=function(){return new Zs},i.createRenderTargetImpl=function(t){return new $s(t)},i.getPrecision=function(){var t=this.gl,e="highp";if(t.getShaderPrecisionFormat){var i=t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT),n=t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT),s=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT),a=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT),r=i.precision>0&&s.precision>0,o=n.precision>0&&a.precision>0;r||(e=o?"mediump":"lowp")}return e},i.initializeExtensions=function(){var t=this.gl,e=t.getSupportedExtensions(),i=function(){for(var i=0;i1&&e.autoResolve&&e.resolve()}},i.setUnpackFlipY=function(t){if(this.unpackFlipY!==t){this.unpackFlipY=t;var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t)}},i.setUnpackPremultiplyAlpha=function(t){if(this.unpackPremultiplyAlpha!==t){this.unpackPremultiplyAlpha=t;var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t)}},i.activeTexture=function(t){this.textureUnit!==t&&(this.gl.activeTexture(this.gl.TEXTURE0+t),this.textureUnit=t)},i.bindTexture=function(t){var e=t.impl,i=e._glTarget,n=e._glTexture,s=this.textureUnit,a=this.targetToSlot[i];this.textureUnits[s][a]!==n&&(this.gl.bindTexture(i,n),this.textureUnits[s][a]=n)},i.bindTextureOnUnit=function(t,e){var i=t.impl,n=i._glTarget,s=i._glTexture,a=this.targetToSlot[n];this.textureUnits[e][a]!==s&&(this.activeTexture(e),this.gl.bindTexture(n,s),this.textureUnits[e][a]=s)},i.setTextureParameters=function(t){var e=this.gl,i=t._parameterFlags,n=t.impl._glTarget;if(1&i){var s=t._minFilter;(!t.pot&&!this.webgl2||!t._mipmaps||t._compressed&&1===t._levels.length)&&(2===s||3===s?s=0:4!==s&&5!==s||(s=1)),e.texParameteri(n,e.TEXTURE_MIN_FILTER,this.glFilter[s])}if(2&i&&e.texParameteri(n,e.TEXTURE_MAG_FILTER,this.glFilter[t._magFilter]),4&i&&(this.webgl2?e.texParameteri(n,e.TEXTURE_WRAP_S,this.glAddress[t._addressU]):e.texParameteri(n,e.TEXTURE_WRAP_S,this.glAddress[t.pot?t._addressU:1])),8&i&&(this.webgl2?e.texParameteri(n,e.TEXTURE_WRAP_T,this.glAddress[t._addressV]):e.texParameteri(n,e.TEXTURE_WRAP_T,this.glAddress[t.pot?t._addressV:1])),16&i&&this.webgl2&&e.texParameteri(n,e.TEXTURE_WRAP_R,this.glAddress[t._addressW]),32&i&&this.webgl2&&e.texParameteri(n,e.TEXTURE_COMPARE_MODE,t._compareOnRead?e.COMPARE_REF_TO_TEXTURE:e.NONE),64&i&&this.webgl2&&e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,this.glComparison[t._compareFunc]),128&i){var a=this.extTextureFilterAnisotropic;a&&e.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.max(1,Math.min(Math.round(t._anisotropy),this.maxAnisotropy)))}},i.setTexture=function(t,e){(t.impl._glTexture||t.impl.initialize(this,t),t._parameterFlags>0||t._needsUpload||t._needsMipmapsUpload||t===this.grabPass.texture)?(this.activeTexture(e),this.bindTexture(t),t._parameterFlags&&(this.setTextureParameters(t),t._parameterFlags=0),t===this.grabPass.texture&&this.grabPass.prepareTexture()||!t._needsUpload&&!t._needsMipmapsUpload||(t.impl.upload(this,t),t._needsUpload=!1,t._needsMipmapsUpload=!1)):this.bindTextureOnUnit(t,e)},i.createVertexArray=function(t){var e,i,n=t.length>1;if(n){e="";for(var s=0;s0?u.drawElementsInstanced(b,S,T,A,e):u.drawElements(b,S,T,A)}else{var M=t.base;e>0?u.drawArraysInstanced(b,M,S,e):u.drawArrays(b,M,S)}this.webgl2&&this.transformFeedbackBuffer&&(u.endTransformFeedback(),u.bindBufferBase(u.TRANSFORM_FEEDBACK_BUFFER,0,null)),this._drawCallsPerFrame++}},i.clear=function(t){var e=this.defaultClearOptions,i=null==(t=t||e).flags?e.flags:t.flags;if(0!==i){var n=this.gl;if(1&i){var s=null==t.color?e.color:t.color;this.setClearColor(s[0],s[1],s[2],s[3])}if(2&i){var a=null==t.depth?e.depth:t.depth;this.setClearDepth(a),this.depthWrite||n.depthMask(!0)}if(4&i){var r=null==t.stencil?e.stencil:t.stencil;this.setClearStencil(r)}n.clear(this.glClearFlag[i]),2&i&&(this.depthWrite||n.depthMask(!1))}},i.readPixels=function(t,e,i,n,s){var a=this.gl;a.readPixels(t,e,i,n,a.RGBA,a.UNSIGNED_BYTE,s)},i.setClearDepth=function(t){t!==this.clearDepth&&(this.gl.clearDepth(t),this.clearDepth=t)},i.setClearColor=function(t,e,i,n){var s=this.clearColor;t===s.r&&e===s.g&&i===s.b&&n===s.a||(this.gl.clearColor(t,e,i,n),this.clearColor.set(t,e,i,n))},i.setClearStencil=function(t){t!==this.clearStencil&&(this.gl.clearStencil(t),this.clearStencil=t)},i.getDepthTest=function(){return this.depthTest},i.setDepthTest=function(t){if(this.depthTest!==t){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.depthTest=t}},i.setDepthFunc=function(t){this.depthFunc!==t&&(this.gl.depthFunc(this.glComparison[t]),this.depthFunc=t)},i.getDepthWrite=function(){return this.depthWrite},i.setDepthWrite=function(t){this.depthWrite!==t&&(this.gl.depthMask(t),this.depthWrite=t)},i.setColorWrite=function(t,e,i,n){this.writeRed===t&&this.writeGreen===e&&this.writeBlue===i&&this.writeAlpha===n||(this.gl.colorMask(t,e,i,n),this.writeRed=t,this.writeGreen=e,this.writeBlue=i,this.writeAlpha=n)},i.setAlphaToCoverage=function(t){this.webgl2&&this.alphaToCoverage!==t&&(this.alphaToCoverage=t,t?this.gl.enable(this.gl.SAMPLE_ALPHA_TO_COVERAGE):this.gl.disable(this.gl.SAMPLE_ALPHA_TO_COVERAGE))},i.setTransformFeedbackBuffer=function(t){if(this.transformFeedbackBuffer!==t&&(this.transformFeedbackBuffer=t,this.webgl2)){var e=this.gl;t?(this.feedback||(this.feedback=e.createTransformFeedback()),e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,this.feedback)):e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null)}},i.setRaster=function(t){this.raster!==t&&(this.raster=t,this.webgl2&&(t?this.gl.disable(this.gl.RASTERIZER_DISCARD):this.gl.enable(this.gl.RASTERIZER_DISCARD)))},i.setDepthBias=function(t){this.depthBiasEnabled!==t&&(this.depthBiasEnabled=t,t?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL))},i.setDepthBiasValues=function(t,e){this.gl.polygonOffset(e,t)},i.getBlending=function(){return this.blending},i.setBlending=function(t){if(this.blending!==t){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.blending=t}},i.setStencilTest=function(t){if(this.stencil!==t){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.stencil=t}},i.setStencilFunc=function(t,e,i){this.stencilFuncFront===t&&this.stencilRefFront===e&&this.stencilMaskFront===i&&this.stencilFuncBack===t&&this.stencilRefBack===e&&this.stencilMaskBack===i||(this.gl.stencilFunc(this.glComparison[t],e,i),this.stencilFuncFront=this.stencilFuncBack=t,this.stencilRefFront=this.stencilRefBack=e,this.stencilMaskFront=this.stencilMaskBack=i)},i.setStencilFuncFront=function(t,e,i){if(this.stencilFuncFront!==t||this.stencilRefFront!==e||this.stencilMaskFront!==i){var n=this.gl;n.stencilFuncSeparate(n.FRONT,this.glComparison[t],e,i),this.stencilFuncFront=t,this.stencilRefFront=e,this.stencilMaskFront=i}},i.setStencilFuncBack=function(t,e,i){if(this.stencilFuncBack!==t||this.stencilRefBack!==e||this.stencilMaskBack!==i){var n=this.gl;n.stencilFuncSeparate(n.BACK,this.glComparison[t],e,i),this.stencilFuncBack=t,this.stencilRefBack=e,this.stencilMaskBack=i}},i.setStencilOperation=function(t,e,i,n){this.stencilFailFront===t&&this.stencilZfailFront===e&&this.stencilZpassFront===i&&this.stencilFailBack===t&&this.stencilZfailBack===e&&this.stencilZpassBack===i||(this.gl.stencilOp(this.glStencilOp[t],this.glStencilOp[e],this.glStencilOp[i]),this.stencilFailFront=this.stencilFailBack=t,this.stencilZfailFront=this.stencilZfailBack=e,this.stencilZpassFront=this.stencilZpassBack=i),this.stencilWriteMaskFront===n&&this.stencilWriteMaskBack===n||(this.gl.stencilMask(n),this.stencilWriteMaskFront=n,this.stencilWriteMaskBack=n)},i.setStencilOperationFront=function(t,e,i,n){this.stencilFailFront===t&&this.stencilZfailFront===e&&this.stencilZpassFront===i||(this.gl.stencilOpSeparate(this.gl.FRONT,this.glStencilOp[t],this.glStencilOp[e],this.glStencilOp[i]),this.stencilFailFront=t,this.stencilZfailFront=e,this.stencilZpassFront=i),this.stencilWriteMaskFront!==n&&(this.gl.stencilMaskSeparate(this.gl.FRONT,n),this.stencilWriteMaskFront=n)},i.setStencilOperationBack=function(t,e,i,n){this.stencilFailBack===t&&this.stencilZfailBack===e&&this.stencilZpassBack===i||(this.gl.stencilOpSeparate(this.gl.BACK,this.glStencilOp[t],this.glStencilOp[e],this.glStencilOp[i]),this.stencilFailBack=t,this.stencilZfailBack=e,this.stencilZpassBack=i),this.stencilWriteMaskBack!==n&&(this.gl.stencilMaskSeparate(this.gl.BACK,n),this.stencilWriteMaskBack=n)},i.setBlendFunction=function(t,e){(this.blendSrc!==t||this.blendDst!==e||this.separateAlphaBlend)&&(this.gl.blendFunc(this.glBlendFunction[t],this.glBlendFunction[e]),this.blendSrc=t,this.blendDst=e,this.separateAlphaBlend=!1)},i.setBlendFunctionSeparate=function(t,e,i,n){this.blendSrc===t&&this.blendDst===e&&this.blendSrcAlpha===i&&this.blendDstAlpha===n&&this.separateAlphaBlend||(this.gl.blendFuncSeparate(this.glBlendFunction[t],this.glBlendFunction[e],this.glBlendFunction[i],this.glBlendFunction[n]),this.blendSrc=t,this.blendDst=e,this.blendSrcAlpha=i,this.blendDstAlpha=n,this.separateAlphaBlend=!0)},i.setBlendEquation=function(t){(this.blendEquation!==t||this.separateAlphaEquation)&&(this.gl.blendEquation(this.glBlendEquation[t]),this.blendEquation=t,this.separateAlphaEquation=!1)},i.setBlendEquationSeparate=function(t,e){this.blendEquation===t&&this.blendAlphaEquation===e&&this.separateAlphaEquation||(this.gl.blendEquationSeparate(this.glBlendEquation[t],this.glBlendEquation[e]),this.blendEquation=t,this.blendAlphaEquation=e,this.separateAlphaEquation=!0)},i.setBlendColor=function(t,e,i,n){var s=this.blendColor;t===s.r&&e===s.g&&i===s.b&&n===s.a||(this.gl.blendColor(t,e,i,n),s.set(t,e,i,n))},i.setCullMode=function(t){if(this.cullMode!==t){if(0===t)this.gl.disable(this.gl.CULL_FACE);else{0===this.cullMode&&this.gl.enable(this.gl.CULL_FACE);var e=this.glCull[t];this.cullFace!==e&&(this.gl.cullFace(e),this.cullFace=e)}this.cullMode=t}},i.getCullMode=function(){return this.cullMode},i.setIndexBuffer=function(t){this.indexBuffer=t},i.setVertexBuffer=function(t){t&&this.vertexBuffers.push(t)},i.setShader=function(t){if(t!==this.shader){if(t.failed)return!1;if(!t.ready&&!t.impl.postLink(this,t))return t.failed=!0,!1;this.shader=t,this.gl.useProgram(t.impl.glProgram),this.attributesInvalidated=!0}return!0},i.getHdrFormat=function(){return this.textureHalfFloatRenderable?ee:this.textureFloatRenderable?ne:7},i.getBoneLimit=function(){return this.boneLimit},i.setBoneLimit=function(t){this.boneLimit=t},i.clearShaderCache=function(){var t=this.gl;for(var e in this.fragmentShaderCache)t.deleteShader(this.fragmentShaderCache[e]),delete this.fragmentShaderCache[e];for(var i in this.vertexShaderCache)t.deleteShader(this.vertexShaderCache[i]),delete this.vertexShaderCache[i];this.programLib.clearCache()},i.clearVertexArrayObjectCache=function(){var t=this.gl;this._vaoMap.forEach((function(e,i,n){t.deleteVertexArray(e)})),this._vaoMap.clear()},i.removeShaderFromCache=function(t){this.programLib.removeFromCache(t)},q(e,[{key:"width",get:function(){return this.gl.drawingBufferWidth||this.canvas.width}},{key:"height",get:function(){return this.gl.drawingBufferHeight||this.canvas.height}},{key:"fullscreen",get:function(){return!!document.fullscreenElement},set:function(t){t?this.gl.canvas.requestFullscreen():document.exitFullscreen()}},{key:"textureFloatHighPrecision",get:function(){return void 0===this._textureFloatHighPrecision&&(this._textureFloatHighPrecision=function(t){if(!t.textureFloatRenderable)return!1;var e=Si(t,ci.fullscreenQuadVS,ci.precisionTestPS,"ptest1"),i=Si(t,ci.fullscreenQuadVS,ci.precisionTest2PS,"ptest2"),n={format:ne,width:1,height:1,mipmaps:!1,minFilter:0,magFilter:0},s=new Bi(t,n);s.name="testFHP";var a=new xs({colorBuffer:s,depth:!1});hi(t,a,e),n.format=7;var r=new Bi(t,n);r.name="testFHP";var o=new xs({colorBuffer:r,depth:!1});t.constantTexSource.setValue(s),hi(t,o,i);var h=t.activeFramebuffer;t.setFramebuffer(o.impl._glFrameBuffer);var l=new Uint8Array(4);t.readPixels(0,0,1,1,l),t.setFramebuffer(h);var c=l[0]/255/16777216+l[1]/255/65536+l[2]/255/256+l[3]/255;return s.destroy(),a.destroy(),r.destroy(),o.destroy(),0===c}(this)),this._textureFloatHighPrecision}},{key:"textureHalfFloatUpdatable",get:function(){return void 0===this._textureHalfFloatUpdatable&&(this.webgl2?this._textureHalfFloatUpdatable=!0:this._textureHalfFloatUpdatable=function(t,e){var i=!0,n=t.createTexture();t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE);var s=new Uint16Array(16);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,2,2,0,t.RGBA,e,s),t.getError()!==t.NO_ERROR&&(i=!1,console.log("Above error related to HALF_FLOAT_OES can be ignored, it was triggered by testing half float texture support")),t.bindTexture(t.TEXTURE_2D,null),t.deleteTexture(n),i}(this.gl,this.extTextureHalfFloat.HALF_FLOAT_OES)),this._textureHalfFloatUpdatable}}]),e}(vs),ea=function(){function t(){this._refCount=0}var e=t.prototype;return e.incRefCount=function(){this._refCount++},e.decRefCount=function(){this._refCount--},q(t,[{key:"refCount",get:function(){return this._refCount}}]),t}();function ia(){return Js}function na(t){Js=t}var sa=0,aa=function(){function t(){this.initDefaults()}var e=t.prototype;return e.initDefaults=function(){this.recreate=!1,this.verticesUsage=0,this.indicesUsage=0,this.maxVertices=0,this.maxIndices=0,this.vertexCount=0,this.indexCount=0,this.vertexStreamsUpdated=!1,this.indexStreamUpdated=!1,this.vertexStreamDictionary={},this.indices=null},e._changeVertexCount=function(t,e){this.vertexCount||(this.vertexCount=t)},t}();aa.DEFAULT_COMPONENTS_POSITION=3,aa.DEFAULT_COMPONENTS_NORMAL=3,aa.DEFAULT_COMPONENTS_UV=2,aa.DEFAULT_COMPONENTS_COLORS=4;var ra=function(t,e,i,n){this.data=t,this.componentCount=e,this.dataType=i,this.dataTypeNormalize=n},oa=function(t){function e(e){var i;return(i=t.call(this)||this).id=sa++,i.device=e||ia().graphicsDevice,i.vertexBuffer=null,i.indexBuffer=[null],i.primitive=[{type:0,base:0,count:0}],i.skin=null,i._morph=null,i._geometryData=null,i._aabb=new Pt,i.boneAabb=null,i}Y(e,t);var i=e.prototype;return i.destroy=function(){var t=this.morph;t&&(this.morph=null,t.refCount<1&&t.destroy()),this.vertexBuffer&&(this.vertexBuffer.destroy(),this.vertexBuffer=null);for(var e=0;e0){var b=g.array[g.index+x];if(u[b]=!0,e=m.array[m.index],i=m.array[m.index+1],n=m.array[m.index+2],s=c[b],(a=l[b]).x>e&&(a.x=e),a.y>i&&(a.y=i),a.z>n&&(a.z=n),s.xS&&(a.x=S),a.y>w&&(a.y=w),a.z>T&&(a.z=T),s.x0&&this.indexBuffer[0]&&(this._geometryData.indexCount=this.indexBuffer[0].numIndices,this._geometryData.maxIndices=this.indexBuffer[0].numIndices))},i.clear=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this._initGeometryData(),this._geometryData.initDefaults(),this._geometryData.recreate=!0,this._geometryData.maxVertices=i,this._geometryData.maxIndices=n,this._geometryData.verticesUsage=t?0:1,this._geometryData.indicesUsage=e?0:1},i.setVertexStream=function(t,e,i,n,s,a){void 0===s&&(s=6),void 0===a&&(a=!1),this._initGeometryData();var r=n||e.length/i;this._geometryData._changeVertexCount(r,t),this._geometryData.vertexStreamsUpdated=!0,this._geometryData.vertexStreamDictionary[t]=new ra(e,i,s,a)},i.getVertexStream=function(t,e){var i=0,n=!1;if(this._geometryData){var s=this._geometryData.vertexStreamDictionary[t];s&&(n=!0,i=this._geometryData.vertexCount,ArrayBuffer.isView(e)?e.set(s.data):(e.length=0,e.push(s.data)))}n||this.vertexBuffer&&(i=new Bs(this.vertexBuffer).readData(t,e));return i},i.setPositions=function(t,e,i){void 0===e&&(e=aa.DEFAULT_COMPONENTS_POSITION),this.setVertexStream(le,t,e,i,6,!1)},i.setNormals=function(t,e,i){void 0===e&&(e=aa.DEFAULT_COMPONENTS_NORMAL),this.setVertexStream(ce,t,e,i,6,!1)},i.setUvs=function(t,e,i,n){void 0===i&&(i=aa.DEFAULT_COMPONENTS_UV),this.setVertexStream(me+t,e,i,n,6,!1)},i.setColors=function(t,e,i){void 0===e&&(e=aa.DEFAULT_COMPONENTS_COLORS),this.setVertexStream(pe,t,e,i,6,!1)},i.setColors32=function(t,e){this.setVertexStream(pe,t,aa.DEFAULT_COMPONENTS_COLORS,e,1,!0)},i.setIndices=function(t,e){this._initGeometryData(),this._geometryData.indexStreamUpdated=!0,this._geometryData.indices=t,this._geometryData.indexCount=e||t.length},i.getPositions=function(t){return this.getVertexStream(le,t)},i.getNormals=function(t){return this.getVertexStream(ce,t)},i.getUvs=function(t,e){return this.getVertexStream(me+t,e)},i.getColors=function(t){return this.getVertexStream(pe,t)},i.getIndices=function(t){var e=0;if(this._geometryData&&this._geometryData.indices){var i=this._geometryData.indices;e=this._geometryData.indexCount,ArrayBuffer.isView(t)?t.set(i):(t.length=0,t.push(i))}else{if(this.indexBuffer.length>0&&this.indexBuffer[0])e=this.indexBuffer[0].readData(t)}return e},i.update=function(t,e){if(void 0===t&&(t=4),void 0===e&&(e=!0),this._geometryData){if(e){var i=this._geometryData.vertexStreamDictionary.POSITION;i&&3===i.componentCount&&this._aabb.compute(i.data,this._geometryData.vertexCount)}var n=this._geometryData.recreate;this._geometryData.vertexCount>this._geometryData.maxVertices&&(n=!0,this._geometryData.maxVertices=this._geometryData.vertexCount),n&&this.vertexBuffer&&(this.vertexBuffer.destroy(),this.vertexBuffer=null);var s=this._geometryData.recreate;this._geometryData.indexCount>this._geometryData.maxIndices&&(s=!0,this._geometryData.maxIndices=this._geometryData.indexCount),s&&this.indexBuffer.length>0&&this.indexBuffer[0]&&(this.indexBuffer[0].destroy(),this.indexBuffer[0]=null),this._geometryData.vertexStreamsUpdated&&this._updateVertexBuffer(),this._geometryData.indexStreamUpdated&&this._updateIndexBuffer(),this.primitive[0].type=t,this.indexBuffer.length>0&&this.indexBuffer[0]?this._geometryData.indexStreamUpdated&&(this.primitive[0].count=this._geometryData.indexCount,this.primitive[0].indexed=!0):this._geometryData.vertexStreamsUpdated&&(this.primitive[0].count=this._geometryData.vertexCount,this.primitive[0].indexed=!1),this._geometryData.vertexCount=0,this._geometryData.indexCount=0,this._geometryData.vertexStreamsUpdated=!1,this._geometryData.indexStreamUpdated=!1,this._geometryData.recreate=!1,this.updateRenderStates()}},i._buildVertexFormat=function(t){var e=[];for(var i in this._geometryData.vertexStreamDictionary){var n=this._geometryData.vertexStreamDictionary[i];e.push({semantic:i,components:n.componentCount,type:n.dataType,normalize:n.dataTypeNormalize})}return new si(this.device,e,t)},i._updateVertexBuffer=function(){if(!this.vertexBuffer){var t=this._geometryData.maxVertices,e=this._buildVertexFormat(t);this.vertexBuffer=new ii(this.device,e,t,this._geometryData.verticesUsage)}var i=new Bs(this.vertexBuffer),n=this._geometryData.vertexCount;for(var s in this._geometryData.vertexStreamDictionary){var a=this._geometryData.vertexStreamDictionary[s];i.writeData(s,a.data,n),delete this._geometryData.vertexStreamDictionary[s]}i.end()},i._updateIndexBuffer=function(){if(this.indexBuffer.length<=0||!this.indexBuffer[0]){var t=this._geometryData.maxVertices>65535?2:1;this.indexBuffer[0]=new ws(this.device,t,this._geometryData.maxIndices,this._geometryData.indicesUsage)}var e=this._geometryData.indices;e&&(this.indexBuffer[0].writeData(e,this._geometryData.indexCount),this._geometryData.indices=null)},i.prepareRenderState=function(t){1===t?this.generateWireframe():2===t&&(this.primitive[2]={type:0,base:0,count:this.vertexBuffer?this.vertexBuffer.numVertices:0,indexed:!1})},i.updateRenderStates=function(){this.primitive[2]&&this.prepareRenderState(2),this.primitive[1]&&this.prepareRenderState(1)},i.generateWireframe=function(){this._destroyIndexBuffer(1);var t,e=[];if(this.indexBuffer.length>0&&this.indexBuffer[0]){for(var i=[[0,1],[1,2],[2,0]],n=this.primitive[0].base,s=this.primitive[0].count,a=this.indexBuffer[0],r=new Qe[a.format](a.storage),o={},h=n;hu?u<<16|c:c<<16|u;void 0===o[d]&&(o[d]=0,e.push(c,u))}t=a.format}else{for(var f=0;f65535?2:1}var p=new ws(this.vertexBuffer.device,t,e.length);new Qe[p.format](p.storage).set(e),p.unlock(),this.primitive[1]={type:1,base:0,count:e.length,indexed:!0},this.indexBuffer[1]=p},q(e,[{key:"morph",get:function(){return this._morph},set:function(t){t!==this._morph&&(this._morph&&this._morph.decRefCount(),this._morph=t,t&&t.incRefCount())}},{key:"aabb",get:function(){return this._aabb},set:function(t){this._aabb=t}}]),e}(ea),ha=4/64,la=.875,ca=[];function ua(t,e){for(var i=e.length/3,n=t.length/3,s=new ft,a=new ft,r=new ft,o=new ft,h=new ft,l=new ft,c=[],u=0;u0)for(var v=0;v<=n;v++)for(var y=0;y<=s;y++){var x=y/s*2*Math.PI-Math.PI,b=Math.sin(x),S=Math.cos(x);u.set(b*t,-i/2,S*t),c.set(b*e,i/2,S*e),o.lerp(u,c,v/n),h.sub2(c,u).normalize(),d.set(S,0,-b),l.cross(d,h).normalize(),f.push(o.x,o.y,o.z),p.push(l.x,l.y,l.z);var w=y/s,T=v/n;m.push(w,1-T);var A=T;if(T=w,w=(w=A)*la+ha,T=T*la+ha,w/=3,_.push(w,1-T),v0)for(var ut=0;ut1&&g.push(r,r+ut,r+ut-1)}if(r+=s,e>0)for(var yt=0;yt1&&g.push(r,r+yt-1,r+yt)}}return{positions:f,normals:p,uvs:m,uvs1:_,indices:g}}function _a(t,e){var i=e&&(e.radius||e.baseRadius);i=void 0!==i?i:.5;var n=e&&void 0!==e.height?e.height:1,s=e&&void 0!==e.heightSegments?e.heightSegments:5,a=e&&void 0!==e.capSegments?e.capSegments:20,r=!(!e||void 0===e.calculateTangents)&&e.calculateTangents,o=ma(i,i,n,s,a,!1);return r&&(o.tangents=da(o.positions,o.normals,o.uvs,o.indices)),fa(t,o.positions,o)}function ga(t,e){var i=e&&void 0!==e.radius?e.radius:.3,n=e&&void 0!==e.height?e.height:1,s=e&&void 0!==e.heightSegments?e.heightSegments:1,a=e&&void 0!==e.sides?e.sides:20,r=!(!e||void 0===e.calculateTangents)&&e.calculateTangents,o=ma(i,i,n-2*i,s,a,!0);return r&&(o.tangents=da(o.positions,o.normals,o.uvs,o.indices)),fa(t,o.positions,o)}function va(t,e){var i=e&&void 0!==e.baseRadius?e.baseRadius:.5,n=e&&void 0!==e.peakRadius?e.peakRadius:0,s=e&&void 0!==e.height?e.height:1,a=e&&void 0!==e.heightSegments?e.heightSegments:5,r=e&&void 0!==e.capSegments?e.capSegments:18,o=!(!e||void 0===e.calculateTangents)&&e.calculateTangents,h=ma(i,n,s,a,r,!1);return o&&(h.tangents=da(h.positions,h.normals,h.uvs,h.indices)),fa(t,h.positions,h)}function ya(t,e){for(var i=e&&void 0!==e.radius?e.radius:.5,n=e&&void 0!==e.latitudeBands?e.latitudeBands:16,s=e&&void 0!==e.longitudeBands?e.longitudeBands:16,a=!(!e||void 0===e.calculateTangents)&&e.calculateTangents,r=[],o=[],h=[],l=[],c=0;c<=n;c++)for(var u=c*Math.PI/n,d=Math.sin(u),f=Math.cos(u),p=0;p<=s;p++){var m=2*p*Math.PI/s-Math.PI/2,_=Math.sin(m),g=Math.cos(m)*d,v=f,y=_*d,x=1-p/s,b=1-c/n;r.push(g*i,v*i,y*i),o.push(g,v,y),h.push(x,1-b)}for(var S=0;S=0;i--)this.matrices[i].mulAffine2(Ma,this.bones[i].getWorldTransform()),this.matrices[i].mulAffine2(this.matrices[i],this.skin.inverseBindPose[i])}},e.updateMatrices=function(t,e){this._updateBeforeCull&&this._updateMatrices(t,e)},e.updateMatrixPalette=function(t,e){this._updateMatrices(t,e);for(var i=this.matrixPalette,n=this.bones.length,s=0;s>16},set:function(t){var e=65535&this._shaderDefs;this._shaderDefs=e|t<<16,this._shader[0]=null,this._shader[1]=null}},{key:"instancingCount",get:function(){return this.instancingData?this.instancingData.count:0},set:function(t){this.instancingData&&(this.instancingData.count=t)}}]),t}();function Na(t,e,i,n){return(15&t)<<27|(3===e?1:0)<<26|(i?1:0)<<25|(33554431&n)<<0}function Ua(t,e){if(t&&!e)return!1;if(!t&&e)return!1;if((t=t.data)===(e=e.data))return!0;if(t instanceof Float32Array&&e instanceof Float32Array){if(t.length!==e.length)return!1;for(var i=0;i=0?1:-1}var ja=function(){function t(t,e,i){this.device=t,this.rootNode=e,this.scene=i,this._init=!1,this._batchGroups={},this._batchGroupCounter=0,this._batchList=[],this._dirtyGroups=[]}var e=t.prototype;return e.destroy=function(){this.device=null,this.rootNode=null,this.scene=null,this._batchGroups={},this._batchList=[],this._dirtyGroups=[]},e.addGroup=function(t,e,i,n,s){if(void 0===n&&(n=this._batchGroupCounter,this._batchGroupCounter++),!this._batchGroups[n]){var a=new Aa(n,t,e,i,s);return this._batchGroups[n]=a,a}},e.removeGroup=function(t){if(this._batchGroups[t]){for(var e=[],i=0;i=0&&(n._obj[t].splice(s,1),this.markGroupDirty(e))}},e._extractRender=function(t,e,i,n){if(t.render){if(t.render.isStatic){for(var s=this.scene.drawCalls,a=t.render.meshInstances,r=0;r=0&&e.push(a[o])}else e=n[t.render.batchGroupId]=e.concat(t.render.meshInstances);t.render.removeFromLayers()}return e},e._extractModel=function(t,e,i,n){if(t.model&&t.model.model){if(t.model.isStatic){for(var s=this.scene.drawCalls,a=t.model.meshInstances,r=0;r=0&&e.push(a[o])}else e=n[t.model.batchGroupId]=e.concat(t.model.meshInstances);t.model.removeModelFromLayers()}return e},e._extractElement=function(t,e,i){if(t.element){var n=!1;t.element._text&&t.element._text._model.meshInstances.length>0?(e.push(t.element._text._model.meshInstances[0]),t.element.removeModelFromLayers(t.element._text._model),n=!0):t.element._image&&(e.push(t.element._image._renderable.meshInstance),t.element.removeModelFromLayers(t.element._image._renderable.model),t.element._image._renderable.unmaskMeshInstance&&(e.push(t.element._image._renderable.unmaskMeshInstance),t.element._image._renderable.unmaskMeshInstance.stencilFront&&t.element._image._renderable.unmaskMeshInstance.stencilBack||(t.element._dirtifyMask(),t.element._onPrerender())),n=!0),n&&(i._ui=!0)}},e._collectAndRemoveMeshInstances=function(t,e){for(var i=0;i0;){u[d]=[p[0]],f=[];var _=p[0].material,g=p[0].layer,v=p[0]._shaderDefs,y=p[0].parameters,x=p[0].stencilFront,b=p[0]._staticLightList,S=p[0].mesh.vertexBuffer.getNumVertices(),w=p[0].drawOrder;h.copy(p[0].aabb);var T=qa(p[0]),A=p[0].mesh.vertexBuffer.format.batchingHash,M=p[0].mesh.primitive[0].indexed;c=null;for(var C=1;C=r){f=f.concat(p.slice(C));break}if(_!==E.material||g!==E.layer||A!==E.mesh.vertexBuffer.format.batchingHash||M!==E.mesh.primitive[0].indexed||v!==E._shaderDefs||S+E.mesh.vertexBuffer.getNumVertices()>o)m(E);else if(l.copy(h),l.add(E.aabb),l.halfExtents.x>a||l.halfExtents.y>a||l.halfExtents.z>a)m(E);else if(!x||(s=E.stencilFront)&&x.func===s.func&&x.zpass===s.zpass)if(T===qa(E))if(za(y,E.parameters)){var P=E._staticLightList;if(b&&P){if(!Va(b,P)){m(E);continue}}else if(b||P){m(E);continue}n&&c&&c.intersects(E.aabb)&&E.drawOrder!==w?m(E):(h.add(E.aabb),S+=E.mesh.vertexBuffer.getNumVertices(),u[d].push(E))}else m(E);else m(E);else m(E)}d++,p=f}return u},e.collectBatchedMeshData=function(t,e){for(var i=null,n=0,s=0,a=null,r=0;r=3)if(s===le)for(var A=0;A0&&a.setIndices(b),a.update(4,!1),e&&((p=p.clone()).chunks.transformVS=this.transformVS,p.chunks.skinTexVS=this.skinTexVS,p.chunks.skinConstVS=this.skinConstVS,p.update());var R=new Ba(a,p,this.rootNode);R.castShadow=h.origMeshInstances[0].castShadow,R.parameters=h.origMeshInstances[0].parameters,R.isStatic=h.origMeshInstances[0].isStatic,R.layer=h.origMeshInstances[0].layer,R._staticLightList=h.origMeshInstances[0]._staticLightList,R._shaderDefs=h.origMeshInstances[0]._shaderDefs,R.cull=h.origMeshInstances[0].cull;var I=this._batchGroups[i];if(I&&I._ui&&(R.cull=!1),e){for(var L=[],D=0;D0&&this.generate(this._dirtyGroups);for(var t=0;t0&&r){if(!(n1){e.copy(t[1].min),i.copy(t[1].max);for(var n=2;n1?this.shaderCube:this.shader2d,a=this.device;n>1&&this.initInvViewProjMatrices(),this.blitTextureId.setValue(e.cookie);for(var r=0;r1){var o=er.z/3,h=this.lightTextureAtlas.cubeSlotsOffsets[r];er.x+=o*h.x,er.y+=o*h.y,er.z=o,er.w=o,this.invViewProjId.setValue(t._invViewProjMatrices[r].data)}er.mulScalar(i.colorBuffer.width),hi(a,i,s,er)}}},q(t,[{key:"shader2d",get:function(){return this.getShader("blitShader2d","\n\t\tvarying vec2 uv0;\n\t\tuniform sampler2D blitTexture;\n\t\tvoid main(void) {\n\t\t\t\tgl_FragColor = texture2D(blitTexture, uv0);\n\t\t}")}},{key:"shaderCube",get:function(){return this.getShader("blitShaderCube","\n\t\tvarying vec2 uv0;\n\t\tuniform samplerCube blitTexture;\n\t\tuniform mat4 invViewProj;\n\t\tvoid main(void) {\n\t\t\t\tvec4 projPos = vec4(uv0 * 2.0 - 1.0, 0.5, 1.0);\n\t\t\t\tvec4 worldPos = invViewProj * projPos;\n\t\t\t\tgl_FragColor = textureCube(blitTexture, worldPos.xyz);\n\t\t}")}}]),t}();ir._invViewProjMatrices=null;var nr=function(){function t(t,e){this.texture=t,this.cached=!1,this.renderTargets=e}return t.prototype.destroy=function(){this.texture&&(this.texture.destroy(),this.texture=null);for(var t=this.renderTargets,e=0;e1)for(var h=1/o,l=0;l1)for(var f=0;f0){for(var s=this.slots,a=0;as&&(s=r)}return dr.min=n,dr.max=s,dr}function pr(t,e){return Math.exp(-t*t/(2*e*e))}var mr=new Pt,_r=new St,gr=new St,vr=new Float32Array(2),yr=new _t(1,1,0,0),xr={r:1,g:2,b:3,a:4},br=new ft,Sr=new St;function wr(t){var e=t.material,i=t.skinInstance?10:0,n=0;if(e.opacityMap){var s=e.opacityMapChannel;s&&(n=xr[s])}return i+n}var Tr=function(){function t(t,e){this.device=t.device,this.forwardRenderer=t,this.lightTextureAtlas=e;var i=this.device.scope;this.polygonOffsetId=i.resolve("polygonOffset"),this.polygonOffset=new Float32Array(2),this.sourceId=i.resolve("source"),this.pixelOffsetId=i.resolve("pixelOffset"),this.weightId=i.resolve("weight[0]"),this.blurVsmShaderCode=[ci.blurVSMPS,"#define GAUSS\n"+ci.blurVSMPS];var n="#define PACKED\n";this.blurPackedVsmShaderCode=[n+this.blurVsmShaderCode[0],n+this.blurVsmShaderCode[1]],this.blurVsmShader=[{},{}],this.blurPackedVsmShader=[{},{}],this.blurVsmWeights={},this.shadowMapLightRadiusId=i.resolve("light_radius"),this.shadowMapCache=new cr}var e=t.prototype;return e.destroy=function(){this.shadowMapCache.destroy(),this.shadowMapCache=null},t.createShadowCamera=function(t,e,i,n){var s=ln.create("ShadowCamera",i,n);return s.clearColor=e>=1&&e<=3?new lt(0,0,0,0):new lt(1,1,1,1),s.clearDepthBuffer=!0,s.clearStencilBuffer=!1,s},t.setShadowCameraSettings=function(t,e,i,n,s){var a=4===i||0===i&&e.webgl2;1!==n||s||(a=!1),t.clearColorBuffer=!a},e.cullShadowCasters=function(t,e,i){for(var n=0,s=t.length,a=0;ap&&(p=_)}var g=o.right,v=o.up,y=o.forward,x=.25*t._shadowResolution/p,b=Math.ceil(br.dot(v)*x)/x,S=Math.ceil(br.dot(g)*x)/x,w=v.mulScalar(b),T=g.mulScalar(S),A=br.dot(y),M=y.mulScalar(A);br.add2(w,T).add(M),o.setPosition(br),o.translateLocal(0,0,1e6),r.nearClip=0,r.farClip=2e6,r.orthoHeight=p,this.forwardRenderer.updateCameraFrustum(r),this.cullShadowCasters(e,a.visibleCasters,r);for(var C=!0,E=a.visibleCasters,P=0;P1)this.forwardRenderer.scene.clusteredLightingEnabled&&0!==s||this.applyVsmBlur(e,i);this.restoreRenderState(n)}},e.getVsmBlurShader=function(t,e,i){var n=(t?this.blurPackedVsmShader:this.blurVsmShader)[e][i];if(!n){this.blurVsmWeights[i]=function(t){t>25&&(t=25);for(var e=(t-1)/6,i=.5*(t-1),n=new Array(t),s=0,a=0;aU&&(U=H),X>z&&(z=X),q>V&&(V=q)}var j=6*O;p[j]=F,p[j+1]=B,p[j+2]=N,p[j+3]=U,p[j+4]=z,p[j+5]=V}for(var Y=0;Y=Z.x&&p[tt+1]<=$.y&&p[tt+4]>=Z.y&&p[tt+2]<=$.z&&p[tt+5]>=Z.z&&(d[J]|=Q,k=!0)}}if(k){for(var et={},it=0;itdt&&(dt=vt),yt>pt&&(pt=yt),xt>mt&&(mt=xt)}h.set(lt,ct,ut),l.set(dt,pt,mt);var bt=new Pt;bt.setMinMax(h,l);var wt=new oa(e);wt.vertexBuffer=w,wt.indexBuffer[0]=ht,wt.primitive[0].type=4,wt.primitive[0].base=0,wt.primitive[0].count=ot.length,wt.primitive[0].indexed=!0,wt.aabb=bt;var Tt=new Ba(wt,g.material,g.node);Tt.isStatic=g.isStatic,Tt.visible=g.visible,Tt.layer=g.layer,Tt.castShadow=g.castShadow,Tt._receiveShadow=g._receiveShadow,Tt.cull=g.cull,Tt.pick=g.pick,Tt.mask=g.mask,Tt.parameters=g.parameters,Tt._shaderDefs=g._shaderDefs,Tt._staticSource=g,g._staticLightList?Tt._staticLightList=g._staticLightList:Tt._staticLightList=[];for(var At=0;At0&&(this._instancedDrawCalls++,t.setVertexBuffer(Ir.vertexBuffer),t.draw(i.primitive[n],Ir.count)):(Lr=e.node.worldTransform,this.modelMatrixId.setValue(Lr.data),s&&(Dr=e.node.normalMatrix,e.node._dirtyNormal&&(Lr.invertTo3x3(Dr),Dr.transpose(),e.node._dirtyNormal=!1),this.normalMatrixId.setValue(Dr.data)),t.draw(i.primitive[n]))},e.drawInstance2=function(t,e,i,n){(Ir=e.instancingData)?Ir.count>0&&(this._instancedDrawCalls++,t.draw(i.primitive[n],Ir.count,!0)):t.draw(i.primitive[n],void 0,!0)},e.renderShadows=function(t,e){var i=this.scene.clusteredLightingEnabled,n=this.device;n.grabPassAvailable=!1;for(var s=0;s0&&n.cull<3){i.flipFaces&&(a*=-1),e&&(a*=-1);var r=i.node.worldTransform;r.getX(no),r.getY(so),r.getZ(ao),no.cross(no,so),no.dot(ao)<0&&(a*=-1)}s=a<0?2===n.cull?1:2:n.cull}if(this.device.setCullMode(s),0===s&&0===n.cull){var o=i.node.worldTransform;o.getX(no),o.getY(so),o.getZ(ao),no.cross(no,so),no.dot(ao)<0?this.twoSidedLightingNegScaleFactorId.setValue(-1):this.twoSidedLightingNegScaleFactorId.setValue(1)}},e.setVertexBuffers=function(t,e){t.setVertexBuffer(e.vertexBuffer)},e.setMorphing=function(t,e){if(e)if(e.morph.useTextureMorph)t.setVertexBuffer(e.morph.vertexBufferIds),this.morphPositionTex.setValue(e.texturePositions),this.morphNormalTex.setValue(e.textureNormals),this.morphTexParams.setValue(e._textureParams);else{for(var i=0;i0&&this.renderShadows(h.directionalLights,f.camera),c.enabled&&t.subLayerEnabled[l]){if(f&&(f.frameBegin(h.renderTarget),h.firstCameraUse&&f.onPreRender&&f.onPreRender()),!u&&c.onPreRenderOpaque?c.onPreRenderOpaque(d):u&&c.onPreRenderTransparent&&c.onPreRenderTransparent(d),c._preRenderCalledForCameras&1<=0&&r._shaderVersion!==i&&(r.updateShader!==Kn.prototype.updateShader&&(r.clearVariants(),r.shader=null),r._shaderVersion=i)}this.passThrough||(this._dirty=!0)},e.removeMeshInstanceFromArray=function(t,e){for(var i=-1,n=0,s=e.length,a=0;a=0)break}i>=0&&e.splice(i,n)},e.removeMeshInstances=function(t,e){for(var i=this.opaqueMeshInstances,n=this.transparentMeshInstances,s=this.shadowCasters,a=0;a=0&&s.splice(o,1)}}this._dirty=!0},e.clearMeshInstances=function(t){(0!==this.opaqueMeshInstances.length||0!==this.transparentMeshInstances.length||!t&&0!==this.shadowCasters.length)&&(this.opaqueMeshInstances.length=0,this.transparentMeshInstances.length=0,t||(this.shadowCasters.length=0),this.passThrough||(this._dirty=!0))},e.addLight=function(t){var e=t.light;this._lightsSet.has(e)||(this._lightsSet.add(e),0!==e.type&&this._clusteredLightsSet.add(e),this._lights.push(e),this._dirtyLights=!0,this._generateLightHash())},e.removeLight=function(t){var e=t.light;this._lightsSet.has(e)&&(this._lightsSet.delete(e),0!==e.type&&this._clusteredLightsSet.delete(e),this._lights.splice(this._lights.indexOf(e),1),this._dirtyLights=!0,this._generateLightHash())},e.clearLights=function(){this._lightsSet.clear(),this._clusteredLightsSet.clear(),this._lights.length=0,this._dirtyLights=!0},e.addShadowCasters=function(t){for(var e=this.shadowCasters,i=0;i=0&&e.splice(n,1)}this._dirtyLights=!0},e._generateLightHash=function(){if(this._lights.length>0){this._lights.sort(po);for(var t="",e="",i=0;i=0||(this.cameras.push(t),this._dirtyCameras=!0)},e.removeCamera=function(t){var e=this.cameras.indexOf(t);e>=0&&(this.cameras.splice(e,1),this._dirtyCameras=!0,this.instances.delete(e))},e.clearCameras=function(){this.cameras.length=0,this._dirtyCameras=!0},e._calculateSortDistances=function(t,e,i,n){for(var s=0;s=0&&!this.directionalLightsSet.has(s)){this.directionalLightsSet.add(s),this.directionalLights.push(s);var r=i.indexOf(s);this.directionalLightsIndices.push(r)}}},t}(),wo=function(){function t(){this.shadowCastersSet=new Set,this.shadowCastersList=[]}var e=t.prototype;return e.clearShadowCasters=function(){this.shadowCastersSet.clear(),this.shadowCastersList.length=0},e.addShadowCasters=function(t){for(var e=0;e1&&bo(this.cameras);for(var _=[],g=0,v=0;v0&&y.layers.indexOf(A.id)>=0){_.push(A),w||A.id!==y.disablePostEffectsLayer||(w=!0,S&&(S.triggerPostprocess=!0));var M=A.cameras.indexOf(y);M>=0&&(S=this.addRenderAction(this._renderActions,g,A,T,M,x,w),g++,x=!1)}}b=0;u--)if(t[u].camera===l&&t[u].renderTarget===h){c=!0;break}var d=a||!c,f=!!d&&l.clearColorBuffer,p=!!d&&l.clearDepthBuffer,m=!!d&&l.clearStencilBuffer;return f|=i.clearColorBuffer,p|=i.clearDepthBuffer,m|=i.clearStencilBuffer,r&&l.postEffectsEnabled&&(h=null),o.reset(),o.triggerPostprocess=!1,o.layerIndex=n,o.cameraIndex=s,o.camera=l,o.renderTarget=h,o.clearColor=f,o.clearDepth=p,o.clearStencil=m,o.firstCameraUse=a,o.lastCameraUse=!1,o},i.propagateRenderTarget=function(t,e){for(var i=t;i>=0;i--){var n=this._renderActions[i],s=this.layerList[n.layerIndex];if(n.renderTarget&&1!==s.id)break;if(1!==s.id){var a=null==n?void 0:n.camera.camera;if(a&&(!e.camera.rect.equals(a.rect)||!e.camera.scissorRect.equals(a.scissorRect)))break;n.renderTarget=e.renderTarget}}},i._logRenderActions=function(){},i._isLayerAdded=function(t){return this.layerList.indexOf(t)>=0},i._isSublayerAdded=function(t,e){for(var i=0;i=0;)this.layerList.splice(e,1),this.subLayerList.splice(e,1),this.subLayerEnabled.splice(e,1),e=this.layerList.indexOf(t),this._dirty=!0,this._dirtyLights=!0,this._dirtyCameras=!0,this.fire("remove",t);var i=this.layerList.length;this._updateOpaqueOrder(0,i-1),this._updateTransparentOrder(0,i-1)},i.pushOpaque=function(t){this._isSublayerAdded(t,!1)||(this.layerList.push(t),this._opaqueOrder[t.id]=this.subLayerList.push(!1)-1,this.subLayerEnabled.push(!0),this._dirty=!0,this._dirtyLights=!0,this._dirtyCameras=!0,this.fire("add",t))},i.insertOpaque=function(t,e){if(!this._isSublayerAdded(t,!1)){this.layerList.splice(e,0,t),this.subLayerList.splice(e,0,!1);var i=this.subLayerList.length;this._updateOpaqueOrder(e,i-1),this.subLayerEnabled.splice(e,0,!0),this._dirty=!0,this._dirtyLights=!0,this._dirtyCameras=!0,this.fire("add",t)}},i.removeOpaque=function(t){for(var e=0,i=this.layerList.length;e=1?(r[0]=Math.pow(e,2.2)*s,r[1]=Math.pow(i,2.2)*s,r[2]=Math.pow(n,2.2)*s):(r[0]=Math.pow(a[0],2.2),r[1]=Math.pow(a[1],2.2),r[2]=Math.pow(a[2],2.2))},e.setColor=function(){1===arguments.length?this._color.set(arguments[0].r,arguments[0].g,arguments[0].b):3===arguments.length&&this._color.set(arguments[0],arguments[1],arguments[2]),this._updateFinalColor()},e.updateShadow=function(){2!==this.shadowUpdateMode&&(this.shadowUpdateMode=1)},e.layersDirty=function(){var t;null!=(t=this._scene)&&t.layers&&(this._scene.layers._dirtyLights=!0)},e.updateKey=function(){var t=this._type<<29|(this._castShadows?1:0)<<28|this._shadowType<<25|this._falloffMode<<23|(0!==this._normalOffsetBias?1:0)<<22|(this._cookie?1:0)<<21|(this._cookieFalloff?1:0)<<20|Io[this._cookieChannel.charAt(0)]<<18|(this._cookieTransform?1:0)<<12|this._shape<<10|this.numCascades-1<<8;3===this._cookieChannel.length&&(t|=Io[this._cookieChannel.charAt(1)]<<16,t|=Io[this._cookieChannel.charAt(2)]<<14),t!==this.key&&null!==this._scene&&this.layersDirty(),this.key=t},q(t,[{key:"numCascades",get:function(){return this.cascades.length},set:function(t){this.cascades&&this.numCascades==t||(this.cascades=Lo[t-1],this._shadowMatrixPalette=new Float32Array(64),this._shadowCascadeDistances=new Float32Array(4),this._destroyShadowMap(),this.updateKey())}},{key:"shadowMap",get:function(){return this._shadowMap},set:function(t){this._shadowMap!==t&&(this._destroyShadowMap(),this._shadowMap=t)}},{key:"numShadowFaces",get:function(){var t=this._type;return 0===t?this.numCascades:1===t?6:1}},{key:"type",get:function(){return this._type},set:function(t){if(this._type!==t){this._type=t,this._destroyShadowMap(),this.updateKey();var e=this._shadowType;this._shadowType=null,this.shadowType=e}}},{key:"shape",get:function(){return this._shape},set:function(t){if(this._shape!==t){this._shape=t,this._destroyShadowMap(),this.updateKey();var e=this._shadowType;this._shadowType=null,this.shadowType=e}}},{key:"shadowType",get:function(){return this._shadowType},set:function(t){if(this._shadowType!==t){var e=this.device;1===this._type&&(t=0),4!==t||e.webgl2||(t=0),3!==t||e.textureFloatRenderable||(t=2),2!==t||e.textureHalfFloatRenderable||(t=1),this._isVsm=t>=1&&t<=3,this._isPcf=4===t||0===t,this._shadowType=t,this._destroyShadowMap(),this.updateKey()}}},{key:"enabled",get:function(){return this._enabled},set:function(t){this._enabled!==t&&(this._enabled=t,this.layersDirty())}},{key:"castShadows",get:function(){return this._castShadows&&4!==this.mask&&0!==this.mask},set:function(t){this._castShadows!==t&&(this._castShadows=t,this._destroyShadowMap(),this.layersDirty(),this.updateKey())}},{key:"shadowResolution",get:function(){return this._shadowResolution},set:function(t){this._shadowResolution!==t&&(t=1===this._type?Math.min(t,this.device.maxCubeMapSize):Math.min(t,this.device.maxTextureSize),this._shadowResolution=t,this._destroyShadowMap())}},{key:"vsmBlurSize",get:function(){return this._vsmBlurSize},set:function(t){this._vsmBlurSize!==t&&(t%2==0&&t++,this._vsmBlurSize=t)}},{key:"normalOffsetBias",get:function(){return this._normalOffsetBias},set:function(t){this._normalOffsetBias!==t&&((!this._normalOffsetBias&&t||this._normalOffsetBias&&!t)&&this.updateKey(),this._normalOffsetBias=t)}},{key:"falloffMode",get:function(){return this._falloffMode},set:function(t){this._falloffMode!==t&&(this._falloffMode=t,this.updateKey())}},{key:"innerConeAngle",get:function(){return this._innerConeAngle},set:function(t){this._innerConeAngle!==t&&(this._innerConeAngle=t,this._innerConeAngleCos=Math.cos(t*Math.PI/180))}},{key:"outerConeAngle",get:function(){return this._outerConeAngle},set:function(t){this._outerConeAngle!==t&&(this._outerConeAngle=t,this._outerConeAngleCos=Math.cos(t*Math.PI/180))}},{key:"intensity",get:function(){return this._intensity},set:function(t){this._intensity!==t&&(this._intensity=t,this._updateFinalColor())}},{key:"cookieMatrix",get:function(){return this._cookieMatrix||(this._cookieMatrix=new St),this._cookieMatrix}},{key:"atlasViewport",get:function(){return this._atlasViewport||(this._atlasViewport=new _t(0,0,1,1)),this._atlasViewport}},{key:"cookie",get:function(){return this._cookie},set:function(t){this._cookie!==t&&(this._cookie=t,this.updateKey())}},{key:"cookieFalloff",get:function(){return this._cookieFalloff},set:function(t){this._cookieFalloff!==t&&(this._cookieFalloff=t,this.updateKey())}},{key:"cookieChannel",get:function(){return this._cookieChannel},set:function(t){if(this._cookieChannel!==t){if(t.length<3)for(var e=t.charAt(t.length-1),i=3-t.length,n=0;n0){var n=i.bakeArea;Sn(Uo,t,e),Uo.mulScalar(.5*n),i._node.rotateLocal(Uo.x,0,Uo.y)}i._node.getWorldTransform();var s=this.scene.gammaCorrection?2.2:1,a=Math.pow(this.intensity,s);i.intensity=Math.pow(a/e,1/s)},q(e,[{key:"numVirtualLights",get:function(){return 0===this.light.type?this.light.bakeNumSamples:1}}]),e}(No),Vo=function(){function t(t,e){this.texture0=t,this.texture1=e}return t.prototype.destroy=function(){var t,e;null==(t=this.texture0)||t.destroy(),null==(e=this.texture1)||e.destroy()},t}(),Wo=new ai,Go=function(){function t(){}return t.createTexture=function(t,e,i,n){void 0===n&&(n="");var s=new Bi(t,{width:i,height:i,format:e,addressU:1,addressV:1,type:Ve,magFilter:1,minFilter:0,anisotropy:1});return s.name="AreaLightLUT"+n,s},t.applyTextures=function(t,e,i){Wo.remove(t),Wo.get(t,(function(){return new Vo(e,e===i?null:i)})),t.scope.resolve("areaLightsLutTex1").setValue(e),t.scope.resolve("areaLightsLutTex2").setValue(i)},t.createPlaceholder=function(e){var i=t.createTexture(e,7,2,"placeholder");i.lock().fill(0),i.unlock(),t.applyTextures(e,i,i)},t.set=function(e,i){function n(e,i,n){var s=t.createTexture(e,n,64);return s.lock().set(i),s.unlock(),s.upload(),s}function s(t,e,i){for(var n=t.length,s=new Float32Array(n),a=0;af)return!1;this.morphTextureWidth=p,this.morphTextureHeight=m;var _=!1,g=3,v=ki.float2Half;this._textureFormat===e.FORMAT_HALF_FLOAT&&(_=!0,g=4);for(var y=this.morphTextureWidth*this.morphTextureHeight*g,x=_?new Uint16Array(y):new Float32Array(y),b=0;b0&&(e+="varying vec2 uv0;\nuniform highp float morphFactor["+t+"];\n");for(var i=0;i=this.maxSubmitCount&&(s(a,r),a=0,r=!0))}(a>0||0===o&&!this.zeroTextures)&&s(a,r)},e._updateTextureMorph=function(){this.device,(this._activeTargets.length>0||!this.zeroTextures)&&(this._updateTextureRenderTarget(this.rtPositions,"texturePositions"),this._updateTextureRenderTarget(this.rtNormals,"textureNormals"),this.zeroTextures=0===this._activeTargets.length)},e._updateVertexMorph=function(){for(var t=this.maxSubmitCount,e=0;e1e-5){this._activeTargets.length<=e&&(this._activeTargets[e]={});var s=this._activeTargets[e++];s.absWeight=n,s.weight=this.getWeight(i),s.target=t[i]}}this._activeTargets.length=e;var a=this.morph.maxActiveTargets;this._activeTargets.length>a&&(this._activeTargets.sort((function(t,e){return t.absWeight0&&this.material.transparent===e&&(this.mesh.setPositions(this.positions),this.mesh.setColors(this.colors),this.mesh.update(1,!1),this.meshInstance||(this.meshInstance=new Ba(this.mesh,this.material,jo)),this.positions.length=0,this.colors.length=0,t.list.push(this.meshInstance),t.length++)},t}(),Ko=function(){function t(t){this.device=t,this.map=new Map}var e=t.prototype;return e.getBatch=function(t,e){var i=this.map.get(t);return i||(i=new Yo(this.device,t,e),this.map.set(t,i)),i},e.onPreRender=function(t,e){this.map.forEach((function(i){i.onPreRender(t,e)}))},t}(),Zo=[],$o=function(){function t(t){this.device=t,this.quadMesh=null,this.textureShader=null,this.depthTextureShader=null,this.cubeLocalPos=null,this.cubeWorldPos=null,this.batchesMap=new Map,this.allBatches=new Set,this.updatedLayers=new Set,this._materialDepth=null,this._materialNoDepth=null,this.layerMeshInstances=new Map}var e=t.prototype;return e.createMaterial=function(t){var e=new wa;return e.vertexColors=!0,e.blend=!0,e.blendType=2,e.depthTest=t,e.update(),e},e.getBatch=function(t,e){var i=this.batchesMap.get(t);i||(i=new Ko(this.device),this.batchesMap.set(t,i)),this.allBatches.add(i);var n=e?this.materialDepth:this.materialNoDepth;return i.getBatch(n,t)},t.getTextureVS=function(){return"\n\t\t\t\t\t\tattribute vec2 aPosition;\n\t\t\t\t\t\tuniform mat4 matrix_model;\n\t\t\t\t\t\tvarying vec2 uv0;\n\t\t\t\t\t\tvoid main(void) {\n\t\t\t\t\t\t\t\tgl_Position = matrix_model * vec4(aPosition, 0, 1);\n\t\t\t\t\t\t\t\tuv0 = aPosition.xy + 0.5;\n\t\t\t\t\t\t}\n\t\t\t\t"},e.getTextureShader=function(){if(!this.textureShader){var e={attributes:{aPosition:le},vshader:t.getTextureVS(),fshader:"\n\t\t\t\t\t\t\t\t\t\tprecision lowp float;\n\t\t\t\t\t\t\t\t\t\tvarying vec2 uv0;\n\t\t\t\t\t\t\t\t\t\tuniform sampler2D colorMap;\n\t\t\t\t\t\t\t\t\t\tvoid main (void) {\n\t\t\t\t\t\t\t\t\t\t\t\tgl_FragColor = vec4(texture2D(colorMap, uv0).xyz, 1);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t"};this.textureShader=new li(this.device,e)}return this.textureShader},e.getDepthTextureShader=function(){if(!this.depthTextureShader){var e=this.device.webgl2?"#define GL2":"",i={attributes:{aPosition:le},vshader:t.getTextureVS(),fshader:"\n\t\t\t\t\t\t\t\t\t\tprecision "+this.device.precision+" float;\n\t\t\t\t\t\t\t\t\t\t"+e+"\n\t\t\t\t\t\t\t\t\t\t"+ci.screenDepthPS+"\n\t\t\t\t\t\t\t\t\t\tvarying vec2 uv0;\n\t\t\t\t\t\t\t\t\t\tvoid main() {\n\t\t\t\t\t\t\t\t\t\t\t\tfloat depth = getLinearScreenDepth(uv0) * camera_params.x;\n\t\t\t\t\t\t\t\t\t\t\t\tgl_FragColor = vec4(vec3(depth), 1.0);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t"};this.depthTextureShader=new li(this.device,i)}return this.depthTextureShader},e.getQuadMesh=function(){return this.quadMesh||(this.quadMesh=new oa(this.device),this.quadMesh.setPositions([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),this.quadMesh.update(5)),this.quadMesh},e.drawMesh=function(t,e,i,n,s){if(!n){var a=this.getGraphNode(e);n=new Ba(i,t,a)}var r=this.layerMeshInstances.get(s);r||(r=[],this.layerMeshInstances.set(s,r)),r.push(n)},e.drawWireAlignedBox=function(t,e,i,n,s){Zo.push(t.x,t.y,t.z,t.x,e.y,t.z,t.x,e.y,t.z,e.x,e.y,t.z,e.x,e.y,t.z,e.x,t.y,t.z,e.x,t.y,t.z,t.x,t.y,t.z,t.x,t.y,e.z,t.x,e.y,e.z,t.x,e.y,e.z,e.x,e.y,e.z,e.x,e.y,e.z,e.x,t.y,e.z,e.x,t.y,e.z,t.x,t.y,e.z,t.x,t.y,t.z,t.x,t.y,e.z,t.x,e.y,t.z,t.x,e.y,e.z,e.x,e.y,t.z,e.x,e.y,e.z,e.x,t.y,t.z,e.x,t.y,e.z),this.getBatch(s,n).addLinesArrays(Zo,i),Zo.length=0},e.drawWireSphere=function(t,e,i,n,s,a){for(var r=2*Math.PI/n,o=0,h=0;h=0},i.getModels=function(t){return this._models},q(e,[{key:"defaultDrawLayer",get:function(){return this.layers.getLayerById(3)}},{key:"ambientBakeNumSamples",get:function(){return this._ambientBakeNumSamples},set:function(t){this._ambientBakeNumSamples=rt.clamp(Math.floor(t),1,255)}},{key:"ambientBakeSpherePart",get:function(){return this._ambientBakeSpherePart},set:function(t){this._ambientBakeSpherePart=rt.clamp(t,.001,1)}},{key:"clusteredLightingEnabled",get:function(){return this._clusteredLightingEnabled},set:function(t){!this._clusteredLightingEnabled||t?this._clusteredLightingEnabled=t:console.error("Turning off enabled clustered lighting is not currently supported")}},{key:"drawCalls",get:function(){var t=this.layers._meshInstances;return t.length||(this.layers._update(this.device,this.clusteredLightingEnabled),t=this.layers._meshInstances),t},set:function(t){}},{key:"envAtlas",get:function(){return this._envAtlas},set:function(t){t!==this._envAtlas&&(this._envAtlas=t,this.updateShaders=!0)}},{key:"fog",get:function(){return this._fog},set:function(t){t!==this._fog&&(this._fog=t,this.updateShaders=!0)}},{key:"gammaCorrection",get:function(){return this._gammaCorrection},set:function(t){t!==this._gammaCorrection&&(this._gammaCorrection=t,this.updateShaders=!0)}},{key:"layers",get:function(){return this._layers},set:function(t){var e=this._layers;this._layers=t,this.fire("set:layers",e,t)}},{key:"lighting",get:function(){return this._lightingParams}},{key:"lightmapFilterRange",get:function(){return this._lightmapFilterRange},set:function(t){this._lightmapFilterRange=Math.max(t,.001)}},{key:"lightmapFilterSmoothness",get:function(){return this._lightmapFilterSmoothness},set:function(t){this._lightmapFilterSmoothness=Math.max(t,.001)}},{key:"prefilteredCubemaps",get:function(){return this._prefilteredCubemaps},set:function(t){var e=this._prefilteredCubemaps;t=t||[];for(var i=!1,n=!0,s=0;s<6;++s){var a=t[s]||null;e[s]!==a&&(e[s]=a,i=!0),n=n&&!!e[s]}i&&(this._resetSkyboxModel(),n?(this._internalEnvAtlas=Xn.generatePrefilteredAtlas(e,{target:this._internalEnvAtlas}),this._envAtlas||(this.envAtlas=this._internalEnvAtlas)):this._internalEnvAtlas&&(this._envAtlas===this._internalEnvAtlas&&(this.envAtlas=null),this._internalEnvAtlas.destroy(),this._internalEnvAtlas=null))}},{key:"skybox",get:function(){return this._skyboxCubeMap},set:function(t){t!==this._skyboxCubeMap&&(this._skyboxCubeMap=t,this._resetSkyboxModel())}},{key:"skyboxIntensity",get:function(){return this._skyboxIntensity},set:function(t){t!==this._skyboxIntensity&&(this._skyboxIntensity=t,this._resetSkyboxModel())}},{key:"skyboxMip",get:function(){return this._skyboxMip},set:function(t){t!==this._skyboxMip&&(this._skyboxMip=t,this._resetSkyboxModel())}},{key:"skyboxRotation",get:function(){return this._skyboxRotation},set:function(t){this._skyboxRotation.equals(t)||(this._skyboxRotation.copy(t),this._resetSkyboxModel())}},{key:"toneMapping",get:function(){return this._toneMapping},set:function(t){t!==this._toneMapping&&(this._toneMapping=t,this.updateShaders=!0)}}]),e}(m);function Jo(){return!("undefined"==typeof AudioContext&&"undefined"==typeof webkitAudioContext)}var th=function(){function t(t,e,i){if(void 0===i&&(i={}),this.volume=void 0===i.volume?1:i.volume,this.loop=void 0!==i.loop&&i.loop,this.pitch=void 0===i.pitch?1:i.pitch,this.sound=e,this.paused=!1,this.suspended=!1,this.manager=t,this.source=null,Jo()){this.startTime=0,this.startOffset=0;var n=t.context;this.gain=n.createGain()}else e.audio&&(this.source=e.audio.cloneNode(!1),this.source.pause())}var e=t.prototype;return e.getVolume=function(){return this.volume},e.getLoop=function(){return this.loop},e.setLoop=function(t){this.loop=t,this.source&&(this.source.loop=t)},e.getPitch=function(){return this.pitch},e.onManagerVolumeChange=function(){this.setVolume(this.getVolume())},e.onManagerSuspend=function(){this.isPlaying()&&!this.suspended&&(this.suspended=!0,this.pause())},e.onManagerResume=function(){this.suspended&&(this.suspended=!1,this.unpause())},e.play=function(){if(this.source)throw new Error("Call stop() before calling play()");this._createSource(),this.source&&(this.startTime=this.manager.context.currentTime,this.source.start(0,this.startOffset%this.source.buffer.duration),this.setVolume(this.volume),this.setLoop(this.loop),this.setPitch(this.pitch),this.manager.on("volumechange",this.onManagerVolumeChange,this),this.manager.on("suspend",this.onManagerSuspend,this),this.manager.on("resume",this.onManagerResume,this),this.manager.suspended&&this.onManagerSuspend())},e.pause=function(){this.source&&(this.paused=!0,this.startOffset+=this.manager.context.currentTime-this.startTime,this.source.stop(0),this.source=null)},e.unpause=function(){!this.source&&this.paused?(this._createSource(),this.source&&(this.startTime=this.manager.context.currentTime,this.source.start(0,this.startOffset%this.source.buffer.duration),this.setVolume(this.volume),this.setLoop(this.loop),this.setPitch(this.pitch),this.paused=!1)):console.warn("Call pause() before unpausing.")},e.stop=function(){this.source&&(this.source.stop(0),this.source=null),this.manager.off("volumechange",this.onManagerVolumeChange,this),this.manager.off("suspend",this.onManagerSuspend,this),this.manager.off("resume",this.onManagerResume,this)},e.setVolume=function(t){t=rt.clamp(t,0,1),this.volume=t,this.gain&&(this.gain.gain.value=t*this.manager.volume)},e.setPitch=function(t){this.pitch=t,this.source&&(this.source.playbackRate.value=t)},e.isPlaying=function(){return!this.paused&&this.source.playbackState===this.source.PLAYING_STATE},e.getDuration=function(){return this.source?this.source.buffer.duration:0},e._createSource=function(){var t=this.manager.context;this.sound.buffer&&(this.source=t.createBufferSource(),this.source.buffer=this.sound.buffer,this.source.connect(this.gain),this.gain.connect(t.destination),this.loop||(this.source.onended=this.pause.bind(this)))},t}();Jo()||Object.assign(th.prototype,{play:function(){this.source&&(this.paused=!1,this.setVolume(this.volume),this.setLoop(this.loop),this.setPitch(this.pitch),this.source.play()),this.manager.on("volumechange",this.onManagerVolumeChange,this),this.manager.on("suspend",this.onManagerSuspend,this),this.manager.on("resume",this.onManagerResume,this),this.manager.suspended&&this.onManagerSuspend()},pause:function(){this.source&&(this.paused=!0,this.source.pause())},unpause:function(){this.source&&(this.paused=!1,this.source.play())},stop:function(){this.source&&this.source.pause(),this.manager.off("volumechange",this.onManagerVolumeChange,this),this.manager.off("suspend",this.onManagerSuspend,this),this.manager.off("resume",this.onManagerResume,this)},setVolume:function(t){t=rt.clamp(t,0,1),this.volume=t,this.source&&(this.source.volume=t*this.manager.volume)},setPitch:function(t){this.pitch=t,this.source&&(this.source.playbackRate=t)},getDuration:function(){return this.source&&!isNaN(this.source.duration)?this.source.duration:0},isPlaying:function(){return!this.source.paused}});var eh="linear",ih="inverse",nh="exponential",sh=function(t){function e(e,i,n){var s;return(s=t.call(this,e,i,n)||this).position=new ft,s.velocity=new ft,Jo()?s.panner=e.context.createPanner():(s.maxDistance=1e4,s.minDistance=1,s.rollOffFactor=1,s.distanceModel=ih),s}Y(e,t);var i=e.prototype;return i.getPosition=function(){return this.position},i.setPosition=function(t){this.position.copy(t);var e=this.panner;"positionX"in e?(e.positionX.value=t.x,e.positionY.value=t.y,e.positionZ.value=t.z):e.setPosition&&e.setPosition(t.x,t.y,t.z)},i.getVelocity=function(){return this.velocity},i.setVelocity=function(t){this.velocity.copy(t)},i.getMaxDistance=function(){return this.panner.maxDistance},i.setMaxDistance=function(t){this.panner.maxDistance=t},i.getMinDistance=function(){return this.panner.refDistance},i.setMinDistance=function(t){this.panner.refDistance=t},i.getRollOffFactor=function(){return this.panner.rolloffFactor},i.setRollOffFactor=function(t){this.panner.rolloffFactor=t},i.getDistanceModel=function(){return this.panner.distanceModel},i.setDistanceModel=function(t){this.panner.distanceModel=t},i._createSource=function(){var t=this.manager.context;this.source=t.createBufferSource(),this.source.buffer=this.sound.buffer,this.source.connect(this.panner),this.panner.connect(this.gain),this.gain.connect(t.destination),this.loop||(this.source.onended=this.pause.bind(this))},e}(th);if(!Jo()){var ah=new ft;Object.assign(sh.prototype,{setPosition:function(t){if(this.position.copy(t),this.source){var e=function(t,e,i,n,s,a){var r=(ah=ah.sub2(t,e)).length();if(rn)return 0;var o=0;return a===eh?o=1-s*(r-i)/(n-i):a===ih?o=i/(i+s*(r-i)):a===nh&&(o=Math.pow(r/i,-s)),rt.clamp(o,0,1)}(this.manager.listener.getPosition(),this.position,this.minDistance,this.maxDistance,this.rollOffFactor,this.distanceModel),i=this.getVolume();this.source.volume=i*e}},getMaxDistance:function(){return this.maxDistance},setMaxDistance:function(t){this.maxDistance=t},getMinDistance:function(){return this.minDistance},setMinDistance:function(t){this.minDistance=t},getRollOffFactor:function(){return this.rollOffFactor},setRollOffFactor:function(t){this.rollOffFactor=t},getDistanceModel:function(){return this.distanceModel},setDistanceModel:function(t){this.distanceModel=t}})}var rh=function(){function t(t){this._manager=t,this.position=new ft,this.velocity=new ft,this.orientation=new St}var e=t.prototype;return e.getPosition=function(){return this.position},e.setPosition=function(t){this.position.copy(t);var e=this.listener;e&&("positionX"in e?(e.positionX.value=t.x,e.positionY.value=t.y,e.positionZ.value=t.z):e.setPosition&&e.setPosition(t.x,t.y,t.z))},e.getVelocity=function(){return this.velocity},e.setVelocity=function(t){},e.setOrientation=function(t){this.orientation.copy(t);var e=this.listener;if(e){var i=t.data;"forwardX"in e?(e.forwardX.value=-i[8],e.forwardY.value=-i[9],e.forwardZ.value=-i[10],e.upX.value=i[4],e.upY.value=i[5],e.upZ.value=i[6]):e.setOrientation&&e.setOrientation(-i[8],-i[9],-i[10],i[4],i[5],i[6])}},e.getOrientation=function(){return this.orientation},q(t,[{key:"listener",get:function(){var t=this._manager.context;return t?t.listener:null}}]),t}(),oh="running",hh="suspended",lh="interrupted",ch=["click","contextmenu","auxclick","dblclick","mousedown","mouseup","pointerup","touchend","keydown","keyup"],uh=function(t){function e(e){var i;return(i=t.call(this)||this)._context=null,i._state="not created",i._forceWebAudioApi=e.forceWebAudioApi,i._resumeContext=null,i._resumeContextAttached=!1,i._unlock=null,i._unlockAttached=!1,Jo()||i._forceWebAudioApi?i._addAudioContextUserInteractionListeners():console.warn("No support for 3D audio found"),i.listener=new rh(Z(i)),i._volume=1,i.suspended=!1,i}Y(e,t);var i=e.prototype;return i.suspend=function(){this.suspended=!0,this.fire("suspend")},i.resume=function(){this.suspended=!1,this.fire("resume"),!this.context||this._state!==lh&&this._state!==hh||this._safelyResumeContext()},i.destroy=function(){var t=this;this._resumeContext&&this._resumeContextAttached&&ch.forEach((function(e){window.removeEventListener(e,t._resumeContext)})),this._unlock&&this._unlockAttached&&window.removeEventListener("touchend",this._unlock),this.fire("destroy"),this._context&&this._context.close&&(this._context.close(),this._context=null)},i.playSound=function(t,e){void 0===e&&(e={});var i=null;return th&&(i=new th(this,t,e)).play(),i},i.playSound3d=function(t,e,i){void 0===i&&(i={});var n=null;return sh&&((n=new sh(this,t,i)).setPosition(e),i.volume&&n.setVolume(i.volume),i.loop&&n.setLoop(i.loop),i.maxDistance&&n.setMaxDistance(i.maxDistance),i.minDistance&&n.setMinDistance(i.minDistance),i.rollOffFactor&&n.setRollOffFactor(i.rollOffFactor),i.distanceModel&&n.setDistanceModel(i.distanceModel),n.play()),n},i._safelyResumeContext=function(){var t=this;this._context&&this._context.resume().then((function(){t._context.state!==oh&&t._addAudioContextUserInteractionListeners()})).catch((function(){t._addAudioContextUserInteractionListeners()}))},i._addAudioContextUserInteractionListeners=function(){var t=this;this._resumeContext||(this._resumeContext=function(){t.context&&t.context.state!==oh?t.context.resume():(ch.forEach((function(e){window.removeEventListener(e,t._resumeContext)})),t._resumeContextAttached=!1)}),this._resumeContextAttached||(ch.forEach((function(e){window.addEventListener(e,t._resumeContext)})),this._resumeContextAttached=!0),L.ios&&(this._unlock||(this._unlock=function(){window.removeEventListener("touchend",t._unlock),t._unlockAttached=!1;var e=t.context;if(e){var i=e.createBuffer(1,1,44100),n=e.createBufferSource();n.buffer=i,n.connect(e.destination),n.start(0),n.disconnect()}}),this._unlockAttached||(window.addEventListener("touchend",this._unlock),this._unlockAttached=!0))},q(e,[{key:"volume",get:function(){return this._volume},set:function(t){t=rt.clamp(t,0,1),this._volume=t,this.fire("volumechange",t)}},{key:"context",get:function(){var t=this;return this._context||(Jo()||this._forceWebAudioApi)&&("undefined"!=typeof AudioContext?this._context=new AudioContext:"undefined"!=typeof webkitAudioContext&&(this._context=new webkitAudioContext),this._context&&(this._state=this._context.state,this._context.onstatechange=function(){t._context&&(t._state!==lh&&t._state!==hh||t._safelyResumeContext(),t._state=t._context.state)})),this._context}}]),e}(m),dh=function(t,e,i,n){this.time=t,this.position=e,this.rotation=i,this.scale=n},fh=function(){this._name="",this._keys=[]},ph=function(){function t(){this.name="",this.duration=0,this._nodes=[],this._nodeDict={}}var e=t.prototype;return e.getNode=function(t){return this._nodeDict[t]},e.addNode=function(t){this._nodes.push(t),this._nodeDict[t._name]=t},q(t,[{key:"nodes",get:function(){return this._nodes}}]),t}(),mh=function(){function t(t){2===arguments.length&&(t=arguments[1]),this.options=t,this._name=t.name,this._defaultWeight=t.defaultWeight||0,this.aabb=t.aabb,this.aabb||(this.aabb=new Pt,t.deltaPositions&&this.aabb.compute(t.deltaPositions)),this.deltaPositions=t.deltaPositions}var e=t.prototype;return e._postInit=function(){this.options=null},e._initVertexBuffers=function(t){var e=this.options;this._vertexBufferPositions=this._createVertexBuffer(t,e.deltaPositions,e.deltaPositionsType),this._vertexBufferNormals=this._createVertexBuffer(t,e.deltaNormals,e.deltaNormalsType),this._vertexBufferPositions&&(this.deltaPositions=this._vertexBufferPositions.lock())},e._createVertexBuffer=function(t,e,i){return void 0===i&&(i=6),e?new ii(t,new si(t,[{semantic:Ae,components:3,type:i}]),e.length/3,0,e):null},e._setTexture=function(t,e){this[t]=e},e.destroy=function(){this._vertexBufferPositions&&(this._vertexBufferPositions.destroy(),this._vertexBufferPositions=null),this._vertexBufferNormals&&(this._vertexBufferNormals.destroy(),this._vertexBufferNormals=null),this.texturePositions&&(this.texturePositions.destroy(),this.texturePositions=null),this.textureNormals&&(this.textureNormals.destroy(),this.textureNormals=null)},q(t,[{key:"name",get:function(){return this._name}},{key:"defaultWeight",get:function(){return this._defaultWeight}},{key:"morphPositions",get:function(){return!!this._vertexBufferPositions||!!this.texturePositions}},{key:"morphNormals",get:function(){return!!this._vertexBufferNormals||!!this.textureNormals}}]),t}(),_h=function(t,e,i){this.device=t,this.inverseBindPose=e,this.boneNames=i},gh=function(t){function e(){var e;return(e=t.call(this)||this)._meshes=null,e}Y(e,t);var i=e.prototype;return i.destroy=function(){this.meshes=null},i.decRefMeshes=function(){if(this._meshes)for(var t=this._meshes.length,e=0;e=0&&t<=1?0:1})),Ah(["fr","pt"],(function(t){return t>=0&&t<2?0:1})),Ah(["da"],(function(t){return 1===t||!Number.isInteger(t)&&t>=0&&t<=1?0:1})),Ah(["de","en","it","el","es","tr","fi","sv","nb","no","ur"],(function(t){return 1===t?0:1})),Ah(["ru","uk"],(function(t){if(Number.isInteger(t)){var e=t%10,i=t%100;if(1===e&&11!==i)return 0;if(e>=2&&e<=4&&(i<12||i>14))return 1;if(0===e||e>=5&&e<=9||i>=11&&i<=14)return 2}return 3})),Ah(["pl"],(function(t){if(Number.isInteger(t)){if(1===t)return 0;var e=t%10,i=t%100;if(e>=2&&e<=4&&(i<12||i>14))return 1;if(e>=0&&e<=1||e>=5&&e<=9||i>=12&&i<=14)return 2}return 3})),Ah(["ar"],(function(t){if(0===t)return 0;if(1===t)return 1;if(2===t)return 2;if(Number.isInteger(t)){var e=t%100;if(e>=3&&e<=10)return 3;if(e>=11&&e<=99)return 4}return 5}));var Eh=Th[Mh(Sh)];function Ph(t){return Th[t]||Eh}var Rh=new RegExp("^\\s*(?:(?:[a-z]+[a-z0-9\\-\\+\\.]*:)?//|data:|blob:)","i"),Ih=function(){function t(t,e,i,n,s,a){this.url=t||"",this.filename=e||"",this.hash=void 0===i?null:i,this.size=void 0===n?null:n,this.opt=void 0===s?null:s,this.contents=a||null}return t.prototype.equals=function(t){return this.url===t.url&&this.filename===t.filename&&this.hash===t.hash&&this.size===t.size&&this.opt===t.opt&&this.contents===t.contents},t}(),Lh=-1,Dh={pvr:"extCompressedTexturePVRTC",dxt:"extCompressedTextureS3TC",etc2:"extCompressedTextureETC",etc1:"extCompressedTextureETC1",basis:"canvas"},kh=["pvr","dxt","etc2","etc1","basis"],Oh=function(t){function e(e,i,n,s,a){var r;return(r=t.call(this)||this)._id=Lh--,r.name=e||"",r.type=i,r.tags=new et(Z(r)),r._preload=!1,r._file=null,r._data=s||{},r.options=a||{},r._resources=[],r._i18n={},r.loaded=!1,r.loading=!1,r.registry=null,n&&(r.file=n),r}Y(e,t);var i=e.prototype;return i.getFileUrl=function(){var t=this.file;if(!t||!t.url)return null;var e=t.url;if(this.registry&&this.registry.prefix&&!Rh.test(e)&&(e=this.registry.prefix+e),"script"!==this.type&&t.hash){var i=-1!==e.indexOf("?")?"&":"?";e+=i+"t="+t.hash}return e},i.getAbsoluteUrl=function(t){if(t.startsWith("blob:")||t.startsWith("data:"))return t;var e=v.getDirectory(this.file.url);return v.join(e,t)},i.getLocalizedAssetId=function(t){return t=Ch(t,this._i18n),this._i18n[t]||null},i.addLocalizedAssetId=function(t,e){this._i18n[t]=e,this.fire("add:localized",t,e)},i.removeLocalizedAssetId=function(t){var e=this._i18n[t];e&&(delete this._i18n[t],this.fire("remove:localized",t,e))},i.ready=function(t,e){e=e||this,this.resource?t.call(e,this):this.once("load",(function(i){t.call(e,i)}))},i.reload=function(){this.loaded&&(this.loaded=!1,this.registry.load(this))},i.unload=function(){if(this.loaded||0!==this._resources.length){this.fire("unload",this),this.registry.fire("unload:"+this.id,this);var t=this._resources;this.resources=[],this.loaded=!1,this.file&&this.registry._loader.clearCache(this.getFileUrl(),this.type);for(var e=0;e0,maxRetries:n},e)},q(e,[{key:"id",get:function(){return this._id},set:function(t){this._id=t}},{key:"file",get:function(){return this._file},set:function(t){var e=this;if(t&&t.variants&&-1!==["texture","textureatlas","bundle"].indexOf(this.type)){var i,n,s=(null==(i=this.registry)||null==(n=i._loader)?void 0:n._app)||ia(),a=null==s?void 0:s.graphicsDevice;if(a)for(var r=function(i,n){var r=kh[i];if(t.variants[r]&&a[Dh[r]])return t=t.variants[r],"break";if(s.enableBundles){var o=s.bundles.listBundlesForAsset(e);if(o&&o.find((function(t){var e;return null==t||null==(e=t.file)?void 0:e.variants[r]})))return"break"}},o=0,h=kh.length;o=0){var a=n[s];a.decRefCount(),0===a.refCount&&(n.splice(s,1),n.length||t._skinInstanceCache.delete(i),e&&(e.destroy(),a.skinInstance=null))}}}}},t}();Bh._skinInstanceCache=new Map;var Nh,Uh=function(){function t(e,i,n,s){for(var a=function(e,s,a){var r=t.createAsset(i.name,e,s,a);return n.add(r),r},r=[],o=0;o0&&o(n,Float32Array,1),s.length>0&&o(s,Uint16Array,65535),a.length>0&&o(a,Uint8Array,255)}(y),y.unlock(),y},Jh=new St,tl=new ft,el=function(t,e,i,n,s,a,r){var o=[];return e.primitives.forEach((function(h){var l,c,u,d=null,f=!0;if(h.hasOwnProperty("extensions")){var p=h.extensions;if(p.hasOwnProperty("KHR_draco_mesh_compression")){var m=window.DracoDecoderModule;if(m){var _=p.KHR_draco_mesh_compression;if(_.hasOwnProperty("attributes")){var g=n[_.bufferView],v=new m.DecoderBuffer;v.Init(g,g.length);var y,x,b=new m.Decoder,S=b.GetEncodedGeometryType(v);switch(S){case m.POINT_CLOUD:l=0,y=new m.PointCloud,x=b.DecodeBufferToPointCloud(v,y);break;case m.TRIANGULAR_MESH:l=4,y=new m.Mesh,x=b.DecodeBufferToMesh(v,y);break;case m.INVALID_GEOMETRY_TYPE:}if(!x||!x.ok()||0==y.ptr)return void s("Failed to decode draco compressed asset: "+(x?x.error_msg():"Mesh asset - invalid draco compressed geometry type: "+S));var w=y.num_faces();if(S===m.TRIANGULAR_MESH){var T=y.num_points()>65535,A=(u=3*w)*(T?4:2),M=m._malloc(A);T?(b.GetTrianglesUInt32Array(y,A,M),d=new Uint32Array(m.HEAPU32.buffer,M,u).slice()):(b.GetTrianglesUInt16Array(y,A,M),d=new Uint16Array(m.HEAPU16.buffer,M,u).slice()),m._free(M)}c=function(t,e,i,n,s,a,r){var o=e.num_points(),h=function(t){var i,a,r,h,l=n.GetAttributeByUniqueId(e,t),c=o*l.num_components();switch(l.data_type()){case s.DT_UINT8:h=1,r=1,i=s._malloc(c*r),n.GetAttributeDataArrayForAllPoints(e,l,s.DT_UINT8,c*r,i),a=new Uint8Array(s.HEAPU8.buffer,i,c).slice();break;case s.DT_UINT16:h=3,r=2,i=s._malloc(c*r),n.GetAttributeDataArrayForAllPoints(e,l,s.DT_UINT16,c*r,i),a=new Uint16Array(s.HEAPU16.buffer,i,c).slice();break;case s.DT_FLOAT32:default:h=6,r=4,i=s._malloc(c*r),n.GetAttributeDataArrayForAllPoints(e,l,s.DT_FLOAT32,c*r,i),a=new Float32Array(s.HEAPF32.buffer,i,c).slice()}return s._free(i),{values:a,numComponents:l.num_components(),componentSizeInBytes:r,storageType:h,normalized:l.normalized()}},l={},c=i.attributes;for(var u in c)if(c.hasOwnProperty(u)&&Xh.hasOwnProperty(u)){var d=Xh[u],f=h(c[u]),p=f.numComponents*f.componentSizeInBytes;l[d]={values:f.values,buffer:f.values.buffer,size:p,offset:0,stride:p,count:o,components:f.numComponents,type:f.storageType,normalize:f.normalized}}return l.hasOwnProperty(ce)||Zh(l,a),Qh(t,l,r)}(t,y,_,b,m,d,a),m.destroy(y),m.destroy(b),m.destroy(v),f=!1}}}}c||(d=h.hasOwnProperty("indices")?jh(i[h.indices],n,!0):null,c=function(t,e,i,n,s,a,r){var o={},h=[];for(var l in e)e.hasOwnProperty(l)&&Xh.hasOwnProperty(l)&&(o[l]=e[l],h.push(l+":"+e[l]));h.sort();var c=h.join(),u=r[c];if(!u){var d={};for(var f in o){var p=n[e[f]],m=jh(p,s),_=s[p.bufferView],g=Xh[f],v=Wh(p.type)*Hh(p.componentType),y=_.hasOwnProperty("byteStride")?_.byteStride:v;d[g]={buffer:m.buffer,size:v,offset:m.byteOffset,stride:y,count:p.count,components:Wh(p.type),type:Gh(p.componentType),normalize:p.normalized}}d.hasOwnProperty(ce)||Zh(d,i),u=Qh(t,d,a),r[c]=u}return u}(t,h.attributes,d,i,n,a,r),l=function(t){if(!t.hasOwnProperty("mode"))return 4;switch(t.mode){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;case 4:return 4;case 5:return 5;case 6:return 6;default:return 4}}(h));var C=null;if(c){if((C=new oa(t)).vertexBuffer=c,C.primitive[0].type=l,C.primitive[0].base=0,C.primitive[0].indexed=null!==d,null!==d){var E;2!==(E=d instanceof Uint8Array?0:d instanceof Uint16Array?1:2)||t.extUintElement||(E=1,d=new Uint16Array(d));var P=new ws(t,E,d.length,0,d);C.indexBuffer[0]=P,C.primitive[0].count=d.length}else C.primitive[0].count=c.numVertices;C.materialIndex=h.material;var R=i[h.attributes.POSITION];if(C.aabb=Kh(R),f&&h.hasOwnProperty("targets")){var I=[];h.targets.forEach((function(t,s){var a={};t.hasOwnProperty("POSITION")&&(R=i[t.POSITION],a.deltaPositions=Yh(R,n),a.deltaPositionsType=6,a.aabb=Kh(R)),t.hasOwnProperty("NORMAL")&&(R=i[t.NORMAL],a.deltaNormals=Yh(R,n),a.deltaNormalsType=6),e.hasOwnProperty("extras")&&e.extras.hasOwnProperty("targetNames")?a.name=e.extras.targetNames[s]:a.name=s.toString(10),e.hasOwnProperty("weights")&&(a.defaultWeight=e.weights[s]),I.push(new mh(a))})),C.morph=new Ho(I,t)}}o.push(C)})),o},il=function(t,e,i){var n,s,a=["#ifdef MAPFLOAT","uniform float material_shininess;","#endif","","#ifdef MAPTEXTURE","uniform sampler2D texture_glossMap;","#endif","","void getGlossiness() {","\t\tdGlossiness = 1.0;","","#ifdef MAPFLOAT","\t\tdGlossiness *= material_shininess;","#endif","","#ifdef MAPTEXTURE","\t\tdGlossiness *= texture2D(texture_glossMap, $UV, textureBias).$CH;","#endif","","#ifdef MAPVERTEX","\t\tdGlossiness *= saturate(vVertexColor.$VC);","#endif","","\t\tdGlossiness = 1.0 - dGlossiness;","","\t\tdGlossiness += 0.0000001;","}"].join("\n"),r=["#ifdef MAPCOLOR","uniform vec3 material_specular;","#endif","","#ifdef MAPTEXTURE","uniform sampler2D texture_specularMap;","#endif","","void getSpecularity() {","\t\tdSpecularity = vec3(1.0);","","\t\t#ifdef MAPCOLOR","\t\t\t\tdSpecularity *= material_specular;","\t\t#endif","","\t\t#ifdef MAPTEXTURE","\t\t\t\tvec3 srgb = texture2D(texture_specularMap, $UV, textureBias).$CH;","\t\t\t\tdSpecularity *= vec3(pow(srgb.r, 2.2), pow(srgb.g, 2.2), pow(srgb.b, 2.2));","\t\t#endif","","\t\t#ifdef MAPVERTEX","\t\t\t\tdSpecularity *= saturate(vVertexColor.$VC);","\t\t#endif","}"].join("\n"),o=["#ifdef MAPFLOAT","uniform float material_clearCoatGlossiness;","#endif","","#ifdef MAPTEXTURE","uniform sampler2D texture_clearCoatGlossMap;","#endif","","void getClearCoatGlossiness() {","\t\tccGlossiness = 1.0;","","#ifdef MAPFLOAT","\t\tccGlossiness *= material_clearCoatGlossiness;","#endif","","#ifdef MAPTEXTURE","\t\tccGlossiness *= texture2D(texture_clearCoatGlossMap, $UV, textureBias).$CH;","#endif","","#ifdef MAPVERTEX","\t\tccGlossiness *= saturate(vVertexColor.$VC);","#endif","","\t\tccGlossiness = 1.0 - ccGlossiness;","","\t\tccGlossiness += 0.0000001;","}"].join("\n"),h=[0,0],l=[1,1],c=function(t,e,i){var n,s,a=t.texCoord;if(a)for(s=0;s0?i.name=t.name:i.name="node_"+e,t.hasOwnProperty("matrix")&&(Jh.data.set(t.matrix),Jh.getTranslation(tl),i.setLocalPosition(tl),Jh.getEulerAngles(tl),i.setLocalEulerAngles(tl),Jh.getScale(tl),i.setLocalScale(tl)),t.hasOwnProperty("rotation")){var n=t.rotation;i.setLocalRotation(n[0],n[1],n[2],n[3])}if(t.hasOwnProperty("translation")){var s=t.translation;i.setLocalPosition(s[0],s[1],s[2])}if(t.hasOwnProperty("scale")){var a=t.scale;i.setLocalScale(a[0],a[1],a[2])}return i},sl=function(t,e){var i="orthographic"===t.type?1:0,n=1===i?t.orthographic:t.perspective,s={enabled:!1,projection:i,nearClip:n.znear,aspectRatioMode:0};n.zfar&&(s.farClip=n.zfar),1===i?(s.orthoHeight=.5*n.ymag,n.ymag&&(s.aspectRatioMode=1,s.aspectRatio=n.xmag/n.ymag)):(s.fov=n.yfov*rt.RAD_TO_DEG,n.aspectRatio&&(s.aspectRatioMode=1,s.aspectRatio=n.aspectRatio));var a=new Bv(t.name);return a.addComponent("camera",s),a},al=function(t,e){var i={enabled:!1,type:"point"===t.type?"omni":t.type,color:t.hasOwnProperty("color")?new lt(t.color):lt.WHITE,range:t.hasOwnProperty("range")?t.range:9999,falloffMode:1,intensity:t.hasOwnProperty("intensity")?rt.clamp(t.intensity,0,2):1};t.hasOwnProperty("spot")&&(i.innerConeAngle=t.spot.hasOwnProperty("innerConeAngle")?t.spot.innerConeAngle*rt.RAD_TO_DEG:0,i.outerConeAngle=t.spot.hasOwnProperty("outerConeAngle")?t.spot.outerConeAngle*rt.RAD_TO_DEG:Math.PI/4);var n=new Bv(e.name);return n.rotateLocal(90,0,0),n.addComponent("light",i),n},rl=function(t,e,i,n){if(!e.hasOwnProperty("skins")||0===e.skins.length)return[];var s=new Map;return e.skins.map((function(a){return function(t,e,i,n,s,a){var r,o,h,l=e.joints,c=l.length,u=[];if(e.hasOwnProperty("inverseBindMatrices")){var d=e.inverseBindMatrices,f=jh(i[d],n,!0),p=[];for(r=0;r0){var s=i&&i.camera&&i.camera.preprocess,a=i&&i.camera&&i.camera.process||sl,r=i&&i.camera&&i.camera.postprocess;t.nodes.forEach((function(i,o){if(i.hasOwnProperty("camera")){var h=t.cameras[i.camera];if(h){s&&s(h);var l=a(h,e[o]);r&&r(h,l),l&&(n||(n=new Map),n.set(i,l))}}}))}return n}(e,l,s),f=ol(e,l,i,s),p=function(t,e,i,n){if(!t.hasOwnProperty("materials")||0===t.materials.length)return[];var s=i&&i.material&&i.material.preprocess,a=i&&i.material&&i.material.process||il,r=i&&i.material&&i.material.postprocess;return t.materials.map((function(t){s&&s(t);var i=a(t,e,n);return r&&r(t,i),i}))}(e,n.map((function(t){return t.resource})),s,h),m=function(t,e,i,n,s){if(!e.hasOwnProperty("meshes")||0===e.meshes.length||!e.hasOwnProperty("accessors")||0===e.accessors.length||!e.hasOwnProperty("bufferViews")||0===e.bufferViews.length)return[];var a={};return e.meshes.map((function(r){return el(t,r,e.accessors,i,n,s,a)}))}(t,e,i,a,h),_=rl(t,e,l,i),g=[],v=0;vi.byteLength)e("Invalid length found in glb header. Found "+a);else{for(var r=[],o=12;oi.byteLength)throw new Error("Invalid chunk length found in glb. Found "+h);var l=i.getUint32(o+4,!0),c=new Uint8Array(i.buffer,i.byteOffset+o+8,h);r.push({length:h,type:l,data:c}),o+=h+8}1===r.length||2===r.length?1313821514===r[0].type?r.length>1&&5130562!==r[1].type?e("Invalid chunk type found in glb file. Expected 0x004E4942, found 0x"+r[1].type.toString(16)):e(null,{gltfChunk:r[0].data,binaryChunk:2===r.length?r[1].data:null}):e("Invalid chunk type found in glb file. Expected 0x4E4F534A, found 0x"+r[0].type.toString(16)):e("Invalid number of chunks found in glb file.")}else e("Invalid version number found in glb header. Expected 2, found "+s);else e("Invalid magic number found in glb header. Expected 0x46546C67, found 0x"+n.toString(16))}(e,i):i(null,{gltfChunk:e,binaryChunk:null})},fl=function(t,e,i,n){var s=[],a=i&&i.bufferView&&i.bufferView.preprocess,r=i&&i.bufferView&&i.bufferView.processAsync||function(t,e,i){i(null,null)},o=i&&i.bufferView&&i.bufferView.postprocess,h=t.bufferViews?t.bufferViews.length:0;if(h)for(var l=function(e,i){var a=t.bufferViews[e];a.hasOwnProperty("byteStride")&&(i.byteStride=a.byteStride),s[e]=i,o&&o(a,i),0==--h&&n(null,s)},c=0;c=0?t.split("?")[0]:t},e.load=function(e,i,n){var s=this;Oh.fetchArrayBuffer(e.load,(function(a,r){a?i(a):t.parseAsync(s._getUrlWithoutParams(e.original),v.extractPath(e.load),r,s._device,n.registry,n.options,(function(t,e){t?i(t):i(null,new Uh(e,n,s._assets,s._defaultMaterial))}))}),n,this._maxRetries)},e.open=function(t,e,i){return e},e.patch=function(t,e){},t}(),ml=function(){function t(){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t});var i={retry:this.maxRetries>0,maxRetries:this.maxRetries};(t.load.startsWith("blob:")||t.load.startsWith("data:"))&&(".glb"===v.getExtension(t.original).toLowerCase()?i.responseType=ot.ResponseType.ARRAY_BUFFER:i.responseType=ot.ResponseType.JSON),ht.get(t.load,i,(function(i,n){i?e("Error loading animation resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){if(".glb"===v.getExtension(t).toLowerCase()){var i=pl.parse("filename.glb",e,null);if(i){var n=i.animations;return i.destroy(),n}return null}return this["_parseAnimationV"+e.animation.version](e)},e.patch=function(t,e){},e._parseAnimationV3=function(t){var e=t.animation,i=new ph;i.name=e.name,i.duration=e.duration;for(var n=0;n0,maxRetries:this.maxRetries};t.load.startsWith("blob:")&&(i.responseType=ot.ResponseType.JSON),ht.get(t.load,i,(function(i,n){i?e("Error loading animation clip resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){var i=e.name,n=e.duration,s=e.inputs.map((function(t){return new yh(1,t)})),a=e.outputs.map((function(t){return new yh(t.components,t.data)})),r=e.curves.map((function(t){return new vh([t.path],t.inputIndex,t.outputIndex,t.interpolation)}));return new bh(i,n,s,a,r)},e.patch=function(t,e){},t}(),gl=function(){function t(t){if(this._layers=[],this._parameters={},Array.isArray(t.layers))this._layers=t.layers;else for(var e in t.layers){for(var i=t.layers[e],n={name:i.name,blendType:i.blendType,weight:i.weight,states:[],transitions:[]},s=0;s0,maxRetries:this.maxRetries};t.load.startsWith("blob:")&&(i.responseType=ot.ResponseType.JSON),ht.get(t.load,i,(function(i,n){i?e("Error loading animation state graph resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return new gl(e)},e.patch=function(t,e){},t}(),yl=function(){function t(t){this.audio=void 0,this.buffer=void 0,t instanceof Audio?this.audio=t:this.buffer=t}return q(t,[{key:"duration",get:function(){var t=0;return this.buffer?t=this.buffer.duration:this.audio&&(t=this.audio.duration),t||0}}]),t}(),xl=function(){if("undefined"==typeof window)return!1;var t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(e>0)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);if(t.indexOf("Trident/")>0){var i=t.indexOf("rv:");return parseInt(t.substring(i+3,t.indexOf(".",i)),10)}return!1}(),bl={".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/x-wav",".mp4a":"audio/mp4",".m4a":"audio/mp4",".mp4":"audio/mp4",".aac":"audio/aac"},Sl=function(){function t(t){this.manager=t,this.maxRetries=0}var e=t.prototype;return e._isSupported=function(t){var e=v.getExtension(t);return!!bl[e]},e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t});var i=function(i){var n="Error loading audio url: "+t.original;i&&(n+=": "+(i.message||i)),console.warn(n),e(n)};if(this._createSound){if(!this._isSupported(t.original))return void i("Audio format for "+t.original+" not supported");this._createSound(t.load,(function(t){e(null,new yl(t))}),i)}else i(null)},e.open=function(t,e){return e},e.patch=function(t,e){},e._createSound=function(t,e,i){if(Jo()){var n=this.manager;if(!n.context)return void i("Audio manager has no audio context");var s={retry:this.maxRetries>0,maxRetries:this.maxRetries};(t.startsWith("blob:")||t.startsWith("data:"))&&(s.responseType=ot.ResponseType.ARRAY_BUFFER),ht.get(t,s,(function(t,s){t?i(t):n.context.decodeAudioData(s,e,i)}))}else{var a=null;try{a=new Audio}catch(t){return void i("No support for Audio element")}xl&&document.body.appendChild(a);a.onerror=function(){a.onerror=null,xl&&document.body.removeChild(a),i()},a.addEventListener("canplaythrough",(function t(){a.removeEventListener("canplaythrough",t),xl&&document.body.removeChild(a),e(a)})),a.src=t}},t}(),wl=function(){function t(){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t}),ht.get(t.load,{responseType:ot.ResponseType.ARRAY_BUFFER,retry:this.maxRetries>0,maxRetries:this.maxRetries},(function(i,n){i?e("Error loading binary resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return e},e.patch=function(t,e){},t}(),Tl=function(){function t(t){this._blobUrls={};for(var e=0,i=t.length;e=s)throw new Error("Invalid PAX header data format.");var l=parseInt(e.decode(new Uint8Array(t,i+r,h-r)),10),c=e.decode(new Uint8Array(t,i+h+1,l-(h-r)-2)).split("=");if(2!==c.length)throw new Error("Invalid PAX header data format.");0===c[1].length&&(c[1]=null),o.push({name:c[0],value:c[1]}),r+=l}return new n(o)},n.prototype.applyHeader=function(t){for(var e=0;e0&&(a=p.trim()+a.trim())}var m={name:a,start:l,size:o,url:c};return this._globalPaxHeader&&this._globalPaxHeader.applyHeader(m),this._paxHeader&&(this._paxHeader.applyHeader(m),this._paxHeader=null),m},s.prototype.untar=function(t){if(!e)return console.error("Cannot untar because TextDecoder interface is not available for this platform."),[];for(var i=[];this._hasNext();){var n=this._readNextFile();n&&(t&&n.name&&(n.name=t+n.name),i.push(n))}return i},t&&(self.onmessage=function(t){var e=t.data.id;try{var i=new s(t.data.arrayBuffer).untar(t.data.prefix);postMessage({id:e,files:i,arrayBuffer:t.data.arrayBuffer},[t.data.arrayBuffer])}catch(t){postMessage({id:e,error:t.toString()})}})}var Ml=null;var Cl=function(){function t(t){this._requestId=0,this._pendingRequests={},this._filenamePrefix=t,this._worker=new Worker(function(){if(!Ml){var t="("+Al.toString()+")(true)\n\n",e=new Blob([t],{type:"application/javascript"});Ml=URL.createObjectURL(e)}return Ml}()),this._worker.addEventListener("message",this._onMessage.bind(this))}var e=t.prototype;return e._onMessage=function(t){var e=t.data.id;if(this._pendingRequests[e]){var i=this._pendingRequests[e];if(delete this._pendingRequests[e],t.data.error)i(t.data.error);else{for(var n=t.data.arrayBuffer,s=0,a=t.data.files.length;s0},e.destroy=function(){this._worker&&(this._worker.terminate(),this._worker=null,this._pendingRequests=null)},t}();Al();var El=function(){function t(t){this._assets=t,this._worker=null,this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t});var i=this;ht.get(t.load,{responseType:ot.ResponseType.ARRAY_BUFFER,retry:this.maxRetries>0,maxRetries:this.maxRetries},(function(n,s){if(n)e("Error loading bundle resource "+t.original+": "+n);else try{i._untar(s,e)}catch(i){e("Error loading bundle resource "+t.original+": "+i)}}))},e._untar=function(t,e){var i=this;if(L.workers)i._worker||(i._worker=new Cl(i._assets.prefix)),i._worker.untar(t,(function(t,n){e(t,n),i._worker.hasPendingRequests()||(i._worker.destroy(),i._worker=null)}));else{var n=new Nh(t).untar(i._assets.prefix);e(null,n)}},e.open=function(t,e){return new Tl(e)},e.patch=function(t,e){},t}(),Pl=function(){function t(){}var e=t.prototype;return e.instantiateModelEntity=function(t){return null},e.instantiateRenderEntity=function(t){return null},t}(),Rl=function(){function t(t,e){this.glbParser=new pl(t,e,0),this.parsers={}}var e=t.prototype;return e._getUrlWithoutParams=function(t){return t.indexOf("?")>=0?t.split("?")[0]:t},e._getParser=function(t){var e=t?v.getExtension(this._getUrlWithoutParams(t)).toLowerCase().replace(".",""):null;return this.parsers[e]||this.glbParser},e.load=function(t,e,i){"string"==typeof t&&(t={load:t,original:t}),this._getParser(t.original).load(t,e,i)},e.open=function(t,e,i){return this._getParser(t).open(t,e,i)},e.patch=function(t,e){},t}(),Il=function(){function t(){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t}),ht.get(t.load,{retry:this.maxRetries>0,maxRetries:this.maxRetries},(function(i,n){i?e("Error loading css resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return e},e.patch=function(t,e){},t}();var Ll=function(){function t(t,e,i){this._device=t,this._registry=e,this._loader=i}var e=t.prototype;return e.load=function(t,e,i){this.loadAssets(i,e)},e.open=function(t,e,i){return i?i.resource:null},e.patch=function(t,e){this.loadAssets(t,(function(i,n){i&&(e.fire("error",t),e.fire("error:"+t.id,i,t),t.fire("error",t))}))},e.getAssetIds=function(t){var e=[];if(e[0]=t.file,(t.loadFaces||!t.file)&&t.data&&t.data.textures)for(var i=0;i<6;++i)e[i+1]=t.data.textures[i];else e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=null;return e},e.compareAssetIds=function(t,e){return t&&e?parseInt(t,10)===t||"string"==typeof t?t===e:t.url===e.url:null!==t==(null!==e)},e.update=function(t,e,i){var n,s,a,r=t.data||{},o=t._handlerState.assets,h=t._resources,l=[null,null,null,null,null,null,null],c=function(){return r.hasOwnProperty("type")?r.type:r.hasOwnProperty("rgbm")?r.rgbm?We:Ve:null};if(t.loaded&&i[0]===o[0])l[1]=h[1]||null,l[2]=h[2]||null,l[3]=h[3]||null,l[4]=h[4]||null,l[5]=h[5]||null,l[6]=h[6]||null;else if(i[0])for(n=i[0].resource,a=0;a<6;++a)l[a+1]=new Bi(this._device,{name:t.name+"_prelitCubemap"+(n.width>>a),cubemap:!0,type:c()||n.type,width:n.width>>a,height:n.height>>a,format:n.format,levels:[n._levels[a]],fixCubemapSeams:!0,addressU:1,addressV:1,mipmaps:0===a});var u=i.slice(1);if(t.loaded&&this.cmpArrays(u,o.slice(1)))l[0]=h[0]||null;else if(-1===u.indexOf(null)){var d=u.map((function(t){return t.resource})),f=[];for(s=0;s0,maxRetries:this.maxRetries},(function(i,s){if(i)e("Error loading font resource: "+t.original+" ["+i+"]");else{var a=Bl(s);n._loadTextures(t.load.replace(".json",".png"),a,(function(t,i){if(t)return e(t);e(null,{data:a,textures:i})}))}})):(i&&i.data&&(i.data=Bl(i.data)),this._loadTextures(t.load,i&&i.data,e))},e._loadTextures=function(t,e,i){for(var n=e.info.maps.length,s=0,a=null,r=new Array(n),o=this._loader,h=function(e){var h=function(t,o){if(!a){if(t)return a=t,i(t);o.upload(),r[e]=o,++s===n&&i(null,r)}};0===e?o.load(t,"texture",h):o.load(t.replace(".png",e+".png"),"texture",h)},l=0;l0,maxRetries:e},(function(e,n){if(e){var s="Error while loading scene JSON "+t.original;e.message?(s+=": "+e.message,e.stack&&(s+="\n"+e.stack)):s+=": "+e,i(s)}else i(e,n)}))},Xl=function(){function t(t){this._app=t,this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){Hl(t,this.maxRetries,e)},e.open=function(t,e){this._app.systems.script.preloading=!0;var i=new Gl(this._app,!1).parse(e);return this._app.systems.script.preloading=!1,i},t}(),ql=function(){function t(){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t}),ht.get(t.load,{retry:this.maxRetries>0,maxRetries:this.maxRetries},(function(i,n){i?e("Error loading html resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return e},e.patch=function(t,e){},t}(),jl=function(){function t(){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t});var i={retry:this.maxRetries>0,maxRetries:this.maxRetries};t.load.startsWith("blob:")&&(i.responseType=ot.ResponseType.JSON),ht.get(t.load,i,(function(i,n){i?e("Error loading JSON resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return e},e.patch=function(t,e){},t}(),Yl=function(){function t(t,e,i,n,s){this.propertyName=t,this.parent=e,this._scope=s,this._registry=i,this.id=null,this.url=null,this.asset=null,this._onAssetLoad=n.load,this._onAssetAdd=n.add,this._onAssetRemove=n.remove,this._onAssetUnload=n.unload}var e=t.prototype;return e._bind=function(){this.id&&(this._onAssetLoad&&this._registry.on("load:"+this.id,this._onLoad,this),this._onAssetAdd&&this._registry.once("add:"+this.id,this._onAdd,this),this._onAssetRemove&&this._registry.on("remove:"+this.id,this._onRemove,this),this._onAssetUnload&&this._registry.on("unload:"+this.id,this._onUnload,this)),this.url&&(this._onAssetLoad&&this._registry.on("load:url:"+this.url,this._onLoad,this),this._onAssetAdd&&this._registry.once("add:url:"+this.url,this._onAdd,this),this._onAssetRemove&&this._registry.on("remove:url:"+this.url,this._onRemove,this))},e._unbind=function(){this.id&&(this._onAssetLoad&&this._registry.off("load:"+this.id,this._onLoad,this),this._onAssetAdd&&this._registry.off("add:"+this.id,this._onAdd,this),this._onAssetRemove&&this._registry.off("remove:"+this.id,this._onRemove,this),this._onAssetUnload&&this._registry.off("unload:"+this.id,this._onUnload,this)),this.url&&(this._onAssetLoad&&this._registry.off("load:"+this.url,this._onLoad,this),this._onAssetAdd&&this._registry.off("add:"+this.url,this._onAdd,this),this._onAssetRemove&&this._registry.off("remove:"+this.url,this._onRemove,this))},e._onLoad=function(t){this._onAssetLoad.call(this._scope,this.propertyName,this.parent,t)},e._onAdd=function(t){this.asset=t,this._onAssetAdd.call(this._scope,this.propertyName,this.parent,t)},e._onRemove=function(t){this._onAssetRemove.call(this._scope,this.propertyName,this.parent,t),this.asset=null},e._onUnload=function(t){this._onAssetUnload.call(this._scope,this.propertyName,this.parent,t)},q(t,[{key:"id",get:function(){return this._id},set:function(t){if(this.url)throw Error("Can't set id and url");this._unbind(),this._id=t,this.asset=this._registry.get(this._id),this._bind()}},{key:"url",get:function(){return this._url},set:function(t){if(this.id)throw Error("Can't set id and url");this._unbind(),this._url=t,this.asset=this._registry.getByUrl(this._url),this._bind()}}]),t}(),Kl=function(){function t(){this.removeInvalid=!0,this.valid=!0,this.enumValidators={occludeSpecular:this._createEnumValidator([0,1,2]),cull:this._createEnumValidator([0,1,2,3]),blendType:this._createEnumValidator([0,1,2,3,4,5,6,7,8,9,10]),depthFunc:this._createEnumValidator([0,1,2,3,4,5,6,7]),shadingModel:this._createEnumValidator([0,1])}}var e=t.prototype;return e.setInvalid=function(t,e){this.valid=!1,this.removeInvalid&&delete e[t]},e.validate=function(t){var e=Jn,i="path"===t.mappingFormat;for(var n in t){var s=e[n];if(s)if(s.startsWith("enum")){var a=s.split(":")[1];this.enumValidators[a]&&(this.enumValidators[a](t[n])||this.setInvalid(n,t))}else if("number"===s)"number"!=typeof t[n]&&this.setInvalid(n,t);else if("boolean"===s)"boolean"!=typeof t[n]&&this.setInvalid(n,t);else if("string"===s)"string"!=typeof t[n]&&this.setInvalid(n,t);else if("vec2"===s)t[n]instanceof Array&&2===t[n].length||this.setInvalid(n,t);else if("rgb"===s)t[n]instanceof Array&&3===t[n].length||this.setInvalid(n,t);else if("texture"===s)i?"string"!=typeof t[n]&&null!==t[n]&&(t[n]instanceof Bi||this.setInvalid(n,t)):"number"!=typeof t[n]&&null!==t[n]&&(t[n]instanceof Bi||this.setInvalid(n,t));else if("boundingbox"===s)t[n].center&&t[n].center instanceof Array&&3===t[n].center.length||this.setInvalid(n,t),t[n].halfExtents&&t[n].halfExtents instanceof Array&&3===t[n].halfExtents.length||this.setInvalid(n,t);else if("cubemap"===s)"number"!=typeof t[n]&&null!==t[n]&&void 0!==t[n]&&(t[n]instanceof Bi&&t[n].cubemap||this.setInvalid(n,t));else if("chunks"===s)for(var r=Object.keys(t[n]),o=0;o=0}},t}(),Zl=function(){function t(){this._validator=null}var e=t.prototype;return e.parse=function(t){var e=this.migrate(t),i=this._validate(e),n=new os;return this.initialize(n,i),n},e.initialize=function(t,e){for(var i in e.validated||(e=this._validate(e)),e.chunks&&(t.chunks=j({},e.chunks)),e){var n=Jn[i],s=e[i];if("vec2"===n)t[i]=new mt(s[0],s[1]);else if("rgb"===n)t[i]=new lt(s[0],s[1],s[2]);else if("texture"===n)s instanceof Bi?t[i]=s:t[i]instanceof Bi&&"number"==typeof s&&s>0||(t[i]=null);else if("cubemap"===n)s instanceof Bi?t[i]=s:t[i]instanceof Bi&&"number"==typeof s&&s>0||(t[i]=null),"cubeMap"!==i||s||(t.prefilteredCubemaps=null);else if("boundingbox"===n){var a=new ft(s.center[0],s.center[1],s.center[2]),r=new ft(s.halfExtents[0],s.halfExtents[1],s.halfExtents[2]);t[i]=new Pt(a,r)}else t[i]=e[i]}t.update()},e.migrate=function(t){var e;void 0===t.shadingModel&&("blinn"===t.shader?t.shadingModel=1:t.shadingModel=0),t.shader&&delete t.shader,t.mapping_format&&(t.mappingFormat=t.mapping_format,delete t.mapping_format);var i=[["bumpMapFactor","bumpiness"],["aoUvSet","aoMapUv"],["aoMapVertexColor","aoVertexColor"],["diffuseMapVertexColor","diffuseVertexColor"],["emissiveMapVertexColor","emissiveVertexColor"],["specularMapVertexColor","specularVertexColor"],["metalnessMapVertexColor","metalnessVertexColor"],["opacityMapVertexColor","opacityVertexColor"],["glossMapVertexColor","glossVertexColor"],["lightMapVertexColor","lightVertexColor"],["diffuseMapTint","diffuseTint"],["specularMapTint","specularTint"],["emissiveMapTint","emissiveTint"],["metalnessMapTint","metalnessTint"]];for(e=0;e0,maxRetries:this.maxRetries},(function(i,n){i?e&&e("Error loading material: "+t.original+" ["+i+"]"):e&&(n._engine=!0,e(null,n))}))},e.open=function(t,e){var i=this._parser.parse(e);return e._engine&&(i._data=e,delete e._engine),i},e._createPlaceholders=function(){this._placeholderTextures={};var t={white:[255,255,255,255],gray:[128,128,128,255],black:[0,0,0,255],normal:[128,128,255,255]};for(var e in t)if(t.hasOwnProperty(e)){this._placeholderTextures[e]=new Bi(this._device,{width:2,height:2,format:7}),this._placeholderTextures[e].name="placeholder";for(var i=this._placeholderTextures[e].lock(),n=0;n<4;n++)for(var s=0;s<4;s++)i[4*n+s]=t[e][s];this._placeholderTextures[e].unlock()}},e.patch=function(t,e){t.resource._data&&(t._data=t.resource._data,delete t.resource._data),t.data.name=t.name,t.resource.name=t.name,this._bindAndAssignAssets(t,e),t.off("unload",this._onAssetUnload,this),t.on("unload",this._onAssetUnload,this)},e._onAssetUnload=function(t){delete t.data.parameters,delete t.data.chunks,delete t.data.name},e._assignTexture=function(t,e,i){e.resource[t]=i},e._getPlaceholderTexture=function(t){this._placeholderTextures||this._createPlaceholders();var e=$l[t];return this._placeholderTextures[e]},e._assignPlaceholderTexture=function(t,e){e.resource[t]=this._getPlaceholderTexture(t)},e._onTextureLoad=function(t,e,i){this._assignTexture(t,e,i.resource),e.resource.update()},e._onTextureAdd=function(t,e,i){this._assets.load(i)},e._onTextureRemoveOrUnload=function(t,e,i){var n=e.resource;n&&e.resource[t]===i.resource&&(this._assignPlaceholderTexture(t,e),n.update())},e._assignCubemap=function(t,e,i){e.resource[t]=i[0],"cubeMap"===t&&(e.resource.prefilteredCubemaps=i.slice(1))},e._onCubemapLoad=function(t,e,i){this._assignCubemap(t,e,i.resources),this._parser.initialize(e.resource,e.data)},e._onCubemapAdd=function(t,e,i){0===e.data.shadingModel&&(e.loadFaces=!0),this._assets.load(i)},e._onCubemapRemoveOrUnload=function(t,e,i){var n=e.resource;e.data.prefilteredCubeMap128===i.resources[1]&&(this._assignCubemap(t,e,[null,null,null,null,null,null,null]),n.update())},e._bindAndAssignAssets=function(t,e){var i,n,s,a=this._parser.migrate(t.data),r=t.resource,o="path"===a.mappingFormat,h=ts;for(i=0;i0){for(var c=i.blendIndices.data[4*h+l],u=!0,d=0;dn)return!1;for(var f=0;f=0;n--)if(l[n].boneNames.length>i){var f=l.splice(n,1)[0],p=[];for(s=0;s=0;a--)u[a].mesh===_.originalMesh&&(u.push({mesh:o,node:u[a].node}),e&&e.push({material:e[a].material,path:e[a].path}));for(s=0;s=0;a--)u[a].mesh===_.originalMesh&&(u.splice(a,1),e&&e.splice(a,1))}!function(t){for(var e=t.vertices,i=t.skins,n=t.meshes,s=t.meshInstances,a=0;a0&&ic(s,null,this._device.getBoneLimit());for(i=0;i0&&(h>65535&&this._device.extUintElement?(s=new ws(this._device,2,r),a=new Uint32Array(s.lock())):(s=new ws(this._device,1,r),a=new Uint16Array(s.lock()))),{buffer:s,data:a}},e._parseMeshes=function(t,e,i,n,s,a){for(var r=t.model,o=[],h=0,l=0;l0,maxRetries:this.maxRetries};(t.load.startsWith("blob:")||t.load.startsWith("data:"))&&(".glb"===v.getExtension(t.original).toLowerCase()?i.responseType=ot.ResponseType.ARRAY_BUFFER:i.responseType=ot.ResponseType.JSON),ht.get(t.load,i,(function(i,n){e&&(i?e("Error loading model: "+t.original+" ["+i+"]"):e(null,n))}))},e.open=function(t,e){for(var i=0;i0?console.assert("Script Ordering Error. Contact support@playcanvas.com"):t._types.push(e)};var e=t.prototype;return e.load=function(e,i){var n=this;"string"==typeof e&&(e={load:e,original:e});var s=this;_c.app=this._app,this._loadScript(e.load,(function(e,a,r){if(e)i(e);else if(_c.legacy){var o=null;t._types.length&&(o=t._types.pop()),o?n._scripts[a]=o:o=null,i(null,o,r)}else{for(var h={},l=0;l0,maxRetries:this.maxRetries},(function(i,n){i?e("Error loading shader resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return e},e.patch=function(t,e){},t}(),yc=[0,0,1,0,0,1,0,0,1,0,0,1],xc=[0,1,3,2,3,1],bc=function(t){function e(e,i){var n;return(n=t.call(this)||this)._device=e,n._pixelsPerUnit=i&&void 0!==i.pixelsPerUnit?i.pixelsPerUnit:1,n._renderMode=i&&void 0!==i.renderMode?i.renderMode:0,n._atlas=i&&void 0!==i.atlas?i.atlas:null,n._frameKeys=i&&void 0!==i.frameKeys?i.frameKeys:null,n._meshes=[],n._updatingProperties=!1,n._meshesDirty=!1,n._atlas&&n._frameKeys&&n._createMeshes(),n}Y(e,t);var i=e.prototype;return i._createMeshes=function(){for(var t=this._meshes.length,e=0;e0,maxRetries:this.maxRetries},(function(t,i){t?e(t):e(null,i)}))},e.open=function(t,e){var i=new bc(this._device);return t&&(i.__data=e),i},e.patch=function(t,e){var i=t.resource;if(i.__data&&(t.data.pixelsPerUnit=i.__data.pixelsPerUnit,t.data.renderMode=i.__data.renderMode,t.data.frameKeys=i.__data.frameKeys,i.__data.textureAtlasAsset)){var n=e.getByUrl(i.__data.textureAtlasAsset);n?t.data.textureAtlasAsset=n.id:console.warn("Could not find textureatlas with url: "+i.__data.textureAtlasAsset)}i.startUpdate(),i.renderMode=t.data.renderMode,i.pixelsPerUnit=t.data.pixelsPerUnit,i.frameKeys=t.data.frameKeys,this._updateAtlas(t),i.endUpdate(),t.off("change",this._onAssetChange,this),t.on("change",this._onAssetChange,this)},e._updateAtlas=function(t){var e=t.resource;if(t.data.textureAtlasAsset){this._assets.off("load:"+t.data.textureAtlasAsset,Sc,t),this._assets.on("load:"+t.data.textureAtlasAsset,Sc,t);var i=this._assets.get(t.data.textureAtlasAsset);i&&i.resource?e.atlas=i.resource:i?this._assets.load(i):(this._assets.off("add:"+t.data.textureAtlasAsset,wc,t),this._assets.on("add:"+t.data.textureAtlasAsset,wc,t))}else e.atlas=null},e._onAssetChange=function(t,e,i,n){"data"===e&&i&&i.textureAtlasAsset&&n&&i.textureAtlasAsset!==n.textureAtlasAsset&&(this._assets.off("load:"+n.textureAtlasAsset,Sc,t),this._assets.off("add:"+n.textureAtlasAsset,wc,t))},t}(),Ac=function(){function t(t,e){this._app=t,this._data=e,this._templateRoot=null}var e=t.prototype;return e.instantiate=function(){return this._templateRoot||this._parseTemplate(),this._templateRoot.clone()},e._parseTemplate=function(){var t=new Gl(this._app,!0);this._templateRoot=t.parse(this._data)},t}(),Mc=function(){function t(t){this._app=t,this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t});var i={retry:this.maxRetries>0,maxRetries:this.maxRetries};ht.get(t.load,i,(function(i,n){i?e("Error requesting template: "+t.original):e(i,n)}))},e.open=function(t,e){return new Ac(this._app,e)},t}(),Cc=function(){function t(){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t}),ht.get(t.load,{retry:this.maxRetries>0,maxRetries:this.maxRetries},(function(i,n){i?e("Error loading text resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return e},e.patch=function(t,e){},t}(),Ec=function(t){function e(){var e;return(e=t.call(this)||this)._texture=null,e._frames=null,e}Y(e,t);var i=e.prototype;return i.setFrame=function(t,e){var i=this._frames[t];i?(i.rect.copy(e.rect),i.pivot.copy(e.pivot),i.border.copy(e.border)):(i={rect:e.rect.clone(),pivot:e.pivot.clone(),border:e.border.clone()},this._frames[t]=i),this.fire("set:frame",t.toString(),i)},i.removeFrame=function(t){var e=this._frames[t];e&&(delete this._frames[t],this.fire("remove:frame",t.toString(),e))},i.destroy=function(){this._texture&&this._texture.destroy()},q(e,[{key:"texture",get:function(){return this._texture},set:function(t){this._texture=t,this.fire("set:texture",t)}},{key:"frames",get:function(){return this._frames},set:function(t){this._frames=t,this.fire("set:frames",t)}}]),e}(m),Pc={repeat:0,clamp:1,mirror:2},Rc={nearest:0,linear:1,nearest_mip_nearest:2,linear_mip_nearest:4,nearest_mip_linear:3,linear_mip_linear:5},Ic=/^data\.frames\.(\d+)$/,Lc=function(){function t(t){this._loader=t,this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t});var i=this,n=this._loader.getHandler("texture");if(".json"!==v.getExtension(t.original))return n.load(t,e);ht.get(t.load,{retry:this.maxRetries>0,maxRetries:this.maxRetries},(function(n,s){if(n)e(n);else{var a=t.original.replace(".json",".png");i._loader.load(a,"texture",(function(t,i){t?e(t):e(null,{data:s,texture:i})}))}}))},e.open=function(t,e){var i=new Ec;if(e.texture&&e.data)i.texture=e.texture,i.__data=e.data;else{var n=this._loader.getHandler("texture").open(t,e);if(!n)return null;i.texture=n}return i},e.patch=function(t,e){t.resource.__data&&(void 0!==t.resource.__data.minfilter&&(t.data.minfilter=t.resource.__data.minfilter),void 0!==t.resource.__data.magfilter&&(t.data.magfilter=t.resource.__data.magfilter),void 0!==t.resource.__data.addressu&&(t.data.addressu=t.resource.__data.addressu),void 0!==t.resource.__data.addressv&&(t.data.addressv=t.resource.__data.addressv),void 0!==t.resource.__data.mipmaps&&(t.data.mipmaps=t.resource.__data.mipmaps),void 0!==t.resource.__data.anisotropy&&(t.data.anisotropy=t.resource.__data.anisotropy),void 0!==t.resource.__data.rgbm&&(t.data.rgbm=!!t.resource.__data.rgbm),t.data.frames=t.resource.__data.frames,delete t.resource.__data);var i=t.resource.texture;if(i&&(i.name=t.name,t.data.hasOwnProperty("minfilter")&&i.minFilter!==Rc[t.data.minfilter]&&(i.minFilter=Rc[t.data.minfilter]),t.data.hasOwnProperty("magfilter")&&i.magFilter!==Rc[t.data.magfilter]&&(i.magFilter=Rc[t.data.magfilter]),t.data.hasOwnProperty("addressu")&&i.addressU!==Pc[t.data.addressu]&&(i.addressU=Pc[t.data.addressu]),t.data.hasOwnProperty("addressv")&&i.addressV!==Pc[t.data.addressv]&&(i.addressV=Pc[t.data.addressv]),t.data.hasOwnProperty("mipmaps")&&i.mipmaps!==t.data.mipmaps&&(i.mipmaps=t.data.mipmaps),t.data.hasOwnProperty("anisotropy")&&i.anisotropy!==t.data.anisotropy&&(i.anisotropy=t.data.anisotropy),t.data.hasOwnProperty("rgbm"))){var n=t.data.rgbm?We:Ve;i.type!==n&&(i.type=n)}t.resource.texture=i;var s={};for(var a in t.data.frames){var r=t.data.frames[a];s[a]={rect:new _t(r.rect),pivot:new mt(r.pivot),border:new _t(r.border)}}t.resource.frames=s,t.off("change",this._onAssetChange,this),t.on("change",this._onAssetChange,this)},e._onAssetChange=function(t,e,i){var n;if("data"===e||"data.frames"===e){var s={};for(var a in i.frames)n=i.frames[a],s[a]={rect:new _t(n.rect),pivot:new mt(n.pivot),border:new _t(n.border)};t.resource.frames=s}else{var r=e.match(Ic);if(r){var o=r[1];i?(t.resource.frames[o]?((n=t.resource.frames[o]).rect.set(i.rect[0],i.rect[1],i.rect[2],i.rect[3]),n.pivot.set(i.pivot[0],i.pivot[1]),n.border.set(i.border[0],i.border[1],i.border[2],i.border[3])):t.resource.frames[o]={rect:new _t(i.rect),pivot:new mt(i.pivot),border:new _t(i.border)},t.resource.fire("set:frame",o,t.resource.frames[o])):t.resource.frames[o]&&(delete t.resource.frames[o],t.resource.fire("remove:frame",o))}}},t}();function Dc(){var t,e,i,n=0,s=1,a=2,r=3,o=8,h=9,l=10,c=11,u=12,d=13,f=14,p=16,m={astc:l,dxt:a,etc1:n,etc2:n,pvr:o,atc:c,none:f},_={astc:l,dxt:r,etc1:p,etc2:s,pvr:h,atc:u,none:p},g=21,v=22,y=23,x=8,b=10,S=26,w=27,T=28,A=29,M=30,C=7,E=3,P=5,R=function(t,e){switch(t){case n:return e.formats.etc1?g:v;case s:return y;case a:return x;case r:return b;case o:return S;case h:return w;case l:return T;case c:return A;case u:return M;case d:return C;case f:return E;case p:return P}},I=function(t){for(var e=function(t,e){var i=t*(2/255)-1,n=e*(2/255)-1,s=Math.sqrt(1-Math.min(1,i*i+n*n));return Math.max(0,Math.min(255,Math.floor(.5*(s+1)*255)))},i=0;i>3}return e},D=function(){return"undefined"!=typeof performance?performance.now():0},k=function(t,n,s){if(s){if(t.formats.astc)return"astc"}else if(n){if(t.formats.etc2)return"etc2"}else if(t.formats.etc1||t.formats.etc2)return"etc1";return function(e){for(var i=0;i0?this.clients.shift().run(s):this.queue.push(s)}},e.enqueueClient=function(t){this.queue.length>0?t.run(this.queue.shift()):this.clients.push(t)},e.handleResponse=function(t,e,i){var n=this.callbacks[t];if(e)for(var s=0;s0,maxRetries:t.maxRetries};if(t.glueUrl&&t.wasmUrl&&function(){try{if("object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate){var t=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(t instanceof WebAssembly.Module)return new WebAssembly.Instance(t)instanceof WebAssembly.Instance}}catch(t){}return!1}()){var s=null,a=null;ht.get(t.glueUrl,n,(function(t,n){t?e(t):a?i(n,a):s=n}));var r=fetch(t.wasmUrl),o=function(){r.then((function(t){return t.arrayBuffer()})).then((function(t){return WebAssembly.compile(t)})).then((function(t){s?i(s,t):a=t})).catch((function(t){e(t,null)}))};WebAssembly.compileStreaming?WebAssembly.compileStreaming(r).then((function(t){s?i(s,t):a=t})).catch((function(t){o()})):o()}else ht.get(t.fallbackUrl,n,(function(t,n){t?e(t,null):i(n,null)}))}(t,(function(t,e){if(t)console.error("failed to initialize basis worker: "+t);else for(var i=0;i0&&++r<=o){var i=100*Math.pow(2,r);console.log("Error loading Texture from: '"+e+"' - Retrying in "+i+"ms...");var h=t.indexOf("?")>=0?"&":"?";a=setTimeout((function(){s.src=t+h+"retry="+Date.now(),a=null}),i)}else n("Error loading Texture from: '"+e+"'")},s.src=t},e._loadImageBitmap=function(t,e,i,n){var s={cache:!0,responseType:"blob",retry:this.maxRetries>0,maxRetries:this.maxRetries};ht.get(t,s,(function(t,e){t?n(t):createImageBitmap(e,{premultiplyAlpha:"none"}).then((function(t){n(null,t)})).catch((function(t){n(t)}))}))},t}(),jc=[1481919403,3140563232,169478669],Yc={33776:8,33778:9,33779:Jt,36196:re,37492:22,37496:23,35840:26,35841:oe,35842:27,35843:he,32849:6,32856:7,35905:19,35907:20,35898:18,34843:te,34842:ee};var Kc=function(){function t(t){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e,i){Oh.fetchArrayBuffer(t.load,e,i,this.maxRetries)},e.open=function(t,e,i){var n=this.parse(e);if(!n)return null;var s=new Bi(i,{name:t,addressU:n.cubemap?1:0,addressV:n.cubemap?1:0,width:n.width,height:n.height,format:n.format,cubemap:n.cubemap,levels:n.levels});return s.upload(),s},e.parse=function(t){var e=new Uint32Array(t);if(jc[0]!==e[0]||jc[1]!==e[1]||jc[2]!==e[2])return null;var i={endianness:e[3],glType:e[4],glTypeSize:e[5],glFormat:e[6],glInternalFormat:e[7],glBaseInternalFormat:e[8],pixelWidth:e[9],pixelHeight:e[10],pixelDepth:e[11],numberOfArrayElements:e[12],numberOfFaces:e[13],numberOfMipmapLevels:e[14],bytesOfKeyValueData:e[15]};if(i.pixelDepth>1)return null;if(0!==i.numberOfArrayElements)return null;var n=Yc[i.glInternalFormat];if(void 0===n)return null;for(var s,a,r,o=16+i.bytesOfKeyValueData/4,h=i.numberOfFaces>1,l=[],c=0;c<(i.numberOfMipmapLevels||1);c++){var u=e[o++];h&&l.push([]);for(var d=h?l[c]:l,f=0;f<(h?6:1);++f)d.push((s=t,a=4*o,r=u,18===n?new Uint32Array(s,a,r/4):new Uint8Array(s,a,r))),o+=u+3>>2}return{format:n,width:i.pixelWidth,height:i.pixelHeight,levels:l,cubemap:h}},t}(),Zc=166,$c=function(){function t(t,e){this.maxRetries=0,this.device=e}var e=t.prototype;return e.load=function(t,e,i){var n=this;Oh.fetchArrayBuffer(t.load,(function(s,a){s?e(s,a):n.parse(a,t,e,i)}),i,this.maxRetries)},e.open=function(t,e,i){var n=new Bi(i,{name:t,addressU:e.cubemap?1:0,addressV:e.cubemap?1:0,width:e.width,height:e.height,format:e.format,cubemap:e.cubemap,levels:e.levels});return n.upload(),n},e.parse=function(t,e,i,n){var s=new J(t),a=[s.readU32be(),s.readU32be(),s.readU32be()];if(2873840728!==a[0]||540160187!==a[1]||218765834!==a[2])return null;for(var r={vkFormat:s.readU32(),typeSize:s.readU32(),pixelWidth:s.readU32(),pixelHeight:s.readU32(),pixelDepth:s.readU32(),layerCount:s.readU32(),faceCount:s.readU32(),levelCount:s.readU32(),supercompressionScheme:s.readU32()},o={dfdByteOffset:s.readU32(),dfdByteLength:s.readU32(),kvdByteOffset:s.readU32(),kvdByteLength:s.readU32(),sgdByteOffset:s.readU64(),sgdByteLength:s.readU64()},h=[],l=0;l1});for(var b,S=128,w=u?6:1,T=l===d?8:16,A=0;A32767)return this._readPixelsFlat(t,e,i);var s=[0,0,0,0];if(t.readArray(s),2!==s[0]||2!==s[1]||0!=(128&s[2]))return t.skip(-4),this._readPixelsFlat(t,e,i);var a,r,o,h,l,c,u=new ArrayBuffer(e*i*4),d=new Uint8Array(u),f=n?0:4*e*(i-1);for(r=0;r128){if(a+(l-=128)>e)return null;for(c=t.readU8(),o=0;oe)return null;for(o=0;o=0?t.split("?")[0]:t},e._getParser=function(t){var e=v.getExtension(this._getUrlWithoutParams(t)).toLowerCase().replace(".","");return this.parsers[e]||this.imgParser},e.load=function(t,e,i){"string"==typeof t&&(t={load:t,original:t}),this._getParser(t.original).load(t,e,i)},e.open=function(t,e,i){if(t){var n=this._getParser(t).open(t,e,this._device);return null===n?n=new Bi(this._device,{width:4,height:4,format:6}):(!function(t){var e=Math.log2(Math.max(t._width,t._height))+1;if(!(7!==t._format&&t._format!==ne||t._volume||t._compressed||1===t._levels.length||t._levels.length===e||(i=t._cubemap?t._levels[0][0]:t._levels[0],i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement))){for(var i,n=function(t,e,i){for(var n=Math.max(1,t>>1),s=Math.max(1,e>>1),a=new i.constructor(n*s*4),r=Math.floor(t/n),o=Math.floor(e/s),h=r*o,l=0;l>s-1),r=Math.max(1,t._height>>s-1);if(t._cubemap){for(var o=[],h=0;h<6;++h)o.push(n(a,r,t._levels[s-1][h]));t._levels.push(o)}else t._levels.push(n(a,r,t._levels[s-1]))}t._levelsUpdated=t._cubemap?[[!0,!0,!0,!0,!0,!0]]:[!0]}}(n),e.unswizzledGGGR&&(i.file.variants.basis.opt&=-9)),n}},e.patch=function(t,e){var i=t.resource;if(i){t.name&&t.name.length>0&&(i.name=t.name);var n=t.data;n.hasOwnProperty("minfilter")&&(i.minFilter=eu[n.minfilter]),n.hasOwnProperty("magfilter")&&(i.magFilter=eu[n.magfilter]),i.cubemap||(n.hasOwnProperty("addressu")&&(i.addressU=tu[n.addressu]),n.hasOwnProperty("addressv")&&(i.addressV=tu[n.addressv])),n.hasOwnProperty("mipmaps")&&(i.mipmaps=n.mipmaps),n.hasOwnProperty("anisotropy")&&(i.anisotropy=n.anisotropy),n.hasOwnProperty("flipY")&&(i.flipY=!!n.flipY),n.hasOwnProperty("type")?i.type=iu[n.type]:n.hasOwnProperty("rgbm")&&n.rgbm?i.type=We:t.file&&0!=(8&t.file.opt)&&(i.type=He)}},q(t,[{key:"crossOrigin",get:function(){return this.imgParser.crossOrigin},set:function(t){this.imgParser.crossOrigin=t}},{key:"maxRetries",get:function(){return this.imgParser.maxRetries},set:function(t){for(var e in this.imgParser.maxRetries=t,this.parsers)this.parsers.hasOwnProperty(e)&&(this.parsers[e].maxRetries=t)}}]),t}(),au=function(){function t(t){void 0===t&&(t=null),this._index={},this._key=t}var e=t.prototype;return e.addItem=function(t){for(var e,i=Q(t.tags._list);!(e=i()).done;){var n=e.value;this.add(n,t)}},e.removeItem=function(t){for(var e,i=Q(t.tags._list);!(e=i()).done;){var n=e.value;this.remove(n,t)}},e.add=function(t,e){this._index[t]&&-1!==this._index[t].list.indexOf(e)||(this._index[t]||(this._index[t]={list:[]},this._key&&(this._index[t].keys={})),this._index[t].list.push(e),this._key&&(this._index[t].keys[e[this._key]]=e))},e.remove=function(t,e){if(this._index[t]&&(!this._key||this._index[t].keys[e[this._key]])){var i=this._index[t].list.indexOf(e);-1!==i&&(this._index[t].list.splice(i,1),this._key&&delete this._index[t].keys[e[this._key]],0===this._index[t].list.length&&delete this._index[t])}},e.find=function(t){for(var e,i,n,s,a,r=this,o={},h=[],l=function(t,e){return r._index[t].list.length-r._index[e].list.length},c=0;c0?i[0]:null},e}(m),ou=function(){function t(t){this._assets=t,this._bundleAssets={},this._assetsInBundles={},this._urlsInBundles={},this._fileRequests={},this._assets.on("add",this._onAssetAdded,this),this._assets.on("remove",this._onAssetRemoved,this)}var e=t.prototype;return e._onAssetAdded=function(t){if("bundle"===t.type){this._bundleAssets[t.id]=t,this._registerBundleEventListeners(t.id);for(var e=0,i=t.data.assets.length;e=3&&i.length<=4){for(var u=0;ui.ind&&(h=i.ind),this._insertScriptInstance(r,h,o),this._scriptsIndex[a]={instance:r,onSwap:function(){n.swap(a)}},this[a]=r,i.preloading||r.__initializeAttributes(),this.fire("create",a,r),this.fire("create:"+a,r),this.system.app.scripts.on("swap:"+a,this._scriptsIndex[a].onSwap),i.preloading||(r.enabled&&!r._initialized&&(r._initialized=!0,r.initialize&&this._scriptMethod(r,e.scriptMethods.initialize)),r.enabled&&!r._postInitialized&&(r._postInitialized=!0,r.postInitialize&&this._scriptMethod(r,e.scriptMethods.postInitialize))),r}}else this._scriptsIndex[a]={awaiting:!0,ind:this._scripts.length};return null},i.destroy=function(t){var e=t,i=t;"string"==typeof i?i=this.system.app.scripts.get(i):i&&(e=i.__name);var n=this._scriptsIndex[e];if(delete this._scriptsIndex[e],!n)return!1;var s=n.instance;if(s&&!s._destroyed)if(s.enabled=!1,s._destroyed=!0,this._isLoopingThroughScripts)this._destroyedScripts.push(s);else{var a=this._removeScriptInstance(s);a>=0&&this._resetExecutionOrder(a,this._scripts.length)}return this.system.app.scripts.off("swap:"+e,n.onSwap),delete this[e],this.fire("destroy",e,s||null),this.fire("destroy:"+e,s||null),s&&s.fire("destroy"),!0},i.swap=function(t){var i=t,n=t;"string"==typeof n?n=this.system.app.scripts.get(n):n&&(i=n.__name);var s=this._scriptsIndex[i];if(!s||!s.instance)return!1;var a=s.instance,r=this._scripts.indexOf(a),o=new n({app:this.system.app,entity:this.entity,enabled:a.enabled,attributes:a.__attributes});return!!o.swap&&(o.__initializeAttributes(),this._scripts[r]=o,this._scriptsIndex[i].instance=o,this[i]=o,o.__executionOrder=r,a.update&&this._updateList.remove(a),a.postUpdate&&this._postUpdateList.remove(a),o.update&&this._updateList.insert(o),o.postUpdate&&this._postUpdateList.insert(o),this._scriptMethod(o,e.scriptMethods.swap,a),this.fire("swap",i,o),this.fire("swap:"+i,o),!0)},i.resolveDuplicatedEntityReferenceProperties=function(t,e){var i=this.entity.script;for(var n in t._scriptsIndex){var s=this.system.app.scripts.get(n);if(s){var a=t._scriptsIndex[n];if(a&&a.instance){var r=i[n].__attributesRaw,o=i[n].__attributes;if(r||o){var h=!!r,l=a.instance.__attributes;for(var c in l)if(l[c]){var u=s.attributes.get(c);if(u)if("entity"===u.type)this._resolveEntityScriptAttribute(u,c,l[c],h,r||o,e);else if("json"===u.type&&Array.isArray(u.schema))for(var d=l[c],f=r?r[c]:o[c],p=0;p=i||e<0)return!1;var n=t,s=t;"string"!=typeof s?s=t.__name:n=null;var a=this._scriptsIndex[s];if(!a||!a.instance)return!1;var r=a.instance;if(n&&!(r instanceof n))return!1;var o=this._scripts.indexOf(r);return-1!==o&&o!==e&&(this._scripts.splice(e,0,this._scripts.splice(o,1)[0]),this._resetExecutionOrder(0,i),this._updateList.sort(),this._postUpdateList.sort(),this.fire("move",s,r,e,o),this.fire("move:"+s,r,e,o),!0)},q(e,[{key:"enabled",get:function(){return this._enabled},set:function(t){var e=this._enabled;this._enabled=t,this.fire("set","enabled",e,t)}},{key:"scripts",get:function(){return this._scripts},set:function(t){for(var e in this._scriptsData=t,t)if(t.hasOwnProperty(e)){var i=this._scriptsIndex[e];if(i){if("boolean"==typeof t[e].enabled&&(i.enabled=!!t[e].enabled),"object"==typeof t[e].attributes)for(var n in t[e].attributes)if(!uu.reservedNames.has(n)){if(!i.__attributes.hasOwnProperty(n)){var s=this.system.app.scripts.get(e);s&&s.attributes.add(n,{})}i[n]=t[e].attributes[n]}}else console.log(this.order)}}}]),e}(du);fu.scriptMethods={initialize:"initialize",postInitialize:"postInitialize",update:"update",postUpdate:"postUpdate",swap:"swap"};var pu=new RegExp("^\\s*function(?:\\s|\\s*\\/\\*.*\\*\\/\\s*)+([^\\(\\s\\/]*)\\s*"),mu=function(t){function e(e){var i;return(i=t.call(this)||this).app=void 0,i.entity=void 0,i._enabled=void 0,i._enabledOld=void 0,i._initialized=void 0,i._postInitialized=void 0,i.__destroyed=void 0,i.__attributes=void 0,i.__attributesRaw=void 0,i.__scriptType=void 0,i.__executionOrder=void 0,i.initScriptType(e),i}Y(e,t);var i=e.prototype;return i.initScriptType=function(t){var e=this.constructor;this.app=t.app,this.entity=t.entity,this._enabled="boolean"!=typeof t.enabled||t.enabled,this._enabledOld=this.enabled,this.__destroyed=!1,this.__attributes={},this.__attributesRaw=t.attributes||{},this.__scriptType=e,this.__executionOrder=-1},e.__getScriptName=function(t){if("function"==typeof t){if("name"in Function.prototype)return t.name;if(t===Function||t===Function.prototype.constructor)return"Function";var e=(""+t).match(pu);return e?e[1]:void 0}},i.__initializeAttributes=function(t){if(t||this.__attributesRaw){for(var e in this.__scriptType.attributes.index)this.__attributesRaw&&this.__attributesRaw.hasOwnProperty(e)?this[e]=this.__attributesRaw[e]:this.__attributes.hasOwnProperty(e)||(this.__scriptType.attributes.index[e].hasOwnProperty("default")?this[e]=this.__scriptType.attributes.index[e].default:this[e]=null);this.__attributesRaw=null}},e.extend=function(t){for(var e in t)t.hasOwnProperty(e)&&(this.prototype[e]=t[e])},q(e,[{key:"enabled",get:function(){return this._enabled&&!this._destroyed&&this.entity.script.enabled&&this.entity.enabled},set:function(t){this._enabled=!!t,this.enabled!==this._enabledOld&&(this._enabledOld=this.enabled,this.fire(this.enabled?"enable":"disable"),this.fire("state",this.enabled),!this._initialized&&this.enabled&&(this._initialized=!0,this.__initializeAttributes(!0),this.initialize&&this.entity.script._scriptMethod(this,fu.scriptMethods.initialize)),this._initialized&&!this._postInitialized&&this.enabled&&!this.entity.script._beingEnabled&&(this._postInitialized=!0,this.postInitialize&&this.entity.script._scriptMethod(this,fu.scriptMethods.postInitialize)))}}],[{key:"scriptName",get:function(){return this.__name}},{key:"attributes",get:function(){return this.hasOwnProperty("__attributes")||(this.__attributes=new uu(this)),this.__attributes}}]),e}(m);mu.__name=null;var _u=function(t){function e(e){var i;return(i=t.call(this)||this).app=e,i._scripts={},i._list=[],i}Y(e,t);var i=e.prototype;return i.destroy=function(){this.app=null,this.off()},i.add=function(t){var e=this,i=t.__name;return this._scripts.hasOwnProperty(i)?(setTimeout((function(){if(t.prototype.swap){var n=e._scripts[i],s=e._list.indexOf(n);e._list[s]=t,e._scripts[i]=t,e.fire("swap",i,t),e.fire("swap:"+i,t)}else console.warn("script registry already has '"+i+"' script, define 'swap' method for new script type to enable code hot swapping")})),!1):(this._scripts[i]=t,this._list.push(t),this.fire("add",i,t),this.fire("add:"+i,t),setTimeout((function(){if(e._scripts.hasOwnProperty(i)&&e.app&&e.app.systems&&e.app.systems.script){var t,n=e.app.systems.script._components,s=[],a=[];for(n.loopIndex=0;n.loopIndexthis.views.length)for(var a=0;a<=s-this.views.length;a++){var r=this.viewsPool.pop();r||(r={viewport:new _t,projMat:new St,viewMat:new St,viewOffMat:new St,viewInvMat:new St,viewInvOffMat:new St,projViewOffMat:new St,viewMat3:new pt,position:new Float32Array(3),rotation:new wt}),this.views.push(r)}else if(s<=this.views.length)for(var o=0;o=this._right){var i=e.length;if(i)if(t=e[i-1])this._left=e[i-1],this._right=1/0,this._len=0,this._recip=0,this._p0=this._p1=i-1;else{var n=this._findKey(t,e);this._left=e[n],this._right=e[n+1],this._len=this._right-this._left;var s=1/this._len;this._recip=isFinite(s)?s:0,this._p0=n,this._p1=n+1}else this._left=-1/0,this._right=1/0,this._len=0,this._recip=0,this._p0=this._p1=0}this._t=0===this._recip?0:(t-this._left)*this._recip,this._hermite.valid=!1},e._findKey=function(t,e){for(var i=0;t>=e[i+1];)i++;return i},e.eval=function(t,e,i){var n=i._data,s=i._components,a=this._p0*s;if(0===e)for(var r=0;rthis.track.duration&&(i=e-this.track.duration,e=this.track.duration);this.track.events[this.eventCursor]&&this.track.events[this.eventCursor].time>=t&&(e===this.track.duration?this.track.events[this.eventCursor].time<=e:this.track.events[this.eventCursor].time0&&i>0&&this.activeEventsForFrame(e,e+n*t),e+=n*t,n>=0?e>i&&(s?e=e%i||0:(e=this._track.duration,this.pause())):e<0&&(s?e=i+(e%i||0):(e=0,this.pause())),this._time=e}this._time!==this._snapshot._time&&this._track.eval(this._time,this._snapshot)},e.play=function(){this._playing=!0,this._time=0},e.stop=function(){this._playing=!1,this._time=0},e.pause=function(){this._playing=!1},e.resume=function(){this._playing=!0},e.reset=function(){this._time=0},q(t,[{key:"name",get:function(){return this._name},set:function(t){this._name=t}},{key:"track",get:function(){return this._track}},{key:"snapshot",get:function(){return this._snapshot}},{key:"time",get:function(){return this._time},set:function(t){this._time=t}},{key:"speed",get:function(){return this._speed},set:function(t){this._speed=t}},{key:"loop",get:function(){return this._loop},set:function(t){this._loop=t}},{key:"blendWeight",get:function(){return this._blendWeight},set:function(t){this._blendWeight=t}},{key:"blendOrder",get:function(){return this._blendOrder},set:function(t){this._blendOrder=t}},{key:"eventCursor",get:function(){return this._eventCursor},set:function(t){this._eventCursor=t}}]),t}(),_d="NONE",gd="PREV_STATE",vd="NEXT_STATE",yd="PREV_STATE_NEXT_STATE",xd="NEXT_STATE_PREV_STATE",bd="GREATER_THAN",Sd="LESS_THAN",wd="GREATER_THAN_EQUAL_TO",Td="LESS_THAN_EQUAL_TO",Ad="EQUAL_TO",Md="NOT_EQUAL_TO",Cd="INTEGER",Ed="FLOAT",Pd="BOOLEAN",Rd="TRIGGER",Id="2D_DIRECTIONAL",Ld="2D_CARTESIAN",Dd="DIRECT",kd="START",Od="END",Fd="ANY",Bd=[kd,Od,Fd],Nd="OVERWRITE",Ud="ADDITIVE",zd=function(){function t(t,e){this._component=t,this.mask=new Int8Array(t.layers.length),this.weights=new Float32Array(t.layers.length),this.totalWeight=0,this.counter=0,this.layerCounter=0,this.valueType=e,this.dirty=!0,this.value=[0,0,0,1],this.baseValue=null,this.setter=null}var e=t.prototype;return e.getWeight=function(t){return this.dirty&&this.updateWeights(),this._normalizeWeights&&0===this.totalWeight||!this.mask[t]?0:this._normalizeWeights?this.weights[t]/this.totalWeight:rt.clamp(this.weights[t],0,1)},e._layerBlendType=function(t){return this._component.layers[t].blendType},e.setMask=function(t,e){this.mask[t]=e,this._normalizeWeights&&(this._component.layers[t].blendType===Nd&&(this.mask=this.mask.fill(0,0,t)),this.dirty=!0)},e.updateWeights=function(){this.totalWeight=0;for(var t=0;t0){i=1/Math.sqrt(i);for(var n=e.length,s=0;s0&&(a=1/Math.sqrt(a));for(var r=0;r0;)this.removeClip(0)},e.findClip=function(t){for(var e=this._clips,i=0;i0&&r._update(e);var c=void 0,u=void 0,d=void 0;if(l>=1)for(var f=0;f0)for(var p=0;p0&&i.push(n),i},t.encode=function(t,e,i){return(Array.isArray(t)?t.join("/"):t)+"/"+e+"/"+(Array.isArray(i)?i.join("/"):i)};var e=t.prototype;return e.resolve=function(t){return null},e.unresolve=function(t){},e.update=function(t){},t}(),Gd=function(){function t(t,e,i,n){t.set?(this._set=t.set,this._get=t.get):this._set=t,this._type=e,this._components=i,this._targetPath=n,this._isTransform="localRotation"===this._targetPath.substring(this._targetPath.length-13)||"localPosition"===this._targetPath.substring(this._targetPath.length-13)||"localScale"===this._targetPath.substring(this._targetPath.length-10)}return q(t,[{key:"set",get:function(){return this._set}},{key:"get",get:function(){return this._get}},{key:"type",get:function(){return this._type}},{key:"components",get:function(){return this._components}},{key:"targetPath",get:function(){return this._targetPath}},{key:"isTransform",get:function(){return this._isTransform}}]),t}(),Hd=function(){function t(e){var i=this;if(this._isPathInMask=function(t,e){var n=i._mask[t];return!!n&&!!(n.children||e&&!1!==n.value)},this.graph=e,e){this._mask=null;var n={};!function t(e){n[e.name]=e;for(var i=0;i0){return t.createAnimTarget((function(t){for(var e=0;ei){this._time=this.looping?0:i;for(var n=0;n=0?1:-1,l=0;l=0;m+=h){var _=d[m],g=d[m+1];if(_.time<=this._time&&g.time>=this._time){var v=(this._time-_.time)/(g.time-_.time);f._pos.lerp(_.position,g.position,v),f._quat.slerp(_.rotation,g.rotation,v),f._scale.lerp(_.scale,g.scale,v),f._written=!0,this._currKeyIndices[u]=m,p=!0;break}}(1===d.length||!p&&0===this._time&&this.looping)&&(f._pos.copy(d[0].position),f._quat.copy(d[0].rotation),f._scale.copy(d[0].scale),f._written=!0)}}}},e.blend=function(t,e,i){for(var n=this._interpolatedKeys.length,s=0;s0&&i.prevAnim,i.blending&&(i.blend=0,i.blendSpeed=1/e),i.skeleton&&(i.blending?(i.fromSkel.animation=n,i.fromSkel.addTime(i.skeleton._time),i.toSkel.animation=s):i.skeleton.animation=s),i.animEvaluator){var a=i.animEvaluator;if(i.blending)for(;a.clips.length>1;)a.removeClip(0);else i.animEvaluator.removeClips();var r=new md(i.animations[i.currAnim],0,1,!0,i.loop);r.name=i.currAnim,r.blendWeight=i.blending?0:1,r.reset(),i.animEvaluator.addClip(r)}}i.playing=!0}}},i.getAnimation=function(t){return this.data.animations[t]},i.setModel=function(t){var e=this.data;t!==e.model&&(this._resetAnimationController(),e.model=t,e.animations&&e.currAnim&&e.animations[e.currAnim]&&this.play(e.currAnim))},i._resetAnimationController=function(){var t=this.data;t.skeleton=null,t.fromSkel=null,t.toSkel=null,t.animEvaluator=null},i._createAnimationController=function(){var t=this.data,e=t.model,i=t.animations,n=!1,s=!1;for(var a in i){if(i.hasOwnProperty(a))i[a].constructor===bh?s=!0:n=!0}var r=e.getGraph();n?(t.fromSkel=new qd(r),t.toSkel=new qd(r),t.skeleton=new qd(r),t.skeleton.looping=t.loop,t.skeleton.setGraph(r)):s&&(t.animEvaluator=new Vd(new Hd(this.entity)))},i.loadAnimationAssets=function(t){var e=this;if(t&&t.length)for(var i=this.system.app.assets,n=function(t){if(t.resources.length>1)for(var i=0;i1){if(n&&n.length>1)for(var a=0;a1)for(var o=0;o1)for(var h=0;h1)for(var e=0;e0&&this.play(r[0])}},i.onSetAssets=function(t,e,i){if(e&&e.length)for(var n=0;n0&&this.play(o[0])}},i.onBeforeRemove=function(){for(var t=0;t0)return e[e.length-1].time}return 0},set:function(t){var e=this.data;if(e.skeleton){var i=e.skeleton;i.currentTime=t,i.addTime(0),i.updateGraph()}if(e.animEvaluator)for(var n=e.animEvaluator,s=0;s=1&&(s.blend=1)),s.playing){var a=s.skeleton;if(null!==a&&null!==s.model){if(s.blending)a.blend(s.fromSkel,s.toSkel,s.blend);else{var r=t*s.speed;a.addTime(r),(s.speed>0&&a._time===a._animation.duration&&!s.loop||s.speed<0&&0===a._time&&!s.loop)&&(s.playing=!1)}s.blending&&1===s.blend&&(a.animation=s.toSkel._animation),a.updateGraph()}}var o=s.animEvaluator;if(o){for(var h=0;h1&&(o.clips[1].blendWeight=s.blend),o.update(t)}s.blending&&1===s.blend&&(s.blending=!1)}}},i.destroy=function(){t.prototype.destroy.call(this),this.app.systems.off("update",this.onUpdate,this)},e}(ud);du._buildAccessors(jd.prototype,Kd);var $d=function(){function t(t,e,i,n,s){void 0===s&&(s=1),this._state=t,this._parent=e,this._name=i,Array.isArray(n)?(this._point=new mt(n[0],n[1]),this._pointLength=this._point.length()):(this._point=n,this._pointLength=n),this._speed=s,this._weightedSpeed=1,this._weight=1,this._animTrack=null}return q(t,[{key:"parent",get:function(){return this._parent}},{key:"name",get:function(){return this._name}},{key:"path",get:function(){return this._parent?this._parent.path+"."+this._name:this._name}},{key:"point",get:function(){return this._point}},{key:"pointLength",get:function(){return this._pointLength}},{key:"weight",get:function(){return this._parent?this._parent.weight*this._weight:this._weight},set:function(t){this._weight=t}},{key:"normalizedWeight",get:function(){var t=this._state.totalWeight;return 0===t?0:this.weight/t}},{key:"speed",get:function(){return this._weightedSpeed*this._speed}},{key:"absoluteSpeed",get:function(){return Math.abs(this._speed)}},{key:"weightedSpeed",get:function(){return this._weightedSpeed},set:function(t){this._weightedSpeed=t}},{key:"animTrack",get:function(){return this._animTrack},set:function(t){this._animTrack=t}}]),t}(),Qd=function(t){function e(e,i,n,s,a,r,o,h,l){var c;(c=t.call(this,e,i,n,s)||this)._parameters=a,c._parameterValues=new Array(a.length),c._children=[],c._findParameter=l,c._syncAnimations=!1!==o,c._pointCache={};for(var u=0;u=0)this._animationList[n].animTrack=e;else{var s=this._getNodeFromPath(t);s.animTrack=e,this._animationList.push(s)}},q(t,[{key:"name",get:function(){return this._name}},{key:"animations",get:function(){return this._animationList},set:function(t){this._animationList=t}},{key:"speed",get:function(){return this._speed},set:function(t){this._speed=t}},{key:"loop",get:function(){return this._loop},set:function(t){this._loop=t}},{key:"nodeCount",get:function(){return this._blendTree&&this._blendTree.constructor!==$d?this._blendTree.getNodeCount():1}},{key:"playable",get:function(){return-1!==Bd.indexOf(this.name)||this.animations.length===this.nodeCount}},{key:"looping",get:function(){if(this.animations.length>0){var t=this.name+"."+this.animations[0].animTrack.name,e=this._controller.animEvaluator.findClip(t);if(e)return e.loop}return!1}},{key:"totalWeight",get:function(){for(var t=0,e=0;et&&(t=i.animTrack.duration)}return t}}]),t}(),af=function(){function t(t){var e=t.from,i=t.to,n=t.time,s=void 0===n?0:n,a=t.priority,r=void 0===a?0:a,o=t.conditions,h=void 0===o?[]:o,l=t.exitTime,c=void 0===l?null:l,u=t.transitionOffset,d=void 0===u?null:u,f=t.interruptionSource,p=void 0===f?_d:f;this._from=e,this._to=i,this._time=s,this._priority=r,this._conditions=h,this._exitTime=c,this._transitionOffset=d,this._interruptionSource=p}return q(t,[{key:"from",get:function(){return this._from}},{key:"to",get:function(){return this._to},set:function(t){this._to=t}},{key:"time",get:function(){return this._time}},{key:"priority",get:function(){return this._priority}},{key:"conditions",get:function(){return this._conditions}},{key:"exitTime",get:function(){return this._exitTime}},{key:"transitionOffset",get:function(){return this._transitionOffset}},{key:"interruptionSource",get:function(){return this._interruptionSource}},{key:"hasExitTime",get:function(){return!!this.exitTime}}]),t}(),rf=function(){function t(t,e,i,n,s,a,r){this._animEvaluator=t,this._states={},this._stateNames=[],this._eventHandler=a,this._consumedTriggers=r;for(var o=0;o"+e];return i||(i=this._transitions.filter((function(i){return i.from===t&&i.to===e})),bo(i),this._findTransitionsBetweenStatesCache[t+"->"+e]=i),i},e._transitionHasConditionsMet=function(t){for(var e=t.conditions,i=0;in.value))return!1;break;case Sd:if(!(s.value=n.value))return!1;break;case Td:if(!(s.value<=n.value))return!1;break;case Ad:if(s.value!==n.value)return!1;break;case Md:if(s.value===n.value)return!1}}return!0},e._findTransition=function(t,e){var i=this,n=[];if(t&&e)n=n.concat(this._findTransitionsBetweenStates(t,e));else if(this._isTransitioning)switch(this._transitionInterruptionSource){case gd:n=(n=n.concat(this._findTransitionsFromState(this._previousStateName))).concat(this._findTransitionsFromState(Fd));break;case vd:n=(n=n.concat(this._findTransitionsFromState(this._activeStateName))).concat(this._findTransitionsFromState(Fd));break;case yd:n=(n=(n=n.concat(this._findTransitionsFromState(this._previousStateName))).concat(this._findTransitionsFromState(this._activeStateName))).concat(this._findTransitionsFromState(Fd));break;case xd:n=(n=(n=n.concat(this._findTransitionsFromState(this._activeStateName))).concat(this._findTransitionsFromState(this._previousStateName))).concat(this._findTransitionsFromState(Fd))}else n=(n=n.concat(this._findTransitionsFromState(this._activeStateName))).concat(this._findTransitionsFromState(Fd));if((n=n.filter((function(t){if(t.to===i.activeStateName)return!1;if(t.hasExitTime){var e=i._getActiveStateProgressForTime(i._timeInStateBefore),n=i._getActiveStateProgressForTime(i._timeInState);if(t.exitTime<1&&i.activeState.loop&&(e-=Math.floor(e),n-=Math.floor(n)),!(t.exitTime>e&&t.exitTime<=n))return null}return i._transitionHasConditionsMet(t)}))).length>0){var s=n[0];if(s.to===Od){var a=this._findTransitionsFromState(kd)[0];s.to=a.to}return s}return null},e.updateStateFromTransition=function(t){var e,i,n;this.previousState=t.from?this.activeStateName:null,this.activeState=t.to;for(var s=0;s0&&t.transitionOffset<1,u=0,d=0;if(c){var f=l.timelineDuration*t.transitionOffset;u=f,d=f}this._timeInState=u,this._timeInStateBefore=d;for(var p=0;p0?n.blendWeight=0:n.blendWeight=l.animations[p].normalizedWeight,n.play(),c)n.time=l.timelineDuration*t.transitionOffset;else{var _=l.speed>=0?0:this.activeStateDuration;n.time=_}}},e._transitionToState=function(t){if(this._findState(t)){var e=this._findTransition(this._activeStateName,t);e||(this._animEvaluator.removeClips(),e=new af({from:null,to:t})),this.updateStateFromTransition(e)}},e.assignAnimation=function(t,e,i,n){var s=t.split("."),a=this._findState(s[0]);a||(a=new sf(this,s[0],1),this._states[s[0]]=a,this._stateNames.push(s[0])),a.addAnimation(s,e),void 0!==i&&(a.speed=i),void 0!==n&&(a.loop=n),!this._playing&&this._activate&&this.playable&&this.play()},e.removeNodeAnimations=function(t){if(-1===Bd.indexOf(t)){var e=this._findState(t);if(e)return e.animations=[],!0}},e.play=function(t){t&&this._transitionToState(t),this._playing=!0},e.pause=function(){this._playing=!1},e.reset=function(){this._previousStateName=null,this._activeStateName=kd,this._playing=!1,this._currTransitionTime=1,this._totalTransitionTime=1,this._isTransitioning=!1,this._timeInState=0,this._timeInStateBefore=0,this._animEvaluator.removeClips()},e.rebind=function(){this._animEvaluator.rebind()},e.update=function(t){if(this._playing){var e,i,n;this._timeInStateBefore=this._timeInState,this._timeInState+=t;var s=this._findTransition(this._activeStateName);if(s&&this.updateStateFromTransition(s),this._isTransitioning)if(this._currTransitionTime+=t,this._currTransitionTime<=this._totalTransitionTime){for(var a=0!==this._totalTransitionTime?this._currTransitionTime/this._totalTransitionTime:1,r=0;r1){var l=e.length>2?this._resolvePath(t,e.slice(0,-1)):t,c=e[e.length-2];return function(t){n[s]=i(t),l[c]=n}}return function(t){n[s]=i(t)}},i._createAnimTargetForProperty=function(t,i,n){if(this.handlers&&"weights"===i[0])return this.handlers.weights(t);if(this.handlers&&"material"===i[0]&&2===i.length){var s=i[1];if(s.endsWith("Map"))return this.handlers.materialTexture(t,s)}var a,r,o,h=this._resolvePath(t,i,!0);if(void 0===h)return null;if("number"==typeof h)a=this._setter(t,i,e._packFloat),r="vector",o=1;else if("boolean"==typeof h)a=this._setter(t,i,e._packBoolean),r="vector",o=1;else if("object"==typeof h)switch(h.constructor){case mt:a=this._setter(t,i,e._packVec2),r="vector",o=2;break;case ft:a=this._setter(t,i,e._packVec3),r="vector",o=3;break;case _t:a=this._setter(t,i,e._packVec4),r="vector",o=4;break;case lt:a=this._setter(t,i,e._packColor),r="vector",o=4;break;case wt:a=this._setter(t,i,e._packQuat),r="quaternion",o=4;break;default:return null}return-1!==i.indexOf("material")?new Gd((function(e){a(e),t.material.update()}),r,o,n):new Gd(a,r,o,n)},i.rebind=function(){this.targetCache={},this.animComponent.rootBone?this.graph=this.animComponent.rootBone:this.graph=this.animComponent.entity;var t={};!function e(i){t[i.name]=i;for(var n=0;n0?this._layers[0]:null}}]),e}(du),mf=function(){this.enabled=!0},_f=["enabled"],gf=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="anim",i.ComponentType=pf,i.DataType=mf,i.schema=_f,i.on("beforeremove",i.onBeforeRemove,Z(i)),i.app.systems.on("animationUpdate",i.onAnimationUpdate,Z(i)),i}Y(e,t);var i=e.prototype;return i.initializeComponentData=function(e,i,n){t.prototype.initializeComponentData.call(this,e,i,_f);var s=["animationAssets","stateGraph","layers","masks"];Object.keys(i).forEach((function(t){s.includes(t)||(e[t]=i[t])})),i.stateGraph&&(e.stateGraph=i.stateGraph,e.loadStateGraph(e.stateGraph)),i.layers?i.layers.forEach((function(t,i){t._controller.states.forEach((function(n){t._controller._states[n]._animationList.forEach((function(t){e.layers[i].assignAnimation(t.name,t.animTrack)}))}))})):i.animationAssets&&(e.animationAssets=Object.assign(e.animationAssets,i.animationAssets)),i.masks&&Object.keys(i.masks).forEach((function(t){if(e.layers[t]){var n=i.masks[t].mask,s={};Object.keys(n).forEach((function(t){s[decodeURI(t)]=n[t]})),e.layers[t].mask=s}}))},i.onAnimationUpdate=function(t){var e=this.store;for(var i in e)if(e.hasOwnProperty(i)){var n=e[i].entity.anim;n.data.enabled&&n.entity.enabled&&n.playing&&n.update(t)}},i.cloneComponent=function(t,e){var i;t.anim.rootBone&&t.anim.rootBone!==t||(i={},t.anim.layers.forEach((function(t,n){if(t.mask){var s={};Object.keys(t.mask).forEach((function(i){var n=i.split("/");n.shift();var a=[e.name].concat(n).join("/");s[a]=t.mask[i]})),i[n]={mask:s}}})));var n={stateGraphAsset:t.anim.stateGraphAsset,animationAssets:t.anim.animationAssets,speed:t.anim.speed,activate:t.anim.activate,playing:t.anim.playing,rootBone:t.anim.rootBone,stateGraph:t.anim.stateGraph,layers:t.anim.layers,layerIndices:t.anim.layerIndices,parameters:t.anim.parameters,normalizeWeights:t.anim.normalizeWeights,masks:i};return this.addComponent(e,n)},i.onBeforeRemove=function(t,e){e.onBeforeRemove()},i.destroy=function(){t.prototype.destroy.call(this),this.app.systems.off("animationUpdate",this.onAnimationUpdate,this)},e}(ud);du._buildAccessors(pf.prototype,_f);var vf=function(t){function e(e,i){return t.call(this,e,i)||this}Y(e,t);var i=e.prototype;return i.setCurrentListener=function(){if(this.enabled&&this.entity.audiolistener&&this.entity.enabled){this.system.current=this.entity;var t=this.system.current.getPosition();this.system.manager.listener.setPosition(t)}},i.onEnable=function(){this.setCurrentListener()},i.onDisable=function(){this.system.current===this.entity&&(this.system.current=null)},e}(du),yf=function(){this.enabled=!0},xf=["enabled"],bf=function(t){function e(e,i){var n;return(n=t.call(this,e)||this).id="audiolistener",n.ComponentType=vf,n.DataType=yf,n.schema=xf,n.manager=i,n.current=null,n.app.systems.on("update",n.onUpdate,Z(n)),n}Y(e,t);var i=e.prototype;return i.initializeComponentData=function(e,i,n){n=["enabled"],t.prototype.initializeComponentData.call(this,e,i,n)},i.onUpdate=function(t){if(this.current){var e=this.current.getPosition();this.manager.listener.setPosition(e);var i=this.current.getWorldTransform();this.manager.listener.setOrientation(i)}},i.destroy=function(){t.prototype.destroy.call(this),this.app.systems.off("update",this.onUpdate,this)},e}(ud);du._buildAccessors(vf.prototype,xf);var Sf=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this).on("set_assets",n.onSetAssets,Z(n)),n.on("set_loop",n.onSetLoop,Z(n)),n.on("set_volume",n.onSetVolume,Z(n)),n.on("set_pitch",n.onSetPitch,Z(n)),n.on("set_minDistance",n.onSetMinDistance,Z(n)),n.on("set_maxDistance",n.onSetMaxDistance,Z(n)),n.on("set_rollOffFactor",n.onSetRollOffFactor,Z(n)),n.on("set_distanceModel",n.onSetDistanceModel,Z(n)),n.on("set_3d",n.onSet3d,Z(n)),n}Y(e,t);var i=e.prototype;return i.play=function(t){if(this.enabled&&this.entity.enabled){var e;this.channel&&this.stop();var i=this.data;if(i.sources[t])if(i["3d"]){var n=this.entity.getPosition();e=this.system.manager.playSound3d(i.sources[t],n,i),i.currentSource=t,i.channel=e}else e=this.system.manager.playSound(i.sources[t],i),i.currentSource=t,i.channel=e}},i.pause=function(){this.channel&&this.channel.pause()},i.unpause=function(){this.channel&&this.channel.paused&&this.channel.unpause()},i.stop=function(){this.channel&&(this.channel.stop(),this.channel=null)},i.onSetAssets=function(t,e,i){var n=[],s=i.length;if(e&&e.length)for(var a=0;a1e-5){var i=this._tweenInfo.lerpColor;i.lerp(this._tweenInfo.from,this._tweenInfo.to,e),this._applyTintImmediately(new lt(i.r,i.g,i.b,i.a))}else this._applyTintImmediately(this._tweenInfo.to),this._cancelTween()},i._cancelTween=function(){delete this._tweenInfo},i.onUpdate=function(){this._tweenInfo&&this._updateTintTween()},i.onEnable=function(){this._isHovering=!1,this._hoveringCounter=0,this._isPressed=!1,this._imageReference.onParentComponentEnable(),this._toggleHitElementListeners("on"),this._forceReapplyVisualState()},i.onDisable=function(){this._toggleHitElementListeners("off"),this._resetToDefaultVisualState(this.transitionMode)},i.onRemove=function(){this._toggleLifecycleListeners("off",this.system),this.onDisable()},e}(du);function Nf(t){return new lt(t.r,t.g,t.b)}var Uf,zf=function(){this.enabled=!0,this.active=!0,this.imageEntity=null,this.hitPadding=new _t,this.transitionMode=0,this.hoverTint=new lt(.75,.75,.75),this.pressedTint=new lt(.5,.5,.5),this.inactiveTint=new lt(.25,.25,.25),this.fadeDuration=0,this.hoverSpriteAsset=null,this.hoverSpriteFrame=0,this.pressedSpriteAsset=null,this.pressedSpriteFrame=0,this.inactiveSpriteAsset=null,this.inactiveSpriteFrame=0},Vf=["enabled","active",{name:"imageEntity",type:"entity"},{name:"hitPadding",type:"vec4"},"transitionMode",{name:"hoverTint",type:"rgba"},{name:"pressedTint",type:"rgba"},{name:"inactiveTint",type:"rgba"},"fadeDuration","hoverSpriteAsset","hoverSpriteFrame","pressedSpriteAsset","pressedSpriteFrame","inactiveSpriteAsset","inactiveSpriteFrame"],Wf=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="button",i.ComponentType=Bf,i.DataType=zf,i.schema=Vf,i.on("beforeremove",i._onRemoveComponent,Z(i)),i.app.systems.on("update",i.onUpdate,Z(i)),i}Y(e,t);var i=e.prototype;return i.initializeComponentData=function(e,i,n){t.prototype.initializeComponentData.call(this,e,i,Vf)},i.onUpdate=function(t){var e=this.store;for(var i in e){var n=e[i].entity,s=n.button;s.enabled&&n.enabled&&s.onUpdate()}},i._onRemoveComponent=function(t,e){e.onRemove()},i.destroy=function(){t.prototype.destroy.call(this),this.app.systems.off("update",this.onUpdate,this)},e}(ud);du._buildAccessors(Bf.prototype,Vf);var Gf=function(t,e){this.effect=t,this.inputTarget=e,this.outputTarget=null,this.name=t.constructor.name},Hf=function(){function t(t,e){var i=this;this.app=t,this.camera=e,this.destinationRenderTarget=null,this.effects=[],this.enabled=!1,this.depthTarget=null,this.renderTargetScale=1,this.resizeTimeout=null,this.resizeLast=0,this._resizeTimeoutCallback=function(){i.resizeRenderTargets()},e.on("set:rect",this.onCameraRectChanged,this)}var e=t.prototype;return e._allocateColorBuffer=function(t,e){var i=this.camera.rect,n=Math.floor(i.z*this.app.graphicsDevice.width*this.renderTargetScale),s=Math.floor(i.w*this.app.graphicsDevice.height*this.renderTargetScale);return new Bi(this.app.graphicsDevice,{name:e,format:t,width:n,height:s,mipmaps:!1,minFilter:0,magFilter:0,addressU:1,addressV:1})},e._createOffscreenTarget=function(t,e){var i=this.app.graphicsDevice,n=e?i.getHdrFormat():7,s=this.camera.entity.name+"-posteffect-"+this.effects.length,a=this._allocateColorBuffer(n,s),r=this.app.graphicsDevice.supportsStencil,o=t?i.samples:1;return new xs({colorBuffer:a,depth:t,stencil:r,samples:o})},e._resizeOffscreenTarget=function(t){var e=t.colorBuffer.format,i=t.colorBuffer.name;t.destroyFrameBuffers(),t.destroyTextureBuffers(),t._colorBuffer=this._allocateColorBuffer(e,i)},e._destroyOffscreenTarget=function(t){t.destroyTextureBuffers(),t.destroy()},e.setRenderTargetScale=function(t){this.renderTargetScale=t,this.resizeRenderTargets()},e.addEffect=function(t){var e=this.effects,i=0===e.length,n=this._createOffscreenTarget(i,t.hdr),s=new Gf(t,n);e.push(s),this._sourceTarget=s.inputTarget,e.length>1&&(e[e.length-2].outputTarget=s.inputTarget),this._newPostEffect=t,t.needsDepthBuffer&&this._requestDepthMap(),this.enable(),this._newPostEffect=void 0},e.removeEffect=function(t){for(var e=-1,i=0,n=this.effects.length;i=0&&(e>0?this.effects[e-1].outputTarget=e+11&&(this.effects[1].inputTarget._depth||(this._destroyOffscreenTarget(this.effects[1].inputTarget),this.effects[1].inputTarget=this._createOffscreenTarget(!0,this.effects[1].hdr),this._sourceTarget=this.effects[1].inputTarget),this.camera.renderTarget=this.effects[1].inputTarget),this._destroyOffscreenTarget(this.effects[e].inputTarget),this.effects.splice(e,1)),this.enabled&&t.needsDepthBuffer&&this._releaseDepthMap(),0===this.effects.length&&this.disable()},e._requestDepthMaps=function(){for(var t=0,e=this.effects.length;t100?this.resizeRenderTargets():this.resizeTimeout=setTimeout(this._resizeTimeoutCallback,100))},e.resizeRenderTargets=function(){this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),this.resizeLast=it();for(var t=this.camera.rect,e=Math.floor(t.z*this.app.graphicsDevice.width*this.renderTargetScale),i=Math.floor(t.w*this.app.graphicsDevice.height*this.renderTargetScale),n=this.effects,s=0,a=n.length;s=0&&(this.cameras.splice(e,1),bo(this.cameras))},i.destroy=function(){t.prototype.destroy.call(this),this.app.systems.off("update",this.onUpdate,this)},e}(ud);du._buildAccessors(qf.prototype,Yf);var Zf,$f,Qf,Jf=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._compoundParent=null,n.entity.on("insert",n._onInsert,Z(n)),n.on("set_type",n.onSetType,Z(n)),n.on("set_halfExtents",n.onSetHalfExtents,Z(n)),n.on("set_radius",n.onSetRadius,Z(n)),n.on("set_height",n.onSetHeight,Z(n)),n.on("set_axis",n.onSetAxis,Z(n)),n.on("set_asset",n.onSetAsset,Z(n)),n.on("set_renderAsset",n.onSetRenderAsset,Z(n)),n.on("set_model",n.onSetModel,Z(n)),n.on("set_render",n.onSetRender,Z(n)),n}Y(e,t);var i=e.prototype;return i.onSetType=function(t,e,i){e!==i&&this.system.changeType(this,e,i)},i.onSetHalfExtents=function(t,e,i){var n=this.data.type;this.data.initialized&&"box"===n&&this.system.recreatePhysicalShapes(this)},i.onSetRadius=function(t,e,i){var n=this.data.type;!this.data.initialized||"sphere"!==n&&"capsule"!==n&&"cylinder"!==n&&"cone"!==n||this.system.recreatePhysicalShapes(this)},i.onSetHeight=function(t,e,i){var n=this.data.type;!this.data.initialized||"capsule"!==n&&"cylinder"!==n&&"cone"!==n||this.system.recreatePhysicalShapes(this)},i.onSetAxis=function(t,e,i){var n=this.data.type;!this.data.initialized||"capsule"!==n&&"cylinder"!==n&&"cone"!==n||this.system.recreatePhysicalShapes(this)},i.onSetAsset=function(t,e,i){var n=this.system.app.assets;if(e){var s=n.get(e);s&&s.off("remove",this.onAssetRemoved,this)}if(i){i instanceof Oh&&(this.data.asset=i.id);var a=n.get(this.data.asset);a&&(a.off("remove",this.onAssetRemoved,this),a.on("remove",this.onAssetRemoved,this))}this.data.initialized&&"mesh"===this.data.type&&(i||(this.data.model=null),this.system.recreatePhysicalShapes(this))},i.onSetRenderAsset=function(t,e,i){var n=this.system.app.assets;if(e){var s=n.get(e);s&&s.off("remove",this.onRenderAssetRemoved,this)}if(i){i instanceof Oh&&(this.data.renderAsset=i.id);var a=n.get(this.data.renderAsset);a&&(a.off("remove",this.onRenderAssetRemoved,this),a.on("remove",this.onRenderAssetRemoved,this))}this.data.initialized&&"mesh"===this.data.type&&(i||(this.data.render=null),this.system.recreatePhysicalShapes(this))},i.onSetModel=function(t,e,i){this.data.initialized&&"mesh"===this.data.type&&this.system.implementations.mesh.doRecreatePhysicalShape(this)},i.onSetRender=function(t,e,i){this.onSetModel(t,e,i)},i.onAssetRemoved=function(t){t.off("remove",this.onAssetRemoved,this),this.data.asset===t.id&&(this.asset=null)},i.onRenderAssetRemoved=function(t){t.off("remove",this.onRenderAssetRemoved,this),this.data.renderAsset===t.id&&(this.renderAsset=null)},i._getCompoundChildShapeIndex=function(t){for(var e=this.data.shape,i=e.getNumChildShapes(),n=0;n-1&&e.rigidbody._triggers.splice(i,1),e.rigidbody.removeBody(t),t.forceActivationState(5)}},t}(),op=new St,hp=new ft,lp=new wt,cp=new an,up=["enabled","type","halfExtents","radius","axis","height","asset","renderAsset","shape","model","render"],dp=function(){function t(t){this.system=t}var e=t.prototype;return e.beforeInitialize=function(t,e){e.shape=null,e.model=new qo,e.model.graph=new an},e.afterInitialize=function(t,e){this.recreatePhysicalShapes(t),t.data.initialized=!0},e.reset=function(t,e){this.beforeInitialize(t,e),this.afterInitialize(t,e)},e.recreatePhysicalShapes=function(t){var e=t.entity,i=t.data;if("undefined"!=typeof Ammo){e.trigger&&(e.trigger.destroy(),delete e.trigger),i.shape&&(t._compoundParent&&(this.system._removeCompoundChild(t._compoundParent,i.shape),t._compoundParent.entity.rigidbody&&t._compoundParent.entity.rigidbody.activate()),Ammo.destroy(i.shape),i.shape=null),i.shape=this.createPhysicalShape(t.entity,i);var n=!t._compoundParent;if("compound"!==i.type||t._compoundParent&&t!==t._compoundParent){if("compound"!==i.type&&(t._compoundParent&&t===t._compoundParent&&e.forEach(this.system.implementations.compound._updateEachDescendant,t),!t.rigidbody)){t._compoundParent=null;for(var s=e.parent;s;){if(s.collision&&"compound"===s.collision.type){t._compoundParent=s.collision;break}s=s.parent}}}else t._compoundParent=t,e.forEach(this._addEachDescendant,t);t._compoundParent&&t!==t._compoundParent&&(n&&0===t._compoundParent.shape.getNumChildShapes()?this.system.recreatePhysicalShapes(t._compoundParent):(this.system.updateCompoundChildTransform(e),t._compoundParent.entity.rigidbody&&t._compoundParent.entity.rigidbody.activate())),e.rigidbody?(e.rigidbody.disableSimulation(),e.rigidbody.createBody(),e.enabled&&e.rigidbody.enabled&&e.rigidbody.enableSimulation()):t._compoundParent||(e.trigger?e.trigger.initialize(i):e.trigger=new rp(this.system.app,t,i))}},e.createPhysicalShape=function(t,e){},e.updateTransform=function(t,e,i,n){t.entity.trigger&&t.entity.trigger.updateTransform()},e.beforeRemove=function(t,e){e.data.shape&&(e._compoundParent&&!e._compoundParent.entity._destroying&&(this.system._removeCompoundChild(e._compoundParent,e.data.shape),e._compoundParent.entity.rigidbody&&e._compoundParent.entity.rigidbody.activate()),e._compoundParent=null,Ammo.destroy(e.data.shape),e.data.shape=null)},e.remove=function(t,e){var i=this.system.app;t.rigidbody&&t.rigidbody.body&&t.rigidbody.disableSimulation(),t.trigger&&(t.trigger.destroy(),delete t.trigger),i.scene.containsModel(e.model)&&(i.root.removeChild(e.model.graph),i.scene.removeModel(e.model))},e.clone=function(t,e){var i=this.system.store[t.getGuid()],n={enabled:i.data.enabled,type:i.data.type,halfExtents:[i.data.halfExtents.x,i.data.halfExtents.y,i.data.halfExtents.z],radius:i.data.radius,axis:i.data.axis,height:i.data.height,asset:i.data.asset,renderAsset:i.data.renderAsset,model:i.data.model,render:i.data.render};return this.system.addComponent(e,n)},t}(),fp=function(t){function e(){return t.apply(this,arguments)||this}return Y(e,t),e.prototype.createPhysicalShape=function(t,e){if("undefined"!=typeof Ammo){var i=e.halfExtents,n=new Ammo.btVector3(i?i.x:.5,i?i.y:.5,i?i.z:.5),s=new Ammo.btBoxShape(n);return Ammo.destroy(n),s}},e}(dp),pp=function(t){function e(){return t.apply(this,arguments)||this}return Y(e,t),e.prototype.createPhysicalShape=function(t,e){if("undefined"!=typeof Ammo)return new Ammo.btSphereShape(e.radius)},e}(dp),mp=function(t){function e(){return t.apply(this,arguments)||this}return Y(e,t),e.prototype.createPhysicalShape=function(t,e){var i=void 0!==e.axis?e.axis:1,n=e.radius||.5,s=Math.max((e.height||2)-2*n,0),a=null;if("undefined"!=typeof Ammo)switch(i){case 0:a=new Ammo.btCapsuleShapeX(n,s);break;case 1:a=new Ammo.btCapsuleShape(n,s);break;case 2:a=new Ammo.btCapsuleShapeZ(n,s)}return a},e}(dp),_p=function(t){function e(){return t.apply(this,arguments)||this}return Y(e,t),e.prototype.createPhysicalShape=function(t,e){var i=void 0!==e.axis?e.axis:1,n=void 0!==e.radius?e.radius:.5,s=void 0!==e.height?e.height:1,a=null,r=null;if("undefined"!=typeof Ammo)switch(i){case 0:a=new Ammo.btVector3(.5*s,n,n),r=new Ammo.btCylinderShapeX(a);break;case 1:a=new Ammo.btVector3(n,.5*s,n),r=new Ammo.btCylinderShape(a);break;case 2:a=new Ammo.btVector3(n,n,.5*s),r=new Ammo.btCylinderShapeZ(a)}return a&&Ammo.destroy(a),r},e}(dp),gp=function(t){function e(){return t.apply(this,arguments)||this}return Y(e,t),e.prototype.createPhysicalShape=function(t,e){var i=void 0!==e.axis?e.axis:1,n=void 0!==e.radius?e.radius:.5,s=void 0!==e.height?e.height:1,a=null;if("undefined"!=typeof Ammo)switch(i){case 0:a=new Ammo.btConeShapeX(n,s);break;case 1:a=new Ammo.btConeShape(n,s);break;case 2:a=new Ammo.btConeShapeZ(n,s)}return a},e}(dp),vp=function(t){function e(){return t.apply(this,arguments)||this}Y(e,t);var i=e.prototype;return i.beforeInitialize=function(t,e){},i.createAmmoMesh=function(t,e,i){var n;if(this.system._triMeshCache[t.id])n=this.system._triMeshCache[t.id];else{for(var s,a,r=t.vertexBuffer,o=r.getFormat(),h=0;h=0&&this.model.meshInstances.splice(i,1),this.unmaskMeshInstance=null}this._entity.enabled&&this._element.enabled&&(this._element.removeModelFromLayers(this.model),this._element.addModelToLayers(this.model))}},e.setMaterial=function(t){this.meshInstance&&(this.meshInstance.material=t,this.unmaskMeshInstance&&(this.unmaskMeshInstance.material=t))},e.setParameter=function(t,e){this.meshInstance&&(this.meshInstance.setParameter(t,e),this.unmaskMeshInstance&&this.unmaskMeshInstance.setParameter(t,e))},e.deleteParameter=function(t){this.meshInstance&&(this.meshInstance.deleteParameter(t),this.unmaskMeshInstance&&this.unmaskMeshInstance.deleteParameter(t))},e.setUnmaskDrawOrder=function(){if(this.meshInstance){if(this.unmaskMeshInstance){var t=function t(e){var i,n=e.children,s=n.length;if(s){for(var a=0;a0?this._symbols[0]:null,this._buf=[],this._mode="text",this._error=null}var e=t.prototype;return e.read=function(){for(var t=this._read();8===t;)t=this._read();return 0!==t&&1!==t&&(this._last=this._index),t},e.buf=function(){return this._buf},e.last=function(){return this._last},e.error=function(){return this._error},e.debugPrint=function(){for(var t=["EOF","ERROR","TEXT","OPEN_BRACKET","CLOSE_BRACKET","EQUALS","STRING","IDENTIFIER","WHITESPACE"],e=this.read(),i="";i+=(i.length>0?"\n":"")+t[e]+" '"+this.buf().join("")+"'",0!==e&&1!==e;)e=this.read();return i},e._read=function(){return this._buf=[],this._eof()?0:"text"===this._mode?this._text():this._tag()},e._text=function(){for(;;)switch(this._cur){case null:return this._buf.length>0?2:0;case"[":return this._mode="tag",this._buf.length>0?2:this._tag();case"\\":switch(this._next(),this._cur){case"[":this._store();break;default:this._output("\\")}break;default:this._store()}},e._tag=function(){switch(this._cur){case null:return this._error="unexpected end of input reading tag",1;case"[":return this._store(),3;case"]":return this._store(),this._mode="text",4;case"=":return this._store(),5;case" ":case"\t":case"\n":case"\r":case"\v":case"\f":return this._whitespace();case'"':return this._string();default:return this._isIdentifierSymbol(this._cur)?this._identifier():(this._error="unrecognized character",1)}},e._whitespace=function(){for(this._store();-1!==" \t\n\r\v\f".indexOf(this._cur);)this._store();return 8},e._string=function(){for(this._next();;)switch(this._cur){case null:return this._error="unexpected end of input reading string",1;case'"':return this._next(),6;default:this._store()}},e._identifier=function(){for(this._store();null!==this._cur&&this._isIdentifierSymbol(this._cur);)this._store();return 7},e._isIdentifierSymbol=function(t){return 1===t.length&&null!==t.match(Mp)},e._eof=function(){return null===this._cur},e._next=function(){return this._eof()||(this._index++,this._cur=this._index=0;--s)if(n==="/"+e[s].name&&null===e[s].end)return e[s].end=t.length,4===(i=this._scanner.read())||(this._error="expected close bracket",!1);return this._error="failed to find matching tag",!1}var a={name:n,value:null,attributes:{},start:t.length,end:null};if(5===(i=this._scanner.read())){if(6!==(i=this._scanner.read()))return this._error="expected string",!1;a.value=this._scanner.buf().join(""),i=this._scanner.read()}for(;;){switch(i){case 4:return e.push(a),!0;case 7:var r=this._scanner.buf().join("");if(5!==(i=this._scanner.read()))return this._error="expected equals",!1;if(6!==(i=this._scanner.read()))return this._error="expected string",!1;var o=this._scanner.buf().join("");a.attributes[r]=o;break;default:return this._error="expected close bracket or identifier",!1}i=this._scanner.read()}},t}();function Pp(t,e){for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];n instanceof Object?(t.hasOwnProperty(i)||(t[i]={}),Pp(t[i],e[i])):t[i]=n}}function Rp(t){if(0===t.length)return null;for(var e={},i=0;i=1e-4,v=this._element.calculatedWidth;(this.autoWidth&&!g||!this._wrapLines)&&(v=Number.POSITIVE_INFINITY);var y,x,b,S,w=0,T=0;function A(t,i,n){e._lineWidths.push(Math.abs(n));var s=f>i?i+1:f,a=f>i?f+1:i,h=t.slice(s,a);if(_)for(var l=h.length;l--&&_>0;)kp.test(h[l])&&(h.splice(l,1),_--);e._lineContents.push(h.join("")),r=0,o-=e._scaledLineHeight,c++,p=0,m=0,_=0,u=0,f=i}for(var M=!0;M;){M=!1,this._scaledLineHeight=s?this._lineHeight*this._fontSize/(this._maxFontSize||1e-4):this._lineHeight,this.width=0,this.height=0,this._lineWidths=[],this._lineContents=[],r=0,o=0,h=0,l=0,c=1,u=0,d=0,f=0,p=0,m=0,_=0;var C=this._fontSize/32;w=this._fontMinY*C,T=this._fontMaxY*C;for(var E=0;E=a?null:this._symbols[L+1],kp.test(y))_++,(!this._wrapLines||this._maxLines<0||c0){var z=this._font.data.kerning;if(z){var V=z[G.getCodePoint(this._symbols[L-1])||0];V&&(U=V[G.getCodePoint(this._symbols[L])||0]||0)}}B=x.scale||1,F=C*((x.width+x.height)/2)/B,O=(x.xadvance+U)*C,D=(x.xoffset-U)*C,k=x.yoffset*C}else console.error("Couldn't substitute missing character: '"+y+"'");var W=Op.test(y),H=this._meshInfo[x&&x.map||0],X=r+this._spacing*O;if(X>v&&m>0&&!W&&(this._maxLines<0||cthis._element.calculatedWidth&&(nt=Math.floor(this._element.fontSize*this._element.calculatedWidth/(this.width||1e-4)),(nt=rt.clamp(nt,i,n))!==this._element.fontSize)){this._fontSize=nt,M=!0;break}if(this.height=Math.max(this.height,T-(o+w)),this._shouldAutoFitHeight()&&this.height>this._element.calculatedHeight&&(nt=rt.clamp(this._fontSize-1,i,n))!==this._element.fontSize){this._fontSize=nt,M=!0;break}r+=this._spacing*O,W||(l=r),(this._isWordBoundary(y)||this._isValidNextChar(S)&&(this._isNextCJKBoundary(y,S)||this._isNextCJKWholeWord(S)))&&(p++,u=l,d=L+1),m++;var st=this._getUv(y);if(H.uvs[4*b*2+0]=st[0],H.uvs[4*b*2+1]=1-st[1],H.uvs[4*b*2+2]=st[2],H.uvs[4*b*2+3]=1-st[1],H.uvs[4*b*2+4]=st[2],H.uvs[4*b*2+5]=1-st[3],H.uvs[4*b*2+6]=st[0],H.uvs[4*b*2+7]=1-st[3],this._symbolColors){var at=3*this._symbolColors[L];P=this._colorPalette[at],R=this._colorPalette[at+1],I=this._colorPalette[at+2]}H.colors[4*b*4+0]=P,H.colors[4*b*4+1]=R,H.colors[4*b*4+2]=I,H.colors[4*b*4+3]=255,H.colors[4*b*4+4]=P,H.colors[4*b*4+5]=R,H.colors[4*b*4+6]=I,H.colors[4*b*4+7]=255,H.colors[4*b*4+8]=P,H.colors[4*b*4+9]=R,H.colors[4*b*4+10]=I,H.colors[4*b*4+11]=255,H.colors[4*b*4+12]=P,H.colors[4*b*4+13]=R,H.colors[4*b*4+14]=I,H.colors[4*b*4+15]=255,H.quad++}}M||f=At?(Mt.element.POSITION.set(0,0,0),Mt.element.TEXCOORD0.set(0,0),Mt.element.COLOR.set(0,0,0,0)):(Mt.element.POSITION.set(this._meshInfo[ut].positions[3*Ct+0],this._meshInfo[ut].positions[3*Ct+1],this._meshInfo[ut].positions[3*Ct+2]),Mt.element.TEXCOORD0.set(this._meshInfo[ut].uvs[2*Ct+0],this._meshInfo[ut].uvs[2*Ct+1]),Mt.element.COLOR.set(this._meshInfo[ut].colors[4*Ct+0],this._meshInfo[ut].colors[4*Ct+1],this._meshInfo[ut].colors[4*Ct+2],this._meshInfo[ut].colors[4*Ct+3])),Mt.next();Mt.end(),this._meshInfo[ut].meshInstance.mesh.aabb.compute(this._meshInfo[ut].positions),this._meshInfo[ut].meshInstance._aabbVer=-1}this._aabbDirty=!0},e._onFontRender=function(){this.font=this._font},e._onFontLoad=function(t){this.font!==t.resource&&(this.font=t.resource)},e._onFontChange=function(t,e,i,n){if("data"===e){this._font.data=i;for(var s=this._font.data.info.maps.length,a=0;athis._font.textures.length&&(this._meshInfo.length=this._font.textures.length),this._updateText()}}},{key:"alignment",get:function(){return this._alignment},set:function(t){t instanceof mt?this._alignment.set(t.x,t.y):this._alignment.set(t[0],t[1]),this._font&&this._updateText()}},{key:"autoWidth",get:function(){return this._autoWidth},set:function(t){var e=this._autoWidth;if(this._autoWidth=t,t&&Math.abs(this._element.anchor.x-this._element.anchor.z)<1e-4&&(this._element.width=this.width),e!==t){var i=this._shouldAutoFit()?this._maxFontSize:this._originalFontSize;i!==this._fontSize&&(this._fontSize=i,this._font&&this._updateText())}}},{key:"autoHeight",get:function(){return this._autoHeight},set:function(t){var e=this._autoHeight;if(this._autoHeight=t,t&&Math.abs(this._element.anchor.y-this._element.anchor.w)<1e-4&&(this._element.height=this.height),e!==t){var i=this._shouldAutoFit()?this._maxFontSize:this._originalFontSize;i!==this._fontSize&&(this._fontSize=i,this._font&&this._updateText())}}},{key:"rtlReorder",get:function(){return this._rtlReorder},set:function(t){this._rtlReorder!==t&&(this._rtlReorder=t,this._font&&this._updateText())}},{key:"unicodeConverter",get:function(){return this._unicodeConverter},set:function(t){this._unicodeConverter!==t&&(this._unicodeConverter=t,this._setText(this._text))}},{key:"aabb",get:function(){if(this._aabbDirty){for(var t=!1,e=0;e=0&&this.system._prerender.splice(i,1),this.system._prerender.indexOf(t)<0&&this.system._prerender.push(t)}t=e}},i._onPrerender=function(){for(var t=0;t=0&&this.system.app.batcher.insert(Aa.ELEMENT,this.batchGroupId,this.entity),this.fire("enableelement")},i.onDisable=function(){this.system.app.scene.off("set:layers",this.onLayersChanged,this),this.system.app.scene.layers&&(this.system.app.scene.layers.off("add",this.onLayerAdded,this),this.system.app.scene.layers.off("remove",this.onLayerRemoved,this)),this._image&&this._image.onDisable(),this._text&&this._text.onDisable(),this._group&&this._group.onDisable(),this.system.app.elementInput&&this.useInput&&this.system.app.elementInput.removeElement(this),this._batchGroupId>=0&&this.system.app.batcher.remove(Aa.ELEMENT,this.batchGroupId,this.entity),this.fire("disableelement")},i.onRemove=function(){this.entity.off("insert",this._onInsert,this),this._unpatch(),this._image&&this._image.destroy(),this._text&&this._text.destroy(),this.system.app.elementInput&&this.useInput&&this.system.app.elementInput.removeElement(this),this.screen&&this.screen.screen&&(this._unbindScreen(this.screen.screen),this.screen.screen.syncDrawOrder()),this.off()},i._calculateSize=function(t,e){if(this.entity._parent||this.screen){this._calculateLocalAnchors();var i=this._absRight-this._absLeft,n=this._absTop-this._absBottom;t?this._setWidth(i):this._setCalculatedWidth(i,!1),e?this._setHeight(n):this._setCalculatedHeight(n,!1);var s=this.entity.getLocalPosition();s.x=this._margin.x+this._calculatedWidth*this._pivot.x,s.y=this._margin.y+this._calculatedHeight*this._pivot.y,this.entity.setLocalPosition(s),this._sizeDirty=!1}},i._setWidth=function(t){this._width=t,this._setCalculatedWidth(t,!1),this.fire("set:width",this._width)},i._setHeight=function(t){this._height=t,this._setCalculatedHeight(t,!1),this.fire("set:height",this._height)},i._setCalculatedWidth=function(t,e){if(!(Math.abs(t-this._calculatedWidth)<=1e-4)){if(this._calculatedWidth=t,this.entity._dirtifyLocal(),e){var i=this.entity.getLocalPosition(),n=this._pivot;this._margin.x=i.x-this._calculatedWidth*n.x,this._margin.z=this._localAnchor.z-this._localAnchor.x-this._calculatedWidth-this._margin.x}this._flagChildrenAsDirty(),this.fire("set:calculatedWidth",this._calculatedWidth),this.fire("resize",this._calculatedWidth,this._calculatedHeight)}},i._setCalculatedHeight=function(t,e){if(!(Math.abs(t-this._calculatedHeight)<=1e-4)){if(this._calculatedHeight=t,this.entity._dirtifyLocal(),e){var i=this.entity.getLocalPosition(),n=this._pivot;this._margin.y=i.y-this._calculatedHeight*n.y,this._margin.w=this._localAnchor.w-this._localAnchor.y-this._calculatedHeight-this._margin.y}this._flagChildrenAsDirty(),this.fire("set:calculatedHeight",this._calculatedHeight),this.fire("resize",this._calculatedWidth,this._calculatedHeight)}},i._flagChildrenAsDirty=function(){for(var t=this.entity._children,e=0,i=t.length;e=0&&this._addedModels.splice(e,1);for(var i=0;ii||f>n||p.001}},{key:"_hasSplitAnchorsY",get:function(){return Math.abs(this._anchor.y-this._anchor.w)>.001}},{key:"aabb",get:function(){return this._image?this._image.aabb:this._text?this._text.aabb:null}},{key:"anchor",get:function(){return this._anchor},set:function(t){t instanceof _t?this._anchor.set(t.x,t.y,t.z,t.w):this._anchor.set(t[0],t[1],t[2],t[3]),this.entity._parent||this.screen?this._calculateSize(this._hasSplitAnchorsX,this._hasSplitAnchorsY):this._calculateLocalAnchors(),this._anchorDirty=!0,this.entity._dirtyLocal||this.entity._dirtifyLocal(),this.fire("set:anchor",this._anchor)}},{key:"batchGroupId",get:function(){return this._batchGroupId},set:function(t){this._batchGroupId!==t&&(this.entity.enabled&&this._batchGroupId>=0&&this.system.app.batcher.remove(Aa.ELEMENT,this.batchGroupId,this.entity),this.entity.enabled&&t>=0&&this.system.app.batcher.insert(Aa.ELEMENT,t,this.entity),t<0&&this._batchGroupId>=0&&this.enabled&&this.entity.enabled&&(this._image&&this._image._renderable.model?this.addModelToLayers(this._image._renderable.model):this._text&&this._text._model&&this.addModelToLayers(this._text._model)),this._batchGroupId=t)}},{key:"bottom",get:function(){return this._margin.y},set:function(t){this._margin.y=t;var e=this.entity.getLocalPosition(),i=this._absTop,n=this._localAnchor.y+t;this._setHeight(i-n),e.y=t+this._calculatedHeight*this._pivot.y,this.entity.setLocalPosition(e)}},{key:"calculatedWidth",get:function(){return this._calculatedWidth},set:function(t){this._setCalculatedWidth(t,!0)}},{key:"calculatedHeight",get:function(){return this._calculatedHeight},set:function(t){this._setCalculatedHeight(t,!0)}},{key:"canvasCorners",get:function(){if(!this._canvasCornersDirty||!this.screen||!this.screen.screen.screenSpace)return this._canvasCorners;for(var t=this.system.app.graphicsDevice,e=this.screenCorners,i=t.canvas.clientWidth/t.width,n=t.canvas.clientHeight/t.height,s=0;s<4;s++)this._canvasCorners[s].set(e[s].x*i,(t.height-e[s].y)*n);return this._canvasCornersDirty=!1,this._canvasCorners}},{key:"drawOrder",get:function(){return this._drawOrder},set:function(t){var e=0;this.screen&&(e=this.screen.screen.priority),t>16777215&&(t=16777215),this._drawOrder=(e<<24)+t,this.fire("set:draworder",this._drawOrder)}},{key:"height",get:function(){return this._height},set:function(t){this._height=t,this._hasSplitAnchorsY||this._setCalculatedHeight(t,!0),this.fire("set:height",this._height)}},{key:"layers",get:function(){return this._layers},set:function(t){if(this._addedModels.length)for(var e=0;e.001,r=Math.abs(e.anchor.y-e.anchor.w)>.001,o=!1;void 0!==i.margin&&(i.margin instanceof _t?e.margin.copy(i.margin):e._margin.set(i.margin[0],i.margin[1],i.margin[2],i.margin[3]),o=!0),void 0!==i.left&&(e._margin.x=i.left,o=!0),void 0!==i.bottom&&(e._margin.y=i.bottom,o=!0),void 0!==i.right&&(e._margin.z=i.right,o=!0),void 0!==i.top&&(e._margin.w=i.top,o=!0),o&&(e.margin=e._margin);var h=!1;void 0===i.width||a?a&&(h=!0):e.width=i.width,void 0===i.height||r?r&&(h=!0):e.height=i.height,h&&(e.anchor=e.anchor),void 0!==i.enabled&&(e.enabled=i.enabled),void 0!==i.useInput&&(e.useInput=i.useInput),e.batchGroupId=void 0===i.batchGroupId||null===i.batchGroupId?-1:i.batchGroupId,i.layers&&Array.isArray(i.layers)&&(e.layers=i.layers.slice(0)),void 0!==i.type&&(e.type=i.type),e.type===Ef?(void 0!==i.rect&&(e.rect=i.rect),void 0!==i.color&&((s=i.color)instanceof lt||(s=new lt(i.color[0],i.color[1],i.color[2])),e.color=s),void 0!==i.opacity&&(e.opacity=i.opacity),void 0!==i.textureAsset&&(e.textureAsset=i.textureAsset),i.texture&&(e.texture=i.texture),void 0!==i.spriteAsset&&(e.spriteAsset=i.spriteAsset),i.sprite&&(e.sprite=i.sprite),void 0!==i.spriteFrame&&(e.spriteFrame=i.spriteFrame),void 0!==i.pixelsPerUnit&&null!==i.pixelsPerUnit&&(e.pixelsPerUnit=i.pixelsPerUnit),void 0!==i.materialAsset&&(e.materialAsset=i.materialAsset),i.material&&(e.material=i.material),void 0!==i.mask&&(e.mask=i.mask)):e.type===Pf&&(void 0!==i.autoWidth&&(e.autoWidth=i.autoWidth),void 0!==i.autoHeight&&(e.autoHeight=i.autoHeight),void 0!==i.rtlReorder&&(e.rtlReorder=i.rtlReorder),void 0!==i.unicodeConverter&&(e.unicodeConverter=i.unicodeConverter),null!==i.text&&void 0!==i.text?e.text=i.text:null!==i.key&&void 0!==i.key&&(e.key=i.key),void 0!==i.color&&((s=i.color)instanceof lt||(s=new lt(s[0],s[1],s[2])),e.color=s),void 0!==i.opacity&&(e.opacity=i.opacity),void 0!==i.spacing&&(e.spacing=i.spacing),void 0!==i.fontSize&&(e.fontSize=i.fontSize,i.lineHeight||(e.lineHeight=i.fontSize)),void 0!==i.lineHeight&&(e.lineHeight=i.lineHeight),void 0!==i.maxLines&&(e.maxLines=i.maxLines),void 0!==i.wrapLines&&(e.wrapLines=i.wrapLines),void 0!==i.minFontSize&&(e.minFontSize=i.minFontSize),void 0!==i.maxFontSize&&(e.maxFontSize=i.maxFontSize),i.autoFitWidth&&(e.autoFitWidth=i.autoFitWidth),i.autoFitHeight&&(e.autoFitHeight=i.autoFitHeight),void 0!==i.fontAsset&&(e.fontAsset=i.fontAsset),void 0!==i.font&&(e.font=i.font),void 0!==i.alignment&&(e.alignment=i.alignment),void 0!==i.outlineColor&&(e.outlineColor=i.outlineColor),void 0!==i.outlineThickness&&(e.outlineThickness=i.outlineThickness),void 0!==i.shadowColor&&(e.shadowColor=i.shadowColor),void 0!==i.shadowOffset&&(e.shadowOffset=i.shadowOffset),void 0!==i.enableMarkup&&(e.enableMarkup=i.enableMarkup));var l=e._parseUpToScreen();l.screen&&e._updateScreen(l.screen),t.prototype.initializeComponentData.call(this,e,i,n),e._beingInitialized=!1,e.type===Ef&&e._image._meshDirty&&e._image._updateMesh(e._image.mesh)},i.onRemoveComponent=function(t,e){e.onRemove()},i.cloneComponent=function(t,e){var i=t.element,n={enabled:i.enabled,width:i.width,height:i.height,anchor:i.anchor.clone(),pivot:i.pivot.clone(),margin:i.margin.clone(),alignment:i.alignment&&i.alignment.clone()||i.alignment,autoWidth:i.autoWidth,autoHeight:i.autoHeight,type:i.type,rect:i.rect&&i.rect.clone()||i.rect,rtlReorder:i.rtlReorder,unicodeConverter:i.unicodeConverter,materialAsset:i.materialAsset,material:i.material,color:i.color&&i.color.clone()||i.color,opacity:i.opacity,textureAsset:i.textureAsset,texture:i.texture,spriteAsset:i.spriteAsset,sprite:i.sprite,spriteFrame:i.spriteFrame,pixelsPerUnit:i.pixelsPerUnit,spacing:i.spacing,lineHeight:i.lineHeight,wrapLines:i.wrapLines,layers:i.layers,fontSize:i.fontSize,minFontSize:i.minFontSize,maxFontSize:i.maxFontSize,autoFitWidth:i.autoFitWidth,autoFitHeight:i.autoFitHeight,maxLines:i.maxLines,fontAsset:i.fontAsset,font:i.font,useInput:i.useInput,batchGroupId:i.batchGroupId,mask:i.mask,outlineColor:i.outlineColor&&i.outlineColor.clone()||i.outlineColor,outlineThickness:i.outlineThickness,shadowColor:i.shadowColor&&i.shadowColor.clone()||i.shadowColor,shadowOffset:i.shadowOffset&&i.shadowOffset.clone()||i.shadowOffset,enableMarkup:i.enableMarkup};return void 0!==i.key&&null!==i.key?n.key=i.key:n.text=i.text,this.addComponent(e,n)},i.getTextElementMaterial=function(t,e){return t?e?(this.defaultScreenSpaceTextMaterial||(this.defaultScreenSpaceTextMaterial=new os,this.defaultScreenSpaceTextMaterial.name="defaultScreenSpaceTextMaterial",this.defaultScreenSpaceTextMaterial.msdfMap=this._defaultTexture,this.defaultScreenSpaceTextMaterial.useLighting=!1,this.defaultScreenSpaceTextMaterial.useGammaTonemap=!1,this.defaultScreenSpaceTextMaterial.useFog=!1,this.defaultScreenSpaceTextMaterial.useSkybox=!1,this.defaultScreenSpaceTextMaterial.diffuse.set(0,0,0),this.defaultScreenSpaceTextMaterial.emissive.set(1,1,1),this.defaultScreenSpaceTextMaterial.opacity=.5,this.defaultScreenSpaceTextMaterial.blendType=4,this.defaultScreenSpaceTextMaterial.depthWrite=!1,this.defaultScreenSpaceTextMaterial.depthTest=!1,this.defaultScreenSpaceTextMaterial.emissiveVertexColor=!0,this.defaultScreenSpaceTextMaterial.update()),this.defaultScreenSpaceTextMaterial):(this.defaultScreenSpaceBitmapTextMaterial||(this.defaultScreenSpaceBitmapTextMaterial=new os,this.defaultScreenSpaceBitmapTextMaterial.name="defaultScreenSpaceBitmapTextMaterial",this.defaultScreenSpaceBitmapTextMaterial.emissive.set(.5,.5,.5),this.defaultScreenSpaceBitmapTextMaterial.emissiveMap=this._defaultTexture,this.defaultScreenSpaceBitmapTextMaterial.emissiveTint=!0,this.defaultScreenSpaceBitmapTextMaterial.opacity=.5,this.defaultScreenSpaceBitmapTextMaterial.opacityMap=this._defaultTexture,this.defaultScreenSpaceBitmapTextMaterial.opacityMapChannel="a",this.defaultScreenSpaceBitmapTextMaterial.useLighting=!1,this.defaultScreenSpaceBitmapTextMaterial.useGammaTonemap=!1,this.defaultScreenSpaceBitmapTextMaterial.useFog=!1,this.defaultScreenSpaceBitmapTextMaterial.useSkybox=!1,this.defaultScreenSpaceBitmapTextMaterial.diffuse.set(0,0,0),this.defaultScreenSpaceBitmapTextMaterial.blendType=4,this.defaultScreenSpaceBitmapTextMaterial.depthWrite=!1,this.defaultScreenSpaceBitmapTextMaterial.depthTest=!1,this.defaultScreenSpaceBitmapTextMaterial.emissiveVertexColor=!0,this.defaultScreenSpaceBitmapTextMaterial.update()),this.defaultScreenSpaceBitmapTextMaterial):e?(this.defaultTextMaterial||(this.defaultTextMaterial=new os,this.defaultTextMaterial.name="defaultTextMaterial",this.defaultTextMaterial.msdfMap=this._defaultTexture,this.defaultTextMaterial.useLighting=!1,this.defaultTextMaterial.useGammaTonemap=!1,this.defaultTextMaterial.useFog=!1,this.defaultTextMaterial.useSkybox=!1,this.defaultTextMaterial.diffuse.set(0,0,0),this.defaultTextMaterial.emissive.set(1,1,1),this.defaultTextMaterial.opacity=.5,this.defaultTextMaterial.blendType=4,this.defaultTextMaterial.depthWrite=!1,this.defaultTextMaterial.emissiveVertexColor=!0,this.defaultTextMaterial.update()),this.defaultTextMaterial):(this.defaultBitmapTextMaterial||(this.defaultBitmapTextMaterial=new os,this.defaultBitmapTextMaterial.name="defaultBitmapTextMaterial",this.defaultBitmapTextMaterial.emissive.set(.5,.5,.5),this.defaultBitmapTextMaterial.emissiveTint=!0,this.defaultBitmapTextMaterial.emissiveMap=this._defaultTexture,this.defaultBitmapTextMaterial.opacity=.5,this.defaultBitmapTextMaterial.opacityMap=this._defaultTexture,this.defaultBitmapTextMaterial.opacityMapChannel="a",this.defaultBitmapTextMaterial.useLighting=!1,this.defaultBitmapTextMaterial.useGammaTonemap=!1,this.defaultBitmapTextMaterial.useFog=!1,this.defaultBitmapTextMaterial.useSkybox=!1,this.defaultBitmapTextMaterial.diffuse.set(0,0,0),this.defaultBitmapTextMaterial.blendType=4,this.defaultBitmapTextMaterial.depthWrite=!1,this.defaultBitmapTextMaterial.emissiveVertexColor=!0,this.defaultBitmapTextMaterial.update()),this.defaultBitmapTextMaterial)},i._createBaseImageMaterial=function(){var t=new os;return t.diffuse.set(0,0,0),t.emissive.set(.5,.5,.5),t.emissiveMap=this._defaultTexture,t.emissiveTint=!0,t.opacityMap=this._defaultTexture,t.opacityMapChannel="a",t.opacityTint=!0,t.opacity=0,t.useLighting=!1,t.useGammaTonemap=!1,t.useFog=!1,t.useSkybox=!1,t.blendType=4,t.depthWrite=!1,t},i.getImageElementMaterial=function(t,e,i,n){return t?e?i?(this.defaultScreenSpaceImageMask9SlicedMaterial||(this.defaultScreenSpaceImageMask9SlicedMaterial=this._createBaseImageMaterial(),this.defaultScreenSpaceImageMask9SlicedMaterial.name="defaultScreenSpaceImageMask9SlicedMaterial",this.defaultScreenSpaceImageMask9SlicedMaterial.nineSlicedMode=1,this.defaultScreenSpaceImageMask9SlicedMaterial.depthTest=!1,this.defaultScreenSpaceImageMask9SlicedMaterial.alphaTest=1,this.defaultScreenSpaceImageMask9SlicedMaterial.redWrite=!1,this.defaultScreenSpaceImageMask9SlicedMaterial.greenWrite=!1,this.defaultScreenSpaceImageMask9SlicedMaterial.blueWrite=!1,this.defaultScreenSpaceImageMask9SlicedMaterial.alphaWrite=!1,this.defaultScreenSpaceImageMask9SlicedMaterial.update(),this.defaultImageMaterials.push(this.defaultScreenSpaceImageMask9SlicedMaterial)),this.defaultScreenSpaceImageMask9SlicedMaterial):n?(this.defaultScreenSpaceImageMask9TiledMaterial||(this.defaultScreenSpaceImageMask9TiledMaterial=this.defaultScreenSpaceImage9TiledMaterial.clone(),this.defaultScreenSpaceImageMask9TiledMaterial.name="defaultScreenSpaceImageMask9TiledMaterial",this.defaultScreenSpaceImageMask9TiledMaterial.nineSlicedMode=2,this.defaultScreenSpaceImageMask9TiledMaterial.depthTest=!1,this.defaultScreenSpaceImageMask9TiledMaterial.alphaTest=1,this.defaultScreenSpaceImageMask9TiledMaterial.redWrite=!1,this.defaultScreenSpaceImageMask9TiledMaterial.greenWrite=!1,this.defaultScreenSpaceImageMask9TiledMaterial.blueWrite=!1,this.defaultScreenSpaceImageMask9TiledMaterial.alphaWrite=!1,this.defaultScreenSpaceImageMask9TiledMaterial.update(),this.defaultImageMaterials.push(this.defaultScreenSpaceImageMask9TiledMaterial)),this.defaultScreenSpaceImageMask9TiledMaterial):(this.defaultScreenSpaceImageMaskMaterial||(this.defaultScreenSpaceImageMaskMaterial=this._createBaseImageMaterial(),this.defaultScreenSpaceImageMaskMaterial.name="defaultScreenSpaceImageMaskMaterial",this.defaultScreenSpaceImageMaskMaterial.depthTest=!1,this.defaultScreenSpaceImageMaskMaterial.alphaTest=1,this.defaultScreenSpaceImageMaskMaterial.redWrite=!1,this.defaultScreenSpaceImageMaskMaterial.greenWrite=!1,this.defaultScreenSpaceImageMaskMaterial.blueWrite=!1,this.defaultScreenSpaceImageMaskMaterial.alphaWrite=!1,this.defaultScreenSpaceImageMaskMaterial.update(),this.defaultImageMaterials.push(this.defaultScreenSpaceImageMaskMaterial)),this.defaultScreenSpaceImageMaskMaterial):i?(this.defaultScreenSpaceImage9SlicedMaterial||(this.defaultScreenSpaceImage9SlicedMaterial=this._createBaseImageMaterial(),this.defaultScreenSpaceImage9SlicedMaterial.name="defaultScreenSpaceImage9SlicedMaterial",this.defaultScreenSpaceImage9SlicedMaterial.nineSlicedMode=1,this.defaultScreenSpaceImage9SlicedMaterial.depthTest=!1,this.defaultScreenSpaceImage9SlicedMaterial.update(),this.defaultImageMaterials.push(this.defaultScreenSpaceImage9SlicedMaterial)),this.defaultScreenSpaceImage9SlicedMaterial):n?(this.defaultScreenSpaceImage9TiledMaterial||(this.defaultScreenSpaceImage9TiledMaterial=this._createBaseImageMaterial(),this.defaultScreenSpaceImage9TiledMaterial.name="defaultScreenSpaceImage9TiledMaterial",this.defaultScreenSpaceImage9TiledMaterial.nineSlicedMode=2,this.defaultScreenSpaceImage9TiledMaterial.depthTest=!1,this.defaultScreenSpaceImage9TiledMaterial.update(),this.defaultImageMaterials.push(this.defaultScreenSpaceImage9TiledMaterial)),this.defaultScreenSpaceImage9TiledMaterial):(this.defaultScreenSpaceImageMaterial||(this.defaultScreenSpaceImageMaterial=this._createBaseImageMaterial(),this.defaultScreenSpaceImageMaterial.name="defaultScreenSpaceImageMaterial",this.defaultScreenSpaceImageMaterial.depthTest=!1,this.defaultScreenSpaceImageMaterial.update(),this.defaultImageMaterials.push(this.defaultScreenSpaceImageMaterial)),this.defaultScreenSpaceImageMaterial):e?i?(this.defaultImage9SlicedMaskMaterial||(this.defaultImage9SlicedMaskMaterial=this._createBaseImageMaterial(),this.defaultImage9SlicedMaskMaterial.name="defaultImage9SlicedMaskMaterial",this.defaultImage9SlicedMaskMaterial.nineSlicedMode=1,this.defaultImage9SlicedMaskMaterial.alphaTest=1,this.defaultImage9SlicedMaskMaterial.redWrite=!1,this.defaultImage9SlicedMaskMaterial.greenWrite=!1,this.defaultImage9SlicedMaskMaterial.blueWrite=!1,this.defaultImage9SlicedMaskMaterial.alphaWrite=!1,this.defaultImage9SlicedMaskMaterial.update(),this.defaultImageMaterials.push(this.defaultImage9SlicedMaskMaterial)),this.defaultImage9SlicedMaskMaterial):n?(this.defaultImage9TiledMaskMaterial||(this.defaultImage9TiledMaskMaterial=this._createBaseImageMaterial(),this.defaultImage9TiledMaskMaterial.name="defaultImage9TiledMaskMaterial",this.defaultImage9TiledMaskMaterial.nineSlicedMode=2,this.defaultImage9TiledMaskMaterial.alphaTest=1,this.defaultImage9TiledMaskMaterial.redWrite=!1,this.defaultImage9TiledMaskMaterial.greenWrite=!1,this.defaultImage9TiledMaskMaterial.blueWrite=!1,this.defaultImage9TiledMaskMaterial.alphaWrite=!1,this.defaultImage9TiledMaskMaterial.update(),this.defaultImageMaterials.push(this.defaultImage9TiledMaskMaterial)),this.defaultImage9TiledMaskMaterial):(this.defaultImageMaskMaterial||(this.defaultImageMaskMaterial=this._createBaseImageMaterial(),this.defaultImageMaskMaterial.name="defaultImageMaskMaterial",this.defaultImageMaskMaterial.alphaTest=1,this.defaultImageMaskMaterial.redWrite=!1,this.defaultImageMaskMaterial.greenWrite=!1,this.defaultImageMaskMaterial.blueWrite=!1,this.defaultImageMaskMaterial.alphaWrite=!1,this.defaultImageMaskMaterial.update(),this.defaultImageMaterials.push(this.defaultImageMaskMaterial)),this.defaultImageMaskMaterial):i?(this.defaultImage9SlicedMaterial||(this.defaultImage9SlicedMaterial=this._createBaseImageMaterial(),this.defaultImage9SlicedMaterial.name="defaultImage9SlicedMaterial",this.defaultImage9SlicedMaterial.nineSlicedMode=1,this.defaultImage9SlicedMaterial.update(),this.defaultImageMaterials.push(this.defaultImage9SlicedMaterial)),this.defaultImage9SlicedMaterial):n?(this.defaultImage9TiledMaterial||(this.defaultImage9TiledMaterial=this._createBaseImageMaterial(),this.defaultImage9TiledMaterial.name="defaultImage9TiledMaterial",this.defaultImage9TiledMaterial.nineSlicedMode=2,this.defaultImage9TiledMaterial.update(),this.defaultImageMaterials.push(this.defaultImage9TiledMaterial)),this.defaultImage9TiledMaterial):(this.defaultImageMaterial||(this.defaultImageMaterial=this._createBaseImageMaterial(),this.defaultImageMaterial.name="defaultImageMaterial",this.defaultImageMaterial.update(),this.defaultImageMaterials.push(this.defaultImageMaterial)),this.defaultImageMaterial)},i.registerUnicodeConverter=function(t){this._unicodeConverter=t},i.registerRtlReorder=function(t){this._rtlReorder=t},i.getUnicodeConverter=function(){return this._unicodeConverter},i.getRtlReorder=function(){return this._rtlReorder},e}(ud);du._buildAccessors($p.prototype,tm);var im="free",nm="limited",sm="locked",am=["angularDampingX","angularDampingY","angularDampingZ","angularEquilibriumX","angularEquilibriumY","angularEquilibriumZ","angularLimitsX","angularLimitsY","angularLimitsZ","angularMotionX","angularMotionY","angularMotionZ","angularSpringX","angularSpringY","angularSpringZ","angularStiffnessX","angularStiffnessY","angularStiffnessZ","breakForce","enableCollision","enabled","entityA","entityB","linearDampingX","linearDampingY","linearDampingZ","linearEquilibriumX","linearEquilibriumY","linearEquilibriumZ","linearLimitsX","linearLimitsY","linearLimitsZ","linearMotionX","linearMotionY","linearMotionZ","linearSpringX","linearSpringY","linearSpringZ","linearStiffnessX","linearStiffnessY","linearStiffnessZ"],rm=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._constraint=null,n._entityA=null,n._entityB=null,n._breakForce=34e37,n._enableCollision=!0,n._linearMotionX=sm,n._linearLimitsX=new mt(0,0),n._linearSpringX=!1,n._linearStiffnessX=0,n._linearDampingX=1,n._linearEquilibriumX=0,n._linearMotionY=sm,n._linearLimitsY=new mt(0,0),n._linearSpringY=!1,n._linearStiffnessY=0,n._linearDampingY=1,n._linearEquilibriumY=0,n._linearMotionZ=sm,n._linearLimitsZ=new mt(0,0),n._linearSpringZ=!1,n._linearStiffnessZ=0,n._linearDampingZ=1,n._linearEquilibriumZ=0,n._angularMotionX=sm,n._angularLimitsX=new mt(0,0),n._angularSpringX=!1,n._angularStiffnessX=0,n._angularDampingX=1,n._angularEquilibriumX=0,n._angularMotionY=sm,n._angularLimitsY=new mt(0,0),n._angularSpringY=!1,n._angularStiffnessY=0,n._angularDampingY=1,n._angularEquilibriumY=0,n._angularMotionZ=sm,n._angularLimitsZ=new mt(0,0),n._angularSpringZ=!1,n._angularEquilibriumZ=0,n._angularDampingZ=1,n._angularStiffnessZ=0,n.on("set_enabled",n._onSetEnabled,Z(n)),n}Y(e,t);var i=e.prototype;return i._convertTransform=function(t,e){var i=t.getTranslation(),n=new wt;n.setFromMat4(t);var s=new Ammo.btVector3(i.x,i.y,i.z),a=new Ammo.btQuaternion(n.x,n.y,n.z,n.w);e.setOrigin(s),e.setRotation(a),Ammo.destroy(s),Ammo.destroy(a)},i._updateAngularLimits=function(){var t=this._constraint;if(t){var e,i,n,s,a,r;this._angularMotionX===nm?(e=this._angularLimitsX.x*rt.DEG_TO_RAD,s=this._angularLimitsX.y*rt.DEG_TO_RAD):this._angularMotionX===im?(e=1,s=0):e=s=0,this._angularMotionY===nm?(i=this._angularLimitsY.x*rt.DEG_TO_RAD,a=this._angularLimitsY.y*rt.DEG_TO_RAD):this._angularMotionY===im?(i=1,a=0):i=a=0,this._angularMotionZ===nm?(n=this._angularLimitsZ.x*rt.DEG_TO_RAD,r=this._angularLimitsZ.y*rt.DEG_TO_RAD):this._angularMotionZ===im?(n=1,r=0):n=r=0;var o=new Ammo.btVector3(e,i,n);t.setAngularLowerLimit(o),o.setValue(s,a,r),t.setAngularUpperLimit(o),Ammo.destroy(o)}},i._updateLinearLimits=function(){var t=this._constraint;if(t){var e,i,n,s,a,r;this._linearMotionX===nm?(e=this._linearLimitsX.x,s=this._linearLimitsX.y):this._linearMotionX===im?(e=1,s=0):e=s=0,this._linearMotionY===nm?(i=this._linearLimitsY.x,a=this._linearLimitsY.y):this._linearMotionY===im?(i=1,a=0):i=a=0,this._linearMotionZ===nm?(n=this._linearLimitsZ.x,r=this._linearLimitsZ.y):this._linearMotionZ===im?(n=1,r=0):n=r=0;var o=new Ammo.btVector3(e,i,n);t.setLinearLowerLimit(o),o.setValue(s,a,r),t.setLinearUpperLimit(o),Ammo.destroy(o)}},i._createConstraint=function(){if(this._entityA&&this._entityA.rigidbody){this._destroyConstraint();var t=new St,e=this._entityA.rigidbody.body;e.activate();var i=this.entity.getWorldTransform(),n=this._entityA.getWorldTransform().clone().invert();t.mul2(n,i);var s=new Ammo.btTransform;if(this._convertTransform(t,s),this._entityB&&this._entityB.rigidbody){var a=this._entityB.rigidbody.body;a.activate();var r=this._entityB.getWorldTransform().clone().invert();t.mul2(r,i);var o=new Ammo.btTransform;this._convertTransform(t,o),this._constraint=new Ammo.btGeneric6DofSpringConstraint(e,a,s,o,!this._enableCollision),Ammo.destroy(o)}else this._constraint=new Ammo.btGeneric6DofSpringConstraint(e,s,!this._enableCollision);Ammo.destroy(s);for(var h=["X","Y","Z","X","Y","Z"],l=0;l<6;l++){var c=l<3?"_linear":"_angular";this._constraint.enableSpring(l,this[c+"Spring"+h[l]]),this._constraint.setDamping(l,this[c+"Damping"+h[l]]),this._constraint.setEquilibriumPoint(l,this[c+"Equilibrium"+h[l]]),this._constraint.setStiffness(l,this[c+"Stiffness"+h[l]])}this._constraint.setBreakingImpulseThreshold(this._breakForce),this._updateLinearLimits(),this._updateAngularLimits(),this.system.app.systems.rigidbody.dynamicsWorld.addConstraint(this._constraint,!this._enableCollision)}},i._destroyConstraint=function(){this._constraint&&(this.system.app.systems.rigidbody.dynamicsWorld.removeConstraint(this._constraint),Ammo.destroy(this._constraint),this._constraint=null)},i.initFromData=function(t){for(var e,i=Q(am);!(e=i()).done;){var n=e.value;t.hasOwnProperty(n)&&(t[n]instanceof mt?this["_"+n].copy(t[n]):this["_"+n]=t[n])}this._createConstraint()},i.onEnable=function(){this._createConstraint()},i.onDisable=function(){this._destroyConstraint()},i._onSetEnabled=function(t,e,i){},i._onBeforeRemove=function(){this.fire("remove")},q(e,[{key:"entityA",get:function(){return this._entityA},set:function(t){this._destroyConstraint(),this._entityA=t,this._createConstraint()}},{key:"entityB",get:function(){return this._entityB},set:function(t){this._destroyConstraint(),this._entityB=t,this._createConstraint()}},{key:"breakForce",get:function(){return this._breakForce},set:function(t){this._constraint&&this._breakForce!==t&&(this._constraint.setBreakingImpulseThreshold(t),this._breakForce=t)}},{key:"enableCollision",get:function(){return this._enableCollision},set:function(t){this._destroyConstraint(),this._enableCollision=t,this._createConstraint()}},{key:"angularLimitsX",get:function(){return this._angularLimitsX},set:function(t){this._angularLimitsX.equals(t)||(this._angularLimitsX.copy(t),this._updateAngularLimits())}},{key:"angularMotionX",get:function(){return this._angularMotionX},set:function(t){this._angularMotionX!==t&&(this._angularMotionX=t,this._updateAngularLimits())}},{key:"angularLimitsY",get:function(){return this._angularLimitsY},set:function(t){this._angularLimitsY.equals(t)||(this._angularLimitsY.copy(t),this._updateAngularLimits())}},{key:"angularMotionY",get:function(){return this._angularMotionY},set:function(t){this._angularMotionY!==t&&(this._angularMotionY=t,this._updateAngularLimits())}},{key:"angularLimitsZ",get:function(){return this._angularLimitsZ},set:function(t){this._angularLimitsZ.equals(t)||(this._angularLimitsZ.copy(t),this._updateAngularLimits())}},{key:"angularMotionZ",get:function(){return this._angularMotionZ},set:function(t){this._angularMotionZ!==t&&(this._angularMotionZ=t,this._updateAngularLimits())}},{key:"linearLimitsX",get:function(){return this._linearLimitsX},set:function(t){this._linearLimitsX.equals(t)||(this._linearLimitsX.copy(t),this._updateLinearLimits())}},{key:"linearMotionX",get:function(){return this._linearMotionX},set:function(t){this._linearMotionX!==t&&(this._linearMotionX=t,this._updateLinearLimits())}},{key:"linearLimitsY",get:function(){return this._linearLimitsY},set:function(t){this._linearLimitsY.equals(t)||(this._linearLimitsY.copy(t),this._updateLinearLimits())}},{key:"linearMotionY",get:function(){return this._linearMotionY},set:function(t){this._linearMotionY!==t&&(this._linearMotionY=t,this._updateLinearLimits())}},{key:"linearLimitsZ",get:function(){return this._linearLimitsZ},set:function(t){this._linearLimitsZ.equals(t)||(this._linearLimitsZ.copy(t),this._updateLinearLimits())}},{key:"linearMotionZ",get:function(){return this._linearMotionZ},set:function(t){this._linearMotionZ!==t&&(this._linearMotionZ=t,this._updateLinearLimits())}}]),e}(du),om={Damping:"setDamping",Equilibrium:"setEquilibriumPoint",Spring:"enableSpring",Stiffness:"setStiffness"};["linear","angular"].forEach((function(t){["Damping","Equilibrium","Spring","Stiffness"].forEach((function(e){["X","Y","Z"].forEach((function(i){var n=t+e+i,s="_"+n,a="linear"===t?0:3;"Y"===i&&(a+=1),"Z"===i&&(a+=2),Object.defineProperty(rm.prototype,n,{get:function(){return this[s]},set:function(t){this[s]!==t&&(this[s]=t,this._constraint[om[e]](a,t))}})}))}))}));var hm=function(){this.enabled=!0},lm=["enabled"],cm=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="joint",i.app=e,i.ComponentType=rm,i.DataType=hm,i.schema=lm,i}return Y(e,t),e.prototype.initializeComponentData=function(t,e,i){t.initFromData(e)},e}(ud);du._buildAccessors(rm.prototype,lm);var um=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._minWidth=0,n._minHeight=0,n._maxWidth=null,n._maxHeight=null,n._fitWidthProportion=0,n._fitHeightProportion=0,n._excludeFromLayout=!1,n}return Y(e,t),q(e,[{key:"minWidth",get:function(){return this._minWidth},set:function(t){t!==this._minWidth&&(this._minWidth=t,this.fire("resize"))}},{key:"minHeight",get:function(){return this._minHeight},set:function(t){t!==this._minHeight&&(this._minHeight=t,this.fire("resize"))}},{key:"maxWidth",get:function(){return this._maxWidth},set:function(t){t!==this._maxWidth&&(this._maxWidth=t,this.fire("resize"))}},{key:"maxHeight",get:function(){return this._maxHeight},set:function(t){t!==this._maxHeight&&(this._maxHeight=t,this.fire("resize"))}},{key:"fitWidthProportion",get:function(){return this._fitWidthProportion},set:function(t){t!==this._fitWidthProportion&&(this._fitWidthProportion=t,this.fire("resize"))}},{key:"fitHeightProportion",get:function(){return this._fitHeightProportion},set:function(t){t!==this._fitHeightProportion&&(this._fitHeightProportion=t,this.fire("resize"))}},{key:"excludeFromLayout",get:function(){return this._excludeFromLayout},set:function(t){t!==this._excludeFromLayout&&(this._excludeFromLayout=t,this.fire("resize"))}}]),e}(du),dm=function(){this.enabled=!0},fm=["enabled"],pm=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="layoutchild",i.ComponentType=um,i.DataType=dm,i.schema=fm,i}Y(e,t);var i=e.prototype;return i.initializeComponentData=function(e,i,n){void 0!==i.enabled&&(e.enabled=i.enabled),void 0!==i.minWidth&&(e.minWidth=i.minWidth),void 0!==i.minHeight&&(e.minHeight=i.minHeight),void 0!==i.maxWidth&&(e.maxWidth=i.maxWidth),void 0!==i.maxHeight&&(e.maxHeight=i.maxHeight),void 0!==i.fitWidthProportion&&(e.fitWidthProportion=i.fitWidthProportion),void 0!==i.fitHeightProportion&&(e.fitHeightProportion=i.fitHeightProportion),void 0!==i.excludeFromLayout&&(e.excludeFromLayout=i.excludeFromLayout),t.prototype.initializeComponentData.call(this,e,i,n)},i.cloneComponent=function(t,e){var i=t.layoutchild;return this.addComponent(e,{enabled:i.enabled,minWidth:i.minWidth,minHeight:i.minHeight,maxWidth:i.maxWidth,maxHeight:i.maxHeight,fitWidthProportion:i.fitWidthProportion,fitHeightProportion:i.fitHeightProportion,excludeFromLayout:i.excludeFromLayout})},e}(ud);du._buildAccessors(um.prototype,fm);var mm={0:{axis:"x",size:"width",calculatedSize:"calculatedWidth",minSize:"minWidth",maxSize:"maxWidth",fitting:"widthFitting",fittingProportion:"fitWidthProportion"},1:{axis:"y",size:"height",calculatedSize:"calculatedHeight",minSize:"minHeight",maxSize:"maxHeight",fitting:"heightFitting",fittingProportion:"fitHeightProportion"}},_m={0:1,1:0},gm={minWidth:0,minHeight:0,maxWidth:Number.POSITIVE_INFINITY,maxHeight:Number.POSITIVE_INFINITY,width:null,height:null,fitWidthProportion:0,fitHeightProportion:0},vm="NONE",ym="APPLY_STRETCHING",xm="APPLY_SHRINKING",bm=new mt;function Sm(t){var e,i=mm[t],n=mm[_m[t]];function s(t,e){return-e[i.size]*t.pivot[i.axis]}function a(t,e){return-e[n.size]*t.pivot[n.axis]}function r(t,e){return e[i.size]*(1-t.pivot[i.axis])}function o(t){var e=t.entity.layoutchild;return!e||!e.enabled||!e.excludeFromLayout}function h(t,e,i){switch(t){case 0:return vm;case 1:return e=i?xm:vm;case 3:return e=0;--n)i[e[n]]=i[e[n+1]]+t[e[n]];return i}return function(t,d){t=t.filter(o),e=d,bm.x=e.containerSize.x-e.padding.x-e.padding.z,bm.y=e.containerSize.y-e.padding.y-e.padding.w,function(t){for(var e=0;e0&&(a+=e.spacing[i.axis]);var h=s[o][i.size];a+=h,!r&&a>bm[i.axis]&&0!==n[n.length-1].length&&(a=h,n.push([])),n[n.length-1].push(t[o]),r&&a>bm[i.axis]&&o!==t.length-1&&(a=0,n.push([]))}return n}(t)),m=function(t,i){for(var s=[],a=[],r=0;ro.largestSize[n.size]&&(o.largestElement=o[d],o.largestSize=f)}s.push(o.largestElement),a.push(o.largestSize)}var p=l(a,n),m=h(e[n.fitting],p,bm[n.axis]);m===ym?c(a,p,n):m===xm&&u(a,p,n);for(var _=0;_0;){var e=this._reflowQueue.slice();this._reflowQueue.length=0,e.sort((function(t,e){return t.entity.graphDepth-e.entity.graphDepth}));for(var i=0;i=100){console.warn("Max reflow iterations limit reached, bailing.");break}}},i._onRemoveComponent=function(t,e){e.onRemove()},i.destroy=function(){t.prototype.destroy.call(this),this.app.systems.off("postUpdate",this._onPostUpdate,this)},e}(ud);du._buildAccessors(Cm.prototype,Pm);var Im=[],Lm=[],Dm=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._cookieAsset=null,n._cookieAssetId=null,n._cookieAssetAdd=!1,n._cookieMatrix=null,n}Y(e,t);var i=e.prototype;return i.addLightToLayers=function(){for(var t=0;t=0&&this.enabled&&this.entity.enabled&&t.addLight(this)},i.onLayerRemoved=function(t){this.layers.indexOf(t.id)>=0&&t.removeLight(this)},i.refreshProperties=function(){for(var t=0;t=0&&t.batcher.insert(Aa.MODEL,this.batchGroupId,this.entity)},i.onDisable=function(){var t=this.system.app,e=t.scene;e.off("set:layers",this.onLayersChanged,this),e.layers&&(e.layers.off("add",this.onLayerAdded,this),e.layers.off("remove",this.onLayerRemoved,this)),this._batchGroupId>=0&&t.batcher.remove(Aa.MODEL,this.batchGroupId,this.entity),this._model&&this.removeModelFromLayers()},i.hide=function(){if(this._model)for(var t=this._model.meshInstances,e=0,i=t.length;e=0&&e.remove(Aa.MODEL,this.batchGroupId,this.entity),this.entity.enabled&&t>=0&&e.insert(Aa.MODEL,t,this.entity),t<0&&this._batchGroupId>=0&&this.enabled&&this.entity.enabled&&this.addModelToLayers(),this._batchGroupId=t}}},{key:"materialAsset",get:function(){return this._materialAsset},set:function(t){var e=t;t instanceof Oh&&(e=t.id);var i=this.system.app.assets;if(e!==this._materialAsset){if(this._materialAsset){i.off("add:"+this._materialAsset,this._onMaterialAssetAdd,this);var n=i.get(this._materialAsset);n&&this._unbindMaterialAsset(n)}if(this._materialAsset=e,this._materialAsset){var s=i.get(this._materialAsset);s?this._bindMaterialAsset(s):(this._setMaterial(this.system.defaultMaterial),i.on("add:"+this._materialAsset,this._onMaterialAssetAdd,this))}else this._setMaterial(this.system.defaultMaterial)}}},{key:"material",get:function(){return this._material},set:function(t){this._material!==t&&(this.materialAsset=null,this._setMaterial(t))}},{key:"mapping",get:function(){return this._mapping},set:function(t){if("asset"===this._type&&(this._unsetMaterialEvents(),t||(t={}),this._mapping=t,this._model))for(var e=this._model.meshInstances,i=this.asset?this.system.app.assets.get(this.asset):null,n=i?i.data.mapping:null,s=null,a=0,r=e.length;a=0&&t.batcher.insert(Aa.RENDER,this.batchGroupId,this.entity)},i.onDisable=function(){var t=this.system.app,e=t.scene;e.off("set:layers",this.onLayersChanged,this),e.layers&&(e.layers.off("add",this.onLayerAdded,this),e.layers.off("remove",this.onLayerRemoved,this)),this._batchGroupId>=0&&t.batcher.remove(Aa.RENDER,this.batchGroupId,this.entity),this.removeFromLayers()},i.hide=function(){if(this._meshInstances)for(var t=0;t=0&&e.remove(Aa.RENDER,this.batchGroupId,this.entity),this.entity.enabled&&t>=0&&e.insert(Aa.RENDER,t,this.entity),t<0&&this._batchGroupId>=0&&this.enabled&&this.entity.enabled&&this.addToLayers(),this._batchGroupId=t}}},{key:"material",get:function(){return this._material},set:function(t){if(this._material!==t&&(this._material=t,this._meshInstances&&"asset"!==this._type))for(var e=0;et.length){for(var e=t.length;e=P)&&this.calcSpawnPosition(i,n,s,a,M);var k=R>0&&R0&&(1===u.emitterShape?(Qm.copy(Jm).mulScalar(2).sub(ft.ONE).normalize(),i_.add(Qm.mulScalar(u.initialVelocity))):i_.add(ft.FORWARD.mulScalar(u.initialVelocity))),e_.x+=(n_.x-e_.x)*Jm.x,e_.y+=(n_.y-e_.y)*Jm.y,e_.z+=(n_.z-e_.z)*Jm.z,_+=(g-_)*Jm.y,L=(L+1e4*C%1*(v-L))*Ym,D=1e3*C%1*(x-y),u.meshInstance.node&&(u.localSpace?(i_.x/=Wm.x,i_.y/=Wm.y,i_.z/=Wm.z):Km.transformPoint(i_,i_)),u.localSpace?(Zm.transformPoint(e_,e_),i_.add(e_).add(a_)):(i_.add(e_.mul(Wm)),i_.add(a_.mul(Wm))),h_.copy(i_),r_.copy(t_).add(i_.mulScalar(r)),o_.copy(r_),i[4*M]=o_.x,i[4*M+1]=o_.y,i[4*M+2]=o_.z,i[4*M+3]+=_*r,u.wrap&&u.wrapBounds&&(u.localSpace||o_.sub(a),o_.x=d_(o_.x,u.wrapBounds.x)-.5*u.wrapBounds.x,o_.y=d_(o_.y,u.wrapBounds.y)-.5*u.wrapBounds.y,o_.z=d_(o_.z,u.wrapBounds.z)-.5*u.wrapBounds.z,u.localSpace||o_.add(a)),u.sort>0&&(1===u.sort?(l_.copy(o_).sub(S),u.particleDistance[M]=-(l_.x*l_.x+l_.y*l_.y+l_.z*l_.z)):2===u.sort?u.particleDistance[M]=R:3===u.sort&&(u.particleDistance[M]=-R))),o?R<0&&(i[4*M+3+2*u.numParticlesPot*4]=-1):(R>=P&&(R-=Math.max(P,(u.numParticles-1)*E),i[4*M+3+2*u.numParticlesPot*4]=u.loop?1:-1),R<0&&u.loop&&(i[4*M+3+2*u.numParticlesPot*4]=1)),i[4*M+3+2*u.numParticlesPot*4]<0&&(k=!1),i[4*M+3+4*u.numParticlesPot]=R;for(var O=0;O0&&u.camera){for(var V=u.useMesh?6:4,W=u.particleDistance,G=0;Gt.maxTextureSize&&(this.numParticles=t.maxTextureSize),k_("rate",1),k_("rate2",this.rate),k_("lifetime",50),k_("emitterExtents",new ft(0,0,0)),k_("emitterExtentsInner",new ft(0,0,0)),k_("emitterRadius",0),k_("emitterRadiusInner",0),k_("emitterShape",0),k_("initialVelocity",1),k_("wrap",!1),k_("localSpace",!1),k_("screenSpace",!1),k_("wrapBounds",null),k_("colorMap",this.defaultParamTexture),k_("normalMap",null),k_("loop",!0),k_("preWarm",!1),k_("sort",0),k_("mode",0),k_("scene",null),k_("lighting",!1),k_("halfLambert",!1),k_("intensity",1),k_("stretch",0),k_("alignToMotion",!1),k_("depthSoftening",0),k_("mesh",null),k_("particleNormal",new ft(0,1,0)),k_("orientation",0),k_("depthWrite",!1),k_("noFog",!1),k_("blendType",2),k_("node",null),k_("startAngle",0),k_("startAngle2",this.startAngle),k_("animTilesX",1),k_("animTilesY",1),k_("animStartFrame",0),k_("animNumFrames",1),k_("animNumAnimations",1),k_("animIndex",0),k_("randomizeAnimIndex",!1),k_("animSpeed",1),k_("animLoop",!0),this._gpuUpdater=new v_(this,i),this._cpuUpdater=new p_(this),this.constantLightCube=i.scope.resolve("lightCube[0]"),this.emitterPosUniform=new Float32Array(3),this.wrapBoundsUniform=new Float32Array(3),this.emitterScaleUniform=new Float32Array([1,1,1]),k_("colorGraph",C_),k_("colorGraph2",this.colorGraph),k_("scaleGraph",A_),k_("scaleGraph2",this.scaleGraph),k_("alphaGraph",A_),k_("alphaGraph2",this.alphaGraph),k_("localVelocityGraph",M_),k_("localVelocityGraph2",this.localVelocityGraph),k_("velocityGraph",M_),k_("velocityGraph2",this.velocityGraph),k_("rotationSpeedGraph",T_),k_("rotationSpeedGraph2",this.rotationSpeedGraph),k_("radialSpeedGraph",T_),k_("radialSpeedGraph2",this.radialSpeedGraph),this.lightCube=new Float32Array(18),this.lightCubeDir=new Array(6),this.lightCubeDir[0]=new ft(-1,0,0),this.lightCubeDir[1]=new ft(1,0,0),this.lightCubeDir[2]=new ft(0,-1,0),this.lightCubeDir[3]=new ft(0,1,0),this.lightCubeDir[4]=new ft(0,0,-1),this.lightCubeDir[5]=new ft(0,0,1),this.animTilesParams=new Float32Array(2),this.animParams=new Float32Array(4),this.animIndexParams=new Float32Array(2),this.internalTex0=null,this.internalTex1=null,this.internalTex2=null,this.colorParam=null,this.vbToSort=null,this.vbOld=null,this.particleDistance=null,this.camera=null,this.swapTex=!1,this.useMesh=!0,this.useCpu=!t.supportsGpuParticles,this.pack8=!0,this.localBounds=new Pt,this.worldBoundsNoTrail=new Pt,this.worldBoundsTrail=[new Pt,new Pt],this.worldBounds=new Pt,this.worldBoundsSize=new ft,this.prevWorldBoundsSize=new ft,this.prevWorldBoundsCenter=new ft,this.prevEmitterExtents=this.emitterExtents,this.prevEmitterRadius=this.emitterRadius,this.worldBoundsMul=new ft,this.worldBoundsAdd=new ft,this.timeToSwitchBounds=0,this.shaderParticleUpdateRespawn=null,this.shaderParticleUpdateNoRespawn=null,this.shaderParticleUpdateOnStop=null,this.numParticleVerts=0,this.numParticleIndices=0,this.material=null,this.meshInstance=null,this.drawOrder=0,this.seed=Math.random(),this.fixedTimeStep=1/60,this.maxSubSteps=10,this.simTime=0,this.simTimeTotal=0,this.beenReset=!1,this._layer=null,this.rebuild()}var e=t.prototype;return e.onChangeCamera=function(){this.regenShader(),this.resetMaterial()},e.calculateBoundsMad=function(){this.worldBoundsMul.x=1/this.worldBoundsSize.x,this.worldBoundsMul.y=1/this.worldBoundsSize.y,this.worldBoundsMul.z=1/this.worldBoundsSize.z,this.worldBoundsAdd.copy(this.worldBounds.center).mul(this.worldBoundsMul).mulScalar(-1),this.worldBoundsAdd.x+=.5,this.worldBoundsAdd.y+=.5,this.worldBoundsAdd.z+=.5},e.calculateWorldBounds=function(){if(this.node){if(this.prevWorldBoundsSize.copy(this.worldBoundsSize),this.prevWorldBoundsCenter.copy(this.worldBounds.center),!this.useCpu){(0===this.emitterShape?!this.emitterExtents.equals(this.prevEmitterExtents):!(this.emitterRadius===this.prevEmitterRadius))&&this.calculateLocalBounds()}var t=this.node.getWorldTransform();this.localSpace?this.worldBoundsNoTrail.copy(this.localBounds):this.worldBoundsNoTrail.setFromTransformedAabb(this.localBounds,t),this.worldBoundsTrail[0].add(this.worldBoundsNoTrail),this.worldBoundsTrail[1].add(this.worldBoundsNoTrail);var e=this.simTimeTotal;e>=this.timeToSwitchBounds&&(this.worldBoundsTrail[0].copy(this.worldBoundsTrail[1]),this.worldBoundsTrail[1].copy(this.worldBoundsNoTrail),this.timeToSwitchBounds=e+this.lifetime),this.worldBounds.copy(this.worldBoundsTrail[0]),this.worldBoundsSize.copy(this.worldBounds.halfExtents).mulScalar(2),this.localSpace?(this.meshInstance.aabb.setFromTransformedAabb(this.worldBounds,t),this.meshInstance.mesh.aabb.setFromTransformedAabb(this.worldBounds,t)):(this.meshInstance.aabb.copy(this.worldBounds),this.meshInstance.mesh.aabb.copy(this.worldBounds)),this.meshInstance._aabbVer=1-this.meshInstance._aabbVer,this.pack8&&this.calculateBoundsMad()}},e.resetWorldBounds=function(){this.node&&(this.worldBoundsNoTrail.setFromTransformedAabb(this.localBounds,this.localSpace?St.IDENTITY:this.node.getWorldTransform()),this.worldBoundsTrail[0].copy(this.worldBoundsNoTrail),this.worldBoundsTrail[1].copy(this.worldBoundsNoTrail),this.worldBounds.copy(this.worldBoundsTrail[0]),this.worldBoundsSize.copy(this.worldBounds.halfExtents).mulScalar(2),this.prevWorldBoundsSize.copy(this.worldBoundsSize),this.prevWorldBoundsCenter.copy(this.worldBounds.center),this.simTimeTotal=0,this.timeToSwitchBounds=0)},e.calculateLocalBounds=function(){for(var t,e,i,n=Number.MAX_VALUE,s=Number.MAX_VALUE,a=Number.MAX_VALUE,r=-Number.MAX_VALUE,o=-Number.MAX_VALUE,h=-Number.MAX_VALUE,l=0,c=0,u=this.lifetime/this.precision,d=[this.qVelocity,this.qVelocity2],f=[this.qLocalVelocity,this.qLocalVelocity2],p=[0,0],m=[0,0],_=[0,0],g=[0,0],v=[0,0],y=0;y0||t.maxVertexTextures<=1||t.fragmentUniformsCount<64||t.forceCpuParticles||!t.extTextureFloat,this._destroyResources(),this.pack8=(this.pack8||!t.textureFloatRenderable)&&!this.useCpu,E_=this.useCpu||this.pack8?4:2,this.useMesh=!1,this.mesh)&&(this.numParticles*this.mesh.vertexBuffer.numVertices>65535||(this.useMesh=!0));this.numParticlesPot=rt.nextPowerOfTwo(this.numParticles),this.rebuildGraphs(),this.calculateLocalBounds(),this.resetWorldBounds(),this.node&&(this.worldBounds.setFromTransformedAabb(this.localBounds,this.localSpace?St.IDENTITY:this.node.getWorldTransform()),this.worldBoundsTrail[0].copy(this.worldBounds),this.worldBoundsTrail[1].copy(this.worldBounds),this.worldBoundsSize.copy(this.worldBounds.halfExtents).mulScalar(2),this.prevWorldBoundsSize.copy(this.worldBoundsSize),this.prevWorldBoundsCenter.copy(this.worldBounds.center),this.pack8&&this.calculateBoundsMad()),this.vbToSort=new Array(this.numParticles);for(var e=0;e=1&&(this.animTilesX>1||this.animTilesY>1)&&(this.colorMap&&this.colorMap!==this.defaultParamTexture||this.normalMap)},e.rebuildGraphs=function(){var t=this.precision,e=this.graphicsDevice;this.qLocalVelocity=this.localVelocityGraph.quantize(t),this.qVelocity=this.velocityGraph.quantize(t),this.qColor=this.colorGraph.quantizeClamped(t,0,1),this.qRotSpeed=this.rotationSpeedGraph.quantize(t),this.qScale=this.scaleGraph.quantize(t),this.qAlpha=this.alphaGraph.quantize(t),this.qRadialSpeed=this.radialSpeedGraph.quantize(t),this.qLocalVelocity2=this.localVelocityGraph2.quantize(t),this.qVelocity2=this.velocityGraph2.quantize(t),this.qColor2=this.colorGraph2.quantizeClamped(t,0,1),this.qRotSpeed2=this.rotationSpeedGraph2.quantize(t),this.qScale2=this.scaleGraph2.quantize(t),this.qAlpha2=this.alphaGraph2.quantize(t),this.qRadialSpeed2=this.radialSpeedGraph2.quantize(t);for(var i=0;i0&&t.setParameter("softening",1/(this.depthSoftening*this.depthSoftening*100)),this.stretch>0&&(t.cull=0),this._compParticleFaceParams()},e._compParticleFaceParams=function(){var t,e;if(0===this.orientation)t=new Float32Array([1,0,0]),e=new Float32Array([0,0,1]);else{var i;if(1===this.orientation)i=this.particleNormal.normalize();else i=(null===this.node?St.IDENTITY:this.node.getWorldTransform()).transformVector(this.particleNormal).normalize();var n=new ft(1,0,0);1===Math.abs(n.dot(i))&&n.set(0,0,1);var s=(new ft).cross(i,n).normalize();n.cross(s,i).normalize(),t=new Float32Array([n.x,n.y,n.z]),e=new Float32Array([s.x,s.y,s.z])}this.material.setParameter("faceTangent",t),this.material.setParameter("faceBinorm",e)},e._allocate=function(t){var e=t*this.numParticleVerts,i=t*this.numParticleIndices;if(void 0===this.vertexBuffer||this.vertexBuffer.getNumVertices()!==e){if(this.useCpu){var n=[{semantic:Ae,components:4,type:6},{semantic:Me,components:4,type:6},{semantic:Ce,components:4,type:6},{semantic:Ee,components:1,type:6},{semantic:Pe,components:this.useMesh?4:2,type:6}],s=new si(this.graphicsDevice,n);this.vertexBuffer=new ii(this.graphicsDevice,s,e,1),this.indexBuffer=new ws(this.graphicsDevice,1,i)}else{var a=[{semantic:Ae,components:4,type:6}];this.useMesh&&a.push({semantic:Me,components:2,type:6});var r=new si(this.graphicsDevice,a);this.vertexBuffer=new ii(this.graphicsDevice,r,e,1),this.indexBuffer=new ws(this.graphicsDevice,1,i)}var o,h,l,c=new Float32Array(this.vertexBuffer.lock());if(this.useMesh){h=(o=new Float32Array(this.mesh.vertexBuffer.lock())).length/this.mesh.vertexBuffer.numVertices;for(var u=0;uthis.endTime&&(this.onFinished&&this.onFinished(),this.meshInstance.visible=!1),this.meshInstance&&(this.meshInstance.drawOrder=this.drawOrder)},e._destroyResources=function(){this.particleTexIN&&(this.particleTexIN.destroy(),this.particleTexIN=null),this.particleTexOUT&&(this.particleTexOUT.destroy(),this.particleTexOUT=null),this.particleTexStart&&this.particleTexStart.destroy&&(this.particleTexStart.destroy(),this.particleTexStart=null),this.rtParticleTexIN&&(this.rtParticleTexIN.destroy(),this.rtParticleTexIN=null),this.rtParticleTexOUT&&(this.rtParticleTexOUT.destroy(),this.rtParticleTexOUT=null),this.internalTex0&&(this.internalTex0.destroy(),this.internalTex0=null),this.internalTex1&&(this.internalTex1.destroy(),this.internalTex1=null),this.internalTex2&&(this.internalTex2.destroy(),this.internalTex2=null),this.internalTex3&&(this.internalTex3.destroy(),this.internalTex3=null),this.colorParam&&(this.colorParam.destroy(),this.colorParam=null),this.vertexBuffer&&(this.vertexBuffer.destroy(),this.vertexBuffer=void 0),this.indexBuffer&&(this.indexBuffer.destroy(),this.indexBuffer=void 0),this.material&&(this.material.destroy(),this.material=null)},e.destroy=function(){this.camera=null,this._destroyResources()},q(t,[{key:"defaultParamTexture",get:function(){var t=this;return z_.get(this.graphicsDevice,(function(){for(var e=16,i=new Float32Array(1024),n=0;n=0))continue;n=this.system.app.assets.get(n)}n&&!n.resource&&this.system.app.assets.load(n)}}if(!this.emitter){var s=t.mesh;s instanceof oa||(s=null),this.emitter=new V_(this.system.app.graphicsDevice,{numParticles:t.numParticles,emitterExtents:t.emitterExtents,emitterExtentsInner:t.emitterExtentsInner,emitterRadius:t.emitterRadius,emitterRadiusInner:t.emitterRadiusInner,emitterShape:t.emitterShape,initialVelocity:t.initialVelocity,wrap:t.wrap,localSpace:t.localSpace,screenSpace:t.screenSpace,wrapBounds:t.wrapBounds,lifetime:t.lifetime,rate:t.rate,rate2:t.rate2,orientation:t.orientation,particleNormal:t.particleNormal,animTilesX:t.animTilesX,animTilesY:t.animTilesY,animStartFrame:t.animStartFrame,animNumFrames:t.animNumFrames,animNumAnimations:t.animNumAnimations,animIndex:t.animIndex,randomizeAnimIndex:t.randomizeAnimIndex,animSpeed:t.animSpeed,animLoop:t.animLoop,startAngle:t.startAngle,startAngle2:t.startAngle2,scaleGraph:t.scaleGraph,scaleGraph2:t.scaleGraph2,colorGraph:t.colorGraph,colorGraph2:t.colorGraph2,alphaGraph:t.alphaGraph,alphaGraph2:t.alphaGraph2,localVelocityGraph:t.localVelocityGraph,localVelocityGraph2:t.localVelocityGraph2,velocityGraph:t.velocityGraph,velocityGraph2:t.velocityGraph2,rotationSpeedGraph:t.rotationSpeedGraph,rotationSpeedGraph2:t.rotationSpeedGraph2,radialSpeedGraph:t.radialSpeedGraph,radialSpeedGraph2:t.radialSpeedGraph2,colorMap:t.colorMap,normalMap:t.normalMap,loop:t.loop,preWarm:t.preWarm,sort:t.sort,stretch:t.stretch,alignToMotion:t.alignToMotion,lighting:t.lighting,halfLambert:t.halfLambert,intensity:t.intensity,depthSoftening:t.depthSoftening,scene:this.system.app.scene,mesh:s,depthWrite:t.depthWrite,noFog:t.noFog,node:this.entity,blendType:t.blendType}),this.emitter.meshInstance.node=this.entity,this.emitter.drawOrder=this.drawOrder,t.autoPlay||(this.pause(),this.emitter.meshInstance.visible=!1)}this.emitter.colorMap&&this.addMeshInstanceToLayers(),this.system.app.scene.on("set:layers",this.onLayersChanged,this),this.system.app.scene.layers&&(this.system.app.scene.layers.on("add",this.onLayerAdded,this),this.system.app.scene.layers.on("remove",this.onLayerRemoved,this)),this.enabled&&this.entity.enabled&&t.depthSoftening&&this._requestDepth()},i.onDisable=function(){this.system.app.scene.off("set:layers",this.onLayersChanged,this),this.system.app.scene.layers&&(this.system.app.scene.layers.off("add",this.onLayerAdded,this),this.system.app.scene.layers.off("remove",this.onLayerRemoved,this)),this.emitter&&(this.removeMeshInstanceFromLayers(),this.data.depthSoftening&&this._releaseDepth(),this.emitter.camera=null)},i.onBeforeRemove=function(){this.enabled&&(this.enabled=!1),this.emitter&&(this.emitter.destroy(),this.emitter=null);for(var t=0;th.fixedTimeStep&&(e=Math.floor(h.simTime/h.fixedTimeStep),h.simTime-=e*h.fixedTimeStep),e){e=Math.min(e,h.maxSubSteps);for(var v=0;vthis._pool.length)for(var e=this._pool.length;e=this._pool.length&&this._resize(2*this._pool.length),this._pool[this._count++]},e.freeAll=function(){this._count=0},t}(),sg=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._angularDamping=0,n._angularFactor=new ft(1,1,1),n._angularVelocity=new ft,n._body=null,n._friction=.5,n._group=2,n._linearDamping=0,n._linearFactor=new ft(1,1,1),n._linearVelocity=new ft,n._mask=ap,n._mass=1,n._restitution=0,n._rollingFriction=0,n._simulationEnabled=!1,n._type=ep,n}Y(e,t),e.onLibraryLoaded=function(){"undefined"==typeof Ammo||Z_||(Z_=new Ammo.btTransform,$_=new Ammo.btVector3,Q_=new Ammo.btVector3,J_=new Ammo.btQuaternion,tg=new Ammo.btVector3(0,0,0))};var i=e.prototype;return i.createBody=function(){var t,e=this.entity;if(e.collision&&(t=e.collision.shape,e.trigger&&(e.trigger.destroy(),delete e.trigger)),t){this._body&&this.system.onRemove(e,this);var i=this._type===ip?this._mass:0;this._getEntityTransform(Z_);var n=this.system.createBody(i,t,Z_);if(n.setRestitution(this._restitution),n.setFriction(this._friction),n.setRollingFriction(this._rollingFriction),n.setDamping(this._linearDamping,this._angularDamping),this._type===ip){var s=this._linearFactor;$_.setValue(s.x,s.y,s.z),n.setLinearFactor($_);var a=this._angularFactor;$_.setValue(a.x,a.y,a.z),n.setAngularFactor($_)}else this._type===np&&(n.setCollisionFlags(2|n.getCollisionFlags()),n.setActivationState(4));n.entity=e,this.body=n,this.enabled&&e.enabled&&this.enableSimulation()}},i.isActive=function(){return!!this._body&&this._body.isActive()},i.activate=function(){this._body&&this._body.activate()},i.enableSimulation=function(){var t=this.entity;if(t.collision&&t.collision.enabled&&!this._simulationEnabled){var e=this._body;if(e){switch(this.system.addBody(e,this._group,this._mask),this._type){case ip:this.system._dynamic.push(this),e.forceActivationState(1),this.syncEntityToBody();break;case np:this.system._kinematic.push(this),e.forceActivationState(4);break;case ep:e.forceActivationState(1),this.syncEntityToBody()}"compound"===t.collision.type&&this.system._compounds.push(t.collision),e.activate(),this._simulationEnabled=!0}}},i.disableSimulation=function(){var t=this._body;if(t&&this._simulationEnabled){var e=this.system,i=e._compounds.indexOf(this.entity.collision);i>-1&&e._compounds.splice(i,1),(i=e._dynamic.indexOf(this))>-1&&e._dynamic.splice(i,1),(i=e._kinematic.indexOf(this))>-1&&e._kinematic.splice(i,1),e.removeBody(t),t.forceActivationState(5),this._simulationEnabled=!1}},i.applyForce=function(){var t,e,i,n,s,a;switch(arguments.length){case 1:t=arguments[0].x,e=arguments[0].y,i=arguments[0].z;break;case 2:t=arguments[0].x,e=arguments[0].y,i=arguments[0].z,n=arguments[1].x,s=arguments[1].y,a=arguments[1].z;break;case 3:t=arguments[0],e=arguments[1],i=arguments[2];break;case 6:t=arguments[0],e=arguments[1],i=arguments[2],n=arguments[3],s=arguments[4],a=arguments[5]}var r=this._body;r&&(r.activate(),$_.setValue(t,e,i),void 0!==n?(Q_.setValue(n,s,a),r.applyForce($_,Q_)):r.applyForce($_,tg))},i.applyTorque=function(){var t,e,i;switch(arguments.length){case 1:t=arguments[0].x,e=arguments[0].y,i=arguments[0].z;break;case 3:t=arguments[0],e=arguments[1],i=arguments[2];break;default:return}var n=this._body;n&&(n.activate(),$_.setValue(t,e,i),n.applyTorque($_))},i.applyImpulse=function(){var t,e,i,n,s,a;switch(arguments.length){case 1:t=arguments[0].x,e=arguments[0].y,i=arguments[0].z;break;case 2:t=arguments[0].x,e=arguments[0].y,i=arguments[0].z,n=arguments[1].x,s=arguments[1].y,a=arguments[1].z;break;case 3:t=arguments[0],e=arguments[1],i=arguments[2];break;case 6:t=arguments[0],e=arguments[1],i=arguments[2],n=arguments[3],s=arguments[4],a=arguments[5];break;default:return}var r=this._body;r&&(r.activate(),$_.setValue(t,e,i),void 0!==n?(Q_.setValue(n,s,a),r.applyImpulse($_,Q_)):r.applyImpulse($_,tg))},i.applyTorqueImpulse=function(){var t,e,i;switch(arguments.length){case 1:t=arguments[0].x,e=arguments[0].y,i=arguments[0].z;break;case 3:t=arguments[0],e=arguments[1],i=arguments[2];break;default:return}var n=this._body;n&&(n.activate(),$_.setValue(t,e,i),n.applyTorqueImpulse($_))},i.isStatic=function(){return this._type===ep},i.isStaticOrKinematic=function(){return this._type===ep||this._type===np},i.isKinematic=function(){return this._type===np},i._getEntityTransform=function(t){var e=this.entity,i=e.getPosition(),n=e.getRotation();$_.setValue(i.x,i.y,i.z),J_.setValue(n.x,n.y,n.z,n.w),t.setOrigin($_),t.setRotation(J_)},i.syncEntityToBody=function(){var t=this._body;if(t){if(this._getEntityTransform(Z_),t.setWorldTransform(Z_),this._type===np){var e=t.getMotionState();e&&e.setWorldTransform(Z_)}t.activate()}},i._updateDynamic=function(){var t=this._body;if(t.isActive()){var e=t.getMotionState();if(e){e.getWorldTransform(Z_);var i=Z_.getOrigin(),n=Z_.getRotation();this.entity.setPosition(i.x(),i.y(),i.z()),this.entity.setRotation(n.x(),n.y(),n.z(),n.w())}}},i._updateKinematic=function(){var t=this._body.getMotionState();t&&(this._getEntityTransform(Z_),t.setWorldTransform(Z_))},i.teleport=function(){arguments.length<3?(arguments[0]&&this.entity.setPosition(arguments[0]),arguments[1]&&(arguments[1]instanceof wt?this.entity.setRotation(arguments[1]):this.entity.setEulerAngles(arguments[1]))):(6===arguments.length&&this.entity.setEulerAngles(arguments[3],arguments[4],arguments[5]),this.entity.setPosition(arguments[0],arguments[1],arguments[2])),this.syncEntityToBody()},i.onEnable=function(){this._body||this.createBody(),this.enableSimulation()},i.onDisable=function(){this.disableSimulation()},q(e,[{key:"angularDamping",get:function(){return this._angularDamping},set:function(t){this._angularDamping!==t&&(this._angularDamping=t,this._body&&this._body.setDamping(this._linearDamping,t))}},{key:"angularFactor",get:function(){return this._angularFactor},set:function(t){this._angularFactor.equals(t)||(this._angularFactor.copy(t),this._body&&this._type===ip&&($_.setValue(t.x,t.y,t.z),this._body.setAngularFactor($_)))}},{key:"angularVelocity",get:function(){if(this._body&&this._type===ip){var t=this._body.getAngularVelocity();this._angularVelocity.set(t.x(),t.y(),t.z())}return this._angularVelocity},set:function(t){this._body&&this._type===ip&&(this._body.activate(),$_.setValue(t.x,t.y,t.z),this._body.setAngularVelocity($_),this._angularVelocity.copy(t))}},{key:"body",get:function(){return this._body},set:function(t){this._body!==t&&(this._body=t,t&&this._simulationEnabled&&t.activate())}},{key:"friction",get:function(){return this._friction},set:function(t){this._friction!==t&&(this._friction=t,this._body&&this._body.setFriction(t))}},{key:"group",get:function(){return this._group},set:function(t){this._group!==t&&(this._group=t,this.enabled&&this.entity.enabled&&(this.disableSimulation(),this.enableSimulation()))}},{key:"linearDamping",get:function(){return this._linearDamping},set:function(t){this._linearDamping!==t&&(this._linearDamping=t,this._body&&this._body.setDamping(t,this._angularDamping))}},{key:"linearFactor",get:function(){return this._linearFactor},set:function(t){this._linearFactor.equals(t)||(this._linearFactor.copy(t),this._body&&this._type===ip&&($_.setValue(t.x,t.y,t.z),this._body.setLinearFactor($_)))}},{key:"linearVelocity",get:function(){if(this._body&&this._type===ip){var t=this._body.getLinearVelocity();this._linearVelocity.set(t.x(),t.y(),t.z())}return this._linearVelocity},set:function(t){this._body&&this._type===ip&&(this._body.activate(),$_.setValue(t.x,t.y,t.z),this._body.setLinearVelocity($_),this._linearVelocity.copy(t))}},{key:"mask",get:function(){return this._mask},set:function(t){this._mask!==t&&(this._mask=t,this.enabled&&this.entity.enabled&&(this.disableSimulation(),this.enableSimulation()))}},{key:"mass",get:function(){return this._mass},set:function(t){if(this._mass!==t&&(this._mass=t,this._body&&this._type===ip)){var e=this.enabled&&this.entity.enabled;e&&this.disableSimulation(),this._body.getCollisionShape().calculateLocalInertia(t,$_),this._body.setMassProps(t,$_),this._body.updateInertiaTensor(),e&&this.enableSimulation()}}},{key:"restitution",get:function(){return this._restitution},set:function(t){this._restitution!==t&&(this._restitution=t,this._body&&this._body.setRestitution(t))}},{key:"rollingFriction",get:function(){return this._rollingFriction},set:function(t){this._rollingFriction!==t&&(this._rollingFriction=t,this._body&&this._body.setRollingFriction(t))}},{key:"type",get:function(){return this._type},set:function(t){if(this._type!==t){switch(this._type=t,this.disableSimulation(),t){case ip:this._group=1,this._mask=sp;break;case np:this._group=4,this._mask=sp;break;case ep:default:this._group=2,this._mask=ap}this.createBody()}}}]),e}(du),ag=function(){this.enabled=!0},rg=function(t,e,i){this.entity=t,this.point=e,this.normal=i},og=function(t,e,i){0===arguments.length?(this.a=null,this.b=null,this.impulse=0,this.localPointA=new ft,this.localPointB=new ft,this.pointA=new ft,this.pointB=new ft,this.normal=new ft):(this.a=t,this.b=e,this.impulse=i.impulse,this.localPointA=i.localPoint,this.localPointB=i.localPointOther,this.pointA=i.point,this.pointB=i.pointOther,this.normal=i.normal)},hg=function(t,e,i,n,s,a){void 0===t&&(t=new ft),void 0===e&&(e=new ft),void 0===i&&(i=new ft),void 0===n&&(n=new ft),void 0===s&&(s=new ft),void 0===a&&(a=0),this.localPoint=t,this.localPointOther=e,this.point=i,this.pointOther=n,this.normal=s,this.impulse=a},lg=function(t,e){this.other=t,this.contacts=e},cg=["enabled"],ug=function(t){function e(e){var i;return(i=t.call(this,e)||this).maxSubSteps=10,i.fixedTimeStep=1/60,i.gravity=new ft(0,-9.81,0),i._dynamic=[],i._kinematic=[],i._triggers=[],i._compounds=[],i.id="rigidbody",i._stats=e.stats.frame,i.ComponentType=sg,i.DataType=ag,i.contactPointPool=null,i.contactResultPool=null,i.singleContactResultPool=null,i.schema=cg,i.collisions={},i.frameCollisions={},i.on("beforeremove",i.onBeforeRemove,Z(i)),i.on("remove",i.onRemove,Z(i)),i}Y(e,t);var i=e.prototype;return i.onLibraryLoaded=function(){if("undefined"!=typeof Ammo){if(this.collisionConfiguration=new Ammo.btDefaultCollisionConfiguration,this.dispatcher=new Ammo.btCollisionDispatcher(this.collisionConfiguration),this.overlappingPairCache=new Ammo.btDbvtBroadphase,this.solver=new Ammo.btSequentialImpulseConstraintSolver,this.dynamicsWorld=new Ammo.btDiscreteDynamicsWorld(this.dispatcher,this.overlappingPairCache,this.solver,this.collisionConfiguration),this.dynamicsWorld.setInternalTickCallback){var t=Ammo.addFunction(this._checkForCollisions.bind(this),"vif");this.dynamicsWorld.setInternalTickCallback(t)}eg=new Ammo.btVector3,ig=new Ammo.btVector3,sg.onLibraryLoaded(),this.contactPointPool=new ng(hg,1),this.contactResultPool=new ng(lg,1),this.singleContactResultPool=new ng(og,1),this.app.systems.on("update",this.onUpdate,this)}else this.app.systems.off("update",this.onUpdate,this)},i.initializeComponentData=function(e,i,n){for(var s=0,a=["mass","linearDamping","angularDamping","linearFactor","angularFactor","friction","rollingFriction","restitution","type","group","mask"];s2){var h=arguments[2];h(i)}}}return Ammo.destroy(n),i},i.raycastAll=function(t,e){var i=[];eg.setValue(t.x,t.y,t.z),ig.setValue(e.x,e.y,e.z);var n=new Ammo.AllHitsRayResultCallback(eg,ig);if(this.dynamicsWorld.rayTest(eg,ig,n),n.hasHit())for(var s=n.get_m_collisionObjects(),a=n.get_m_hitPointWorld(),r=n.get_m_hitNormalWorld(),o=s.size(),h=0;h0)if(4&d||4&f){var v=c.collision&&(c.collision.hasEvent("triggerenter")||c.collision.hasEvent("triggerleave")),y=u.collision&&(u.collision.hasEvent("triggerenter")||u.collision.hasEvent("triggerleave")),x=c.rigidbody&&(c.rigidbody.hasEvent("triggerenter")||c.rigidbody.hasEvent("triggerleave")),b=u.rigidbody&&(u.rigidbody.hasEvent("triggerenter")||u.rigidbody.hasEvent("triggerleave"));v&&(!(g=this._storeCollision(c,u))||4&f||c.collision.fire("triggerenter",u)),y&&(!(g=this._storeCollision(u,c))||4&d||u.collision.fire("triggerenter",c)),x&&(g||(g=this._storeCollision(u,c)),g&&c.rigidbody.fire("triggerenter",u)),b&&(g||(g=this._storeCollision(c,u)),g&&u.rigidbody.fire("triggerenter",c))}else{var S=this._hasContactEvent(c),w=this._hasContactEvent(u),T=this.hasEvent("contact");if(T||S||w){for(var A=0;A=0&&i!==t.element.drawOrder&&this.system.app.batcher.markGroupDirty(t.element._batchGroupId)}t.particlesystem&&(t.particlesystem.drawOrder=e++);for(var n=t.children,s=0;s255&&(t=255),this._priority=t}}]),e}(du),_g=function(){this.enabled=!0},gg=["enabled"],vg=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="screen",i.ComponentType=mg,i.DataType=_g,i.schema=gg,i.windowResolution=new mt,i._drawOrderSyncQueue=new H,i.app.graphicsDevice.on("resizecanvas",i._onResize,Z(i)),i.app.systems.on("update",i._onUpdate,Z(i)),i.on("beforeremove",i.onRemoveComponent,Z(i)),i}Y(e,t);var i=e.prototype;return i.initializeComponentData=function(e,i,n){void 0!==i.priority&&(e.priority=i.priority),void 0!==i.screenSpace&&(e.screenSpace=i.screenSpace),e.cull=e.screenSpace,void 0!==i.scaleMode&&(e.scaleMode=i.scaleMode),void 0!==i.scaleBlend&&(e.scaleBlend=i.scaleBlend),void 0!==i.resolution&&(i.resolution instanceof mt?e._resolution.copy(i.resolution):e._resolution.set(i.resolution[0],i.resolution[1]),e.resolution=e._resolution),void 0!==i.referenceResolution&&(i.referenceResolution instanceof mt?e._referenceResolution.copy(i.referenceResolution):e._referenceResolution.set(i.referenceResolution[0],i.referenceResolution[1]),e.referenceResolution=e._referenceResolution),e.syncDrawOrder(),t.prototype.initializeComponentData.call(this,e,i,n)},i.destroy=function(){t.prototype.destroy.call(this),this.app.graphicsDevice.off("resizecanvas",this._onResize,this),this.app.systems.off("update",this._onUpdate,this)},i._onUpdate=function(t){var e=this.store;for(var i in e)e[i].entity.screen.update&&e[i].entity.screen.update(t)},i._onResize=function(t,e){this.windowResolution.x=t,this.windowResolution.y=e},i.cloneComponent=function(t,e){var i=t.screen;return this.addComponent(e,{enabled:i.enabled,screenSpace:i.screenSpace,scaleMode:i.scaleMode,resolution:i.resolution.clone(),referenceResolution:i.referenceResolution.clone()})},i.onRemoveComponent=function(t,e){e.onRemove()},i.processDrawOrderSyncQueue=function(){for(var t=this._drawOrderSyncQueue.list(),e=0;eNumber.MAX_SAFE_INTEGER&&this._resetExecutionOrder(),t.enabled=!e.hasOwnProperty("enabled")||!!e.enabled,t.enabled&&t.entity.enabled&&this._enabledComponents.append(t),e.hasOwnProperty("order")&&e.hasOwnProperty("scripts")){t._scriptsData=e.scripts;for(var i=0;i=0&&e._onBeforeRemove(),this._removeComponentFromEnabled(e),this._components.remove(e)},i.destroy=function(){t.prototype.destroy.call(this),this.app.systems.off("initialize",this._onInitialize,this),this.app.systems.off("postInitialize",this._onPostInitialize,this),this.app.systems.off("update",this._onUpdate,this),this.app.systems.off("postUpdate",this._onPostUpdate,this)},e}(ud),Sg=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this).on("set_scripts",n.onSetScripts,Z(n)),n}Y(e,t);var i=e.prototype;return i.send=function(t,e){var i,n=Array.prototype.slice.call(arguments,2),s=this.entity.script.instances;if(s&&s[t]&&(i=s[t].instance[e]))return i.apply(s[t].instance,n)},i.onEnable=function(){this.data.areScriptsLoaded&&!this.system.preloading&&(this.data.initialized?this.system._enableScriptComponent(this):this.system._initializeScriptComponent(this),this.data.postInitialized||this.system._postInitializeScriptComponent(this))},i.onDisable=function(){this.system._disableScriptComponent(this)},i.onSetScripts=function(t,e,i){if(!this.system._inTools||this.runInTools){if(this._updateScriptAttributes(e,i))return;this.enabled&&this.system._disableScriptComponent(this),this.system._destroyScriptComponent(this),this.data.areScriptsLoaded=!1;var n=i.map((function(t){return t.url}));if(this._loadFromCache(n))return;this._loadScripts(n)}},i._updateScriptAttributes=function(t,e){var i=!0;if(t.length!==e.length)i=!1;else for(var n=0,s=e.length;n=0&&this.instancesWithUpdate.splice(s,1)}if(n.fixedUpdate){var a=this.instancesWithFixedUpdate.indexOf(n);a>=0&&this.instancesWithFixedUpdate.splice(a,1)}if(n.postUpdate){var r=this.instancesWithPostUpdate.indexOf(n);r>=0&&this.instancesWithPostUpdate.splice(r,1)}if(n.toolsUpdate){var o=this.instancesWithToolsUpdate.indexOf(n);o>=0&&this.instancesWithToolsUpdate.splice(o,1)}t.instances[i].instance===t[i]&&delete t[i],delete t.instances[i]}},i._postInitializeScriptComponent=function(t){this._callInstancesMethod(t,Mg),t.data.postInitialized=!0},i._updateInstances=function(t,e,i){for(var n=0,s=e.length;n0){var i=Fg.sub(kg).dot(Bg)/e,n=kg.add(Og.mulScalar(i));return Ng.copy(this._element.entity.getRotation()).invert().transformVector(n,n),n.mul(this._dragScale),n}return null},i._determineInputPosition=function(t){var e=this._app.graphicsDevice.maxPixelRatio;void 0!==t.x&&void 0!==t.y?(Lg.x=t.x*e,Lg.y=t.y*e):t.changedTouches?(Lg.x=t.changedTouches[0].x*e,Lg.y=t.changedTouches[0].y*e):console.warn("Could not determine position from input event")},i._chooseRayOriginAndDirection=function(){this._element.screen&&this._element.screen.screen.screenSpace?(kg.set(Lg.x,-Lg.y,0),Og.set(0,0,-1)):(Dg.copy(this._dragCamera.screenToWorld(Lg.x,Lg.y,1)),kg.copy(this._dragCamera.entity.getPosition()),Og.copy(Dg).sub(kg).normalize())},i._calculateDragScale=function(){var t=this._element.entity.parent,e=this._element.screen&&this._element.screen.screen,i=e&&e.screenSpace,n=i?e.scale:1,s=this._dragScale;for(s.set(n,n,n);t&&(s.mul(t.getLocalScale()),t=t.parent,!i||!t.screen););s.x=1/s.x,s.y=1/s.y,s.z=1/s.z},i._onMove=function(t){if(this._element&&this._isDragging&&this.enabled&&this._element.enabled&&this._element.entity.enabled){var e=this._screenToLocal(t);if(this._dragStartMousePosition&&e){if(this._deltaMousePosition.copy(e).sub(this._dragStartMousePosition),this._deltaHandlePosition.copy(this._dragStartHandlePosition).add(this._deltaMousePosition),this._axis){var i=this._element.entity.getLocalPosition(),n=Ug[this._axis];this._deltaHandlePosition[n]=i[n]}this._element.entity.setLocalPosition(this._deltaHandlePosition),this.fire("drag:move",this._deltaHandlePosition)}}},i.destroy=function(){this._toggleLifecycleListeners("off"),this._toggleDragListeners("off")},q(e,[{key:"enabled",get:function(){return this._enabled},set:function(t){this._enabled=t}},{key:"isDragging",get:function(){return this._isDragging}}]),e}(m),Vg="mouse",Wg="keyboard",Gg="gamepad",Hg="mousedown",Xg="mousemove",qg="mouseup",jg="mousewheel",Yg=new mt,Kg=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._viewportReference=new Mf(Z(n),"viewportEntity",{"element#gain":n._onViewportElementGain,"element#resize":n._onSetContentOrViewportSize}),n._contentReference=new Mf(Z(n),"contentEntity",{"element#gain":n._onContentElementGain,"element#lose":n._onContentElementLose,"element#resize":n._onSetContentOrViewportSize}),n._scrollbarUpdateFlags={},n._scrollbarReferences={},n._scrollbarReferences[0]=new Mf(Z(n),"horizontalScrollbarEntity",{"scrollbar#set:value":n._onSetHorizontalScrollbarValue,"scrollbar#gain":n._onHorizontalScrollbarGain}),n._scrollbarReferences[1]=new Mf(Z(n),"verticalScrollbarEntity",{"scrollbar#set:value":n._onSetVerticalScrollbarValue,"scrollbar#gain":n._onVerticalScrollbarGain}),n._prevContentSizes={},n._prevContentSizes[0]=null,n._prevContentSizes[1]=null,n._scroll=new mt,n._velocity=new ft,n._dragStartPosition=new ft,n._disabledContentInput=!1,n._disabledContentInputEntities=[],n._toggleLifecycleListeners("on",e),n._toggleElementListeners("on"),n}Y(e,t);var i=e.prototype;return i._toggleLifecycleListeners=function(t,e){this[t]("set_horizontal",this._onSetHorizontalScrollingEnabled,this),this[t]("set_vertical",this._onSetVerticalScrollingEnabled,this),e.app.systems.element[t]("add",this._onElementComponentAdd,this),e.app.systems.element[t]("beforeremove",this._onElementComponentRemove,this)},i._toggleElementListeners=function(t){if(this.entity.element){if("on"===t&&this._hasElementListeners)return;this.entity.element[t]("resize",this._onSetContentOrViewportSize,this),this.entity.element[t](jg,this._onMouseWheel,this),this._hasElementListeners="on"===t}},i._onElementComponentAdd=function(t){this.entity===t&&this._toggleElementListeners("on")},i._onElementComponentRemove=function(t){this.entity===t&&this._toggleElementListeners("off")},i._onViewportElementGain=function(){this._syncAll()},i._onContentElementGain=function(){this._destroyDragHelper(),this._contentDragHelper=new zg(this._contentReference.entity.element),this._contentDragHelper.on("drag:start",this._onContentDragStart,this),this._contentDragHelper.on("drag:end",this._onContentDragEnd,this),this._contentDragHelper.on("drag:move",this._onContentDragMove,this),this._prevContentSizes[0]=null,this._prevContentSizes[1]=null,this._syncAll()},i._onContentElementLose=function(){this._destroyDragHelper()},i._onContentDragStart=function(){this._contentReference.entity&&this.enabled&&this.entity.enabled&&this._dragStartPosition.copy(this._contentReference.entity.getLocalPosition())},i._onContentDragEnd=function(){this._prevContentDragPosition=null,this._enableContentInput()},i._onContentDragMove=function(t){if(this._contentReference.entity&&this.enabled&&this.entity.enabled&&(this._wasDragged=!0,this._setScrollFromContentPosition(t),this._setVelocityFromContentPositionDelta(t),!this._disabledContentInput)){var e=t.x-this._dragStartPosition.x,i=t.y-this._dragStartPosition.y;(Math.abs(e)>this.dragThreshold||Math.abs(i)>this.dragThreshold)&&this._disableContentInput()}},i._onSetContentOrViewportSize=function(){this._syncAll()},i._onSetHorizontalScrollbarValue=function(t){!this._scrollbarUpdateFlags[0]&&this.enabled&&this.entity.enabled&&this._onSetScroll(t,null)},i._onSetVerticalScrollbarValue=function(t){!this._scrollbarUpdateFlags[1]&&this.enabled&&this.entity.enabled&&this._onSetScroll(null,t)},i._onSetHorizontalScrollingEnabled=function(){this._syncScrollbarEnabledState(0)},i._onSetVerticalScrollingEnabled=function(){this._syncScrollbarEnabledState(1)},i._onHorizontalScrollbarGain=function(){this._syncScrollbarEnabledState(0),this._syncScrollbarPosition(0)},i._onVerticalScrollbarGain=function(){this._syncScrollbarEnabledState(1),this._syncScrollbarPosition(1)},i._onSetScroll=function(t,e,i){!1!==i&&this._velocity.set(0,0,0);var n=this._updateAxis(t,"x",0),s=this._updateAxis(e,"y",1);(n||s)&&this.fire("set:scroll",this._scroll)},i._updateAxis=function(t,e,i){var n=null!==t&&Math.abs(t-this._scroll[e])>1e-5;return(n||this._isDragging()||0===t)&&(this._scroll[e]=this._determineNewScrollValue(t,e,i),this._syncContentPosition(i),this._syncScrollbarPosition(i)),n},i._determineNewScrollValue=function(t,e,i){if(!this._getScrollingEnabled(i))return this._scroll[e];switch(this.scrollMode){case 0:return rt.clamp(t,0,this._getMaxScrollValue(i));case 1:return this._setVelocityFromOvershoot(t,e,i),t;case 2:return t;default:return console.warn("Unhandled scroll mode:"+this.scrollMode),t}},i._syncAll=function(){this._syncContentPosition(0),this._syncContentPosition(1),this._syncScrollbarPosition(0),this._syncScrollbarPosition(1),this._syncScrollbarEnabledState(0),this._syncScrollbarEnabledState(1)},i._syncContentPosition=function(t){var e=this._getAxis(t),i=this._getSign(t),n=this._contentReference.entity;if(n){var s=this._prevContentSizes[t],a=this._getContentSize(t);if(null!==s&&Math.abs(s-a)>1e-4){var r=this._getMaxOffset(t,s),o=this._getMaxOffset(t,a);this._scroll[e]=0===o?1:rt.clamp(this._scroll[e]*r/o,0,1)}var h=this._scroll[e]*this._getMaxOffset(t),l=n.getLocalPosition();l[e]=h*i,n.setLocalPosition(l),this._prevContentSizes[t]=a}},i._syncScrollbarPosition=function(t){var e=this._getAxis(t),i=this._scrollbarReferences[t].entity;i&&i.scrollbar&&(this._scrollbarUpdateFlags[t]=!0,i.scrollbar.value=this._scroll[e],i.scrollbar.handleSize=this._getScrollbarHandleSize(e,t),this._scrollbarUpdateFlags[t]=!1)},i._syncScrollbarEnabledState=function(t){var e=this._scrollbarReferences[t].entity;if(e){var i=this._getScrollingEnabled(t),n=this._getScrollbarVisibility(t);switch(n){case 0:return void(e.enabled=i);case 1:return void(e.enabled=i&&this._contentIsLargerThanViewport(t));default:console.warn("Unhandled scrollbar visibility:"+n),e.enabled=i}}},i._contentIsLargerThanViewport=function(t){return this._getContentSize(t)>this._getViewportSize(t)},i._contentPositionToScrollValue=function(t){var e=this._getMaxOffset(0),i=this._getMaxOffset(1);return Yg.x=0===e?0:t.x/e,Yg.y=0===i?0:t.y/-i,Yg},i._getMaxOffset=function(t,e){e=void 0===e?this._getContentSize(t):e;var i=this._getViewportSize(t);return e1e-4||Math.abs(this._velocity.y)>1e-4){var t=this._contentReference.entity.getLocalPosition();t.x+=this._velocity.x,t.y+=this._velocity.y,this._contentReference.entity.setLocalPosition(t),this._setScrollFromContentPosition(t)}this._velocity.x*=1-this.friction,this._velocity.y*=1-this.friction}},i._hasOvershoot=function(t,e){return Math.abs(this._toOvershoot(this.scroll[t],e))>.001},i._toOvershoot=function(t,e){var i=this._getMaxScrollValue(e);return t<0?t:t>i?t-i:0},i._setVelocityFromOvershoot=function(t,e,i){var n=this._toOvershoot(t,i)*this._getMaxOffset(i)*this._getSign(i);Math.abs(n)>0&&(this._velocity[e]=-n/(50*this.bounceAmount+1))},i._setVelocityFromContentPositionDelta=function(t){this._prevContentDragPosition?(this._velocity.sub2(t,this._prevContentDragPosition),this._prevContentDragPosition.copy(t)):(this._velocity.set(0,0,0),this._prevContentDragPosition=t.clone())},i._setScrollFromContentPosition=function(t){var e=this._contentPositionToScrollValue(t);this._isDragging()&&(e=this._applyScrollValueTension(e)),this._onSetScroll(e.x,e.y,!1)},i._applyScrollValueTension=function(t){var e=this._getMaxScrollValue(0),i=this._toOvershoot(t.x,0);return i>0?t.x=e+1*Math.log10(1+i):i<0&&(t.x=-1*Math.log10(1-i)),e=this._getMaxScrollValue(1),(i=this._toOvershoot(t.y,1))>0?t.y=e+1*Math.log10(1+i):i<0&&(t.y=-1*Math.log10(1-i)),t},i._isDragging=function(){return this._contentDragHelper&&this._contentDragHelper.isDragging},i._setScrollbarComponentsEnabled=function(t){this._scrollbarReferences[0].hasComponent("scrollbar")&&(this._scrollbarReferences[0].entity.scrollbar.enabled=t),this._scrollbarReferences[1].hasComponent("scrollbar")&&(this._scrollbarReferences[1].entity.scrollbar.enabled=t)},i._setContentDraggingEnabled=function(t){this._contentDragHelper&&(this._contentDragHelper.enabled=t)},i._onMouseWheel=function(t){if(this.useMouseWheel){var e=t.event,i=e.deltaX/this._contentReference.entity.element.calculatedWidth*this.mouseWheelSensitivity.x,n=e.deltaY/this._contentReference.entity.element.calculatedHeight*this.mouseWheelSensitivity.y,s=rt.clamp(this._scroll.x+i,0,this._getMaxScrollValue(0)),a=rt.clamp(this._scroll.y+n,0,this._getMaxScrollValue(1));this.scroll=new mt(s,a)}},i._enableContentInput=function(){for(;this._disabledContentInputEntities.length;){var t=this._disabledContentInputEntities.pop();t.element&&(t.element.useInput=!0)}this._disabledContentInput=!1},i._disableContentInput=function(){var t=this,e=function e(i){i.element&&i.element.useInput&&(t._disabledContentInputEntities.push(i),i.element.useInput=!1);for(var n=i.children,s=0,a=n.length;s1e-5&&(this.data.value=rt.clamp(i,0,1),this._updateHandlePositionAndSize(),this.fire("set:value",this.data.value))},i._onSetHandleSize=function(t,e,i){Math.abs(i-e)>1e-5&&(this.data.handleSize=rt.clamp(i,0,1),this._updateHandlePositionAndSize())},i._onSetHandleAlignment=function(){this._updateHandlePositionAndSize()},i._onSetOrientation=function(t,e,i){i!==e&&this._handleReference.hasComponent("element")&&(this._handleReference.entity.element[this._getOppositeDimension()]=0)},i._updateHandlePositionAndSize=function(){var t=this._handleReference.entity,e=t&&t.element;if(t){var i=t.getLocalPosition();i[this._getAxis()]=this._getHandlePosition(),this._handleReference.entity.setLocalPosition(i)}e&&(e[this._getDimension()]=this._getHandleLength())},i._handlePositionToScrollValue=function(t){return t*this._getSign()/this._getUsableTrackLength()},i._scrollValueToHandlePosition=function(t){return t*this._getSign()*this._getUsableTrackLength()},i._getUsableTrackLength=function(){return Math.max(this._getTrackLength()-this._getHandleLength(),.001)},i._getTrackLength=function(){return this.entity.element?0===this.orientation?this.entity.element.calculatedWidth:this.entity.element.calculatedHeight:0},i._getHandleLength=function(){return this._getTrackLength()*this.handleSize},i._getHandlePosition=function(){return this._scrollValueToHandlePosition(this.value)},i._getSign=function(){return 0===this.orientation?1:-1},i._getAxis=function(){return 0===this.orientation?"x":"y"},i._getDimension=function(){return 0===this.orientation?"width":"height"},i._getOppositeDimension=function(){return 0===this.orientation?"height":"width"},i._destroyDragHelper=function(){this._handleDragHelper&&this._handleDragHelper.destroy()},i._setHandleDraggingEnabled=function(t){this._handleDragHelper&&(this._handleDragHelper.enabled=t)},i.onEnable=function(){this._handleReference.onParentComponentEnable(),this._setHandleDraggingEnabled(!0)},i.onDisable=function(){this._setHandleDraggingEnabled(!1)},i.onRemove=function(){this._destroyDragHelper(),this._toggleLifecycleListeners("off")},e}(du),tv=function(){this.enabled=!0},ev=[{name:"enabled",type:"boolean"},{name:"orientation",type:"number"},{name:"value",type:"number"},{name:"handleSize",type:"number"},{name:"handleEntity",type:"entity"}],iv=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="scrollbar",i.ComponentType=Jg,i.DataType=tv,i.schema=ev,i.on("beforeremove",i._onRemoveComponent,Z(i)),i}Y(e,t);var i=e.prototype;return i.initializeComponentData=function(e,i,n){t.prototype.initializeComponentData.call(this,e,i,ev)},i._onRemoveComponent=function(t,e){e.onRemove()},e}(ud);du._buildAccessors(Jg.prototype,ev);function nv(t,e){return t%e||0}var sv=function(t){function e(e,i,n){var s;return(s=t.call(this)||this).source=null,s._manager=e,s._volume=void 0!==n.volume?rt.clamp(Number(n.volume)||0,0,1):1,s._pitch=void 0!==n.pitch?Math.max(.01,Number(n.pitch)||0):1,s._loop=!(void 0===n.loop||!n.loop),s._sound=i,s._state=2,s._suspended=!1,s._suspendEndEvent=!1,s._suspendInstanceEvents=!1,s._playWhenLoaded=!0,s._startTime=Math.max(0,Number(n.startTime)||0),s._duration=Math.max(0,Number(n.duration)||0),s._startOffset=null,s._onPlayCallback=n.onPlay,s._onPauseCallback=n.onPause,s._onResumeCallback=n.onResume,s._onStopCallback=n.onStop,s._onEndCallback=n.onEnd,Jo()?(s._startedAt=0,s._currentTime=0,s._currentOffset=0,s._inputNode=null,s._connectorNode=null,s._firstNode=null,s._lastNode=null,s._initializeNodes(),s._endedHandler=s._onEnded.bind(Z(s))):(s._isReady=!1,s._loadedMetadataHandler=s._onLoadedMetadata.bind(Z(s)),s._timeUpdateHandler=s._onTimeUpdate.bind(Z(s)),s._endedHandler=s._onEnded.bind(Z(s)),s._createSource()),s}Y(e,t);var i=e.prototype;return i._onPlay=function(){this.fire("play"),this._onPlayCallback&&this._onPlayCallback(this)},i._onPause=function(){this.fire("pause"),this._onPauseCallback&&this._onPauseCallback(this)},i._onResume=function(){this.fire("resume"),this._onResumeCallback&&this._onResumeCallback(this)},i._onStop=function(){this.fire("stop"),this._onStopCallback&&this._onStopCallback(this)},i._onEnded=function(){this._suspendEndEvent?this._suspendEndEvent=!1:(this.fire("end"),this._onEndCallback&&this._onEndCallback(this),this.stop())},i._onManagerVolumeChange=function(){this.volume=this._volume},i._onManagerSuspend=function(){0!==this._state||this._suspended||(this._suspended=!0,this.pause())},i._onManagerResume=function(){this._suspended&&(this._suspended=!1,this.resume())},i._initializeNodes=function(){this.gain=this._manager.context.createGain(),this._inputNode=this.gain,this._connectorNode=this.gain,this._connectorNode.connect(this._manager.context.destination)},i.play=function(){2!==this._state&&this.stop(),this.source||this._createSource();var t=nv(this._startOffset,this.duration);return t=nv(this._startTime+t,this._sound.duration),this._startOffset=null,this._duration?this.source.start(0,t,this._duration):this.source.start(0,t),this._startedAt=this._manager.context.currentTime,this._currentTime=0,this._currentOffset=t,this._state=0,this._playWhenLoaded=!1,this.volume=this._volume,this.loop=this._loop,this.pitch=this._pitch,this._manager.on("volumechange",this._onManagerVolumeChange,this),this._manager.on("suspend",this._onManagerSuspend,this),this._manager.on("resume",this._onManagerResume,this),this._manager.on("destroy",this._onManagerDestroy,this),this._manager.suspended&&this._onManagerSuspend(),this._suspendInstanceEvents||this._onPlay(),!0},i.pause=function(){return this._playWhenLoaded=!1,!(0!==this._state||!this.source)&&(this._updateCurrentTime(),this._state=1,this._suspendEndEvent=!0,this.source.stop(0),this.source=null,this._startOffset=null,this._suspendInstanceEvents||this._onPause(),!0)},i.resume=function(){if(1!==this._state)return!1;this.source||this._createSource();var t=this.currentTime;return null!==this._startOffset&&(t=nv(this._startOffset,this.duration),t=nv(this._startTime+t,this._sound.duration),this._startOffset=null),this._duration?this.source.start(0,t,this._duration):this.source.start(0,t),this._state=0,this._startedAt=this._manager.context.currentTime,this._currentOffset=t,this.volume=this._volume,this.loop=this._loop,this.pitch=this._pitch,this._playWhenLoaded=!1,this._suspendInstanceEvents||this._onResume(),!0},i.stop=function(){return this._playWhenLoaded=!1,!(2===this._state||!this.source)&&(this._manager.off("volumechange",this._onManagerVolumeChange,this),this._manager.off("suspend",this._onManagerSuspend,this),this._manager.off("resume",this._onManagerResume,this),this._manager.off("destroy",this._onManagerDestroy,this),this._startedAt=0,this._currentTime=0,this._currentOffset=0,this._startOffset=null,this._suspendEndEvent=!0,0===this._state&&this.source.stop(0),this.source=null,this._state=2,this._suspendInstanceEvents||this._onStop(),!0)},i.setExternalNodes=function(t,e){if(t){e||(e=t);var i=this._manager.context.destination;this._firstNode!==t&&(this._firstNode?this._connectorNode.disconnect(this._firstNode):this._connectorNode.disconnect(i),this._firstNode=t,this._connectorNode.connect(t)),this._lastNode!==e&&(this._lastNode&&this._lastNode.disconnect(i),this._lastNode=e,this._lastNode.connect(i))}else console.error("The firstNode must be a valid Audio Node")},i.clearExternalNodes=function(){var t=this._manager.context.destination;this._firstNode&&(this._connectorNode.disconnect(this._firstNode),this._firstNode=null),this._lastNode&&(this._lastNode.disconnect(t),this._lastNode=null),this._connectorNode.connect(t)},i.getExternalNodes=function(){return[this._firstNode,this._lastNode]},i._createSource=function(){if(!this._sound)return null;var t=this._manager.context;return this._sound.buffer&&(this.source=t.createBufferSource(),this.source.buffer=this._sound.buffer,this.source.connect(this._inputNode),this.source.onended=this._endedHandler,this.source.loopStart=nv(this._startTime,this.source.buffer.duration),this._duration&&(this.source.loopEnd=Math.max(this.source.loopStart,nv(this._startTime+this._duration,this.source.buffer.duration)))),this.source},i._updateCurrentTime=function(){this._currentTime=nv((this._manager.context.currentTime-this._startedAt)*this._pitch+this._currentOffset,this.duration)},i._onManagerDestroy=function(){this.source&&0===this._state&&(this.source.stop(0),this.source=null)},q(e,[{key:"currentTime",get:function(){return null!==this._startOffset?this._startOffset:1===this._state?this._currentTime:2!==this._state&&this.source?(this._updateCurrentTime(),this._currentTime):0},set:function(t){if(!(t<0))if(0===this._state){var e=this._suspendInstanceEvents;this._suspendInstanceEvents=!0,this.stop(),this._startOffset=t,this.play(),this._suspendInstanceEvents=e}else this._startOffset=t,this._currentTime=t}},{key:"duration",get:function(){return this._sound?this._duration?nv(this._duration,this._sound.duration):this._sound.duration:0},set:function(t){this._duration=Math.max(0,Number(t)||0);var e=0===this._state;this.stop(),e&&this.play()}},{key:"isPaused",get:function(){return 1===this._state}},{key:"isPlaying",get:function(){return 0===this._state}},{key:"isStopped",get:function(){return 2===this._state}},{key:"isSuspended",get:function(){return this._suspended}},{key:"loop",get:function(){return this._loop},set:function(t){this._loop=!!t,this.source&&(this.source.loop=this._loop)}},{key:"pitch",get:function(){return this._pitch},set:function(t){this._currentOffset=this.currentTime,this._startedAt=this._manager.context.currentTime,this._pitch=Math.max(Number(t)||0,.01),this.source&&(this.source.playbackRate.value=this._pitch)}},{key:"sound",get:function(){return this._sound},set:function(t){this._sound=t,2!==this._state?this.stop():this._createSource()}},{key:"startTime",get:function(){return this._startTime},set:function(t){this._startTime=Math.max(0,Number(t)||0);var e=0===this._state;this.stop(),e&&this.play()}},{key:"volume",get:function(){return this._volume},set:function(t){t=rt.clamp(t,0,1),this._volume=t,this.gain&&(this.gain.gain.value=t*this._manager.volume)}}]),e}(m);Jo()||(Object.assign(sv.prototype,{play:function(){return 2!==this._state&&this.stop(),!(!this.source&&!this._createSource())&&(this.volume=this._volume,this.pitch=this._pitch,this.loop=this._loop,this.source.play(),this._state=0,this._playWhenLoaded=!1,this._manager.on("volumechange",this._onManagerVolumeChange,this),this._manager.on("suspend",this._onManagerSuspend,this),this._manager.on("resume",this._onManagerResume,this),this._manager.on("destroy",this._onManagerDestroy,this),this._manager.suspended&&this._onManagerSuspend(),this._suspendInstanceEvents||this._onPlay(),!0)},pause:function(){return!(!this.source||0!==this._state)&&(this._suspendEndEvent=!0,this.source.pause(),this._playWhenLoaded=!1,this._state=1,this._startOffset=null,this._suspendInstanceEvents||this._onPause(),!0)},resume:function(){return!(!this.source||1!==this._state)&&(this._state=0,this._playWhenLoaded=!1,this.source.paused&&(this.source.play(),this._suspendInstanceEvents||this._onResume()),!0)},stop:function(){return!(!this.source||2===this._state)&&(this._manager.off("volumechange",this._onManagerVolumeChange,this),this._manager.off("suspend",this._onManagerSuspend,this),this._manager.off("resume",this._onManagerResume,this),this._manager.off("destroy",this._onManagerDestroy,this),this._suspendEndEvent=!0,this.source.pause(),this._playWhenLoaded=!1,this._state=2,this._startOffset=null,this._suspendInstanceEvents||this._onStop(),!0)},setExternalNodes:function(){},clearExternalNodes:function(){},getExternalNodes:function(){return[null,null]},_onLoadedMetadata:function(){this.source.removeEventListener("loadedmetadata",this._loadedMetadataHandler),this._isReady=!0;var t=nv(this._startOffset,this.duration);t=nv(this._startTime+t,this._sound.duration),this._startOffset=null,this.source.currentTime=t},_createSource:function(){return this._sound&&this._sound.audio&&(this._isReady=!1,this.source=this._sound.audio.cloneNode(!0),this.source.addEventListener("loadedmetadata",this._loadedMetadataHandler),this.source.addEventListener("timeupdate",this._timeUpdateHandler),this.source.onended=this._endedHandler),this.source},_onTimeUpdate:function(){this._duration&&this.source.currentTime>nv(this._startTime+this._duration,this.source.duration)&&(this.loop?this.source.currentTime=nv(this._startTime,this.source.duration):(this.source.removeEventListener("timeupdate",this._timeUpdateHandler),this.source.pause(),this._onEnded()))},_onManagerDestroy:function(){this.source&&this.source.pause()}}),Object.defineProperty(sv.prototype,"volume",{get:function(){return this._volume},set:function(t){t=rt.clamp(t,0,1),this._volume=t,this.source&&(this.source.volume=t*this._manager.volume)}}),Object.defineProperty(sv.prototype,"pitch",{get:function(){return this._pitch},set:function(t){this._pitch=Math.max(Number(t)||0,.01),this.source&&(this.source.playbackRate=this._pitch)}}),Object.defineProperty(sv.prototype,"sound",{get:function(){return this._sound},set:function(t){this.stop(),this._sound=t}}),Object.defineProperty(sv.prototype,"currentTime",{get:function(){return null!==this._startOffset?this._startOffset:2!==this._state&&this.source?this.source.currentTime-this._startTime:0},set:function(t){t<0||(this._startOffset=t,this.source&&this._isReady&&(this.source.currentTime=nv(this._startTime+nv(t,this.duration),this._sound.duration),this._startOffset=null))}}));var av=function(t){function e(e,i,n){var s;return void 0===n&&(n={}),(s=t.call(this,e,i,n)||this)._position=new ft,s._velocity=new ft,n.position&&(s.position=n.position),s.maxDistance=void 0!==n.maxDistance?Number(n.maxDistance):1e4,s.refDistance=void 0!==n.refDistance?Number(n.refDistance):1,s.rollOffFactor=void 0!==n.rollOffFactor?Number(n.rollOffFactor):1,s.distanceModel=void 0!==n.distanceModel?n.distanceModel:eh,s}return Y(e,t),e.prototype._initializeNodes=function(){this.gain=this._manager.context.createGain(),this.panner=this._manager.context.createPanner(),this.panner.connect(this.gain),this._inputNode=this.panner,this._connectorNode=this.gain,this._connectorNode.connect(this._manager.context.destination)},q(e,[{key:"position",get:function(){return this._position},set:function(t){this._position.copy(t);var e=this.panner;"positionX"in e?(e.positionX.value=t.x,e.positionY.value=t.y,e.positionZ.value=t.z):e.setPosition&&e.setPosition(t.x,t.y,t.z)}},{key:"velocity",get:function(){return this._velocity},set:function(t){this._velocity.copy(t)}},{key:"maxDistance",get:function(){return this.panner.maxDistance},set:function(t){this.panner.maxDistance=t}},{key:"refDistance",get:function(){return this.panner.refDistance},set:function(t){this.panner.refDistance=t}},{key:"rollOffFactor",get:function(){return this.panner.rolloffFactor},set:function(t){this.panner.rolloffFactor=t}},{key:"distanceModel",get:function(){return this.panner.distanceModel},set:function(t){this.panner.distanceModel=t}}]),e}(sv);if(!Jo()){var rv=new ft;Object.defineProperty(av.prototype,"position",{get:function(){return this._position},set:function(t){if(this._position.copy(t),this.source){var e=function(t,e,i,n,s,a){var r=(rv=rv.sub2(t,e)).length();if(rn)return 0;var o=0;return a===eh?o=1-s*(r-i)/(n-i):a===ih?o=i/(i+s*(r-i)):a===nh&&(o=Math.pow(r/i,-s)),rt.clamp(o,0,1)}(this._manager.listener.getPosition(),this._position,this.refDistance,this.maxDistance,this.rollOffFactor,this.distanceModel),i=this.volume;this.source.volume=i*e*this._manager.volume}}}),Object.defineProperty(av.prototype,"maxDistance",{get:function(){return this._maxDistance},set:function(t){this._maxDistance=t}}),Object.defineProperty(av.prototype,"refDistance",{get:function(){return this._refDistance},set:function(t){this._refDistance=t}}),Object.defineProperty(av.prototype,"rollOffFactor",{get:function(){return this._rollOffFactor},set:function(t){this._rollOffFactor=t}}),Object.defineProperty(av.prototype,"distanceModel",{get:function(){return this._distanceModel},set:function(t){this._distanceModel=t}})}var ov={volume:0,pitch:0,loop:!1,startTime:0,duration:0,position:new ft,maxDistance:0,refDistance:0,rollOffFactor:0,distanceModel:0,onPlay:null,onPause:null,onResume:null,onStop:null,onEnd:null},hv=function(t){function e(e,i,n){var s;return void 0===i&&(i="Untitled"),void 0===n&&(n={}),(s=t.call(this)||this).name=void 0,s.instances=[],s._component=e,s._assets=e.system.app.assets,s._manager=e.system.manager,s.name=i,s._volume=void 0!==n.volume?rt.clamp(Number(n.volume)||0,0,1):1,s._pitch=void 0!==n.pitch?Math.max(.01,Number(n.pitch)||0):1,s._loop=!(void 0===n.loop||!n.loop),s._duration=n.duration>0?n.duration:null,s._startTime=Math.max(0,Number(n.startTime)||0),s._overlap=!!n.overlap,s._autoPlay=!!n.autoPlay,s._firstNode=null,s._lastNode=null,s._asset=n.asset,s._asset instanceof Oh&&(s._asset=s._asset.id),s._onInstancePlayHandler=s._onInstancePlay.bind(Z(s)),s._onInstancePauseHandler=s._onInstancePause.bind(Z(s)),s._onInstanceResumeHandler=s._onInstanceResume.bind(Z(s)),s._onInstanceStopHandler=s._onInstanceStop.bind(Z(s)),s._onInstanceEndHandler=s._onInstanceEnd.bind(Z(s)),s}Y(e,t);var i=e.prototype;return i.play=function(){if(this.overlap||this.stop(),this.isLoaded||this._hasAsset()){var t=this._createInstance();if(this.instances.push(t),this.isLoaded)t.play();else{var e=function(e){var i=t._playWhenLoaded;t.sound=e,i&&t.play()};this.off("load",e),this.once("load",e),this.load()}return t}},i.pause=function(){for(var t=!1,e=this.instances,i=0,n=e.length;i=0;a--){var r=s[a].isPlaying||s[a].isSuspended,o=s[a].currentTime;r&&s[a].stop();var h=n._createInstance();r&&(h.play(),h.currentTime=o),s.push(h)}}}},{key:"slots",get:function(){return this._slots},set:function(t){var e=this._slots;if(e)for(var i in e)e[i].stop();var n={};for(var s in t)t[s]instanceof hv?n[t[s].name]=t[s]:t[s].name&&(n[t[s].name]=new hv(this,t[s].name,t[s]));this._slots=n,this.enabled&&this.entity.enabled&&this.onEnable()}}]),e}(du),cv=function(){this.enabled=!0},uv=["enabled"],dv=function(t){function e(e,i){var n;return(n=t.call(this,e)||this).id="sound",n.ComponentType=lv,n.DataType=cv,n.schema=uv,n.manager=i,n.app.systems.on("update",n.onUpdate,Z(n)),n.on("beforeremove",n.onBeforeRemove,Z(n)),n}Y(e,t);var i=e.prototype;return i.initializeComponentData=function(e,i,n){n=["volume","pitch","positional","refDistance","maxDistance","rollOffFactor","distanceModel","slots"];for(var s=0;sn||i<0;this._setTime(i);var a=this.frame;(a=this._sprite?Math.floor(this._sprite.frameKeys.length*this._time/n):0)!==this._frame&&this._setFrame(a),s&&(this.loop?(this.fire("loop"),this._component.fire("loop",this)):(this._playing=!1,this._paused=!1,this.fire("end"),this._component.fire("end",this)))}},i._setTime=function(t){this._time=t;var e=this.duration;this._time<0?this.loop?this._time=this._time%e+e:this._time=0:this._time>e&&(this.loop?this._time%=e:this._time=e)},i._setFrame=function(t){this._sprite?this._frame=rt.clamp(t,0,this._sprite.frameKeys.length-1):this._frame=t,this._component.currentClip===this&&this._component._showFrame(this._frame)},i._destroy=function(){this._sprite&&(this.sprite=null),this._spriteAsset&&(this.spriteAsset=null)},i.play=function(){this._playing||(this._playing=!0,this._paused=!1,this.frame=0,this.fire("play"),this._component.fire("play",this))},i.pause=function(){this._playing&&!this._paused&&(this._paused=!0,this.fire("pause"),this._component.fire("pause",this))},i.resume=function(){this._paused&&(this._paused=!1,this.fire("resume"),this._component.fire("resume",this))},i.stop=function(){this._playing&&(this._playing=!1,this._paused=!1,this._time=0,this.frame=0,this.fire("stop"),this._component.fire("stop",this))},q(e,[{key:"duration",get:function(){if(this._sprite){var t=this.fps||Number.MIN_VALUE;return this._sprite.frameKeys.length/Math.abs(t)}return 0}},{key:"frame",get:function(){return this._frame},set:function(t){this._setFrame(t);var e=this.fps||Number.MIN_VALUE;this._setTime(this._frame/e)}},{key:"isPaused",get:function(){return this._paused}},{key:"isPlaying",get:function(){return this._playing}},{key:"sprite",get:function(){return this._sprite},set:function(t){var e;(this._sprite&&(this._sprite.off("set:meshes",this._onSpriteMeshesChange,this),this._sprite.off("set:pixelsPerUnit",this._onSpritePpuChanged,this),this._sprite.off("set:atlas",this._onSpriteMeshesChange,this),this._sprite.atlas&&this._sprite.atlas.off("set:texture",this._onSpriteMeshesChange,this)),this._sprite=t,this._sprite&&(this._sprite.on("set:meshes",this._onSpriteMeshesChange,this),this._sprite.on("set:pixelsPerUnit",this._onSpritePpuChanged,this),this._sprite.on("set:atlas",this._onSpriteMeshesChange,this),this._sprite.atlas&&this._sprite.atlas.on("set:texture",this._onSpriteMeshesChange,this)),this._component.currentClip===this)&&(t&&t.atlas?(t.atlas.texture&&((e=this._component._meshInstance)&&(e.setParameter("texture_emissiveMap",t.atlas.texture),e.setParameter("texture_opacityMap",t.atlas.texture)),this._component.enabled&&this._component.entity.enabled&&this._component._showModel()),this.time&&this.fps?this.time=this.time:this.frame=this.frame):((e=this._component._meshInstance)&&(e.deleteParameter("texture_emissiveMap"),e.deleteParameter("texture_opacityMap")),this._component._hideModel()))}},{key:"spriteAsset",get:function(){return this._spriteAsset},set:function(t){var e=this._component.system.app.assets,i=t;if(t instanceof Oh&&(i=t.id),this._spriteAsset!==i){if(this._spriteAsset){var n=e.get(this._spriteAsset);n&&this._unbindSpriteAsset(n)}if(this._spriteAsset=i,this._spriteAsset){var s=e.get(this._spriteAsset);s?this._bindSpriteAsset(s):(this.sprite=null,e.on("add:"+this._spriteAsset,this._onSpriteAssetAdded,this))}else this.sprite=null}}},{key:"time",get:function(){return this._time},set:function(t){this._setTime(t),this._sprite?this.frame=Math.min(this._sprite.frameKeys.length-1,Math.floor(this._time*Math.abs(this.fps))):this.frame=0}}]),e}(m),_v="texture_emissiveMap",gv="texture_opacityMap",vv="material_emissive",yv="material_opacity",xv=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._type=fv,n._material=e.defaultMaterial,n._color=new lt(1,1,1,1),n._colorUniform=new Float32Array(3),n._speed=1,n._flipX=!1,n._flipY=!1,n._width=1,n._height=1,n._drawOrder=0,n._layers=[0],n._outerScale=new mt(1,1),n._outerScaleUniform=new Float32Array(2),n._innerOffset=new _t,n._innerOffsetUniform=new Float32Array(4),n._atlasRect=new _t,n._atlasRectUniform=new Float32Array(4),n._batchGroupId=-1,n._batchGroup=null,n._node=new an,n._model=new qo,n._model.graph=n._node,n._meshInstance=null,i.addChild(n._model.graph),n._model._entity=i,n._updateAabbFunc=n._updateAabb.bind(Z(n)),n._addedModel=!1,n._autoPlayClip=null,n._clips={},n._defaultClip=new mv(Z(n),{name:n.entity.name,fps:0,loop:!1,spriteAsset:null}),n._currentClip=n._defaultClip,n}Y(e,t);var i=e.prototype;return i.onEnable=function(){var t=this.system.app,e=t.scene;e.on("set:layers",this._onLayersChanged,this),e.layers&&(e.layers.on("add",this._onLayerAdded,this),e.layers.on("remove",this._onLayerRemoved,this)),this._showModel(),this._autoPlayClip&&this._tryAutoPlay(),this._batchGroupId>=0&&t.batcher.insert(Aa.SPRITE,this._batchGroupId,this.entity)},i.onDisable=function(){var t=this.system.app,e=t.scene;e.off("set:layers",this._onLayersChanged,this),e.layers&&(e.layers.off("add",this._onLayerAdded,this),e.layers.off("remove",this._onLayerRemoved,this)),this.stop(),this._hideModel(),this._batchGroupId>=0&&t.batcher.remove(Aa.SPRITE,this._batchGroupId,this.entity)},i.onDestroy=function(){for(var t in this._currentClip=null,this._defaultClip&&(this._defaultClip._destroy(),this._defaultClip=null),this._clips)this._clips[t]._destroy();this._clips=null,this._hideModel(),this._model=null,this._node&&(this._node.parent&&this._node.parent.removeChild(this._node),this._node=null),this._meshInstance&&(this._meshInstance.material=null,this._meshInstance.mesh=null,this._meshInstance=null)},i._showModel=function(){if(!this._addedModel&&this._meshInstance){for(var t=[this._meshInstance],e=0,i=this._layers.length;e=0&&this.system.app.batcher.remove(Aa.SPRITE,e,this.entity),this.entity.enabled&&t>=0?this.system.app.batcher.insert(Aa.SPRITE,t,this.entity):e>=0&&this._currentClip&&this._currentClip.sprite&&this.enabled&&this.entity.enabled&&this._showModel()}}},{key:"autoPlayClip",get:function(){return this._autoPlayClip},set:function(t){this._autoPlayClip=t instanceof mv?t.name:t,this._tryAutoPlay()}},{key:"drawOrder",get:function(){return this._drawOrder},set:function(t){this._drawOrder=t,this._meshInstance&&(this._meshInstance.drawOrder=t)}},{key:"layers",get:function(){return this._layers},set:function(t){this._addedModel&&this._hideModel(),this._layers=t,this._meshInstance&&this.enabled&&this.entity.enabled&&this._showModel()}},{key:"aabb",get:function(){return this._meshInstance?this._meshInstance.aabb:null}}]),e}(du),bv=function(){this.enabled=!0},Sv=["enabled"],wv=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="sprite",i.ComponentType=xv,i.DataType=bv,i.schema=Sv,i._defaultTexture=null,i._defaultMaterial=null,i._default9SlicedMaterialSlicedMode=null,i._default9SlicedMaterialTiledMode=null,i.app.systems.on("update",i.onUpdate,Z(i)),i.on("beforeremove",i.onBeforeRemove,Z(i)),i}Y(e,t);var i=e.prototype;return i.destroy=function(){t.prototype.destroy.call(this),this.app.systems.off("update",this.onUpdate,this),this._defaultTexture&&(this._defaultTexture.destroy(),this._defaultTexture=null)},i.initializeComponentData=function(e,i,n){if(void 0!==i.enabled&&(e.enabled=i.enabled),e.type=i.type,i.layers&&Array.isArray(i.layers)&&(e.layers=i.layers.slice(0)),void 0!==i.drawOrder&&(e.drawOrder=i.drawOrder),void 0!==i.color&&(i.color instanceof lt?e.color.set(i.color.r,i.color.g,i.color.b,void 0!==i.opacity?i.opacity:1):e.color.set(i.color[0],i.color[1],i.color[2],void 0!==i.opacity?i.opacity:1),e.color=e.color),void 0!==i.opacity&&(e.opacity=i.opacity),void 0!==i.flipX&&(e.flipX=i.flipX),void 0!==i.flipY&&(e.flipY=i.flipY),void 0!==i.width&&(e.width=i.width),void 0!==i.height&&(e.height=i.height),void 0!==i.spriteAsset&&(e.spriteAsset=i.spriteAsset),i.sprite&&(e.sprite=i.sprite),void 0!==i.frame&&(e.frame=i.frame),i.clips)for(var s in i.clips)e.addClip(i.clips[s]);void 0!==i.speed&&(e.speed=i.speed),i.autoPlayClip&&(e.autoPlayClip=i.autoPlayClip),e.batchGroupId=void 0===i.batchGroupId||null===i.batchGroupId?-1:i.batchGroupId,t.prototype.initializeComponentData.call(this,e,i,n)},i.cloneComponent=function(t,e){var i=t.sprite;return this.addComponent(e,{enabled:i.enabled,type:i.type,spriteAsset:i.spriteAsset,sprite:i.sprite,frame:i.frame,color:i.color.clone(),opacity:i.opacity,flipX:i.flipX,flipY:i.flipY,speed:i.speed,clips:i.clips,autoPlayClip:i.autoPlayClip,batchGroupId:i.batchGroupId,drawOrder:i.drawOrder,layers:i.layers.slice(0)})},i.onUpdate=function(t){var e=this.store;for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(n.data.enabled&&n.entity.enabled){var s=n.entity.sprite;s._currentClip&&s._currentClip._update(t)}}},i.onBeforeRemove=function(t,e){e.onDestroy()},q(e,[{key:"defaultMaterial",get:function(){if(!this._defaultMaterial){var t=new Bi(this.app.graphicsDevice,{width:1,height:1,format:7}),e=new Uint8Array(t.lock());e[0]=e[1]=e[2]=e[3]=255,t.name="sprite",t.unlock();var i=new os;i.diffuse.set(0,0,0),i.emissive.set(.5,.5,.5),i.emissiveMap=t,i.emissiveMapTint=!0,i.opacityMap=t,i.opacityMapChannel="a",i.opacityTint=!0,i.opacity=0,i.useLighting=!1,i.useGammaTonemap=!1,i.useFog=!1,i.useSkybox=!1,i.blendType=4,i.depthWrite=!1,i.pixelSnap=!1,i.cull=0,i.update(),this._defaultTexture=t,this._defaultMaterial=i}return this._defaultMaterial},set:function(t){this._defaultMaterial=t}},{key:"default9SlicedMaterialSlicedMode",get:function(){if(!this._default9SlicedMaterialSlicedMode){var t=this.defaultMaterial.clone();t.nineSlicedMode=1,t.update(),this._default9SlicedMaterialSlicedMode=t}return this._default9SlicedMaterialSlicedMode},set:function(t){this._default9SlicedMaterialSlicedMode=t}},{key:"default9SlicedMaterialTiledMode",get:function(){if(!this._default9SlicedMaterialTiledMode){var t=this.defaultMaterial.clone();t.nineSlicedMode=2,t.update(),this._default9SlicedMaterialTiledMode=t}return this._default9SlicedMaterialTiledMode},set:function(t){this._default9SlicedMaterialTiledMode=t}}]),e}(ud);du._buildAccessors(xv.prototype,Sv);var Tv=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._oldState=!0,n._size=new ft,n.on("set_enabled",n._onSetEnabled,Z(n)),n}Y(e,t);var i=e.prototype;return i.onEnable=function(){this._checkState()},i.onDisable=function(){this._checkState()},i._onSetEnabled=function(t,e,i){this._checkState()},i._checkState=function(){var t=this.enabled&&this.entity.enabled;t!==this._oldState&&(this._oldState=t,this.fire("enable"),this.fire("state",this.enabled))},i._onBeforeRemove=function(){this.fire("remove")},q(e,[{key:"size",get:function(){return this._size},set:function(t){t instanceof ft?this._size.copy(t):t instanceof Array&&t.length>=3&&this.size.set(t[0],t[1],t[2])}}]),e}(du),Av=function(){this.enabled=!0},Mv=["enabled"],Cv=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="zone",i.ComponentType=Tv,i.DataType=Av,i.schema=Mv,i.on("beforeremove",i._onBeforeRemove,Z(i)),i}Y(e,t);var i=e.prototype;return i.initializeComponentData=function(t,e,i){t.enabled=!e.hasOwnProperty("enabled")||!!e.enabled,e.size&&(e.size instanceof ft?t.size.copy(e.size):e.size instanceof Array&&e.size.length>=3&&t.size.set(e.size[0],e.size[1],e.size[2]))},i.cloneComponent=function(t,e){var i={size:t.zone.size};return this.addComponent(e,i)},i._onBeforeRemove=function(t,e){e._onBeforeRemove()},e}(ud);du._buildAccessors(Tv.prototype,Mv);var Ev=function(){function t(t){this.frame={fps:0,ms:0,dt:0,updateStart:0,updateTime:0,renderStart:0,renderTime:0,physicsStart:0,physicsTime:0,cullTime:0,sortTime:0,skinTime:0,morphTime:0,instancingTime:0,triangles:0,otherPrimitives:0,shaders:0,materials:0,cameras:0,shadowMapUpdates:0,shadowMapTime:0,depthMapTime:0,forwardTime:0,lightClustersTime:0,lightClusters:0,_timeToCountFrames:0,_fpsAccum:0},this.drawCalls={forward:0,depth:0,shadow:0,immediate:0,misc:0,total:0,skinned:0,instanced:0,removedByInstancing:0},this.misc={renderTargetCreationTime:0},this.particles={updatesPerFrame:0,_updatesPerFrame:0,frameTime:0,_frameTime:0},this.shaders=t._shaderStats,this.vram=t._vram,Object.defineProperty(this.vram,"totalUsed",{get:function(){return this.tex+this.vb+this.ib}}),Object.defineProperty(this.vram,"geom",{get:function(){return this.vb+this.ib}})}return q(t,[{key:"scene",get:function(){return ia().scene._stats}},{key:"lightmapper",get:function(){return ia().lightmapper.stats}},{key:"batcher",get:function(){return ia().batcher._stats}}]),t}(),Pv=function(){function t(t,e){this.name=t,this.url=e,this.data=null,this._loading=!1,this._onLoadedCallbacks=[]}return q(t,[{key:"loaded",get:function(){return!!this.data}},{key:"loading",get:function(){return this._loading}}]),t}(),Rv=function(){function t(t){this._app=t,this._list=[],this._index={},this._urlIndex={}}var e=t.prototype;return e.destroy=function(){this._app=null},e.list=function(){return this._list},e.add=function(t,e){if(this._index.hasOwnProperty(t))return!1;var i=new Pv(t,e),n=this._list.push(i);return this._index[i.name]=n-1,this._urlIndex[i.url]=n-1,!0},e.find=function(t){return this._index.hasOwnProperty(t)?this._list[this._index[t]]:null},e.findByUrl=function(t){return this._urlIndex.hasOwnProperty(t)?this._list[this._urlIndex[t]]:null},e.remove=function(t){if(this._index.hasOwnProperty(t)){var e=this._index[t],i=this._list[e];delete this._urlIndex[i.url],delete this._index[t],this._list.splice(e,1);for(var n=0;n0&&this.loader.enableRetry(t.maxAssetRetries),t.useDevicePixelRatio||(t.useDevicePixelRatio=t.use_device_pixel_ratio),t.resolutionMode||(t.resolutionMode=t.resolution_mode),t.fillMode||(t.fillMode=t.fill_mode),this._width=t.width,this._height=t.height,t.useDevicePixelRatio&&(this.graphicsDevice.maxPixelRatio=window.devicePixelRatio),this.setCanvasResolution(t.resolutionMode,this._width,this._height),this.setCanvasFillMode(t.fillMode,this._width,this._height),t.layers&&t.layerOrder){var i=new Mo("application"),n={};for(var s in t.layers){var a=t.layers[s];a.id=parseInt(s,10),a.enabled=1!==a.id,n[s]=new vo(a)}for(var r=0,o=t.layerOrder.length;r0,d.tags.add(u.tags),u.i18n)for(var f in u.i18n)d.addLocalizedAssetId(f,u.i18n[f]);this.assets.add(d)}},n._getScriptReferences=function(t){var e=[];t.settings.priority_scripts&&(e=t.settings.priority_scripts);for(var i=[],n={},s=0;sn._timeToCountFrames?(n.fps=n._fpsAccum,n._fpsAccum=0,n._timeToCountFrames=t+1e3):n._fpsAccum++,this.stats.drawCalls.total=this.graphicsDevice._drawCallsPerFrame,this.graphicsDevice._drawCallsPerFrame=0},n._fillFrameStats=function(){var t=this.stats.frame;t.cameras=this.renderer._camerasRendered,t.materials=this.renderer._materialSwitches,t.shaders=this.graphicsDevice._shaderSwitchesPerFrame,t.shadowMapUpdates=this.renderer._shadowMapUpdates,t.shadowMapTime=this.renderer._shadowMapTime,t.depthMapTime=this.renderer._depthMapTime,t.forwardTime=this.renderer._forwardTime;var e=this.graphicsDevice._primsPerFrame;t.triangles=e[4]/3+Math.max(e[5]-2,0)+Math.max(e[6]-2,0),t.cullTime=this.renderer._cullTime,t.sortTime=this.renderer._sortTime,t.skinTime=this.renderer._skinTime,t.morphTime=this.renderer._morphTime,t.lightClusters=this.renderer._lightClusters,t.lightClustersTime=this.renderer._lightClustersTime,t.otherPrimitives=0;for(var i=0;ii/n?e=(t=i)/s:t=(e=n)*s}else this._fillMode===xu&&(t=i,e=n);return this.graphicsDevice.canvas.style.width=t+"px",this.graphicsDevice.canvas.style.height=e+"px",this.updateCanvasSize(),{width:t,height:e}}},n.updateCanvasSize=function(){if(this._allowResize&&!this.xr.active&&this._resolutionMode===Su){var t=this.graphicsDevice.canvas;this.graphicsDevice.resizeCanvas(t.clientWidth,t.clientHeight)}},n.onLibrariesLoaded=function(){this._librariesLoaded=!0,this.systems.rigidbody.onLibraryLoaded()},n.applySceneSettings=function(t){var e;if(this.systems.rigidbody&&"undefined"!=typeof Ammo){var i=t.physics.gravity;this.systems.rigidbody.gravity.set(i[0],i[1],i[2])}this.scene.applySettings(t),t.render.hasOwnProperty("skybox")&&(t.render.skybox?(e=this.assets.get(t.render.skybox))?this.setSkybox(e):this.assets.once("add:"+t.render.skybox,this.setSkybox,this):this.setSkybox(null))},n.setAreaLightLuts=function(t){if(t){var e=this.graphicsDevice;t.ready((function(t){Go.set(e,t.resource)})),this.assets.load(t)}},n.setSkybox=function(t){var e=this;if(t!==this._skyboxAsset){var i=function(){e.setSkybox(null)},n=function(){e.scene.setSkybox(e._skyboxAsset?e._skyboxAsset.resources:null)};this._skyboxAsset&&(this.assets.off("load:"+this._skyboxAsset.id,n,this),this.assets.off("remove:"+this._skyboxAsset.id,i,this),this._skyboxAsset.off("change",n,this)),this._skyboxAsset=t,this._skyboxAsset&&(this.assets.on("load:"+this._skyboxAsset.id,n,this),this.assets.once("remove:"+this._skyboxAsset.id,i,this),this._skyboxAsset.on("change",n,this),0!==this.scene.skyboxMip||this._skyboxAsset.loadFaces||(this._skyboxAsset.loadFaces=!0),this.assets.load(this._skyboxAsset)),n()}},n.enableVr=function(){this.vr||(this.vr=new Au(this))},n.disableVr=function(){this.vr&&(this.vr.destroy(),this.vr=null)},n._firstBake=function(){this.lightmapper.bake(null,this.scene.lightmapMode)},n._firstBatch=function(){this.batcher.generate()},n._processTimestamp=function(t){return t},n.drawLine=function(t,e,i,n,s){this.scene.drawLine(t,e,i,n,s)},n.drawLines=function(t,e,i,n){void 0===i&&(i=!0),void 0===n&&(n=this.scene.defaultDrawLayer),this.scene.drawLines(t,e,i,n)},n.drawLineArrays=function(t,e,i,n){void 0===i&&(i=!0),void 0===n&&(n=this.scene.defaultDrawLayer),this.scene.drawLineArrays(t,e,i,n)},n.drawWireSphere=function(t,e,i,n,s,a){void 0===i&&(i=lt.WHITE),void 0===n&&(n=20),void 0===s&&(s=!0),void 0===a&&(a=this.scene.defaultDrawLayer),this.scene.immediate.drawWireSphere(t,e,i,n,s,a)},n.drawWireAlignedBox=function(t,e,i,n,s){void 0===i&&(i=lt.WHITE),void 0===n&&(n=!0),void 0===s&&(s=this.scene.defaultDrawLayer),this.scene.immediate.drawWireAlignedBox(t,e,i,n,s)},n.drawMeshInstance=function(t,e){void 0===e&&(e=this.scene.defaultDrawLayer),this.scene.immediate.drawMesh(null,null,null,t,e)},n.drawMesh=function(t,e,i,n){void 0===n&&(n=this.scene.defaultDrawLayer),this.scene.immediate.drawMesh(e,i,t,null,n)},n.drawQuad=function(t,e,i){void 0===i&&(i=this.scene.defaultDrawLayer),this.scene.immediate.drawMesh(e,t,this.scene.immediate.getQuadMesh(),null,i)},n.drawTexture=function(t,e,i,n,s,a,r){void 0===r&&(r=this.scene.defaultDrawLayer);var o=new St;o.setTRS(new ft(t,e,0),wt.IDENTITY,new ft(i,n,0)),a||((a=new Kn).setParameter("colorMap",s),a.shader=this.scene.immediate.getTextureShader(),a.update()),this.drawQuad(o,a,r)},n.drawDepthTexture=function(t,e,i,n,s){void 0===s&&(s=this.scene.defaultDrawLayer);var a=new Kn;a.shader=this.scene.immediate.getDepthTextureShader(),a.update(),this.drawTexture(t,e,i,n,null,a,s)},n.destroy=function(){if(this._inFrameUpdate)this._destroyRequested=!0;else{var t=this.graphicsDevice.canvas.id;this.off("librariesloaded"),"undefined"!=typeof document&&(document.removeEventListener("visibilitychange",this._visibilityChangeHandler,!1),document.removeEventListener("mozvisibilitychange",this._visibilityChangeHandler,!1),document.removeEventListener("msvisibilitychange",this._visibilityChangeHandler,!1),document.removeEventListener("webkitvisibilitychange",this._visibilityChangeHandler,!1)),this._visibilityChangeHandler=null,this.root.destroy(),this.root=null,this.mouse&&(this.mouse.off(),this.mouse.detach(),this.mouse=null),this.keyboard&&(this.keyboard.off(),this.keyboard.detach(),this.keyboard=null),this.touch&&(this.touch.off(),this.touch.detach(),this.touch=null),this.elementInput&&(this.elementInput.detach(),this.elementInput=null),this.controller&&(this.controller=null),this.systems.destroy(),this.scene.layers&&this.scene.layers.destroy();for(var e=this.assets.list(),n=0;n0&&e.push(new Vv(t,l))}}for(var d=0;d0){var c=1===e?2:1;this.setLightmapping(o,!1,c),this.initBake(i),this.bakeInternal(c,o,h);var u=64;1===e&&(u|=Ft),this.scene.ambientBake&&(u|=Vt),this.setLightmapping(o,!0,c,u),this.finishBake(o)}var d=it();this.stats.totalRenderTime=d-n,this.stats.shadersLinked=i._shaderStats.linked-s,this.stats.compileTime=i._shaderStats.compileTime-r,this.stats.fboTime=i._renderTargetCreationTime-a,this.stats.lightmapCount=o.length},e.allocateTextures=function(t,e){for(var i=0;i0){e.copy(t[0].aabb);for(var i=1;i1&&x>1&&v.light.bakeDir&&(x=1);for(var b=0;b1&&v.prepareVirtualLight(b,x),v.startBake();var S=!1,w=this.lightCameraPrepare(s,v);for(m=0;m0&&b>0)&&!(y&&p>0);p++){var M=T.renderTargets[p],C=T.renderTargets[p].colorBuffer.width,E=this.renderTargets.get(C),P=E.colorBuffer;0===p?g=n.updateShaders:g&&(n.updateShaders=!0);var R=this.passMaterials[p];for(y&&b+1===x&&0===p&&(R=this.ambientAOMaterial),c=0;c>16&255)/255,e.pickColor[1]=(s>>8&255)/255,e.pickColor[2]=(255&s)/255,i.setValue(e.pickColor),t.setBlending(!1),e.mapping[s]=n}}),this.layer.addCamera(this.cameraEntity.camera),this.layerComp=new Mo("picker"),this.layerComp.pushOpaque(this.layer)},e.prepare=function(t,e,i){t instanceof Wi&&(t=t.node.camera),i instanceof vo&&(i=[i]),this.layer.clearMeshInstances();for(var n=this.layer.opaqueMeshInstances,s=e.layers.layerList,a=e.layers.subLayerEnabled,r=e.layers.subLayerList,o=0;o=0){h._clearDepthBuffer&&n.push(this.clearDepthCommand);for(var l=r[o]?h.instances.transparentMeshInstances:h.instances.opaqueMeshInstances,c=0;cYv?Yv:i.width||512,a=i.height>Yv?Yv:i.height||512,r=document.createElement("canvas");r.height=a,r.width=s;var o=new Bi(n.app.graphicsDevice,{name:"font",format:7,minFilter:5,magFilter:1,addressU:1,addressV:1,mipmaps:!0});return o.setSource(r),n.textures=[o],n.chars="",n.data={},n}Y(e,t);var i=e.prototype;return i.createTextures=function(t){var e=this._normalizeCharsSet(t);if(e.length===this.chars.length){for(var i=0;i0&&this._renderAtlas(this.chars.concat(i))},i.destroy=function(){for(var t=0;tC&&(C=this.fontSize*this.fontSize/E,c.font=this.fontWeight+" "+C.toString()+"px "+this.fontName,E=this.fontSize),this.renderCharacter(c,A,S+x,w+b,a);var P=this.padding+(this.glyphSize-E)/2,R=-this.padding+m[A].descent-p,I=E;if(this._addChar(this.data,A,M,S,w,v,y,P,R,I,e-1,n,s),(S+=v)+v>n&&(S=0,(w+=y)+y>s))if(this.textures[e-1].upload(),w=0,++e>d){(i=document.createElement("canvas")).height=s,i.width=n,c=this._getAndClearContext(i,o);var L=new Bi(this.app.graphicsDevice,{format:7,mipmaps:!0});L.name="font-atlas",L.setSource(i),L.minFilter=5,L.magFilter=1,L.addressU=1,L.addressV=1,this.textures.push(L)}else i=this.textures[e-1].getSource(),c=this._getAndClearContext(i,o)}if(this.textures[e-1].upload(),e0?this.wheelDelta=1:i.deltaY<0&&(this.wheelDelta=-1)),hy()?(this.dx=i.movementX||i.webkitMovementX||i.mozMovementX||0,this.dy=i.movementY||i.webkitMovementY||i.mozMovementY||0):(this.dx=this.x-e._lastX,this.dy=this.y-e._lastY),"mousedown"===i.type||"mouseup"===i.type?this.button=i.button:this.button=-1,this.buttons=e._buttons.slice(0),this.element=i.target,this.ctrlKey=i.ctrlKey||!1,this.altKey=i.altKey||!1,this.shiftKey=i.shiftKey||!1,this.metaKey=i.metaKey||!1,this.event=i},dy=function(t){function e(e){var i;return(i=t.call(this)||this)._lastX=0,i._lastY=0,i._buttons=[!1,!1,!1],i._lastbuttons=[!1,!1,!1],i._upHandler=i._handleUp.bind(Z(i)),i._downHandler=i._handleDown.bind(Z(i)),i._moveHandler=i._handleMove.bind(Z(i)),i._wheelHandler=i._handleWheel.bind(Z(i)),i._contextMenuHandler=function(t){t.preventDefault()},i._target=null,i._attached=!1,i.attach(e),i}Y(e,t),e.isPointerLocked=function(){return hy()};var i=e.prototype;return i.attach=function(t){if(this._target=t,!this._attached){this._attached=!0;var e=!!L.passiveEvents&&{passive:!1};window.addEventListener("mouseup",this._upHandler,e),window.addEventListener("mousedown",this._downHandler,e),window.addEventListener("mousemove",this._moveHandler,e),window.addEventListener("wheel",this._wheelHandler,e)}},i.detach=function(){if(this._attached){this._attached=!1,this._target=null;var t=!!L.passiveEvents&&{passive:!1};window.removeEventListener("mouseup",this._upHandler,t),window.removeEventListener("mousedown",this._downHandler,t),window.removeEventListener("mousemove",this._moveHandler,t),window.removeEventListener("wheel",this._wheelHandler,t)}},i.disableContextMenu=function(){this._target&&this._target.addEventListener("contextmenu",this._contextMenuHandler)},i.enableContextMenu=function(){this._target&&this._target.removeEventListener("contextmenu",this._contextMenuHandler)},i.enablePointerLock=function(t,e){if(document.body.requestPointerLock){t&&document.addEventListener("pointerlockchange",(function e(){t(),document.removeEventListener("pointerlockchange",e)}),!1),e&&document.addEventListener("pointerlockerror",(function t(){e(),document.removeEventListener("pointerlockerror",t)}),!1),document.body.requestPointerLock()}else e&&e()},i.disablePointerLock=function(t){if(document.exitPointerLock){t&&document.addEventListener("pointerlockchange",(function e(){t(),document.removeEventListener("pointerlockchange",e)}),!1),document.exitPointerLock()}},i.update=function(){this._lastbuttons[0]=this._buttons[0],this._lastbuttons[1]=this._buttons[1],this._lastbuttons[2]=this._buttons[2]},i.isPressed=function(t){return this._buttons[t]},i.wasPressed=function(t){return this._buttons[t]&&!this._lastbuttons[t]},i.wasReleased=function(t){return!this._buttons[t]&&this._lastbuttons[t]},i._handleUp=function(t){this._buttons[t.button]=!1;var e=new uy(this,t);e.event&&this.fire(qg,e)},i._handleDown=function(t){this._buttons[t.button]=!0;var e=new uy(this,t);e.event&&this.fire(Hg,e)},i._handleMove=function(t){var e=new uy(this,t);e.event&&(this.fire(Xg,e),this._lastX=e.x,this._lastY=e.y)},i._handleWheel=function(t){var e=new uy(this,t);e.event&&this.fire(jg,e)},i._getTargetCoords=function(t){var e=this._target.getBoundingClientRect(),i=Math.floor(e.left),n=Math.floor(e.top);return t.clientX=i+this._target.clientWidth||t.clientY=n+this._target.clientHeight?null:{x:t.clientX-i,y:t.clientY-n}},e}(m),fy=function(){function t(t,e){void 0===e&&(e={}),this._keyboard=e.keyboard||null,this._mouse=e.mouse||null,this._gamepads=e.gamepads||null,this._element=null,this._actions={},this._axes={},this._axesValues={},t&&this.attach(t)}var e=t.prototype;return e.attach=function(t){this._element=t,this._keyboard&&this._keyboard.attach(t),this._mouse&&this._mouse.attach(t)},e.detach=function(){this._keyboard&&this._keyboard.detach(),this._mouse&&this._mouse.detach(),this._element=null},e.disableContextMenu=function(){this._mouse||this._enableMouse(),this._mouse.disableContextMenu()},e.enableContextMenu=function(){this._mouse||this._enableMouse(),this._mouse.enableContextMenu()},e.update=function(t){for(var e in this._keyboard&&this._keyboard.update(),this._mouse&&this._mouse.update(),this._gamepads&&this._gamepads.update(),this._axesValues={},this._axes)this._axesValues[e]=[]},e.registerKeys=function(t,e){if(this._keyboard||this._enableKeyboard(),this._actions[t])throw new Error("Action: "+t+" already registered");if(void 0===e)throw new Error("Invalid button");e.length||(e=[e]),this._actions[t]?this._actions[t].push({type:Wg,keys:e}):this._actions[t]=[{type:Wg,keys:e}]},e.registerMouse=function(t,e){if(this._mouse||this._enableMouse(),void 0===e)throw new Error("Invalid button");this._actions[t]?this._actions[t].push({type:Vg,button:e}):this._actions[t]=[{type:Vg,button:-e}]},e.registerPadButton=function(t,e,i){if(void 0===i)throw new Error("Invalid button");this._actions[t]?this._actions[t].push({type:Gg,button:i,pad:e}):this._actions[t]=[{type:Gg,button:i,pad:e}]},e.registerAxis=function(t){var e=t.name;this._axes[e]||(this._axes[e]=[]);var i=this._axes[e].push(e);(t=t||{}).pad=t.pad||0;var n=function(n,s,a,r){switch(s){case"mousex":n._mouse.on(Xg,(function(t){n._axesValues[e][i]=t.dx/10}));break;case"mousey":n._mouse.on(Xg,(function(t){n._axesValues[e][i]=t.dy/10}));break;case"key":n._axes[e].push((function(){return n._keyboard.isPressed(r)?a:0}));break;case"padrx":n._axes[e].push((function(){return n._gamepads.getAxis(t.pad,2)}));break;case"padry":n._axes[e].push((function(){return n._gamepads.getAxis(t.pad,3)}));break;case"padlx":n._axes[e].push((function(){return n._gamepads.getAxis(t.pad,0)}));break;case"padly":n._axes[e].push((function(){return n._gamepads.getAxis(t.pad,1)}));break;default:throw new Error("Unknown axis")}};n(this,t.positive,1,t.positiveKey),(t.negativeKey||t.negative!==t.positive)&&n(this,t.negative,-1,t.negativeKey)},e.isPressed=function(t){if(!this._actions[t])return!1;for(var e=this._actions[t].length,i=0;iMath.abs(e)&&(e=s)}else this._axesValues[t]&&Math.abs(this._axesValues[t][n])>Math.abs(e)&&(e=this._axesValues[t][n]);return e},e._enableMouse=function(){if(this._mouse=new dy,!this._element)throw new Error("Controller must be attached to an Element");this._mouse.attach(this._element)},e._enableKeyboard=function(){if(this._keyboard=new oy,!this._element)throw new Error("Controller must be attached to an Element");this._keyboard.attach(this._element)},t}(),py=new ft,my=new ft,_y=new Xt,gy=new Xt,vy=new Xt;_y.end=new ft,gy.end=new ft,vy.end=new ft;var yy=new ft,xy=new ft,by=new ft,Sy=new ft,wy=new ft,Ty=new ft,Ay=new ft,My=new ft,Cy=new ft,Ey=new ft,Py=new ft,Ry=new ft,Iy=new ft,Ly=new ft,Dy=new ft,ky=new ft,Oy=new ft,Fy=new ft,By=new ft,Ny=new ft,Uy=new _t;function zy(t,e,i){return Py.cross(t,e).dot(i)}var Vy=function(){function t(t,e,i){this.event=t,this.element=e,this.camera=i,this._stopPropagation=!1}return t.prototype.stopPropagation=function(){this._stopPropagation=!0,this.event&&(this.event.stopImmediatePropagation(),this.event.stopPropagation())},t}(),Wy=function(t){function e(e,i,n,s,a,r,o){var h;return(h=t.call(this,e,i,n)||this).x=s,h.y=a,h.ctrlKey=e.ctrlKey||!1,h.altKey=e.altKey||!1,h.shiftKey=e.shiftKey||!1,h.metaKey=e.metaKey||!1,h.button=e.button,dy.isPointerLocked()?(h.dx=e.movementX||e.webkitMovementX||e.mozMovementX||0,h.dy=e.movementY||e.webkitMovementY||e.mozMovementY||0):(h.dx=s-r,h.dy=a-o),h.wheelDelta=0,"wheel"===e.type&&(e.deltaY>0?h.wheelDelta=1:e.deltaY<0&&(h.wheelDelta=-1)),h}return Y(e,t),e}(Vy),Gy=function(t){function e(e,i,n,s,a,r){var o;return(o=t.call(this,e,i,n)||this).touches=e.touches,o.changedTouches=e.changedTouches,o.x=s,o.y=a,o.touch=r,o}return Y(e,t),e}(Vy),Hy=function(t){function e(e,i,n,s){var a;return(a=t.call(this,e,i,n)||this).inputSource=s,a}return Y(e,t),e}(Vy),Xy=function(){function t(t,e){this._app=null,this._attached=!1,this._target=null,this._enabled=!0,this._lastX=0,this._lastY=0,this._upHandler=this._handleUp.bind(this),this._downHandler=this._handleDown.bind(this),this._moveHandler=this._handleMove.bind(this),this._wheelHandler=this._handleWheel.bind(this),this._touchstartHandler=this._handleTouchStart.bind(this),this._touchendHandler=this._handleTouchEnd.bind(this),this._touchcancelHandler=this._touchendHandler,this._touchmoveHandler=this._handleTouchMove.bind(this),this._sortHandler=this._sortElements.bind(this),this._elements=[],this._hoveredElement=null,this._pressedElement=null,this._touchedElements={},this._touchesForWhichTouchLeaveHasFired={},this._selectedElements={},this._selectedPressedElements={},this._useMouse=!e||!1!==e.useMouse,this._useTouch=!e||!1!==e.useTouch,this._useXr=!e||!1!==e.useXr,this._selectEventsAttached=!1,L.touch&&(this._clickedEntities={}),this.attach(t)}var e=t.prototype;return e.attach=function(t){this._attached&&(this._attached=!1,this.detach()),this._target=t,this._attached=!0;var e=!!L.passiveEvents&&{passive:!0};this._useMouse&&(window.addEventListener("mouseup",this._upHandler,e),window.addEventListener("mousedown",this._downHandler,e),window.addEventListener("mousemove",this._moveHandler,e),window.addEventListener("wheel",this._wheelHandler,e)),this._useTouch&&L.touch&&(this._target.addEventListener("touchstart",this._touchstartHandler,e),this._target.addEventListener("touchend",this._touchendHandler,!1),this._target.addEventListener("touchmove",this._touchmoveHandler,!1),this._target.addEventListener("touchcancel",this._touchcancelHandler,!1)),this.attachSelectEvents()},e.attachSelectEvents=function(){!this._selectEventsAttached&&this._useXr&&this.app&&this.app.xr&&this.app.xr.supported&&(this._clickedEntities||(this._clickedEntities={}),this._selectEventsAttached=!0,this.app.xr.on("start",this._onXrStart,this))},e.detach=function(){if(this._attached){this._attached=!1;var t=!!L.passiveEvents&&{passive:!0};this._useMouse&&(window.removeEventListener("mouseup",this._upHandler,t),window.removeEventListener("mousedown",this._downHandler,t),window.removeEventListener("mousemove",this._moveHandler,t),window.removeEventListener("wheel",this._wheelHandler,t)),this._useTouch&&(this._target.removeEventListener("touchstart",this._touchstartHandler,t),this._target.removeEventListener("touchend",this._touchendHandler,!1),this._target.removeEventListener("touchmove",this._touchmoveHandler,!1),this._target.removeEventListener("touchcancel",this._touchcancelHandler,!1)),this._selectEventsAttached&&(this._selectEventsAttached=!1,this.app.xr.off("start",this._onXrStart,this),this.app.xr.off("end",this._onXrEnd,this),this.app.xr.off("update",this._onXrUpdate,this),this.app.xr.input.off("selectstart",this._onSelectStart,this),this.app.xr.input.off("selectend",this._onSelectEnd,this),this.app.xr.input.off("remove",this._onXrInputRemove,this)),this._target=null}},e.addElement=function(t){-1===this._elements.indexOf(t)&&this._elements.push(t)},e.removeElement=function(t){var e=this._elements.indexOf(t);-1!==e&&this._elements.splice(e,1)},e._handleUp=function(t){this._enabled&&(dy.isPointerLocked()||(this._calcMouseCoords(t),null!==ly&&this._onElementMouseEvent("mouseup",t)))},e._handleDown=function(t){this._enabled&&(dy.isPointerLocked()||(this._calcMouseCoords(t),null!==ly&&this._onElementMouseEvent("mousedown",t)))},e._handleMove=function(t){this._enabled&&(this._calcMouseCoords(t),null!==ly&&(this._onElementMouseEvent("mousemove",t),this._lastX=ly,this._lastY=cy))},e._handleWheel=function(t){this._enabled&&(this._calcMouseCoords(t),null!==ly&&this._onElementMouseEvent("mousewheel",t))},e._determineTouchedElements=function(t){for(var e={},i=this.app.systems.camera.cameras,n=i.length-1;n>=0;n--){for(var s=i[n],a=0,r=t.changedTouches.length,o=0;o=0;d--){this._getTargetElement(e[d],u.x,u.y)===o&&(this._clickedEntities[o.entity.getGuid()]||(this._fireEvent("click",new Gy(t,o,h,l,c,a)),this._clickedEntities[o.entity.getGuid()]=!0))}}}}},e._handleTouchMove=function(t){if(t.preventDefault(),this._enabled)for(var e=this._determineTouchedElements(t),i=0,n=t.changedTouches.length;i=0&&(s=a[r],!(i=this._getTargetElement(s,ly,cy)));r--);i&&(this._fireEvent(t,new Wy(e,i,s,ly,cy,this._lastX,this._lastY)),this._hoveredElement=i,"mousedown"===t&&(this._pressedElement=i)),n!==this._hoveredElement&&(n&&this._fireEvent("mouseleave",new Wy(e,n,s,ly,cy,this._lastX,this._lastY)),this._hoveredElement&&this._fireEvent("mouseenter",new Wy(e,this._hoveredElement,s,ly,cy,this._lastX,this._lastY))),"mouseup"===t&&this._pressedElement&&(this._pressedElement===this._hoveredElement?(this._pressedElement=null,this._clickedEntities&&this._clickedEntities[this._hoveredElement.entity.getGuid()]||this._fireEvent("click",new Wy(e,this._hoveredElement,s,ly,cy,this._lastX,this._lastY))):this._pressedElement=null)},e._onXrStart=function(){this.app.xr.on("end",this._onXrEnd,this),this.app.xr.on("update",this._onXrUpdate,this),this.app.xr.input.on("selectstart",this._onSelectStart,this),this.app.xr.input.on("selectend",this._onSelectEnd,this),this.app.xr.input.on("remove",this._onXrInputRemove,this)},e._onXrEnd=function(){this.app.xr.off("update",this._onXrUpdate,this),this.app.xr.input.off("selectstart",this._onSelectStart,this),this.app.xr.input.off("selectend",this._onSelectEnd,this),this.app.xr.input.off("remove",this._onXrInputRemove,this)},e._onXrUpdate=function(){if(this._enabled)for(var t=this.app.xr.input.inputSources,e=0;e=0&&(a=o[h],!(n=this._getTargetElementByRay(vy,a)));h--);}e._elementEntity=n||null,n?(this._selectedElements[e.id]=n,s=n):delete this._selectedElements[e.id],r!==s&&(r&&this._fireEvent("selectleave",new Hy(i,r,a,e)),s&&this._fireEvent("selectenter",new Hy(i,s,a,e))),"selectstart"===t&&(this._selectedPressedElements[e.id]=s,s&&this._fireEvent("selectstart",new Hy(i,s,a,e)));var l=this._selectedPressedElements[e.id];!e.elementInput&&l&&(delete this._selectedPressedElements[e.id],r&&this._fireEvent("selectend",new Hy(i,r,a,e))),"selectend"===t&&e.elementInput&&(delete this._selectedPressedElements[e.id],r&&this._fireEvent("selectend",new Hy(i,r,a,e)),l&&l===r&&this._fireEvent("click",new Hy(i,l,a,e)))},e._fireEvent=function(t,e){for(var i=e.element;i.fire(t,e),!e._stopPropagation&&i.entity.parent&&(i=i.entity.parent.element););},e._calcMouseCoords=function(t){var e=this._target.getBoundingClientRect(),i=Math.floor(e.left),n=Math.floor(e.top);t.clientX=i+this._target.clientWidth||t.clientY=n+this._target.clientHeight?(ly=null,cy=null):(ly=t.clientX-i,cy=t.clientY-n)},e._calcTouchCoords=function(t){for(var e=0,i=0,n=t.target;!(n instanceof HTMLElement);)n=n.parentNode;var s=n;do{e+=s.offsetLeft-s.scrollLeft,i+=s.offsetTop-s.scrollTop,s=s.offsetParent}while(s);return{x:t.pageX-e,y:t.pageY-i}},e._sortElements=function(t,e){var i=this.app.scene.layers.sortTransparentLayers(t.layers,e.layers);return 0!==i?i:t.screen&&!e.screen?-1:!t.screen&&e.screen?1:t.screen||e.screen?t.screen.screen.screenSpace&&!e.screen.screen.screenSpace?-1:e.screen.screen.screenSpace&&!t.screen.screen.screenSpace?1:e.drawOrder-t.drawOrder:0},e._getTargetElement=function(t,e,i){var n,s,a=null,r=1/0;this._elements.sort(this._sortHandler);for(var o=0,h=this._elements.length;o=0){a=l;break}}else{if(void 0===s&&(s=this._calculateRay3d(e,i,t,gy)?gy:null),!s)continue;var c=this._checkElement(s,l,!1);if(c>=0&&(c=0){i=a;break}}return i},e._buildHitCorners=function(t,e,i,n,s){var a=e;if(t.entity&&t.entity.button){var r=t.entity.button.hitPadding||Uy;Iy.copy(t.entity.up),Ly.copy(Iy).mulScalar(-1),ky.copy(t.entity.right),Dy.copy(ky).mulScalar(-1),Iy.mulScalar(r.w*n),Ly.mulScalar(r.y*n),ky.mulScalar(r.z*i),Dy.mulScalar(r.x*i),Oy.copy(a[0]).add(Ly).add(Dy),Fy.copy(a[1]).add(Ly).add(ky),By.copy(a[2]).add(Iy).add(ky),Ny.copy(a[3]).add(Iy).add(Dy),a=[Oy,Fy,By,Ny]}if(i<0){var o=a[2].x,h=a[0].x;a[0].x=o,a[1].x=h,a[2].x=h,a[3].x=o}if(n<0){var l=a[2].y,c=a[0].y;a[0].y=l,a[1].y=l,a[2].y=c,a[3].y=c}if(s<0){var u=a[2].x,d=a[2].y,f=a[2].z;a[2].x=a[0].x,a[2].y=a[0].y,a[2].z=a[0].z,a[0].x=u,a[0].y=d,a[0].z=f}return a},e._calculateScaleToScreen=function(t){var e=t.entity,i=t.screen.screen.scale;for(Ry.set(i,i,i);e&&!e.screen;)Ry.mul(e.getLocalScale()),e=e.parent;return Ry},e._calculateScaleToWorld=function(t){var e=t.entity;for(Ry.set(1,1,1);e;)Ry.mul(e.getLocalScale()),e=e.parent;return Ry},e._calculateRayScreen=function(t,e,i,n){var s=this.app.graphicsDevice.width,a=this.app.graphicsDevice.height,r=i.rect.z*s,o=i.rect.w*a,h=i.rect.x*s,l=h+r,c=(1-i.rect.y)*a,u=c-o,d=t*s/this._target.clientWidth,f=e*a/this._target.clientHeight;return d>=h&&d<=l&&f<=c&&f>=u&&(d=s*(d-h)/r,f=a-(f=a*(f-u)/o),n.origin.set(d,f,1),n.direction.set(0,0,-1),n.end.copy(n.direction).mulScalar(2).add(n.origin),!0)},e._calculateRay3d=function(t,e,i,n){var s=this._target.clientWidth,a=this._target.clientHeight,r=i.rect.z*s,o=i.rect.w*a,h=i.rect.x*s,l=h+r,c=(1-i.rect.y)*a,u=c-o,d=t,f=e;return t>=h&&t<=l&&e<=c&&f>=u&&(d=s*(d-h)/r,f=a*(f-u)/o,i.screenToWorld(d,f,i.nearClip,py),i.screenToWorld(d,f,i.farClip,my),n.origin.copy(py),n.direction.set(0,0,-1),n.end.copy(my),!0)},e._checkElement=function(t,e,i){if(e.maskedBy&&this._checkElement(t,e.maskedBy.element,i)<0)return-1;var n;n=i?this._calculateScaleToScreen(e):this._calculateScaleToWorld(e);var s=this._buildHitCorners(e,i?e.screenCorners:e.worldCorners,n.x,n.y,n.z);return function(t,e,i){yy.sub2(e,t),xy.sub2(i[0],t),by.sub2(i[1],t),Sy.sub2(i[2],t),Ty.cross(Sy,yy);var n,s,a=xy.dot(Ty);if(a>=0){if((n=-by.dot(Ty))<0)return-1;if((s=zy(yy,by,xy))<0)return-1;var r=1/(n+a+s);Ay.copy(i[0]).mulScalar(n*r),My.copy(i[1]).mulScalar(a*r),Cy.copy(i[2]).mulScalar(s*r),Ey.copy(Ay).add(My).add(Cy)}else{if(wy.sub2(i[3],t),(n=wy.dot(Ty))<0)return-1;if((s=zy(yy,xy,wy))<0)return-1;var o=1/(n+(a=-a)+s);Ay.copy(i[0]).mulScalar(n*o),My.copy(i[3]).mulScalar(a*o),Cy.copy(i[2]).mulScalar(s*o),Ey.copy(Ay).add(My).add(Cy)}return yy.sub2(i[0],i[2]).lengthSq()<1e-8||yy.sub2(i[1],i[3]).lengthSq()<1e-8?-1:Ey.sub(t).lengthSq()}(t.origin,t.end,s)},q(t,[{key:"enabled",get:function(){return this._enabled},set:function(t){this._enabled=t}},{key:"app",get:function(){return this._app||ia()},set:function(t){this._app=t}}]),t}(),qy={DEFAULT:{buttons:["PAD_FACE_1","PAD_FACE_2","PAD_FACE_3","PAD_FACE_4","PAD_L_SHOULDER_1","PAD_R_SHOULDER_1","PAD_L_SHOULDER_2","PAD_R_SHOULDER_2","PAD_SELECT","PAD_START","PAD_L_STICK_BUTTON","PAD_R_STICK_BUTTON","PAD_UP","PAD_DOWN","PAD_LEFT","PAD_RIGHT","PAD_VENDOR"],axes:["PAD_L_STICK_X","PAD_L_STICK_Y","PAD_R_STICK_X","PAD_R_STICK_Y"]},PS3:{buttons:["PAD_FACE_1","PAD_FACE_2","PAD_FACE_4","PAD_FACE_3","PAD_L_SHOULDER_1","PAD_R_SHOULDER_1","PAD_L_SHOULDER_2","PAD_R_SHOULDER_2","PAD_SELECT","PAD_START","PAD_L_STICK_BUTTON","PAD_R_STICK_BUTTON","PAD_UP","PAD_DOWN","PAD_LEFT","PAD_RIGHT","PAD_VENDOR"],axes:["PAD_L_STICK_X","PAD_L_STICK_Y","PAD_R_STICK_X","PAD_R_STICK_Y"]}},jy={"Product: 0268":"PS3"},Yy=function(){function t(){this.gamepadsSupported=!!navigator.getGamepads||!!navigator.webkitGetGamepads,this.current=[],this.previous=[],this.deadZone=.25}var e=t.prototype;return e.update=function(){for(var t=0,e=this.current.length;t0&&(t.length=0),this.gamepadsSupported)for(var e=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads(),i=0,n=e.length;i=0)return qy[jy[e]];return qy.DEFAULT},e.isPressed=function(t,e){if(!this.current[t])return!1;var i=this.current[t].map.buttons[e];return this.current[t].pad.buttons[pc[i]].pressed},e.wasPressed=function(t,e){if(!this.current[t])return!1;var i=this.current[t].map.buttons[e],n=pc[i];return this.current[t].pad.buttons[n].pressed&&!(this.previous[t]&&this.previous[t][n])},e.wasReleased=function(t,e){if(!this.current[t])return!1;var i=this.current[t].map.buttons[e],n=pc[i];return!this.current[t].pad.buttons[n].pressed&&this.previous[t]&&this.previous[t][n]},e.getAxis=function(t,e){if(!this.current[t])return 0;var i=this.current[t].map.axes[e],n=this.current[t].pad.axes[pc[i]];return Math.abs(n)=0&&(this._count++,this.fire("progress",t)),this._count===this._total&&setTimeout((function(){e._loadingComplete(e._failed)}),0)},i._onError=function(t,e){var i=this;this._assets.indexOf(e)>=0&&(this._count++,this._failed.push(e)),this._count===this._total&&setTimeout((function(){i._loadingComplete(i._failed)}),0)},i._onAddAsset=function(t){var e=this._waitingAssets.indexOf(t);e>=0&&this._waitingAssets.splice(e,1),this._assets.push(t);for(var i=0,n=this._assets.length;i