diff --git a/1390892.json b/1390892.json index b092df3..2888ea9 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":{"! 1":{"!":"Camera","#":"! %","$":"! 1","%":{"!2":{"!3":0,"!4":1000,"!5":true,")":[0,1,2,3,4],"!6":0,"!7":45,"!8":true,"!9":true,"!:":[0.118,0.118,0.118,1]," ":true,"!;":4,"!<":0.1,">":[0,0,1,1]},";":{" ":true,"<":["pickerRaycast","roomWidthSlider"],"=":{"!=":{"8":{}," ":true},"!>":{"8":{"!?":85572337,"!@":85572402}," ":false}}}},"&":[]," ":true,"'":["! #","! "],"___1":[105,108,0]},"! %":{"!":"Root","#":null,"$":"! %","%":{},"&":[]," ":true,"'":["! 1","! ,","! m","! -","! n","!!/"],"___2":0},"! o":{"!":"ImgPlane","&":[]," ":true,"$":"! o","#":"! ,","'":[],"%":{".":{"0":true,"1":true,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":true,"(":"plane","+":null,"/":[78072855],")":[0],"*":null,",":false,"-":false},";":{" ":true,"<":["switchingTextures"],"=":{"!A":{"8":{"!B":[78072763,78072763],"!C":"https://farsh-mobile.s3.me-south-1.amazonaws.com/cdn/loonie1.png","!D":null}," ":true}}}},"___1":[111,3,0]},"! m":{" ":true,"&":[],"'":["! )"],"$":"! m","!":"livingroom","%":{},"#":"! %","___1":[114,117,120]},"! )":{" ":true,"&":[],"'":["!!0","! p","! q","! 2"],"$":"! )","!":"Fbx_Root","%":{},"#":"! m","___1":[3,3,123]},"!!0":{" ":true,"&":[],"'":[],"$":"!!0","!":"Plane01","%":{".":{"0":true,"1":true,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":true,"(":"asset","+":78181884,"/":[78181754],")":[0],"*":null,",":true,"-":false}},"#":"! )","___1":[126,3,129]},"! 3":{"!":"C-Ext01","&":[]," ":true,"$":"! 3","#":"! 2","'":["!!1","!!2"],"%":{".":{"0":true,"1":true,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":true,"(":"asset","+":78181885,"/":[78181757],")":[0],"*":null,",":true,"-":false}},"___1":[132,3,135]},"! q":{"!":"Omni01","&":[]," ":true,"$":"! q","#":"! )","'":["!!3"],"%":{"g":{" ":true,"(":"point","h":false,"i":0,"j":1,"k":true,"l":true,"m":false,":":[1,1,1],"n":0.8,",":false,"o":2,"p":0,"q":1,"r":11,"s":0.01,"t":16,"u":1024,"v":1,"w":0.5,"x":0.2,"y":0.05,"z":8,"{":0,"|":40,"}":45,"~":0,"! ":null,"!!":1,"!#":true,"!$":"rgb","!%":0,"!&":[1,1],"!'":[0,0],"-":false,")":[0]}},"___1":[138,3,0]},"! -":{" ":true,"&":[],"'":["! *","! !"],"$":"! -","!":"doorman","%":{"b":{"9":2," ":true,"(":"box","c":[0.346,1.745,0.319],"d":0.5,"e":1,"+":null,"f":null},"!E":{" ":true,"(":"kinematic","!F":1,"!G":0,"!H":0,"!I":[1,1,1],"!J":[1,1,1],"!K":0.5,"!L":0.5},";":{" ":true,"<":["mouse","touch","sliderVisible"],"=":{"!-":{"8":{"a":0}," ":true},"!.":{"8":{"a":0}," ":true},"!M":{"8":{"!N":"! !","!O":5}," ":true}}}},"#":"! %","!/":{"! -":"2cfeea72-a4bb-4a0e-8dad-abd92cc83dad","!P":"9ccb87a7-6e1d-4ae0-9c96-b3b5d27c22f2","!Q":"a662f523-2a86-4f77-9951-1053085f7717","!R":"fbf7970b-0b02-48c8-9fbb-6fbb5d4f3485","!S":"cafbe398-372c-44b5-a905-6a9ca90c105c","!T":"6147aeb5-2849-4302-80b1-7120263a14de"},"!0":78401706,"___1":[141,3,144]},"! ,":{"!":"Plane","&":[]," ":true,"$":"! ,","#":"! %","'":["! 4","! 5","! o"],"%":{".":{"0":true,"1":true,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":false,"(":"plane","+":null,"/":[78072855],")":[0],"*":null,",":true,"-":false},";":{" ":true,"<":["mouse","touch","showHeightAndWidth"],"=":{"!-":{"8":{"a":0}," ":true},"!.":{"8":{"a":0}," ":true},"!U":{"8":{"9":"! 4","?":"! 5","!V":5,"!W":0,"!X":0,"!Y":"! o","!Z":45,"![":90}," ":true}}},"b":{"9":2," ":true,"(":"box","c":[0.664,0.1,0.767],"d":0.5,"e":1,"+":null,"f":null}},"___1":[147,18,0]},"! 5":{"!":"WidthPlane","&":[]," ":true,"$":"! 5","#":"! ,","'":["!!4"],"%":{".":{"0":false,"1":false,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":true,"(":"plane","+":null,"/":[79458597],")":[0],"*":null,",":false,"-":false},";":{" ":true,"<":[],"=":{}}},"___1":[150,3,153]},"! 4":{"!":"HeightPlane","&":[]," ":true,"$":"! 4","#":"! ,","'":["!!5"],"%":{".":{"0":false,"1":false,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":true,"(":"plane","+":null,"/":[79458597],")":[0],"*":null,",":false,"-":false},";":{" ":true,"<":[],"=":{}}},"___1":[156,159,162]},"!!5":{"!":"Text","&":[]," ":true,"$":"!!5","#":"! 4","'":[],"%":{"@":{"9":29.875," ":true,"(":"text","A":[0.5,0.5,0.5,0.5],"B":[0.5,0.5],"C":"90","D":null,"E":79465530,"F":32,"G":8,"H":32,"I":false,"J":false,"K":null,"L":32,"M":true,"N":1,":":[0,0,0],"O":1,"P":null,"Q":null,"R":0,"S":null,"?":38.234,"T":[-19.113,-14.938,-19.121,-14.937],"U":[0.5,0.5],"V":[1,1,1,1],"W":0.1,"X":[0,0,0,1],"Y":[0,0],">":[0,0,1,1],"Z":null,"[":true,"]":true,"^":false,"*":null,"_":false,")":[4],"`":false},";":{" ":true,"<":["getHeightFromUrlparams"],"=":{"!]":{"8":{}," ":true}}}},"___1":[165,168,171]},"!!4":{"!":"Text","&":[]," ":true,"$":"!!4","#":"! 5","'":[],"%":{"@":{"9":29.875," ":true,"(":"text","A":[0.5,0.5,0.5,0.5],"B":[0.5,0.5],"C":"45","D":null,"E":79465530,"F":32,"G":8,"H":32,"I":false,"J":false,"K":null,"L":32,"M":true,"N":1,":":[0,0,0],"O":1,"P":null,"Q":null,"R":0,"S":null,"?":33.813,"T":[-16.906,-14.938,-16.906,-14.937],"U":[0.5,0.5],"V":[1,1,1,1],"W":0.13,"X":[0,0,0,1],"Y":[0,0],">":[0,0,1,1],"Z":null,"[":true,"]":true,"^":false,"*":null,"_":false,")":[4],"`":false},";":{" ":true,"<":["getWidthFromUrlparams"],"=":{"!^":{"8":{}," ":true}}}},"___1":[174,6,177]},"! p":{"!":"Omni01","&":[]," ":true,"$":"! p","#":"! )","'":["!!6"],"%":{"g":{" ":true,"(":"point","h":false,"i":0,"j":1,"k":true,"l":true,"m":false,":":[1,1,1],"n":0.59,",":true,"o":2,"p":0,"q":1,"r":11,"s":0.01,"t":16,"u":1024,"v":1,"w":0.5,"x":0.2,"y":0.05,"z":39.47,"{":0,"|":40,"}":45,"~":0,"! ":null,"!!":1,"!#":true,"!$":"rgb","!%":0,"!&":[1,1],"!'":[0,0],"-":false,")":[0]}},"___1":[180,3,0]},"!!3":{"!":"Omni01","&":[]," ":true,"$":"!!3","#":"! q","'":[],"%":{"g":{" ":true,"(":"point","h":false,"i":0,"j":1,"k":true,"l":true,"m":false,":":[1,1,0.92157],"n":0.8,",":false,"o":2,"p":0,"q":1,"r":11,"s":0.01,"t":16,"u":1024,"v":1,"w":0.5,"x":0.2,"y":0.05,"z":8,"{":0,"|":40,"}":45,"~":0,"! ":null,"!!":1,"!#":true,"!$":"rgb","!%":0,"!&":[1,1],"!'":[0,0],"-":false,")":[0]}},"___1":[183,3,0]},"! n":{"!":"Box","&":[]," ":true,"$":"! n","#":"! %","'":[],"%":{".":{"0":true,"1":true,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":true,"(":"box","+":null,"/":[null],")":[0],"*":null,",":true,"-":false}},"___1":[186,3,189]},"! *":{" ":true,"&":[],"'":["! 6","! ."],"$":"! *","!":"BlueSuitFree01","%":{},"#":"! -","!/":{"! *":"349f823f-3e44-4162-9ed4-1ec84e75483e","! 6":"25304268-5782-46b4-8096-5a1f035ab0d0","! 7":"246d9b13-1098-45a7-8efc-e4049fd311a3","! 8":"bc364d92-e370-47d9-b20d-98c792aabe97","! $":"0eaf1817-47cf-4320-aec4-ec4b5d4890ac","! 9":"9d5cddc3-0168-44c2-8497-2f1d7c82fdaf","! :":"f0f0f0a5-b770-47ca-84c3-6171f02026c4","! ;":"66a06794-d1eb-420c-8966-d33c47f62243","! <":"4b69f146-6d36-445d-8cf1-b30df1714d26","! r":"185884e8-8d7f-4d73-ac4e-1e91a6ba694f","! =":"6779d20e-ffd2-477d-80b7-425c0475f1d5","! >":"69dafd9b-5183-4dec-97b8-f2290ad74a88","! ?":"5c4b614b-ca99-45d1-9ffd-01ba4dca482d","! +":"154ec305-b964-4a07-bcf7-75787b883c55","! @":"2a2b3e82-d0b1-429b-9ac0-a428b9b95d26","! A":"70dc6419-fd57-4484-82f9-a76a9febe516","! B":"930b8e63-6492-4681-8c80-c279a115c7ca","! &":"9d0c19ef-7c47-4889-b6c2-bf67f6676c43","! C":"1511ab22-1978-4397-8ce9-84d25d969039","! D":"a74c353f-c707-4245-a5e0-211c193e2f82","! E":"8d5f729b-c6b8-4496-ad31-162dbb88a4b0","! s":"5170b049-30a6-4290-8fc9-71f0369044fb","! F":"8dad2df0-2a5c-4d29-ac1d-0da768c0af1a","! G":"32454a3b-dc95-4603-8275-9bfa4d3656a5","! H":"d25c60b0-e9ec-4946-b309-52cb2d7bb6ce","! t":"66c5cf80-593e-43a7-9985-262e8c3943db","! I":"9bb4ad61-8b98-40b3-8f03-471e717aaa10","! J":"948f7e2a-f7ac-43db-9f13-c4a211931cb8","! K":"62dd3059-d198-4a25-a948-58aa9ad6de9a","! u":"663ef460-551d-4fdf-9f9f-6d80af049001","! /":"0ab2d415-16f1-433c-839c-f5dc8a12ece6","! L":"5b405fed-76b0-4a86-a7be-3631dfb22d64","! M":"8c45383b-77c5-4d41-9465-4aea58643c8b","! N":"acfbb9a3-a794-4d6d-ba44-423df348662b","! v":"78e35c79-f4b2-4b45-a8bb-ce6232b10926","! O":"44ba2028-08bb-471b-b01d-bfebdff376c2","! P":"75173193-4148-4d13-8f87-3ed747edba07","! Q":"0bb5ecac-fdd5-4206-9727-58742015c918","! w":"d1d22996-f6cf-46a7-a1da-e1f21e206e4f","! R":"a2cbe25c-d987-45d8-afb7-fa723c9e4f65","! '":"0ca9cdcf-2466-4c04-80a4-ccf74d859d95","! S":"fedb1ab2-2c0a-4158-aa3d-6aea2debcc56","! x":"4052b35f-20d3-4bf7-a7bb-d9afae946c44","! T":"133a3599-deb2-4f93-bb79-2fdaea1f53b5","! y":"0a828f87-deb9-497b-9af5-540b60eafff1","! z":"54de4e11-2768-477f-8a66-d26f13fd0fe6","! U":"4003c198-1874-42dc-83a4-56b8b704eff6","! {":"27584000-9400-4126-a17c-845a9f9f7605","! V":"2fdd9dbe-f57c-4b97-89d9-3c8e05200917","! W":"ef7ab9d6-07e7-4e0c-97ee-66b5e94f6b21","! X":"b05cb928-fd7e-48cd-9e18-afc07c46fba3","! (":"4e2fd5fc-6dbe-420a-ab31-fb287e31c726","! Y":"25ebeb00-d02d-4d7a-b09a-1c773f157f56","! Z":"1ddeca7a-7d8b-4993-a05c-5f47a62fb541","! [":"aba2941b-f3e0-4469-8126-2a5e9052a7d8","! |":"44e89eeb-26ac-4f17-96dc-eb7925aa0576","! ]":"25037cf1-bb2d-45f1-962a-0ccae3e7f47d","! ^":"86903bbc-4a42-44a5-a4fb-9f94ebc80ff5","! _":"4a0d4912-c2f7-4a8a-8d15-c21b278c6ba8","! }":"7cdc4abd-7de8-4aab-bbaf-5287b47baea9","! `":"6c23aa87-ff9a-45da-83c0-e56a98fe765d","! a":"18966956-e888-4707-872f-7bcad5dd4975","! b":"e155d26f-a44d-4065-b856-3c1f7655dd45","! ~":"19d67abf-6da7-4668-bb56-63e362a0abb8","! 0":"120cf609-3d9a-4068-9c11-d7b7feb1abdc","! c":"b161ff11-86c3-4e00-bb3c-bd09ea8a4bf8","! d":"578ebeda-4f81-42eb-8220-e276bf55e73b","! e":"84c775d9-46f4-480c-bfa8-ebac01660934","!! ":"fcda9764-a9e6-4790-b7c8-2275e8fdce3a","! f":"0cae0b66-218e-4636-95b8-cf3cc24c14c5","! g":"f1dd3f38-f2a7-4e2d-8437-5c8968e56595","! h":"648f62bc-f587-4a1a-944c-663cc286ba53","!!!":"5ac65a16-94b0-478a-b324-791b9c77ee5f","! i":"5ad7ed93-07f3-4e3d-8792-fe9e33ed134b","! j":"8c176529-ae92-4185-af03-cf980598f550","! k":"2d05dab9-2167-4ce6-85d3-0b2127ab677d","! l":"b6911b20-b769-488a-95f4-b6c960fb41f3","!!#":"36ce698b-7be6-4bec-9080-01be8e125d22","! .":"2cb48962-5b67-4b71-b0b2-afa8d9db58c1","!!$":"5b0ab82e-f081-47c5-98bc-75d547e77476","!!%":"ce472413-e97f-4cff-92be-695f07c7bedc"},"!0":80915306,"___1":[192,195,198]},"! 6":{" ":true,"&":[],"'":["! 7"],"$":"! 6","!":"Group","%":{},"#":"! *","___2":0},"! 7":{" ":true,"&":[],"'":["! 8"],"$":"! 7","!":"Main","%":{},"#":"! 6","___2":0},"! 8":{" ":true,"&":[],"'":["! $"],"$":"! 8","!":"DeformationSystem","%":{},"#":"! 7","___2":0},"! $":{" ":true,"&":[],"'":["! 9","! =","! i"],"$":"! $","!":"Root_M","%":{},"#":"! 8","___1":[201,204,0]},"! 9":{" ":true,"&":[],"'":["! :"],"$":"! 9","!":"Hip_R","%":{},"#":"! $","___1":[207,210,0]},"! :":{" ":true,"&":[],"'":["! ;"],"$":"! :","!":"Knee_R","%":{},"#":"! 9","___1":[213,21,0]},"! ;":{" ":true,"&":[],"'":["! <"],"$":"! ;","!":"Ankle_R","%":{},"#":"! :","___1":[216,24,0]},"! <":{" ":true,"&":[],"'":["! r"],"$":"! <","!":"Toes_R","%":{},"#":"! ;","___1":[219,27,0]},"! r":{" ":true,"&":[],"'":[],"$":"! r","!":"ToesEnd_R","%":{},"#":"! <","___1":[222,3,0]},"! =":{" ":true,"&":[],"'":["! >"],"$":"! =","!":"Spine1_M","%":{},"#":"! $","___1":[225,228,0]},"! >":{" ":true,"&":[],"'":["! ?"],"$":"! >","!":"Spine1Part1_M","%":{},"#":"! =","___1":[12,3,0]},"! ?":{" ":true,"&":[],"'":["! +"],"$":"! ?","!":"Spine1Part2_M","%":{},"#":"! >","___1":[12,3,0]},"! +":{" ":true,"&":[],"'":["! @","! R","! V"],"$":"! +","!":"Chest_M","%":{},"#":"! ?","___1":[12,231,0]},"! @":{" ":true,"&":[],"'":["! A"],"$":"! @","!":"Scapula_R","%":{},"#":"! +","___1":[234,237,0]},"! A":{" ":true,"&":[],"'":["! B"],"$":"! A","!":"Shoulder_R","%":{},"#":"! @","___1":[240,243,0]},"! B":{" ":true,"&":[],"'":["! &"],"$":"! B","!":"Elbow_R","%":{},"#":"! A","___1":[246,30,0]},"! &":{" ":true,"&":[],"'":["! C","! F","! I","! /"],"$":"! &","!":"Wrist_R","%":{},"#":"! B","___1":[249,252,0]},"! C":{" ":true,"&":[],"'":["! D"],"$":"! C","!":"MiddleFinger1_R","%":{},"#":"! &","___1":[255,33,0]},"! D":{" ":true,"&":[],"'":["! E"],"$":"! D","!":"MiddleFinger2_R","%":{},"#":"! C","___1":[258,36,0]},"! E":{" ":true,"&":[],"'":["! s"],"$":"! E","!":"MiddleFinger3_R","%":{},"#":"! D","___1":[261,39,0]},"! s":{" ":true,"&":[],"'":[],"$":"! s","!":"MiddleFinger4_R","%":{},"#":"! E","___1":[264,3,0]},"! F":{" ":true,"&":[],"'":["! G"],"$":"! F","!":"ThumbFinger1_R","%":{},"#":"! &","___1":[267,42,0]},"! G":{" ":true,"&":[],"'":["! H"],"$":"! G","!":"ThumbFinger2_R","%":{},"#":"! F","___1":[270,45,0]},"! H":{" ":true,"&":[],"'":["! t"],"$":"! H","!":"ThumbFinger3_R","%":{},"#":"! G","___1":[273,3,0]},"! t":{" ":true,"&":[],"'":[],"$":"! t","!":"ThumbFinger4_R","%":{},"#":"! H","___1":[276,3,0]},"! I":{" ":true,"&":[],"'":["! J"],"$":"! I","!":"IndexFinger1_R","%":{},"#":"! &","___1":[279,48,0]},"! J":{" ":true,"&":[],"'":["! K"],"$":"! J","!":"IndexFinger2_R","%":{},"#":"! I","___1":[282,51,0]},"! K":{" ":true,"&":[],"'":["! u"],"$":"! K","!":"IndexFinger3_R","%":{},"#":"! J","___1":[285,54,0]},"! u":{" ":true,"&":[],"'":[],"$":"! u","!":"IndexFinger4_R","%":{},"#":"! K","___1":[288,3,0]},"! /":{" ":true,"&":[],"'":["! L","! O"],"$":"! /","!":"Cup_R","%":{},"#":"! &","___1":[291,57,0]},"! L":{" ":true,"&":[],"'":["! M"],"$":"! L","!":"RingFinger1_R","%":{},"#":"! /","___1":[294,60,0]},"! M":{" ":true,"&":[],"'":["! N"],"$":"! M","!":"RingFinger2_R","%":{},"#":"! L","___1":[297,63,0]},"! N":{" ":true,"&":[],"'":["! v"],"$":"! N","!":"RingFinger3_R","%":{},"#":"! M","___1":[300,66,0]},"! v":{" ":true,"&":[],"'":[],"$":"! v","!":"RingFinger4_R","%":{},"#":"! N","___1":[303,3,0]},"! O":{" ":true,"&":[],"'":["! P"],"$":"! O","!":"PinkyFinger1_R","%":{},"#":"! /","___1":[306,69,0]},"! P":{" ":true,"&":[],"'":["! Q"],"$":"! P","!":"PinkyFinger2_R","%":{},"#":"! O","___1":[309,72,0]},"! Q":{" ":true,"&":[],"'":["! w"],"$":"! Q","!":"PinkyFinger3_R","%":{},"#":"! P","___1":[312,75,0]},"! w":{" ":true,"&":[],"'":[],"$":"! w","!":"PinkyFinger4_R","%":{},"#":"! Q","___1":[315,3,0]},"! R":{" ":true,"&":[],"'":["! '"],"$":"! R","!":"Neck_M","%":{},"#":"! +","___1":[318,321,0]},"! '":{" ":true,"&":[],"'":["! S","! T","! z","! U"],"$":"! '","!":"Head_M","%":{},"#":"! R","___1":[324,327,0]},"! S":{" ":true,"&":[],"'":["! x"],"$":"! S","!":"Eye_R","%":{},"#":"! '","___1":[330,78,0]},"! x":{" ":true,"&":[],"'":[],"$":"! x","!":"EyeEnd_R","%":{},"#":"! S","___1":[81,333,0]},"! T":{" ":true,"&":[],"'":["! y"],"$":"! T","!":"Jaw_M","%":{},"#":"! '","___1":[336,339,0]},"! y":{" ":true,"&":[],"'":[],"$":"! y","!":"JawEnd_M","%":{},"#":"! T","___1":[342,3,0]},"! z":{" ":true,"&":[],"'":[],"$":"! z","!":"HeadEnd_M","%":{},"#":"! '","___1":[345,3,0]},"! U":{" ":true,"&":[],"'":["! {"],"$":"! U","!":"Eye_L","%":{},"#":"! '","___1":[348,78,0]},"! {":{" ":true,"&":[],"'":[],"$":"! {","!":"EyeEnd_L","%":{},"#":"! U","___1":[81,351,0]},"! V":{" ":true,"&":[],"'":["! W"],"$":"! V","!":"Scapula_L","%":{},"#":"! +","___1":[354,357,0]},"! W":{" ":true,"&":[],"'":["! X"],"$":"! W","!":"Shoulder_L","%":{},"#":"! V","___1":[360,363,0]},"! X":{" ":true,"&":[],"'":["! ("],"$":"! X","!":"Elbow_L","%":{},"#":"! W","___1":[366,30,0]},"! (":{" ":true,"&":[],"'":["! Y","! ]","! `","! 0"],"$":"! (","!":"Wrist_L","%":{},"#":"! X","___1":[369,372,0]},"! Y":{" ":true,"&":[],"'":["! Z"],"$":"! Y","!":"MiddleFinger1_L","%":{},"#":"! (","___1":[375,33,0]},"! Z":{" ":true,"&":[],"'":["! ["],"$":"! Z","!":"MiddleFinger2_L","%":{},"#":"! Y","___1":[378,36,0]},"! [":{" ":true,"&":[],"'":["! |"],"$":"! [","!":"MiddleFinger3_L","%":{},"#":"! Z","___1":[381,39,0]},"! |":{" ":true,"&":[],"'":[],"$":"! |","!":"MiddleFinger4_L","%":{},"#":"! [","___1":[384,3,0]},"! ]":{" ":true,"&":[],"'":["! ^"],"$":"! ]","!":"ThumbFinger1_L","%":{},"#":"! (","___1":[387,42,0]},"! ^":{" ":true,"&":[],"'":["! _"],"$":"! ^","!":"ThumbFinger2_L","%":{},"#":"! ]","___1":[390,45,0]},"! _":{" ":true,"&":[],"'":["! }"],"$":"! _","!":"ThumbFinger3_L","%":{},"#":"! ^","___1":[393,3,0]},"! }":{" ":true,"&":[],"'":[],"$":"! }","!":"ThumbFinger4_L","%":{},"#":"! _","___1":[396,3,0]},"! `":{" ":true,"&":[],"'":["! a"],"$":"! `","!":"IndexFinger1_L","%":{},"#":"! (","___1":[399,48,0]},"! a":{" ":true,"&":[],"'":["! b"],"$":"! a","!":"IndexFinger2_L","%":{},"#":"! `","___1":[402,51,0]},"! b":{" ":true,"&":[],"'":["! ~"],"$":"! b","!":"IndexFinger3_L","%":{},"#":"! a","___1":[405,54,0]},"! ~":{" ":true,"&":[],"'":[],"$":"! ~","!":"IndexFinger4_L","%":{},"#":"! b","___1":[408,3,0]},"! 0":{" ":true,"&":[],"'":["! c","! f"],"$":"! 0","!":"Cup_L","%":{},"#":"! (","___1":[411,57,0]},"! c":{" ":true,"&":[],"'":["! d"],"$":"! c","!":"RingFinger1_L","%":{},"#":"! 0","___1":[414,60,0]},"! d":{" ":true,"&":[],"'":["! e"],"$":"! d","!":"RingFinger2_L","%":{},"#":"! c","___1":[417,63,0]},"! e":{" ":true,"&":[],"'":["!! "],"$":"! e","!":"RingFinger3_L","%":{},"#":"! d","___1":[420,66,0]},"!! ":{" ":true,"&":[],"'":[],"$":"!! ","!":"RingFinger4_L","%":{},"#":"! e","___1":[423,3,0]},"! f":{" ":true,"&":[],"'":["! g"],"$":"! f","!":"PinkyFinger1_L","%":{},"#":"! 0","___1":[426,69,0]},"! g":{" ":true,"&":[],"'":["! h"],"$":"! g","!":"PinkyFinger2_L","%":{},"#":"! f","___1":[429,72,0]},"! h":{" ":true,"&":[],"'":["!!!"],"$":"! h","!":"PinkyFinger3_L","%":{},"#":"! g","___1":[432,75,0]},"!!!":{" ":true,"&":[],"'":[],"$":"!!!","!":"PinkyFinger4_L","%":{},"#":"! h","___1":[435,3,0]},"! i":{" ":true,"&":[],"'":["! j"],"$":"! i","!":"Hip_L","%":{},"#":"! $","___1":[438,441,0]},"! j":{" ":true,"&":[],"'":["! k"],"$":"! j","!":"Knee_L","%":{},"#":"! i","___1":[444,21,0]},"! k":{" ":true,"&":[],"'":["! l"],"$":"! k","!":"Ankle_L","%":{},"#":"! j","___1":[447,24,0]},"! l":{" ":true,"&":[],"'":["!!#"],"$":"! l","!":"Toes_L","%":{},"#":"! k","___1":[450,27,0]},"!!#":{" ":true,"&":[],"'":[],"$":"!!#","!":"ToesEnd_L","%":{},"#":"! l","___1":[453,3,0]},"! .":{" ":true,"&":[],"'":["!!$","!!%"],"$":"! .","!":"Geo","%":{},"#":"! *","___2":0},"!!$":{" ":true,"&":[],"'":[],"$":"!!$","!":"SuitGEO01","%":{".":{"0":true,"1":true,"2":false,"3":1,"4":true,"5":false,"6":1,"7":"! $"," ":true,"(":"asset","+":80915304,"/":[80915301],")":[0],"*":null,",":false,"-":false}},"#":"! .","___2":0},"!!%":{" ":true,"&":[],"'":[],"$":"!!%","!":"HeadF","%":{".":{"0":true,"1":true,"2":false,"3":1,"4":true,"5":false,"6":1,"7":"! $"," ":true,"(":"asset","+":80915305,"/":[80915302],")":[0],"*":null,",":false,"-":false}},"#":"! .","___2":0},"!!&":{"!":"MinSliderEnd","&":[]," ":true,"$":"!!&","#":"! #","'":[],"%":{".":{"0":true,"1":true,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":false,"(":"plane","+":null,"/":[86059723],")":[0],"*":null,",":false,"-":false}},"___1":[456,84,87]},"!!'":{"!":"MaxSliderEnd","&":[]," ":true,"$":"!!'","#":"! #","'":[],"%":{".":{"0":true,"1":true,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":false,"(":"plane","+":null,"/":[86059723],")":[0],"*":null,",":false,"-":false}},"___1":[459,90,93]},"!!7":{"!":"SliderKnot","&":[]," ":true,"$":"!!7","#":"! #","'":[],"%":{".":{"0":true,"1":true,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":true,"(":"plane","+":null,"/":[86175481],")":[0],"*":null,",":false,"-":false},"b":{"9":2," ":true,"(":"box","c":[0.012,0.007,0.027],"d":0.5,"e":1,"+":null,"f":null},";":{" ":true,"<":["sliderHorizontal"],"=":{"!_":{"8":{"a":0,"!(":"!!&","!)":"!!'","!*":0.02,"!+":0.02,"!,":0,"!`":"! 2","!a":"!!("}," ":true}}}},"___1":[462,15,465]},"! 2":{"!":"Box","&":[]," ":true,"$":"! 2","#":"! )","'":["! 3"],"%":{".":{"0":true,"1":true,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":false,"(":"box","+":null,"/":[null],")":[0],"*":null,",":false,"-":false}},"___1":[468,3,471]},"!!/":{"!":"Box","&":[]," ":true,"$":"!!/","#":"! %","'":[],"%":{".":{"0":true,"1":true,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":true,"(":"box","+":null,"/":[78181757],")":[0],"*":null,",":true,"-":false}},"___1":[474,3,477]},"! #":{"!":"HorizontalSlider","&":[]," ":true,"$":"! #","#":"! 1","'":["!!&","!!'","!!7","!!8","!!(","!!9"],"%":{},"___2":0},"! ":{"!":"VerticalSlider","&":[]," ":true,"$":"! ","#":"! 1","'":["!!:","!!)","!!*","!!;","!!<","!!+","!!="],"%":{},"___1":[480,483,0]},"!!:":{"!":"Plane","&":[]," ":false,"$":"!!:","#":"! ","'":[],"%":{".":{"0":false,"1":false,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":true,"(":"plane","+":null,"/":[null],")":[0],"*":null,",":false,"-":false}},"___1":[486,489,492]},"!!)":{"!":"MinSliderEnd","&":[]," ":true,"$":"!!)","#":"! ","'":[],"%":{".":{"0":true,"1":true,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":false,"(":"plane","+":null,"/":[86059723],")":[0],"*":null,",":false,"-":false}},"___1":[495,84,87]},"!!*":{"!":"MaxSliderEnd","&":[]," ":true,"$":"!!*","#":"! ","'":[],"%":{".":{"0":true,"1":true,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":false,"(":"plane","+":null,"/":[86059723],")":[0],"*":null,",":false,"-":false}},"___1":[498,90,93]},"!!;":{"!":"Plane","&":[]," ":true,"$":"!!;","#":"! ","'":[],"%":{".":{"0":true,"1":true,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":true,"(":"plane","+":null,"/":[86175481],")":[0],"*":null,",":false,"-":false},"b":{"9":2," ":true,"(":"box","c":[0.012,0.007,0.027],"d":0.5,"e":1,"+":null,"f":null},";":{" ":true,"<":["sliderVertical"],"=":{"!b":{"8":{"a":0,"!,":0,"!(":"!!)","!)":"!!*","!*":0,"!+":0,"!c":"! n","!1":1,"!d":"!!+"}," ":true}}}},"___1":[501,15,504]},"!!,":{"!":"Minimum","&":[]," ":true,"$":"!!,","#":"! !","'":[],"%":{".":{"0":false,"1":false,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":false,"(":"plane","+":null,"/":[null],")":[0],"*":null,",":false,"-":false}},"___1":[507,6,96]},"!!-":{"!":"Maximum","&":[]," ":true,"$":"!!-","#":"! !","'":[],"%":{".":{"0":false,"1":false,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":false,"(":"plane","+":null,"/":[null],")":[0],"*":null,",":false,"-":false}},"___1":[510,6,96]},"!!>":{"!":"SliderKnot","&":[]," ":true,"$":"!!>","#":"! !","'":[],"%":{".":{"0":false,"1":false,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":true,"(":"plane","+":null,"/":[86175481],")":[0],"*":null,",":false,"-":false},";":{" ":true,"<":["scaleSlider"],"=":{"!e":{"8":{"a":0,"!,":0,"!(":"!!,","!)":"!!-","!*":0.38,"!+":0.26,"!1":1,"!f":"! *","!g":"!!."}," ":true}}},"b":{"9":2," ":true,"(":"box","c":[0.164,0.058,0.148],"d":0.5,"e":1,"+":null,"f":null}},"___1":[513,6,516]},"! !":{"!":"HeightSlider","&":[]," ":true,"$":"! !","#":"! -","'":["!!,","!!-","!!>","!!?","!!@","!!."],"%":{},"___2":0},"!!6":{"!":"Omni01","&":[]," ":true,"$":"!!6","#":"! p","'":[],"%":{"g":{" ":true,"(":"point","h":false,"i":0,"j":1,"k":true,"l":true,"m":false,":":[1,1,1],"n":0.59,",":true,"o":2,"p":0,"q":1,"r":11,"s":0.01,"t":16,"u":1024,"v":1,"w":0.5,"x":0.2,"y":0.05,"z":39.47,"{":0,"|":40,"}":45,"~":0,"! ":null,"!!":1,"!#":true,"!$":"rgb","!%":0,"!&":[1,1],"!'":[0,0],"-":false,")":[0]}},"___1":[519,3,0]},"!!8":{"!":"Plane","&":[]," ":true,"$":"!!8","#":"! #","'":[],"%":{".":{"0":false,"1":false,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":true,"(":"plane","+":null,"/":[86175118],")":[0],"*":null,",":false,"-":false}},"___1":[522,15,525]},"!!<":{"!":"Plane","&":[]," ":true,"$":"!!<","#":"! ","'":[],"%":{".":{"0":false,"1":false,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":true,"(":"plane","+":null,"/":[86175694],")":[0],"*":null,",":false,"-":false}},"___1":[528,531,534]},"!!?":{"!":"Plane","&":[]," ":true,"$":"!!?","#":"! !","'":[],"%":{".":{"0":false,"1":false,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":true,"(":"plane","+":null,"/":[86175694],")":[0],"*":null,",":false,"-":false}},"___1":[537,18,540]},"!!9":{"!":"RoomWidthTextLabel","&":[]," ":true,"$":"!!9","#":"! #","'":[],"%":{"@":{"9":32," ":true,"(":"text","A":[0.5,0.5,0.5,0.5],"B":[0.5,0.5],"C":"Room Width (m):","D":null,"E":79465530,"F":50,"G":8,"H":32,"I":false,"J":false,"K":null,"L":32,"M":true,"N":1,":":[0,0,0],"O":1,"P":null,"Q":null,"R":0,"S":null,"?":247.5,"T":[-193.386,-23.604,-193.332,-23.075],"U":[0.5,0.5],"V":[1,1,1,1],"W":0.22,"X":[0,0,0,1],"Y":[0,0],">":[0,0,1,1],"Z":null,"[":true,"]":true,"^":false,"*":null,"_":false,")":[4],"`":false}},"___1":[543,3,9]},"!!(":{"!":"RoomWidthNumber","&":[]," ":true,"$":"!!(","#":"! #","'":[],"%":{"@":{"9":29.875," ":true,"(":"text","A":[0.5,0.5,0.5,0.5],"B":[0.5,0.5],"C":"2.2","D":null,"E":79465530,"F":50,"G":8,"H":32,"I":false,"J":false,"K":null,"L":32,"M":true,"N":1,":":[0,0,0],"O":1,"P":null,"Q":null,"R":0,"S":null,"?":42.078,"T":[-32.755,-23.606,-32.992,-23.074],"U":[0.5,0.5],"V":[1,1,1,1],"W":0.22,"X":[0,0,0,1],"Y":[0,0],">":[0,0,1,1],"Z":null,"[":true,"]":true,"^":false,"*":null,"_":false,")":[4],"`":false}},"___1":[546,3,9]},"!!+":{"!":"RoomWidthNumber","&":[]," ":true,"$":"!!+","#":"! ","'":[],"%":{"@":{"9":29.875," ":true,"(":"text","A":[0.5,0.5,0.5,0.5],"B":[0.5,0.5],"C":"2.5","D":null,"E":79465530,"F":50,"G":8,"H":32,"I":false,"J":false,"K":null,"L":32,"M":true,"N":1,":":[0,0,0],"O":1,"P":null,"Q":null,"R":0,"S":null,"?":41.688,"T":[-32.792,-23.684,-32.345,-22.996],"U":[0.5,0.5],"V":[1,1,1,1],"W":0.22,"X":[0,0,0,1],"Y":[0,0],">":[0,0,1,1],"Z":null,"[":true,"]":true,"^":false,"*":null,"_":false,")":[4],"`":false}},"___1":[549,99,9]},"!!=":{"!":"RoomWidthTextLabel","&":[]," ":true,"$":"!!=","#":"! ","'":[],"%":{"@":{"9":46.68," ":true,"(":"text","A":[0.5,0.5,0.5,0.5],"B":[0.5,0.5],"C":"Ceiling(m):","D":null,"E":79465530,"F":50,"G":8,"H":32,"I":false,"J":false,"K":null,"L":32,"M":true,"N":1,":":[0,0,0],"O":1,"P":null,"Q":null,"R":0,"S":null,"?":249.829,"T":[-125.105,-23.684,-124.724,-22.996],"U":[0.5,0.5],"V":[1,1,1,1],"W":0.22,"X":[0,0,0,1],"Y":[0,0],">":[0,0,1,1],"Z":null,"[":true,"]":true,"^":false,"*":null,"_":false,")":[4],"`":false}},"___1":[552,99,9]},"!!@":{"!":"RoomWidthTextLabel","&":[]," ":true,"$":"!!@","#":"! !","'":[],"%":{"@":{"9":29.875," ":true,"(":"text","A":[0.5,0.5,0.5,0.5],"B":[0.5,0.5],"C":"CM","D":null,"E":79465530,"F":32,"G":8,"H":32,"I":false,"J":false,"K":null,"L":32,"M":true,"N":1,":":[0,0,0],"O":1,"P":null,"Q":null,"R":0,"S":null,"?":46.141,"T":[-28.89,-0.038,-17.25,-29.837],"U":[0.5,0.5],"V":[1,1,1,1],"W":0.22,"X":[0,0,0,1],"Y":[0,0],">":[0,0,1,1],"Z":null,"[":true,"]":true,"^":false,"*":null,"_":false,")":[4],"`":false}},"___1":[555,102,558]},"!!.":{"!":"ModelHeightNumber","&":[]," ":true,"$":"!!.","#":"! !","'":[],"%":{"@":{"9":29.875," ":true,"(":"text","A":[0.5,0.5,0.5,0.5],"B":[0.5,0.5],"C":"200","D":null,"E":79465530,"F":32,"G":8,"H":32,"I":false,"J":false,"K":null,"L":32,"M":true,"N":1,":":[0,0,0],"O":1,"P":null,"Q":null,"R":0,"S":null,"?":56.859,"T":[-31.976,-0.04,-24.883,-29.835],"U":[0.5,0.5],"V":[1,1,1,1],"W":0.22,"X":[0,0,0,1],"Y":[0,0],">":[0,0,1,1],"Z":null,"[":true,"]":true,"^":false,"*":null,"_":false,")":[4],"`":false}},"___1":[561,102,564]},"!!1":{"!":"C-Ext01","&":[]," ":true,"$":"!!1","#":"! 3","'":[],"%":{".":{"0":true,"1":true,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":true,"(":"asset","+":78181885,"/":[78181759],")":[0],"*":null,",":true,"-":false}},"___1":[567,3,570]},"!!2":{"!":"C-Ext01","&":[]," ":true,"$":"!!2","#":"! 3","'":[],"%":{".":{"0":true,"1":true,"2":false,"3":1,"4":true,"5":false,"6":1,"7":null," ":true,"(":"asset","+":78181885,"/":[78181759],")":[0],"*":null,",":true,"-":false}},"___1":[573,576,579]}},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":1390892,"compressedFormat":{"fieldFirstCode":32,"fieldCodeBase":95,"fieldArray":["enabled","name",1,"parent","resource_id","components","tags","children","type","layers","batchGroupId","asset","castShadows","isStatic","render","materialAssets","castShadowsLightmap","receiveShadows","lightmapped","lightmapSizeMultiplier","castShadowsLightMap","lightMapped","lightMapSizeMultiplier","rootBone","attributes","height","color","script","order","scripts","rect","width","element","anchor","pivot","text","key","fontAsset","fontSize","minFontSize","maxFontSize","autoFitWidth","autoFitHeight","maxLines","lineHeight","wrapLines","spacing","opacity","textureAsset","spriteAsset","spriteFrame","pixelsPerUnit","margin","alignment","outlineColor","outlineThickness","shadowColor","shadowOffset","materialAsset","autoWidth",1,"autoHeight","useInput","mask","enableMarkup","Selected","collision","halfExtents","radius","axis","renderAsset","light","bake","bakeArea","bakeNumSamples","bakeDir","affectDynamic","affectLightmapped","intensity","shadowUpdateMode","shadowType","vsmBlurMode","vsmBlurSize","vsmBias","shadowDistance","shadowResolution","numCascades","cascadeDistribution","shadowBias","normalOffsetBias","range","falloffMode","innerConeAngle","outerConeAngle","shape","cookieAsset","cookieIntensity",1,"cookieFalloff","cookieChannel","cookieAngle","cookieScale","cookieOffset","MinLimit","MaxLimit","MinLimitOffset","MaxLimitOffset","SliderValue","mouse","touch","template_ent_ids","template_id","RaiseFactor","camera","projection","farClip","clearColorBuffer","priority","fov","clearDepthBuffer","frustumCulling","clearColor","orthoHeight","nearClip","pickerRaycast","roomWidthSlider","html","css","switchingTextures","textures","url","WebTexture","rigidbody","mass","linearDamping","angularDamping","linearFactor","angularFactor","friction","restitution","sliderVisible","SliderEntity","Interval","155feed0-4828-4db3-bd69-ec82a43b842a","a7c74765-6d1f-4585-83fa-3d1678d4565c","c4e7019f-d3ef-48c6-8f74-3d5beb2f2d4e","c7f8fe2d-4cc6-4e6b-9050-ec7eb392e1ca","209d5672-6d22-4502-bbcd-704d9b2fad6b","showHeightAndWidth","hideInterval","physicalHeight","physicalWidth","ImageEntity","baseScaleWidth","baseScaleHeight",1,"getHeightFromUrlparams","getWidthFromUrlparams","sliderHorizontal","RoomWidth","RoomWidthText","sliderVertical","Ceiling","CeilingHeightText","scaleSlider","Model","ModelHeightText"],"singleVecs":[1,1,1,0,0,0,-90,0,0,0.00059,0.00059,0.00593,4.57661,0,0,90,0,0,90,180,0,0,0,-9.83765,1.70759,6.38072,10.1826,-4.68637,1.48242,86.1308,0,0,10.2376,16.6631,19.9882,4.62472,0.03899,21.5463,0.0132,0.05442,11.2242,0.01184,-50.0838,12.4673,45.8555,0,4.37155,0,12.8626,11.9827,15.7219,0.03037,19.975,-0.00271,-1.73917,20.228,-0.66787,0.03545,2.78555,0.72947,17.5479,25.7488,-3.43213,-0.29036,10.8685,-0.05631,0.58929,16.0378,0.17081,15.0094,29.8961,-14.1535,0.27993,3.28062,0.12607,2.18092,11.1041,0.39643,0,0,84.3542,1.65817,0,0,90,0,180,0.04131,0.04027,0.0417,90,0,-180,0.0392,0.04027,0.0417,2.18491,2.18491,2.18491,0,0,-90,180,0,-180,0.82906,1.11542,-5.99003,180,0,180,-0.03963,0,-0.29508,0,0,0.69745,360,90,0,0.00801,0.00309,0.00493,2.54,2.54,2.54,129.593,0,84.7355,10.05528,10.05528,10.05528,188.71229,-187.04491,-291.27156,1.809,1.916,0.84571,66.88726,129.36642,95.34216,1.72418,-0.05229,1.574,0.10537,0.10537,0.10537,0.29042,0.30065,1.58792,-0.01811,0.03637,-1.05991,1,1,0.17553,0.40313,0.07274,-0.34441,0,88.28624,0,1.5209,1,0.24756,0.00408,-0.001,0.73984,-90,-90,0,0.01633,0.00326,0.00471,0,-0.001,-0.827,0.00648,0.03073,0.00505,247.305,182.83083,56.25824,151.85122,-8.3473,-340.37986,0,2.3,-1.40541,97.12108,0.64764,1602.27268,0.41092,0.21622,-1.50434,-180,0.04179,-180,0.10168,0.10168,0.10168,0,95.3786,-1.71933,90,-2.06823,90,-2.04778,-0.44583,-9.98721,-178.09,6.36596,178.487,44.9641,0,0,39.9237,0,0,7.95222,15.2582,0,6.08362,0,0,17.1229,0,0,0,0,-8.40716,0,0,8.22027,15.5097,-1.70398,-8.47709,-40.4095,82.4185,-48.3494,12.1813,0,0,-8.04775,85.0757,-5.30434,27.3069,0,0,25.3891,0,0,-25.03787,-11.86115,11.42346,10.7004,0,0,4.89337,0,0,2.69621,0,0,2.71607,0,0,3.10674,2.31021,-0.48335,4.34949,0,0,3.1758,0,0,2.76567,0,0,10.4145,2.09944,0.18772,4.25091,0,0,2.52958,0,0,2.13039,0,0,1.94157,-1.04512,0.00629,8.45064,-0.93379,-0.41941,4.34265,0,0,2.67256,0,0,2.53469,0,0,7.91143,-2.6839,-1.31764,3.58146,0,0,1.91524,0,0,1.72662,0,0,23.2872,0,0,0,0,19.0927,9.92291,0,0,0,0,-15.3283,8.45394,6.53702,-3.17524,15.9437,-0.26039,-0.01814,0.7124,0.79216,0,0,0,114.083,11.1906,0,0,21.1224,0,0,8.45394,6.53702,3.17524,-15.9437,0.26039,-0.01814,15.5097,-1.70398,8.47709,-40.4095,82.4185,131.651,-12.1813,0,0,-9.62855,85.69364,-6.94368,-27.3069,0,0,-25.3891,0,0,-17.98275,2.76806,9.94243,-10.7004,0,0,-4.89337,0,0,-2.69621,0,0,-2.71607,0,0,-3.10674,-2.31021,0.48335,-4.34949,0,0,-3.1758,0,0,-2.76567,0,0,-10.4145,-2.09944,-0.18772,-4.25091,0,0,-2.52958,0,0,-2.13039,0,0,-1.94157,1.04512,-0.00629,-8.45064,0.93379,0.41941,-4.34265,0,0,-2.67256,0,0,-2.53469,0,0,-7.91143,2.6839,1.31764,-3.58146,0,0,-1.91524,0,0,-1.72662,0,0,-2.04778,-0.44583,9.98721,-178.09,6.36596,-1.51345,-44.9641,0,0,-39.9237,0,0,-7.95222,-15.2582,0,-6.08362,0,0,-0.14026,-0.241,-0.78977,0.1238,-0.24361,-0.79728,-0.1201,-0.25119,-0.811,0.02188,0.02908,0.02046,196.89171,187.04491,43.35508,1,1,0.5,2.98725,2.5505,4.48496,21.84536,6.36697,5.4856,-0.78534,0.00966,-0.00518,0,0,90,-0.03275,-0.25974,-0.84154,90,0,90,0.00479,0.04027,0.22664,-0.13344,-0.23969,-0.8106,0.08279,-0.24302,-0.80683,-0.13377,-0.28369,-0.80381,0.02291,0.02532,0.02494,-4.32415,2.69128,-0.00577,-4.32415,12.64214,-0.02576,-4.32415,12.10678,-0.00408,1.14645,1.14645,1.14645,247.30498,-14.20643,56.25825,-0.00939,-0.25437,-0.82418,0.33512,0.36051,0.08456,-0.02949,-0.283,-0.8082,90,0,-90,0.0862,0.05171,0.30854,-4.36523,7.68097,0.00758,3.20613,10.51753,13.83415,-0.02698,-0.26461,-0.70218,0.11865,-0.26566,-0.706,-0.22364,-0.344,-0.70483,-0.19006,-0.34407,-0.70218,-5.82006,14.8995,0.14434,0.03974,0.03531,0.06174,-3.54648,14.8975,0.14434,0.04033,0.03884,0.06174,0,-3.38298,3.9899,1.8,0.02168,0.988,-293.74893,-3.38298,-10.3123,180,90,-180,1.8,0.02168,0.073],"tripleVecs":[3,3,0]}} \ 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":{"! 1":{"#":"Camera","!":"! ","$":"! 1","%":{"!W":{"!X":0,"!Y":1000,"!Z":true,")":[0,1,2,3,4],"![":0,"!]":45,"!^":true,"!_":true,"!`":[0.118,0.118,0.118,1]," ":true,"!a":4,"!b":0.1,";":[0,0,1,1]},"^":{" ":true,"_":["fxaa","pickerRaycast"],"`":{"!c":{" ":true,"/":{}},"!d":{" ":true,"/":{}}}}},"&":[]," ":true,"'":["! $","! #"],"___1":[54,57,3]},"! ":{"#":"Root","!":null,"$":"! ","%":{},"&":[]," ":true,"'":["! K","! 1","! *","! L","! 9","! )","! 2","! M","! %"],"___2":0},"! &":{"#":"ImgPlane","&":[]," ":true,"$":"! &","!":"! *","'":[],"%":{"0":{"1":[78072855],"2":true,"3":true,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":true,"(":"plane","+":null,")":[0],"*":null,",":false,"-":false},"^":{" ":true,"_":["switchingTextures"],"`":{"!e":{" ":true,"/":{"!f":[78072763,78072763],"!g":"https://farsh-mobile.s3.me-south-1.amazonaws.com/cdn/loonie1.png","!h":null}}}}},"___1":[60,0,3]},"! 9":{" ":true,"&":[],"'":["! +"],"$":"! 9","#":"livingroom","%":{},"!":"! ","___1":[63,66,69]},"! +":{" ":true,"&":[],"'":["! :","! ;","! ,"],"$":"! +","#":"Fbx_Root","%":{},"!":"! 9","___1":[0,0,72]},"! L":{" ":true,"&":[],"'":[],"$":"! L","#":"Plane01","%":{"0":{"1":[78181754],"2":true,"3":true,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":true,"(":"asset","+":78181884,")":[0],"*":null,",":true,"-":false}},"!":"! ","___1":[75,15,78]},"! 3":{"#":"C-Ext01","&":[]," ":true,"$":"! 3","!":"! ,","'":["! N","! O"],"%":{"0":{"1":[78181757],"2":true,"3":true,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":true,"(":"asset","+":78181885,")":[0],"*":null,",":true,"-":false}},"___1":[81,0,84]},"! ;":{"#":"Omni01","&":[]," ":true,"$":"! ;","!":"! +","'":["! P"],"%":{"h":{" ":true,"(":"point","i":false,"j":0,"k":1,"l":true,"m":true,"n":false,":":[1,1,1],"o":0.8,",":false,"p":2,"q":0,"r":1,"s":11,"t":0.01,"u":16,"v":1024,"w":1,"x":0.5,"y":0.2,"z":0.05,"{":8,"|":0,"}":40,"~":45,"! ":0,"!!":null,"!#":1,"!$":true,"!%":"rgb","!&":0,"!'":[1,1],"!(":[0,0],"-":false,")":[0]}},"___1":[87,0,3]},"! )":{" ":true,"&":[],"'":["! !","! 4"],"$":"! )","#":"doorman","%":{"c":{" ":true,"(":"box","d":[0.346,1.745,0.319],"e":0.5,"a":1,".":2,"+":null,"f":null},"!i":{" ":true,"(":"kinematic","!j":1,"!k":0,"!l":0,"!m":[1,1,1],"!n":[1,1,1],"!o":0.5,"!p":0.5},"^":{" ":true,"_":["mouse","touch","sliderVisible"],"`":{"!A":{" ":true,"/":{"b":0}},"!B":{" ":true,"/":{"b":0}},"!q":{" ":false,"/":{"!r":"! !","!s":5}}}}},"!":"! ","!t":{"! )":"2cfeea72-a4bb-4a0e-8dad-abd92cc83dad","!u":"9ccb87a7-6e1d-4ae0-9c96-b3b5d27c22f2","!v":"a662f523-2a86-4f77-9951-1053085f7717","!w":"fbf7970b-0b02-48c8-9fbb-6fbb5d4f3485","!x":"cafbe398-372c-44b5-a905-6a9ca90c105c","!y":"6147aeb5-2849-4302-80b1-7120263a14de"},"!z":78401706,"___1":[90,0,93]},"! *":{"#":"Plane","&":[]," ":true,"$":"! *","!":"! ","'":["! 5","! -","! &"],"%":{"0":{"1":[78072855],"2":true,"3":true,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":false,"(":"plane","+":null,")":[0],"*":null,",":true,"-":false},"^":{" ":true,"_":["mouse","touch","showHeightAndWidth","moveUpwithScale"],"`":{"!A":{" ":true,"/":{"b":0}},"!B":{" ":true,"/":{"b":0}},"!{":{" ":true,"/":{"<":"! -",".":"! 6","!|":5,"!}":0,"!~":0,"# ":"! &","#!":45,"##":93}},"#$":{" ":true,"/":{"g":"! &"}}}},"c":{" ":true,"(":"box","d":[0.664,0.1,0.767],"e":0.5,"a":1,".":2,"+":null,"f":null}},"___1":[96,24,3]},"! -":{"#":"WidthPlane","&":[]," ":true,"$":"! -","!":"! *","'":["! Q"],"%":{"0":{"1":[79458597],"2":false,"3":false,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":true,"(":"plane","+":null,")":[0],"*":null,",":false,"-":false},"^":{" ":true,"_":["matchTargetScale","mantainDistanceWithTargetScale"],"`":{"!C":{" ":true,"/":{"g":"! &","!D":true,"!E":false,"!F":false}},"!G":{" ":true,"/":{"g":"! &","!H":-0.5,"!I":0,"!J":true,"!K":false}}}}},"___1":[99,0,102]},"! 6":{"#":"HeightPlane","&":[]," ":true,"$":"! 6","!":"! 5","'":["! R"],"%":{"0":{"1":[79458597],"2":false,"3":false,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":true,"(":"plane","+":null,")":[0],"*":null,",":false,"-":false},"^":{" ":false,"_":[],"`":{}}},"___1":[0,15,3]},"! R":{"#":"FurnitureHieghtText","&":[]," ":true,"$":"! R","!":"! 6","'":[],"%":{"=":{" ":true,"(":"text",">":[0.5,0.5,0.5,0.5],"?":[0.5,0.5],"@":"90","A":null,"B":91600010,"C":32,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[0,0,0],"L":1,"M":null,"N":null,"O":0,"P":null,"<":39.648,".":31.2,"Q":[-19.84,-15.601,-19.808,-15.599],"R":[0.5,0.5],"S":[1,1,1,1],"T":0.1,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":true,"Y":true,"Z":false,"*":null,"[":false,")":[4],"]":false},"^":{" ":true,"_":["getHeightFromUrlparams","unscaleFromParents"],"`":{"#%":{" ":true,"/":{}},"!L":{" ":true,"/":{"!":"! 5","!M":true,"!N":0.006,"!O":0.006,"!P":0.006}}}}},"___1":[105,108,111]},"! Q":{"#":"FurnitureWidthText","&":[]," ":true,"$":"! Q","!":"! -","'":[],"%":{"=":{" ":true,"(":"text",">":[0.5,0.5,0.5,0.5],"?":[0.5,0.5],"@":"45","A":null,"B":91600010,"C":32,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[0,0,0],"L":1,"M":null,"N":null,"O":0,"P":null,"<":38.176,".":31.2,"Q":[-19.066,-15.565,-19.11,-15.635],"R":[0.5,0.5],"S":[1,1,1,1],"T":0.13,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":true,"Y":true,"Z":false,"*":null,"[":false,")":[4],"]":false},"^":{" ":true,"_":["getWidthFromUrlparams","unscaleFromParents"],"`":{"#&":{" ":true,"/":{}},"!L":{" ":true,"/":{"!":"! -","!M":false,"!N":0.006,"!O":0.006,"!P":0.006}}}}},"___1":[114,9,117]},"! :":{"#":"Omni01","&":[]," ":true,"$":"! :","!":"! +","'":["! S"],"%":{"h":{" ":true,"(":"point","i":false,"j":0,"k":1,"l":true,"m":true,"n":false,":":[1,1,1],"o":0.59,",":true,"p":2,"q":0,"r":1,"s":11,"t":0.01,"u":16,"v":1024,"w":1,"x":0.5,"y":0.2,"z":0.05,"{":39.47,"|":0,"}":40,"~":45,"! ":0,"!!":null,"!#":1,"!$":true,"!%":"rgb","!&":0,"!'":[1,1],"!(":[0,0],"-":false,")":[0]}},"___1":[120,0,3]},"! P":{"#":"Omni01","&":[]," ":true,"$":"! P","!":"! ;","'":[],"%":{"h":{" ":true,"(":"point","i":false,"j":0,"k":1,"l":true,"m":true,"n":false,":":[1,1,0.92157],"o":0.8,",":false,"p":2,"q":0,"r":1,"s":11,"t":0.01,"u":16,"v":1024,"w":1,"x":0.5,"y":0.2,"z":0.05,"{":8,"|":0,"}":40,"~":45,"! ":0,"!!":null,"!#":1,"!$":true,"!%":"rgb","!&":0,"!'":[1,1],"!(":[0,0],"-":false,")":[0]}},"___1":[123,0,3]},"! 2":{"#":"Ceiling","&":[]," ":true,"$":"! 2","!":"! ","'":[],"%":{"0":{"1":[null],"2":true,"3":true,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":true,"(":"box","+":null,")":[0],"*":null,",":true,"-":false}},"___1":[126,0,129]},"! <":{"#":"MinSliderEnd","&":[]," ":true,"$":"! <","!":"! $","'":[],"%":{"0":{"1":[86059723],"2":true,"3":true,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":false,"(":"plane","+":null,")":[0],"*":null,",":false,"-":false}},"___1":[132,27,30]},"! =":{"#":"MaxSliderEnd","&":[]," ":true,"$":"! =","!":"! $","'":[],"%":{"0":{"1":[86059723],"2":true,"3":true,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":false,"(":"plane","+":null,")":[0],"*":null,",":false,"-":false}},"___1":[135,33,36]},"! T":{"#":"SliderKnot","&":[]," ":true,"$":"! T","!":"! $","'":[],"%":{"0":{"1":[86175481],"2":true,"3":true,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":true,"(":"plane","+":null,")":[0],"*":null,",":false,"-":false},"c":{" ":true,"(":"box","d":[0.012,0.007,0.027],"e":0.5,"a":1,".":2,"+":null,"f":null},"^":{" ":true,"_":["sliderHorizontal"],"`":{"#'":{" ":true,"/":{"b":0,"!)":"! <","!*":"! =","!+":0.02,"!,":0.02,"!-":0,"#(":"! ,","#)":"! >"}}}}},"___1":[138,18,141]},"! ,":{"#":"Box","&":[]," ":true,"$":"! ,","!":"! +","'":["! 3"],"%":{"0":{"1":[null],"2":true,"3":true,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":false,"(":"box","+":null,")":[0],"*":null,",":false,"-":false}},"___1":[144,0,147]},"! M":{"#":"Box","&":[]," ":true,"$":"! M","!":"! ","'":[],"%":{"0":{"1":[78181757],"2":true,"3":true,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":true,"(":"box","+":null,")":[0],"*":null,",":true,"-":false}},"___1":[150,0,153]},"! $":{"#":"HorizontalSlider","&":[]," ":false,"$":"! $","!":"! 1","'":["! <","! =","! T","! U","! >","! V"],"%":{},"___2":0},"! #":{"#":"VerticalSlider","&":[]," ":false,"$":"! #","!":"! 1","'":["! W","! ?","! @","! X","! Y","! A","! Z"],"%":{},"___1":[156,159,3]},"! W":{"#":"Plane","&":[]," ":false,"$":"! W","!":"! #","'":[],"%":{"0":{"1":[null],"2":false,"3":false,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":true,"(":"plane","+":null,")":[0],"*":null,",":false,"-":false}},"___1":[162,165,168]},"! ?":{"#":"MinSliderEnd","&":[]," ":true,"$":"! ?","!":"! #","'":[],"%":{"0":{"1":[86059723],"2":true,"3":true,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":false,"(":"plane","+":null,")":[0],"*":null,",":false,"-":false}},"___1":[171,27,30]},"! @":{"#":"MaxSliderEnd","&":[]," ":true,"$":"! @","!":"! #","'":[],"%":{"0":{"1":[86059723],"2":true,"3":true,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":false,"(":"plane","+":null,")":[0],"*":null,",":false,"-":false}},"___1":[174,33,36]},"! X":{"#":"Plane","&":[]," ":true,"$":"! X","!":"! #","'":[],"%":{"0":{"1":[86175481],"2":true,"3":true,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":true,"(":"plane","+":null,")":[0],"*":null,",":false,"-":false},"c":{" ":true,"(":"box","d":[0.012,0.007,0.027],"e":0.5,"a":1,".":2,"+":null,"f":null},"^":{" ":true,"_":["sliderVertical"],"`":{"#*":{" ":true,"/":{"b":0,"!-":0,"!)":"! ?","!*":"! @","!+":0,"!,":0,"#+":"! 2","!Q":1,"#,":"! A"}}}}},"___1":[177,18,180]},"! B":{"#":"Minimum","&":[]," ":true,"$":"! B","!":"! !","'":[],"%":{"0":{"1":[null],"2":false,"3":false,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":false,"(":"plane","+":null,")":[0],"*":null,",":false,"-":false}},"___1":[183,9,39]},"! C":{"#":"Maximum","&":[]," ":true,"$":"! C","!":"! !","'":[],"%":{"0":{"1":[null],"2":false,"3":false,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":false,"(":"plane","+":null,")":[0],"*":null,",":false,"-":false}},"___1":[186,9,39]},"! [":{"#":"SliderKnot","&":[]," ":true,"$":"! [","!":"! !","'":[],"%":{"0":{"1":[86175481],"2":false,"3":false,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":true,"(":"plane","+":null,")":[0],"*":null,",":false,"-":false},"^":{" ":true,"_":["scaleSlider"],"`":{"#-":{" ":true,"/":{"b":0,"!-":0,"!)":"! B","!*":"! C","!+":0.38,"!,":0.26,"!Q":1,"#.":"! 4","#/":"! D","#0":"! )"}}}},"c":{" ":true,"(":"box","d":[0.164,0.058,0.148],"e":0.5,"a":1,".":2,"+":null,"f":null}},"___1":[189,9,192]},"! !":{"#":"HeightSlider","&":[]," ":true,"$":"! !","!":"! )","'":["! B","! C","! [","! ]","! ^","! D"],"%":{},"___2":0},"! S":{"#":"Omni01","&":[]," ":true,"$":"! S","!":"! :","'":[],"%":{"h":{" ":true,"(":"point","i":false,"j":0,"k":1,"l":true,"m":true,"n":false,":":[1,1,1],"o":0.59,",":true,"p":2,"q":0,"r":1,"s":11,"t":0.01,"u":16,"v":1024,"w":1,"x":0.5,"y":0.2,"z":0.05,"{":39.47,"|":0,"}":40,"~":45,"! ":0,"!!":null,"!#":1,"!$":true,"!%":"rgb","!&":0,"!'":[1,1],"!(":[0,0],"-":false,")":[0]}},"___1":[195,0,3]},"! U":{"#":"Plane","&":[]," ":true,"$":"! U","!":"! $","'":[],"%":{"0":{"1":[86175118],"2":false,"3":false,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":true,"(":"plane","+":null,")":[0],"*":null,",":false,"-":false}},"___1":[198,18,201]},"! Y":{"#":"Plane","&":[]," ":true,"$":"! Y","!":"! #","'":[],"%":{"0":{"1":[86175694],"2":false,"3":false,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":true,"(":"plane","+":null,")":[0],"*":null,",":false,"-":false}},"___1":[204,207,210]},"! ]":{"#":"Plane","&":[]," ":true,"$":"! ]","!":"! !","'":[],"%":{"0":{"1":[86175694],"2":false,"3":false,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":true,"(":"plane","+":null,")":[0],"*":null,",":false,"-":false}},"___1":[213,24,216]},"! V":{"#":"RoomWidthTextLabel","&":[]," ":true,"$":"! V","!":"! $","'":[],"%":{"=":{" ":true,"(":"text",">":[0.5,0.5,0.5,0.5],"?":[0.5,0.5],"@":"Room Width (m):","A":null,"B":79465530,"C":50,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[0,0,0],"L":1,"M":null,"N":null,"O":0,"P":null,"<":247.5,".":32,"Q":[-193.386,-23.604,-193.332,-23.075],"R":[0.5,0.5],"S":[1,1,1,1],"T":0.22,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":true,"Y":true,"Z":false,"*":null,"[":false,")":[4],"]":false}},"___1":[219,0,12]},"! >":{"#":"RoomWidthNumber","&":[]," ":true,"$":"! >","!":"! $","'":[],"%":{"=":{" ":true,"(":"text",">":[0.5,0.5,0.5,0.5],"?":[0.5,0.5],"@":"2.2","A":null,"B":79465530,"C":50,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[0,0,0],"L":1,"M":null,"N":null,"O":0,"P":null,"<":42.078,".":29.875,"Q":[-32.755,-23.606,-32.992,-23.074],"R":[0.5,0.5],"S":[1,1,1,1],"T":0.22,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":true,"Y":true,"Z":false,"*":null,"[":false,")":[4],"]":false}},"___1":[222,0,12]},"! A":{"#":"RoomWidthNumber","&":[]," ":true,"$":"! A","!":"! #","'":[],"%":{"=":{" ":true,"(":"text",">":[0.5,0.5,0.5,0.5],"?":[0.5,0.5],"@":"2.5","A":null,"B":79465530,"C":50,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[0,0,0],"L":1,"M":null,"N":null,"O":0,"P":null,"<":41.688,".":29.875,"Q":[-32.792,-23.684,-32.345,-22.996],"R":[0.5,0.5],"S":[1,1,1,1],"T":0.22,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":true,"Y":true,"Z":false,"*":null,"[":false,")":[4],"]":false}},"___1":[225,42,12]},"! Z":{"#":"RoomWidthTextLabel","&":[]," ":true,"$":"! Z","!":"! #","'":[],"%":{"=":{" ":true,"(":"text",">":[0.5,0.5,0.5,0.5],"?":[0.5,0.5],"@":"Ceiling(m):","A":null,"B":79465530,"C":50,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[0,0,0],"L":1,"M":null,"N":null,"O":0,"P":null,"<":249.829,".":46.68,"Q":[-125.105,-23.684,-124.724,-22.996],"R":[0.5,0.5],"S":[1,1,1,1],"T":0.22,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":true,"Y":true,"Z":false,"*":null,"[":false,")":[4],"]":false}},"___1":[228,42,12]},"! ^":{"#":"RoomWidthTextLabel","&":[]," ":true,"$":"! ^","!":"! !","'":[],"%":{"=":{" ":true,"(":"text",">":[0.5,0.5,0.5,0.5],"?":[0.5,0.5],"@":"CM","A":null,"B":91600010,"C":32,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[0,0,0],"L":1,"M":null,"N":null,"O":0,"P":null,"<":49.28,".":31.2,"Q":[-30.46,-0.7,-18.82,-30.5],"R":[0.5,0.5],"S":[0,0,0,1],"T":0.05,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":true,"Y":true,"Z":false,"*":null,"[":false,")":[4],"]":false}},"___1":[231,45,234]},"! D":{"#":"ModelHeightNumber","&":[]," ":true,"$":"! D","!":"! !","'":[],"%":{"=":{" ":true,"(":"text",">":[0.5,0.5,0.5,0.5],"?":[0.5,0.5],"@":"200","A":null,"B":91600010,"C":32,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[0,0,0],"L":1,"M":null,"N":null,"O":0,"P":null,"<":58.464,".":31.2,"Q":[-32.778,-0.702,-25.686,-30.498],"R":[0.5,0.5],"S":[0,0,0,1],"T":0.01,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":true,"Y":true,"Z":false,"*":null,"[":false,")":[4],"]":false}},"___1":[237,45,240]},"! N":{"#":"C-Ext01","&":[]," ":true,"$":"! N","!":"! 3","'":[],"%":{"0":{"1":[78181759],"2":true,"3":true,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":true,"(":"asset","+":78181885,")":[0],"*":null,",":true,"-":false}},"___1":[243,0,246]},"! O":{"#":"C-Ext01","&":[]," ":true,"$":"! O","!":"! 3","'":[],"%":{"0":{"1":[78181759],"2":true,"3":true,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":true,"(":"asset","+":78181885,")":[0],"*":null,",":true,"-":false}},"___1":[249,252,255]},"! _":{"#":"Plane","&":[]," ":true,"$":"! _","!":"! 4","'":[],"%":{"0":{"1":[87532120],"2":false,"3":true,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":true,"(":"plane","+":null,")":[0],"*":null,",":false,"-":false}},"___1":[258,0,261]},"! %":{"#":"2D Screen","&":[]," ":true,"$":"! %","!":"! ","'":["! `","! '","! (","! 7","! .","! /"],"%":{"#1":{" ":true,"#2":true,"#3":"blend","#4":0.5,"#5":[1280,720],"#6":[1280,720]}},"___2":0},"! a":{"#":"Image","&":[]," ":true,"$":"! a","!":"! '","'":[],"%":{"=":{" ":true,"(":"image",">":[0,0.5,0,0.5],"?":[0.5,0.5],"@":"","A":null,"B":79465530,"C":32,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[1,1,1],"L":1,"M":89683130,"N":null,"O":0,"P":null,"<":200,".":800,"Q":[-1.238,-400,-198.762,-400],"R":[0.5,0.5],"S":[0,0,0,1],"T":0,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":false,"Y":false,"Z":false,"*":null,"[":false,")":[4],"]":false}},"___1":[264,0,48]},"! 8":{"#":"SliderKnot","&":[]," ":true,"$":"! 8","!":"! '","'":[],"%":{"=":{" ":true,"(":"image",">":[0,0.5,0,0.5],"?":[0.5,0.5],"@":"","A":null,"B":79465530,"C":32,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[1,1,1],"L":1,"M":86173568,"N":null,"O":0,"P":null,"<":200,".":200,"Q":[-0.547,-234.936,-199.453,34.936],"R":[0.5,0.5],"S":[0,0,0,1],"T":0,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":false,"Y":false,"Z":false,"*":null,"[":false,")":[4],"]":false},"^":{" ":true,"_":["uiSlider"],"`":{"!R":{" ":true,"/":{"!S":"! 8","a":"y","!T":"! E","!U":"! F","!V":0}}}}},"___1":[267,0,6]},"! E":{"#":"UpperLimit","&":[]," ":false,"$":"! E","!":"! '","'":[],"%":{"=":{" ":true,"(":"image",">":[0,0.5,0,0.5],"?":[0.5,0.5],"@":"","A":null,"B":79465530,"C":32,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[1,1,1],"L":1,"M":86173568,"N":null,"O":0,"P":null,"<":200,".":200,"Q":[-1.057,27.881,-198.943,-227.881],"R":[0.5,0.5],"S":[0,0,0,1],"T":0,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":false,"Y":false,"Z":false,"*":null,"[":false,")":[4],"]":false}},"___1":[270,0,6]},"! F":{"#":"LowerLimit","&":[]," ":false,"$":"! F","!":"! '","'":[],"%":{"=":{" ":true,"(":"image",">":[0,0.5,0,0.5],"?":[0.5,0.5],"@":"","A":null,"B":79465530,"C":32,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[1,1,1],"L":1,"M":86173568,"N":null,"O":0,"P":null,"<":200,".":200,"Q":[-0.696,-238.105,-199.304,38.105],"R":[0.5,0.5],"S":[0,0,0,1],"T":0,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":false,"Y":false,"Z":false,"*":null,"[":false,")":[4],"]":false}},"___1":[273,0,6]},"! '":{"#":"CeilingSlider","&":[]," ":false,"$":"! '","!":"! %","'":["! a","! 8","! E","! F","! b"],"%":{},"___2":0},"! (":{"#":"RoomWidthSlider","&":[]," ":false,"$":"! (","!":"! %","'":["! c","! 0","! G","! H","! d"],"%":{},"___2":0},"! 0":{"#":"SliderKnot","&":[]," ":true,"$":"! 0","!":"! (","'":[],"%":{"=":{" ":true,"(":"image",">":[0.5,0,0.5,0],"?":[0.5,0.5],"@":"","A":null,"B":79465530,"C":32,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[1,1,1],"L":1,"M":86173568,"N":null,"O":0,"P":null,"<":200,".":200,"Q":[-229.474,-47.738,29.474,-152.262],"R":[0.5,0.5],"S":[0,0,0,1],"T":0,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":false,"Y":false,"Z":false,"*":null,"[":false,")":[4],"]":false},"^":{" ":true,"_":["uiSlider"],"`":{"!R":{" ":true,"/":{"!S":"! 0","a":"x","!T":"! G","!U":"! H","!V":0}}}}},"___1":[276,0,6]},"! G":{"#":"UpperLimit","&":[]," ":false,"$":"! G","!":"! (","'":[],"%":{"=":{" ":true,"(":"image",">":[0.5,0,0.5,0],"?":[0.5,0.5],"@":"","A":null,"B":79465530,"C":32,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[1,1,1],"L":1,"M":86173568,"N":null,"O":0,"P":null,"<":200,".":200,"Q":[34.565,-47.98,-234.565,-152.02],"R":[0.5,0.5],"S":[0,0,0,1],"T":0,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":false,"Y":false,"Z":false,"*":null,"[":false,")":[4],"]":false}},"___1":[279,0,6]},"! H":{"#":"LowerLimit","&":[]," ":false,"$":"! H","!":"! (","'":[],"%":{"=":{" ":true,"(":"image",">":[0.5,0,0.5,0],"?":[0.5,0.5],"@":"","A":null,"B":79465530,"C":32,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[1,1,1],"L":1,"M":86173568,"N":null,"O":0,"P":null,"<":200,".":200,"Q":[-234.541,-47.814,34.541,-152.186],"R":[0.5,0.5],"S":[0,0,0,1],"T":0,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":false,"Y":false,"Z":false,"*":null,"[":false,")":[4],"]":false}},"___1":[282,0,6]},"! c":{"#":"Image","&":[]," ":true,"$":"! c","!":"! (","'":[],"%":{"=":{" ":true,"(":"image",">":[0.5,0,0.5,0],"?":[0.5,0.5],"@":"","A":null,"B":79465530,"C":32,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[1,1,1],"L":1,"M":86174925,"N":null,"O":0,"P":null,"<":800,".":200,"Q":[-400,-47.578,-400,-152.422],"R":[0.5,0.5],"S":[0,0,0,1],"T":0,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":false,"Y":false,"Z":false,"*":null,"[":false,")":[4],"]":false}},"___1":[285,0,48]},"! b":{"#":"BusinessLogic","&":[]," ":true,"$":"! b","!":"! '","'":[],"%":{"^":{" ":true,"_":["ceilingHeightController"],"`":{"#7":{" ":true,"/":{"#8":"! 2","!.":"! 8","#9":"! I"}}}}},"___1":[288,0,3]},"! `":{"#":"Debug","&":[]," ":false,"$":"! `","!":"! %","'":[],"%":{"=":{" ":true,"(":"text",">":[0.5,0.5,0.5,0.5],"?":[0.5,0.5],"@":"Text","A":null,"B":79465530,"C":32,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[0,0,0],"L":1,"M":null,"N":null,"O":0,"P":null,"<":32,".":32,"Q":[-30.328,28.303,-30.328,-58.178],"R":[0.5,0.5],"S":[0,0,0,1],"T":0,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":true,"Y":true,"Z":false,"*":null,"[":false,")":[4],"]":false},"^":{" ":true,"_":["debug"],"`":{"#:":{" ":true,"/":{"!.":"! 0"}}}}},"___1":[291,0,3]},"! d":{"#":"BusinessLogic","&":[]," ":true,"$":"! d","!":"! (","'":[],"%":{"^":{" ":true,"_":["roomWidthController"],"`":{"#;":{" ":true,"/":{"#<":"! ,","!.":"! 0","#=":0.5,"#>":3.6,"#?":6,"#@":"! J"}}}}},"___1":[294,0,3]},"! K":{"#":"Box","&":[]," ":true,"$":"! K","!":"! ","'":[],"%":{"0":{"1":[null],"2":true,"3":true,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":true,"(":"box","+":null,")":[0],"*":null,",":true,"-":false}},"___1":[297,15,300]},"! 4":{"#":"Plane","&":[]," ":true,"$":"! 4","!":"! )","'":["! _"],"%":{"0":{"1":[87532120],"2":true,"3":true,"4":false,"5":1,"6":true,"7":false,"8":1,"9":null," ":false,"(":"plane","+":null,")":[0],"*":null,",":true,"-":false}},"___1":[303,306,309]},"! 7":{"#":"Resize","&":[]," ":true,"$":"! 7","!":"! %","'":["! e"],"%":{"!/":{" ":true,"!0":true,"!1":"! 7","!2":[0,0,0,0],"!3":0,"!4":[0.89412,0.89412,0.89412,1],"!5":[0.75686,0.75686,0.75686,1],"!6":[1,1,1,1],"!7":0,"!8":null,"!9":0,"!:":null,"!;":0,"!<":null,"!=":0,"!>":null,"!?":null,"!@":null},"=":{" ":true,"(":"image",">":[0,0,0,0],"?":[0.5,0.5],"@":"","A":null,"B":79465530,"C":32,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[1,1,1],"L":1,"M":91591081,"N":null,"O":0,"P":null,"<":256,".":128,"Q":[-29.608,-0.384,-226.392,-127.616],"R":[0.5,0.5],"S":[0,0,0,1],"T":0,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":false,"Y":false,"Z":true,"*":null,"[":false,")":[4],"]":false},"^":{" ":true,"_":["showResizeOptions"],"`":{"#A":{" ":true,"/":{"#B":"! '","#C":"! (","#D":"! .","#E":"! /","#F":"! !","#G":0}}}}},"___1":[312,0,21]},"! e":{"#":"Text","&":[]," ":true,"$":"! e","!":"! 7","'":[],"%":{"=":{" ":true,"(":"text",">":[0.5,0.5,0.5,0.5],"?":[0.5,0.5],"@":"RESIZE","A":null,"B":91600010,"C":47.74,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[0,0,0],"L":1,"M":null,"N":null,"O":0,"P":null,"<":167.472,".":46.547,"Q":[-83.736,-29.245,-83.736,-17.302],"R":[0.5,0.5],"S":[0,0,0,1],"T":0,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":true,"Y":true,"Z":false,"*":null,"[":false,")":[4],"]":false}},"___1":[315,0,3]},"! .":{"#":"HeightText","&":[]," ":false,"$":"! .","!":"! %","'":["! I"],"%":{"!/":{" ":true,"!0":true,"!1":"! .","!2":[0,0,0,0],"!3":0,"!4":[1,1,1,1],"!5":[1,1,1,1],"!6":[1,1,1,1],"!7":0,"!8":null,"!9":0,"!:":null,"!;":0,"!<":null,"!=":0,"!>":null,"!?":null,"!@":null},"=":{" ":true,"(":"image",">":[0,0,0,0],"?":[0.5,0.5],"@":"","A":null,"B":79465530,"C":32,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[1,1,1],"L":1,"M":91591081,"N":null,"O":0,"P":null,"<":256,".":128,"Q":[-29.608,73.064,-226.392,-201.064],"R":[0.5,0.5],"S":[0,0,0,1],"T":0,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":false,"Y":false,"Z":true,"*":null,"[":false,")":[4],"]":false}},"___1":[318,0,21]},"! I":{"#":"Text","&":[]," ":true,"$":"! I","!":"! .","'":[],"%":{"=":{" ":true,"(":"text",">":[0.5,0.5,0.5,0.5],"?":[0.5,0.5],"@":"H: 2.3m","A":null,"B":91600010,"C":47.74,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[0,0,0],"L":1,"M":null,"N":null,"O":0,"P":null,"<":179.311,".":46.547,"Q":[-83.736,-29.24478,-83.73592,-17.30172],"R":[0.5,0.5],"S":[0,0,0,1],"T":0,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":true,"Y":true,"Z":false,"*":null,"[":false,")":[4],"]":false}},"___1":[51,0,3]},"! /":{"#":"Width Text","&":[]," ":false,"$":"! /","!":"! %","'":["! J"],"%":{"!/":{" ":true,"!0":true,"!1":"! /","!2":[0,0,0,0],"!3":0,"!4":[1,1,1,1],"!5":[1,1,1,1],"!6":[1,1,1,1],"!7":0,"!8":null,"!9":0,"!:":null,"!;":0,"!<":null,"!=":0,"!>":null,"!?":null,"!@":null},"=":{" ":true,"(":"image",">":[0,0,0,0],"?":[0.5,0.5],"@":"","A":null,"B":79465530,"C":32,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[1,1,1],"L":1,"M":91591081,"N":null,"O":0,"P":null,"<":256,".":128,"Q":[114.739,-0.449,-370.739,-127.551],"R":[0.5,0.5],"S":[0,0,0,1],"T":0,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":false,"Y":false,"Z":true,"*":null,"[":false,")":[4],"]":false}},"___1":[321,0,21]},"! J":{"#":"Text","&":[]," ":true,"$":"! J","!":"! /","'":[],"%":{"=":{" ":true,"(":"text",">":[0.5,0.5,0.5,0.5],"?":[0.5,0.5],"@":"W: 3.0m","A":null,"B":91600010,"C":47.74,"D":8,"E":32,"F":false,"G":false,"H":null,"I":32,"J":true,"K":1,":":[0,0,0],"L":1,"M":null,"N":null,"O":0,"P":null,"<":192.01,".":46.547,"Q":[-96.005,-29.245,-96.005,-17.302],"R":[0.5,0.5],"S":[0,0,0,1],"T":0,"U":[0,0,0,1],"V":[0,0],";":[0,0,1,1],"W":null,"X":true,"Y":true,"Z":false,"*":null,"[":false,")":[4],"]":false}},"___1":[51,0,3]},"! 5":{"#":"HeightPlane","&":[]," ":true,"$":"! 5","!":"! *","'":["! 6"],"%":{"^":{" ":true,"_":["matchTargetScale","mantainDistanceWithTargetScale"],"`":{"!C":{" ":true,"/":{"g":"! &","!D":false,"!E":false,"!F":true}},"!G":{" ":true,"/":{"g":"! &","!H":0,"!I":0.296,"!J":false,"!K":true}}}}},"___1":[324,0,3]}},"checkpoint_id":"9bcb7c16-e36a-4860-9e04-ecd9a42705fb","id":1390892,"compressedFormat":{"fieldFirstCode":32,"fieldCodeBase":95,"fieldArray":["enabled","parent",1,"name","resource_id","components","tags","children","type","layers","batchGroupId","asset","castShadows","isStatic","height","attributes","render","materialAssets","castShadowsLightmap","receiveShadows","lightmapped","lightmapSizeMultiplier","castShadowsLightMap","lightMapped","lightMapSizeMultiplier","rootBone","color","rect","width","element","anchor","pivot","text","key","fontAsset","fontSize","minFontSize","maxFontSize","autoFitWidth","autoFitHeight","maxLines","lineHeight","wrapLines","spacing","opacity","textureAsset","spriteAsset","spriteFrame","pixelsPerUnit","margin","alignment","outlineColor","outlineThickness","shadowColor","shadowOffset","materialAsset","autoWidth","autoHeight","useInput","mask",1,"enableMarkup","script","order","scripts","axis","Selected","collision","halfExtents","radius","renderAsset","target","light","bake","bakeArea","bakeNumSamples","bakeDir","affectDynamic","affectLightmapped","intensity","shadowUpdateMode","shadowType","vsmBlurMode","vsmBlurSize","vsmBias","shadowDistance","shadowResolution","numCascades","cascadeDistribution","shadowBias","normalOffsetBias","range","falloffMode","innerConeAngle","outerConeAngle","shape","cookieAsset",1,"cookieIntensity","cookieFalloff","cookieChannel","cookieAngle","cookieScale","cookieOffset","MinLimit","MaxLimit","MinLimitOffset","MaxLimitOffset","SliderValue","sliderKnot","button","active","imageEntity","hitPadding","transitionMode","hoverTint","pressedTint","inactiveTint","fadeDuration","hoverSpriteAsset","hoverSpriteFrame","pressedSpriteAsset","pressedSpriteFrame","inactiveSpriteAsset","inactiveSpriteFrame","hoverTextureAsset","pressedTextureAsset","inactiveTextureAsset","mouse","touch","matchTargetScale","matchX","matchY","matchZ","mantainDistanceWithTargetScale","defaultDistZ","defaultDistX","adjustZ","adjustX","unscaleFromParents","invertZandY","targetValueX","targetValueY","targetValueZ","RaiseFactor","uiSlider","handle","upperLimit","lowerLimit","val","camera","projection","farClip","clearColorBuffer","priority",1,"fov","clearDepthBuffer","frustumCulling","clearColor","orthoHeight","nearClip","pickerRaycast","fxaa","switchingTextures","textures","url","WebTexture","rigidbody","mass","linearDamping","angularDamping","linearFactor","angularFactor","friction","restitution","sliderVisible","SliderEntity","Interval","template_ent_ids","155feed0-4828-4db3-bd69-ec82a43b842a","a7c74765-6d1f-4585-83fa-3d1678d4565c","c4e7019f-d3ef-48c6-8f74-3d5beb2f2d4e","c7f8fe2d-4cc6-4e6b-9050-ec7eb392e1ca","209d5672-6d22-4502-bbcd-704d9b2fad6b","template_id","showHeightAndWidth","hideInterval","physicalHeight","physicalWidth",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"ImageEntity","baseScaleWidth",null,"baseScaleHeight","moveUpwithScale","getHeightFromUrlparams","getWidthFromUrlparams","sliderHorizontal","RoomWidth","RoomWidthText","sliderVertical","Ceiling","CeilingHeightText","scaleSlider","Model","ModelHeightText","ParentPlane","screen","screenSpace","scaleMode","scaleBlend","resolution","referenceResolution","ceilingHeightController","ceiling","ceilText","debug","roomWidthController","room","initialWidthScale","minWidth","maxWidth","UiWidthText","showResizeOptions","VertSlider","HorSlider","HeightShow","WidthShow","ModelScaleSlider","Toggle"],"singleVecs":[0,0,0,1,1,1,0.15,0.15,0.15,-90,0,0,0.00059,0.00059,0.00593,0,90,0,90,0,0,0.5,0.5,0.7,90,180,0,90,0,180,0.04131,0.04027,0.0417,90,0,-180,0.0392,0.04027,0.0417,2.18491,2.18491,2.18491,0,0,-90,180,0,-180,0.6,0.6,0.6,-0.00004,-5.97153,0,0.66789,1.11542,-6.01397,180,0,180,-0.00004,0,-0.43476,0,0,0.69745,360,90,0,0.00801,0.00309,0.00493,2.54,2.54,2.54,1.06092,0,-1.94033,0.10697,0.10697,0.10697,188.71229,-187.04491,-300.45148,1.809,1.916,0.81,8.48895,129.36641,30.88531,1.72418,-0.05229,1.574,0.10537,0.10537,0.10537,0.29042,0,1.58792,0,0,-0.93385,0.5,1,1,-0.016,-0.001,0.154,90,-88.28624,-180,0.005,0.005,0.00471,0.02816,-0.00137,-0.11997,0.01055,0.00531,0.005,247.305,182.83083,56.25824,151.85122,-8.3473,-340.37986,0,2.30012,-1.40541,97.12108,0.03207,1602.27268,-0.14026,-0.241,-0.78977,0.1238,-0.24361,-0.79728,-0.1201,-0.25119,-0.811,0.02188,0.02908,0.02046,196.89171,187.04491,43.35508,1,1,0.5,2.98725,1.59406,4.48496,21.84536,6.36697,5.4856,-0.78534,0.00966,-0.00518,0,0,90,-0.03275,-0.25974,-0.84154,90,0,90,0.00479,0.04027,0.22664,-0.13344,-0.23969,-0.8106,0.08279,-0.24302,-0.80683,-0.13377,-0.28369,-0.80381,0.02291,0.02532,0.02494,-4.32415,2.69128,-0.00577,-4.32415,12.06263,-0.02576,-4.32414,12.0375,-0.00407,1.14645,1.14645,1.14645,247.30498,-14.20643,56.25825,-0.00939,-0.25437,-0.82418,0.33512,0.36051,0.08456,-0.02949,-0.283,-0.8082,90,0,-90,0.0862,0.05171,0.30854,-4.36523,7.68097,0.00758,4.35694,14.29273,17.35826,-0.02698,-0.26461,-0.70218,0.11865,-0.26566,-0.706,-0.22364,-0.344,-0.70483,-0.19006,-0.34407,-0.70218,-5.82006,14.8995,0.14434,0.03974,0.03531,0.06174,-3.54648,14.8975,0.14434,0.04033,0.03884,0.06174,0,-3.38298,3.9899,1.8,0.02168,0.988,-293.74893,-3.38298,-10.3123,180,90,-180,1.8,0.02168,0.073,-0.00076,0,-0.4913,1,0.03,1,98.76194,0,4.763,99.45294,-134.93598,0,98.94331,127.88099,0,99.30396,-138.10482,0,-129.47405,52.26201,0,134.56494,52.01964,0,-134.541,52.18622,0,0,52.42199,0,28.76494,0,0,0,43.24094,0,0,7.79899,0,2.31907,0.34609,-7.15126,0.1,0.1,0.1,-0.35772,0.51834,-2.1172,-90,0,180,4.04452,1.29831,12.78358,98.39162,63.61553,0,0.00005,-5.97153,0,98.39205,137.06435,0,242.73902,63.55136,0,0.29575,0,-0.41811],"tripleVecs":[0,0,3]}} \ No newline at end of file diff --git a/__game-scripts.js b/__game-scripts.js index 52cfa08..307983a 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.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,o=(e-t.y)/e*16,s=this.entity.getPosition();this.app.root.findByName("Camera").camera.screenToWorld(t.x,t.y,o,this.pos),this.entity.setPosition(this.pos.x,s.y,this.pos.z),this.entity.getPosition().z>1.58&&this.entity.setPosition(this.pos.x,s.y,1.58)}},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),e=this.entity.camera.screenToWorld(t.x,t.y,this.entity.camera.farClip);this.app.systems.rigidbody.raycastFirst(i,e,(function(t){var i=t.entity;i.script.mouse&&(i.script.mouse.Selected=1),i.script.sliderHorizontal&&(i.script.sliderHorizontal.Selected=1),i.script.scaleSlider&&(i.script.scaleSlider.Selected=1),i.script.sliderVisible&&i.script.sliderVisible.showSlider(),i.script.sliderVertical&&(i.script.sliderVertical.Selected=1,console.log("Vert Slider Selected")),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),e=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: "+e),this.app.systems.rigidbody.raycastFirst(i,e,(function(t){var i=t.entity;i.script.touch&&(i.script.touch.Selected=1),i.script.sliderHorizontal&&(i.script.sliderHorizontal.Selected=1),i.script.scaleSlider&&(i.script.scaleSlider.Selected=1),i.script.sliderVisible&&i.script.sliderVisible.showSlider(),i.script.sliderVertical&&(i.script.sliderVertical.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};var ButtonLogic=pc.createScript("buttonLogic");ButtonLogic.attributes.add("textEntity",{type:"entity",description:"The entity that we want to update when the button is clicked"}),ButtonLogic.attributes.add("description",{type:"string"}),ButtonLogic.attributes.add("model",{type:"entity"}),ButtonLogic.prototype.initialize=function(){this.entity.button.on("click",(function(t){var e=this.textEntity.element.text,i=e.charAt(e.length-1),n=e[0],o=0,a=0;"6"==i?(o=0,i="0",a=parseInt(n),n=(++a).toString()):"0"==i&&(o=5,i="6",a=parseInt(n));var c=a.toString()+"."+o.toString(),r=parseFloat(c);this.model.setLocalScale(r/5.5*.105,r/5.5*.105,r/5.5*.105),this.textEntity.element.text=n+"'"+i}),this)};var ButtonLogic2=pc.createScript("buttonLogic2");ButtonLogic2.attributes.add("textEntity",{type:"entity",description:"The entity that we want to update when the button is clicked"}),ButtonLogic2.attributes.add("description",{type:"string"}),ButtonLogic2.attributes.add("model",{type:"entity"}),ButtonLogic2.prototype.initialize=function(){this.entity.button.on("click",(function(t){var e=this.textEntity.element.text,i=e.charAt(e.length-1),n=e[0],o=parseInt(i),a=parseInt(n);"6"==i?(o=0,i="0",a=parseInt(n)):"0"==i&&(o=5,i="6",a=parseInt(n),n=(--a).toString());var r=a.toString()+"."+o.toString(),c=parseFloat(r);this.model.setLocalScale(c/5.5*.105,c/5.5*.105,c/5.5*.105),this.textEntity.element.text=n+"'"+i}),this)};var RoomWidthSlider=pc.createScript("roomWidthSlider");RoomWidthSlider.attributes.add("html",{type:"asset",assetType:"html",title:"HTML Asset"}),RoomWidthSlider.attributes.add("css",{type:"asset",assetType:"css",title:"CSS Asset"}),RoomWidthSlider.prototype.initialize=function(){this.addUi(),this.addUi()},RoomWidthSlider.prototype.update=function(t){},RoomWidthSlider.prototype.addUi=function(){var t=this,e=document.createElement("style");document.head.appendChild(e),e.innerHTML=this.css.resource||"",this.div=document.createElement("div"),this.div.classList.add("container"),this.div.innerHTML=this.html.resource||"",document.body.appendChild(this.div),this.resumeFlythroughButton=this.div.querySelector(".button"),this.pathSlider=this.div.querySelector(".slider"),this.resumeFlythroughButton.addEventListener("click",(function(){t.flyingThrough=!0})),this.pathSlider.addEventListener("input",(function(){t.flyingThrough=!1,t.time=t.pathSlider.value/t.pathSlider.max*t.duration}))};var SliderHorizontal=pc.createScript("sliderHorizontal");SliderHorizontal.attributes.add("Selected",{type:"number",default:0}),SliderHorizontal.attributes.add("SliderValue",{type:"number",default:0}),SliderHorizontal.attributes.add("MinLimit",{type:"entity"}),SliderHorizontal.attributes.add("MaxLimit",{type:"entity"}),SliderHorizontal.attributes.add("RoomWidth",{type:"entity"}),SliderHorizontal.attributes.add("RoomWidthText",{type:"entity"}),SliderHorizontal.attributes.add("MinLimitOffset",{type:"number",default:0}),SliderHorizontal.attributes.add("MaxLimitOffset",{type:"number",default:0}),SliderHorizontal.prototype.initialize=function(){this.pos=new pc.Vec3,this.roomWidthInitialScale=this.RoomWidth.getLocalScale().z,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);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)},SliderHorizontal.prototype.update=function(t){},SliderHorizontal.prototype.onMouseDown=function(t){},SliderHorizontal.prototype.onMouseMove=function(t){if(1==this.Selected){this.app.graphicsDevice.canvas.clientWidth,this.app.graphicsDevice.canvas.clientHeight;var i=this.entity.getPosition();this.app.root.findByName("Camera").camera.screenToWorld(t.x,t.y,.808,this.pos),this.entity.setPosition(this.pos.x,i.y,-5.18),console.log("This.x: "+this.entity.getPosition().x+"Max Limit: "+this.entity.getPosition().x),this.entity.getPosition().xthis.MinLimit.getPosition().x-this.MinLimitOffset&&this.entity.setPosition(this.MinLimit.getPosition().x-this.MinLimitOffset,this.entity.getPosition().y,this.entity.getPosition().z);var e=this.MinLimit.getPosition().distance(this.MaxLimit.getPosition()),o=this.MinLimit.getPosition().distance(this.entity.getPosition());this.SliderValue=o/e,this.RoomWidth.setLocalScale(this.RoomWidth.getLocalScale().x,this.RoomWidth.getLocalScale().y,this.roomWidthInitialScale*(1+this.SliderValue));var s=2*(1+this.SliderValue);this.RoomWidthText.element.text=s.toFixed(1).toString(),console.log(this.RoomWidth.getLocalScale()),console.log(this.SliderValue)}},SliderHorizontal.prototype.onMouseUp=function(t){t.button===pc.MOUSEBUTTON_LEFT&&(this.Selected=0)},SliderHorizontal.prototype.updateFromScreen=function(t){if(1==this.Selected){this.app.graphicsDevice.canvas.clientWidth,this.app.graphicsDevice.canvas.clientHeight;var i=this.entity.getPosition();this.app.root.findByName("Camera").camera.screenToWorld(t.x,t.y,.808,this.pos),this.entity.setPosition(this.pos.x,i.y,-5.18),console.log("This.x: "+this.entity.getPosition().x+"Max Limit: "+this.entity.getPosition().x),this.entity.getPosition().xthis.MinLimit.getPosition().x-this.MinLimitOffset&&this.entity.setPosition(this.MinLimit.getPosition().x-this.MinLimitOffset,this.entity.getPosition().y,this.entity.getPosition().z);var e=this.MinLimit.getPosition().distance(this.MaxLimit.getPosition()),o=this.MinLimit.getPosition().distance(this.entity.getPosition());this.SliderValue=o/e,this.RoomWidth.setLocalScale(this.RoomWidth.getLocalScale().x,this.RoomWidth.getLocalScale().y,this.roomWidthInitialScale*(1+this.SliderValue));var s=2*(1+this.SliderValue);this.RoomWidthText.element.text=s.toFixed(1).toString(),console.log(this.RoomWidth.getLocalScale()),console.log(this.SliderValue)}},SliderHorizontal.prototype.onTouchStart=function(t){1===t.touches.length&&this.updateFromScreen(t.touches[0]),t.event.preventDefault()},SliderHorizontal.prototype.onTouchMove=function(t){this.updateFromScreen(t.touches[0]),t.event.preventDefault()},SliderHorizontal.prototype.onTouchEnd=function(t){this.Selected=0,t.event.preventDefault()},SliderHorizontal.prototype.onTouchCancel=function(t){this.Selected=0,t.event.preventDefault()};var SliderVertical=pc.createScript("sliderVertical");SliderVertical.attributes.add("Selected",{type:"number",default:0}),SliderVertical.attributes.add("SliderValue",{type:"number",default:0}),SliderVertical.attributes.add("MinLimit",{type:"entity"}),SliderVertical.attributes.add("MaxLimit",{type:"entity"}),SliderVertical.attributes.add("Ceiling",{type:"entity"}),SliderVertical.attributes.add("CeilingHeightText",{type:"entity"}),SliderVertical.attributes.add("MinLimitOffset",{type:"number",default:0}),SliderVertical.attributes.add("MaxLimitOffset",{type:"number",default:0}),SliderVertical.attributes.add("RaiseFactor",{type:"number",default:1}),SliderVertical.prototype.initialize=function(){this.pos=new pc.Vec3,this.initialCielingHeight=this.Ceiling.getPosition().y,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);var i=this.MinLimit.getPosition().distance(this.MaxLimit.getPosition()),t=this.MinLimit.getPosition().distance(this.entity.getPosition());this.SliderValue=t/i,this.Ceiling.setLocalPosition(this.Ceiling.getPosition().x,this.initialCielingHeight+this.SliderValue*this.RaiseFactor,this.Ceiling.getPosition().z),this.CeilingHeightText.element.text=(this.initialCielingHeight+this.SliderValue*this.RaiseFactor).toFixed(1).toString();var e=this.app.touch;e&&(e.on(pc.EVENT_TOUCHSTART,this.onTouchStart,this),e.on(pc.EVENT_TOUCHMOVE,this.onTouchMove,this),e.on(pc.EVENT_TOUCHEND,this.onTouchEnd,this),e.on(pc.EVENT_TOUCHCANCEL,this.onTouchCancel,this)),this.on("destroy",(function(){e.off(pc.EVENT_TOUCHSTART,this.onTouchStart,this),e.off(pc.EVENT_TOUCHMOVE,this.onTouchMove,this),e.off(pc.EVENT_TOUCHEND,this.onTouchEnd,this),e.off(pc.EVENT_TOUCHCANCEL,this.onTouchCancel,this)}),this)},SliderVertical.prototype.update=function(i){},SliderVertical.prototype.onMouseDown=function(i){},SliderVertical.prototype.onMouseMove=function(i){if(1==this.Selected){this.app.graphicsDevice.canvas.clientWidth,this.app.graphicsDevice.canvas.clientHeight;var t=this.entity.getPosition();this.app.root.findByName("Camera").camera.screenToWorld(i.x,i.y,.808,this.pos),this.entity.setPosition(t.x,this.pos.y,-5.18),this.entity.getPosition().y>this.MaxLimit.getPosition().y-this.MaxLimitOffset&&this.entity.setPosition(this.entity.getPosition().x,this.MaxLimit.getPosition().y-this.MaxLimitOffset,this.entity.getPosition().z),this.entity.getPosition().ythis.MaxLimit.getPosition().y-this.MaxLimitOffset&&this.entity.setPosition(this.entity.getPosition().x,this.MaxLimit.getPosition().y-this.MaxLimitOffset,this.entity.getPosition().z),this.entity.getPosition().ythis.MaxLimit.getPosition().y&&this.entity.setPosition(this.entity.getPosition().x,this.MaxLimit.getPosition().y,this.entity.getPosition().z),this.entity.getPosition().ythis.MaxLimit.getPosition().y&&this.entity.setPosition(this.entity.getPosition().x,this.MaxLimit.getPosition().y,this.entity.getPosition().z),this.entity.getPosition().ythis.Interval&&(this.timer=0,this.SliderEntity.enabled=!1)},SliderVisible.prototype.showSlider=function(){this.timer=0,this.SliderEntity.enabled=!0}; \ No newline at end of file +var Mouse=pc.createScript("mouse");Mouse.attributes.add("Selected",{type:"number",default:0}),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){var e=this.app.graphicsDevice.canvas.clientWidth,o=this.app.graphicsDevice.canvas.clientHeight,i=(o-t.y)/o*16,s=this.entity.getPosition(),n=this.app.root.findByName("Camera");n.camera.screenToWorld(t.x,t.y,i,this.pos),this.entity.translate(t.dx/e*-15*(this.entity.getPosition().distance(n.getPosition())/12),0,t.dy/e*-15),this.entity.getPosition().z>1.58&&this.entity.setPosition(this.pos.x,s.y,1.58)}},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),e=this.entity.camera.screenToWorld(t.x,t.y,this.entity.camera.farClip);this.app.systems.rigidbody.raycastFirst(i,e,(function(t){var i=t.entity;i.script.mouse&&(i.script.mouse.Selected=1),i.script.sliderHorizontal&&(i.script.sliderHorizontal.Selected=1),i.script.scaleSlider&&(i.script.scaleSlider.Selected=1),i.script.sliderVisible&&i.script.sliderVisible.showSlider(),i.script.sliderVertical&&(i.script.sliderVertical.Selected=1,console.log("Vert Slider Selected")),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),e=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: "+e),this.app.systems.rigidbody.raycastFirst(i,e,(function(t){var i=t.entity;i.script.touch&&(i.script.touch.Selected=1),i.script.sliderHorizontal&&(i.script.sliderHorizontal.Selected=1),i.script.scaleSlider&&(i.script.scaleSlider.Selected=1),i.script.sliderVisible&&i.script.sliderVisible.showSlider(),i.script.sliderVertical&&(i.script.sliderVertical.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.MinLimit.getPosition().x-this.MinLimitOffset&&this.entity.setPosition(this.MinLimit.getPosition().x-this.MinLimitOffset,this.entity.getPosition().y,this.entity.getPosition().z);var e=this.MinLimit.getPosition().distance(this.MaxLimit.getPosition()),o=this.MinLimit.getPosition().distance(this.entity.getPosition());this.SliderValue=o/e,this.RoomWidth.setLocalScale(this.RoomWidth.getLocalScale().x,this.RoomWidth.getLocalScale().y,this.roomWidthInitialScale*(1+this.SliderValue));var s=2*(1+this.SliderValue);this.RoomWidthText.element.text=s.toFixed(1).toString()}},SliderHorizontal.prototype.onMouseUp=function(t){t.button===pc.MOUSEBUTTON_LEFT&&(this.Selected=0)},SliderHorizontal.prototype.updateFromScreen=function(t){if(1==this.Selected){this.app.graphicsDevice.canvas.clientWidth,this.app.graphicsDevice.canvas.clientHeight;var i=this.entity.getPosition();this.app.root.findByName("Camera").camera.screenToWorld(t.x,t.y,.808,this.pos),this.entity.setPosition(this.pos.x,i.y,-5.18),console.log("This.x: "+this.entity.getPosition().x+"Max Limit: "+this.entity.getPosition().x),this.entity.getPosition().xthis.MinLimit.getPosition().x-this.MinLimitOffset&&this.entity.setPosition(this.MinLimit.getPosition().x-this.MinLimitOffset,this.entity.getPosition().y,this.entity.getPosition().z);var e=this.MinLimit.getPosition().distance(this.MaxLimit.getPosition()),o=this.MinLimit.getPosition().distance(this.entity.getPosition());this.SliderValue=o/e,this.RoomWidth.setLocalScale(this.RoomWidth.getLocalScale().x,this.RoomWidth.getLocalScale().y,this.roomWidthInitialScale*(1+this.SliderValue));var s=2*(1+this.SliderValue);this.RoomWidthText.element.text=s.toFixed(1).toString(),console.log(this.RoomWidth.getLocalScale()),console.log(this.SliderValue)}},SliderHorizontal.prototype.onTouchStart=function(t){1===t.touches.length&&this.updateFromScreen(t.touches[0]),t.event.preventDefault()},SliderHorizontal.prototype.onTouchMove=function(t){this.updateFromScreen(t.touches[0]),t.event.preventDefault()},SliderHorizontal.prototype.onTouchEnd=function(t){this.Selected=0,t.event.preventDefault()},SliderHorizontal.prototype.onTouchCancel=function(t){this.Selected=0,t.event.preventDefault()};var SliderVertical=pc.createScript("sliderVertical");SliderVertical.attributes.add("Selected",{type:"number",default:0}),SliderVertical.attributes.add("SliderValue",{type:"number",default:0}),SliderVertical.attributes.add("MinLimit",{type:"entity"}),SliderVertical.attributes.add("MaxLimit",{type:"entity"}),SliderVertical.attributes.add("Ceiling",{type:"entity"}),SliderVertical.attributes.add("CeilingHeightText",{type:"entity"}),SliderVertical.attributes.add("MinLimitOffset",{type:"number",default:0}),SliderVertical.attributes.add("MaxLimitOffset",{type:"number",default:0}),SliderVertical.attributes.add("RaiseFactor",{type:"number",default:1}),SliderVertical.prototype.initialize=function(){this.pos=new pc.Vec3,this.initialCielingHeight=this.Ceiling.getPosition().y,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);var i=this.MinLimit.getPosition().distance(this.MaxLimit.getPosition()),t=this.MinLimit.getPosition().distance(this.entity.getPosition());this.SliderValue=t/i,this.Ceiling.setLocalPosition(this.Ceiling.getPosition().x,this.initialCielingHeight+this.SliderValue*this.RaiseFactor,this.Ceiling.getPosition().z),this.CeilingHeightText.element.text=(this.initialCielingHeight+this.SliderValue*this.RaiseFactor).toFixed(1).toString();var e=this.app.touch;e&&(e.on(pc.EVENT_TOUCHSTART,this.onTouchStart,this),e.on(pc.EVENT_TOUCHMOVE,this.onTouchMove,this),e.on(pc.EVENT_TOUCHEND,this.onTouchEnd,this),e.on(pc.EVENT_TOUCHCANCEL,this.onTouchCancel,this)),this.on("destroy",(function(){e.off(pc.EVENT_TOUCHSTART,this.onTouchStart,this),e.off(pc.EVENT_TOUCHMOVE,this.onTouchMove,this),e.off(pc.EVENT_TOUCHEND,this.onTouchEnd,this),e.off(pc.EVENT_TOUCHCANCEL,this.onTouchCancel,this)}),this)},SliderVertical.prototype.update=function(i){},SliderVertical.prototype.onMouseDown=function(i){},SliderVertical.prototype.onMouseMove=function(i){if(1==this.Selected){this.app.graphicsDevice.canvas.clientWidth,this.app.graphicsDevice.canvas.clientHeight;var t=this.entity.getPosition();this.app.root.findByName("Camera").camera.screenToWorld(i.x,i.y,.808,this.pos),this.entity.setPosition(t.x,this.pos.y,-5.18),this.entity.getPosition().y>this.MaxLimit.getPosition().y-this.MaxLimitOffset&&this.entity.setPosition(this.entity.getPosition().x,this.MaxLimit.getPosition().y-this.MaxLimitOffset,this.entity.getPosition().z),this.entity.getPosition().ythis.MaxLimit.getPosition().y-this.MaxLimitOffset&&this.entity.setPosition(this.entity.getPosition().x,this.MaxLimit.getPosition().y-this.MaxLimitOffset,this.entity.getPosition().z),this.entity.getPosition().ythis.MaxLimit.getPosition().y&&this.entity.setPosition(this.entity.getPosition().x,this.MaxLimit.getPosition().y,this.entity.getPosition().z),this.entity.getPosition().ythis.MaxLimit.getPosition().y&&this.entity.setPosition(this.entity.getPosition().x,this.MaxLimit.getPosition().y,this.entity.getPosition().z),this.entity.getPosition().ythis.Interval&&(this.timer=0,this.SliderEntity.enabled=!1)},SliderVisible.prototype.showSlider=function(){this.timer=0,this.SliderEntity.enabled=!0};pc.script.createLoadingScreen((function(e){var t,a;t=["body {"," background-color: #283538;","}","","#application-splash-wrapper {"," position: absolute;"," top: 0;"," left: 0;"," height: 100%;"," width: 100%;"," background-color: #ffffff;","}","","#application-splash {"," position: absolute;"," top: calc(50% - 28px);"," width: 264px;"," left: calc(50% - 132px);","}","","#application-splash img {"," width: 100%;","}","","#progress-bar-container {"," margin: 20px auto 0 auto;"," height: 2px;"," width: 100%;"," background-color: #1d292c;","}","","#progress-bar {"," width: 0%;"," height: 100%;"," background-color: #eeeeee;","}","","@media (max-width: 480px) {"," #application-splash {"," width: 170px;"," left: calc(50% - 85px);"," }","}"].join("\n"),(a=document.createElement("style")).type="text/css",a.styleSheet?a.styleSheet.cssText=t:a.appendChild(document.createTextNode(t)),document.head.appendChild(a),function(){var e=document.createElement("div");e.id="application-splash-wrapper",document.body.appendChild(e);var t=document.createElement("div");t.id="application-splash",e.appendChild(t),t.style.display="none";var a=document.createElement("img");a.src="https://farsh-mobile.s3.me-south-1.amazonaws.com/farsh_logo_high_res_1.png",t.appendChild(a),a.onload=function(){t.style.display="block"};var o=document.createElement("div");o.id="progress-bar-container",t.appendChild(o);var n=document.createElement("div");n.id="progress-bar",o.appendChild(n)}(),e.on("preload:end",(function(){e.off("preload:progress")})),e.on("preload:progress",(function(e){var t=document.getElementById("progress-bar");t&&(e=Math.min(1,Math.max(0,e)),t.style.width=100*e+"%")})),e.on("start",(function(){var e=document.getElementById("application-splash-wrapper");e.parentElement.removeChild(e)}))}));var UISlider=pc.createScript("uiSlider");UISlider.attributes.add("handle",{type:"entity",default:null,title:"Handle"}),UISlider.attributes.add("axis",{type:"string",default:"y",title:"Axis",description:"lock drag to axis: x, y or xy"}),UISlider.attributes.add("upperLimit",{type:"entity",default:null,title:"upperLimit"}),UISlider.attributes.add("lowerLimit",{type:"entity",default:null,title:"lowerLimit"}),UISlider.attributes.add("val",{type:"number",default:0}),UISlider.prototype.postInitialize=function(){if(this.handle||(this.handle=this.entity.parent.findByName("UISliderHandle")),!this.handle)throw new Error("UISlider has no handle");this.addHandleListeners(),this.isDragging=!1,this.touchId=-1,this.mousePos=new pc.Vec3,this.anchorPos=this.handle.getLocalPosition().clone(),this.screen=this.getUIScreenComponent()},UISlider.prototype.getUIScreenComponent=function(){return this.handle.element.screen.screen},UISlider.prototype.addHandleListeners=function(){this.handle.element.useInput=!0,this.handle.element.on(pc.EVENT_MOUSEDOWN,this.onPressDown,this),this.app.mouse.on(pc.EVENT_MOUSEUP,this.onPressUp,this),this.app.mouse.on(pc.EVENT_MOUSEMOVE,this.onPressMove,this),this.app.touch&&(console.log("initing touches"),this.handle.element.on(pc.EVENT_TOUCHSTART,this.onTouchStart,this),this.app.touch.on(pc.EVENT_TOUCHEND,this.onTouchEnd,this),this.app.touch.on(pc.EVENT_TOUCHCANCEL,this.onTouchEnd,this),this.app.touch.on(pc.EVENT_TOUCHMOVE,this.onTouchMove,this)),this.on("destroy",(function(){this.handle.element.off(pc.EVENT_MOUSEDOWN,this.onPressDown,this),this.app.mouse.off(pc.EVENT_MOUSEUP,this.onPressUp,this),this.app.mouse.off(pc.EVENT_MOUSEMOVE,this.onPressMove,this),this.app.touch&&(this.handle.element.off(pc.EVENT_TOUCHSTART,this.onTouchStart,this),this.app.touch.off(pc.EVENT_TOUCHEND,this.onTouchEnd,this),this.app.touch.off(pc.EVENT_TOUCHCANCEL,this.onTouchEnd,this),this.app.touch.off(pc.EVENT_TOUCHMOVE,this.onTouchMove,this))}))},UISlider.prototype.onTouchStart=function(t){var i=t.changedTouches[0];this.touchId=i.identifier,this.startDrag(t.x,t.y),t.event.stopPropagation()},UISlider.prototype.onTouchMove=function(t){for(var i=0;ithis.upperLimit.getLocalPosition().y&&this.handle.setLocalPosition(this.handle.getLocalPosition().x,this.upperLimit.getLocalPosition().y,0),this.handle.getLocalPosition().ythis.upperLimit.getLocalPosition().x&&this.handle.setLocalPosition(this.upperLimit.getLocalPosition().x,this.handle.getLocalPosition().y,0),this.handle.getLocalPosition().x lumaMax ) )"," {"," gl_FragColor = vec4( rgbA, opacity );"," }"," else"," {"," gl_FragColor = vec4( rgbB, opacity );"," }","}"].join("\n");this.fxaaShader=new pc.Shader(e,{attributes:o,vshader:t,fshader:a}),this.resolution=new Float32Array(2)}FxaaEffect.prototype=Object.create(pc.PostEffect.prototype),FxaaEffect.prototype.constructor=FxaaEffect,Object.assign(FxaaEffect.prototype,{render:function(e,o,t){var a=this.device,r=a.scope;this.resolution[0]=1/e.width,this.resolution[1]=1/e.height,r.resolve("uResolution").setValue(this.resolution),r.resolve("uColorBuffer").setValue(e.colorBuffer),pc.drawFullscreenQuad(a,o,this.vertexBuffer,this.fxaaShader,t)}});var Fxaa=pc.createScript("fxaa");Fxaa.prototype.initialize=function(){this.effect=new FxaaEffect(this.app.graphicsDevice);var e=this.entity.camera.postEffects;e.addEffect(this.effect),this.on("state",(function(o){o?e.addEffect(this.effect):e.removeEffect(this.effect)})),this.on("destroy",(function(){e.removeEffect(this.effect)}))};var CeilingHeightController=pc.createScript("ceilingHeightController");CeilingHeightController.attributes.add("ceiling",{type:"entity",default:null,title:"ceiling"}),CeilingHeightController.attributes.add("sliderKnot",{type:"entity",default:null,title:"sliderKnot"}),CeilingHeightController.attributes.add("ceilText",{type:"entity",default:null,title:"ceilText"}),CeilingHeightController.prototype.initialize=function(){this.initialHeight=this.ceiling.getLocalPosition().y},CeilingHeightController.prototype.update=function(i){this.ceiling.setLocalPosition(this.ceiling.getLocalPosition().x,this.initialHeight+this.sliderKnot.script.uiSlider.val,this.ceiling.getLocalPosition().z),this.ceilText.element.text="H: "+this.ceiling.getLocalPosition().y.toFixed(1).toString()+"m"};var Debug=pc.createScript("debug");Debug.attributes.add("DebugElement",{type:"entity",default:null,title:"sliderKnot"}),Debug.attributes.add("sliderKnot",{type:"entity",default:null,title:"sliderKnot"}),Debug.prototype.initialize=function(){},Debug.prototype.update=function(t){this.entity.element.text=this.sliderKnot.script.uiSlider.val.toString()};var RoomWidthController=pc.createScript("roomWidthController");RoomWidthController.attributes.add("room",{type:"entity",default:null,title:"room"}),RoomWidthController.attributes.add("sliderKnot",{type:"entity",default:null,title:"sliderKnot"}),RoomWidthController.attributes.add("initialWidthScale",{type:"number",default:.5}),RoomWidthController.attributes.add("minWidth",{type:"number",default:3.6}),RoomWidthController.attributes.add("maxWidth",{type:"number",default:6}),RoomWidthController.attributes.add("UiWidthText",{type:"entity",default:null,title:"UiWidthText"}),RoomWidthController.prototype.initialize=function(){},RoomWidthController.prototype.update=function(t){var i=this.sliderKnot.script.uiSlider.val,o=this.maxWidth-this.minWidth;this.room.setLocalScale(this.room.getLocalScale().x,this.room.getLocalScale().y,(this.minWidth+o*i)/(this.minWidth/this.initialWidthScale)),this.UiWidthText.element.text="W: "+(this.minWidth+o*i).toFixed(1).toString()+"m"};var FollowWorldTarget=pc.createScript("followWorldTarget");FollowWorldTarget.attributes.add("target",{type:"entity"}),FollowWorldTarget.attributes.add("camera",{type:"entity"}),FollowWorldTarget.prototype.initialize=function(){},FollowWorldTarget.prototype.postUpdate=function(t){var e=this.target.getPosition(),i=new pc.Vec3;if(this.camera.camera.worldToScreen(e,i),i.z>0){this.entity.element.enabled=!0;var a=this.app.graphicsDevice.maxPixelRatio;i.x*=a,i.y*=a;var o=this.app.graphicsDevice;this.entity.setPosition(i.x/o.width*2-1,2*(1-i.y/o.height)-1,0)}else this.entity.element.enabled=!1};var ShowResizeOptions=pc.createScript("showResizeOptions");ShowResizeOptions.attributes.add("VertSlider",{type:"entity",description:"The entity that we want to update when the button is clicked"}),ShowResizeOptions.attributes.add("HorSlider",{type:"entity",description:"The entity that we want to update when the button is clicked"}),ShowResizeOptions.attributes.add("HeightShow",{type:"entity",description:"The entity that we want to update when the button is clicked"}),ShowResizeOptions.attributes.add("WidthShow",{type:"entity",description:"The entity that we want to update when the button is clicked"}),ShowResizeOptions.attributes.add("ModelScaleSlider",{type:"entity",description:"The entity that we want to update when the button is clicked"}),ShowResizeOptions.attributes.add("Toggle",{type:"number",description:"The entity that we want to update when the button is clicked"}),ShowResizeOptions.prototype.initialize=function(){this.entity.button.on("click",(function(t){0==this.Toggle?(this.Toggle=1,this.VertSlider.enabled=!0,this.HorSlider.enabled=!0,this.HeightShow.enabled=!0,this.WidthShow.enabled=!0,this.ModelScaleSlider.enabled=!0):(this.Toggle=0,this.VertSlider.enabled=!1,this.HorSlider.enabled=!1,this.HeightShow.enabled=!1,this.WidthShow.enabled=!1,this.ModelScaleSlider.enabled=!1),console.log("CHAL GYA")}),this)},ShowResizeOptions.prototype.update=function(t){};var UnscaleFromParents=pc.createScript("unscaleFromParents");UnscaleFromParents.attributes.add("parent",{type:"entity",default:null,title:"parent"}),UnscaleFromParents.attributes.add("invertZandY",{type:"boolean"}),UnscaleFromParents.attributes.add("targetValueX",{type:"number"}),UnscaleFromParents.attributes.add("targetValueY",{type:"number"}),UnscaleFromParents.attributes.add("targetValueZ",{type:"number"}),UnscaleFromParents.prototype.initialize=function(){},UnscaleFromParents.prototype.update=function(t){1==this.invertZandY?this.entity.setLocalScale(this.targetValueX*(1/this.parent.getLocalScale().x),1*this.targetValueY/this.parent.getLocalScale().z,1*this.targetValueZ/this.parent.getLocalScale().y):this.entity.setLocalScale(this.targetValueX*(1/this.parent.getLocalScale().x),1*this.targetValueY/this.parent.getLocalScale().y,1*this.targetValueZ/this.parent.getLocalScale().z)};var MatchTargetScale=pc.createScript("matchTargetScale");MatchTargetScale.attributes.add("target",{type:"entity"}),MatchTargetScale.attributes.add("matchX",{type:"boolean"}),MatchTargetScale.attributes.add("matchY",{type:"boolean"}),MatchTargetScale.attributes.add("matchZ",{type:"boolean"}),MatchTargetScale.prototype.initialize=function(){this.initialX=this.entity.getLocalScale().x,this.initialY=this.entity.getLocalScale().y,this.initialZ=this.entity.getLocalScale().z},MatchTargetScale.prototype.update=function(t){1==this.matchX&&(this.entity.setLocalScale(this.initialX*this.target.getLocalScale().x,this.entity.getLocalScale().y,this.entity.getLocalScale().z),console.log(this.target.getLocalScale().x/this.initialTargetX)),1==this.matchY&&this.entity.setLocalScale(this.entity.getLocalScale().x,this.target.getLocalScale().y,this.entity.getLocalScale().z),1==this.matchZ&&this.entity.setLocalScale(this.entity.getLocalScale().x,this.entity.getLocalScale().y,this.target.getLocalScale().z)};var MantainDistanceWithTargetScale=pc.createScript("mantainDistanceWithTargetScale");MantainDistanceWithTargetScale.attributes.add("target",{type:"entity"}),MantainDistanceWithTargetScale.attributes.add("defaultDistZ",{type:"number"}),MantainDistanceWithTargetScale.attributes.add("defaultDistX",{type:"number"}),MantainDistanceWithTargetScale.attributes.add("adjustZ",{type:"boolean"}),MantainDistanceWithTargetScale.attributes.add("adjustX",{type:"boolean"}),MantainDistanceWithTargetScale.prototype.initialize=function(){},MantainDistanceWithTargetScale.prototype.update=function(t){1==this.adjustZ&&this.entity.setLocalPosition(this.entity.getLocalPosition().x,this.entity.getLocalPosition().y,this.target.getLocalPosition().z+this.defaultDistZ*this.target.getLocalScale().z),1==this.adjustX&&this.entity.setLocalPosition(this.target.getLocalPosition().x+this.defaultDistX*this.target.getLocalScale().x,this.entity.getLocalPosition().y,this.entity.getLocalPosition().z)};var MoveUpwithScale=pc.createScript("moveUpwithScale");MoveUpwithScale.attributes.add("target",{type:"entity"}),MoveUpwithScale.prototype.initialize=function(){this.initialYPosition=this.entity.getLocalPosition().y},MoveUpwithScale.prototype.update=function(t){this.entity.setLocalPosition(this.entity.getLocalPosition().x,-(1-this.target.getLocalScale().z)/2.2,this.entity.getLocalPosition().z)}; \ No newline at end of file diff --git a/__loading__.js b/__loading__.js index 627a013..4d5673b 100644 --- a/__loading__.js +++ b/__loading__.js @@ -12,7 +12,7 @@ pc.script.createLoadingScreen(function (app) { splash.style.display = 'none'; var logo = document.createElement('img'); - logo.src = ASSET_PREFIX + 'logo.png'; + logo.src = 'https://farsh-mobile.s3.me-south-1.amazonaws.com/farsh_logo_high_res_1.png'; splash.appendChild(logo); logo.onload = function () { splash.style.display = 'block'; @@ -35,7 +35,7 @@ pc.script.createLoadingScreen(function (app) { var setProgress = function (value) { var bar = document.getElementById('progress-bar'); - if (bar) { + if(bar) { value = Math.min(1, Math.max(0, value)); bar.style.width = value * 100 + '%'; } @@ -46,46 +46,46 @@ pc.script.createLoadingScreen(function (app) { 'body {', ' background-color: #283538;', '}', - + '', '#application-splash-wrapper {', ' position: absolute;', ' top: 0;', ' left: 0;', ' height: 100%;', ' width: 100%;', - ' background-color: #283538;', + ' background-color: #ffffff;', '}', - + '', '#application-splash {', ' position: absolute;', ' top: calc(50% - 28px);', ' width: 264px;', ' left: calc(50% - 132px);', '}', - + '', '#application-splash img {', ' width: 100%;', '}', - + '', '#progress-bar-container {', ' margin: 20px auto 0 auto;', ' height: 2px;', ' width: 100%;', ' background-color: #1d292c;', '}', - + '', '#progress-bar {', ' width: 0%;', ' height: 100%;', - ' background-color: #f60;', + ' background-color: #eeeeee;', '}', + '', '@media (max-width: 480px) {', ' #application-splash {', ' width: 170px;', ' left: calc(50% - 85px);', ' }', '}' - ].join('\n'); var style = document.createElement('style'); @@ -99,9 +99,7 @@ pc.script.createLoadingScreen(function (app) { document.head.appendChild(style); }; - createCss(); - showSplash(); app.on('preload:end', function () { @@ -109,4 +107,4 @@ pc.script.createLoadingScreen(function (app) { }); app.on('preload:progress', setProgress); app.on('start', hideSplash); -}); +}); \ No newline at end of file diff --git a/__settings__.js b/__settings__.js index 45aea0d..89eedca 100644 --- a/__settings__.js +++ b/__settings__.js @@ -6,9 +6,9 @@ CONTEXT_OPTIONS = { 'alpha': false, 'preserveDrawingBuffer': false, 'preferWebGl2': true, - 'powerPreference': "default" + 'powerPreference': "high-performance" }; -SCRIPTS = [ 77854887, 78097772, 78382718, 79014545, 79153391, 79459251, 79465795, 79469394, 82175600, 82307731, 85572451, 86079364, 86144986, 86147006, 86182389 ]; +SCRIPTS = [ 77854887, 78097772, 78382718, 79014545, 79153391, 79459251, 79465795, 79469394, 82175600, 82307731, 86079364, 86144986, 86147006, 86182389, 86761091, 89559195, 89696259, 89697541, 89706577, 89717413, 91478011, 91628463, 92663277, 92668910, 92676263, 93407776 ]; CONFIG_FILENAME = "config.json"; INPUT_SETTINGS = { useKeyboard: true, diff --git a/config.json b/config.json index 7bb6c42..6357ca4 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,82175600,82307731,85572451,86079364,86144986,86147006,86182389],"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"],"attributes":{"Selected":{"type":"number","default":0}}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":24523,"hash":"716682924eba773e776b64eff97015ca","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"7bc18c8f-82fe-4680-926d-309538b1674b","same_as_backup":0,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":24523,"hash":"716682924eba773e776b64eff97015ca","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"80a64f57-ab50-40bb-9ad6-a11a4c149415","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"51190c9c-93ec-417f-b21c-95a3d9534df4","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":[118.58,59.38],"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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":[18.17,7.04],"aoMapOffset":[0,0],"diffuseMap":85570629,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[18.17,7.04],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[18.17,7.04],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[18.17,7.04],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[18.17,7.04],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[18.17,7.04],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[18.17,7.04],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[18.17,7.04],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[18.17,7.04],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[18.17,7.04],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[18.17,7.04],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[18.17,7.04],"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":[18.17,7.04],"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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":24523,"hash":"716682924eba773e776b64eff97015ca","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"e57f9cf1-f99e-4018-b12f-7e22257e0e1c","same_as_backup":0,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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}},"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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":24523,"hash":"716682924eba773e776b64eff97015ca","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"c6340062-deb9-478d-93cb-12fd1392454c","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":24523,"hash":"716682924eba773e776b64eff97015ca","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","immutable_backup":"35a0c9ab-c914-43d9-9df1-af277469a8d9","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":[0,0,0],"diffuseMap":86181995,"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":0.73,"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.334,"alphaFade":1,"opacity":1,"opacityMap":86181995,"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":"phong","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":24523,"hash":"716682924eba773e776b64eff97015ca","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"b451465d-204c-4380-8ca8-55d61da76f08","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":24523,"hash":"716682924eba773e776b64eff97015ca","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"e70bc0ed-cdb7-4cd5-9c0c-839bcacd499a","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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","baseScaleWidth","baseScaleHeight","physicalHeight","physicalWidth","ImageEntity"],"attributes":{"width":{"type":"entity"},"height":{"type":"entity"},"hideInterval":{"type":"number"},"physicalHeight":{"type":"number"},"physicalWidth":{"type":"number"},"ImageEntity":{"type":"entity"},"baseScaleWidth":{"type":"number"},"baseScaleHeight":{"type":"number"}}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":24523,"hash":"716682924eba773e776b64eff97015ca","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"ae45f8a7-fce5-4343-8d3c-6304ad9cf6a6","same_as_backup":0,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"immutable_backup":"2c320b9a-8f3c-447c-aff4-5277fb7725ef","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"immutable_backup":"e9bf1f8d-6b7e-4387-9f2e-40e43cd7722f","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"immutable_backup":"c1b359a7-81f5-46d5-975f-91e687e33e59","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"immutable_backup":"9ce09fd6-2536-46f7-a416-726794f3d40d","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"immutable_backup":"01e3ae99-922c-4a77-8cc7-96f8a8c4e9c9","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"immutable_backup":"2ab12593-7188-4b40-8221-66bd9bdc7ad7","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"immutable_backup":"95e4942a-09fd-4a61-a7ee-ed8bd63e7913","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"immutable_backup":"92253479-c4f6-4db6-9c2a-a3adc2acd178","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"immutable_backup":"7dbb5081-efa5-41c9-9233-c3111f8604e6","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":82069915,"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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"immutable_backup":"e035ed46-dee6-4ebe-976b-d8217186f62f","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"immutable_backup":"c472f8ed-068a-42b7-ba3d-23db7fa24fed","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","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":{},"immutable_backup":"d3ae9623-c9d5-4632-b4ee-f3e3cfc0fb06","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"80915363"},"82069915":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Rug_N1.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":512,"height":512,"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_N1.png","size":704035,"hash":"bae0abb5f9efedd328f95b683f46ae78","variants":{},"url":"files/assets/82069915/1/Rug_N1.png"},"region":"eu-west-1","i18n":{},"immutable_backup":"de986194-3370-4e38-a97e-699b423c021f","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"82069915"},"82175600":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"button-logic.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"buttonLogic":{"attributesOrder":["textEntity","description","model"],"attributes":{"textEntity":{"type":"entity","description":"The entity that we want to update when the button is clicked"},"description":{"type":"string"},"model":{"type":"entity"}}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":24523,"hash":"716682924eba773e776b64eff97015ca","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"1a0083ec-735a-4f63-be31-7a5bde6999d5","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"82175600"},"82307731":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"buttonLogic2.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"buttonLogic2":{"attributesOrder":["textEntity","description","model"],"attributes":{"textEntity":{"type":"entity","description":"The entity that we want to update when the button is clicked"},"description":{"type":"string"},"model":{"type":"entity"}}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":24523,"hash":"716682924eba773e776b64eff97015ca","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"617368ef-b692-4114-9f45-df32d07f36a5","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"82307731"},"85570528":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"1_white bricks texture-seamless.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":1000,"height":1000,"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":"1_white bricks texture-seamless.jpg","size":448379,"hash":"2584eda7e31a4ad4c3ca18b389d44555","variants":{},"url":"files/assets/85570528/1/1_white%20bricks%20texture-seamless.jpg"},"region":"eu-west-1","i18n":{},"immutable_backup":"c14dd110-b373-4b36-9aec-2220fdb962f1","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"85570528"},"85570629":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"25_white bricks texture-seamless.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":1250,"height":1250,"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":"25_white bricks texture-seamless.jpg","size":508599,"hash":"2376024584e99abdc1e91d611ecd1e9b","variants":{},"url":"files/assets/85570629/1/25_white%20bricks%20texture-seamless.jpg"},"region":"eu-west-1","i18n":{},"immutable_backup":"2ac8e7ee-731b-4aef-9239-725c5ed254e3","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"85570629"},"85572337":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"html-ui.html","revision":1,"preload":true,"exclude":false,"meta":null,"data":null,"type":"html","file":{"filename":"html-ui.html","size":178,"hash":"b577517df682d6988e635f2120b98223","url":"files/assets/85572337/1/html-ui.html"},"region":"eu-west-1","i18n":{},"immutable_backup":"6d9e6782-38b4-4850-aea5-78ccf55e1f99","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"85572337"},"85572402":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"css-ui.css","revision":1,"preload":true,"exclude":false,"meta":null,"data":null,"type":"css","file":{"filename":"css-ui.css","size":1339,"hash":"52f42e130516dd45d42e627df98cbd6c","url":"files/assets/85572402/1/css-ui.css"},"region":"eu-west-1","i18n":{},"immutable_backup":"73d7be2d-d2df-4fd8-a443-38047430210a","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"85572402"},"85572451":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"RoomWidthSlider.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"roomWidthSlider":{"attributesOrder":["html","css"],"attributes":{"html":{"type":"asset","assetType":"html","title":"HTML Asset"},"css":{"type":"asset","assetType":"css","title":"CSS Asset"}}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":24523,"hash":"716682924eba773e776b64eff97015ca","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"9604cbd0-1e1c-4c82-b6d4-3e30aa33a3b9","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"85572451"},"86059723":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Button","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.8196078431372549,0.8196078431372549,0.8196078431372549],"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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"86059723"},"86079364":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"sliderHorizontal.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"sliderHorizontal":{"attributesOrder":["Selected","SliderValue","MinLimit","MaxLimit","RoomWidth","RoomWidthText","MinLimitOffset","MaxLimitOffset"],"attributes":{"Selected":{"type":"number","default":0},"MinLimit":{"type":"entity"},"MaxLimit":{"type":"entity"},"MinLimitOffset":{"type":"number","default":0},"MaxLimitOffset":{"type":"number","default":0},"SliderValue":{"type":"number","default":0},"RoomWidth":{"type":"entity"},"RoomWidthText":{"type":"entity"}}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":24523,"hash":"716682924eba773e776b64eff97015ca","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"16e3ac0c-5df9-46c9-a6b0-7bdd99f9f6a8","same_as_backup":0,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"86079364"},"86144986":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"sliderVertical.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"sliderVertical":{"attributesOrder":["Selected","SliderValue","MinLimit","MaxLimit","Ceiling","CeilingHeightText","MinLimitOffset","MaxLimitOffset","RaiseFactor"],"attributes":{"Selected":{"type":"number","default":0},"SliderValue":{"type":"number","default":0},"MinLimit":{"type":"entity"},"MaxLimit":{"type":"entity"},"MinLimitOffset":{"type":"number","default":0},"MaxLimitOffset":{"type":"number","default":0},"Ceiling":{"type":"entity"},"RaiseFactor":{"type":"number","default":1},"CeilingHeightText":{"type":"entity"}}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":24523,"hash":"716682924eba773e776b64eff97015ca","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"13806641-74ab-4477-8c07-bae27a7d5b4c","same_as_backup":0,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"86144986"},"86147006":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"scaleSlider.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"scaleSlider":{"attributesOrder":["Selected","SliderValue","MinLimit","MaxLimit","Model","ModelHeightText","MinLimitOffset","MaxLimitOffset","RaiseFactor"],"attributes":{"Selected":{"type":"number","default":0},"SliderValue":{"type":"number","default":0},"MinLimit":{"type":"entity"},"MaxLimit":{"type":"entity"},"MinLimitOffset":{"type":"number","default":0},"MaxLimitOffset":{"type":"number","default":0},"RaiseFactor":{"type":"number","default":1},"Model":{"type":"entity"},"ModelHeightText":{"type":"entity"}}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":24523,"hash":"716682924eba773e776b64eff97015ca","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"132365b1-5ee6-4f50-95d2-f57cd6866ba4","same_as_backup":0,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"86147006"},"86173566":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"SliderHorizontal.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":800,"height":200,"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":"SliderHorizontal.png","size":4832,"hash":"9baec53ced12bb0f97c5ffcad65a8442","variants":{},"url":"files/assets/86173566/1/SliderHorizontal.png"},"region":"eu-west-1","i18n":{},"immutable_backup":"6e5673d6-b687-493f-8970-972f8610e187","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"86173566"},"86173567":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Slider.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":200,"height":800,"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":"Slider.png","size":5911,"hash":"0fc6a27983bb80cc8452a61cbbac3afd","variants":{},"url":"files/assets/86173567/1/Slider.png"},"region":"eu-west-1","i18n":{},"immutable_backup":"70d36359-4351-47fc-b8b6-6331a41c8043","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"86173567"},"86173568":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"SliderKnot.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":100,"height":100,"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":"SliderKnot.png","size":6292,"hash":"d9d5e1fe7d12b16397b54945bd47c4d4","variants":{},"url":"files/assets/86173568/1/SliderKnot.png"},"region":"eu-west-1","i18n":{},"immutable_backup":"398bd074-9937-4792-ba22-7b22463aa398","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"86173568"},"86173570":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"HorizontalSlider","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":86173567,"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":true,"alphaTest":0,"alphaFade":1,"opacity":1,"opacityMap":86174925,"opacityMapChannel":"a","opacityMapUv":1,"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":2,"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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"86173570"},"86174697":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"HorizonAlpha.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":800,"height":200,"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":"HorizonAlpha.png","size":4882,"hash":"17c8477a4a4d0708ac36dc8cac7c141d","variants":{},"url":"files/assets/86174697/1/HorizonAlpha.png"},"region":"eu-west-1","i18n":{},"immutable_backup":"9a941c7c-a1d5-4d66-9c4a-0d963e413940","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"86174697"},"86174925":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"HorAlpha.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":800,"height":200,"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":"HorAlpha.png","size":4544,"hash":"db21ae43f8d74a8961ac48029fa43eef","variants":{},"url":"files/assets/86174925/1/HorAlpha.png"},"region":"eu-west-1","i18n":{},"immutable_backup":"1182ebe3-34e0-4d03-92b0-0aeb37462630","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"86174925"},"86175118":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"SliderMat","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":86173566,"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":86173566,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":0.41,"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":0.87,"opacityMap":86173566,"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":2,"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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"86175118"},"86175481":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"SliderKnot","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":86173568,"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":86173568,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":0.99,"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.027,"alphaFade":1,"opacity":1,"opacityMap":86173568,"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":2,"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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"86175481"},"86175694":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"VerticalSlider","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":86173567,"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":86173567,"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":true,"alphaTest":0,"alphaFade":1,"opacity":1,"opacityMap":86175751,"opacityMapChannel":"b","opacityMapUv":1,"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":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"86175694"},"86175751":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"HorSLiderAlpha.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":200,"height":800,"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":"HorSLiderAlpha.png","size":5765,"hash":"cff7df8f3c85cbf4ff996366b1b2d56f","variants":{},"url":"files/assets/86175751/1/HorSLiderAlpha.png"},"region":"eu-west-1","i18n":{},"immutable_backup":"b815a3f2-2883-4de5-bdc6-9674c953aff8","same_as_backup":1,"checkpoint_id":"61dc67ff-7f4f-4b2d-aeb5-b46abfe99088","id":"86175751"},"86181995":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Arrow.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":400,"height":100,"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":"Arrow.png","size":10266,"hash":"23bb55b401eae5f168ea244fa7553f3b","variants":{},"url":"files/assets/86181995/1/Arrow.png"},"region":"eu-west-1","i18n":{},"id":"86181995"},"86182389":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"SliderVisible.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"sliderVisible":{"attributesOrder":["SliderEntity","Interval"],"attributes":{"SliderEntity":{"type":"entity"},"Interval":{"type":"number","default":5}}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":24523,"hash":"716682924eba773e776b64eff97015ca","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"id":"86182389"},"86202215":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"41_white bricks texture-seamless.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":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":"41_white bricks texture-seamless.jpg","size":709349,"hash":"abb46f3dde4c7bce2c25d9e7fa55162b","variants":{},"url":"files/assets/86202215/1/41_white%20bricks%20texture-seamless.jpg"},"region":"eu-west-1","i18n":{},"id":"86202215"}}} \ 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":"high-performance","batchGroups":[],"preserveDrawingBuffer":false,"useLegacyScripts":false,"fillMode":"KEEP_ASPECT","scripts":[77854887,78097772,78382718,79014545,79153391,79459251,79465795,79469394,82175600,82307731,86079364,86144986,86147006,86182389,86761091,89559195,89696259,89697541,89706577,89717413,91478011,91628463,92663277,92668910,92676263,93407776],"useMouse":true,"use3dPhysics":false,"transparentCanvas":false,"resolutionMode":"AUTO","loadingScreenScript":"86761091","preferWebGl2":true,"useGamepads":false,"libraries":[]},"scenes":[{"name":"Untitled","url":"1390892.json"}],"assets":{"77854887":{"name":"mouse.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"mouse":{"attributesOrder":["Selected"],"attributes":{"Selected":{"type":"number","default":0}}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"77854887"},"77855246":{"name":"New Material","type":"material","file":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},"preload":true,"tags":[],"i18n":{},"id":"77855246"},"78072763":{"name":"loonie1.png","type":"texture","file":{"filename":"loonie1.png","size":179080,"hash":"549278f659af3330a068eeab4953f01b","variants":{},"url":"files/assets/78072763/1/loonie1.png"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"78072763"},"78072855":{"name":"New Material","type":"material","file":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},"preload":true,"tags":[],"i18n":{},"id":"78072855"},"78097772":{"name":"touch.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"touch":{"attributesOrder":["Selected"],"attributes":{"Selected":{"type":"number","default":0}}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"78097772"},"78181705":{"name":"Wdparq2.jpg","type":"texture","file":{"filename":"Wdparq2.jpg","size":75522,"hash":"bf13297b4b74e7c37839ecba595482f2","variants":{},"url":"files/assets/78181705/1/Wdparq2.jpg"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"78181705"},"78181707":{"name":"ceilingbump.jpg","type":"texture","file":{"filename":"ceilingbump.jpg","size":115965,"hash":"c78e303aa89c57fb464518c819f327b6","variants":{},"url":"files/assets/78181707/1/ceilingbump.jpg"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"78181707"},"78181709":{"name":"CARPTTAN.JPG","type":"texture","file":{"filename":"CARPTTAN.JPG","size":250224,"hash":"1d7c8fb9403e175e294aa0a14e290a54","variants":{},"url":"files/assets/78181709/1/CARPTTAN.JPG"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"78181709"},"78181710":{"name":"livingroom.max","type":"binary","file":{"filename":"livingroom.max","size":302592,"hash":"444dd36a95b616a14e030148af5cda69","url":"files/assets/78181710/1/livingroom.max"},"data":null,"preload":true,"tags":[],"i18n":{},"id":"78181710"},"78181711":{"name":"BURLOAK.JPG","type":"texture","file":{"filename":"BURLOAK.JPG","size":189060,"hash":"3a7de42744d470c97f33b53c1b3eef7b","variants":{},"url":"files/assets/78181711/1/BURLOAK.JPG"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"78181711"},"78181751":{"name":"Take 001.glb","type":"animation","file":{"hash":"cb00af4e5637090a638f86273312a910","size":13688,"filename":"Take 001.glb","url":"files/assets/78181751/1/Take%20001.glb"},"data":null,"preload":true,"tags":[],"i18n":{},"id":"78181751"},"78181752":{"name":"01 - Default","type":"material","file":null,"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},"preload":true,"tags":[],"i18n":{},"id":"78181752"},"78181753":{"name":"02 - Default","type":"material","file":null,"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},"preload":true,"tags":[],"i18n":{},"id":"78181753"},"78181754":{"name":"13 - Default","type":"material","file":null,"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":[118.58,59.38],"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},"preload":true,"tags":[],"i18n":{},"id":"78181754"},"78181756":{"name":"14 - Defaultwall","type":"material","file":null,"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},"preload":true,"tags":[],"i18n":{},"id":"78181756"},"78181757":{"name":"07 - Default","type":"material","file":null,"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":[18.17,7.04],"aoMapOffset":[0,0],"diffuseMap":85570629,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[18.17,7.04],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[18.17,7.04],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[18.17,7.04],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[18.17,7.04],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[18.17,7.04],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[18.17,7.04],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[18.17,7.04],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[18.17,7.04],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[18.17,7.04],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[18.17,7.04],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[18.17,7.04],"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":[18.17,7.04],"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},"preload":true,"tags":[],"i18n":{},"id":"78181757"},"78181758":{"name":"15 - Default","type":"material","file":null,"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},"preload":true,"tags":[],"i18n":{},"id":"78181758"},"78181759":{"name":"14 - Default","type":"material","file":null,"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},"preload":true,"tags":[],"i18n":{},"id":"78181759"},"78181760":{"name":"08 - Default","type":"material","file":null,"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},"preload":true,"tags":[],"i18n":{},"id":"78181760"},"78181761":{"name":"03 - Default","type":"material","file":null,"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},"preload":true,"tags":[],"i18n":{},"id":"78181761"},"78181762":{"name":"Box01","type":"render","file":null,"data":{"containerAsset":78181755,"renderIndex":0},"preload":true,"tags":[],"i18n":{},"id":"78181762"},"78181763":{"name":"Box02","type":"render","file":null,"data":{"containerAsset":78181755,"renderIndex":1},"preload":true,"tags":[],"i18n":{},"id":"78181763"},"78181764":{"name":"Box03","type":"render","file":null,"data":{"containerAsset":78181755,"renderIndex":2},"preload":true,"tags":[],"i18n":{},"id":"78181764"},"78181765":{"name":"Box04","type":"render","file":null,"data":{"containerAsset":78181755,"renderIndex":3},"preload":true,"tags":[],"i18n":{},"id":"78181765"},"78181766":{"name":"Box05","type":"render","file":null,"data":{"containerAsset":78181755,"renderIndex":4},"preload":true,"tags":[],"i18n":{},"id":"78181766"},"78181767":{"name":"Box06","type":"render","file":null,"data":{"containerAsset":78181755,"renderIndex":5},"preload":true,"tags":[],"i18n":{},"id":"78181767"},"78181769":{"name":"Plane01","type":"render","file":null,"data":{"containerAsset":78181755,"renderIndex":7},"preload":true,"tags":[],"i18n":{},"id":"78181769"},"78181770":{"name":"C-Ext01","type":"render","file":null,"data":{"containerAsset":78181755,"renderIndex":8},"preload":true,"tags":[],"i18n":{},"id":"78181770"},"78181772":{"name":"Sphere01","type":"render","file":null,"data":{"containerAsset":78181755,"renderIndex":10},"preload":true,"tags":[],"i18n":{},"id":"78181772"},"78181773":{"name":"Cylinder01","type":"render","file":null,"data":{"containerAsset":78181755,"renderIndex":11},"preload":true,"tags":[],"i18n":{},"id":"78181773"},"78181774":{"name":"Sphere02","type":"render","file":null,"data":{"containerAsset":78181755,"renderIndex":12},"preload":true,"tags":[],"i18n":{},"id":"78181774"},"78181775":{"name":"Line01","type":"render","file":null,"data":{"containerAsset":78181755,"renderIndex":13},"preload":true,"tags":[],"i18n":{},"id":"78181775"},"78181777":{"name":"Box10","type":"render","file":null,"data":{"containerAsset":78181755,"renderIndex":15},"preload":true,"tags":[],"i18n":{},"id":"78181777"},"78181778":{"name":"Box11","type":"render","file":null,"data":{"containerAsset":78181755,"renderIndex":16},"preload":true,"tags":[],"i18n":{},"id":"78181778"},"78181779":{"name":"Box12","type":"render","file":null,"data":{"containerAsset":78181755,"renderIndex":17},"preload":true,"tags":[],"i18n":{},"id":"78181779"},"78181780":{"name":"Box13","type":"render","file":null,"data":{"containerAsset":78181755,"renderIndex":18},"preload":true,"tags":[],"i18n":{},"id":"78181780"},"78181876":{"name":"livingroom.glb","type":"container","file":{"hash":"78e748bf3b30b70fc9d4b74e36d22e8d","size":815580,"filename":"livingroom.glb","url":"files/assets/78181876/1/livingroom.glb"},"data":{},"preload":true,"tags":[],"i18n":{},"id":"78181876"},"78181877":{"name":"Box01","type":"render","file":null,"data":{"containerAsset":78181876,"renderIndex":0},"preload":true,"tags":[],"i18n":{},"id":"78181877"},"78181878":{"name":"Box02","type":"render","file":null,"data":{"containerAsset":78181876,"renderIndex":1},"preload":true,"tags":[],"i18n":{},"id":"78181878"},"78181879":{"name":"Box03","type":"render","file":null,"data":{"containerAsset":78181876,"renderIndex":2},"preload":true,"tags":[],"i18n":{},"id":"78181879"},"78181881":{"name":"Box05","type":"render","file":null,"data":{"containerAsset":78181876,"renderIndex":4},"preload":true,"tags":[],"i18n":{},"id":"78181881"},"78181884":{"name":"Plane01","type":"render","file":null,"data":{"containerAsset":78181876,"renderIndex":7},"preload":true,"tags":[],"i18n":{},"id":"78181884"},"78181885":{"name":"C-Ext01","type":"render","file":null,"data":{"containerAsset":78181876,"renderIndex":8},"preload":true,"tags":[],"i18n":{},"id":"78181885"},"78181886":{"name":"Sphere01","type":"render","file":null,"data":{"containerAsset":78181876,"renderIndex":10},"preload":true,"tags":[],"i18n":{},"id":"78181886"},"78181888":{"name":"Cylinder01","type":"render","file":null,"data":{"containerAsset":78181876,"renderIndex":11},"preload":true,"tags":[],"i18n":{},"id":"78181888"},"78181889":{"name":"Sphere02","type":"render","file":null,"data":{"containerAsset":78181876,"renderIndex":12},"preload":true,"tags":[],"i18n":{},"id":"78181889"},"78181890":{"name":"Line01","type":"render","file":null,"data":{"containerAsset":78181876,"renderIndex":13},"preload":true,"tags":[],"i18n":{},"id":"78181890"},"78181892":{"name":"Box10","type":"render","file":null,"data":{"containerAsset":78181876,"renderIndex":15},"preload":true,"tags":[],"i18n":{},"id":"78181892"},"78181893":{"name":"Box11","type":"render","file":null,"data":{"containerAsset":78181876,"renderIndex":16},"preload":true,"tags":[],"i18n":{},"id":"78181893"},"78181894":{"name":"Box12","type":"render","file":null,"data":{"containerAsset":78181876,"renderIndex":17},"preload":true,"tags":[],"i18n":{},"id":"78181894"},"78181895":{"name":"Box13","type":"render","file":null,"data":{"containerAsset":78181876,"renderIndex":18},"preload":true,"tags":[],"i18n":{},"id":"78181895"},"78181896":{"name":"livingroom","type":"template","file":null,"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"}}},"preload":true,"tags":[],"i18n":{},"id":"78181896"},"78379717":{"name":"ammo.js","type":"script","file":{"filename":"ammo.js","size":1895438,"hash":"34480c72ed787337db20c105cb9ba69d","url":"files/assets/78379717/1/ammo.js"},"data":{"order":100,"scripts":{},"loadingType":0},"preload":false,"tags":[],"i18n":{},"id":"78379717"},"78379718":{"name":"ammo.wasm.js","type":"script","file":{"filename":"ammo.wasm.js","size":391789,"hash":"6b7ab3989e4f9f17c86e44380f9181c6","url":"files/assets/78379718/1/ammo.wasm.js"},"data":{"order":100,"scripts":{},"loadingType":0},"preload":false,"tags":[],"i18n":{},"id":"78379718"},"78379719":{"name":"ammo.wasm.wasm","type":"wasm","file":{"filename":"ammo.wasm.wasm","size":659433,"hash":"a6819ea71a53e67f1dfe3e42957c2971","url":"files/assets/78379719/1/ammo.wasm.wasm"},"data":{"moduleName":"Ammo","glueScriptId":78379718,"fallbackScriptId":78379717,"loadingType":0},"preload":false,"tags":[],"i18n":{},"id":"78379719"},"78382718":{"name":"picker_raycast.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"pickerRaycast":{"attributesOrder":[],"attributes":{}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"78382718"},"78401677":{"name":"doorman.mtl","type":"binary","file":{"filename":"doorman.mtl","size":930,"hash":"db9bed74e8bdc6681a6ab846c919aada","url":"files/assets/78401677/1/doorman.mtl"},"data":null,"preload":true,"tags":[],"i18n":{},"id":"78401677"},"78401691":{"name":"t_eye_d.jpeg","type":"texture","file":{"filename":"t_eye_d.jpeg","hash":"fef226427dfd003d8f8b462219f1df8e","size":10713,"variants":{},"url":"files/assets/78401691/1/t_eye_d.jpeg"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"78401691"},"78401692":{"name":"t_doorMan_teeth_d.jpeg","type":"texture","file":{"filename":"t_doorMan_teeth_d.jpeg","hash":"32521ea35225763f7f528eb8e7b4393e","size":16505,"variants":{},"url":"files/assets/78401692/1/t_doorMan_teeth_d.jpeg"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"78401692"},"78401693":{"name":"t_doorMan_teeth_n.jpeg","type":"texture","file":{"filename":"t_doorMan_teeth_n.jpeg","hash":"d75247a48a056745a100fc522344f5b0","size":22879,"variants":{},"url":"files/assets/78401693/1/t_doorMan_teeth_n.jpeg"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"78401693"},"78401695":{"name":"t_eye_n.png","type":"texture","file":{"filename":"t_eye_n.png","hash":"18e0ed32b974fc7e20d98149d20e7589","size":35989,"variants":{},"url":"files/assets/78401695/1/t_eye_n.png"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"78401695"},"78401697":{"name":"rdmobj00Mat","type":"material","file":null,"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},"preload":true,"tags":[],"i18n":{},"id":"78401697"},"78401698":{"name":"rdmobj01Mat","type":"material","file":null,"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},"preload":true,"tags":[],"i18n":{},"id":"78401698"},"78401699":{"name":"rdmobj03Mat","type":"material","file":null,"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},"preload":true,"tags":[],"i18n":{},"id":"78401699"},"78401700":{"name":"rdmobj02Mat","type":"material","file":null,"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},"preload":true,"tags":[],"i18n":{},"id":"78401700"},"78401701":{"name":"doorman.glb","type":"container","file":{"hash":"20572c505d27cbde1e4c76f0b853421f","size":306708,"filename":"doorman.glb","url":"files/assets/78401701/1/doorman.glb"},"data":{},"preload":true,"tags":[],"i18n":{},"id":"78401701"},"78401702":{"name":"rdmobj00","type":"render","file":null,"data":{"containerAsset":78401701,"renderIndex":0},"preload":true,"tags":[],"i18n":{},"id":"78401702"},"78401703":{"name":"rdmobj01","type":"render","file":null,"data":{"containerAsset":78401701,"renderIndex":1},"preload":true,"tags":[],"i18n":{},"id":"78401703"},"78401704":{"name":"rdmobj03","type":"render","file":null,"data":{"containerAsset":78401701,"renderIndex":3},"preload":true,"tags":[],"i18n":{},"id":"78401704"},"78401705":{"name":"rdmobj02","type":"render","file":null,"data":{"containerAsset":78401701,"renderIndex":2},"preload":true,"tags":[],"i18n":{},"id":"78401705"},"78401706":{"name":"doorman","type":"template","file":null,"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}},"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"}}},"preload":true,"tags":[],"i18n":{},"id":"78401706"},"78402284":{"name":"t_doorMan_d.jpeg","type":"texture","file":{"filename":"t_doorMan_d.jpeg","hash":"c098404fd23169b3f6dfe0e20bec277f","size":170279,"variants":{},"url":"files/assets/78402284/1/t_doorMan_d.jpeg"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"78402284"},"78402285":{"name":"t_doorMan_s.jpeg","type":"texture","file":{"filename":"t_doorMan_s.jpeg","hash":"560ee2f398d81b75b4ba419cce710cb9","size":122293,"variants":{},"url":"files/assets/78402285/1/t_doorMan_s.jpeg"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"78402285"},"78402286":{"name":"t_doorMan_n.jpeg","type":"texture","file":{"filename":"t_doorMan_n.jpeg","hash":"803af87756a209776154326664e5dbc9","size":237433,"variants":{},"url":"files/assets/78402286/1/t_doorMan_n.jpeg"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"78402286"},"78406226":{"name":"archive-roundface-script_bigfontsite.com.ttf","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"},"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":{}},"preload":true,"tags":[],"i18n":{},"id":"78406226"},"79014545":{"name":"load_image.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"loadImage":{"attributesOrder":[],"attributes":{}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"79014545"},"79153391":{"name":"switching-textures.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"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},"preload":true,"tags":[],"i18n":{},"id":"79153391"},"79449648":{"name":"double-sided-arrow-png-51575265495yriug9wtzm.png","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"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"79449648"},"79458597":{"name":"New Material","type":"material","file":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":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":0.73,"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.334,"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":"phong","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},"preload":true,"tags":[],"i18n":{},"id":"79458597"},"79459251":{"name":"GetWidthFromURLParams.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"getWidthFromUrlparams":{"attributesOrder":[],"attributes":{}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"79459251"},"79465530":{"name":"BRLNSDB.TTF","type":"font","file":{"filename":"BRLNSDB.png","hash":"64c1f05f77830228af9c5fa580768cf1","size":369767,"url":"files/assets/79465530/1/BRLNSDB.png"},"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":{}},"preload":true,"tags":[],"i18n":{},"id":"79465530"},"79465795":{"name":"GetHeightFromURLParams.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"getHeightFromUrlparams":{"attributesOrder":[],"attributes":{}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"79465795"},"79469394":{"name":"showHeightAndWidth.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"showHeightAndWidth":{"attributesOrder":["width","height","hideInterval","baseScaleWidth","baseScaleHeight","physicalHeight","physicalWidth","ImageEntity"],"attributes":{"width":{"type":"entity"},"height":{"type":"entity"},"hideInterval":{"type":"number"},"physicalHeight":{"type":"number"},"physicalWidth":{"type":"number"},"ImageEntity":{"type":"entity"},"baseScaleWidth":{"type":"number"},"baseScaleHeight":{"type":"number"}}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"79469394"},"82175600":{"name":"button-logic.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"buttonLogic":{"attributesOrder":["textEntity","description","model"],"attributes":{"textEntity":{"type":"entity","description":"The entity that we want to update when the button is clicked"},"description":{"type":"string"},"model":{"type":"entity"}}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"82175600"},"82307731":{"name":"buttonLogic2.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"buttonLogic2":{"attributesOrder":["textEntity","description","model"],"attributes":{"textEntity":{"type":"entity","description":"The entity that we want to update when the button is clicked"},"description":{"type":"string"},"model":{"type":"entity"}}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"82307731"},"85570528":{"name":"1_white bricks texture-seamless.jpg","type":"texture","file":{"filename":"1_white bricks texture-seamless.jpg","size":448379,"hash":"2584eda7e31a4ad4c3ca18b389d44555","variants":{},"url":"files/assets/85570528/1/1_white%20bricks%20texture-seamless.jpg"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"85570528"},"85570629":{"name":"25_white bricks texture-seamless.jpg","type":"texture","file":{"filename":"25_white bricks texture-seamless.jpg","size":508599,"hash":"2376024584e99abdc1e91d611ecd1e9b","variants":{},"url":"files/assets/85570629/1/25_white%20bricks%20texture-seamless.jpg"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"85570629"},"86059723":{"name":"Button","type":"material","file":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.8196078431372549,0.8196078431372549,0.8196078431372549],"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},"preload":true,"tags":[],"i18n":{},"id":"86059723"},"86079364":{"name":"sliderHorizontal.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"sliderHorizontal":{"attributesOrder":["Selected","SliderValue","MinLimit","MaxLimit","RoomWidth","RoomWidthText","MinLimitOffset","MaxLimitOffset"],"attributes":{"Selected":{"type":"number","default":0},"MinLimit":{"type":"entity"},"MaxLimit":{"type":"entity"},"MinLimitOffset":{"type":"number","default":0},"MaxLimitOffset":{"type":"number","default":0},"SliderValue":{"type":"number","default":0},"RoomWidth":{"type":"entity"},"RoomWidthText":{"type":"entity"}}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"86079364"},"86144986":{"name":"sliderVertical.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"sliderVertical":{"attributesOrder":["Selected","SliderValue","MinLimit","MaxLimit","Ceiling","CeilingHeightText","MinLimitOffset","MaxLimitOffset","RaiseFactor"],"attributes":{"Selected":{"type":"number","default":0},"SliderValue":{"type":"number","default":0},"MinLimit":{"type":"entity"},"MaxLimit":{"type":"entity"},"MinLimitOffset":{"type":"number","default":0},"MaxLimitOffset":{"type":"number","default":0},"Ceiling":{"type":"entity"},"RaiseFactor":{"type":"number","default":1},"CeilingHeightText":{"type":"entity"}}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"86144986"},"86147006":{"name":"scaleSlider.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"scaleSlider":{"attributesOrder":["Selected","SliderValue","MinLimit","MaxLimit","Model","ModelHeightText","ParentPlane","MinLimitOffset","MaxLimitOffset","RaiseFactor"],"attributes":{"Selected":{"type":"number","default":0},"SliderValue":{"type":"number","default":0},"MinLimit":{"type":"entity"},"MaxLimit":{"type":"entity"},"MinLimitOffset":{"type":"number","default":0},"MaxLimitOffset":{"type":"number","default":0},"RaiseFactor":{"type":"number","default":1},"Model":{"type":"entity"},"ModelHeightText":{"type":"entity"},"ParentPlane":{"type":"entity"}}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"86147006"},"86173566":{"name":"SliderHorizontal.png","type":"texture","file":{"filename":"SliderHorizontal.png","size":4832,"hash":"9baec53ced12bb0f97c5ffcad65a8442","variants":{},"url":"files/assets/86173566/1/SliderHorizontal.png"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"86173566"},"86173567":{"name":"Slider.png","type":"texture","file":{"filename":"Slider.png","size":5911,"hash":"0fc6a27983bb80cc8452a61cbbac3afd","variants":{},"url":"files/assets/86173567/1/Slider.png"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"86173567"},"86173568":{"name":"SliderKnot.png","type":"texture","file":{"filename":"SliderKnot.png","size":10555,"hash":"a6cb193c788ac08574ac4d32fdcbe120","variants":{},"url":"files/assets/86173568/1/SliderKnot.png"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":false},"preload":true,"tags":[],"i18n":{},"id":"86173568"},"86173570":{"name":"HorizontalSlider","type":"material","file":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":86173567,"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":true,"alphaTest":0,"alphaFade":1,"opacity":1,"opacityMap":86174925,"opacityMapChannel":"a","opacityMapUv":1,"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":2,"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},"preload":true,"tags":[],"i18n":{},"id":"86173570"},"86174697":{"name":"HorizonAlpha.png","type":"texture","file":{"filename":"HorizonAlpha.png","size":4882,"hash":"17c8477a4a4d0708ac36dc8cac7c141d","variants":{},"url":"files/assets/86174697/1/HorizonAlpha.png"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"86174697"},"86174925":{"name":"HorAlpha.png","type":"texture","file":{"filename":"HorAlpha.png","size":4792,"hash":"9418680d548ea5be66bc2086bba06da2","variants":{},"url":"files/assets/86174925/1/HorAlpha.png"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":false},"preload":true,"tags":[],"i18n":{},"id":"86174925"},"86175118":{"name":"SliderMat","type":"material","file":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":86173566,"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":86173566,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":0.41,"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":0.87,"opacityMap":86173566,"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":2,"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},"preload":true,"tags":[],"i18n":{},"id":"86175118"},"86175481":{"name":"SliderKnot","type":"material","file":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":86173568,"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":86173568,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":0.99,"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.027,"alphaFade":1,"opacity":1,"opacityMap":86173568,"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":2,"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},"preload":true,"tags":[],"i18n":{},"id":"86175481"},"86175694":{"name":"VerticalSlider","type":"material","file":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":89683130,"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":89683130,"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.196,"alphaFade":1,"opacity":1,"opacityMap":89683130,"opacityMapChannel":"a","opacityMapUv":1,"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},"preload":true,"tags":[],"i18n":{},"id":"86175694"},"86175751":{"name":"HorSLiderAlpha.png","type":"texture","file":{"filename":"HorSLiderAlpha.png","size":5765,"hash":"cff7df8f3c85cbf4ff996366b1b2d56f","variants":{},"url":"files/assets/86175751/1/HorSLiderAlpha.png"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"86175751"},"86181995":{"name":"Arrow.png","type":"texture","file":{"filename":"Arrow.png","size":10266,"hash":"23bb55b401eae5f168ea244fa7553f3b","variants":{},"url":"files/assets/86181995/1/Arrow.png"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"86181995"},"86182389":{"name":"SliderVisible.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"sliderVisible":{"attributesOrder":["SliderEntity","Interval"],"attributes":{"SliderEntity":{"type":"entity"},"Interval":{"type":"number","default":5}}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"86182389"},"86202215":{"name":"41_white bricks texture-seamless.jpg","type":"texture","file":{"filename":"41_white bricks texture-seamless.jpg","size":709349,"hash":"abb46f3dde4c7bce2c25d9e7fa55162b","variants":{},"url":"files/assets/86202215/1/41_white%20bricks%20texture-seamless.jpg"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"86202215"},"86761091":{"name":"FarshArLoadingScreen.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{},"loading":true,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"86761091"},"87530980":{"name":"LadyModel.png","type":"texture","file":{"filename":"LadyModel.png","size":253256,"hash":"092eaa9b86b478b92b00a779f17bbe9b","variants":{},"url":"files/assets/87530980/1/LadyModel.png"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"87530980"},"87532120":{"name":"Lady","type":"material","file":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":87530980,"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":87530980,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1.05,"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":87530980,"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},"preload":true,"tags":[],"i18n":{},"id":"87532120"},"89559195":{"name":"uiSlider.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"uiSlider":{"attributesOrder":["handle","axis","upperLimit","lowerLimit","val"],"attributes":{"handle":{"type":"entity","default":null,"title":"Handle"},"axis":{"type":"string","default":"y","title":"Axis","description":"lock drag to axis: x, y or xy"},"upperLimit":{"type":"entity","default":null,"title":"upperLimit"},"lowerLimit":{"type":"entity","default":null,"title":"lowerLimit"},"val":{"type":"number","default":0}}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"89559195"},"89683130":{"name":"VertSlider.png","type":"texture","file":{"filename":"VertSlider.png","size":5375,"hash":"2e2ba786621d705a5a3c67508d404eed","variants":{},"url":"files/assets/89683130/1/VertSlider.png"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":false},"preload":true,"tags":[],"i18n":{},"id":"89683130"},"89696259":{"name":"posteffect-fxaa.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"order":100,"scripts":{"fxaa":{"attributesOrder":[],"attributes":{}}},"loadingType":0,"loading":false},"preload":true,"tags":[],"i18n":{},"id":"89696259"},"89697541":{"name":"ceilingHeightController.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"ceilingHeightController":{"attributesOrder":["ceiling","sliderKnot","ceilText"],"attributes":{"ceiling":{"type":"entity","default":null,"title":"ceiling"},"sliderKnot":{"type":"entity","default":null,"title":"sliderKnot"},"ceilText":{"type":"entity","default":null,"title":"sliderKnot"}}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"89697541"},"89706577":{"name":"Debug.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"debug":{"attributesOrder":["sliderKnot"],"attributes":{"sliderKnot":{"type":"entity","default":null,"title":"sliderKnot"}}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"89706577"},"89717413":{"name":"roomWidthController.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"roomWidthController":{"attributesOrder":["room","sliderKnot","initialWidthScale","minWidth","maxWidth","UiWidthText"],"attributes":{"room":{"type":"entity","default":null,"title":"room"},"sliderKnot":{"type":"entity","default":null,"title":"sliderKnot"},"initialWidthScale":{"type":"number","default":0.5},"minWidth":{"type":"number","default":3.6},"maxWidth":{"type":"number","default":6},"UiWidthText":{"type":"entity","default":null,"title":"UiWidthText"}}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"89717413"},"91478011":{"name":"follow-world-target.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"followWorldTarget":{"attributesOrder":["target","camera"],"attributes":{"target":{"type":"entity"},"camera":{"type":"entity"}}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"91478011"},"91587903":{"name":"Resize.PNG","type":"texture","file":{"filename":"Resize.PNG","size":4397,"hash":"536b76cd95b9b06a21bae023e5fa92cc","variants":{},"url":"files/assets/91587903/1/Resize.PNG"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"91587903"},"91591081":{"name":"Blank.PNG","type":"texture","file":{"filename":"Blank.PNG","size":2919,"hash":"850c38d35e02e7595f34d029fdbcf1fd","variants":{},"url":"files/assets/91591081/1/Blank.PNG"},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"preload":true,"tags":[],"i18n":{},"id":"91591081"},"91600010":{"name":"WorkSans-VariableFont_wght.ttf","type":"font","file":{"filename":"WorkSans-VariableFont_wght.png","hash":"ce345ee42ef213c9877d413f3e0d8ebd","size":101738,"url":"files/assets/91600010/1/WorkSans-VariableFont_wght.png"},"data":{"version":2,"intensity":0,"info":{"face":"WorkSans-VariableFont_wght","maps":[{"width":1024,"height":512}]},"chars":{"32":{"id":32,"letter":" ","x":1,"y":1,"width":64,"height":64,"map":0,"xadvance":10.912,"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.704,"xoffset":27.648,"yoffset":21.6,"scale":1,"range":8,"bounds":[2.272,-0.32,6.432,21.12]},"34":{"id":34,"letter":"\"","x":133,"y":1,"width":64,"height":64,"map":0,"xadvance":12.896,"xoffset":25.264,"yoffset":13.872,"scale":1,"range":8,"bounds":[2.624,14.176,10.848,22.08]},"35":{"id":35,"letter":"#","x":199,"y":1,"width":64,"height":64,"map":0,"xadvance":20.448,"xoffset":21.776,"yoffset":21.44,"scale":1,"range":8,"bounds":[0.64,0,19.808,21.12]},"36":{"id":36,"letter":"$","x":265,"y":1,"width":64,"height":64,"map":0,"xadvance":19.904,"xoffset":22.304,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.344,-3.2,18.048,24.32]},"37":{"id":37,"letter":"%","x":331,"y":1,"width":64,"height":64,"map":0,"xadvance":27.392,"xoffset":18.304,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.28,-0.32,26.112,21.44]},"38":{"id":38,"letter":"&","x":397,"y":1,"width":64,"height":64,"map":0,"xadvance":19.936,"xoffset":21.2,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.536,-0.32,20.064,21.44]},"39":{"id":39,"letter":"'","x":463,"y":1,"width":64,"height":64,"map":0,"xadvance":7.488,"xoffset":27.968,"yoffset":13.872,"scale":1,"range":8,"bounds":[2.624,14.176,5.44,22.08]},"40":{"id":40,"letter":"(","x":529,"y":1,"width":64,"height":64,"map":0,"xadvance":11.2,"xoffset":25.888,"yoffset":23.008,"scale":1,"range":8,"bounds":[1.952,-6.048,10.272,24.032]},"41":{"id":41,"letter":")","x":595,"y":1,"width":64,"height":64,"map":0,"xadvance":11.2,"xoffset":26.912,"yoffset":23.008,"scale":1,"range":8,"bounds":[0.928,-6.048,9.248,24.032]},"42":{"id":42,"letter":"*","x":661,"y":1,"width":64,"height":64,"map":0,"xadvance":18.304,"xoffset":22.848,"yoffset":15.744,"scale":1,"range":8,"bounds":[1.696,9.152,16.608,23.36]},"43":{"id":43,"letter":"+","x":727,"y":1,"width":64,"height":64,"map":0,"xadvance":19.328,"xoffset":22.336,"yoffset":21.888,"scale":1,"range":8,"bounds":[1.888,2.176,17.44,18.048]},"44":{"id":44,"letter":",","x":793,"y":1,"width":64,"height":64,"map":0,"xadvance":8.512,"xoffset":27.76,"yoffset":32.416,"scale":1,"range":8,"bounds":[1.824,-4.672,6.656,3.84]},"45":{"id":45,"letter":"-","x":859,"y":1,"width":64,"height":64,"map":0,"xadvance":16.32,"xoffset":23.84,"yoffset":23.632,"scale":1,"range":8,"bounds":[2.88,7.04,13.44,9.696]},"46":{"id":46,"letter":".","x":925,"y":1,"width":64,"height":64,"map":0,"xadvance":8.512,"xoffset":27.744,"yoffset":30.24,"scale":1,"range":8,"bounds":[2.176,-0.32,6.336,3.84]},"47":{"id":47,"letter":"/","x":1,"y":67,"width":64,"height":64,"map":0,"xadvance":13.984,"xoffset":25.008,"yoffset":21.44,"scale":1,"range":8,"bounds":[0.896,-2.24,13.088,23.36]},"48":{"id":48,"letter":"0","x":67,"y":67,"width":64,"height":64,"map":0,"xadvance":19.904,"xoffset":22.048,"yoffset":21.44,"scale":1,"range":8,"bounds":[2.08,-0.32,17.824,21.44]},"49":{"id":49,"letter":"1","x":133,"y":67,"width":64,"height":64,"map":0,"xadvance":12.48,"xoffset":27.104,"yoffset":21.44,"scale":1,"range":8,"bounds":[0.576,0,9.216,21.12]},"50":{"id":50,"letter":"2","x":199,"y":67,"width":64,"height":64,"map":0,"xadvance":18.656,"xoffset":22.864,"yoffset":21.28,"scale":1,"range":8,"bounds":[1.696,0,16.576,21.44]},"51":{"id":51,"letter":"3","x":265,"y":67,"width":64,"height":64,"map":0,"xadvance":18.656,"xoffset":23.04,"yoffset":21.424,"scale":1,"range":8,"bounds":[1.376,-0.32,16.544,21.472]},"52":{"id":52,"letter":"4","x":331,"y":67,"width":64,"height":64,"map":0,"xadvance":19.552,"xoffset":22.288,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.408,0,18.016,21.12]},"53":{"id":53,"letter":"5","x":397,"y":67,"width":64,"height":64,"map":0,"xadvance":18.624,"xoffset":22.688,"yoffset":21.6,"scale":1,"range":8,"bounds":[2.016,-0.32,16.608,21.12]},"54":{"id":54,"letter":"6","x":463,"y":67,"width":64,"height":64,"map":0,"xadvance":19.456,"xoffset":22.208,"yoffset":21.44,"scale":1,"range":8,"bounds":[2.08,-0.32,17.504,21.44]},"55":{"id":55,"letter":"7","x":529,"y":67,"width":64,"height":64,"map":0,"xadvance":17.952,"xoffset":22.944,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.28,0,16.832,21.12]},"56":{"id":56,"letter":"8","x":595,"y":67,"width":64,"height":64,"map":0,"xadvance":19.712,"xoffset":22.144,"yoffset":21.456,"scale":1,"range":8,"bounds":[2.176,-0.32,17.536,21.408]},"57":{"id":57,"letter":"9","x":661,"y":67,"width":64,"height":64,"map":0,"xadvance":19.744,"xoffset":22.064,"yoffset":21.44,"scale":1,"range":8,"bounds":[2.208,-0.32,17.664,21.44]},"58":{"id":58,"letter":":","x":727,"y":67,"width":64,"height":64,"map":0,"xadvance":9.472,"xoffset":27.264,"yoffset":24,"scale":1,"range":8,"bounds":[2.656,-0.32,6.816,16.32]},"59":{"id":59,"letter":";","x":793,"y":67,"width":64,"height":64,"map":0,"xadvance":9.472,"xoffset":27.312,"yoffset":26.176,"scale":1,"range":8,"bounds":[2.272,-4.672,7.104,16.32]},"60":{"id":60,"letter":"<","x":859,"y":67,"width":64,"height":64,"map":0,"xadvance":19.328,"xoffset":22.112,"yoffset":22.416,"scale":1,"range":8,"bounds":[2.272,0.896,17.504,18.272]},"61":{"id":61,"letter":"=","x":925,"y":67,"width":64,"height":64,"map":0,"xadvance":19.328,"xoffset":22.336,"yoffset":22.288,"scale":1,"range":8,"bounds":[2.048,5.312,17.28,14.112]},"62":{"id":62,"letter":">","x":1,"y":133,"width":64,"height":64,"map":0,"xadvance":19.328,"xoffset":22.56,"yoffset":22.416,"scale":1,"range":8,"bounds":[1.824,0.896,17.056,18.272]},"63":{"id":63,"letter":"?","x":67,"y":133,"width":64,"height":64,"map":0,"xadvance":17.344,"xoffset":23.504,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.248,-0.32,15.744,21.44]},"64":{"id":64,"letter":"@","x":133,"y":133,"width":64,"height":64,"map":0,"xadvance":30.656,"xoffset":16.576,"yoffset":24.56,"scale":1,"range":8,"bounds":[2.112,-6.24,28.736,21.12]},"65":{"id":65,"letter":"A","x":199,"y":133,"width":64,"height":64,"map":0,"xadvance":21.12,"xoffset":21.44,"yoffset":21.44,"scale":1,"range":8,"bounds":[0.832,0,20.288,21.12]},"66":{"id":66,"letter":"B","x":265,"y":133,"width":64,"height":64,"map":0,"xadvance":20.896,"xoffset":20.912,"yoffset":21.44,"scale":1,"range":8,"bounds":[3.456,0,18.72,21.12]},"67":{"id":67,"letter":"C","x":331,"y":133,"width":64,"height":64,"map":0,"xadvance":21.952,"xoffset":20.672,"yoffset":21.44,"scale":1,"range":8,"bounds":[2.176,-0.32,20.48,21.44]},"68":{"id":68,"letter":"D","x":397,"y":133,"width":64,"height":64,"map":0,"xadvance":23.072,"xoffset":19.824,"yoffset":21.44,"scale":1,"range":8,"bounds":[3.456,0,20.896,21.12]},"69":{"id":69,"letter":"E","x":463,"y":133,"width":64,"height":64,"map":0,"xadvance":20.416,"xoffset":20.896,"yoffset":21.44,"scale":1,"range":8,"bounds":[3.456,0,18.752,21.12]},"70":{"id":70,"letter":"F","x":529,"y":133,"width":64,"height":64,"map":0,"xadvance":19.52,"xoffset":21.152,"yoffset":21.44,"scale":1,"range":8,"bounds":[3.456,0,18.24,21.12]},"71":{"id":71,"letter":"G","x":595,"y":133,"width":64,"height":64,"map":0,"xadvance":23.168,"xoffset":20.592,"yoffset":21.44,"scale":1,"range":8,"bounds":[2.176,-0.32,20.64,21.44]},"72":{"id":72,"letter":"H","x":661,"y":133,"width":64,"height":64,"map":0,"xadvance":23.488,"xoffset":20.256,"yoffset":21.44,"scale":1,"range":8,"bounds":[3.456,0,20.032,21.12]},"73":{"id":73,"letter":"I","x":727,"y":133,"width":64,"height":64,"map":0,"xadvance":9.472,"xoffset":27.264,"yoffset":21.44,"scale":1,"range":8,"bounds":[3.456,0,6.016,21.12]},"74":{"id":74,"letter":"J","x":793,"y":133,"width":64,"height":64,"map":0,"xadvance":18.112,"xoffset":23.8952258065,"yoffset":21.6,"scale":1,"range":8,"bounds":[1.3295483871,-0.32,14.88,21.12]},"75":{"id":75,"letter":"K","x":859,"y":133,"width":64,"height":64,"map":0,"xadvance":20.992,"xoffset":20.224,"yoffset":21.44,"scale":1,"range":8,"bounds":[3.456,0,20.096,21.12]},"76":{"id":76,"letter":"L","x":925,"y":133,"width":64,"height":64,"map":0,"xadvance":19.136,"xoffset":21.216,"yoffset":21.44,"scale":1,"range":8,"bounds":[3.456,0,18.112,21.12]},"77":{"id":77,"letter":"M","x":1,"y":199,"width":64,"height":64,"map":0,"xadvance":27.328,"xoffset":18.336,"yoffset":21.44,"scale":1,"range":8,"bounds":[3.456,0,23.872,21.12]},"78":{"id":78,"letter":"N","x":67,"y":199,"width":64,"height":64,"map":0,"xadvance":23.488,"xoffset":20.256,"yoffset":21.44,"scale":1,"range":8,"bounds":[3.456,0,20.032,21.12]},"79":{"id":79,"letter":"O","x":133,"y":199,"width":64,"height":64,"map":0,"xadvance":23.936,"xoffset":20.032,"yoffset":21.44,"scale":1,"range":8,"bounds":[2.176,-0.32,21.76,21.44]},"80":{"id":80,"letter":"P","x":199,"y":199,"width":64,"height":64,"map":0,"xadvance":19.52,"xoffset":21.264,"yoffset":21.44,"scale":1,"range":8,"bounds":[3.456,0,18.016,21.12]},"81":{"id":81,"letter":"Q","x":265,"y":199,"width":64,"height":64,"map":0,"xadvance":23.936,"xoffset":20.032,"yoffset":24.4,"scale":1,"range":8,"bounds":[2.176,-6.24,21.76,21.44]},"82":{"id":82,"letter":"R","x":331,"y":199,"width":64,"height":64,"map":0,"xadvance":21.28,"xoffset":20.336,"yoffset":21.44,"scale":1,"range":8,"bounds":[3.456,0,19.872,21.12]},"83":{"id":83,"letter":"S","x":397,"y":199,"width":64,"height":64,"map":0,"xadvance":20.512,"xoffset":22.016,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.376,-0.32,18.592,21.44]},"84":{"id":84,"letter":"T","x":463,"y":199,"width":64,"height":64,"map":0,"xadvance":19.328,"xoffset":22.336,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.024,0,18.304,21.12]},"85":{"id":85,"letter":"U","x":529,"y":199,"width":64,"height":64,"map":0,"xadvance":22.656,"xoffset":20.672,"yoffset":21.6,"scale":1,"range":8,"bounds":[3.04,-0.32,19.616,21.12]},"86":{"id":86,"letter":"V","x":595,"y":199,"width":64,"height":64,"map":0,"xadvance":20.736,"xoffset":21.632,"yoffset":21.44,"scale":1,"range":8,"bounds":[0.896,0,19.84,21.12]},"87":{"id":87,"letter":"W","x":661,"y":199,"width":64,"height":64,"map":0,"xadvance":30.752,"xoffset":16.624,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.152,0,29.6,21.12]},"88":{"id":88,"letter":"X","x":727,"y":199,"width":64,"height":64,"map":0,"xadvance":19.232,"xoffset":22.496,"yoffset":21.44,"scale":1,"range":8,"bounds":[0.8,0,18.208,21.12]},"89":{"id":89,"letter":"Y","x":793,"y":199,"width":64,"height":64,"map":0,"xadvance":18.304,"xoffset":22.848,"yoffset":21.44,"scale":1,"range":8,"bounds":[0.32,0,17.984,21.12]},"90":{"id":90,"letter":"Z","x":859,"y":199,"width":64,"height":64,"map":0,"xadvance":20.16,"xoffset":21.904,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.792,0,18.4,21.12]},"91":{"id":91,"letter":"[","x":925,"y":199,"width":64,"height":64,"map":0,"xadvance":11.136,"xoffset":25.568,"yoffset":23.008,"scale":1,"range":8,"bounds":[2.784,-5.376,10.08,23.36]},"92":{"id":92,"letter":"\\","x":1,"y":265,"width":64,"height":64,"map":0,"xadvance":13.984,"xoffset":25.008,"yoffset":21.44,"scale":1,"range":8,"bounds":[0.896,-2.24,13.088,23.36]},"93":{"id":93,"letter":"]","x":67,"y":265,"width":64,"height":64,"map":0,"xadvance":11.136,"xoffset":27.296,"yoffset":23.008,"scale":1,"range":8,"bounds":[1.056,-5.376,8.352,23.36]},"94":{"id":94,"letter":"^","x":133,"y":265,"width":64,"height":64,"map":0,"xadvance":17.92,"xoffset":23.04,"yoffset":14.64,"scale":1,"range":8,"bounds":[0.864,11.36,17.056,23.36]},"95":{"id":95,"letter":"_","x":199,"y":265,"width":64,"height":64,"map":0,"xadvance":17.248,"xoffset":23.376,"yoffset":36.304,"scale":1,"range":8,"bounds":[0,-5.504,17.248,-3.104]},"96":{"id":96,"letter":"`","x":265,"y":265,"width":64,"height":64,"map":0,"xadvance":16,"xoffset":23.984,"yoffset":10.672,"scale":1,"range":8,"bounds":[5.408,18.656,10.624,24]},"97":{"id":97,"letter":"a","x":331,"y":265,"width":64,"height":64,"map":0,"xadvance":18.112,"xoffset":22.384,"yoffset":24,"scale":1,"range":8,"bounds":[1.952,-0.32,17.28,16.32]},"98":{"id":98,"letter":"b","x":397,"y":265,"width":64,"height":64,"map":0,"xadvance":20.064,"xoffset":21.44,"yoffset":20.48,"scale":1,"range":8,"bounds":[2.976,-0.32,18.144,23.36]},"99":{"id":99,"letter":"c","x":463,"y":265,"width":64,"height":64,"map":0,"xadvance":17.92,"xoffset":22.88,"yoffset":24,"scale":1,"range":8,"bounds":[1.856,-0.32,16.384,16.32]},"100":{"id":100,"letter":"d","x":529,"y":265,"width":64,"height":64,"map":0,"xadvance":20.064,"xoffset":22.496,"yoffset":20.48,"scale":1,"range":8,"bounds":[1.92,-0.32,17.088,23.36]},"101":{"id":101,"letter":"e","x":595,"y":265,"width":64,"height":64,"map":0,"xadvance":18.464,"xoffset":22.784,"yoffset":24,"scale":1,"range":8,"bounds":[1.856,-0.32,16.576,16.32]},"102":{"id":102,"letter":"f","x":661,"y":265,"width":64,"height":64,"map":0,"xadvance":12.576,"xoffset":25.392,"yoffset":20.24,"scale":1,"range":8,"bounds":[1.024,0,12.192,23.52]},"103":{"id":103,"letter":"g","x":727,"y":265,"width":64,"height":64,"map":0,"xadvance":17.024,"xoffset":22.912,"yoffset":25.968,"scale":1,"range":8,"bounds":[1.152,-6.88,17.024,18.944]},"104":{"id":104,"letter":"h","x":793,"y":265,"width":64,"height":64,"map":0,"xadvance":19.808,"xoffset":22.016,"yoffset":20.32,"scale":1,"range":8,"bounds":[2.976,0,16.992,23.36]},"105":{"id":105,"letter":"i","x":859,"y":265,"width":64,"height":64,"map":0,"xadvance":8.512,"xoffset":27.744,"yoffset":20.544,"scale":1,"range":8,"bounds":[2.336,0,6.176,22.912]},"106":{"id":106,"letter":"j","x":925,"y":265,"width":64,"height":64,"map":0,"xadvance":8.512,"xoffset":30.176,"yoffset":23.984,"scale":1,"range":8,"bounds":[-2.528,-6.88,6.176,22.912]},"107":{"id":107,"letter":"k","x":1,"y":331,"width":64,"height":64,"map":0,"xadvance":18.144,"xoffset":21.808,"yoffset":20.32,"scale":1,"range":8,"bounds":[2.976,0,17.408,23.36]},"108":{"id":108,"letter":"l","x":67,"y":331,"width":64,"height":64,"map":0,"xadvance":9.792,"xoffset":25.84,"yoffset":20.48,"scale":1,"range":8,"bounds":[2.848,-0.32,9.472,23.36]},"109":{"id":109,"letter":"m","x":133,"y":331,"width":64,"height":64,"map":0,"xadvance":30.496,"xoffset":16.672,"yoffset":23.84,"scale":1,"range":8,"bounds":[2.976,0,27.68,16.32]},"110":{"id":110,"letter":"n","x":199,"y":331,"width":64,"height":64,"map":0,"xadvance":19.808,"xoffset":22.016,"yoffset":23.84,"scale":1,"range":8,"bounds":[2.976,0,16.992,16.32]},"111":{"id":111,"letter":"o","x":265,"y":331,"width":64,"height":64,"map":0,"xadvance":19.2,"xoffset":22.4,"yoffset":24,"scale":1,"range":8,"bounds":[1.856,-0.32,17.344,16.32]},"112":{"id":112,"letter":"p","x":331,"y":331,"width":64,"height":64,"map":0,"xadvance":20.064,"xoffset":21.44,"yoffset":27.2,"scale":1,"range":8,"bounds":[2.976,-6.72,18.144,16.32]},"113":{"id":113,"letter":"q","x":397,"y":331,"width":64,"height":64,"map":0,"xadvance":20.064,"xoffset":22.496,"yoffset":27.2,"scale":1,"range":8,"bounds":[1.92,-6.72,17.088,16.32]},"114":{"id":114,"letter":"r","x":463,"y":331,"width":64,"height":64,"map":0,"xadvance":13.056,"xoffset":24.368,"yoffset":23.84,"scale":1,"range":8,"bounds":[2.976,0,12.288,16.32]},"115":{"id":115,"letter":"s","x":529,"y":331,"width":64,"height":64,"map":0,"xadvance":16.864,"xoffset":23.744,"yoffset":24,"scale":1,"range":8,"bounds":[1.408,-0.32,15.104,16.32]},"116":{"id":116,"letter":"t","x":595,"y":331,"width":64,"height":64,"map":0,"xadvance":13.408,"xoffset":25.072,"yoffset":21.888,"scale":1,"range":8,"bounds":[0.992,-0.32,12.864,20.544]},"117":{"id":117,"letter":"u","x":661,"y":331,"width":64,"height":64,"map":0,"xadvance":19.744,"xoffset":22.208,"yoffset":24.16,"scale":1,"range":8,"bounds":[2.816,-0.32,16.768,16]},"118":{"id":118,"letter":"v","x":727,"y":331,"width":64,"height":64,"map":0,"xadvance":16.64,"xoffset":23.68,"yoffset":24,"scale":1,"range":8,"bounds":[0.384,0,16.256,16]},"119":{"id":119,"letter":"w","x":793,"y":331,"width":64,"height":64,"map":0,"xadvance":26.752,"xoffset":18.624,"yoffset":24,"scale":1,"range":8,"bounds":[0.864,0,25.888,16]},"120":{"id":120,"letter":"x","x":859,"y":331,"width":64,"height":64,"map":0,"xadvance":17.056,"xoffset":23.536,"yoffset":24,"scale":1,"range":8,"bounds":[0.928,0,16,16]},"121":{"id":121,"letter":"y","x":925,"y":331,"width":64,"height":64,"map":0,"xadvance":16.512,"xoffset":23.92,"yoffset":27.44,"scale":1,"range":8,"bounds":[0.032,-6.88,16.128,16]},"122":{"id":122,"letter":"z","x":1,"y":397,"width":64,"height":64,"map":0,"xadvance":17.088,"xoffset":23.424,"yoffset":24,"scale":1,"range":8,"bounds":[1.824,0,15.328,16]},"123":{"id":123,"letter":"{","x":67,"y":397,"width":64,"height":64,"map":0,"xadvance":11.232,"xoffset":26.688,"yoffset":23.008,"scale":1,"range":8,"bounds":[0.896,-6.048,9.728,24.032]},"124":{"id":124,"letter":"|","x":133,"y":397,"width":64,"height":64,"map":0,"xadvance":7.776,"xoffset":28.112,"yoffset":23.008,"scale":1,"range":8,"bounds":[2.784,-5.376,4.992,23.36]},"125":{"id":125,"letter":"}","x":199,"y":397,"width":64,"height":64,"map":0,"xadvance":11.232,"xoffset":26.08,"yoffset":23.008,"scale":1,"range":8,"bounds":[1.504,-6.048,10.336,24.032]},"126":{"id":126,"letter":"~","x":265,"y":397,"width":64,"height":64,"map":0,"xadvance":17.28,"xoffset":23.36,"yoffset":22.096,"scale":1,"range":8,"bounds":[1.376,7.52,15.904,12.288]}},"kerning":{}},"preload":true,"tags":[],"i18n":{},"id":"91600010"},"91600011":{"name":"WorkSans-Italic-VariableFont_wght.ttf","type":"font","file":{"filename":"WorkSans-Italic-VariableFont_wght.png","hash":"7e8137f53c71367bd6a806c48cda57ea","size":129251,"url":"files/assets/91600011/1/WorkSans-Italic-VariableFont_wght.png"},"data":{"version":2,"intensity":0,"info":{"face":"WorkSans-Italic-VariableFont_wght","maps":[{"width":1024,"height":512}]},"chars":{"32":{"id":32,"letter":" ","x":1,"y":1,"width":64,"height":64,"map":0,"xadvance":10.752,"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.576,"xoffset":27.296,"yoffset":21.6,"scale":1,"range":8,"bounds":[0.832,-0.32,8.576,21.12]},"34":{"id":34,"letter":"\"","x":133,"y":1,"width":64,"height":64,"map":0,"xadvance":12.736,"xoffset":22.992,"yoffset":13.872,"scale":1,"range":8,"bounds":[3.968,14.176,14.048,22.08]},"35":{"id":35,"letter":"#","x":199,"y":1,"width":64,"height":64,"map":0,"xadvance":20.448,"xoffset":21.184,"yoffset":21.44,"scale":1,"range":8,"bounds":[0.864,0,20.768,21.12]},"36":{"id":36,"letter":"$","x":265,"y":1,"width":64,"height":64,"map":0,"xadvance":19.84,"xoffset":21.824,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.024,-3.2,19.328,24.32]},"37":{"id":37,"letter":"%","x":331,"y":1,"width":64,"height":64,"map":0,"xadvance":28.416,"xoffset":17.2,"yoffset":21.44,"scale":1,"range":8,"bounds":[2.944,-0.32,26.656,21.44]},"38":{"id":38,"letter":"&","x":397,"y":1,"width":64,"height":64,"map":0,"xadvance":19.392,"xoffset":22.528,"yoffset":21.44,"scale":1,"range":8,"bounds":[0.704,-0.352,18.24,21.472]},"39":{"id":39,"letter":"'","x":463,"y":1,"width":64,"height":64,"map":0,"xadvance":7.392,"xoffset":25.664,"yoffset":13.872,"scale":1,"range":8,"bounds":[3.968,14.176,8.704,22.08]},"40":{"id":40,"letter":"(","x":529,"y":1,"width":64,"height":64,"map":0,"xadvance":10.944,"xoffset":24.368,"yoffset":23.008,"scale":1,"range":8,"bounds":[1.92,-6.048,13.344,24.032]},"41":{"id":41,"letter":")","x":595,"y":1,"width":64,"height":64,"map":0,"xadvance":10.944,"xoffset":28.24,"yoffset":23.008,"scale":1,"range":8,"bounds":[-1.952,-6.048,9.472,24.032]},"42":{"id":42,"letter":"*","x":661,"y":1,"width":64,"height":64,"map":0,"xadvance":18.048,"xoffset":20.848,"yoffset":15.888,"scale":1,"range":8,"bounds":[3.872,8.864,18.432,23.36]},"43":{"id":43,"letter":"+","x":727,"y":1,"width":64,"height":64,"map":0,"xadvance":19.328,"xoffset":21.84,"yoffset":21.888,"scale":1,"range":8,"bounds":[2.112,2.176,18.208,18.048]},"44":{"id":44,"letter":",","x":793,"y":1,"width":64,"height":64,"map":0,"xadvance":8.064,"xoffset":29.92,"yoffset":32.464,"scale":1,"range":8,"bounds":[-0.96,-4.768,5.12,3.84]},"45":{"id":45,"letter":"-","x":859,"y":1,"width":64,"height":64,"map":0,"xadvance":16.32,"xoffset":23.76,"yoffset":23.632,"scale":1,"range":8,"bounds":[2.656,7.04,13.824,9.696]},"46":{"id":46,"letter":".","x":925,"y":1,"width":64,"height":64,"map":0,"xadvance":8.384,"xoffset":29.248,"yoffset":30.24,"scale":1,"range":8,"bounds":[0.736,-0.32,4.768,3.84]},"47":{"id":47,"letter":"/","x":1,"y":67,"width":64,"height":64,"map":0,"xadvance":13.44,"xoffset":24.688,"yoffset":21.44,"scale":1,"range":8,"bounds":[-1.536,-2.24,16.16,23.36]},"48":{"id":48,"letter":"0","x":67,"y":67,"width":64,"height":64,"map":0,"xadvance":20.128,"xoffset":21.344,"yoffset":21.408,"scale":1,"range":8,"bounds":[2.4,-0.256,18.912,21.44]},"49":{"id":49,"letter":"1","x":133,"y":67,"width":64,"height":64,"map":0,"xadvance":12.224,"xoffset":24.944,"yoffset":21.44,"scale":1,"range":8,"bounds":[2.432,0,11.68,21.12]},"50":{"id":50,"letter":"2","x":199,"y":67,"width":64,"height":64,"map":0,"xadvance":18.08,"xoffset":23.152,"yoffset":21.28,"scale":1,"range":8,"bounds":[0.8,0,16.896,21.44]},"51":{"id":51,"letter":"3","x":265,"y":67,"width":64,"height":64,"map":0,"xadvance":18.048,"xoffset":22.8,"yoffset":21.424,"scale":1,"range":8,"bounds":[1.344,-0.32,17.056,21.472]},"52":{"id":52,"letter":"4","x":331,"y":67,"width":64,"height":64,"map":0,"xadvance":18.08,"xoffset":23.184,"yoffset":21.44,"scale":1,"range":8,"bounds":[0.512,0,17.12,21.12]},"53":{"id":53,"letter":"5","x":397,"y":67,"width":64,"height":64,"map":0,"xadvance":18.272,"xoffset":22.24,"yoffset":21.6,"scale":1,"range":8,"bounds":[1.664,-0.32,17.856,21.12]},"54":{"id":54,"letter":"6","x":463,"y":67,"width":64,"height":64,"map":0,"xadvance":18.848,"xoffset":21.392,"yoffset":21.424,"scale":1,"range":8,"bounds":[2.464,-0.32,18.752,21.472]},"55":{"id":55,"letter":"7","x":529,"y":67,"width":64,"height":64,"map":0,"xadvance":17.216,"xoffset":20.912,"yoffset":21.44,"scale":1,"range":8,"bounds":[3.328,0,18.848,21.12]},"56":{"id":56,"letter":"8","x":595,"y":67,"width":64,"height":64,"map":0,"xadvance":19.392,"xoffset":22.032,"yoffset":21.408,"scale":1,"range":8,"bounds":[1.536,-0.288,18.4,21.472]},"57":{"id":57,"letter":"9","x":661,"y":67,"width":64,"height":64,"map":0,"xadvance":19.488,"xoffset":22.16,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.472,-0.32,18.208,21.44]},"58":{"id":58,"letter":":","x":727,"y":67,"width":64,"height":64,"map":0,"xadvance":9.472,"xoffset":27.264,"yoffset":24,"scale":1,"range":8,"bounds":[1.28,-0.32,8.192,16.32]},"59":{"id":59,"letter":";","x":793,"y":67,"width":64,"height":64,"map":0,"xadvance":9.472,"xoffset":28.16,"yoffset":26.224,"scale":1,"range":8,"bounds":[-0.512,-4.768,8.192,16.32]},"60":{"id":60,"letter":"<","x":859,"y":67,"width":64,"height":64,"map":0,"xadvance":19.328,"xoffset":20.912,"yoffset":22.416,"scale":1,"range":8,"bounds":[2.304,0.896,19.872,18.272]},"61":{"id":61,"letter":"=","x":925,"y":67,"width":64,"height":64,"map":0,"xadvance":19.328,"xoffset":21.936,"yoffset":22.288,"scale":1,"range":8,"bounds":[1.44,5.312,18.688,14.112]},"62":{"id":62,"letter":">","x":1,"y":133,"width":64,"height":64,"map":0,"xadvance":19.328,"xoffset":23.024,"yoffset":22.416,"scale":1,"range":8,"bounds":[0.192,0.896,17.76,18.272]},"63":{"id":63,"letter":"?","x":67,"y":133,"width":64,"height":64,"map":0,"xadvance":17.152,"xoffset":21.888,"yoffset":21.472,"scale":1,"range":8,"bounds":[2.976,-0.32,17.248,21.376]},"64":{"id":64,"letter":"@","x":133,"y":133,"width":64,"height":64,"map":0,"xadvance":30.4,"xoffset":16.656,"yoffset":24.576,"scale":1,"range":8,"bounds":[2.112,-6.272,28.576,21.12]},"65":{"id":65,"letter":"A","x":199,"y":133,"width":64,"height":64,"map":0,"xadvance":20.576,"xoffset":23.568,"yoffset":21.44,"scale":1,"range":8,"bounds":[-1.12,0,17.984,21.12]},"66":{"id":66,"letter":"B","x":265,"y":133,"width":64,"height":64,"map":0,"xadvance":20.64,"xoffset":21.488,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.504,0,19.52,21.12]},"67":{"id":67,"letter":"C","x":331,"y":133,"width":64,"height":64,"map":0,"xadvance":21.568,"xoffset":19.984,"yoffset":21.44,"scale":1,"range":8,"bounds":[2.656,-0.32,21.376,21.44]},"68":{"id":68,"letter":"D","x":397,"y":133,"width":64,"height":64,"map":0,"xadvance":22.592,"xoffset":20.672,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.504,0,21.152,21.12]},"69":{"id":69,"letter":"E","x":463,"y":133,"width":64,"height":64,"map":0,"xadvance":20,"xoffset":20.8,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.504,0,20.896,21.12]},"70":{"id":70,"letter":"F","x":529,"y":133,"width":64,"height":64,"map":0,"xadvance":18.72,"xoffset":21.024,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.504,0,20.448,21.12]},"71":{"id":71,"letter":"G","x":595,"y":133,"width":64,"height":64,"map":0,"xadvance":22.624,"xoffset":19.696,"yoffset":21.408,"scale":1,"range":8,"bounds":[2.688,-0.256,21.92,21.44]},"72":{"id":72,"letter":"H","x":661,"y":133,"width":64,"height":64,"map":0,"xadvance":23.008,"xoffset":19.904,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.504,0,22.688,21.12]},"73":{"id":73,"letter":"I","x":727,"y":133,"width":64,"height":64,"map":0,"xadvance":9.28,"xoffset":26.768,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.504,0,8.96,21.12]},"74":{"id":74,"letter":"J","x":793,"y":133,"width":64,"height":64,"map":0,"xadvance":17.568,"xoffset":22.6996363636,"yoffset":21.568,"scale":1,"range":8,"bounds":[1.00072727273,-0.256,17.6,21.12]},"75":{"id":75,"letter":"K","x":859,"y":133,"width":64,"height":64,"map":0,"xadvance":20.384,"xoffset":20.032,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.504,0,22.432,21.12]},"76":{"id":76,"letter":"L","x":925,"y":133,"width":64,"height":64,"map":0,"xadvance":18.752,"xoffset":23.008,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.504,0,16.48,21.12]},"77":{"id":77,"letter":"M","x":1,"y":199,"width":64,"height":64,"map":0,"xadvance":26.784,"xoffset":18.016,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.504,0,26.464,21.12]},"78":{"id":78,"letter":"N","x":67,"y":199,"width":64,"height":64,"map":0,"xadvance":23.008,"xoffset":19.904,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.504,0,22.688,21.12]},"79":{"id":79,"letter":"O","x":133,"y":199,"width":64,"height":64,"map":0,"xadvance":23.744,"xoffset":19.536,"yoffset":21.44,"scale":1,"range":8,"bounds":[2.72,-0.32,22.208,21.44]},"80":{"id":80,"letter":"P","x":199,"y":199,"width":64,"height":64,"map":0,"xadvance":19.52,"xoffset":21.584,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.504,0,19.328,21.12]},"81":{"id":81,"letter":"Q","x":265,"y":199,"width":64,"height":64,"map":0,"xadvance":23.744,"xoffset":19.536,"yoffset":24.384,"scale":1,"range":8,"bounds":[2.72,-6.208,22.208,21.44]},"82":{"id":82,"letter":"R","x":331,"y":199,"width":64,"height":64,"map":0,"xadvance":20.384,"xoffset":21.488,"yoffset":21.44,"scale":1,"range":8,"bounds":[1.504,0,19.52,21.12]},"83":{"id":83,"letter":"S","x":397,"y":199,"width":64,"height":64,"map":0,"xadvance":20.448,"xoffset":21.328,"yoffset":21.392,"scale":1,"range":8,"bounds":[1.248,-0.256,20.096,21.472]},"84":{"id":84,"letter":"T","x":463,"y":199,"width":64,"height":64,"map":0,"xadvance":18.944,"xoffset":19.776,"yoffset":21.44,"scale":1,"range":8,"bounds":[3.456,0,20.992,21.12]},"85":{"id":85,"letter":"U","x":529,"y":199,"width":64,"height":64,"map":0,"xadvance":22.176,"xoffset":19.448,"yoffset":21.6,"scale":1,"range":8,"bounds":[2.832,-0.32,22.272,21.12]},"86":{"id":86,"letter":"V","x":595,"y":199,"width":64,"height":64,"map":0,"xadvance":20.096,"xoffset":18.912,"yoffset":21.44,"scale":1,"range":8,"bounds":[3.776,0,22.4,21.12]},"87":{"id":87,"letter":"W","x":661,"y":199,"width":64,"height":64,"map":0,"xadvance":30.048,"xoffset":13.936,"yoffset":21.44,"scale":1,"range":8,"bounds":[4.096,0,32.032,21.12]},"88":{"id":88,"letter":"X","x":727,"y":199,"width":64,"height":64,"map":0,"xadvance":18.816,"xoffset":22.224,"yoffset":21.44,"scale":1,"range":8,"bounds":[-1.088,0,20.64,21.12]},"89":{"id":89,"letter":"Y","x":793,"y":199,"width":64,"height":64,"map":0,"xadvance":17.984,"xoffset":19.968,"yoffset":21.44,"scale":1,"range":8,"bounds":[3.52,0,20.544,21.12]},"90":{"id":90,"letter":"Z","x":859,"y":199,"width":64,"height":64,"map":0,"xadvance":18.912,"xoffset":22.08,"yoffset":21.44,"scale":1,"range":8,"bounds":[-0.096,0,19.936,21.12]},"91":{"id":91,"letter":"[","x":925,"y":199,"width":64,"height":64,"map":0,"xadvance":11.008,"xoffset":25.408,"yoffset":23.008,"scale":1,"range":8,"bounds":[-0.384,-5.376,13.568,23.36]},"92":{"id":92,"letter":"\\","x":1,"y":265,"width":64,"height":64,"map":0,"xadvance":15.008,"xoffset":23.904,"yoffset":21.44,"scale":1,"range":8,"bounds":[4.384,-2.24,11.808,23.36]},"93":{"id":93,"letter":"]","x":67,"y":265,"width":64,"height":64,"map":0,"xadvance":11.04,"xoffset":27.104,"yoffset":23.008,"scale":1,"range":8,"bounds":[-2.08,-5.376,11.872,23.36]},"94":{"id":94,"letter":"^","x":133,"y":265,"width":64,"height":64,"map":0,"xadvance":17.92,"xoffset":22.272,"yoffset":14.64,"scale":1,"range":8,"bounds":[1.632,11.36,17.824,23.36]},"95":{"id":95,"letter":"_","x":199,"y":265,"width":64,"height":64,"map":0,"xadvance":17.248,"xoffset":26.208,"yoffset":36.304,"scale":1,"range":8,"bounds":[-3.104,-5.504,14.688,-3.104]},"96":{"id":96,"letter":"`","x":265,"y":265,"width":64,"height":64,"map":0,"xadvance":16,"xoffset":20.912,"yoffset":10.672,"scale":1,"range":8,"bounds":[9.088,18.656,13.088,24]},"97":{"id":97,"letter":"a","x":331,"y":265,"width":64,"height":64,"map":0,"xadvance":19.712,"xoffset":21.76,"yoffset":23.968,"scale":1,"range":8,"bounds":[1.76,-0.256,18.72,16.32]},"98":{"id":98,"letter":"b","x":397,"y":265,"width":64,"height":64,"map":0,"xadvance":19.712,"xoffset":22.528,"yoffset":20.48,"scale":1,"range":8,"bounds":[0.992,-0.32,17.952,23.36]},"99":{"id":99,"letter":"c","x":463,"y":265,"width":64,"height":64,"map":0,"xadvance":17.216,"xoffset":22.72,"yoffset":24,"scale":1,"range":8,"bounds":[1.824,-0.288,16.736,16.288]},"100":{"id":100,"letter":"d","x":529,"y":265,"width":64,"height":64,"map":0,"xadvance":19.712,"xoffset":20.912,"yoffset":20.448,"scale":1,"range":8,"bounds":[1.76,-0.256,20.416,23.36]},"101":{"id":101,"letter":"e","x":595,"y":265,"width":64,"height":64,"map":0,"xadvance":18.304,"xoffset":22.848,"yoffset":24,"scale":1,"range":8,"bounds":[1.792,-0.288,16.512,16.288]},"102":{"id":102,"letter":"f","x":661,"y":265,"width":64,"height":64,"map":0,"xadvance":12.32,"xoffset":23.408,"yoffset":20.24,"scale":1,"range":8,"bounds":[2.176,0,15.008,23.52]},"103":{"id":103,"letter":"g","x":727,"y":265,"width":64,"height":64,"map":0,"xadvance":19.616,"xoffset":22.784,"yoffset":27.28,"scale":1,"range":8,"bounds":[-0.192,-6.88,18.624,16.32]},"104":{"id":104,"letter":"h","x":793,"y":265,"width":64,"height":64,"map":0,"xadvance":19.2,"xoffset":22.8955,"yoffset":20.32,"scale":1,"range":8,"bounds":[0.992,0,17.217,23.36]},"105":{"id":105,"letter":"i","x":859,"y":265,"width":64,"height":64,"map":0,"xadvance":8.256,"xoffset":27.008,"yoffset":20.544,"scale":1,"range":8,"bounds":[0.992,0,8.992,22.912]},"106":{"id":106,"letter":"j","x":925,"y":265,"width":64,"height":64,"map":0,"xadvance":8.256,"xoffset":30.048,"yoffset":23.984,"scale":1,"range":8,"bounds":[-5.088,-6.88,8.992,22.912]},"107":{"id":107,"letter":"k","x":1,"y":331,"width":64,"height":64,"map":0,"xadvance":17.44,"xoffset":22.416,"yoffset":20.32,"scale":1,"range":8,"bounds":[0.992,0,18.176,23.36]},"108":{"id":108,"letter":"l","x":67,"y":331,"width":64,"height":64,"map":0,"xadvance":9.696,"xoffset":26.687255814,"yoffset":20.432,"scale":1,"range":8,"bounds":[1.76148837209,-0.224,8.864,23.36]},"109":{"id":109,"letter":"m","x":133,"y":331,"width":64,"height":64,"map":0,"xadvance":29.888,"xoffset":17.632,"yoffset":23.84,"scale":1,"range":8,"bounds":[0.992,0,27.744,16.32]},"110":{"id":110,"letter":"n","x":199,"y":331,"width":64,"height":64,"map":0,"xadvance":19.2,"xoffset":22.8955,"yoffset":23.84,"scale":1,"range":8,"bounds":[0.992,0,17.217,16.32]},"111":{"id":111,"letter":"o","x":265,"y":331,"width":64,"height":64,"map":0,"xadvance":19.04,"xoffset":22.48,"yoffset":24,"scale":1,"range":8,"bounds":[1.792,-0.288,17.248,16.288]},"112":{"id":112,"letter":"p","x":331,"y":331,"width":64,"height":64,"map":0,"xadvance":19.712,"xoffset":23.296,"yoffset":27.232,"scale":1,"range":8,"bounds":[-0.544,-6.72,17.952,16.256]},"113":{"id":113,"letter":"q","x":397,"y":331,"width":64,"height":64,"map":0,"xadvance":19.712,"xoffset":21.76,"yoffset":27.2,"scale":1,"range":8,"bounds":[1.76,-6.72,18.72,16.32]},"114":{"id":114,"letter":"r","x":463,"y":331,"width":64,"height":64,"map":0,"xadvance":12.416,"xoffset":24.816,"yoffset":23.84,"scale":1,"range":8,"bounds":[0.992,0,13.376,16.32]},"115":{"id":115,"letter":"s","x":529,"y":331,"width":64,"height":64,"map":0,"xadvance":16.384,"xoffset":23.984,"yoffset":24.016,"scale":1,"range":8,"bounds":[0.608,-0.352,15.424,16.32]},"116":{"id":116,"letter":"t","x":595,"y":331,"width":64,"height":64,"map":0,"xadvance":12.864,"xoffset":24.288,"yoffset":21.968,"scale":1,"range":8,"bounds":[2.08,-0.256,13.344,20.32]},"117":{"id":117,"letter":"u","x":661,"y":331,"width":64,"height":64,"map":0,"xadvance":19.136,"xoffset":21.9330909091,"yoffset":24.128,"scale":1,"range":8,"bounds":[1.98981818182,-0.256,18.144,16]},"118":{"id":118,"letter":"v","x":727,"y":331,"width":64,"height":64,"map":0,"xadvance":15.776,"xoffset":22.256,"yoffset":24,"scale":1,"range":8,"bounds":[2.048,0,17.44,16]},"119":{"id":119,"letter":"w","x":793,"y":331,"width":64,"height":64,"map":0,"xadvance":25.696,"xoffset":17.44,"yoffset":24,"scale":1,"range":8,"bounds":[2.432,0,26.688,16]},"120":{"id":120,"letter":"x","x":859,"y":331,"width":64,"height":64,"map":0,"xadvance":16.608,"xoffset":23.904,"yoffset":24,"scale":1,"range":8,"bounds":[-0.992,0,17.184,16]},"121":{"id":121,"letter":"y","x":925,"y":331,"width":64,"height":64,"map":0,"xadvance":16.128,"xoffset":24.688,"yoffset":27.44,"scale":1,"range":8,"bounds":[-3.168,-6.88,17.792,16]},"122":{"id":122,"letter":"z","x":1,"y":397,"width":64,"height":64,"map":0,"xadvance":16.416,"xoffset":23.84,"yoffset":24,"scale":1,"range":8,"bounds":[0.032,0,16.288,16]},"123":{"id":123,"letter":"{","x":67,"y":397,"width":64,"height":64,"map":0,"xadvance":10.656,"xoffset":25.152,"yoffset":23.008,"scale":1,"range":8,"bounds":[0.8,-6.048,12.896,24.032]},"124":{"id":124,"letter":"|","x":133,"y":397,"width":64,"height":64,"map":0,"xadvance":7.648,"xoffset":27.952,"yoffset":23.008,"scale":1,"range":8,"bounds":[-0.384,-5.376,8.48,23.36]},"125":{"id":125,"letter":"}","x":199,"y":397,"width":64,"height":64,"map":0,"xadvance":10.656,"xoffset":27.744,"yoffset":23.008,"scale":1,"range":8,"bounds":[-1.792,-6.048,10.304,24.032]},"126":{"id":126,"letter":"~","x":265,"y":397,"width":64,"height":64,"map":0,"xadvance":17.28,"xoffset":22.912,"yoffset":22.096,"scale":1,"range":8,"bounds":[1.28,7.52,16.896,12.288]}},"kerning":{}},"preload":true,"tags":[],"i18n":{},"id":"91600011"},"91628463":{"name":"showResizeOptions.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"showResizeOptions":{"attributesOrder":["VertSlider","HorSlider","HeightShow","WidthShow","ModelScaleSlider","Toggle"],"attributes":{"VertSlider":{"type":"entity","description":"The entity that we want to update when the button is clicked"},"HorSlider":{"type":"entity","description":"The entity that we want to update when the button is clicked"},"HeightShow":{"type":"entity","description":"The entity that we want to update when the button is clicked"},"WidthShow":{"type":"entity","description":"The entity that we want to update when the button is clicked"},"ModelScaleSlider":{"type":"entity","description":"The entity that we want to update when the button is clicked"},"Toggle":{"type":"number","description":"The entity that we want to update when the button is clicked"}}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"91628463"},"92380612":{"name":"Heli.blend","type":"binary","file":{"filename":"Heli.blend","size":523024,"hash":"62e29d8bc19c3228f27d9634576a8b79","url":"files/assets/92380612/1/Heli.blend"},"data":null,"preload":true,"tags":[],"i18n":{},"id":"92380612"},"92663277":{"name":"unscaleFromParents.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"unscaleFromParents":{"attributesOrder":["parent","invertZandY","targetValueX","targetValueY","targetValueZ"],"attributes":{"parent":{"type":"entity","default":null,"title":"parent"},"invertZandY":{"type":"boolean"},"targetValueX":{"type":"number"},"targetValueY":{"type":"number"},"targetValueZ":{"type":"number"}}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"92663277"},"92668910":{"name":"MatchTargetScale.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"matchTargetScale":{"attributesOrder":["target","matchX","matchY","matchZ"],"attributes":{"target":{"type":"entity"},"matchX":{"type":"boolean"},"matchY":{"type":"boolean"},"matchZ":{"type":"boolean"}}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"92668910"},"92676263":{"name":"mantainDistanceWithTargetScale.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"mantainDistanceWithTargetScale":{"attributesOrder":["target","defaultDistZ","defaultDistX","adjustZ","adjustX"],"attributes":{"target":{"type":"entity"},"defaultDistZ":{"type":"number"},"defaultDistX":{"type":"number"},"adjustZ":{"type":"boolean"},"adjustX":{"type":"boolean"}}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"92676263"},"93407776":{"name":"moveUpWithScale.js","type":"script","file":{"filename":"__game-scripts.js","size":41189,"hash":"b25ae5b36eea15486df2ec7ca73e9a7d","url":"__game-scripts.js"},"data":{"scripts":{"moveUpwithScale":{"attributesOrder":["target"],"attributes":{"target":{"type":"entity"}}}},"loading":false,"loadingType":0},"preload":true,"tags":[],"i18n":{},"id":"93407776"}}} \ No newline at end of file diff --git a/files/assets/86173568/1/SliderKnot.png b/files/assets/86173568/1/SliderKnot.png index 24fabe8..57c62de 100644 Binary files a/files/assets/86173568/1/SliderKnot.png and b/files/assets/86173568/1/SliderKnot.png differ diff --git a/files/assets/86174925/1/HorAlpha.png b/files/assets/86174925/1/HorAlpha.png index 303e393..601ff52 100644 Binary files a/files/assets/86174925/1/HorAlpha.png and b/files/assets/86174925/1/HorAlpha.png differ diff --git a/files/assets/87530980/1/LadyModel.png b/files/assets/87530980/1/LadyModel.png new file mode 100644 index 0000000..d88dd5f Binary files /dev/null and b/files/assets/87530980/1/LadyModel.png differ diff --git a/files/assets/89683130/1/VertSlider.png b/files/assets/89683130/1/VertSlider.png new file mode 100644 index 0000000..0a3a43a Binary files /dev/null and b/files/assets/89683130/1/VertSlider.png differ diff --git a/files/assets/91587903/1/Resize.PNG b/files/assets/91587903/1/Resize.PNG new file mode 100644 index 0000000..bb5eade Binary files /dev/null and b/files/assets/91587903/1/Resize.PNG differ diff --git a/files/assets/91591081/1/Blank.PNG b/files/assets/91591081/1/Blank.PNG new file mode 100644 index 0000000..eeac84d Binary files /dev/null and b/files/assets/91591081/1/Blank.PNG differ diff --git a/files/assets/91600010/1/WorkSans-VariableFont_wght.png b/files/assets/91600010/1/WorkSans-VariableFont_wght.png new file mode 100644 index 0000000..d9f9e61 Binary files /dev/null and b/files/assets/91600010/1/WorkSans-VariableFont_wght.png differ diff --git a/files/assets/91600011/1/WorkSans-Italic-VariableFont_wght.png b/files/assets/91600011/1/WorkSans-Italic-VariableFont_wght.png new file mode 100644 index 0000000..5f4496c Binary files /dev/null and b/files/assets/91600011/1/WorkSans-Italic-VariableFont_wght.png differ diff --git a/files/assets/92380612/1/Heli.blend b/files/assets/92380612/1/Heli.blend new file mode 100644 index 0000000..fc7b1f8 Binary files /dev/null and b/files/assets/92380612/1/Heli.blend differ diff --git a/playcanvas-stable.min.js b/playcanvas-stable.min.js index f7d2f5e..787440a 100644 --- a/playcanvas-stable.min.js +++ b/playcanvas-stable.min.js @@ -1,6 +1,6 @@ /** * @license - * PlayCanvas Engine v1.53.4 revision 25b117788 + * PlayCanvas Engine v1.54.1 revision 999c376eb * 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";function e(t,e,i){t.prototype[e]||Object.defineProperty(t.prototype,e,{value:i,configurable:!0,enumerable:!1,writable:!0})}e(Array,"fill",(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})),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>>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){var i=e>0?0|e:0;return this.substring(i,i+t.length)===t})),e(String,"trimEnd",(function(){return this.replace(new RegExp(/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/.source+"$","g"),"")}));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 G(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 W={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}j(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;i1?i-1:0),s=1;s1?n-1:0),a=1;a=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)*ot.clamp(i,0,1)},lerpAngle:function(t,e,i){return e-t>180&&(e-=360),e-t<-180&&(e+=360),ot.lerp(t,e,ot.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,t.ContentType.OPUS].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=ot.intToBytes32(i):(e=ot.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}();ct.BLACK=Object.freeze(new ct(0,0,0,1)),ct.BLUE=Object.freeze(new ct(0,0,1,1)),ct.CYAN=Object.freeze(new ct(0,1,1,1)),ct.GRAY=Object.freeze(new ct(.5,.5,.5,1)),ct.GREEN=Object.freeze(new ct(0,1,0,1)),ct.MAGENTA=Object.freeze(new ct(1,0,1,1)),ct.RED=Object.freeze(new ct(1,0,0,1)),ct.WHITE=Object.freeze(new ct(1,1,1,1)),ct.YELLOW=Object.freeze(new ct(1,1,0,1));var ut=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?ot.lerp(this._p0,this._p1,s):1===n?ot.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}(),dt=function(){function t(t){if(this.keys=[],this.type=1,this.tension=.5,this._eval=new ut(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}();pt.ZERO=Object.freeze(new pt(0,0,0)),pt.ONE=Object.freeze(new pt(1,1,1)),pt.UP=Object.freeze(new pt(0,1,0)),pt.DOWN=Object.freeze(new pt(0,-1,0)),pt.RIGHT=Object.freeze(new pt(1,0,0)),pt.LEFT=Object.freeze(new pt(-1,0,0)),pt.FORWARD=Object.freeze(new pt(0,0,-1)),pt.BACK=Object.freeze(new pt(0,0,1));var mt=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 pt);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}();mt.IDENTITY=Object.freeze(new mt),mt.ZERO=Object.freeze((new mt).set([0,0,0,0,0,0,0,0,0]));var _t=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}();_t.ZERO=Object.freeze(new _t(0,0)),_t.ONE=Object.freeze(new _t(1,1)),_t.UP=Object.freeze(new _t(0,1)),_t.DOWN=Object.freeze(new _t(0,-1)),_t.RIGHT=Object.freeze(new _t(1,0)),_t.LEFT=Object.freeze(new _t(-1,0));var gt=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}();gt.ZERO=Object.freeze(new gt(0,0,0,0)),gt.ONE=Object.freeze(new gt(1,1,1,1));var vt=new _t,yt=new pt,xt=new pt,bt=new pt,St=new pt,wt=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 pt);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 pt);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 gt);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){bt.sub2(t,e).normalize(),xt.copy(i).normalize(),yt.cross(xt,bt).normalize(),xt.cross(bt,yt);var n=this.data;return n[0]=yt.x,n[1]=yt.y,n[2]=yt.z,n[3]=0,n[4]=xt.x,n[5]=xt.y,n[6]=xt.z,n[7]=0,n[8]=bt.x,n[9]=bt.y,n[10]=bt.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(vt,e,i,n,a),this.setFrustum(-vt.x,vt.x,-vt.y,vt.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*=ot.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 pt),t.set(this.data[12],this.data[13],this.data[14])},e.getX=function(t){return void 0===t&&(t=new pt),t.set(this.data[0],this.data[1],this.data[2])},e.getY=function(t){return void 0===t&&(t=new pt),t.set(this.data[4],this.data[5],this.data[6])},e.getZ=function(t){return void 0===t&&(t=new pt),t.set(this.data[8],this.data[9],this.data[10])},e.getScale=function(t){return void 0===t&&(t=new pt),this.getX(yt),this.getY(xt),this.getZ(bt),t.set(yt.length(),xt.length(),bt.length()),t},e.setFromEulerAngles=function(t,e,i){t*=ot.DEG_TO_RAD,e*=ot.DEG_TO_RAD,i*=ot.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 pt),this.getScale(St);var e=St.x,i=St.y,n=St.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(ot.RAD_TO_DEG)},e.toString=function(){return"["+this.data.join(", ")+"]"},t}();wt.IDENTITY=Object.freeze(new wt),wt.ZERO=Object.freeze((new wt).set([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]));var Tt=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*ot.RAD_TO_DEG},e.getEulerAngles=function(t){var e,i,n;void 0===t&&(t=new pt);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(ot.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*ot.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 pt){var n=t;t=n.x,e=n.y,i=n.z}var s=.5*ot.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 pt);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}();Tt.IDENTITY=Object.freeze(new Tt(0,0,0,1)),Tt.ZERO=Object.freeze(new Tt(0,0,0,0));var At=new pt,Mt=new pt,Ct=new pt,Et=new pt,Pt=new pt,Rt=function(){function t(t,e){void 0===t&&(t=new pt),void 0===e&&(e=new pt(.5,.5,.5)),this.center=t,this.halfExtents=e,this._min=new pt,this._max=new pt}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=At.copy(this.getMin()).sub(t.origin),n=Mt.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=Ct.set(Math.min(i.x,n.x),Math.min(i.y,n.y),Math.min(i.z,n.z)),r=Et.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=At,i=Mt,n=Ct,s=Et,a=Pt,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=At.set(t[0],t[1],t[2]),n=Mt.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){At.add2(this.getMin(),t),Mt.add2(this.getMax(),e),this.setMinMax(At,Mt)},t}(),It=new pt,Lt=new pt,Dt=function(){function t(t,e){void 0===t&&(t=new pt),void 0===e&&(e=.5),this.center=t,this.radius=e}var e=t.prototype;return e.containsPoint=function(t){var e=It.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){It.sub2(t.center,this.center);var e=t.radius+this.radius;return It.lengthSq()<=e*e},t}(),kt="none",Ot="linear",Ft={0:"PCF3",1:"VSM8",2:"VSM16",3:"VSM32",4:"PCF5",5:"PCF1"},Bt=128,Nt=256,Ut=1024,zt=2048,Vt=4096,Gt=8192,Wt=18,Ht=[new pt,new pt,new pt,new pt,new pt,new pt,new pt,new pt],Xt=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=Ht;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}(),qt=function(){function t(t,e){void 0===t&&(t=new pt),void 0===e&&(e=new pt(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}(),Yt=new qt,jt=new pt,Kt=new Dt,Zt=new wt,$t=function(){function t(t,e){void 0===t&&(t=new wt),void 0===e&&(e=new pt(.5,.5,.5)),this.halfExtents=e,this._modelTransform=t.clone().invert(),this._worldTransform=t.clone(),this._aabb=new Rt(new pt,this.halfExtents)}var e=t.prototype;return e.intersectsRay=function(t,e){if(this._modelTransform.transformPoint(t.origin,Yt.origin),this._modelTransform.transformVector(t.direction,Yt.direction),e){var i=this._aabb._intersectsRay(Yt,e);return Zt.copy(this._modelTransform).invert().transformPoint(e,e),i}return this._aabb._fastIntersectsRay(Yt)},e.containsPoint=function(t){return this._modelTransform.transformPoint(t,jt),this._aabb.containsPoint(jt)},e.intersectsBoundingSphere=function(t){return this._modelTransform.transformPoint(t.center,Kt.center),Kt.radius=t.radius,!!this._aabb.intersectsBoundingSphere(Kt)},q(t,[{key:"worldTransform",get:function(){return this._worldTransform},set:function(t){this._worldTransform.copy(t),this._modelTransform.copy(t).invert()}}]),t}(),Qt=new pt,Jt=function(){function t(t,e){void 0===t&&(t=new pt),void 0===e&&(e=new pt(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=Qt.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}(),te=10,ee=11,ie=12,ne=13,se=14,ae=16,re=17,oe=21,he=24,le=25,ce="POSITION",ue="NORMAL",de="TANGENT",fe="BLENDWEIGHT",pe="BLENDINDICES",me="COLOR",_e="TEXCOORD",ge="TEXCOORD0",ve="TEXCOORD1",ye="TEXCOORD2",xe="TEXCOORD3",be="TEXCOORD4",Se="TEXCOORD5",we="TEXCOORD6",Te="TEXCOORD7",Ae="ATTR",Me="ATTR0",Ce="ATTR1",Ee="ATTR2",Pe="ATTR3",Re="ATTR4",Ie="ATTR5",Le="ATTR6",De="ATTR7",ke="ATTR8",Oe="ATTR9",Fe="ATTR10",Be="ATTR11",Ne="ATTR12",Ue="ATTR13",ze="ATTR14",Ve="ATTR15",Ge="default",We="rgbm",He="rgbe",Xe="swizzleGGGR",qe="none",Ye="cube",je="equirect",Ke="octahedral",Ze=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array],$e=[1,1,2,2,4,4,4],Qe={Int8Array:0,Uint8Array:1,Int16Array:2,Uint16Array:3,Int32Array:4,Uint32Array:5,Float32Array:6},Je=[Uint8Array,Uint16Array,Uint32Array],ti=[1,2,4],ei={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},ii=0,ni=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=ii++,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 si(t){for(var e=0,i=0,n=t.length;i 0.5) {\n\t\t\t\tif (dAtten > 0.00001) {\n\t\t\t\t\t\tdirLm.xyz = dirLm.xyz * 2.0 - vec3(1.0);\n\t\t\t\t\t\tdAtten = saturate(dAtten);\n\t\t\t\t\t\tgl_FragColor.rgb = normalize(dLightDirNormW.xyz*dAtten + dirLm.xyz*dirLm.w) * 0.5 + vec3(0.5);\n\t\t\t\t\t\tgl_FragColor.a = dirLm.w + dAtten;\n\t\t\t\t\t\tgl_FragColor.a = max(gl_FragColor.a, 1.0 / 255.0);\n\t\t\t\t} else {\n\t\t\t\t\t\tgl_FragColor = dirLm;\n\t\t\t\t}\n\t\t} else {\n\t\t\t\tgl_FragColor.rgb = dirLm.xyz;\n\t\t\t\tgl_FragColor.a = max(dirLm.w, dAtten > 0.00001? (1.0/255.0) : 0.0);\n\t\t}\n",bakeLmEndPS:"\n\t\tgl_FragColor.rgb = dDiffuseLight;\n\t\tgl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(0.5));\n\t\tgl_FragColor.rgb /= 8.0;\n\t\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\t\tgl_FragColor.a = ceil(gl_FragColor.a * 255.0) / 255.0;\n\t\tgl_FragColor.rgb /= gl_FragColor.a;\n",basePS:"\nuniform vec3 view_position;\n\nuniform vec3 light_globalAmbient;\n\nfloat square(float x) {\n\t\treturn x*x;\n}\n\nfloat saturate(float x) {\n\t\treturn clamp(x, 0.0, 1.0);\n}\n\nvec3 saturate(vec3 x) {\n\t\treturn clamp(x, vec3(0.0), vec3(1.0));\n}\n",baseVS:"\nattribute vec3 vertex_position;\nattribute vec3 vertex_normal;\nattribute vec4 vertex_tangent;\nattribute vec2 vertex_texCoord0;\nattribute vec2 vertex_texCoord1;\nattribute vec4 vertex_color;\n\nuniform mat4 matrix_viewProjection;\nuniform mat4 matrix_model;\nuniform mat3 matrix_normal;\n\nvec3 dPositionW;\nmat4 dModelMatrix;\nmat3 dNormalMatrix;\n",baseNineSlicedPS:"\n#define NINESLICED\n\nvarying vec2 vMask;\nvarying vec2 vTiledUv;\n\nuniform mediump vec4 innerOffset;\nuniform mediump vec2 outerScale;\nuniform mediump vec4 atlasRect;\n\nvec2 nineSlicedUv;\n",baseNineSlicedVS:"\n#define NINESLICED\n\nvarying vec2 vMask;\nvarying vec2 vTiledUv;\n\nuniform mediump vec4 innerOffset;\nuniform mediump vec2 outerScale;\nuniform mediump vec4 atlasRect;\n",baseNineSlicedTiledPS:"\n#define NINESLICED\n#define NINESLICETILED\n\nvarying vec2 vMask;\nvarying vec2 vTiledUv;\n\nuniform mediump vec4 innerOffset;\nuniform mediump vec2 outerScale;\nuniform mediump vec4 atlasRect;\n\nvec2 nineSlicedUv;\n",biasConstPS:"\n#define SHADOWBIAS\n\nfloat getShadowBias(float resolution, float maxBias) {\n\t\treturn maxBias;\n}\n",blurVSMPS:"\nvarying vec2 vUv0;\n\nuniform sampler2D source;\nuniform vec2 pixelOffset;\n\n#ifdef GAUSS\nuniform float weight[SAMPLES];\n#endif\n\n#ifdef PACKED\nfloat decodeFloatRG(vec2 rg) {\n\t\treturn rg.y*(1.0/255.0) + rg.x;\n}\n\nvec2 encodeFloatRG( float v ) {\n\t\tvec2 enc = vec2(1.0, 255.0) * v;\n\t\tenc = fract(enc);\n\t\tenc -= enc.yy * vec2(1.0/255.0, 1.0/255.0);\n\t\treturn enc;\n}\n#endif\n\nvoid main(void) {\n\t\tvec3 moments = vec3(0.0);\n\t\tvec2 uv = vUv0 - pixelOffset * (float(SAMPLES) * 0.5);\n\t\tfor (int i=0; i shadowZ ? 1.0 : 0.0;\n\t\t}\n\n\t\t#endif\n\n\t\t#if defined(CLUSTER_SHADOW_TYPE_PCF3)\n\n\t\tfloat getShadowOmniClusteredPCF3(sampler2D shadowMap, vec4 shadowParams, vec3 omniAtlasViewport, float shadowEdgePixels, vec3 dir) {\n\n\t\t\t\tfloat shadowTextureResolution = shadowParams.x;\n\t\t\t\tvec2 uv = getCubemapAtlasCoordinates(omniAtlasViewport, shadowEdgePixels, shadowTextureResolution, dir);\n\n\t\t\t\t// pcf3\n\t\t\t\tfloat shadowZ = length(dir) * shadowParams.w + shadowParams.z;\n\t\t\t\tdShadowCoord = vec3(uv, shadowZ);\n\t\t\t\treturn getShadowPCF3x3(shadowMap, shadowParams.xyz);\n\t\t}\n\n\t\t#endif\n\n\t\t#if defined(CLUSTER_SHADOW_TYPE_PCF5)\n\n\t\t// we don't have PCF5 implementation for webgl1, use PCF3\n\t\tfloat getShadowOmniClusteredPCF5(sampler2D shadowMap, vec4 shadowParams, vec3 omniAtlasViewport, float shadowEdgePixels, vec3 dir) {\n\n\t\t\t\tfloat shadowTextureResolution = shadowParams.x;\n\t\t\t\tvec2 uv = getCubemapAtlasCoordinates(omniAtlasViewport, shadowEdgePixels, shadowTextureResolution, dir);\n\n\t\t\t\t// pcf3\n\t\t\t\tfloat shadowZ = length(dir) * shadowParams.w + shadowParams.z;\n\t\t\t\tdShadowCoord = vec3(uv, shadowZ);\n\t\t\t\treturn getShadowPCF3x3(shadowMap, shadowParams.xyz);\n\t\t}\n\n\t\t#endif\n\n#endif\n\n\n// Clustered Spot Sampling using atlas\n\n#ifdef GL2\n\n\t\t#if defined(CLUSTER_SHADOW_TYPE_PCF1)\n\n\t\tfloat getShadowSpotClusteredPCF1(sampler2DShadow shadowMap, vec4 shadowParams) {\n\t\t\t\treturn texture(shadowMap, dShadowCoord);\n\t\t}\n\n\t\t#endif\n\n\t\t#if defined(CLUSTER_SHADOW_TYPE_PCF3)\n\n\t\tfloat getShadowSpotClusteredPCF3(sampler2DShadow shadowMap, vec4 shadowParams) {\n\t\t\t\treturn getShadowSpotPCF3x3(shadowMap, shadowParams);\n\t\t}\n\n\t\t#endif\n\n\t\t#if defined(CLUSTER_SHADOW_TYPE_PCF5)\n\n\t\tfloat getShadowSpotClusteredPCF5(sampler2DShadow shadowMap, vec4 shadowParams) {\n\t\t\t\treturn getShadowPCF5x5(shadowMap, shadowParams.xyz);\n\t\t}\n\t\t#endif\n\n#else\n\n\t\t#if defined(CLUSTER_SHADOW_TYPE_PCF1)\n\n\t\tfloat getShadowSpotClusteredPCF1(sampler2D shadowMap, vec4 shadowParams) {\n\n\t\t\t\tfloat depth = unpackFloat(texture2D(shadowMap, dShadowCoord.xy));\n\n\t\t\t\treturn depth > dShadowCoord.z ? 1.0 : 0.0;\n\n\t\t}\n\n\t\t#endif\n\n\t\t#if defined(CLUSTER_SHADOW_TYPE_PCF3)\n\n\t\tfloat getShadowSpotClusteredPCF3(sampler2D shadowMap, vec4 shadowParams) {\n\t\t\t\treturn getShadowSpotPCF3x3(shadowMap, shadowParams);\n\t\t}\n\n\t\t#endif\n\n\t\t#if defined(CLUSTER_SHADOW_TYPE_PCF5)\n\n\t\t// we don't have PCF5 implementation for webgl1, use PCF3\n\t\tfloat getShadowSpotClusteredPCF5(sampler2D shadowMap, vec4 shadowParams) {\n\t\t\t\treturn getShadowSpotPCF3x3(shadowMap, shadowParams);\n\t\t}\n\n\t\t#endif\n\n#endif\n",clusteredLightUtilsPS:"\n// Converts unnormalized direction vector to a cubemap face index [0..5] and uv coordinates within the face in [0..1] range.\n// Additionally offset to a tile in atlas within 3x3 subdivision is provided\nvec2 getCubemapFaceCoordinates(const vec3 dir, out float faceIndex, out vec2 tileOffset)\n{\n\t\tvec3 vAbs = abs(dir);\n\t\tfloat ma;\n\t\tvec2 uv;\n\t\tif (vAbs.z >= vAbs.x && vAbs.z >= vAbs.y) {\t // front / back\n\n\t\t\t\tfaceIndex = dir.z < 0.0 ? 5.0 : 4.0;\n\t\t\t\tma = 0.5 / vAbs.z;\n\t\t\t\tuv = vec2(dir.z < 0.0 ? -dir.x : dir.x, -dir.y);\n\n\t\t\t\ttileOffset.x = 2.0;\n\t\t\t\ttileOffset.y = dir.z < 0.0 ? 1.0 : 0.0;\n\n\t\t} else if(vAbs.y >= vAbs.x) {\t// top index 2, bottom index 3\n\n\t\t\t\tfaceIndex = dir.y < 0.0 ? 3.0 : 2.0;\n\t\t\t\tma = 0.5 / vAbs.y;\n\t\t\t\tuv = vec2(dir.x, dir.y < 0.0 ? -dir.z : dir.z);\n\n\t\t\t\ttileOffset.x = 1.0;\n\t\t\t\ttileOffset.y = dir.y < 0.0 ? 1.0 : 0.0;\n\n\t\t} else {\t\t// left / right\n\n\t\t\t\tfaceIndex = dir.x < 0.0 ? 1.0 : 0.0;\n\t\t\t\tma = 0.5 / vAbs.x;\n\t\t\t\tuv = vec2(dir.x < 0.0 ? dir.z : -dir.z, -dir.y);\n\n\t\t\t\ttileOffset.x = 0.0;\n\t\t\t\ttileOffset.y = dir.x < 0.0 ? 1.0 : 0.0;\n\n\t\t}\n\t\treturn uv * ma + 0.5;\n}\n\n// converts unnormalized direction vector to a texture coordinate for a cubemap face stored within texture atlas described by the viewport\nvec2 getCubemapAtlasCoordinates(const vec3 omniAtlasViewport, float shadowEdgePixels, float shadowTextureResolution, const vec3 dir) {\n\n\t\tfloat faceIndex;\n\t\tvec2 tileOffset;\n\t\tvec2 uv = getCubemapFaceCoordinates(dir, faceIndex, tileOffset);\n\n\t\t// move uv coordinates inwards inside to compensate for larger fov when rendering shadow into atlas\n\t\tfloat atlasFaceSize = omniAtlasViewport.z;\n\t\tfloat tileSize = shadowTextureResolution * atlasFaceSize;\n\t\tfloat offset = shadowEdgePixels / tileSize;\n\t\tuv = uv * vec2(1.0 - offset * 2.0) + vec2(offset * 1.0);\n\n\t\t// scale uv coordinates to cube face area within the viewport\n\t\tuv *= atlasFaceSize;\n\n\t\t// offset into face of the atlas (3x3 grid)\n\t\tuv += tileOffset * atlasFaceSize;\n\n\t\t// offset into the atlas viewport\n\t\tuv += omniAtlasViewport.xy;\n\n\t\treturn uv;\n}\n",clusteredLightPS:"\nuniform sampler2D clusterWorldTexture;\nuniform sampler2D lightsTexture8;\nuniform highp sampler2D lightsTextureFloat;\n\n// complex ifdef expression are not supported, handle it here\n// defined(CLUSTER_COOKIES) || defined(CLUSTER_SHADOWS)\n#if defined(CLUSTER_COOKIES)\n\t\t#define CLUSTER_COOKIES_OR_SHADOWS\n#endif\n#if defined(CLUSTER_SHADOWS)\n\t\t#define CLUSTER_COOKIES_OR_SHADOWS\n#endif\n\n#ifdef CLUSTER_SHADOWS\n\t\t#ifdef GL2\n\t\t\t\t// TODO: when VSM shadow is supported, it needs to use sampler2D in webgl2\n\t\t\t\tuniform sampler2DShadow shadowAtlasTexture;\n\t\t#else\n\t\t\t\tuniform sampler2D shadowAtlasTexture;\n\t\t#endif\n#endif\n\n#ifdef CLUSTER_COOKIES\n\t\tuniform sampler2D cookieAtlasTexture;\n#endif\n\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;\n\n// global variable to limit shared area light values to be evaluated only one time\nfloat LTCLightValuesEvaluated = 0.0;\n\n// structure storing light properties of a clustered light\nstruct ClusterLightData {\n\n\t\t// v coordinate to look up the light textures\n\t\tfloat lightV;\n\n\t\t// type of the light (spot or omni)\n\t\tfloat type;\n\n\t\t// area light shape\n\t\tfloat shape;\n\n\t\t// area light sizes / orientation\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\n\t\t// light follow mode\n\t\tfloat falloffMode;\n\n\t\t// 1.0 if the light is shadow casting\n\t\tfloat castShadows;\n\n\t\t// shadow bias values\n\t\tfloat shadowBias;\n\t\tfloat shadowNormalBias;\n\n\t\t// world space position\n\t\tvec3 position;\n\n\t\t// world space direction (spot light only)\n\t\tvec3 direction;\n\n\t\t// range of the light\n\t\tfloat range;\n\n\t\t// spot light inner and outer angle cosine\n\t\tfloat innerConeAngleCos;\n\t\tfloat outerConeAngleCos;\n\n\t\t// color\n\t\tvec3 color;\n\n\t\t// atlas viewport for omni light shadow and cookie (.xy is offset to the viewport slot, .z is size of the face in the atlas)\n\t\tvec3 omniAtlasViewport;\n\n\t\t// 1.0 if the light has a cookie texture\n\t\tfloat cookie;\n\n\t\t// 1.0 if cookie texture is rgb, otherwise it is using a single channel selectable by cookieChannelMask\n\t\tfloat cookieRgb;\n\n\t\t// intensity of the cookie\n\t\tfloat cookieIntensity;\n\n\t\t// channel mask - one of the channels has 1, the others are 0\n\t\tvec4 cookieChannelMask;\n\n\t\t// light mask\n\t\tfloat mask;\n};\n\n// Note: on some devices (tested on Pixel 3A XL), this matrix when stored inside the light struct has lower precision compared to\n// when stored outside, so we store it outside to avoid spot shadow flickering. This might need to be done to other / all members\n// of the structure if further similar issues are observed.\n\n// shadow (spot light only) / cookie projection matrix\nmat4 lightProjectionMatrix;\n\n// macros for light properties\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\n// macros to test light shape\n// Note: Following functions need to be called serially in listed order as they do not test both '>' and '<'\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\n// macro to test light mask (mesh accepts dynamic vs lightmapped lights)\n#ifdef CLUSTER_MESH_DYNAMIC_LIGHTS\n\t\t// accept lights marked as dynamic or both dynamic and lightmapped\n\t\t#define acceptLightMask(light) ( light.mask < 0.75)\n#else\n\t\t// accept lights marked as lightmapped or both dynamic and lightmapped\n\t\t#define acceptLightMask(light) ( light.mask > 0.25)\n#endif\n\nvec4 decodeClusterLowRange4Vec4(vec4 d0, vec4 d1, vec4 d2, vec4 d3) {\n\t\treturn vec4(\n\t\t\t\tbytes2floatRange4(d0, -2.0, 2.0),\n\t\t\t\tbytes2floatRange4(d1, -2.0, 2.0),\n\t\t\t\tbytes2floatRange4(d2, -2.0, 2.0),\n\t\t\t\tbytes2floatRange4(d3, -2.0, 2.0)\n\t\t);\n}\n\n// use LOD sampling if supported to sample data textures as it has better chance of getting skipped inside dynamic branches\n#ifdef SUPPORTS_TEXLOD\n\t\t#define textureData(texture, uv) texture2DLodEXT(texture, uv, 0.0)\n#else\n\t\t#define textureData(texture, uv) texture2D(texture, uv)\n#endif\n\nvec4 sampleLightsTexture8(const ClusterLightData clusterLightData, float index) {\n\t\treturn textureData(lightsTexture8, vec2(index * lightsTextureInvSize.z, clusterLightData.lightV));\n}\n\nvec4 sampleLightTextureF(const ClusterLightData clusterLightData, float index) {\n\t\treturn textureData(lightsTextureFloat, vec2(index * lightsTextureInvSize.x, clusterLightData.lightV));\n}\n\nvoid decodeClusterLightCore(inout ClusterLightData clusterLightData, float lightIndex) {\n\n\t\t// read omni light properties\n\t\tclusterLightData.lightV = (lightIndex + 0.5) * lightsTextureInvSize.w;\n\n\t\t// shared data from 8bit texture\n\t\tvec4 lightInfo = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_FLAGS);\n\t\tclusterLightData.type = lightInfo.x;\n\t\tclusterLightData.shape = lightInfo.y;\n\t\tclusterLightData.falloffMode = lightInfo.z;\n\t\tclusterLightData.castShadows = lightInfo.w;\n\n\t\t// color\n\t\tvec4 colorA = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_COLOR_A);\n\t\tvec4 colorB = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_COLOR_B);\n\t\tclusterLightData.color = vec3(bytes2float2(colorA.xy), bytes2float2(colorA.zw), bytes2float2(colorB.xy)) * clusterCompressionLimit0.y;\n\n\t\t// cookie\n\t\tclusterLightData.cookie = colorB.z;\n\n\t\t// light mask\n\t\tclusterLightData.mask = colorB.w;\n\n\t\t#ifdef CLUSTER_TEXTURE_FLOAT\n\n\t\t\t\tvec4 lightPosRange = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_POSITION_RANGE);\n\t\t\t\tclusterLightData.position = lightPosRange.xyz;\n\t\t\t\tclusterLightData.range = lightPosRange.w;\n\n\t\t\t\t// spot light direction\n\t\t\t\tvec4 lightDir_Unused = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_SPOT_DIRECTION);\n\t\t\t\tclusterLightData.direction = lightDir_Unused.xyz;\n\n\t\t#else\t // 8bit\n\n\t\t\t\tvec4 encPosX = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_POSITION_X);\n\t\t\t\tvec4 encPosY = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_POSITION_Y);\n\t\t\t\tvec4 encPosZ = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_POSITION_Z);\n\t\t\t\tclusterLightData.position = vec3(bytes2float4(encPosX), bytes2float4(encPosY), bytes2float4(encPosZ)) * clusterBoundsDelta + clusterBoundsMin;\n\n\t\t\t\tvec4 encRange = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_RANGE);\n\t\t\t\tclusterLightData.range = bytes2float4(encRange) * clusterCompressionLimit0.x;\n\n\t\t\t\t// spot light direction\n\t\t\t\tvec4 encDirX = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_SPOT_DIRECTION_X);\n\t\t\t\tvec4 encDirY = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_SPOT_DIRECTION_Y);\n\t\t\t\tvec4 encDirZ = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_SPOT_DIRECTION_Z);\n\t\t\t\tclusterLightData.direction = vec3(bytes2float4(encDirX), bytes2float4(encDirY), bytes2float4(encDirZ)) * 2.0 - 1.0;\n\n\t\t#endif\n}\n\nvoid decodeClusterLightSpot(inout ClusterLightData clusterLightData) {\n\n\t\t// spot light cos angles\n\t\tvec4 coneAngle = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_SPOT_ANGLES);\n\t\tclusterLightData.innerConeAngleCos = bytes2float2(coneAngle.xy) * 2.0 - 1.0;\n\t\tclusterLightData.outerConeAngleCos = bytes2float2(coneAngle.zw) * 2.0 - 1.0;\n}\n\nvoid decodeClusterLightOmniAtlasViewport(inout ClusterLightData clusterLightData) {\n\t\t#ifdef CLUSTER_TEXTURE_FLOAT\n\t\t\t\tclusterLightData.omniAtlasViewport = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_PROJ_MAT_0).xyz;\n\t\t#else\n\t\t\t\tvec4 viewportA = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_ATLAS_VIEWPORT_A);\n\t\t\t\tvec4 viewportB = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_ATLAS_VIEWPORT_B);\n\t\t\t\tclusterLightData.omniAtlasViewport = vec3(bytes2float2(viewportA.xy), bytes2float2(viewportA.zw), bytes2float2(viewportB.xy));\n\t\t#endif\n}\n\nvoid decodeClusterLightAreaData(inout ClusterLightData clusterLightData) {\n\t\t#ifdef CLUSTER_TEXTURE_FLOAT\n\t\t\t\tclusterLightData.halfWidth = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_AREA_DATA_WIDTH).xyz;\n\t\t\t\tclusterLightData.halfHeight = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_AREA_DATA_HEIGHT).xyz;\n\t\t#else\n\t\t\t\tvec4 areaWidthX = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_WIDTH_X);\n\t\t\t\tvec4 areaWidthY = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_WIDTH_Y);\n\t\t\t\tvec4 areaWidthZ = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_WIDTH_Z);\n\t\t\t\tclusterLightData.halfWidth = vec3(mantissaExponent2Float(areaWidthX), mantissaExponent2Float(areaWidthY), mantissaExponent2Float(areaWidthZ));\n\n\t\t\t\tvec4 areaHeightX = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_HEIGHT_X);\n\t\t\t\tvec4 areaHeightY = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_HEIGHT_Y);\n\t\t\t\tvec4 areaHeightZ = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_HEIGHT_Z);\n\t\t\t\tclusterLightData.halfHeight = vec3(mantissaExponent2Float(areaHeightX), mantissaExponent2Float(areaHeightY), mantissaExponent2Float(areaHeightZ));\n\t\t#endif\n}\n\nvoid decodeClusterLightProjectionMatrixData(inout ClusterLightData clusterLightData) {\n\t\t\n\t\t// shadow matrix\n\t\t#ifdef CLUSTER_TEXTURE_FLOAT\n\t\t\t\tvec4 m0 = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_PROJ_MAT_0);\n\t\t\t\tvec4 m1 = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_PROJ_MAT_1);\n\t\t\t\tvec4 m2 = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_PROJ_MAT_2);\n\t\t\t\tvec4 m3 = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_PROJ_MAT_3);\n\t\t#else\n\t\t\t\tvec4 m00 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_00);\n\t\t\t\tvec4 m01 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_01);\n\t\t\t\tvec4 m02 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_02);\n\t\t\t\tvec4 m03 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_03);\n\t\t\t\tvec4 m0 = decodeClusterLowRange4Vec4(m00, m01, m02, m03);\n\n\t\t\t\tvec4 m10 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_10);\n\t\t\t\tvec4 m11 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_11);\n\t\t\t\tvec4 m12 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_12);\n\t\t\t\tvec4 m13 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_13);\n\t\t\t\tvec4 m1 = decodeClusterLowRange4Vec4(m10, m11, m12, m13);\n\n\t\t\t\tvec4 m20 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_20);\n\t\t\t\tvec4 m21 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_21);\n\t\t\t\tvec4 m22 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_22);\n\t\t\t\tvec4 m23 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_23);\n\t\t\t\tvec4 m2 = decodeClusterLowRange4Vec4(m20, m21, m22, m23);\n\n\t\t\t\tvec4 m30 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_30);\n\t\t\t\tvec4 m31 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_31);\n\t\t\t\tvec4 m32 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_32);\n\t\t\t\tvec4 m33 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_33);\n\t\t\t\tvec4 m3 = vec4(mantissaExponent2Float(m30), mantissaExponent2Float(m31), mantissaExponent2Float(m32), mantissaExponent2Float(m33));\n\t\t#endif\n\t\t\n\t\tlightProjectionMatrix = mat4(m0, m1, m2, m3);\n}\n\nvoid decodeClusterLightShadowData(inout ClusterLightData clusterLightData) {\n\t\t\n\t\t// shadow biases\n\t\tvec4 biases = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_SHADOW_BIAS);\n\t\tclusterLightData.shadowBias = bytes2floatRange2(biases.xy, -1.0, 20.0),\n\t\tclusterLightData.shadowNormalBias = bytes2float2(biases.zw);\n}\n\nvoid decodeClusterLightCookieData(inout ClusterLightData clusterLightData) {\n\n\t\tvec4 cookieA = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_COOKIE_A);\n\t\tclusterLightData.cookieIntensity = cookieA.x;\n\t\tclusterLightData.cookieRgb = cookieA.y;\n\n\t\tclusterLightData.cookieChannelMask = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_COOKIE_B);\n}\n\nvoid evaluateLight(ClusterLightData light) {\n\n\t\tdAtten3 = vec3(1.0);\n\n\t\t// evaluate omni part of the light\n\t\tgetLightDirPoint(light.position);\n\n\t\t#ifdef CLUSTER_AREALIGHTS\n\n\t\t// distance attenuation\n\t\tif (isClusteredLightArea(light)) { // area light\n\n\t\t\t\t// area lights\n\t\t\t\tdecodeClusterLightAreaData(light);\n\n\t\t\t\t// evaluate material based area lights data, shared by all area lights\n\t\t\t\tif (LTCLightValuesEvaluated < 0.5) {\n\t\t\t\t\t\tLTCLightValuesEvaluated = 1.0;\n\t\t\t\t\t\tcalcLTCLightValues();\n\t\t\t\t}\n\n\t\t\t\t// handle light shape\n\t\t\t\tif (isClusteredLightRect(light)) {\n\t\t\t\t\t\tcalcRectLightValues(light.position, light.halfWidth, light.halfHeight);\n\t\t\t\t} else if (isClusteredLightDisk(light)) {\n\t\t\t\t\t\tcalcDiskLightValues(light.position, light.halfWidth, light.halfHeight);\n\t\t\t\t} else { // sphere\n\t\t\t\t\t\tcalcSphereLightValues(light.position, light.halfWidth, light.halfHeight);\n\t\t\t\t}\n\n\t\t\t\tdAtten = getFalloffWindow(light.range);\n\n\t\t} else\n\n\t\t#endif\n\n\t\t{\t // punctual light\n\n\t\t\t\tif (isClusteredLightFalloffLinear(light))\n\t\t\t\t\t\tdAtten = getFalloffLinear(light.range);\n\t\t\t\telse\n\t\t\t\t\t\tdAtten = getFalloffInvSquared(light.range);\n\t\t}\n\n\t\tif (dAtten > 0.00001) {\n\n\t\t\t\t#ifdef CLUSTER_AREALIGHTS\n\n\t\t\t\tif (isClusteredLightArea(light)) { // area light\n\n\t\t\t\t\t\t// handle light shape\n\t\t\t\t\t\tif (isClusteredLightRect(light)) {\n\t\t\t\t\t\t\t\tdAttenD = getRectLightDiffuse() * 16.0;\n\t\t\t\t\t\t} else if (isClusteredLightDisk(light)) {\n\t\t\t\t\t\t\t\tdAttenD = getDiskLightDiffuse() * 16.0;\n\t\t\t\t\t\t} else { // sphere\n\t\t\t\t\t\t\t\tdAttenD = getSphereLightDiffuse() * 16.0;\n\t\t\t\t\t\t}\n\n\t\t\t\t} else\n\n\t\t\t\t#endif\n\n\t\t\t\t{\n\t\t\t\t\t\tdAtten *= getLightDiffuse();\n\t\t\t\t}\n\n\t\t\t\t// spot light falloff\n\t\t\t\tif (isClusteredLightSpot(light)) {\n\t\t\t\t\t\tdecodeClusterLightSpot(light);\n\t\t\t\t\t\tdAtten *= getSpotEffect(light.direction, light.innerConeAngleCos, light.outerConeAngleCos);\n\t\t\t\t}\n\n\t\t\t\t#if defined(CLUSTER_COOKIES_OR_SHADOWS)\n\n\t\t\t\tif (dAtten > 0.00001) {\n\n\t\t\t\t\t\t// shadow / cookie\n\t\t\t\t\t\tif (isClusteredLightCastShadow(light) || isClusteredLightCookie(light)) {\n\n\t\t\t\t\t\t\t\t// shared shadow / cookie data depends on light type\n\t\t\t\t\t\t\t\tif (isClusteredLightSpot(light)) {\n\t\t\t\t\t\t\t\t\t\tdecodeClusterLightProjectionMatrixData(light);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tdecodeClusterLightOmniAtlasViewport(light);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tfloat shadowTextureResolution = shadowAtlasParams.x;\n\t\t\t\t\t\t\t\tfloat shadowEdgePixels = shadowAtlasParams.y;\n\n\t\t\t\t\t\t\t\t#ifdef CLUSTER_COOKIES\n\n\t\t\t\t\t\t\t\t// cookie\n\t\t\t\t\t\t\t\tif (isClusteredLightCookie(light)) {\n\t\t\t\t\t\t\t\t\t\tdecodeClusterLightCookieData(light);\n\n\t\t\t\t\t\t\t\t\t\tif (isClusteredLightSpot(light)) {\n\t\t\t\t\t\t\t\t\t\t\t\tdAtten3 = getCookie2DClustered(cookieAtlasTexture, lightProjectionMatrix, vPositionW, light.cookieIntensity, isClusteredLightCookieRgb(light), light.cookieChannelMask);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\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\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t\t\t#ifdef CLUSTER_SHADOWS\n\n\t\t\t\t\t\t\t\t// shadow\n\t\t\t\t\t\t\t\tif (isClusteredLightCastShadow(light)) {\n\t\t\t\t\t\t\t\t\t\tdecodeClusterLightShadowData(light);\n\n\t\t\t\t\t\t\t\t\t\tvec4 shadowParams = vec4(shadowTextureResolution, light.shadowNormalBias, light.shadowBias, 1.0 / light.range);\n\n\t\t\t\t\t\t\t\t\t\tif (isClusteredLightSpot(light)) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t// spot shadow\n\t\t\t\t\t\t\t\t\t\t\t\tgetShadowCoordPerspZbufferNormalOffset(lightProjectionMatrix, shadowParams);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t#if defined(CLUSTER_SHADOW_TYPE_PCF1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdAtten *= getShadowSpotClusteredPCF1(shadowAtlasTexture, shadowParams);\n\t\t\t\t\t\t\t\t\t\t\t\t#elif defined(CLUSTER_SHADOW_TYPE_PCF3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdAtten *= getShadowSpotClusteredPCF3(shadowAtlasTexture, shadowParams);\n\t\t\t\t\t\t\t\t\t\t\t\t#elif defined(CLUSTER_SHADOW_TYPE_PCF5)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdAtten *= getShadowSpotClusteredPCF5(shadowAtlasTexture, shadowParams);\n\t\t\t\t\t\t\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t\t\t// omni shadow\n\t\t\t\t\t\t\t\t\t\t\t\tnormalOffsetPointShadow(shadowParams);\t// normalBias adjusted for distance\n\n\t\t\t\t\t\t\t\t\t\t\t\t#if defined(CLUSTER_SHADOW_TYPE_PCF1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdAtten *= getShadowOmniClusteredPCF1(shadowAtlasTexture, shadowParams, light.omniAtlasViewport, shadowEdgePixels, dLightDirW);\n\t\t\t\t\t\t\t\t\t\t\t\t#elif defined(CLUSTER_SHADOW_TYPE_PCF3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdAtten *= getShadowOmniClusteredPCF3(shadowAtlasTexture, shadowParams, light.omniAtlasViewport, shadowEdgePixels, dLightDirW);\n\t\t\t\t\t\t\t\t\t\t\t\t#elif defined(CLUSTER_SHADOW_TYPE_PCF5)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdAtten *= getShadowOmniClusteredPCF5(shadowAtlasTexture, shadowParams, light.omniAtlasViewport, shadowEdgePixels, dLightDirW);\n\t\t\t\t\t\t\t\t\t\t\t\t#endif\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t#endif\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t\t// diffuse / specular / clearcoat\n\t\t\t\t#ifdef CLUSTER_AREALIGHTS\n\n\t\t\t\tif (isClusteredLightArea(light)) { // area light\n\n\t\t\t\t\t\t// area light diffuse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvec3 areaDiffuse = (dAttenD * dAtten) * light.color * dAtten3;\n\n\t\t\t\t\t\t\t\t#if defined(CLUSTER_SPECULAR)\n\t\t\t\t\t\t\t\t\t\t#if defined(CLUSTER_CONSERVE_ENERGY)\n\t\t\t\t\t\t\t\t\t\t\t\tareaDiffuse = mix(areaDiffuse, vec3(0), dLTCSpecFres);\n\t\t\t\t\t\t\t\t\t\t#endif\n\t\t\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t\t\t// area light diffuse - it does not mix diffuse lighting into specular attenuation\n\t\t\t\t\t\t\t\tdDiffuseLight += areaDiffuse;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// specular and clear coat are material settings and get included by a define based on the material\n\t\t\t\t\t\t#ifdef CLUSTER_SPECULAR\n\n\t\t\t\t\t\t\t\t// area light specular\n\t\t\t\t\t\t\t\tfloat areaLightSpecular;\n\n\t\t\t\t\t\t\t\tif (isClusteredLightRect(light)) {\n\t\t\t\t\t\t\t\t\t\tareaLightSpecular = getRectLightSpecular();\n\t\t\t\t\t\t\t\t} else if (isClusteredLightDisk(light)) {\n\t\t\t\t\t\t\t\t\t\tareaLightSpecular = getDiskLightSpecular();\n\t\t\t\t\t\t\t\t} else { // sphere\n\t\t\t\t\t\t\t\t\t\tareaLightSpecular = getSphereLightSpecular();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tdSpecularLight += dLTCSpecFres * areaLightSpecular * dAtten * light.color * dAtten3;\n\n\t\t\t\t\t\t\t\t#ifdef CLUSTER_CLEAR_COAT\n\n\t\t\t\t\t\t\t\t\t\t// area light specular clear coat\n\t\t\t\t\t\t\t\t\t\tfloat areaLightSpecularCC;\n\n\t\t\t\t\t\t\t\t\t\tif (isClusteredLightRect(light)) {\n\t\t\t\t\t\t\t\t\t\t\t\tareaLightSpecularCC = getRectLightSpecularCC();\n\t\t\t\t\t\t\t\t\t\t} else if (isClusteredLightDisk(light)) {\n\t\t\t\t\t\t\t\t\t\t\t\tareaLightSpecularCC = getDiskLightSpecularCC();\n\t\t\t\t\t\t\t\t\t\t} else { // sphere\n\t\t\t\t\t\t\t\t\t\t\t\tareaLightSpecularCC = getSphereLightSpecularCC();\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tccSpecularLight += ccLTCSpecFres * areaLightSpecularCC * dAtten * light.color\t* dAtten3;\n\n\t\t\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t#endif\n\n\t\t\t\t} else\n\n\t\t\t\t#endif\n\n\t\t\t\t{\t\t// punctual light\n\n\t\t\t\t\t\t// punctual light diffuse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvec3 punctualDiffuse = dAtten * light.color * dAtten3;\n\n\t\t\t\t\t\t\t\t#if defined(CLUSTER_AREALIGHTS)\n\t\t\t\t\t\t\t\t#if defined(CLUSTER_SPECULAR)\n\t\t\t\t\t\t\t\t#if defined(CLUSTER_CONSERVE_ENERGY)\n\t\t\t\t\t\t\t\t\t\tpunctualDiffuse = mix(punctualDiffuse, vec3(0), dSpecularity);\n\t\t\t\t\t\t\t\t#endif\n\t\t\t\t\t\t\t\t#endif\n\t\t\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t\t\tdDiffuseLight += punctualDiffuse;\n\t\t\t\t\t\t}\n\t \n\t\t\t\t\t\t// specular and clear coat are material settings and get included by a define based on the material\n\t\t\t\t\t\t#ifdef CLUSTER_SPECULAR\n\n\t\t\t\t\t\t\t\t// specular\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvec3 punctualSpecular = getLightSpecular() * dAtten * light.color * dAtten3;\n\n\t\t\t\t\t\t\t\t\t\t#if defined(CLUSTER_AREALIGHTS)\n\t\t\t\t\t\t\t\t\t\t\t\tpunctualSpecular *= dSpecularity;\n\t\t\t\t\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t\t\t\t\tdSpecularLight += punctualSpecular;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t#ifdef CLUSTER_CLEAR_COAT\n\n\t\t\t\t\t\t\t\t\t\tvec3 punctualCC = getLightSpecularCC() * dAtten * light.color * dAtten3;\n\n\t\t\t\t\t\t\t\t\t\t#if defined(CLUSTER_AREALIGHTS)\n\t\t\t\t\t\t\t\t\t\t\t\tpunctualCC *= ccSpecularity;\n\t\t\t\t\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t\t\t\t\tccSpecularLight += punctualCC;\n\t\t\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t#endif\n\t\t\t\t}\n\t\t}\n}\n\nvoid evaluateClusterLight(float lightIndex) {\n\n\t\t// decode core light data from textures\n\t\tClusterLightData clusterLightData;\n\t\tdecodeClusterLightCore(clusterLightData, lightIndex);\n\n\t\t// evaluate light if it uses accepted light mask\n\t\tif (acceptLightMask(clusterLightData))\n\t\t\t\tevaluateLight(clusterLightData);\n}\n\nvoid addClusteredLights() {\n\t\t// world space position to 3d integer cell cordinates in the cluster structure\n\t\tvec3 cellCoords = floor((vPositionW - clusterBoundsMin) * clusterCellsCountByBoundsSize);\n\n\t\t// no lighting when cell coordinate is out of range\n\t\tif (!(any(lessThan(cellCoords, vec3(0.0))) || any(greaterThanEqual(cellCoords, clusterCellsMax)))) {\n\n\t\t\t\t// cell index (mapping from 3d cell coordinates to linear memory)\n\t\t\t\tfloat cellIndex = dot(clusterCellsDot, cellCoords);\n\n\t\t\t\t// convert cell index to uv coordinates\n\t\t\t\tfloat clusterV = floor(cellIndex * clusterTextureSize.y);\n\t\t\t\tfloat clusterU = cellIndex - (clusterV * clusterTextureSize.x);\n\t\t\t\tclusterV = (clusterV + 0.5) * clusterTextureSize.z;\n\n\t\t\t\t// loop over maximum possible number of supported light cells\n\t\t\t\tconst float maxLightCells = 256.0 / 4.0;\t// 8 bit index, each stores 4 lights\n\t\t\t\tfor (float lightCellIndex = 0.5; lightCellIndex < maxLightCells; lightCellIndex++) {\n\n\t\t\t\t\t\tvec4 lightIndices = textureData(clusterWorldTexture, vec2(clusterTextureSize.y * (clusterU + lightCellIndex), clusterV));\n\t\t\t\t\t\tvec4 indices = lightIndices * 255.0;\n\n\t\t\t\t\t\t// evaluate up to 4 lights. This is written using a loop instead of manually unrolling to keep shader compile time smaller\n\t\t\t\t\t\tfor (int i = 0; i < 4; i++) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (indices.x <= 0.0)\n\t\t\t\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t\t\tevaluateClusterLight(indices.x); \n\t\t\t\t\t\t\t\tindices = indices.yzwx;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// end of the cell array\n\t\t\t\t\t\tif (lightCellIndex > clusterPixelsPerCell) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n}\n",combineClearCoatPS:"\nvec3 combineColorCC() {\n\t\treturn combineColor()+(ccSpecularLight*ccSpecularity+ccReflection.rgb*ccSpecularity*ccReflection.a);\n}\n",combineDiffusePS:"\nvec3 combineColor() {\n\t\treturn dAlbedo * dDiffuseLight;\n}\n",combineDiffuseSpecularPS:"\nvec3 combineColor() {\n\t\treturn mix(dAlbedo * dDiffuseLight, dSpecularLight + dReflection.rgb * dReflection.a, dSpecularity);\n}\n",combineDiffuseSpecularNoConservePS:"\nvec3 combineColor() {\n\t\treturn dAlbedo * dDiffuseLight + (dSpecularLight + dReflection.rgb * dReflection.a) * dSpecularity;\n}\n",combineDiffuseSpecularNoReflPS:"\nvec3 combineColor() {\n\t\treturn dAlbedo * dDiffuseLight + dSpecularLight * dSpecularity;\n}\n",combineDiffuseSpecularNoReflSeparateAmbientPS:"\nuniform vec3 material_ambient;\n\nvec3 combineColor() {\n\t\treturn (dDiffuseLight - light_globalAmbient) * dAlbedo + dSpecularLight * dSpecularity + material_ambient * light_globalAmbient;\n}\n",combineDiffuseSpecularOldPS:"\nvec3 combineColor() {\n\t\treturn mix(dAlbedo * dDiffuseLight + dSpecularLight * dSpecularity, dReflection.rgb, dReflection.a);\n}\n",cookiePS:"\n// light cookie functionality for non-clustered lights\nvec4 getCookie2D(sampler2D tex, mat4 transform, float intensity) {\n\t\tvec4 projPos = transform * vec4(vPositionW, 1.0);\n\t\tprojPos.xy /= projPos.w;\n\t\treturn mix(vec4(1.0), texture2D(tex, projPos.xy), intensity);\n}\n\nvec4 getCookie2DClip(sampler2D tex, mat4 transform, float intensity) {\n\t\tvec4 projPos = transform * vec4(vPositionW, 1.0);\n\t\tprojPos.xy /= projPos.w;\n\t\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\t\treturn mix(vec4(1.0), texture2D(tex, projPos.xy), intensity);\n}\n\nvec4 getCookie2DXform(sampler2D tex, mat4 transform, float intensity, vec4 cookieMatrix, vec2 cookieOffset) {\n\t\tvec4 projPos = transform * vec4(vPositionW, 1.0);\n\t\tprojPos.xy /= projPos.w;\n\t\tprojPos.xy += cookieOffset;\n\t\tvec2 uv = mat2(cookieMatrix) * (projPos.xy-vec2(0.5)) + vec2(0.5);\n\t\treturn mix(vec4(1.0), texture2D(tex, uv), intensity);\n}\n\nvec4 getCookie2DClipXform(sampler2D tex, mat4 transform, float intensity, vec4 cookieMatrix, vec2 cookieOffset) {\n\t\tvec4 projPos = transform * vec4(vPositionW, 1.0);\n\t\tprojPos.xy /= projPos.w;\n\t\tprojPos.xy += cookieOffset;\n\t\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\t\tvec2 uv = mat2(cookieMatrix) * (projPos.xy-vec2(0.5)) + vec2(0.5);\n\t\treturn mix(vec4(1.0), texture2D(tex, uv), intensity);\n}\n\nvec4 getCookieCube(samplerCube tex, mat4 transform, float intensity) {\n\t\treturn mix(vec4(1.0), textureCube(tex, dLightDirNormW * mat3(transform)), intensity);\n}\n",cubeMapProjectBoxPS:"\nuniform vec3 envBoxMin, envBoxMax;\n\nvec3 cubeMapProject(vec3 nrdir) {\n\t\tnrdir = cubeMapRotate(nrdir);\n\n\t\tvec3 rbmax = (envBoxMax - vPositionW) / nrdir;\n\t\tvec3 rbmin = (envBoxMin - vPositionW) / nrdir;\n\n\t\tvec3 rbminmax;\n\t\trbminmax.x = nrdir.x>0.0? rbmax.x : rbmin.x;\n\t\trbminmax.y = nrdir.y>0.0? rbmax.y : rbmin.y;\n\t\trbminmax.z = nrdir.z>0.0? rbmax.z : rbmin.z;\n\n\t\tfloat fa = min(min(rbminmax.x, rbminmax.y), rbminmax.z);\n\n\t\tvec3 posonbox = vPositionW + nrdir * fa;\n\t\tvec3 envBoxPos = (envBoxMin + envBoxMax) * 0.5;\n\t\treturn normalize(posonbox - envBoxPos);\n}\n",cubeMapProjectNonePS:"\nvec3 cubeMapProject(vec3 dir) {\n\t\treturn cubeMapRotate(dir);\n}\n",cubeMapRotatePS:"\n#ifdef CUBEMAP_ROTATION\nuniform mat3 cubeMapRotationMatrix;\n#endif\n\nvec3 cubeMapRotate(vec3 refDir) {\n#ifdef CUBEMAP_ROTATION\n\t\treturn refDir * cubeMapRotationMatrix;\n#else\n\t\treturn refDir;\n#endif\n}\n",detailModesPS:"\nvec3 detailMode_mul(vec3 c1, vec3 c2) {\n\t\treturn c1 * c2;\n}\n\nvec3 detailMode_add(vec3 c1, vec3 c2) {\n\t\treturn c1 + c2;\n}\n\n// https://en.wikipedia.org/wiki/Blend_modes#Screen\nvec3 detailMode_screen(vec3 c1, vec3 c2) {\n\t\treturn 1.0 - (1.0 - c1)*(1.0 - c2);\n}\n\n// https://en.wikipedia.org/wiki/Blend_modes#Overlay\nvec3 detailMode_overlay(vec3 c1, vec3 c2) {\n\t\treturn mix(1.0 - 2.0*(1.0 - c1)*(1.0 - c2), 2.0*c1*c2, step(c1, vec3(0.5)));\n}\n\nvec3 detailMode_min(vec3 c1, vec3 c2) {\n\t\treturn min(c1, c2);\n}\n\nvec3 detailMode_max(vec3 c1, vec3 c2) {\n\t\treturn max(c1, c2);\n}\n",diffusePS:"\n#ifdef MAPCOLOR\nuniform vec3 material_diffuse;\n#endif\n\n#ifdef MAPTEXTURE\nuniform sampler2D texture_diffuseMap;\n#endif\n\nvoid getAlbedo() {\n\t\tdAlbedo = vec3(1.0);\n\n\t\t#ifdef MAPCOLOR\n\t\tdAlbedo *= material_diffuse.rgb;\n\t\t#endif\n\n\t\t#ifdef MAPTEXTURE\n\t\tdAlbedo *= gammaCorrectInput(addAlbedoDetail(texture2D(texture_diffuseMap, $UV, textureBias).$CH));\n\t\t#endif\n\n\t\t#ifdef MAPVERTEX\n\t\tdAlbedo *= gammaCorrectInput(saturate(vVertexColor.$VC));\n\t\t#endif\n}\n",diffuseDetailMapPS:"\n#ifdef MAPTEXTURE\nuniform sampler2D texture_diffuseDetailMap;\n#endif\n\nvec3 addAlbedoDetail(vec3 albedo) {\n\t\t#ifdef MAPTEXTURE\n\t\tvec3 albedoDetail = vec3(texture2D(texture_diffuseDetailMap, $UV, textureBias).$CH);\n\t\treturn detailMode_$DETAILMODE(albedo, albedoDetail);\n\t\t#else\n\t\treturn albedo;\n\t\t#endif\n}\n",dilatePS:"\n#define SHADER_NAME Dilate\n\nvarying vec2 vUv0;\n\nuniform sampler2D source;\nuniform vec2 pixelOffset;\n\nvoid main(void) {\n\t\tvec4 c = texture2D(source, vUv0);\n\t\tc = c.a>0.0? c : texture2D(source, vUv0 - pixelOffset);\n\t\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(0, -pixelOffset.y));\n\t\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(pixelOffset.x, -pixelOffset.y));\n\t\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(-pixelOffset.x, 0));\n\t\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(pixelOffset.x, 0));\n\t\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(-pixelOffset.x, pixelOffset.y));\n\t\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(0, pixelOffset.y));\n\t\tc = c.a>0.0? c : texture2D(source, vUv0 + pixelOffset);\n\t\tgl_FragColor = c;\n}\n",bilateralDeNoisePS:"\n// bilateral filter, based on https://www.shadertoy.com/view/4dfGDH# and\n// http://people.csail.mit.edu/sparis/bf_course/course_notes.pdf\n\n// A bilateral filter is a non-linear, edge-preserving, and noise-reducing smoothing filter for images.\n// It replaces the intensity of each pixel with a weighted average of intensity values from nearby pixels.\n// This weight can be based on a Gaussian distribution. Crucially, the weights depend not only on\n// Euclidean distance of pixels, but also on the radiometric differences (e.g., range differences, such\n// as color intensity, depth distance, etc.). This preserves sharp edges.\n\n#define SHADER_NAME BilateralDeNoise\n\nfloat normpdf3(in vec3 v, in float sigma) {\n\t\treturn 0.39894 * exp(-0.5 * dot(v, v) / (sigma * sigma)) / sigma;\n}\n\nvec3 decodeRGBM(vec4 rgbm) {\n\t\tvec3 color = (8.0 * rgbm.a) * rgbm.rgb;\n\t\treturn color * color;\n}\n\nfloat saturate(float x) {\n\t\treturn clamp(x, 0.0, 1.0);\n}\n\nvec4 encodeRGBM(vec3 color) { // modified RGBM\n\t\tvec4 encoded;\n\t\tencoded.rgb = pow(color.rgb, vec3(0.5));\n\t\tencoded.rgb *= 1.0 / 8.0;\n\n\t\tencoded.a = saturate( max( max( encoded.r, encoded.g ), max( encoded.b, 1.0 / 255.0 ) ) );\n\t\tencoded.a = ceil(encoded.a * 255.0) / 255.0;\n\n\t\tencoded.rgb /= encoded.a;\n\t\treturn encoded;\n}\n\n// filter size\n#define MSIZE 15\n\nvarying vec2 vUv0;\nuniform sampler2D source;\nuniform vec2 pixelOffset;\nuniform vec2 sigmas;\nuniform float bZnorm;\nuniform float kernel[MSIZE];\n\nvoid main(void) {\n\t\t\n\t\tvec4 pixelRgbm = texture2D(source, vUv0);\n\n\t\t// lightmap specific optimization - skip pixels that were not baked\n\t\t// this also allows dilate filter that work on the output of this to work correctly, as it depends on .a being zero\n\t\t// to dilate, which the following blur filter would otherwise modify\n\t\tif (pixelRgbm.a <= 0.0) {\n\t\t\t\tgl_FragColor = pixelRgbm;\n\t\t\t\treturn ;\n\t\t}\n\n\t\t// range sigma - controls blurriness based on a pixel distance\n\t\tfloat sigma = sigmas.x;\n\n\t\t// domain sigma - controls blurriness based on a pixel similarity (to preserve edges)\n\t\tfloat bSigma = sigmas.y;\n\n\t\tvec3 pixelHdr = decodeRGBM(pixelRgbm);\n\t\tvec3 accumulatedHdr = vec3(0.0);\n\t\tfloat accumulatedFactor = 0.0;\n\n\t\t// read out the texels\n\t\tconst int kSize = (MSIZE-1)/2;\n\t\tfor (int i = -kSize; i <= kSize; ++i) {\n\t\t\t\tfor (int j = -kSize; j <= kSize; ++j) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// sample the pixel with offset\n\t\t\t\t\t\tvec2 coord = vUv0 + vec2(float(i), float(j)) * pixelOffset;\n\t\t\t\t\t\tvec4 rgbm = texture2D(source, coord);\n\n\t\t\t\t\t\t// lightmap - only use baked pixels\n\t\t\t\t\t\tif (rgbm.a > 0.0) {\n\t\t\t\t\t\t\t\tvec3 hdr = decodeRGBM(rgbm);\n\n\t\t\t\t\t\t\t\t// bilateral factors\n\t\t\t\t\t\t\t\tfloat factor = kernel[kSize + j] * kernel[kSize + i];\n\t\t\t\t\t\t\t\tfactor *= normpdf3(hdr - pixelHdr, bSigma) * bZnorm;\n\n\t\t\t\t\t\t\t\t// accumulate\n\t\t\t\t\t\t\t\taccumulatedHdr += factor * hdr;\n\t\t\t\t\t\t\t\taccumulatedFactor += factor;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\n\t\tgl_FragColor = encodeRGBM(accumulatedHdr / accumulatedFactor);\n}\n",decodePS:"\nvec3 decodeLinear(vec4 raw) {\n\t\treturn raw.rgb;\n}\n\nvec3 decodeGamma(vec4 raw) {\n\t\treturn pow(raw.xyz, vec3(2.2));\n}\n\nvec3 decodeRGBM(vec4 raw) {\n\t\tvec3 color = (8.0 * raw.a) * raw.rgb;\n\t\treturn color * color;\n}\n\nvec3 decodeRGBE(vec4 raw) {\n\t\tif (raw.a == 0.0) {\n\t\t\t\treturn vec3(0.0, 0.0, 0.0);\n\t\t} else {\n\t\t\t\treturn raw.xyz * pow(2.0, raw.w * 255.0 - 128.0);\n\t\t}\n}\n\nconst float PI = 3.141592653589793;\n\nvec2 toSpherical(vec3 dir) {\n\t\treturn vec2(dir.xz == vec2(0.0) ? 0.0 : atan(dir.x, dir.z), asin(dir.y));\n}\n\nvec2 toSphericalUv(vec3 dir) {\n\t\tvec2 uv = toSpherical(dir) / vec2(PI * 2.0, PI) + 0.5;\n\t\treturn vec2(uv.x, 1.0 - uv.y);\n}\n\n// equirectangular helper functions\n\n// envAtlas is fixed at 512 pixels. every equirect is generated with 1 pixel boundary.\nconst float atlasSize = 512.0;\nconst float seamSize = 1.0 / atlasSize;\n\n// map a normalized equirect UV to the given rectangle (taking 1 pixel seam into account).\nvec2 mapUv(vec2 uv, vec4 rect) {\n\t\treturn vec2(mix(rect.x + seamSize, rect.x + rect.z - seamSize, uv.x),\n\t\t\t\t\t\t\t\tmix(rect.y + seamSize, rect.y + rect.w - seamSize, uv.y));\n}\n\n// map a normalized equirect UV and roughness level to the correct atlas rect.\nvec2 mapRoughnessUv(vec2 uv, float level) {\n\t\tfloat t = 1.0 / exp2(level);\n\t\treturn mapUv(uv, vec4(0, 1.0 - t, t, t * 0.5));\n}\n\n// \nvec2 mapMip(vec2 uv, float level) {\n\t\tfloat t = 1.0 / exp2(level);\n\t\treturn mapUv(uv, vec4(1.0 - t, 1.0 - t, t, t * 0.5));\n}\n",emissivePS:"\n#ifdef MAPCOLOR\nuniform vec3 material_emissive;\n#endif\n\n#ifdef MAPFLOAT\nuniform float material_emissiveIntensity;\n#endif\n\n#ifdef MAPTEXTURE\nuniform sampler2D texture_emissiveMap;\n#endif\n\nvec3 getEmission() {\n\t\tvec3 emission = vec3(1.0);\n\n\t\t#ifdef MAPFLOAT\n\t\temission *= material_emissiveIntensity;\n\t\t#endif\n\n\t\t#ifdef MAPCOLOR\n\t\temission *= material_emissive;\n\t\t#endif\n\n\t\t#ifdef MAPTEXTURE\n\t\temission *= $texture2DSAMPLE(texture_emissiveMap, $UV, textureBias).$CH;\n\t\t#endif\n\n\t\t#ifdef MAPVERTEX\n\t\temission *= gammaCorrectInput(saturate(vVertexColor.$VC));\n\t\t#endif\n\n\t\treturn emission;\n}\n",endPS:"\n\t\t#ifdef CLEARCOAT\n\t\tgl_FragColor.rgb = combineColorCC();\n\t\t#else\n\t\tgl_FragColor.rgb = combineColor();\n\t\t#endif \n\n\t\tgl_FragColor.rgb += getEmission();\n\t\tgl_FragColor.rgb = addFog(gl_FragColor.rgb);\n\n\t\t#ifndef HDR\n\t\tgl_FragColor.rgb = toneMap(gl_FragColor.rgb);\n\t\tgl_FragColor.rgb = gammaCorrectOutput(gl_FragColor.rgb);\n\t\t#endif\n",endVS:"\n",envConstPS:"\nvec3 processEnvironment(vec3 color) {\n\t\treturn color;\n}\n",envMultiplyPS:"\nuniform float skyboxIntensity;\n\nvec3 processEnvironment(vec3 color) {\n\t\treturn color * skyboxIntensity;\n}\n",extensionPS:"\n",extensionVS:"\n",falloffInvSquaredPS:"\nfloat getFalloffWindow(float lightRadius) {\n\t\tfloat sqrDist = dot(dLightDirW, dLightDirW);\n\t\tfloat invRadius = 1.0 / lightRadius;\n\t\treturn square( saturate( 1.0 - square( sqrDist * square(invRadius) ) ) );\n}\n\nfloat getFalloffInvSquared(float lightRadius) {\n\t\tfloat sqrDist = dot(dLightDirW, dLightDirW);\n\t\tfloat falloff = 1.0 / (sqrDist + 1.0);\n\t\tfloat invRadius = 1.0 / lightRadius;\n\n\t\tfalloff *= 16.0;\n\t\tfalloff *= square( saturate( 1.0 - square( sqrDist * square(invRadius) ) ) );\n\n\t\treturn falloff;\n}\n",falloffLinearPS:"\nfloat getFalloffLinear(float lightRadius) {\n\t\tfloat d = length(dLightDirW);\n\t\treturn max(((lightRadius - d) / lightRadius), 0.0);\n}\n",fixCubemapSeamsNonePS:"\nvec3 fixSeams(vec3 vec, float mipmapIndex) {\n\t\treturn vec;\n}\n\nvec3 fixSeams(vec3 vec) {\n\t\treturn vec;\n}\n\nvec3 fixSeamsStatic(vec3 vec, float invRecMipSize) {\n\t\treturn vec;\n}\n\nvec3 calcSeam(vec3 vec) {\n\t\treturn vec3(0);\n}\n\nvec3 applySeam(vec3 vec, vec3 seam, float scale) {\n\t\treturn vec;\n}\n",fixCubemapSeamsStretchPS:"\nvec3 fixSeams(vec3 vec, float mipmapIndex) {\n\t\tvec3 avec = abs(vec);\n\t\tfloat scale = 1.0 - exp2(mipmapIndex) / 128.0;\n\t\tfloat M = max(max(avec.x, avec.y), avec.z);\n\t\tif (avec.x != M) vec.x *= scale;\n\t\tif (avec.y != M) vec.y *= scale;\n\t\tif (avec.z != M) vec.z *= scale;\n\t\treturn vec;\n}\n\nvec3 fixSeams(vec3 vec) {\n\t\tvec3 avec = abs(vec);\n\t\tfloat scale = 1.0 - 1.0 / 128.0;\n\t\tfloat M = max(max(avec.x, avec.y), avec.z);\n\t\tif (avec.x != M) vec.x *= scale;\n\t\tif (avec.y != M) vec.y *= scale;\n\t\tif (avec.z != M) vec.z *= scale;\n\t\treturn vec;\n}\n\nvec3 fixSeamsStatic(vec3 vec, float invRecMipSize) {\n\t\tvec3 avec = abs(vec);\n\t\tfloat scale = invRecMipSize;\n\t\tfloat M = max(max(avec.x, avec.y), avec.z);\n\t\tif (avec.x != M) vec.x *= scale;\n\t\tif (avec.y != M) vec.y *= scale;\n\t\tif (avec.z != M) vec.z *= scale;\n\t\treturn vec;\n}\n\nvec3 calcSeam(vec3 vec) {\n\t\tvec3 avec = abs(vec);\n\t\tfloat M = max(avec.x, max(avec.y, avec.z));\n\t\treturn vec3(avec.x != M ? 1.0 : 0.0,\n\t\t\t\t\t\t\t\tavec.y != M ? 1.0 : 0.0,\n\t\t\t\t\t\t\t\tavec.z != M ? 1.0 : 0.0);\n}\n\nvec3 applySeam(vec3 vec, vec3 seam, float scale) {\n\t\treturn vec * (seam * -scale + vec3(1.0));\n}\n",floatUnpackingPS:"\n// float unpacking functionality, complimentary to float-packing.js\nfloat bytes2float2(vec2 data) {\n\t\treturn dot(data, vec2(1.0, 1.0 / 255.0));\n}\n\nfloat bytes2float3(vec3 data) {\n\t\treturn dot(data, vec3(1.0, 1.0 / 255.0, 1.0 / 65025.0));\n}\n\nfloat bytes2float4(vec4 data) {\n\t\treturn dot(data, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));\n}\n\nfloat bytes2floatRange2(vec2 data, float min, float max) {\n\t\treturn mix(min, max, bytes2float2(data));\n}\n\nfloat bytes2floatRange3(vec3 data, float min, float max) {\n\t\treturn mix(min, max, bytes2float3(data));\n}\n\nfloat bytes2floatRange4(vec4 data, float min, float max) {\n\t\treturn mix(min, max, bytes2float4(data));\n}\n\nfloat mantissaExponent2Float(vec4 pack)\n{\n\t\tfloat value = bytes2floatRange3(pack.xyz, -1.0, 1.0);\n\t\tfloat exponent = floor(pack.w * 255.0 - 127.0);\n\t\treturn value * exp2(exponent);\n}\n",fogExpPS:"\nuniform vec3 fog_color;\nuniform float fog_density;\nfloat dBlendModeFogFactor = 1.0;\n\nvec3 addFog(vec3 color) {\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t\tfloat fogFactor = exp(-depth * fog_density);\n\t\tfogFactor = clamp(fogFactor, 0.0, 1.0);\n\t\treturn mix(fog_color * dBlendModeFogFactor, color, fogFactor);\n}\n",fogExp2PS:"\nuniform vec3 fog_color;\nuniform float fog_density;\nfloat dBlendModeFogFactor = 1.0;\n\nvec3 addFog(vec3 color) {\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t\tfloat fogFactor = exp(-depth * depth * fog_density * fog_density);\n\t\tfogFactor = clamp(fogFactor, 0.0, 1.0);\n\t\treturn mix(fog_color * dBlendModeFogFactor, color, fogFactor);\n}\n",fogLinearPS:"\nuniform vec3 fog_color;\nuniform float fog_start;\nuniform float fog_end;\nfloat dBlendModeFogFactor = 1.0;\n\nvec3 addFog(vec3 color) {\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t\tfloat fogFactor = (fog_end - depth) / (fog_end - fog_start);\n\t\tfogFactor = clamp(fogFactor, 0.0, 1.0);\n\t\treturn mix(fog_color * dBlendModeFogFactor, color, fogFactor);\n}\n",fogNonePS:"\nfloat dBlendModeFogFactor = 1.0;\n\nvec3 addFog(vec3 color) {\n\t\treturn color;\n}\n",fresnelSchlickPS:"\n// Schlick's approximation\nuniform float material_fresnelFactor; // unused\n\nvoid getFresnel() {\n\t\tfloat fresnel = 1.0 - max(dot(dNormalW, dViewDirW), 0.0);\n\t\tfloat fresnel2 = fresnel * fresnel;\n\t\tfresnel *= fresnel2 * fresnel2;\n\t\tfresnel *= dGlossiness * dGlossiness;\n\t\tdSpecularity = dSpecularity + (1.0 - dSpecularity) * fresnel;\n\n\t\t#ifdef CLEARCOAT\n\t\tfresnel = 1.0 - max(dot(ccNormalW, dViewDirW), 0.0);\n\t\tfresnel2 = fresnel * fresnel;\n\t\tfresnel *= fresnel2 * fresnel2;\n\t\tfresnel *= ccGlossiness * ccGlossiness;\n\t\tccSpecularity = ccSpecularity + (1.0 - ccSpecularity) * fresnel;\n\t\t#endif\n}\n",fullscreenQuadPS:"\nvarying vec2 vUv0;\n\nuniform sampler2D source;\n\nvoid main(void) {\n\t\tgl_FragColor = texture2D(source, vUv0);\n}\n",fullscreenQuadVS:"\nattribute vec2 vertex_position;\n\nvarying vec2 vUv0;\n\nvoid main(void)\n{\n\t\tgl_Position = vec4(vertex_position, 0.5, 1.0);\n\t\tvUv0 = vertex_position.xy*0.5+0.5;\n}\n",gamma1_0PS:"\nvec4 texture2DSRGB(sampler2D tex, vec2 uv) {\n\t\treturn texture2D(tex, uv);\n}\n\nvec4 texture2DSRGB(sampler2D tex, vec2 uv, float bias) {\n\t\treturn texture2D(tex, uv, bias);\n}\n\nvec4 textureCubeSRGB(samplerCube tex, vec3 uvw) {\n\t\treturn textureCube(tex, uvw);\n}\n\nvec3 gammaCorrectOutput(vec3 color) {\n\t\treturn color;\n}\n\nvec3 gammaCorrectInput(vec3 color) {\n\t\treturn color;\n}\n\nfloat gammaCorrectInput(float color) {\n\t\treturn color;\n}\n\nvec4 gammaCorrectInput(vec4 color) {\n\t\treturn color;\n}\n",gamma2_2PS:"\nvec3 gammaCorrectInput(vec3 color) {\n\t\treturn pow(color, vec3(2.2));\n}\n\nfloat gammaCorrectInput(float color) {\n\t\treturn pow(color, 2.2);\n}\n\nvec4 gammaCorrectInput(vec4 color) {\n\t\treturn vec4(pow(color.rgb, vec3(2.2)), color.a);\n}\n\nvec4 texture2DSRGB(sampler2D tex, vec2 uv) {\n\t\tvec4 rgba = texture2D(tex, uv);\n\t\trgba.rgb = gammaCorrectInput(rgba.rgb);\n\t\treturn rgba;\n}\n\nvec4 texture2DSRGB(sampler2D tex, vec2 uv, float bias) {\n\t\tvec4 rgba = texture2D(tex, uv, bias);\n\t\trgba.rgb = gammaCorrectInput(rgba.rgb);\n\t\treturn rgba;\n}\n\nvec4 textureCubeSRGB(samplerCube tex, vec3 uvw) {\n\t\tvec4 rgba = textureCube(tex, uvw);\n\t\trgba.rgb = gammaCorrectInput(rgba.rgb);\n\t\treturn rgba;\n}\n\nvec3 gammaCorrectOutput(vec3 color) {\n\t\t#ifdef HDR\n\t\treturn color;\n\t\t#else\n\t\tcolor += vec3(0.0000001);\n\t\treturn pow(color, vec3(0.45));\n\t\t#endif\n}\n",gles3PS:"\n#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:"\n#define attribute in\n#define varying out\n#define texture2D texture\n#define GL2\n#define VERTEXSHADER\n",glossPS:"\n#ifdef MAPFLOAT\nuniform float material_shininess;\n#endif\n\n#ifdef MAPTEXTURE\nuniform sampler2D texture_glossMap;\n#endif\n\nvoid getGlossiness() {\n\t\tdGlossiness = 1.0;\n\n\t\t#ifdef MAPFLOAT\n\t\tdGlossiness *= material_shininess;\n\t\t#endif\n\n\t\t#ifdef MAPTEXTURE\n\t\tdGlossiness *= texture2D(texture_glossMap, $UV, textureBias).$CH;\n\t\t#endif\n\n\t\t#ifdef MAPVERTEX\n\t\tdGlossiness *= saturate(vVertexColor.$VC);\n\t\t#endif\n\n\t\tdGlossiness += 0.0000001;\n}\n",instancingVS:"\nattribute vec4 instance_line1;\nattribute vec4 instance_line2;\nattribute vec4 instance_line3;\nattribute vec4 instance_line4;\n",lightDiffuseLambertPS:"\nfloat getLightDiffuse() {\n\t\treturn max(dot(dNormalW, -dLightDirNormW), 0.0);\n}\n",lightDirPointPS:"\nvoid getLightDirPoint(vec3 lightPosW) {\n\t\tdLightDirW = vPositionW - lightPosW;\n\t\tdLightDirNormW = normalize(dLightDirW);\n\t\tdLightPosW = lightPosW;\n}\n",lightmapDirPS:"\nuniform sampler2D texture_lightMap;\nuniform sampler2D texture_dirLightMap;\n\nvoid addLightMap() {\n\t\tvec3 color = $texture2DSAMPLE(texture_lightMap, $UV, textureBias).$CH;\n\t\tvec3 dir = texture2D(texture_dirLightMap, $UV, textureBias).xyz;\n\t\tif (dot(dir, vec3(1.0)) < 0.00001) {\n\t\t\t\tdDiffuseLight += color;\n\t\t} else {\n\t\t\t\tdLightDirNormW = normalize(dir * 2.0 - vec3(1.0));\n\n\t\t\t\tfloat vlight = saturate(dot(dLightDirNormW, -dVertexNormalW));\n\t\t\t\tfloat flight = saturate(dot(dLightDirNormW, -dNormalW));\n\t\t\t\tfloat nlight = (flight / max(vlight, 0.01)) * 0.5;\n\n\t\t\t\tdDiffuseLight += color * nlight * 2.0;\n\t\t}\n\n\t\tdSpecularLight += color * getLightSpecular();\n}\n",lightmapSinglePS:"\n#ifdef MAPTEXTURE\nuniform sampler2D texture_lightMap;\n#endif\n\nvoid addLightMap() {\n\t\tvec3 lm = vec3(1.0);\n\n\t\t#ifdef MAPTEXTURE\n\t\tlm *= $texture2DSAMPLE(texture_lightMap, $UV, textureBias).$CH;\n\t\t#endif\n\n\t\t#ifdef MAPVERTEX\n\t\tlm *= saturate(vVertexColor.$VC);\n\t\t#endif\n\t\t\n\t\tdDiffuseLight += lm;\n}\n",lightmapSingleVertPS:"\nvoid addLightMap() {\n\t\tdDiffuseLight += saturate(vVertexColor.$CH);\n}\n",lightSpecularAnisoGGXPS:"\n// Anisotropic GGX\nfloat calcLightSpecular(float tGlossiness, vec3 tNormalW) {\n\t\tfloat PI = 3.141592653589793;\n\t\tfloat roughness = max((1.0 - tGlossiness) * (1.0 - tGlossiness), 0.001);\n\t\tfloat anisotropy = material_anisotropy * roughness;\n \n\t\tfloat at = max((roughness + anisotropy), roughness / 4.0);\n\t\tfloat ab = max((roughness - anisotropy), roughness / 4.0);\n\n\t\tvec3 h = normalize(normalize(-dLightDirNormW) + normalize(dViewDirW));\n\n\t\tfloat NoH = dot(tNormalW, h);\n\t\tfloat ToH = dot(dTBN[0], h);\n\t\tfloat BoH = dot(dTBN[1], h);\n\n\t\tfloat a2 = at * ab;\n\t\tvec3 v = vec3(ab * ToH, at * BoH, a2 * NoH);\n\t\tfloat v2 = dot(v, v);\n\t\tfloat w2 = a2 / v2;\n\t\tfloat D = a2 * w2 * w2 * (1.0 / PI);\n\n\t\tfloat ToV = dot(dTBN[0], dViewDirW);\n\t\tfloat BoV = dot(dTBN[1], dViewDirW);\n\t\tfloat ToL = dot(dTBN[0], -dLightDirNormW);\n\t\tfloat BoL = dot(dTBN[1], -dLightDirNormW);\n\t\tfloat NoV = dot(tNormalW, dViewDirW);\n\t\tfloat NoL = dot(tNormalW, -dLightDirNormW);\n\n\t\tfloat lambdaV = NoL * length(vec3(at * ToV, ab * BoV, NoV));\n\t\tfloat lambdaL = NoV * length(vec3(at * ToL, ab * BoL, NoL));\n\t\tfloat G = 0.5 / (lambdaV + lambdaL);\n\n\t\treturn D * G;\n}\n\nfloat getLightSpecular() {\n\t\treturn calcLightSpecular(dGlossiness, dNormalW);\n}\n\nfloat getLightSpecularCC() {\n\t\treturn calcLightSpecular(ccGlossiness, ccNormalW);\n}\n",lightSpecularBlinnPS:"\n// Energy-conserving (hopefully) Blinn-Phong\nfloat calcLightSpecular(float tGlossiness, vec3 tNormalW) {\n\t\tvec3 h = normalize( -dLightDirNormW + dViewDirW );\n\t\tfloat nh = max( dot( h, tNormalW ), 0.0 );\n\n\t\tfloat specPow = exp2(tGlossiness * 11.0); // glossiness is linear, power is not; 0 - 2048\n\t\tspecPow = antiAliasGlossiness(specPow);\n\n\t\t// Hack: On Mac OS X, calling pow with zero for the exponent generates hideous artifacts so bias up a little\n\t\tspecPow = max(specPow, 0.0001);\n\n\t\treturn pow(nh, specPow) * (specPow + 2.0) / 8.0;\n}\n\nfloat getLightSpecular() {\n\t\treturn calcLightSpecular(dGlossiness, dNormalW);\n}\n\nfloat getLightSpecularCC() {\n\t\treturn calcLightSpecular(ccGlossiness, ccNormalW);\n}\n",lightSpecularPhongPS:"\nfloat calcLightSpecular(float tGlossiness, vec3 tReflDirW) {\n\t\tfloat specPow = tGlossiness;\n\n\t\tspecPow = antiAliasGlossiness(specPow);\n\n\t\t// Hack: On Mac OS X, calling pow with zero for the exponent generates hideous artifacts so bias up a little\n\t\treturn pow(max(dot(tReflDirW, -dLightDirNormW), 0.0), specPow + 0.0001);\n}\n\nfloat getLightSpecular() {\n\t\treturn calcLightSpecular(dGlossiness, dReflDirW);\n}\n\nfloat getLightSpecularCC() {\n\t\treturn calcLightSpecular(ccGlossiness, ccReflDirW);\n}\n",ltc:'\n// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines\n// by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt\n// code: https://github.com/selfshadow/ltc_code/\n\nmat3 transposeMat3( const in mat3 m ) {\n\t\tmat3 tmp;\n\t\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\t\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\t\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\t\treturn tmp;\n}\n\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\t\tconst float LUT_SIZE = 64.0;\n\t\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\t\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\t\tfloat dotNV = saturate( dot( N, V ) );\n\t\t// texture parameterized by sqrt( GGX alpha ) and sqrt( 1 - cos( theta ) )\n\t\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\t\tuv = uv * LUT_SCALE + LUT_BIAS;\n\t\treturn uv;\n}\n\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\t\t// Real-Time Area Lighting: a Journey from Research to Production (p.102)\n\t\t// An approximation of the form factor of a horizon-clipped rectangle.\n\t\tfloat l = length( f );\n\t\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\n\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\t\tfloat x = dot( v1, v2 );\n\t\tfloat y = abs( x );\n\t\t// rational polynomial approximation to theta / sin( theta ) / 2PI\n\t\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\t\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\t\tfloat v = a / b;\n\t\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\t\treturn cross( v1, v2 ) * theta_sintheta;\n}\n\nstruct Coords {\n\t\tvec3 coord0;\n\t\tvec3 coord1;\n\t\tvec3 coord2;\n\t\tvec3 coord3;\n};\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\t\t// bail if point is on back side of plane of light\n\t\t// assumes ccw winding order of light vertices\n\t\tvec3 v1 = rectCoords.coord1 - rectCoords.coord0;\n\t\tvec3 v2 = rectCoords.coord3 - rectCoords.coord0;\n\t\t\n\t\tvec3 lightNormal = cross( v1, v2 );\n\t\t// if( dot( lightNormal, P - rectCoords.coord0 ) < 0.0 ) return 0.0;\n\t\tfloat factor = sign(-dot( lightNormal, P - rectCoords.coord0 ));\n\n\t\t// construct orthonormal basis around N\n\t\tvec3 T1, T2;\n\t\tT1 = normalize( V - N * dot( V, N ) );\n\t\tT2 =\tfactor * cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system\n\t\t// compute transform\n\t\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\t\t// transform rect\n\t\tvec3 coords[ 4 ];\n\t\tcoords[ 0 ] = mat * ( rectCoords.coord0 - P );\n\t\tcoords[ 1 ] = mat * ( rectCoords.coord1 - P );\n\t\tcoords[ 2 ] = mat * ( rectCoords.coord2 - P );\n\t\tcoords[ 3 ] = mat * ( rectCoords.coord3 - P );\n\t\t// project rect onto sphere\n\t\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\t\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\t\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\t\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\t\t// calculate vector form factor\n\t\tvec3 vectorFormFactor = vec3( 0.0 );\n\t\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\t\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\t\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\t\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\t\t// adjust for horizon clipping\n\t\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\n\t\treturn result;\n}\n\nCoords dLTCCoords;\nCoords getLTCLightCoords(vec3 lightPos, vec3 halfWidth, vec3 halfHeight){\n\t\tCoords coords;\n\t\tcoords.coord0 = lightPos + halfWidth - halfHeight;\n\t\tcoords.coord1 = lightPos - halfWidth - halfHeight;\n\t\tcoords.coord2 = lightPos - halfWidth + halfHeight;\n\t\tcoords.coord3 = lightPos + halfWidth + halfHeight;\n\t\treturn coords;\n}\n\nfloat dSphereRadius;\nCoords getSphereLightCoords(vec3 lightPos, vec3 halfWidth, vec3 halfHeight){\n\t\t// used for simple sphere light falloff\n\t\t// also, the code only handles a spherical light, it cannot be non-uniformly scaled in world space, and so we enforce it here\n\t\tdSphereRadius = max(length(halfWidth), length(halfHeight));\n\n\t\t// Billboard the 2d light quad to reflection vector, as it\'s used for specular. This allows us to use disk math for the sphere.\n\t\tvec3 f = reflect(normalize(lightPos - view_position), vNormalW);\n\t\tvec3 w = normalize(cross(f, halfHeight));\n\t\tvec3 h = normalize(cross(f, w));\n\n\t\treturn getLTCLightCoords(lightPos, w * dSphereRadius, h * dSphereRadius);\n}\n\n// used for LTC LUT texture lookup\nvec2 dLTCUV;\n#ifdef CLEARCOAT\nvec2 ccLTCUV;\n#endif\nvec2 getLTCLightUV(float tGlossiness, vec3 tNormalW)\n{\n\t\tfloat roughness = max((1.0 - tGlossiness) * (1.0 - tGlossiness), 0.001);\n\t\treturn LTC_Uv( tNormalW, dViewDirW, roughness );\n}\n\n//used for energy conservation and to modulate specular\nvec3 dLTCSpecFres;\n#ifdef CLEARCOAT\nvec3 ccLTCSpecFres;\n#endif\nvec3 getLTCLightSpecFres(vec2 uv, vec3 tSpecularity)\n{\n\t\tvec4 t2 = texture2D( areaLightsLutTex2, uv );\n\n\t\t#ifdef AREA_R8_G8_B8_A8_LUTS\n\t\tt2 *= vec4(0.693103,1,1,1);\n\t\tt2 += vec4(0.306897,0,0,0);\n\t\t#endif\n\n\t\treturn tSpecularity * t2.x + ( vec3( 1.0 ) - tSpecularity) * t2.y;\n}\n\nvoid calcLTCLightValues()\n{\n\t\tdLTCUV = getLTCLightUV(dGlossiness, dNormalW);\n\t\tdLTCSpecFres = getLTCLightSpecFres(dLTCUV, dSpecularityNoFres); \n\n#ifdef CLEARCOAT\n\t\tccLTCUV = getLTCLightUV(ccGlossiness, ccNormalW);\n\t\tccLTCSpecFres = getLTCLightSpecFres(ccLTCUV, vec3(ccSpecularityNoFres));\n#endif\n}\n\nvoid calcRectLightValues(vec3 lightPos, vec3 halfWidth, vec3 halfHeight)\n{\n\t\tdLTCCoords = getLTCLightCoords(lightPos, halfWidth, halfHeight);\n}\nvoid calcDiskLightValues(vec3 lightPos, vec3 halfWidth, vec3 halfHeight)\n{\n\t\tcalcRectLightValues(lightPos, halfWidth, halfHeight);\n}\nvoid calcSphereLightValues(vec3 lightPos, vec3 halfWidth, vec3 halfHeight)\n{\n\t\tdLTCCoords = getSphereLightCoords(lightPos, halfWidth, halfHeight);\n}\n\n// An extended version of the implementation from\n// "How to solve a cubic equation, revisited"\n// http://momentsingraphics.de/?p=105\nvec3 SolveCubic(vec4 Coefficient)\n{\n\t\tfloat pi = 3.14159;\n\t\t// Normalize the polynomial\n\t\tCoefficient.xyz /= Coefficient.w;\n\t\t// Divide middle coefficients by three\n\t\tCoefficient.yz /= 3.0;\n\n\t\tfloat A = Coefficient.w;\n\t\tfloat B = Coefficient.z;\n\t\tfloat C = Coefficient.y;\n\t\tfloat D = Coefficient.x;\n\n\t\t// Compute the Hessian and the discriminant\n\t\tvec3 Delta = vec3(\n\t\t\t\t-Coefficient.z * Coefficient.z + Coefficient.y,\n\t\t\t\t-Coefficient.y * Coefficient.z + Coefficient.x,\n\t\t\t\tdot(vec2(Coefficient.z, -Coefficient.y), Coefficient.xy)\n\t\t);\n\n\t\tfloat Discriminant = dot(vec2(4.0 * Delta.x, -Delta.y), Delta.zy);\n\n\t\tvec3 RootsA, RootsD;\n\n\t\tvec2 xlc, xsc;\n\n\t\t// Algorithm A\n\t\t{\n\t\t\t\tfloat A_a = 1.0;\n\t\t\t\tfloat C_a = Delta.x;\n\t\t\t\tfloat D_a = -2.0 * B * Delta.x + Delta.y;\n\n\t\t\t\t// Take the cubic root of a normalized complex number\n\t\t\t\tfloat Theta = atan(sqrt(Discriminant), -D_a) / 3.0;\n\n\t\t\t\tfloat x_1a = 2.0 * sqrt(-C_a) * cos(Theta);\n\t\t\t\tfloat x_3a = 2.0 * sqrt(-C_a) * cos(Theta + (2.0 / 3.0) * pi);\n\n\t\t\t\tfloat xl;\n\t\t\t\tif ((x_1a + x_3a) > 2.0 * B)\n\t\t\t\t\t\txl = x_1a;\n\t\t\t\telse\n\t\t\t\t\t\txl = x_3a;\n\n\t\t\t\txlc = vec2(xl - B, A);\n\t\t}\n\n\t\t// Algorithm D\n\t\t{\n\t\t\t\tfloat A_d = D;\n\t\t\t\tfloat C_d = Delta.z;\n\t\t\t\tfloat D_d = -D * Delta.y + 2.0 * C * Delta.z;\n\n\t\t\t\t// Take the cubic root of a normalized complex number\n\t\t\t\tfloat Theta = atan(D * sqrt(Discriminant), -D_d) / 3.0;\n\n\t\t\t\tfloat x_1d = 2.0 * sqrt(-C_d) * cos(Theta);\n\t\t\t\tfloat x_3d = 2.0 * sqrt(-C_d) * cos(Theta + (2.0 / 3.0) * pi);\n\n\t\t\t\tfloat xs;\n\t\t\t\tif (x_1d + x_3d < 2.0 * C)\n\t\t\t\t\t\txs = x_1d;\n\t\t\t\telse\n\t\t\t\t\t\txs = x_3d;\n\n\t\t\t\txsc = vec2(-D, xs + C);\n\t\t}\n\n\t\tfloat E =\txlc.y * xsc.y;\n\t\tfloat F = -xlc.x * xsc.y - xlc.y * xsc.x;\n\t\tfloat G =\txlc.x * xsc.x;\n\n\t\tvec2 xmc = vec2(C * F - B * G, -B * F + C * E);\n\n\t\tvec3 Root = vec3(xsc.x / xsc.y, xmc.x / xmc.y, xlc.x / xlc.y);\n\n\t\tif (Root.x < Root.y && Root.x < Root.z)\n\t\t\t\tRoot.xyz = Root.yxz;\n\t\telse if (Root.z < Root.x && Root.z < Root.y)\n\t\t\t\tRoot.xyz = Root.xzy;\n\n\t\treturn Root;\n}\n\nfloat LTC_EvaluateDisk(vec3 N, vec3 V, vec3 P, mat3 Minv, Coords points)\n{\n\t\t// construct orthonormal basis around N\n\t\tvec3 T1, T2;\n\t\tT1 = normalize(V - N * dot(V, N));\n\t\tT2 = cross(N, T1);\n\n\t\t// rotate area light in (T1, T2, N) basis\n\t\t//mat3 R = transpose(mat3(T1, T2, N));\n\t\tmat3 R = transposeMat3( mat3( T1, T2, N ) );\n\t\t// polygon (allocate 5 vertices for clipping)\n\t\tvec3 L_[ 3 ];\n\t\tL_[ 0 ] = R * ( points.coord0 - P );\n\t\tL_[ 1 ] = R * ( points.coord1 - P );\n\t\tL_[ 2 ] = R * ( points.coord2 - P );\n\n\t\tvec3 Lo_i = vec3(0);\n\n\t\t// init ellipse\n\t\tvec3 C\t= 0.5 * (L_[0] + L_[2]);\n\t\tvec3 V1 = 0.5 * (L_[1] - L_[2]);\n\t\tvec3 V2 = 0.5 * (L_[1] - L_[0]);\n\n\t\tC\t= Minv * C;\n\t\tV1 = Minv * V1;\n\t\tV2 = Minv * V2;\n\n\t\t//if(dot(cross(V1, V2), C) > 0.0)\n\t\t//\t\treturn 0.0;\n\n\t\t// compute eigenvectors of ellipse\n\t\tfloat a, b;\n\t\tfloat d11 = dot(V1, V1);\n\t\tfloat d22 = dot(V2, V2);\n\t\tfloat d12 = dot(V1, V2);\n\t\tif (abs(d12) / sqrt(d11 * d22) > 0.0001)\n\t\t{\n\t\t\t\tfloat tr = d11 + d22;\n\t\t\t\tfloat det = -d12 * d12 + d11 * d22;\n\n\t\t\t\t// use sqrt matrix to solve for eigenvalues\n\t\t\t\tdet = sqrt(det);\n\t\t\t\tfloat u = 0.5 * sqrt(tr - 2.0 * det);\n\t\t\t\tfloat v = 0.5 * sqrt(tr + 2.0 * det);\n\t\t\t\tfloat e_max = (u + v) * (u + v);\n\t\t\t\tfloat e_min = (u - v) * (u - v);\n\n\t\t\t\tvec3 V1_, V2_;\n\n\t\t\t\tif (d11 > d22)\n\t\t\t\t{\n\t\t\t\t\t\tV1_ = d12 * V1 + (e_max - d11) * V2;\n\t\t\t\t\t\tV2_ = d12 * V1 + (e_min - d11) * V2;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\tV1_ = d12*V2 + (e_max - d22)*V1;\n\t\t\t\t\t\tV2_ = d12*V2 + (e_min - d22)*V1;\n\t\t\t\t}\n\n\t\t\t\ta = 1.0 / e_max;\n\t\t\t\tb = 1.0 / e_min;\n\t\t\t\tV1 = normalize(V1_);\n\t\t\t\tV2 = normalize(V2_);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\ta = 1.0 / dot(V1, V1);\n\t\t\t\tb = 1.0 / dot(V2, V2);\n\t\t\t\tV1 *= sqrt(a);\n\t\t\t\tV2 *= sqrt(b);\n\t\t}\n\n\t\tvec3 V3 = cross(V1, V2);\n\t\tif (dot(C, V3) < 0.0)\n\t\t\t\tV3 *= -1.0;\n\n\t\tfloat L\t= dot(V3, C);\n\t\tfloat x0 = dot(V1, C) / L;\n\t\tfloat y0 = dot(V2, C) / L;\n\n\t\tfloat E1 = inversesqrt(a);\n\t\tfloat E2 = inversesqrt(b);\n\n\t\ta *= L * L;\n\t\tb *= L * L;\n\n\t\tfloat c0 = a * b;\n\t\tfloat c1 = a * b * (1.0 + x0 * x0 + y0 * y0) - a - b;\n\t\tfloat c2 = 1.0 - a * (1.0 + x0 * x0) - b * (1.0 + y0 * y0);\n\t\tfloat c3 = 1.0;\n\n\t\tvec3 roots = SolveCubic(vec4(c0, c1, c2, c3));\n\t\tfloat e1 = roots.x;\n\t\tfloat e2 = roots.y;\n\t\tfloat e3 = roots.z;\n\n\t\tvec3 avgDir = vec3(a * x0 / (a - e2), b * y0 / (b - e2), 1.0);\n\n\t\tmat3 rotate = mat3(V1, V2, V3);\n\n\t\tavgDir = rotate * avgDir;\n\t\tavgDir = normalize(avgDir);\n\n\t\tfloat L1 = sqrt(-e2 / e3);\n\t\tfloat L2 = sqrt(-e2 / e1);\n\n\t\tfloat formFactor = L1 * L2 * inversesqrt((1.0 + L1 * L1) * (1.0 + L2 * L2));\n\t\t\n\t\tconst float LUT_SIZE = 64.0;\n\t\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\t\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\n\t\t// use tabulated horizon-clipped sphere\n\t\tvec2 uv = vec2(avgDir.z * 0.5 + 0.5, formFactor);\n\t\tuv = uv*LUT_SCALE + LUT_BIAS;\n\n\t\tfloat scale = texture2D( areaLightsLutTex2, uv ).w;\n\n\t\treturn formFactor*scale;\n}\n\nfloat getRectLightDiffuse() {\n\t\treturn LTC_EvaluateRect( dNormalW, dViewDirW, vPositionW, mat3( 1.0 ), dLTCCoords );\n}\n\nfloat getDiskLightDiffuse() {\n\t\treturn LTC_EvaluateDisk( dNormalW, dViewDirW, vPositionW, mat3( 1.0 ), dLTCCoords );\n}\n\nfloat getSphereLightDiffuse() {\n\t\t// NB: this could be improved further with distance based wrap lighting\n\t\tfloat falloff = dSphereRadius / (dot(dLightDirW, dLightDirW) + dSphereRadius);\n\t\treturn getLightDiffuse()*falloff;\n}\n\nmat3 getLTCLightInvMat(vec2 uv)\n{\n\t\tvec4 t1 = texture2D( areaLightsLutTex1, uv );\n\n\t\t#ifdef AREA_R8_G8_B8_A8_LUTS\n\t\tt1 *= vec4(1.001, 0.3239, 0.60437568, 1.0);\n\t\tt1 += vec4(0.0, -0.2976, -0.01381, 0.0);\n\t\t#endif\n\n\t\treturn mat3(\n\t\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\t\tvec3(\t\t0, 1,\t\t0 ),\n\t\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n}\n\nfloat calcRectLightSpecular(vec3 tNormalW, vec2 uv) {\n\t\tmat3 mInv = getLTCLightInvMat(uv);\n\t\treturn LTC_EvaluateRect( tNormalW, dViewDirW, vPositionW, mInv, dLTCCoords );\n}\n\nfloat getRectLightSpecular() {\n\t\treturn calcRectLightSpecular(dNormalW, dLTCUV);\n}\n\n#ifdef CLEARCOAT\nfloat getRectLightSpecularCC() {\n\t\treturn calcRectLightSpecular(ccNormalW, ccLTCUV);\n}\n#endif\n\nfloat calcDiskLightSpecular(vec3 tNormalW, vec2 uv) {\n\t\tmat3 mInv = getLTCLightInvMat(uv);\n\t\treturn LTC_EvaluateDisk( tNormalW, dViewDirW, vPositionW, mInv, dLTCCoords );\n}\n\nfloat getDiskLightSpecular() {\n\t\treturn calcDiskLightSpecular(dNormalW, dLTCUV);\n}\n\n#ifdef CLEARCOAT\nfloat getDiskLightSpecularCC() {\n\t\treturn calcDiskLightSpecular(ccNormalW, ccLTCUV);\n}\n#endif\n\nfloat getSphereLightSpecular() {\n\t\treturn calcDiskLightSpecular(dNormalW, dLTCUV);\n}\n\n#ifdef CLEARCOAT\nfloat getSphereLightSpecularCC() {\n\t\treturn calcDiskLightSpecular(ccNormalW, ccLTCUV);\n}\n#endif\n',metalnessPS:"\nvoid processMetalness(float metalness) {\n\t\tconst float dielectricF0 = 0.04;\n\t\tdSpecularity = mix(vec3(dielectricF0), dAlbedo, metalness);\n\t\tdAlbedo *= 1.0 - metalness;\n}\n\n#ifdef MAPFLOAT\nuniform float material_metalness;\n#endif\n\n#ifdef MAPTEXTURE\nuniform sampler2D texture_metalnessMap;\n#endif\n\nvoid getSpecularity() {\n\t\tfloat metalness = 1.0;\n\n\t\t#ifdef MAPFLOAT\n\t\tmetalness *= material_metalness;\n\t\t#endif\n\n\t\t#ifdef MAPTEXTURE\n\t\tmetalness *= texture2D(texture_metalnessMap, $UV, textureBias).$CH;\n\t\t#endif\n\n\t\t#ifdef MAPVERTEX\n\t\tmetalness *= saturate(vVertexColor.$VC);\n\t\t#endif\n\n\t\tprocessMetalness(metalness);\n}\n",msdfPS:"\nuniform sampler2D texture_msdfMap;\n\n#ifdef GL_OES_standard_derivatives\n#define USE_FWIDTH\n#endif\n\n#ifdef GL2\n#define USE_FWIDTH\n#endif\n\nfloat median(float r, float g, float b) {\n\t\treturn max(min(r, g), min(max(r, g), b));\n}\n\nfloat map (float min, float max, float v) {\n\t\treturn (v - min) / (max - min);\n}\n\nuniform float font_sdfIntensity; // intensity is used to boost the value read from the SDF, 0 is no boost, 1.0 is max boost\nuniform float font_pxrange;\t\t\t// the number of pixels between inside and outside the font in SDF\nuniform float font_textureWidth; // the width of the texture atlas\n\nuniform vec4 outline_color;\nuniform float outline_thickness;\nuniform vec4 shadow_color;\nuniform vec2 shadow_offset;\n\nvec4 applyMsdf(vec4 color) {\n\t\t// sample the field\n\t\tvec3 tsample = texture2D(texture_msdfMap, vUv0).rgb;\n\t\tvec2 uvShdw = vUv0 - shadow_offset;\n\t\tvec3 ssample = texture2D(texture_msdfMap, uvShdw).rgb;\n\t\t// get the signed distance value\n\t\tfloat sigDist = median(tsample.r, tsample.g, tsample.b);\n\t\tfloat sigDistShdw = median(ssample.r, ssample.g, ssample.b);\n\n\t\t// smoothing limit - smaller value makes for sharper but more aliased text, especially on angles\n\t\t// too large value (0.5) creates a dark glow around the letters\n\t\tfloat smoothingMax = 0.2;\n\n\t\t#ifdef USE_FWIDTH\n\t\t// smoothing depends on size of texture on screen\n\t\tvec2 w = fwidth(vUv0);\n\t\tfloat smoothing = clamp(w.x * font_textureWidth / font_pxrange, 0.0, smoothingMax);\n\t\t#else\n\t\tfloat font_size = 16.0; // TODO fix this\n\t\t// smoothing gets smaller as the font size gets bigger\n\t\t// don't have fwidth we can approximate from font size, this doesn't account for scaling\n\t\t// so a big font scaled down will be wrong...\n\t\tfloat smoothing = clamp(font_pxrange / font_size, 0.0, smoothingMax);\n\t\t#endif\n\n\t\tfloat mapMin = 0.05;\n\t\tfloat mapMax = clamp(1.0 - font_sdfIntensity, mapMin, 1.0);\n\n\t\t// remap to a smaller range (used on smaller font sizes)\n\t\tfloat sigDistInner = map(mapMin, mapMax, sigDist);\n\t\tfloat sigDistOutline = map(mapMin, mapMax, sigDist + outline_thickness);\n\t\tsigDistShdw = map(mapMin, mapMax, sigDistShdw + outline_thickness);\n\n\t\tfloat center = 0.5;\n\t\t// calculate smoothing and use to generate opacity\n\t\tfloat inside = smoothstep(center-smoothing, center+smoothing, sigDistInner);\n\t\tfloat outline = smoothstep(center-smoothing, center+smoothing, sigDistOutline);\n\t\tfloat shadow = smoothstep(center-smoothing, center+smoothing, sigDistShdw);\n\n\t\tvec4 tcolor = (outline > inside) ? outline * vec4(outline_color.a * outline_color.rgb, outline_color.a) : vec4(0.0);\n\t\ttcolor = mix(tcolor, color, inside);\n\n\t\tvec4 scolor = (shadow > outline) ? shadow * vec4(shadow_color.a * shadow_color.rgb, shadow_color.a) : tcolor;\n\t\ttcolor = mix(scolor, tcolor, outline);\n\t\t\n\t\treturn tcolor;\n}\n",normalVS:"\n#ifdef MORPHING_TEXTURE_BASED_NORMAL\nuniform highp sampler2D morphNormalTex;\n#endif\n\nvec3 getNormal() {\n\t\t#ifdef SKIN\n\t\tdNormalMatrix = mat3(dModelMatrix[0].xyz, dModelMatrix[1].xyz, dModelMatrix[2].xyz);\n\t\t#elif defined(INSTANCING)\n\t\tdNormalMatrix = mat3(instance_line1.xyz, instance_line2.xyz, instance_line3.xyz);\n\t\t#else\n\t\tdNormalMatrix = matrix_normal;\n\t\t#endif\n\n\t\tvec3 tempNormal = vertex_normal;\n\n\t\t#ifdef MORPHING\n\t\t#ifdef MORPHING_NRM03\n\t\ttempNormal += morph_weights_a[0] * morph_nrm0;\n\t\ttempNormal += morph_weights_a[1] * morph_nrm1;\n\t\ttempNormal += morph_weights_a[2] * morph_nrm2;\n\t\ttempNormal += morph_weights_a[3] * morph_nrm3;\n\t\t#endif\n\t\t#ifdef MORPHING_NRM47\n\t\ttempNormal += morph_weights_b[0] * morph_nrm4;\n\t\ttempNormal += morph_weights_b[1] * morph_nrm5;\n\t\ttempNormal += morph_weights_b[2] * morph_nrm6;\n\t\ttempNormal += morph_weights_b[3] * morph_nrm7;\n\t\t#endif\n\t\t#endif\n\n\t\t#ifdef MORPHING_TEXTURE_BASED_NORMAL\n\t\t// apply morph offset from texture\n\t\tvec2 morphUV = getTextureMorphCoords();\n\t\tvec3 morphNormal = texture2D(morphNormalTex, morphUV).xyz;\n\t\ttempNormal += morphNormal;\n\t\t#endif\n\n\t\treturn normalize(dNormalMatrix * tempNormal);\n}\n",normalDetailMapPS:"\n#ifdef MAPTEXTURE\nuniform sampler2D texture_normalDetailMap;\nuniform float material_normalDetailMapBumpiness;\n\nvec3 blendNormals(vec3 n1, vec3 n2) {\n\t\t// https://blog.selfshadow.com/publications/blending-in-detail/#detail-oriented\n\t\tn1 += vec3(0, 0, 1);\n\t\tn2 *= vec3(-1, -1, 1);\n\t\treturn normalize(n1*dot(n1, n2)/n1.z - n2);\n}\n#endif\n\nvec3 addNormalDetail(vec3 normalMap) {\n\t\t#ifdef MAPTEXTURE\n\t\tvec3 normalDetailMap = unpackNormal(texture2D(texture_normalDetailMap, $UV, textureBias));\n\t\tnormalDetailMap = normalize(mix(vec3(0.0, 0.0, 1.0), normalDetailMap, material_normalDetailMapBumpiness));\n\t\treturn blendNormals(normalMap, normalDetailMap);\n\t\t#else\n\t\treturn normalMap;\n\t\t#endif\n}\n",normalInstancedVS:"\nvec3 getNormal() {\n\t\tdNormalMatrix = mat3(instance_line1.xyz, instance_line2.xyz, instance_line3.xyz);\n\t\treturn normalize(dNormalMatrix * vertex_normal);\n}\n",normalMapPS:"\nuniform sampler2D texture_normalMap;\nuniform float material_bumpiness;\n\nvoid getNormal() {\n\t\tvec3 normalMap = unpackNormal(texture2D(texture_normalMap, $UV, textureBias));\n\t\tnormalMap = normalize(mix(vec3(0.0, 0.0, 1.0), normalMap, material_bumpiness));\n\t\tdNormalMap = addNormalDetail(normalMap);\n\t\tdNormalW = dTBN * dNormalMap;\n}\n",normalMapFastPS:"\nuniform sampler2D texture_normalMap;\n\nvoid getNormal() {\n\t\tvec3 normalMap = unpackNormal(texture2D(texture_normalMap, $UV, textureBias));\n\t\tdNormalMap = addNormalDetail(normalMap);\n\t\tdNormalW = dTBN * dNormalMap;\n}\n",normalSkinnedVS:"\nvec3 getNormal() {\n\t\tdNormalMatrix = mat3(dModelMatrix[0].xyz, dModelMatrix[1].xyz, dModelMatrix[2].xyz);\n\t\treturn normalize(dNormalMatrix * vertex_normal);\n}\n",normalVertexPS:"\nvoid getNormal() {\n\t\tdNormalW = normalize(dVertexNormalW);\n}\n",normalXYPS:"\nvec3 unpackNormal(vec4 nmap) {\n\t\tvec3 normal;\n\t\tnormal.xy = nmap.wy * 2.0 - 1.0;\n\t\tnormal.z = sqrt(1.0 - saturate(dot(normal.xy, normal.xy)));\n\t\treturn normal;\n}\n",normalXYZPS:"\nvec3 unpackNormal(vec4 nmap) {\n\t\treturn nmap.xyz * 2.0 - 1.0;\n}\n",opacityPS:"\n#ifdef MAPFLOAT\nuniform float material_opacity;\n#endif\n\n#ifdef MAPTEXTURE\nuniform sampler2D texture_opacityMap;\n#endif\n\nvoid getOpacity() {\n\t\tdAlpha = 1.0;\n\n\t\t#ifdef MAPFLOAT\n\t\tdAlpha *= material_opacity;\n\t\t#endif\n\n\t\t#ifdef MAPTEXTURE\n\t\tdAlpha *= texture2D(texture_opacityMap, $UV, textureBias).$CH;\n\t\t#endif\n\n\t\t#ifdef MAPVERTEX\n\t\tdAlpha *= clamp(vVertexColor.$VC, 0.0, 1.0);\n\t\t#endif\n}\n",outputAlphaPS:"\ngl_FragColor.a = dAlpha;\n",outputAlphaOpaquePS:"\ngl_FragColor.a = 1.0;\n",outputAlphaPremulPS:"\ngl_FragColor.rgb *= dAlpha;\ngl_FragColor.a = dAlpha;\n",outputTex2DPS:"\nvarying vec2 vUv0;\n\nuniform sampler2D source;\n\nvoid main(void) {\n\t\tgl_FragColor = texture2D(source, vUv0);\n}\n",packDepthPS:"\n// Packing a float in GLSL with multiplication and mod\n// http://blog.gradientstudios.com/2012/08/23/shadow-map-improvement\nvec4 packFloat(float depth) {\n\t\tconst vec4 bit_shift = vec4(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0);\n\t\tconst vec4 bit_mask\t= vec4(0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0);\n\n\t\t// combination of mod and multiplication and division works better\n\t\tvec4 res = mod(depth * bit_shift * vec4(255), vec4(256) ) / vec4(255);\n\t\tres -= res.xxyz * bit_mask;\n\t\treturn res;\n}\n",parallaxPS:"\nuniform sampler2D texture_heightMap;\nuniform float material_heightMapFactor;\n\nvoid getParallax() {\n\t\tfloat parallaxScale = material_heightMapFactor;\n\n\t\tfloat height = texture2D(texture_heightMap, $UV, textureBias).$CH;\n\t\theight = height * parallaxScale - parallaxScale*0.5;\n\t\tvec3 viewDirT = dViewDirW * dTBN;\n\n\t\tviewDirT.z += 0.42;\n\t\tdUvOffset = height * (viewDirT.xy / viewDirT.z);\n}\n",particlePS:"\nvarying vec4 texCoordsAlphaLife;\n\nuniform sampler2D colorMap;\nuniform sampler2D colorParam;\nuniform float graphSampleSize;\nuniform float graphNumSamples;\n\n#ifndef CAMERAPLANES\n#define CAMERAPLANES\nuniform vec4 camera_params;\n#endif\n\nuniform float softening;\nuniform float colorMult;\n\nfloat saturate(float x) {\n\t\treturn clamp(x, 0.0, 1.0);\n}\n\n#ifndef UNPACKFLOAT\n#define UNPACKFLOAT\nfloat unpackFloat(vec4 rgbaDepth) {\n\t\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\t\tfloat depth = dot(rgbaDepth, bitShift);\n\t\treturn depth;\n}\n#endif\n\nvoid main(void) {\n\t\tvec4 tex\t= texture2DSRGB(colorMap, vec2(texCoordsAlphaLife.x, 1.0 - texCoordsAlphaLife.y));\n\t\tvec4 ramp = texture2DSRGB(colorParam, vec2(texCoordsAlphaLife.w, 0.0));\n\t\tramp.rgb *= colorMult;\n\n\t\tramp.a += texCoordsAlphaLife.z;\n\n\t\tvec3 rgb = tex.rgb * ramp.rgb;\n\t\tfloat a\t= tex.a * ramp.a;\n",particleVS:"\nvec3 unpack3NFloats(float src) {\n\t\tfloat r = fract(src);\n\t\tfloat g = fract(src * 256.0);\n\t\tfloat b = fract(src * 65536.0);\n\t\treturn vec3(r, g, b);\n}\n\nfloat saturate(float x) {\n\t\treturn clamp(x, 0.0, 1.0);\n}\n\nvec4 tex1Dlod_lerp(highp sampler2D tex, vec2 tc) {\n\t\treturn mix( texture2D(tex,tc), texture2D(tex,tc + graphSampleSize), fract(tc.x*graphNumSamples) );\n}\n\nvec4 tex1Dlod_lerp(highp sampler2D tex, vec2 tc, out vec3 w) {\n\t\tvec4 a = texture2D(tex,tc);\n\t\tvec4 b = texture2D(tex,tc + graphSampleSize);\n\t\tfloat c = fract(tc.x*graphNumSamples);\n\n\t\tvec3 unpackedA = unpack3NFloats(a.w);\n\t\tvec3 unpackedB = unpack3NFloats(b.w);\n\t\tw = mix(unpackedA, unpackedB, c);\n\n\t\treturn mix(a, b, c);\n}\n\nvec2 rotate(vec2 quadXY, float pRotation, out mat2 rotMatrix) {\n\t\tfloat c = cos(pRotation);\n\t\tfloat s = sin(pRotation);\n\n\t\tmat2 m = mat2(c, -s, s, c);\n\t\trotMatrix = m;\n\n\t\treturn m * quadXY;\n}\n\nvec3 billboard(vec3 InstanceCoords, vec2 quadXY) {\n\t\t#ifdef SCREEN_SPACE\n\t\t\t\tvec3 pos = vec3(-1, 0, 0) * quadXY.x + vec3(0, -1, 0) * quadXY.y;\n\t\t#else\n\t\t\t\tvec3 pos = -matrix_viewInverse[0].xyz * quadXY.x + -matrix_viewInverse[1].xyz * quadXY.y;\n\t\t#endif\n\n\t\treturn pos;\n}\n\nvec3 customFace(vec3 InstanceCoords, vec2 quadXY) {\n\t\tvec3 pos = faceTangent * quadXY.x + faceBinorm * quadXY.y;\n\t\treturn pos;\n}\n\nvec2 safeNormalize(vec2 v) {\n\t\tfloat l = length(v);\n\t\treturn (l > 1e-06) ? v / l : v;\n}\n\nvoid main(void) {\n\t\tvec3 meshLocalPos = particle_vertexData.xyz;\n\t\tfloat id = floor(particle_vertexData.w);\n\n\t\tfloat rndFactor = fract(sin(id + 1.0 + seed));\n\t\tvec3 rndFactor3 = vec3(rndFactor, fract(rndFactor*10.0), fract(rndFactor*100.0));\n\n\t\tfloat uv = id / numParticlesPot;\n\t\treadInput(uv);\n\n#ifdef LOCAL_SPACE\n\t\tinVel = mat3(matrix_model) * inVel;\n#endif\n\t\tvec2 velocityV = safeNormalize((mat3(matrix_view) * inVel).xy); // should be removed by compiler if align/stretch is not used\n\n\t\tfloat particleLifetime = lifetime;\n\n\t\tif (inLife <= 0.0 || inLife > particleLifetime || !inShow) meshLocalPos = vec3(0.0);\n\t\tvec2 quadXY = meshLocalPos.xy;\n\t\tfloat nlife = clamp(inLife / particleLifetime, 0.0, 1.0);\n\n\t\tvec3 paramDiv;\n\t\tvec4 params = tex1Dlod_lerp(internalTex2, vec2(nlife, 0), paramDiv);\n\t\tfloat scale = params.y;\n\t\tfloat scaleDiv = paramDiv.x;\n\t\tfloat alphaDiv = paramDiv.z;\n\n\t\tscale += (scaleDiv * 2.0 - 1.0) * scaleDivMult * fract(rndFactor*10000.0);\n\n#ifndef USE_MESH\n\t\ttexCoordsAlphaLife = vec4(quadXY * -0.5 + 0.5, (alphaDiv * 2.0 - 1.0) * alphaDivMult * fract(rndFactor*1000.0), nlife);\n#else\n\t\ttexCoordsAlphaLife = vec4(particle_uv, (alphaDiv * 2.0 - 1.0) * alphaDivMult * fract(rndFactor*1000.0), nlife);\n#endif\n\n\t\tvec3 particlePos = inPos;\n\t\tvec3 particlePosMoved = vec3(0.0);\n\n\t\tmat2 rotMatrix;\n",particleAnimFrameClampVS:"\n\t\tfloat animFrame = min(floor(texCoordsAlphaLife.w * animTexParams.y) + animTexParams.x, animTexParams.z);\n",particleAnimFrameLoopVS:"\n\t\tfloat animFrame = floor(mod(texCoordsAlphaLife.w * animTexParams.y + animTexParams.x, animTexParams.z + 1.0));\n",particleAnimTexVS:"\n\t\tfloat animationIndex;\n\n\t\tif (animTexIndexParams.y == 1.0) {\n\t\t\t\tanimationIndex = floor((animTexParams.w + 1.0) * rndFactor3.z) * (animTexParams.z + 1.0);\n\t\t} else {\n\t\t\t\tanimationIndex = animTexIndexParams.x * (animTexParams.z + 1.0);\n\t\t}\n\n\t\tfloat atlasX = (animationIndex + animFrame) * animTexTilesParams.x;\n\t\tfloat atlasY = 1.0 - floor(atlasX + 1.0) * animTexTilesParams.y;\n\t\tatlasX = fract(atlasX);\n\n\t\ttexCoordsAlphaLife.xy *= animTexTilesParams.xy;\n\t\ttexCoordsAlphaLife.xy += vec2(atlasX, atlasY);\n",particleInputFloatPS:"\nvoid readInput(float uv) {\n\t\tvec4 tex = texture2D(particleTexIN, vec2(uv, 0.25));\n\t\tvec4 tex2 = texture2D(particleTexIN, vec2(uv, 0.75));\n\n\t\tinPos = tex.xyz;\n\t\tinVel = tex2.xyz;\n\t\tinAngle = (tex.w < 0.0? -tex.w : tex.w) - 1000.0;\n\t\tinShow = tex.w >= 0.0;\n\t\tinLife = tex2.w;\n}\n",particleInputRgba8PS:"\n//RG=X, BA=Y\n//RG=Z, BA=A\n//RGB=V, A=visMode\n//RGBA=life\n\n#define PI2 6.283185307179586\n\nuniform vec3 inBoundsSize;\nuniform vec3 inBoundsCenter;\n\nuniform float maxVel;\n\nfloat decodeFloatRG(vec2 rg) {\n\t\treturn rg.y*(1.0/255.0) + rg.x;\n}\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}\n\nvoid readInput(float uv) {\n\t\tvec4 tex0 = texture2D(particleTexIN, vec2(uv, 0.125));\n\t\tvec4 tex1 = texture2D(particleTexIN, vec2(uv, 0.375));\n\t\tvec4 tex2 = texture2D(particleTexIN, vec2(uv, 0.625));\n\t\tvec4 tex3 = texture2D(particleTexIN, vec2(uv, 0.875));\n\n\t\tinPos = vec3(decodeFloatRG(tex0.rg), decodeFloatRG(tex0.ba), decodeFloatRG(tex1.rg));\n\t\tinPos = (inPos - vec3(0.5)) * inBoundsSize + inBoundsCenter;\n\n\t\tinVel = tex2.xyz;\n\t\tinVel = (inVel - vec3(0.5)) * maxVel;\n\n\t\tinAngle = decodeFloatRG(tex1.ba) * PI2;\n\t\tinShow = tex2.a > 0.5;\n\n\t\tinLife = decodeFloatRGBA(tex3);\n\t\tfloat maxNegLife = max(lifetime, (numParticles - 1.0) * (rate+rateDiv));\n\t\tfloat maxPosLife = lifetime+1.0;\n\t\tinLife = inLife * (maxNegLife + maxPosLife) - maxNegLife;\n}\n",particleOutputFloatPS:"\nvoid writeOutput() {\n\t\tif (gl_FragCoord.y<1.0) {\n\t\t\t\tgl_FragColor = vec4(outPos, (outAngle + 1000.0) * visMode);\n\t\t} else {\n\t\t\t\tgl_FragColor = vec4(outVel, outLife);\n\t\t}\n}\n",particleOutputRgba8PS:"\nuniform vec3 outBoundsMul;\nuniform vec3 outBoundsAdd;\n\nvec2 encodeFloatRG( float v ) {\n\t\tvec2 enc = vec2(1.0, 255.0) * v;\n\t\tenc = fract(enc);\n\t\tenc -= enc.yy * vec2(1.0/255.0, 1.0/255.0);\n\t\treturn enc;\n}\n\nvec4 encodeFloatRGBA( float v ) {\n\t\tvec4 enc = vec4(1.0, 255.0, 65025.0, 160581375.0) * v;\n\t\tenc = fract(enc);\n\t\tenc -= enc.yzww * vec4(1.0/255.0,1.0/255.0,1.0/255.0,0.0);\n\t\treturn enc;\n}\n\nvoid writeOutput() {\n\t\toutPos = outPos * outBoundsMul + outBoundsAdd;\n\t\toutAngle = fract(outAngle / PI2);\n\n\t\toutVel = (outVel / maxVel) + vec3(0.5); // TODO: mul\n\n\t\tfloat maxNegLife = max(lifetime, (numParticles - 1.0) * (rate+rateDiv));\n\t\tfloat maxPosLife = lifetime+1.0;\n\t\toutLife = (outLife + maxNegLife) / (maxNegLife + maxPosLife);\n\n\t\tif (gl_FragCoord.y < 1.0) {\n\t\t\t\tgl_FragColor = vec4(encodeFloatRG(outPos.x), encodeFloatRG(outPos.y));\n\t\t} else if (gl_FragCoord.y < 2.0) {\n\t\t\t\tgl_FragColor = vec4(encodeFloatRG(outPos.z), encodeFloatRG(outAngle));\n\t\t} else if (gl_FragCoord.y < 3.0) {\n\t\t\t\tgl_FragColor = vec4(outVel, visMode*0.5+0.5);\n\t\t} else {\n\t\t\t\tgl_FragColor = encodeFloatRGBA(outLife);\n\t\t}\n}\n",particleUpdaterAABBPS:"\nuniform mat3 spawnBounds;\nuniform vec3 spawnPosInnerRatio;\n\nvec3 calcSpawnPosition(vec3 inBounds, float rndFactor) {\n\t\tvec3 pos = inBounds - vec3(0.5);\n\n\t\tvec3 posAbs = abs(pos);\n\t\tvec3 maxPos = vec3(max(posAbs.x, max(posAbs.y, posAbs.z)));\n\n\t\tvec3 edge = maxPos + (vec3(0.5) - maxPos) * spawnPosInnerRatio;\n\n\t\tpos.x = edge.x * (maxPos.x == posAbs.x ? sign(pos.x) : 2.0 * pos.x);\n\t\tpos.y = edge.y * (maxPos.y == posAbs.y ? sign(pos.y) : 2.0 * pos.y);\n\t\tpos.z = edge.z * (maxPos.z == posAbs.z ? sign(pos.z) : 2.0 * pos.z);\n\n#ifndef LOCAL_SPACE\n\t\treturn emitterPos + spawnBounds * pos;\n#else\n\t\treturn spawnBounds * pos;\n#endif\n}\n\nvoid addInitialVelocity(inout vec3 localVelocity, vec3 inBounds) {\n\t\tlocalVelocity -= vec3(0, 0, initialVelocity);\n}\n",particleUpdaterEndPS:"\n\t\twriteOutput();\n}\n",particleUpdaterInitPS:"\nvarying vec2 vUv0;\n\nuniform highp sampler2D particleTexIN;\nuniform highp sampler2D internalTex0;\nuniform highp sampler2D internalTex1;\nuniform highp sampler2D internalTex2;\nuniform highp sampler2D internalTex3;\n\nuniform mat3 emitterMatrix, emitterMatrixInv;\nuniform vec3 emitterScale;\n\nuniform vec3 emitterPos, frameRandom, localVelocityDivMult, velocityDivMult;\nuniform float delta, rate, rateDiv, lifetime, numParticles, rotSpeedDivMult, radialSpeedDivMult, seed;\nuniform float startAngle, startAngle2;\nuniform float initialVelocity;\n\nuniform float graphSampleSize;\nuniform float graphNumSamples;\n\nvec3 inPos;\nvec3 inVel;\nfloat inAngle;\nbool inShow;\nfloat inLife;\nfloat visMode;\n\nvec3 outPos;\nvec3 outVel;\nfloat outAngle;\nbool outShow;\nfloat outLife;\n",particleUpdaterNoRespawnPS:"\n\t\tif (outLife >= lifetime) {\n\t\t\t\toutLife -= max(lifetime, (numParticles - 1.0) * particleRate);\n\t\t\t\tvisMode = -1.0;\n\t\t}\n",particleUpdaterOnStopPS:"\n\t\tvisMode = outLife < 0.0? -1.0: visMode;\n",particleUpdaterRespawnPS:"\n\t\tif (outLife >= lifetime) {\n\t\t\t\toutLife -= max(lifetime, (numParticles - 1.0) * particleRate);\n\t\t\t\tvisMode = 1.0;\n\t\t}\n\t\tvisMode = outLife < 0.0? 1.0: visMode;\n",particleUpdaterSpherePS:"\nuniform float spawnBoundsSphere;\nuniform float spawnBoundsSphereInnerRatio;\n\nvec3 calcSpawnPosition(vec3 inBounds, float rndFactor) {\n\t\tfloat rnd4 = fract(rndFactor * 1000.0);\n\t\tvec3 norm = normalize(inBounds.xyz - vec3(0.5));\n\t\tfloat r = rnd4 * (1.0 - spawnBoundsSphereInnerRatio) + spawnBoundsSphereInnerRatio;\n#ifndef LOCAL_SPACE\n\t\treturn emitterPos + norm * r * spawnBoundsSphere;\n#else\n\t\treturn norm * r * spawnBoundsSphere;\n#endif\n}\n\nvoid addInitialVelocity(inout vec3 localVelocity, vec3 inBounds) {\n\t\tlocalVelocity += normalize(inBounds - vec3(0.5)) * initialVelocity;\n}\n",particleUpdaterStartPS:"\nfloat saturate(float x) {\n\t\treturn clamp(x, 0.0, 1.0);\n}\n\nvec3 unpack3NFloats(float src) {\n\t\tfloat r = fract(src);\n\t\tfloat g = fract(src * 256.0);\n\t\tfloat b = fract(src * 65536.0);\n\t\treturn vec3(r, g, b);\n}\n\nvec3 tex1Dlod_lerp(highp sampler2D tex, vec2 tc, out vec3 w) {\n\t\tvec4 a = texture2D(tex, tc);\n\t\tvec4 b = texture2D(tex, tc + graphSampleSize);\n\t\tfloat c = fract(tc.x * graphNumSamples);\n\n\t\tvec3 unpackedA = unpack3NFloats(a.w);\n\t\tvec3 unpackedB = unpack3NFloats(b.w);\n\t\tw = mix(unpackedA, unpackedB, c);\n\n\t\treturn mix(a.xyz, b.xyz, c);\n}\n\n#define HASHSCALE4 vec4(1031, .1030, .0973, .1099)\nvec4 hash41(float p) {\n\t\tvec4 p4 = fract(vec4(p) * HASHSCALE4);\n\t\tp4 += dot(p4, p4.wzxy+19.19);\n\t\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}\n\nvoid main(void) {\n\t\tif (gl_FragCoord.x > numParticles) discard;\n\n\t\treadInput(vUv0.x);\n\t\tvisMode = inShow? 1.0 : -1.0;\n\n\t\tvec4 rndFactor = hash41(gl_FragCoord.x + seed);\n\n\t\tfloat particleRate = rate + rateDiv * rndFactor.x;\n\n\t\toutLife = inLife + delta;\n\t\tfloat nlife = clamp(outLife / lifetime, 0.0, 1.0);\n\n\t\tvec3 localVelocityDiv;\n\t\tvec3 velocityDiv;\n\t\tvec3 paramDiv;\n\t\tvec3 localVelocity = tex1Dlod_lerp(internalTex0, vec2(nlife, 0), localVelocityDiv);\n\t\tvec3 velocity =\t\t\ttex1Dlod_lerp(internalTex1, vec2(nlife, 0), velocityDiv);\n\t\tvec3 params =\t\t\t\ttex1Dlod_lerp(internalTex2, vec2(nlife, 0), paramDiv);\n\t\tfloat rotSpeed = params.x;\n\t\tfloat rotSpeedDiv = paramDiv.y;\n\n\t\tvec3 radialParams = tex1Dlod_lerp(internalTex3, vec2(nlife, 0), paramDiv);\n\t\tfloat radialSpeed = radialParams.x;\n\t\tfloat radialSpeedDiv = radialParams.y;\n\n\t\tbool respawn = inLife <= 0.0 || outLife >= lifetime;\n\t\tinPos = respawn ? calcSpawnPosition(rndFactor.xyz, rndFactor.x) : inPos;\n\t\tinAngle = respawn ? mix(startAngle, startAngle2, rndFactor.x) : inAngle;\n\n#ifndef LOCAL_SPACE\n\t\tvec3 radialVel = inPos - emitterPos;\n#else\n\t\tvec3 radialVel = inPos;\n#endif\n\t\tradialVel = (dot(radialVel, radialVel) > 1.0E-8) ? radialSpeed * normalize(radialVel) : vec3(0.0);\n\t\tradialVel += (radialSpeedDiv * vec3(2.0) - vec3(1.0)) * radialSpeedDivMult * rndFactor.xyz;\n\n\t\tlocalVelocity +=\t\t(localVelocityDiv * vec3(2.0) - vec3(1.0)) * localVelocityDivMult * rndFactor.xyz;\n\t\tvelocity +=\t\t\t\t (velocityDiv * vec3(2.0) - vec3(1.0)) * velocityDivMult * rndFactor.xyz;\n\t\trotSpeed +=\t\t\t\t (rotSpeedDiv * 2.0 - 1.0) * rotSpeedDivMult * rndFactor.y;\n\n\t\taddInitialVelocity(localVelocity, rndFactor.xyz);\n\n#ifndef LOCAL_SPACE\n\t\toutVel = emitterMatrix * localVelocity + (radialVel + velocity) * emitterScale;\n#else\n\t\toutVel = (localVelocity + radialVel) / emitterScale + emitterMatrixInv * velocity;\n#endif\n\n\t\toutPos = inPos + outVel * delta;\n\t\toutAngle = inAngle + rotSpeed * delta;\n",particle_billboardVS:"\n\t\tquadXY = rotate(quadXY, inAngle, rotMatrix);\n\t\tvec3 localPos = billboard(particlePos, quadXY);\n",particle_blendAddPS:"\n\t\tdBlendModeFogFactor = 0.0;\n\t\trgb *= saturate(gammaCorrectInput(max(a, 0.0)));\n\t\tif ((rgb.r + rgb.g + rgb.b) < 0.000001) discard;\n",particle_blendMultiplyPS:"\n\t\trgb = mix(vec3(1.0), rgb, vec3(a));\n\t\tif (rgb.r + rgb.g + rgb.b > 2.99) discard;\n",particle_blendNormalPS:"\n\t\tif (a < 0.01) discard;\n",particle_cpuVS:"\nattribute vec4 particle_vertexData;\t // XYZ = world pos, W = life\nattribute vec4 particle_vertexData2;\t// X = angle, Y = scale, Z = alpha, W = velocity.x\nattribute vec4 particle_vertexData3;\t// XYZ = particle local pos, W = velocity.y\nattribute float particle_vertexData4; // particle id\n#ifndef USE_MESH\n#define VDATA5TYPE vec2\n#else\n#define VDATA5TYPE vec4\n#endif\nattribute VDATA5TYPE particle_vertexData5; // VDATA4TYPE depends on useMesh property. Start with X = velocity.z, Y = particle ID and for mesh particles proceeds with Z = mesh UV.x, W = mesh UV.y\n\nuniform mat4 matrix_viewProjection;\nuniform mat4 matrix_model;\n\n#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\n\nuniform mat3 matrix_normal;\nuniform mat4 matrix_viewInverse;\n\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;\n\nvarying vec4 texCoordsAlphaLife;\n\nvec2 rotate(vec2 quadXY, float pRotation, out mat2 rotMatrix)\n{\n\t\tfloat c = cos(pRotation);\n\t\tfloat s = sin(pRotation);\n\t\t//vec4 rotationMatrix = vec4(c, -s, s, c);\n\n\t\tmat2 m = mat2(c, -s, s, c);\n\t\trotMatrix = m;\n\n\t\treturn m * quadXY;\n}\n\nvec3 billboard(vec3 InstanceCoords, vec2 quadXY)\n{\n\t\tvec3 pos = -matrix_viewInverse[0].xyz * quadXY.x + -matrix_viewInverse[1].xyz * quadXY.y;\n\t\treturn pos;\n}\n\nvec3 customFace(vec3 InstanceCoords, vec2 quadXY)\n{\n\t\tvec3 pos = faceTangent * quadXY.x + faceBinorm * quadXY.y;\n\t\treturn pos;\n}\n\nvoid main(void)\n{\n\t\tvec3 particlePos = particle_vertexData.xyz;\n\t\tvec3 inPos = particlePos;\n\t\tvec3 vertPos = particle_vertexData3.xyz;\n\t\tvec3 inVel = vec3(particle_vertexData2.w, particle_vertexData3.w, particle_vertexData5.x);\n\n\t\tfloat id = floor(particle_vertexData4);\n\t\tfloat rndFactor = fract(sin(id + 1.0 + seed));\n\t\tvec3 rndFactor3 = vec3(rndFactor, fract(rndFactor*10.0), fract(rndFactor*100.0));\n\n#ifdef LOCAL_SPACE\n\t\tinVel = mat3(matrix_model) * inVel;\n#endif\n\t\tvec2 velocityV = normalize((mat3(matrix_view) * inVel).xy); // should be removed by compiler if align/stretch is not used\n\n\t\tvec2 quadXY = vertPos.xy;\n\n#ifdef USE_MESH\n\t\ttexCoordsAlphaLife = vec4(particle_vertexData5.zw, particle_vertexData2.z, particle_vertexData.w);\n#else\n\t\ttexCoordsAlphaLife = vec4(quadXY * -0.5 + 0.5, particle_vertexData2.z, particle_vertexData.w);\n#endif\n\t\tmat2 rotMatrix;\n\n\t\tfloat inAngle = particle_vertexData2.x;\n\t\tvec3 particlePosMoved = vec3(0.0);\n\t\tvec3 meshLocalPos = particle_vertexData3.xyz;\n",particle_cpu_endVS:"\n\t\tlocalPos *= particle_vertexData2.y * emitterScale;\n\t\tlocalPos += particlePos;\n\n\t\tgl_Position = matrix_viewProjection * vec4(localPos, 1.0);\n",particle_customFaceVS:"\n\t\tquadXY = rotate(quadXY, inAngle, rotMatrix);\n\t\tvec3 localPos = customFace(particlePos, quadXY);\n",particle_endPS:"\n\t\trgb = addFog(rgb);\n\t\trgb = toneMap(rgb);\n\t\trgb = gammaCorrectOutput(rgb);\n\t\tgl_FragColor = vec4(rgb, a);\n}\n",particle_endVS:"\n\t\tlocalPos *= scale * emitterScale;\n\t\tlocalPos += particlePos;\n\n\t\t#ifdef SCREEN_SPACE\n\t\tgl_Position = vec4(localPos.x, localPos.y, 0.0, 1.0);\n\t\t#else\n\t\tgl_Position = matrix_viewProjection * vec4(localPos.xyz, 1.0);\n\t\t#endif\n",particle_halflambertPS:"\n\t\tvec3 negNormal = normal*0.5+0.5;\n\t\tvec3 posNormal = -normal*0.5+0.5;\n\t\tnegNormal *= negNormal;\n\t\tposNormal *= posNormal;\n",particle_initVS:"\nattribute vec4 particle_vertexData; // XYZ = particle position, W = particle ID + random factor\n#ifdef USE_MESH\nattribute vec2 particle_uv;\t\t\t\t // mesh UV\n#endif\n\nuniform mat4 matrix_viewProjection;\nuniform mat4 matrix_model;\nuniform mat3 matrix_normal;\nuniform mat4 matrix_viewInverse;\n\n#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\n\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\n#ifndef CAMERAPLANES\n#define CAMERAPLANES\nuniform vec4 camera_params;\n#endif\n\nvarying vec4 texCoordsAlphaLife;\n\nvec3 inPos;\nvec3 inVel;\nfloat inAngle;\nbool inShow;\nfloat inLife;\n",particle_lambertPS:"\n\t\tvec3 negNormal = max(normal, vec3(0.0));\n\t\tvec3 posNormal = max(-normal, vec3(0.0));\n",particle_lightingPS:"\n\t\tvec3 light = negNormal.x*lightCube[0] + posNormal.x*lightCube[1] +\n\t\t\t\t\t\t\t\t\t\t\t\tnegNormal.y*lightCube[2] + posNormal.y*lightCube[3] +\n\t\t\t\t\t\t\t\t\t\t\t\tnegNormal.z*lightCube[4] + posNormal.z*lightCube[5];\n\n\t\trgb *= light;\n",particle_localShiftVS:"\n\t\tparticlePos = (matrix_model * vec4(particlePos, 1.0)).xyz;\n",particle_meshVS:"\n\t\tvec3 localPos = meshLocalPos;\n\t\tlocalPos.xy = rotate(localPos.xy, inAngle, rotMatrix);\n\t\tlocalPos.yz = rotate(localPos.yz, inAngle, rotMatrix);\n\n\t\tbillboard(particlePos, quadXY);\n",particle_normalVS:"\n\t\tNormal = normalize(localPos + matrix_viewInverse[2].xyz);\n",particle_normalMapPS:"\n\t\tvec3 normalMap = normalize(texture2D(normalMap, vec2(texCoordsAlphaLife.x, 1.0 - texCoordsAlphaLife.y)).xyz * 2.0 - 1.0);\n\t\tvec3 normal = ParticleMat * normalMap;\n",particle_pointAlongVS:"\n\t\tinAngle = atan(velocityV.x, velocityV.y); // not the fastest way, but easier to plug in; TODO: create rot matrix right from vectors\n\n",particle_softPS:"\n\t\tfloat depth = getLinearScreenDepth();\n\t\tfloat particleDepth = vDepth;\n\t\tfloat depthDiff = saturate(abs(particleDepth - depth) * softening);\n\t\ta *= depthDiff;\n",particle_softVS:"\n\t\tvDepth = getLinearDepth(localPos);\n",particle_stretchVS:"\n\t\tvec3 moveDir = inVel * stretch;\n\t\tvec3 posPrev = particlePos - moveDir;\n\t\tposPrev += particlePosMoved;\n\n\t\tvec2 centerToVertexV = normalize((mat3(matrix_view) * localPos).xy);\n\n\t\tfloat interpolation = dot(-velocityV, centerToVertexV) * 0.5 + 0.5;\n\n\t\tparticlePos = mix(particlePos, posPrev, interpolation);\n",particle_TBNVS:"\n\t\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\t\tParticleMat = mat3(-matrix_viewInverse[0].xyz, -matrix_viewInverse[1].xyz, matrix_viewInverse[2].xyz) * rot3;\n",particle_wrapVS:"\n\t\tvec3 origParticlePos = particlePos;\n\t\tparticlePos -= matrix_model[3].xyz;\n\t\tparticlePos = mod(particlePos, wrapBounds) - wrapBounds * 0.5;\n\t\tparticlePos += matrix_model[3].xyz;\n\t\tparticlePosMoved = particlePos - origParticlePos;\n",precisionTestPS:"\nvoid main(void) {\n\t\tgl_FragColor = vec4(2147483648.0);\n}\n",precisionTest2PS:"\nuniform sampler2D source;\n\nvec4 packFloat(float depth) {\n\t\tconst vec4 bit_shift = vec4(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0);\n\t\tconst vec4 bit_mask\t= vec4(0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0);\n\n\t\tvec4 res = mod(depth * bit_shift * vec4(255), vec4(256) ) / vec4(255);\n\t\tres -= res.xxyz * bit_mask;\n\t\treturn res;\n}\n\nvoid main(void) {\n\t\tfloat c = texture2D(source, vec2(0.0)).r;\n\t\tfloat diff = abs(c - 2147483648.0) / 2147483648.0;\n\t\tgl_FragColor = packFloat(diff);\n}\n",reflDirPS:"\nvoid getReflDir() {\n\t\tdReflDirW = normalize(-reflect(dViewDirW, dNormalW));\n}\n",reflDirAnisoPS:"\nvoid getReflDir() {\n\t\tfloat roughness = sqrt(1.0 - min(dGlossiness, 1.0));\n\t\tfloat anisotropy = material_anisotropy * roughness;\n\t\tvec3 anisotropicDirection = anisotropy >= 0.0 ? dTBN[1] : dTBN[0];\n\t\tvec3 anisotropicTangent = cross(anisotropicDirection, dViewDirW);\n\t\tvec3 anisotropicNormal = cross(anisotropicTangent, anisotropicDirection);\n\t\tvec3 bentNormal = normalize(mix(normalize(dNormalW), normalize(anisotropicNormal), anisotropy));\n\t\tdReflDirW = reflect(-dViewDirW, bentNormal);\n}\n",reflectionCCPS:"\n#ifdef CLEARCOAT\nuniform float material_clearCoatReflectivity;\n\nvoid addReflectionCC() {\n\t\tccReflection += vec4(calcReflection(ccReflDirW, ccGlossiness), material_clearCoatReflectivity);\n}\n#endif\n",reflectionCubePS:"\nuniform samplerCube texture_cubeMap;\nuniform float material_reflectivity;\n\nvec3 calcReflection(vec3 tReflDirW, float tGlossiness) {\n\t\tvec3 lookupVec = fixSeams(cubeMapProject(tReflDirW));\n\t\tlookupVec.x *= -1.0;\n\t\treturn $DECODE(textureCube(texture_cubeMap, lookupVec));\n}\n\nvoid addReflection() {\t \n\t\tdReflection += vec4(calcReflection(dReflDirW, dGlossiness), material_reflectivity);\n}\n",reflectionEnvPS:"\n#ifndef ENV_ATLAS\n#define ENV_ATLAS\nuniform sampler2D texture_envAtlas;\n#endif\nuniform float material_reflectivity;\n\n// calculate mip level for shiny reflection given equirect coords uv.\nfloat shinyMipLevel(vec2 uv) {\n\t\tvec2 dx = dFdx(uv);\n\t\tvec2 dy = dFdy(uv);\n\n\t\t// calculate second dF at 180 degrees\n\t\tvec2 uv2 = vec2(fract(uv.x + 0.5), uv.y);\n\t\tvec2 dx2 = dFdx(uv2);\n\t\tvec2 dy2 = dFdy(uv2);\n\n\t\t// calculate min of both sets of dF to handle discontinuity at the azim edge\n\t\tfloat maxd = min(max(dot(dx, dx), dot(dy, dy)), max(dot(dx2, dx2), dot(dy2, dy2)));\n\n\t\treturn clamp(0.5 * log2(maxd) - 1.0 + textureBias, 0.0, 5.0);\n}\n\nvec3 calcReflection(vec3 tReflDirW, float tGlossiness) {\n\t\tvec3 dir = cubeMapProject(tReflDirW) * vec3(-1.0, 1.0, 1.0);\n\t\tvec2 uv = toSphericalUv(dir);\n\n\t\t// calculate roughness level\n\t\tfloat level = saturate(1.0 - tGlossiness) * 5.0;\n\t\tfloat ilevel = floor(level);\n\n\t\t// accessing the shiny (top level) reflection - perform manual mipmap lookup\n\t\tfloat level2 = shinyMipLevel(uv * atlasSize);\n\t\tfloat ilevel2 = floor(level2);\n\n\t\tvec2 uv0, uv1;\n\t\tfloat weight;\n\t\tif (ilevel == 0.0) {\n\t\t\t\tuv0 = mapMip(uv, ilevel2);\n\t\t\t\tuv1 = mapMip(uv, ilevel2 + 1.0);\n\t\t\t\tweight = level2 - ilevel2;\n\t\t} else {\n\t\t\t\t// accessing rough reflection - just sample the same part twice\n\t\t\t\tuv0 = uv1 = mapRoughnessUv(uv, ilevel);\n\t\t\t\tweight = 0.0;\n\t\t}\n\n\t\tvec3 linearA = $DECODE(texture2D(texture_envAtlas, uv0));\n\t\tvec3 linearB = $DECODE(texture2D(texture_envAtlas, uv1));\n\t\tvec3 linear0 = mix(linearA, linearB, weight);\n\t\tvec3 linear1 = $DECODE(texture2D(texture_envAtlas, mapRoughnessUv(uv, ilevel + 1.0)));\n\n\t\treturn processEnvironment(mix(linear0, linear1, level - ilevel));\n}\n\nvoid addReflection() {\t \n\t\tdReflection += vec4(calcReflection(dReflDirW, dGlossiness), material_reflectivity);\n}\n",reflectionSpherePS:"\n#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\nuniform sampler2D texture_sphereMap;\nuniform float material_reflectivity;\n\nvec3 calcReflection(vec3 tReflDirW, float tGlossiness) {\n\t\tvec3 reflDirV = (mat3(matrix_view) * tReflDirW).xyz;\n\n\t\tfloat m = 2.0 * sqrt( dot(reflDirV.xy, reflDirV.xy) + (reflDirV.z+1.0)*(reflDirV.z+1.0) );\n\t\tvec2 sphereMapUv = reflDirV.xy / m + 0.5;\n\n\t\treturn $DECODE(texture2D(texture_sphereMap, sphereMapUv));\n}\n\nvoid addReflection() {\t \n\t\tdReflection += vec4(calcReflection(dReflDirW, dGlossiness), material_reflectivity);\n}\n",reflectionSphereLowPS:"\nuniform sampler2D texture_sphereMap;\nuniform float material_reflectivity;\n\nvec3 calcReflection(vec3 tReflDirW, float tGlossiness) {\n\t\tvec3 reflDirV = vNormalV;\n\n\t\tvec2 sphereMapUv = reflDirV.xy * 0.5 + 0.5;\n\t\treturn $DECODE(texture2D(texture_sphereMap, sphereMapUv));\n}\n\nvoid addReflection() {\t \n\t\tdReflection += vec4(calcReflection(dReflDirW, dGlossiness), material_reflectivity);\n}\n",refractionPS:"\nuniform float material_refraction, material_refractionIndex;\n\nvec3 refract2(vec3 viewVec, vec3 Normal, float IOR) {\n\t\tfloat vn = dot(viewVec, Normal);\n\t\tfloat k = 1.0 - IOR * IOR * (1.0 - vn * vn);\n\t\tvec3 refrVec = IOR * viewVec - (IOR * vn + sqrt(k)) * Normal;\n\t\treturn refrVec;\n}\n\nvoid addRefraction() {\n\t\t// use same reflection code with refraction vector\n\t\tvec3 tmp = dReflDirW;\n\t\tvec4 tmp2 = dReflection;\n\t\tdReflection = vec4(0.0);\n\t\tdReflDirW = refract2(-dViewDirW, dNormalW, material_refractionIndex);\n\n\t\taddReflection();\n\n\t\tdDiffuseLight = mix(dDiffuseLight, dReflection.rgb * dAlbedo, material_refraction);\n\t\tdReflDirW = tmp;\n\t\tdReflection = tmp2;\n}\n",reprojectPS:'\n// This shader requires the following #DEFINEs:\n//\n// PROCESS_FUNC - must be one of reproject, prefilter\n// DECODE_FUNC - must be one of decodeRGBM, decodeRGBE, decodeGamma or decodeLinear\n// ENCODE_FUNC - must be one of encodeRGBM, encodeRGBE, encideGamma or encodeLinear\n// SOURCE_FUNC - must be one of sampleCubemap, sampleEquirect, sampleOctahedral\n// TARGET_FUNC - must be one of getDirectionCubemap, getDirectionEquirect, getDirectionOctahedral\n//\n// When filtering:\n// NUM_SAMPLES - number of samples\n// NUM_SAMPLES_SQRT - sqrt of number of samples\n//\n// SUPPORTS_TEXLOD - whether supports texlod is supported\n\nvarying vec2 vUv0;\n\n// source\nuniform sampler2D sourceTex;\nuniform samplerCube sourceCube;\n\n// samples\nuniform sampler2D samplesTex;\nuniform vec2 samplesTexInverseSize;\n\n// params:\n// x - target cubemap face 0..6\n// y - specular power (when prefiltering)\n// z - source cubemap seam scale (0 to disable)\n// w - target cubemap size for seam calc (0 to disable)\nuniform vec4 params;\n\n// params2:\n// x - target image total pixels\n// y - source cubemap size\nuniform vec2 params2;\n\nfloat targetFace() { return params.x; }\nfloat specularPower() { return params.y; }\nfloat sourceCubeSeamScale() { return params.z; }\nfloat targetCubeSeamScale() { return params.w; }\n\nfloat targetTotalPixels() { return params2.x; }\nfloat sourceTotalPixels() { return params2.y; }\n\nfloat PI = 3.141592653589793;\n\nfloat saturate(float x) {\n\t\treturn clamp(x, 0.0, 1.0);\n}\n\n//-- supported codings\n\nvec3 decodeLinear(vec4 source) {\n\t\treturn source.rgb;\n}\n\nvec4 encodeLinear(vec3 source) {\n\t\treturn vec4(source, 1.0);\n}\n\nvec3 decodeGamma(vec4 source) {\n\t\treturn pow(source.xyz, vec3(2.2));\n}\n\nvec4 encodeGamma(vec3 source) {\n\t\treturn vec4(pow(source + 0.0000001, vec3(1.0 / 2.2)), 1.0);\n}\n\nvec3 decodeRGBM(vec4 rgbm) {\n\t\tvec3 color = (8.0 * rgbm.a) * rgbm.rgb;\n\t\treturn color * color;\n}\n\nvec4 encodeRGBM(vec3 source) { // modified RGBM\n\t\tvec4 result;\n\t\tresult.rgb = pow(source.rgb, vec3(0.5));\n\t\tresult.rgb *= 1.0 / 8.0;\n\n\t\tresult.a = saturate( max( max( result.r, result.g ), max( result.b, 1.0 / 255.0 ) ) );\n\t\tresult.a = ceil(result.a * 255.0) / 255.0;\n\n\t\tresult.rgb /= result.a;\n\t\treturn result;\n}\n\nvec3 decodeRGBE(vec4 source) {\n\t\tif (source.a == 0.0) {\n\t\t\t\treturn vec3(0.0, 0.0, 0.0);\n\t\t} else {\n\t\t\t\treturn source.xyz * pow(2.0, source.w * 255.0 - 128.0);\n\t\t}\n}\n\nvec4 encodeRGBE(vec3 source) {\n\t\tfloat maxVal = max(source.x, max(source.y, source.z));\n\t\tif (maxVal < 1e-32) {\n\t\t\t\treturn vec4(0, 0, 0, 0);\n\t\t} else {\n\t\t\t\tfloat e = ceil(log2(maxVal));\n\t\t\t\treturn vec4(source / pow(2.0, e), (e + 128.0) / 255.0);\n\t\t}\n}\n\n//-- supported projections\n\nvec3 modifySeams(vec3 dir, float scale) {\n\t\tvec3 adir = abs(dir);\n\t\tfloat M = max(max(adir.x, adir.y), adir.z);\n\t\treturn dir / M * vec3(\n\t\t\t\tadir.x == M ? 1.0 : scale,\n\t\t\t\tadir.y == M ? 1.0 : scale,\n\t\t\t\tadir.z == M ? 1.0 : scale\n\t\t);\n}\n\nvec2 toSpherical(vec3 dir) {\n\t\treturn vec2(dir.xz == vec2(0.0) ? 0.0 : atan(dir.x, dir.z), asin(dir.y));\n}\n\nvec3 fromSpherical(vec2 uv) {\n\t\treturn vec3(cos(uv.y) * sin(uv.x),\n\t\t\t\t\t\t\t\tsin(uv.y),\n\t\t\t\t\t\t\t\tcos(uv.y) * cos(uv.x));\n}\n\nvec3 getDirectionEquirect() {\n\t\treturn fromSpherical((vec2(vUv0.x, 1.0 - vUv0.y) * 2.0 - 1.0) * vec2(PI, PI * 0.5));\n}\n\nvec4 sampleEquirect(vec2 sph) {\n\t\tvec2 uv = sph / vec2(PI * 2.0, PI) + 0.5;\n\t\treturn texture2D(sourceTex, vec2(uv.x, 1.0 - uv.y));\n}\n\nvec4 sampleEquirect(vec3 dir) {\n\t\treturn sampleEquirect(toSpherical(dir));\n}\n\nvec4 sampleCubemap(vec3 dir) {\n\t\treturn textureCube(sourceCube, modifySeams(dir, 1.0 - sourceCubeSeamScale()));\n}\n\nvec4 sampleCubemap(vec2 sph) {\n\t\treturn sampleCubemap(fromSpherical(sph));\n}\n\nvec4 sampleEquirect(vec2 sph, float mipLevel) {\n\t\tvec2 uv = sph / vec2(PI * 2.0, PI) + 0.5;\n#ifdef SUPPORTS_TEXLOD\n\t\treturn texture2DLodEXT(sourceTex, vec2(uv.x, 1.0 - uv.y), mipLevel);\n#else\n\t\treturn texture2D(sourceTex, vec2(uv.x, 1.0 - uv.y));\n#endif\n}\n\nvec4 sampleEquirect(vec3 dir, float mipLevel) {\n\t\treturn sampleEquirect(toSpherical(dir), mipLevel);\n}\n\nvec4 sampleCubemap(vec3 dir, float mipLevel) {\n#ifdef SUPPORTS_TEXLOD\n\t\treturn textureCubeLodEXT(sourceCube, modifySeams(dir, 1.0 - exp2(mipLevel) * sourceCubeSeamScale()), mipLevel);\n#else\n\t\treturn textureCube(sourceCube, modifySeams(dir, 1.0 - exp2(mipLevel) * sourceCubeSeamScale()));\n#endif\n}\n\nvec4 sampleCubemap(vec2 sph, float mipLevel) {\n\t\treturn sampleCubemap(fromSpherical(sph), mipLevel);\n}\n\n// octahedral code, based on http://jcgt.org/published/0003/02/01\n// "Survey of Efficient Representations for Independent Unit Vectors" by Cigolle, Donow, Evangelakos, Mara, McGuire, Meyer\n\nfloat signNotZero(float k){\n\t\treturn(k >= 0.0) ? 1.0 : -1.0;\n}\n\nvec2 signNotZero(vec2 v) {\n\t\treturn vec2(signNotZero(v.x), signNotZero(v.y));\n}\n\n// Returns a unit vector. Argument o is an octahedral vector packed via octEncode, on the [-1, +1] square\nvec3 octDecode(vec2 o) {\n\t\tvec3 v = vec3(o.x, 1.0 - abs(o.x) - abs(o.y), o.y);\n\t\tif (v.y < 0.0) {\n\t\t\t\tv.xz = (1.0 - abs(v.zx)) * signNotZero(v.xz);\n\t\t}\n\t\treturn normalize(v);\n}\n\nvec3 getDirectionOctahedral() {\n\t\treturn octDecode(vec2(vUv0.x, 1.0 - vUv0.y) * 2.0 - 1.0);\n}\n\n// Assumes that v is a unit vector. The result is an octahedral vector on the [-1, +1] square\nvec2 octEncode(in vec3 v) {\n\t\tfloat l1norm = abs(v.x) + abs(v.y) + abs(v.z);\n\t\tvec2 result = v.xz * (1.0 / l1norm);\n\t\tif (v.y < 0.0) {\n\t\t\t\tresult = (1.0 - abs(result.yx)) * signNotZero(result.xy);\n\t\t}\n\t\treturn result;\n}\n\nvec4 sampleOctahedral(vec3 dir) {\n\t\tvec2 uv = octEncode(dir) * 0.5 + 0.5;\n\t\treturn texture2D(sourceTex, vec2(uv.x, 1.0 - uv.y));\n}\n\nvec4 sampleOctahedral(vec2 sph) {\n\t\treturn sampleOctahedral(fromSpherical(sph));\n}\n\nvec4 sampleOctahedral(vec3 dir, float mipLevel) {\n\t\tvec2 uv = octEncode(dir) * 0.5 + 0.5;\n#ifdef SUPPORTS_TEXLOD\n\t\treturn texture2DLodEXT(sourceTex, vec2(uv.x, 1.0 - uv.y), mipLevel);\n#else\n\t\treturn texture2D(sourceTex, vec2(uv.x, 1.0 - uv.y));\n#endif\n}\n\nvec4 sampleOctahedral(vec2 sph, float mipLevel) {\n\t\treturn sampleOctahedral(fromSpherical(sph), mipLevel);\n}\n\n/////////////////////////////////////////////////////////////////////\n\nvec3 getDirectionCubemap() {\n\t\tvec2 st = vUv0 * 2.0 - 1.0;\n\t\tfloat face = targetFace();\n\n\t\tvec3 vec;\n\t\tif (face == 0.0) {\n\t\t\t\tvec = vec3(1, -st.y, -st.x);\n\t\t} else if (face == 1.0) {\n\t\t\t\tvec = vec3(-1, -st.y, st.x);\n\t\t} else if (face == 2.0) {\n\t\t\t\tvec = vec3(st.x, 1, st.y);\n\t\t} else if (face == 3.0) {\n\t\t\t\tvec = vec3(st.x, -1, -st.y);\n\t\t} else if (face == 4.0) {\n\t\t\t\tvec = vec3(st.x, -st.y, 1);\n\t\t} else {\n\t\t\t\tvec = vec3(-st.x, -st.y, -1);\n\t\t}\n\n\t\treturn normalize(modifySeams(vec, 1.0 / (1.0 - targetCubeSeamScale())));\n}\n\nmat3 matrixFromVector(vec3 n) { // frisvad\n\t\tfloat a = 1.0 / (1.0 + n.z);\n\t\tfloat b = -n.x * n.y * a;\n\t\tvec3 b1 = vec3(1.0 - n.x * n.x * a, b, -n.x);\n\t\tvec3 b2 = vec3(b, 1.0 - n.y * n.y * a, -n.y);\n\t\treturn mat3(b1, b2, n);\n}\n\nmat3 matrixFromVectorSlow(vec3 n) {\n\t\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\t\tvec3 x = normalize(cross(up, n));\n\t\tvec3 y = cross(n, x);\n\t\treturn mat3(x, y, n);\n}\n\nvec4 reproject() {\n\t\tif (NUM_SAMPLES <= 1) {\n\t\t\t\t// single sample\n\t\t\t\treturn ENCODE_FUNC(DECODE_FUNC(SOURCE_FUNC(TARGET_FUNC())));\n\t\t} else {\n\t\t\t\t// multi sample\n\t\t\t\tvec2 sph = toSpherical(TARGET_FUNC());\n\t\t\t\tvec2 sphu = dFdx(sph);\n\t\t\t\tvec2 sphv = dFdy(sph);\n\t\t\t\tvec3 result = vec3(0.0);\n\t\t\t\tfor (float u = 0.0; u < NUM_SAMPLES_SQRT; ++u) {\n\t\t\t\t\t\tfor (float v = 0.0; v < NUM_SAMPLES_SQRT; ++v) {\n\t\t\t\t\t\t\t\tresult += DECODE_FUNC(SOURCE_FUNC(sph +\n\t\t\t\t\t\t\t\t\t\t\t\t\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\t\t\t\t\t\t\t\t\t\t\t\t\tsphv * (v / NUM_SAMPLES_SQRT - 0.5)));\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn ENCODE_FUNC(result / (NUM_SAMPLES_SQRT * NUM_SAMPLES_SQRT));\n\t\t}\n}\n\nvec4 unpackFloat = vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0);\n\nvoid unpackSample(int i, out vec3 L, out float mipLevel) {\n\t\tfloat u = (float(i * 4) + 0.5) * samplesTexInverseSize.x;\n\t\tfloat v = (floor(u) + 0.5) * samplesTexInverseSize.y;\n\n\t\tvec4 raw;\n\t\traw.x = dot(texture2D(samplesTex, vec2(u, v)), unpackFloat); u += samplesTexInverseSize.x;\n\t\traw.y = dot(texture2D(samplesTex, vec2(u, v)), unpackFloat); u += samplesTexInverseSize.x;\n\t\traw.z = dot(texture2D(samplesTex, vec2(u, v)), unpackFloat); u += samplesTexInverseSize.x;\n\t\traw.w = dot(texture2D(samplesTex, vec2(u, v)), unpackFloat);\n\n\t\tL.xyz = raw.xyz * 2.0 - 1.0;\n\t\tmipLevel = raw.w * 8.0;\n}\n\n// convolve an environment given pre-generated samples\nvec4 prefilterSamples() {\n\t\t// construct vector space given target direction\n\t\tmat3 vecSpace = matrixFromVectorSlow(TARGET_FUNC());\n\n\t\tvec3 L;\n\t\tfloat mipLevel;\n\n\t\tvec3 result = vec3(0.0);\n\t\tfloat totalWeight = 0.0;\n\t\tfor (int i = 0; i < NUM_SAMPLES; ++i) {\n\t\t\t\tunpackSample(i, L, mipLevel);\n\t\t\t\tresult += DECODE_FUNC(SOURCE_FUNC(vecSpace * L, mipLevel)) * L.z;\n\t\t\t\ttotalWeight += L.z;\n\t\t}\n\n\t\treturn ENCODE_FUNC(result / totalWeight);\n}\n\n// unweighted version of prefilterSamples\nvec4 prefilterSamplesUnweighted() {\n\t\t// construct vector space given target direction\n\t\tmat3 vecSpace = matrixFromVectorSlow(TARGET_FUNC());\n\n\t\tvec3 L;\n\t\tfloat mipLevel;\n\n\t\tvec3 result = vec3(0.0);\n\t\tfloat totalWeight = 0.0;\n\t\tfor (int i = 0; i < NUM_SAMPLES; ++i) {\n\t\t\t\tunpackSample(i, L, mipLevel);\n\t\t\t\tresult += DECODE_FUNC(SOURCE_FUNC(vecSpace * L, mipLevel));\n\t\t}\n\n\t\treturn ENCODE_FUNC(result / float(NUM_SAMPLES));\n}\n\nvoid main(void) {\n\t\tgl_FragColor = PROCESS_FUNC();\n}\n',rgbmPS:"\nvec3 texture2DRGBM(sampler2D tex, vec2 uv) {\n\t\treturn decodeRGBM(texture2D(tex, uv));\n}\n\nvec3 texture2DRGBM(sampler2D tex, vec2 uv, float bias) {\n\t\treturn decodeRGBM(texture2D(tex, uv, bias));\n}\n\nvec3 textureCubeRGBM(samplerCube tex, vec3 uvw) {\n\t\treturn decodeRGBM(textureCube(tex, uvw));\n}\n",screenDepthPS:"\nuniform highp sampler2D uSceneDepthMap;\n\n#ifndef SCREENSIZE\n#define SCREENSIZE\nuniform vec4 uScreenSize;\n#endif\n\n#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\n\n#ifndef CAMERAPLANES\n#define CAMERAPLANES\nuniform vec4 camera_params; // 1 / camera_far,\t\t\tcamera_far,\t\t (1 - f / n) / 2,\t\t\t\t(1 + f / n) / 2\n#endif\n\n#ifdef GL2\nfloat linearizeDepth(float z) {\n\t\tz = z * 2.0 - 1.0;\n\t\treturn 1.0 / (camera_params.z * z + camera_params.w);\n}\n#else\n#ifndef UNPACKFLOAT\n#define UNPACKFLOAT\nfloat unpackFloat(vec4 rgbaDepth) {\n\t\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\t\treturn dot(rgbaDepth, bitShift);\n}\n#endif\n#endif\n\n// Retrieves rendered linear camera depth by UV\nfloat getLinearScreenDepth(vec2 uv) {\n\t\t#ifdef GL2\n\t\treturn linearizeDepth(texture2D(uSceneDepthMap, uv).r) * camera_params.y;\n\t\t#else\n\t\treturn unpackFloat(texture2D(uSceneDepthMap, uv)) * camera_params.y;\n\t\t#endif\n}\n\n#ifndef VERTEXSHADER\n// Retrieves rendered linear camera depth under the current pixel\nfloat getLinearScreenDepth() {\n\t\tvec2 uv = gl_FragCoord.xy * uScreenSize.zw;\n\t\treturn getLinearScreenDepth(uv);\n}\n#endif\n\n// Generates linear camera depth for the given world position\nfloat getLinearDepth(vec3 pos) {\n\t\treturn -(matrix_view * vec4(pos, 1.0)).z;\n}\n",shadowCascadesPS:"\nconst float maxCascades = 4.0;\n\n// shadow matrix for selected cascade\nmat4 cascadeShadowMat;\n\n// function which selects a shadow projection matrix based on cascade distances \nvoid getShadowCascadeMatrix(mat4 shadowMatrixPalette[4], float shadowCascadeDistances[4], float shadowCascadeCount) {\n\n\t\t// depth in 0 .. far plane range\n\t\tfloat depth = 1.0 / gl_FragCoord.w;\n\n\t\t// find cascade index based on the depth (loop as there is no per component vec compare operator in webgl)\n\t\tfloat cascadeIndex = 0.0;\n\t\tfor (float i = 0.0; i < maxCascades; i++) {\n\t\t\t\tif (depth < shadowCascadeDistances[int(i)]) {\n\t\t\t\t\t\tcascadeIndex = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t}\n\n\t\t// limit to actual number of used cascades\n\t\tcascadeIndex = min(cascadeIndex, shadowCascadeCount - 1.0);\n\n\t\t// pick shadow matrix\n\t\t#ifdef GL2\n\t\t\t\tcascadeShadowMat = shadowMatrixPalette[int(cascadeIndex)];\n\t\t#else\n\t\t\t\t// webgl 1 does not allow non-cost index array lookup\n\t\t\t\tif (cascadeIndex == 0.0) {\n\t\t\t\t\t\tcascadeShadowMat = shadowMatrixPalette[0];\n\t\t\t\t}\n\t\t\t\telse if (cascadeIndex == 1.0) {\n\t\t\t\t\t\tcascadeShadowMat = shadowMatrixPalette[1];\n\t\t\t\t}\n\t\t\t\telse if (cascadeIndex == 2.0) {\n\t\t\t\t\t\tcascadeShadowMat = shadowMatrixPalette[2];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t\tcascadeShadowMat = shadowMatrixPalette[3];\n\t\t\t\t}\n\t\t#endif\n}\n\nvoid fadeShadow(float shadowCascadeDistances[4]) {\t\t\t\t\t\t\t\t\t\n\n\t\t// if the pixel is past the shadow distance, remove shadow\n\t\t// this enforces straight line instead of corner of shadow which moves when camera rotates\t\n\t\tfloat depth = 1.0 / gl_FragCoord.w;\n\t\tif (depth > shadowCascadeDistances[int(maxCascades - 1.0)]) {\n\t\t\t\tdShadowCoord.z = -9999999.0;\n\t\t}\n}\n",shadowCommonPS:"\nvoid normalOffsetPointShadow(vec4 shadowParams) {\n\t\tfloat distScale = length(dLightDirW);\n\t\tvec3 wPos = vPositionW + dVertexNormalW * shadowParams.y * clamp(1.0 - dot(dVertexNormalW, -dLightDirNormW), 0.0, 1.0) * distScale; //0.02\n\t\tvec3 dir = wPos - dLightPosW;\n\t\tdLightDirW = dir;\n}\n",shadowCoordPS:"\nvoid _getShadowCoordOrtho(mat4 shadowMatrix, vec3 shadowParams, vec3 wPos) {\n\t\tdShadowCoord = (shadowMatrix * vec4(wPos, 1.0)).xyz;\n\t\tdShadowCoord.z = saturate(dShadowCoord.z) - 0.0001;\n\n\t\t#ifdef SHADOWBIAS\n\t\tdShadowCoord.z += getShadowBias(shadowParams.x, shadowParams.z);\n\t\t#endif\n}\n\nvoid _getShadowCoordPersp(mat4 shadowMatrix, vec4 shadowParams, vec3 wPos) {\n\t\tvec4 projPos = shadowMatrix * vec4(wPos, 1.0);\n\t\tprojPos.xy /= projPos.w;\n\t\tdShadowCoord.xy = projPos.xy;\n\t\tdShadowCoord.z = length(dLightDirW) * shadowParams.w;\n\n\t\t#ifdef SHADOWBIAS\n\t\tdShadowCoord.z += getShadowBias(shadowParams.x, shadowParams.z);\n\t\t#endif\n}\n\nvoid getShadowCoordOrtho(mat4 shadowMatrix, vec3 shadowParams) {\n\t\t_getShadowCoordOrtho(shadowMatrix, shadowParams, vPositionW);\n}\n\nvoid getShadowCoordPersp(mat4 shadowMatrix, vec4 shadowParams) {\n\t\t_getShadowCoordPersp(shadowMatrix, shadowParams, vPositionW);\n}\n\nvoid getShadowCoordPerspNormalOffset(mat4 shadowMatrix, vec4 shadowParams) {\n\t\tfloat distScale = abs(dot(vPositionW - dLightPosW, dLightDirNormW)); // fov?\n\t\tvec3 wPos = vPositionW + dVertexNormalW * shadowParams.y * clamp(1.0 - dot(dVertexNormalW, -dLightDirNormW), 0.0, 1.0) * distScale;\n\n\t\t_getShadowCoordPersp(shadowMatrix, shadowParams, wPos);\n}\n\nvoid getShadowCoordOrthoNormalOffset(mat4 shadowMatrix, vec3 shadowParams) {\n\t\tvec3 wPos = vPositionW + dVertexNormalW * shadowParams.y * clamp(1.0 - dot(dVertexNormalW, -dLightDirNormW), 0.0, 1.0); //0.08\n\n\t\t_getShadowCoordOrtho(shadowMatrix, shadowParams, wPos);\n}\n",shadowCoordPerspZbufferPS:"\nvoid _getShadowCoordPerspZbuffer(mat4 shadowMatrix, vec4 shadowParams, vec3 wPos) {\n\t\tvec4 projPos = shadowMatrix * vec4(wPos, 1.0);\n\t\tprojPos.xyz /= projPos.w;\n\t\tdShadowCoord = projPos.xyz;\n\t\t// depth bias is already applied on render\n}\n\nvoid getShadowCoordPerspZbufferNormalOffset(mat4 shadowMatrix, vec4 shadowParams) {\n\t\tfloat distScale = abs(dot(vPositionW - dLightPosW, dLightDirNormW)); // fov?\n\t\tvec3 wPos = vPositionW + dVertexNormalW * shadowParams.y * clamp(1.0 - dot(dVertexNormalW, -dLightDirNormW), 0.0, 1.0) * distScale;\n\t\t_getShadowCoordPerspZbuffer(shadowMatrix, shadowParams, wPos);\n}\n\nvoid getShadowCoordPerspZbuffer(mat4 shadowMatrix, vec4 shadowParams) {\n\t\t_getShadowCoordPerspZbuffer(shadowMatrix, shadowParams, vPositionW);\n}\n",shadowEVSMPS:"\nfloat VSM$(sampler2D tex, vec2 texCoords, float resolution, float Z, float vsmBias, float exponent) {\n\t\tvec3 moments = texture2D(tex, texCoords).xyz;\n\t\treturn calculateEVSM(moments, Z, vsmBias, exponent);\n}\n\nfloat getShadowVSM$(sampler2D shadowMap, vec3 shadowParams, float exponent) {\n\t\treturn VSM$(shadowMap, dShadowCoord.xy, shadowParams.x, dShadowCoord.z, shadowParams.y, exponent);\n}\n\nfloat getShadowSpotVSM$(sampler2D shadowMap, vec4 shadowParams, float exponent) {\n\t\treturn VSM$(shadowMap, dShadowCoord.xy, shadowParams.x, length(dLightDirW) * shadowParams.w + shadowParams.z, shadowParams.y, exponent);\n}\n",shadowEVSMnPS:"\nfloat VSM$(sampler2D tex, vec2 texCoords, float resolution, float Z, float vsmBias, float exponent) {\n\t\tfloat pixelSize = 1.0 / resolution;\n\t\ttexCoords -= vec2(pixelSize);\n\t\tvec3 s00 = texture2D(tex, texCoords).xyz;\n\t\tvec3 s10 = texture2D(tex, texCoords + vec2(pixelSize, 0)).xyz;\n\t\tvec3 s01 = texture2D(tex, texCoords + vec2(0, pixelSize)).xyz;\n\t\tvec3 s11 = texture2D(tex, texCoords + vec2(pixelSize)).xyz;\n\t\tvec2 fr = fract(texCoords * resolution);\n\t\tvec3 h0 = mix(s00, s10, fr.x);\n\t\tvec3 h1 = mix(s01, s11, fr.x);\n\t\tvec3 moments = mix(h0, h1, fr.y);\n\t\treturn calculateEVSM(moments, Z, vsmBias, exponent);\n}\n\nfloat getShadowVSM$(sampler2D shadowMap, vec3 shadowParams, float exponent) {\n\t\treturn VSM$(shadowMap, dShadowCoord.xy, shadowParams.x, dShadowCoord.z, shadowParams.y, exponent);\n}\n\nfloat getShadowSpotVSM$(sampler2D shadowMap, vec4 shadowParams, float exponent) {\n\t\treturn VSM$(shadowMap, dShadowCoord.xy, shadowParams.x, length(dLightDirW) * shadowParams.w + shadowParams.z, shadowParams.y, exponent);\n}\n",shadowStandardPS:"\nvec3 lessThan2(vec3 a, vec3 b) {\n\t\treturn clamp((b - a)*1000.0, 0.0, 1.0); // softer version\n}\n\n#ifndef UNPACKFLOAT\n#define UNPACKFLOAT\nfloat unpackFloat(vec4 rgbaDepth) {\n\t\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\t\treturn dot(rgbaDepth, bitShift);\n}\n#endif\n\n// ----- Direct/Spot Sampling -----\n\n#ifdef GL2\nfloat _getShadowPCF3x3(sampler2DShadow shadowMap, vec3 shadowParams) {\n\t\tfloat z = dShadowCoord.z;\n\t\tvec2 uv = dShadowCoord.xy * shadowParams.x; // 1 unit - 1 texel\n\t\tfloat shadowMapSizeInv = 1.0 / shadowParams.x;\n\t\tvec2 base_uv = floor(uv + 0.5);\n\t\tfloat s = (uv.x + 0.5 - base_uv.x);\n\t\tfloat t = (uv.y + 0.5 - base_uv.y);\n\t\tbase_uv -= vec2(0.5);\n\t\tbase_uv *= shadowMapSizeInv;\n\n\t\tfloat sum = 0.0;\n\n\t\tfloat uw0 = (3.0 - 2.0 * s);\n\t\tfloat uw1 = (1.0 + 2.0 * s);\n\n\t\tfloat u0 = (2.0 - s) / uw0 - 1.0;\n\t\tfloat u1 = s / uw1 + 1.0;\n\n\t\tfloat vw0 = (3.0 - 2.0 * t);\n\t\tfloat vw1 = (1.0 + 2.0 * t);\n\n\t\tfloat v0 = (2.0 - t) / vw0 - 1.0;\n\t\tfloat v1 = t / vw1 + 1.0;\n\n\t\tu0 = u0 * shadowMapSizeInv + base_uv.x;\n\t\tv0 = v0 * shadowMapSizeInv + base_uv.y;\n\n\t\tu1 = u1 * shadowMapSizeInv + base_uv.x;\n\t\tv1 = v1 * shadowMapSizeInv + base_uv.y;\n\n\t\tsum += uw0 * vw0 * texture(shadowMap, vec3(u0, v0, z));\n\t\tsum += uw1 * vw0 * texture(shadowMap, vec3(u1, v0, z));\n\t\tsum += uw0 * vw1 * texture(shadowMap, vec3(u0, v1, z));\n\t\tsum += uw1 * vw1 * texture(shadowMap, vec3(u1, v1, z));\n\n\t\tsum *= 1.0f / 16.0;\n\t\treturn sum;\n}\n\nfloat getShadowPCF3x3(sampler2DShadow shadowMap, vec3 shadowParams) {\n\t\treturn _getShadowPCF3x3(shadowMap, shadowParams);\n}\n\nfloat getShadowSpotPCF3x3(sampler2DShadow shadowMap, vec4 shadowParams) {\n\t\treturn _getShadowPCF3x3(shadowMap, shadowParams.xyz);\n}\n#else\nfloat _xgetShadowPCF3x3(mat3 depthKernel, sampler2D shadowMap, vec3 shadowParams) {\n\t\tmat3 shadowKernel;\n\t\tvec3 shadowCoord = dShadowCoord;\n\t\tvec3 shadowZ = vec3(shadowCoord.z);\n\t\tshadowKernel[0] = vec3(greaterThan(depthKernel[0], shadowZ));\n\t\tshadowKernel[1] = vec3(greaterThan(depthKernel[1], shadowZ));\n\t\tshadowKernel[2] = vec3(greaterThan(depthKernel[2], shadowZ));\n\n\t\tvec2 fractionalCoord = fract( shadowCoord.xy * shadowParams.x );\n\n\t\tshadowKernel[0] = mix(shadowKernel[0], shadowKernel[1], fractionalCoord.x);\n\t\tshadowKernel[1] = mix(shadowKernel[1], shadowKernel[2], fractionalCoord.x);\n\n\t\tvec4 shadowValues;\n\t\tshadowValues.x = mix(shadowKernel[0][0], shadowKernel[0][1], fractionalCoord.y);\n\t\tshadowValues.y = mix(shadowKernel[0][1], shadowKernel[0][2], fractionalCoord.y);\n\t\tshadowValues.z = mix(shadowKernel[1][0], shadowKernel[1][1], fractionalCoord.y);\n\t\tshadowValues.w = mix(shadowKernel[1][1], shadowKernel[1][2], fractionalCoord.y);\n\n\t\treturn dot( shadowValues, vec4( 1.0 ) ) * 0.25;\n}\n\nfloat _getShadowPCF3x3(sampler2D shadowMap, vec3 shadowParams) {\n\t\tvec3 shadowCoord = dShadowCoord;\n\n\t\tfloat xoffset = 1.0 / shadowParams.x; // 1/shadow map width\n\t\tfloat dx0 = -xoffset;\n\t\tfloat dx1 = xoffset;\n\n\t\tmat3 depthKernel;\n\t\tdepthKernel[0][0] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx0, dx0)));\n\t\tdepthKernel[0][1] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx0, 0.0)));\n\t\tdepthKernel[0][2] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx0, dx1)));\n\t\tdepthKernel[1][0] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(0.0, dx0)));\n\t\tdepthKernel[1][1] = unpackFloat(texture2D(shadowMap, shadowCoord.xy));\n\t\tdepthKernel[1][2] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(0.0, dx1)));\n\t\tdepthKernel[2][0] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx1, dx0)));\n\t\tdepthKernel[2][1] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx1, 0.0)));\n\t\tdepthKernel[2][2] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx1, dx1)));\n\n\t\treturn _xgetShadowPCF3x3(depthKernel, shadowMap, shadowParams);\n}\n\nfloat getShadowPCF3x3(sampler2D shadowMap, vec3 shadowParams) {\n\t\treturn _getShadowPCF3x3(shadowMap, shadowParams);\n}\n\nfloat getShadowSpotPCF3x3(sampler2D shadowMap, vec4 shadowParams) {\n\t\treturn _getShadowPCF3x3(shadowMap, shadowParams.xyz);\n}\n#endif\n\n\n// ----- Omni Sampling -----\n\nfloat _getShadowPoint(samplerCube shadowMap, vec4 shadowParams, vec3 dir) {\n\n\t\tvec3 tc = normalize(dir);\n\t\tvec3 tcAbs = abs(tc);\n\n\t\tvec4 dirX = vec4(1,0,0, tc.x);\n\t\tvec4 dirY = vec4(0,1,0, tc.y);\n\t\tfloat majorAxisLength = tc.z;\n\t\tif ((tcAbs.x > tcAbs.y) && (tcAbs.x > tcAbs.z)) {\n\t\t\t\tdirX = vec4(0,0,1, tc.z);\n\t\t\t\tdirY = vec4(0,1,0, tc.y);\n\t\t\t\tmajorAxisLength = tc.x;\n\t\t} else if ((tcAbs.y > tcAbs.x) && (tcAbs.y > tcAbs.z)) {\n\t\t\t\tdirX = vec4(1,0,0, tc.x);\n\t\t\t\tdirY = vec4(0,0,1, tc.z);\n\t\t\t\tmajorAxisLength = tc.y;\n\t\t}\n\n\t\tfloat shadowParamsInFaceSpace = ((1.0/shadowParams.x) * 2.0) * abs(majorAxisLength);\n\n\t\tvec3 xoffset = (dirX.xyz * shadowParamsInFaceSpace);\n\t\tvec3 yoffset = (dirY.xyz * shadowParamsInFaceSpace);\n\t\tvec3 dx0 = -xoffset;\n\t\tvec3 dy0 = -yoffset;\n\t\tvec3 dx1 = xoffset;\n\t\tvec3 dy1 = yoffset;\n\n\t\tmat3 shadowKernel;\n\t\tmat3 depthKernel;\n\n\t\tdepthKernel[0][0] = unpackFloat(textureCube(shadowMap, tc + dx0 + dy0));\n\t\tdepthKernel[0][1] = unpackFloat(textureCube(shadowMap, tc + dx0));\n\t\tdepthKernel[0][2] = unpackFloat(textureCube(shadowMap, tc + dx0 + dy1));\n\t\tdepthKernel[1][0] = unpackFloat(textureCube(shadowMap, tc + dy0));\n\t\tdepthKernel[1][1] = unpackFloat(textureCube(shadowMap, tc));\n\t\tdepthKernel[1][2] = unpackFloat(textureCube(shadowMap, tc + dy1));\n\t\tdepthKernel[2][0] = unpackFloat(textureCube(shadowMap, tc + dx1 + dy0));\n\t\tdepthKernel[2][1] = unpackFloat(textureCube(shadowMap, tc + dx1));\n\t\tdepthKernel[2][2] = unpackFloat(textureCube(shadowMap, tc + dx1 + dy1));\n\n\t\tvec3 shadowZ = vec3(length(dir) * shadowParams.w + shadowParams.z);\n\n\t\tshadowKernel[0] = vec3(lessThan2(depthKernel[0], shadowZ));\n\t\tshadowKernel[1] = vec3(lessThan2(depthKernel[1], shadowZ));\n\t\tshadowKernel[2] = vec3(lessThan2(depthKernel[2], shadowZ));\n\n\t\tvec2 uv = (vec2(dirX.w, dirY.w) / abs(majorAxisLength)) * 0.5;\n\n\t\tvec2 fractionalCoord = fract( uv * shadowParams.x );\n\n\t\tshadowKernel[0] = mix(shadowKernel[0], shadowKernel[1], fractionalCoord.x);\n\t\tshadowKernel[1] = mix(shadowKernel[1], shadowKernel[2], fractionalCoord.x);\n\n\t\tvec4 shadowValues;\n\t\tshadowValues.x = mix(shadowKernel[0][0], shadowKernel[0][1], fractionalCoord.y);\n\t\tshadowValues.y = mix(shadowKernel[0][1], shadowKernel[0][2], fractionalCoord.y);\n\t\tshadowValues.z = mix(shadowKernel[1][0], shadowKernel[1][1], fractionalCoord.y);\n\t\tshadowValues.w = mix(shadowKernel[1][1], shadowKernel[1][2], fractionalCoord.y);\n\n\t\treturn 1.0 - dot( shadowValues, vec4( 1.0 ) ) * 0.25;\n}\n\nfloat getShadowPointPCF3x3(samplerCube shadowMap, vec4 shadowParams) {\n\t\treturn _getShadowPoint(shadowMap, shadowParams, dLightDirW);\n}\n",shadowStandardGL2PS:"\nfloat _getShadowPCF5x5(sampler2DShadow shadowMap, vec3 shadowParams) {\n\t\t// http://the-witness.net/news/2013/09/shadow-mapping-summary-part-1/\n\n\t\tfloat z = dShadowCoord.z;\n\t\tvec2 uv = dShadowCoord.xy * shadowParams.x; // 1 unit - 1 texel\n\t\tfloat shadowMapSizeInv = 1.0 / shadowParams.x;\n\t\tvec2 base_uv = floor(uv + 0.5);\n\t\tfloat s = (uv.x + 0.5 - base_uv.x);\n\t\tfloat t = (uv.y + 0.5 - base_uv.y);\n\t\tbase_uv -= vec2(0.5);\n\t\tbase_uv *= shadowMapSizeInv;\n\n\n\t\tfloat uw0 = (4.0 - 3.0 * s);\n\t\tfloat uw1 = 7.0;\n\t\tfloat uw2 = (1.0 + 3.0 * s);\n\n\t\tfloat u0 = (3.0 - 2.0 * s) / uw0 - 2.0;\n\t\tfloat u1 = (3.0 + s) / uw1;\n\t\tfloat u2 = s / uw2 + 2.0;\n\n\t\tfloat vw0 = (4.0 - 3.0 * t);\n\t\tfloat vw1 = 7.0;\n\t\tfloat vw2 = (1.0 + 3.0 * t);\n\n\t\tfloat v0 = (3.0 - 2.0 * t) / vw0 - 2.0;\n\t\tfloat v1 = (3.0 + t) / vw1;\n\t\tfloat v2 = t / vw2 + 2.0;\n\n\t\tfloat sum = 0.0;\n\n\t\tu0 = u0 * shadowMapSizeInv + base_uv.x;\n\t\tv0 = v0 * shadowMapSizeInv + base_uv.y;\n\n\t\tu1 = u1 * shadowMapSizeInv + base_uv.x;\n\t\tv1 = v1 * shadowMapSizeInv + base_uv.y;\n\n\t\tu2 = u2 * shadowMapSizeInv + base_uv.x;\n\t\tv2 = v2 * shadowMapSizeInv + base_uv.y;\n\n\t\tsum += uw0 * vw0 * texture(shadowMap, vec3(u0, v0, z));\n\t\tsum += uw1 * vw0 * texture(shadowMap, vec3(u1, v0, z));\n\t\tsum += uw2 * vw0 * texture(shadowMap, vec3(u2, v0, z));\n\n\t\tsum += uw0 * vw1 * texture(shadowMap, vec3(u0, v1, z));\n\t\tsum += uw1 * vw1 * texture(shadowMap, vec3(u1, v1, z));\n\t\tsum += uw2 * vw1 * texture(shadowMap, vec3(u2, v1, z));\n\n\t\tsum += uw0 * vw2 * texture(shadowMap, vec3(u0, v2, z));\n\t\tsum += uw1 * vw2 * texture(shadowMap, vec3(u1, v2, z));\n\t\tsum += uw2 * vw2 * texture(shadowMap, vec3(u2, v2, z));\n\n\t\tsum *= 1.0f / 144.0;\n\n\t\tsum = gammaCorrectInput(sum); // gives softer gradient\n\t\tsum = saturate(sum);\n\n\t\treturn sum;\n}\n\nfloat getShadowPCF5x5(sampler2DShadow shadowMap, vec3 shadowParams) {\n\t\treturn _getShadowPCF5x5(shadowMap, shadowParams);\n}\n\nfloat getShadowSpotPCF5x5(sampler2DShadow shadowMap, vec4 shadowParams) {\n\t\treturn _getShadowPCF5x5(shadowMap, shadowParams.xyz);\n}\n",shadowVSM8PS:"\nfloat calculateVSM8(vec3 moments, float Z, float vsmBias) {\n\t\tfloat VSMBias = vsmBias;//0.01 * 0.25;\n\t\tfloat depthScale = VSMBias * Z;\n\t\tfloat minVariance1 = depthScale * depthScale;\n\t\treturn chebyshevUpperBound(moments.xy, Z, minVariance1, 0.1);\n}\n\nfloat decodeFloatRG(vec2 rg) {\n\t\treturn rg.y*(1.0/255.0) + rg.x;\n}\n\nfloat VSM8(sampler2D tex, vec2 texCoords, float resolution, float Z, float vsmBias, float exponent) {\n\t\tvec4 c = texture2D(tex, texCoords);\n\t\tvec3 moments = vec3(decodeFloatRG(c.xy), decodeFloatRG(c.zw), 0.0);\n\t\treturn calculateVSM8(moments, Z, vsmBias);\n}\n\nfloat getShadowVSM8(sampler2D shadowMap, vec3 shadowParams, float exponent) {\n\t\treturn VSM8(shadowMap, dShadowCoord.xy, shadowParams.x, dShadowCoord.z, shadowParams.y, 0.0);\n}\n\nfloat getShadowSpotVSM8(sampler2D shadowMap, vec4 shadowParams, float exponent) {\n\t\treturn VSM8(shadowMap, dShadowCoord.xy, shadowParams.x, length(dLightDirW) * shadowParams.w + shadowParams.z, shadowParams.y, 0.0);\n}\n",shadowVSM_commonPS:"\nfloat linstep(float a, float b, float v) {\n\t\treturn saturate((v - a) / (b - a));\n}\n\nfloat reduceLightBleeding(float pMax, float amount) {\n\t // Remove the [0, amount] tail and linearly rescale (amount, 1].\n\t return linstep(amount, 1.0, pMax);\n}\n\nfloat chebyshevUpperBound(vec2 moments, float mean, float minVariance, float lightBleedingReduction) {\n\t\t// Compute variance\n\t\tfloat variance = moments.y - (moments.x * moments.x);\n\t\tvariance = max(variance, minVariance);\n\n\t\t// Compute probabilistic upper bound\n\t\tfloat d = mean - moments.x;\n\t\tfloat pMax = variance / (variance + (d * d));\n\n\t\tpMax = reduceLightBleeding(pMax, lightBleedingReduction);\n\n\t\t// One-tailed Chebyshev\n\t\treturn (mean <= moments.x ? 1.0 : pMax);\n}\n\nfloat calculateEVSM(vec3 moments, float Z, float vsmBias, float exponent) {\n\t\tZ = 2.0 * Z - 1.0;\n\t\tfloat warpedDepth = exp(exponent * Z);\n\n\t\tmoments.xy += vec2(warpedDepth, warpedDepth*warpedDepth) * (1.0 - moments.z);\n\n\t\tfloat VSMBias = vsmBias;//0.01 * 0.25;\n\t\tfloat depthScale = VSMBias * exponent * warpedDepth;\n\t\tfloat minVariance1 = depthScale * depthScale;\n\t\treturn chebyshevUpperBound(moments.xy, warpedDepth, minVariance1, 0.1);\n}\n",skinBatchConstVS:"\nattribute float vertex_boneIndices;\n\nuniform vec4 matrix_pose[BONE_LIMIT * 3];\n\nmat4 getBoneMatrix(const in float i) {\n\t\t// read 4x3 matrix\n\t\tvec4 v1 = matrix_pose[int(3.0 * i)];\n\t\tvec4 v2 = matrix_pose[int(3.0 * i + 1.0)];\n\t\tvec4 v3 = matrix_pose[int(3.0 * i + 2.0)];\n\n\t\t// transpose to 4x4 matrix\n\t\treturn mat4(\n\t\t\t\tv1.x, v2.x, v3.x, 0,\n\t\t\t\tv1.y, v2.y, v3.y, 0,\n\t\t\t\tv1.z, v2.z, v3.z, 0,\n\t\t\t\tv1.w, v2.w, v3.w, 1\n\t\t);\n}\n",skinBatchTexVS:"\nattribute float vertex_boneIndices;\n\nuniform highp sampler2D texture_poseMap;\nuniform vec4 texture_poseMapSize;\n\nmat4 getBoneMatrix(const in float i) {\n\t\tfloat j = i * 3.0;\n\t\tfloat dx = texture_poseMapSize.z;\n\t\tfloat dy = texture_poseMapSize.w;\n\n\t\tfloat y = floor(j * dx);\n\t\tfloat x = j - (y * texture_poseMapSize.x);\n\t\ty = dy * (y + 0.5);\n\n\t\t// read elements of 4x3 matrix\n\t\tvec4 v1 = texture2D(texture_poseMap, vec2(dx * (x + 0.5), y));\n\t\tvec4 v2 = texture2D(texture_poseMap, vec2(dx * (x + 1.5), y));\n\t\tvec4 v3 = texture2D(texture_poseMap, vec2(dx * (x + 2.5), y));\n\n\t\t// transpose to 4x4 matrix\n\t\treturn mat4(\n\t\t\t\tv1.x, v2.x, v3.x, 0,\n\t\t\t\tv1.y, v2.y, v3.y, 0,\n\t\t\t\tv1.z, v2.z, v3.z, 0,\n\t\t\t\tv1.w, v2.w, v3.w, 1\n\t\t);\n}\n",skinConstVS:"\nattribute vec4 vertex_boneWeights;\nattribute vec4 vertex_boneIndices;\n\nuniform vec4 matrix_pose[BONE_LIMIT * 3];\n\nvoid getBoneMatrix(const in float i, out vec4 v1, out vec4 v2, out vec4 v3) {\n\t\t// read 4x3 matrix\n\t\tv1 = matrix_pose[int(3.0 * i)];\n\t\tv2 = matrix_pose[int(3.0 * i + 1.0)];\n\t\tv3 = matrix_pose[int(3.0 * i + 2.0)];\n}\n\nmat4 getSkinMatrix(const in vec4 indices, const in vec4 weights) {\n\t\t// get 4 bone matrices\n\t\tvec4 a1, a2, a3;\n\t\tgetBoneMatrix(indices.x, a1, a2, a3);\n\n\t\tvec4 b1, b2, b3;\n\t\tgetBoneMatrix(indices.y, b1, b2, b3);\n\n\t\tvec4 c1, c2, c3;\n\t\tgetBoneMatrix(indices.z, c1, c2, c3);\n\n\t\tvec4 d1, d2, d3;\n\t\tgetBoneMatrix(indices.w, d1, d2, d3);\n\n\t\t// multiply them by weights and add up to get final 4x3 matrix\n\t\tvec4 v1 = a1 * weights.x + b1 * weights.y + c1 * weights.z + d1 * weights.w;\n\t\tvec4 v2 = a2 * weights.x + b2 * weights.y + c2 * weights.z + d2 * weights.w;\n\t\tvec4 v3 = a3 * weights.x + b3 * weights.y + c3 * weights.z + d3 * weights.w;\n\n\t\t// add up weights\n\t\tfloat one = dot(weights, vec4(1.0));\n\n\t\t// transpose to 4x4 matrix\n\t\treturn mat4(\n\t\t\t\tv1.x, v2.x, v3.x, 0,\n\t\t\t\tv1.y, v2.y, v3.y, 0,\n\t\t\t\tv1.z, v2.z, v3.z, 0,\n\t\t\t\tv1.w, v2.w, v3.w, one\n\t\t);\n}\n",skinTexVS:"\nattribute vec4 vertex_boneWeights;\nattribute vec4 vertex_boneIndices;\n\nuniform highp sampler2D texture_poseMap;\nuniform vec4 texture_poseMapSize;\n\nvoid getBoneMatrix(const in float i, out vec4 v1, out vec4 v2, out vec4 v3) {\n\t\tfloat j = i * 3.0;\n\t\tfloat dx = texture_poseMapSize.z;\n\t\tfloat dy = texture_poseMapSize.w;\n\t\t\n\t\tfloat y = floor(j * dx);\n\t\tfloat x = j - (y * texture_poseMapSize.x);\n\t\ty = dy * (y + 0.5);\n\n\t\t// read elements of 4x3 matrix\n\t\tv1 = texture2D(texture_poseMap, vec2(dx * (x + 0.5), y));\n\t\tv2 = texture2D(texture_poseMap, vec2(dx * (x + 1.5), y));\n\t\tv3 = texture2D(texture_poseMap, vec2(dx * (x + 2.5), y));\n}\n\nmat4 getSkinMatrix(const in vec4 indices, const in vec4 weights) {\n\t\t// get 4 bone matrices\n\t\tvec4 a1, a2, a3;\n\t\tgetBoneMatrix(indices.x, a1, a2, a3);\n\n\t\tvec4 b1, b2, b3;\n\t\tgetBoneMatrix(indices.y, b1, b2, b3);\n\n\t\tvec4 c1, c2, c3;\n\t\tgetBoneMatrix(indices.z, c1, c2, c3);\n\n\t\tvec4 d1, d2, d3;\n\t\tgetBoneMatrix(indices.w, d1, d2, d3);\n\n\t\t// multiply them by weights and add up to get final 4x3 matrix\n\t\tvec4 v1 = a1 * weights.x + b1 * weights.y + c1 * weights.z + d1 * weights.w;\n\t\tvec4 v2 = a2 * weights.x + b2 * weights.y + c2 * weights.z + d2 * weights.w;\n\t\tvec4 v3 = a3 * weights.x + b3 * weights.y + c3 * weights.z + d3 * weights.w;\n\n\t\t// add up weights\n\t\tfloat one = dot(weights, vec4(1.0));\n\n\t\t// transpose to 4x4 matrix\n\t\treturn mat4(\n\t\t\t\tv1.x, v2.x, v3.x, 0,\n\t\t\t\tv1.y, v2.y, v3.y, 0,\n\t\t\t\tv1.z, v2.z, v3.z, 0,\n\t\t\t\tv1.w, v2.w, v3.w, one\n\t\t);\n}\n",skyboxEnvPS:"\nvarying vec3 vViewDir;\n\nuniform sampler2D texture_envAtlas;\nuniform float mipLevel;\n\nvoid main(void) {\n\t\tvec3 dir = vViewDir * vec3(-1.0, 1.0, 1.0);\n\t\tvec2 uv = toSphericalUv(normalize(dir));\n\n\t\tvec3 linear = $DECODE(texture2D(texture_envAtlas, mapRoughnessUv(uv, mipLevel)));\n\n\t\tgl_FragColor = vec4(gammaCorrectOutput(toneMap(processEnvironment(linear))), 1.0);\n}\n",skyboxHDRPS:"\nvarying vec3 vViewDir;\n\nuniform samplerCube texture_cubeMap;\n\nvoid main(void) {\n\t\tvec3 dir=vViewDir;\n\t\tdir.x *= -1.0;\n\t\tvec3 color = processEnvironment($textureCubeSAMPLE(texture_cubeMap, fixSeamsStatic(dir, $FIXCONST)).rgb);\n\t\tcolor = toneMap(color);\n\t\tcolor = gammaCorrectOutput(color);\n\t\tgl_FragColor = vec4(color, 1.0);\n}\n",skyboxVS:"\nattribute vec3 aPosition;\n\n#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\n\nuniform mat4 matrix_projectionSkybox;\nuniform mat3 cubeMapRotationMatrix;\n\nvarying vec3 vViewDir;\n\nvoid main(void) {\n\t\tmat4 view = matrix_view;\n\t\tview[3][0] = view[3][1] = view[3][2] = 0.0;\n\t\tgl_Position = matrix_projectionSkybox * view * vec4(aPosition, 1.0);\n\n\t\t// Force skybox to far Z, regardless of the clip planes on the camera\n\t\t// Subtract a tiny fudge factor to ensure floating point errors don't\n\t\t// still push pixels beyond far Z. See:\n\t\t// http://www.opengl.org/discussion_boards/showthread.php/171867-skybox-problem\n\n\t\tgl_Position.z = gl_Position.w - 0.00001;\n\t\tvViewDir = aPosition * cubeMapRotationMatrix;\n}\n",specularPS:"\n#ifdef MAPCOLOR\nuniform vec3 material_specular;\n#endif\n\n#ifdef MAPTEXTURE\nuniform sampler2D texture_specularMap;\n#endif\n\nvoid getSpecularity() {\n\t\tdSpecularity = vec3(1.0);\n\n\t\t#ifdef MAPCOLOR\n\t\tdSpecularity *= material_specular;\n\t\t#endif\n\n\t\t#ifdef MAPTEXTURE\n\t\tdSpecularity *= texture2D(texture_specularMap, $UV, textureBias).$CH;\n\t\t#endif\n\n\t\t#ifdef MAPVERTEX\n\t\tdSpecularity *= saturate(vVertexColor.$VC);\n\t\t#endif\n}\n",specularAaNonePS:"\nfloat antiAliasGlossiness(float power) {\n\t\treturn power;\n}\n",specularAaToksvigPS:"\nfloat antiAliasGlossiness(float power) {\n\t\tfloat rlen = 1.0 / saturate(length(dNormalMap));\n\t\tfloat toksvig = 1.0 / (1.0 + power * (rlen - 1.0));\n\t\treturn power * mix(1.0, toksvig, material_bumpiness);\n}\n",specularAaToksvigFastPS:"\nfloat antiAliasGlossiness(float power) {\n\t\tfloat rlen = 1.0 / saturate(length(dNormalMap));\n\t\tfloat toksvig = 1.0 / (1.0 + power * (rlen - 1.0));\n\t\treturn power * toksvig;\n}\n",spotPS:"\nfloat getSpotEffect(vec3 lightSpotDirW, float lightInnerConeAngle, float lightOuterConeAngle) {\n\t\tfloat cosAngle = dot(dLightDirNormW, lightSpotDirW);\n\t\treturn smoothstep(lightOuterConeAngle, lightInnerConeAngle, cosAngle);\n}\n",startPS:"\nvoid main(void) {\n\t\tdDiffuseLight = vec3(0);\n\t\tdSpecularLight = vec3(0);\n\t\tdReflection = vec4(0);\n\t\tdSpecularity = vec3(0);\n\n\t\t#ifdef CLEARCOAT\n\t\tccSpecularLight = vec3(0);\n\t\tccReflection = vec4(0);\n\t\t#endif\n",startVS:"\nvoid main(void) {\n\t\tgl_Position = getPosition();\n",startNineSlicedPS:"\n\t\tnineSlicedUv = vUv0;\n\t\tnineSlicedUv.y = 1.0 - nineSlicedUv.y;\n\n",startNineSlicedTiledPS:"\n\t\tvec2 tileMask = step(vMask, vec2(0.99999));\n\t\tvec2 tileSize = 0.5 * (innerOffset.xy + innerOffset.zw);\n\t\tvec2 tileScale = vec2(1.0) / (vec2(1.0) - tileSize);\n\t\tvec2 clampedUv = mix(innerOffset.xy * 0.5, vec2(1.0) - innerOffset.zw * 0.5, fract((vTiledUv - tileSize) * tileScale));\n\t\tclampedUv = clampedUv * atlasRect.zw + atlasRect.xy;\n\t\tnineSlicedUv = vUv0 * tileMask + clampedUv * (vec2(1.0) - tileMask);\n\t\tnineSlicedUv.y = 1.0 - nineSlicedUv.y;\n\t\t\n",storeEVSMPS:"\nfloat exponent = VSM_EXPONENT;\n\ndepth = 2.0 * depth - 1.0;\ndepth =\texp(exponent * depth);\ngl_FragColor = vec4(depth, depth*depth, 1.0, 1.0);\n",tangentBinormalVS:"\nvec3 getTangent() {\n\t\treturn normalize(dNormalMatrix * vertex_tangent.xyz);\n}\n\nvec3 getBinormal() {\n\t\treturn cross(vNormalW, vTangentW) * vertex_tangent.w;\n}\n\nvec3 getObjectSpaceUp() {\n\t\treturn normalize(dNormalMatrix * vec3(0, 1, 0));\n}\n",TBNPS:"\nvoid getTBN() {\n\t\tdTBN = mat3(normalize(dTangentW), normalize(dBinormalW), normalize(dVertexNormalW));\n}\n",TBNderivativePS:"\nuniform float tbnBasis;\n\n// http://www.thetenthplanet.de/archives/1180\nvoid getTBN() {\n\t\tvec2 uv = $UV;\n\n\t\t// get edge vectors of the pixel triangle\n\t\tvec3 dp1 = dFdx( vPositionW );\n\t\tvec3 dp2 = dFdy( vPositionW );\n\t\tvec2 duv1 = dFdx( uv );\n\t\tvec2 duv2 = dFdy( uv );\n\n\t\t// solve the linear system\n\t\tvec3 dp2perp = cross( dp2, dVertexNormalW );\n\t\tvec3 dp1perp = cross( dVertexNormalW, dp1 );\n\t\tvec3 T = dp2perp * duv1.x + dp1perp * duv2.x;\n\t\tvec3 B = dp2perp * duv1.y + dp1perp * duv2.y;\n\n\t\t// construct a scale-invariant frame\n\t\tfloat denom = max( dot(T,T), dot(B,B) );\n\t\tfloat invmax = (denom == 0.0) ? 0.0 : tbnBasis / sqrt( denom );\n\t\tdTBN = mat3(T * invmax, -B * invmax, dVertexNormalW );\n}\n",TBNfastPS:"\nvoid getTBN() {\n\t\tdTBN = mat3(dTangentW, dBinormalW, dVertexNormalW);\n}\n",TBNObjectSpacePS:"\nvoid getTBN() {\n\n\t\tvec3 B = cross(dVertexNormalW, vObjectSpaceUpW);\n\t\tvec3 T = cross(dVertexNormalW, B);\n\n\t\tif (dot(B,B)==0.0) // deal with case when vObjectSpaceUpW dVertexNormalW are parallel\n\t\t{\n\t\t\t\tfloat major=max(max(dVertexNormalW.x, dVertexNormalW.y),dVertexNormalW.z);\n\n\t\t\t\tif (dVertexNormalW.x==major)\n\t\t\t\t{\n\t\t\t\t\t\tB=cross(dVertexNormalW, vec3(0,1,0));\n\t\t\t\t\t\tT=cross(dVertexNormalW, B);\n\t\t\t\t}\n\t\t\t\telse if (dVertexNormalW.y==major)\n\t\t\t\t{\n\t\t\t\t\t\tB=cross(dVertexNormalW, vec3(0,0,1));\n\t\t\t\t\t\tT=cross(dVertexNormalW, B);\n\t\t\t\t}\n\t\t\t\telse if (dVertexNormalW.z==major)\n\t\t\t\t{\n\t\t\t\t\t\tB=cross(dVertexNormalW, vec3(1,0,0));\n\t\t\t\t\t\tT=cross(dVertexNormalW, B);\n\t\t\t\t}\n\t\t}\n\n\t\tdTBN = mat3(normalize(T), normalize(B), normalize(dVertexNormalW));\n}\n",tonemappingAcesPS:"\nuniform float exposure;\n\nvec3 toneMap(vec3 color) {\n\t\tfloat tA = 2.51;\n\t\tfloat tB = 0.03;\n\t\tfloat tC = 2.43;\n\t\tfloat tD = 0.59;\n\t\tfloat tE = 0.14;\n\t\tvec3 x = color * exposure;\n\t\treturn (x*(tA*x+tB))/(x*(tC*x+tD)+tE);\n}\n",tonemappingAces2PS:"\nuniform float exposure;\n\n// ACES approximation by Stephen Hill\n\n// sRGB => XYZ => D65_2_D60 => AP1 => RRT_SAT\nconst mat3 ACESInputMat = mat3(\n\t\t0.59719, 0.35458, 0.04823,\n\t\t0.07600, 0.90834, 0.01566,\n\t\t0.02840, 0.13383, 0.83777\n);\n\n// ODT_SAT => XYZ => D60_2_D65 => sRGB\nconst mat3 ACESOutputMat = mat3(\n\t\t 1.60475, -0.53108, -0.07367,\n\t\t-0.10208,\t1.10813, -0.00605,\n\t\t-0.00327, -0.07276,\t1.07602\n);\n\nvec3 RRTAndODTFit(vec3 v) {\n\t\tvec3 a = v * (v + 0.0245786) - 0.000090537;\n\t\tvec3 b = v * (0.983729 * v + 0.4329510) + 0.238081;\n\t\treturn a / b;\n}\n\nvec3 toneMap(vec3 color) {\n\t\tcolor *= exposure;\n\t\tcolor = color * ACESInputMat;\n\n\t\t// Apply RRT and ODT\n\t\tcolor = RRTAndODTFit(color);\n\t\tcolor = color * ACESOutputMat;\n\n\t\t// Clamp to [0, 1]\n\t\tcolor = clamp(color, 0.0, 1.0);\n\n\t\treturn color;\n}\n",tonemappingFilmicPS:"\nconst 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;\n\nuniform float exposure;\n\nvec3 uncharted2Tonemap(vec3 x) {\n\t return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;\n}\n\nvec3 toneMap(vec3 color) {\n\t\tcolor = uncharted2Tonemap(color * exposure);\n\t\tvec3 whiteScale = 1.0 / uncharted2Tonemap(vec3(W,W,W));\n\t\tcolor = color * whiteScale;\n\n\t\treturn color;\n}\n",tonemappingHejlPS:"\nuniform float exposure;\n\nvec3 toneMap(vec3 color) {\n\t\tcolor *= exposure;\n\t\tconst float\tA = 0.22, B = 0.3, C = .1, D = 0.2, E = .01, F = 0.3;\n\t\tconst float Scl = 1.25;\n\n\t\tvec3 h = max( vec3(0.0), color - vec3(0.004) );\n\t\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:"\nuniform float exposure;\n\nvec3 toneMap(vec3 color) {\n\t\treturn color * exposure;\n}\n",tonemappingNonePS:"\nvec3 toneMap(vec3 color) {\n\t\treturn color;\n}\n",transformVS:"\n#ifdef PIXELSNAP\nuniform vec4 uScreenSize;\n#endif\n\n#ifdef SCREENSPACE\nuniform float projectionFlipY;\n#endif\n\n#ifdef MORPHING\nuniform vec4 morph_weights_a;\nuniform vec4 morph_weights_b;\n#endif\n\n#ifdef MORPHING_TEXTURE_BASED\nuniform vec4 morph_tex_params;\n\nvec2 getTextureMorphCoords() {\n\t\tfloat vertexId = morph_vertex_id;\n\t\tvec2 textureSize = morph_tex_params.xy;\n\t\tvec2 invTextureSize = morph_tex_params.zw;\n\n\t\t// turn vertexId into int grid coordinates\n\t\tfloat morphGridV = floor(vertexId * invTextureSize.x);\n\t\tfloat morphGridU = vertexId - (morphGridV * textureSize.x);\n\n\t\t// convert grid coordinates to uv coordinates with half pixel offset\n\t\treturn (vec2(morphGridU, morphGridV) * invTextureSize) + (0.5 * invTextureSize);\n}\n#endif\n\n#ifdef MORPHING_TEXTURE_BASED_POSITION\nuniform highp sampler2D morphPositionTex;\n#endif\n\nmat4 getModelMatrix() {\n\t\t#ifdef DYNAMICBATCH\n\t\treturn getBoneMatrix(vertex_boneIndices);\n\t\t#elif defined(SKIN)\n\t\treturn matrix_model * getSkinMatrix(vertex_boneIndices, vertex_boneWeights);\n\t\t#elif defined(INSTANCING)\n\t\treturn mat4(instance_line1, instance_line2, instance_line3, instance_line4);\n\t\t#else\n\t\treturn matrix_model;\n\t\t#endif\n}\n\nvec4 getPosition() {\n\t\tdModelMatrix = getModelMatrix();\n\t\tvec3 localPos = vertex_position;\n\n\t\t#ifdef NINESLICED\n\t\t// outer and inner vertices are at the same position, scale both\n\t\tlocalPos.xz *= outerScale;\n\n\t\t// offset inner vertices inside\n\t\t// (original vertices must be in [-1;1] range)\n\t\tvec2 positiveUnitOffset = clamp(vertex_position.xz, vec2(0.0), vec2(1.0));\n\t\tvec2 negativeUnitOffset = clamp(-vertex_position.xz, vec2(0.0), vec2(1.0));\n\t\tlocalPos.xz += (-positiveUnitOffset * innerOffset.xy + negativeUnitOffset * innerOffset.zw) * vertex_texCoord0.xy;\n\n\t\tvTiledUv = (localPos.xz - outerScale + innerOffset.xy) * -0.5 + 1.0; // uv = local pos - inner corner\n\n\t\tlocalPos.xz *= -0.5; // move from -1;1 to -0.5;0.5\n\t\tlocalPos = localPos.xzy;\n\t\t#endif\n\n\t\t#ifdef MORPHING\n\t\t#ifdef MORPHING_POS03\n\t\tlocalPos.xyz += morph_weights_a[0] * morph_pos0;\n\t\tlocalPos.xyz += morph_weights_a[1] * morph_pos1;\n\t\tlocalPos.xyz += morph_weights_a[2] * morph_pos2;\n\t\tlocalPos.xyz += morph_weights_a[3] * morph_pos3;\n\t\t#endif // MORPHING_POS03\n\t\t#ifdef MORPHING_POS47\n\t\tlocalPos.xyz += morph_weights_b[0] * morph_pos4;\n\t\tlocalPos.xyz += morph_weights_b[1] * morph_pos5;\n\t\tlocalPos.xyz += morph_weights_b[2] * morph_pos6;\n\t\tlocalPos.xyz += morph_weights_b[3] * morph_pos7;\n\t\t#endif // MORPHING_POS47\n\t\t#endif // MORPHING\n\n\t\t#ifdef MORPHING_TEXTURE_BASED_POSITION\n\t\t// apply morph offset from texture\n\t\tvec2 morphUV = getTextureMorphCoords();\n\t\tvec3 morphPos = texture2D(morphPositionTex, morphUV).xyz;\n\t\tlocalPos += morphPos;\n\t\t#endif\n\n\t\tvec4 posW = dModelMatrix * vec4(localPos, 1.0);\n\t\t#ifdef SCREENSPACE\n\t\tposW.zw = vec2(0.0, 1.0);\n\t\t#endif\n\t\tdPositionW = posW.xyz;\n\n\t\tvec4 screenPos;\n\t\t#ifdef UV1LAYOUT\n\t\tscreenPos = vec4(vertex_texCoord1.xy * 2.0 - 1.0, 0.5, 1);\n\t\t#else\n\t\t#ifdef SCREENSPACE\n\t\tscreenPos = posW;\n\t\tscreenPos.y *= projectionFlipY;\n\t\t#else\n\t\tscreenPos = matrix_viewProjection * posW;\n\t\t#endif\n\n\t\t#ifdef PIXELSNAP\n\t\t// snap vertex to a pixel boundary\n\t\tscreenPos.xy = (screenPos.xy * 0.5) + 0.5;\n\t\tscreenPos.xy *= uScreenSize.xy;\n\t\tscreenPos.xy = floor(screenPos.xy);\n\t\tscreenPos.xy *= uScreenSize.zw;\n\t\tscreenPos.xy = (screenPos.xy * 2.0) - 1.0;\n\t\t#endif\n\t\t#endif\n\n\t\treturn screenPos;\n}\n\nvec3 getWorldPosition() {\n\t\treturn dPositionW;\n}\n",transformDeclVS:"\nattribute vec3 vertex_position;\n\nuniform mat4 matrix_model;\nuniform mat4 matrix_viewProjection;\n\nvec3 dPositionW;\nmat4 dModelMatrix;\n",uv0VS:"\n#ifdef NINESLICED\nvec2 getUv0() {\n\t\tvec2 uv = vertex_position.xz;\n\n\t\t// offset inner vertices inside\n\t\t// (original vertices must be in [-1;1] range)\n\t\tvec2 positiveUnitOffset = clamp(vertex_position.xz, vec2(0.0), vec2(1.0));\n\t\tvec2 negativeUnitOffset = clamp(-vertex_position.xz, vec2(0.0), vec2(1.0));\n\t\tuv += (-positiveUnitOffset * innerOffset.xy + negativeUnitOffset * innerOffset.zw) * vertex_texCoord0.xy;\n\n\t\tuv = uv * -0.5 + 0.5;\n\t\tuv = uv * atlasRect.zw + atlasRect.xy;\n\n\t\tvMask = vertex_texCoord0.xy;\n\n\t\treturn uv;\n}\n#else\nvec2 getUv0() {\n\t\treturn vertex_texCoord0;\n}\n#endif\n",uv1VS:"\nvec2 getUv1() {\n\t\treturn vertex_texCoord1;\n}\n",viewDirPS:"\nvoid getViewDir() {\n\t\tdViewDirW = normalize(view_position - vPositionW);\n}\n",viewNormalVS:"\n#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\n\nvec3 getViewNormal() {\n\t\treturn mat3(matrix_view) * vNormalW;\n}\n"};function di(t,e){return e||(e=ui),1===t||2===t?e.gamma2_2PS?e.gamma2_2PS:ui.gamma2_2PS:3===t?"#define HDR\n"+(e.gamma2_2PS?e.gamma2_2PS:ui.gamma2_2PS):e.gamma1_0PS?e.gamma1_0PS:ui.gamma1_0PS}function fi(t,e){return e||(e=ui),1===t?e.tonemappingFilmicPS?e.tonemappingFilmicPS:ui.tonemappingFilmicPS:0===t?e.tonemappingLinearPS?e.tonemappingLinearPS:ui.tonemappingLinearPS:2===t?e.tonemappingHejlPS?e.tonemappingHejlPS:ui.tonemappingHejlPS:3===t?e.tonemappingAcesPS?e.tonemappingAcesPS:ui.tonemappingAcesPS:4===t?e.tonemappingAces2PS?e.tonemappingAces2PS:ui.tonemappingAces2PS:e.tonemapingNonePS?e.tonemapingNonePS:ui.tonemappingNonePS}function pi(t,e){return e||(e=ui),"linear"===t?e.fogLinearPS?e.fogLinearPS:ui.fogLinearPS:"exp"===t?e.fogExpPS?e.fogExpPS:ui.fogExpPS:"exp2"===t?e.fogExp2PS?e.fogExp2PS:ui.fogExp2PS:e.fogNonePS?e.fogNonePS:ui.fogNonePS}function mi(t,e){return e||(e=ui),t.supportsBoneTextures?e.skinTexVS:"#define BONE_LIMIT "+t.getBoneLimit()+"\n"+e.skinConstVS}function _i(t){var e="precision "+t.precision+" float;\n";return t.webgl2&&(e+="#ifdef GL2\nprecision "+t.precision+" sampler2DShadow;\n#endif\n"),e}function gi(t){return t.webgl2?"#version 300 es\n":""}function vi(){return"void main(void) {gl_FragColor = vec4(0.0);}"}function yi(){return"void main(void)\n{\n"}function xi(){return"}\n"}var bi={vertex_position:ce,vertex_normal:ue,vertex_tangent:de,vertex_texCoord0:ge,vertex_texCoord1:ve,vertex_texCoord2:ye,vertex_texCoord3:xe,vertex_texCoord4:be,vertex_texCoord5:Se,vertex_texCoord6:we,vertex_texCoord7:Te,vertex_color:me,vertex_boneIndices:pe,vertex_boneWeights:fe};function Si(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.substring(a+1,s),o=bi[r];void 0!==o?e[r]=o:(e[r]="ATTR"+i,i++),n=t.indexOf("attribute",n+1)}return e}function wi(t,e,i,n){void 0===n&&(n=!1);var s=ui[e],a=_i(t)+"\n"+ui[i],r=Si(s);return t.webgl2&&(s=gi(t)+ui.gles3VS+s,a=gi(t)+ui.gles3PS+a),new ci(t,{attributes:r,vshader:s,fshader:a,useTransformFeedback:n})}function Ti(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=_i(t)+"\n"+(i||"void main(void) {gl_FragColor = vec4(0.0);}");var h=Si(e);return t.webgl2&&(e=gi(t)+ui.gles3VS+e,i=gi(t)+ui.gles3PS+i),r[n]=new ci(t,{attributes:h,vshader:e,fshader:a+i,useTransformFeedback:s}),r[n]}ui.collectAttribs=Si,ui.createShader=wi,ui.createShaderFromCode=Ti;var Ai=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}(),Mi=0,Ci=function(){function t(){Mi++,this.version=new Ai,this.version.globalId=Mi}return t.prototype.increment=function(){this.version.revision++},t}(),Ei=function(){function t(t){this.name=t,this.value=null,this.versionObject=new Ci}var e=t.prototype;return e.setValue=function(t){this.value=t,this.versionObject.increment()},e.getValue=function(){return this.value},t}(),Pi=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 Ei(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}(),Ri={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:ce};e.skin&&(i.vertex_boneWeights=fe,i.vertex_boneIndices=pe),e.vertexColors&&(i.vertex_color=me),e.diffuseMap&&(i.vertex_texCoord0=ge);var n="";n+=ui.transformDeclVS,e.skin?(n+=mi(t),n+=ui.transformSkinnedVS):n+=ui.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=_i(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+=pi(e.fog)),e.alphatest&&(n+=ui.alphaTestPS),2===e.pass&&(n+="varying float vDepth;\n",n+=ui.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"}}},Ii={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?ui.particleAnimFrameLoopVS:ui.particleAnimFrameClampVS,e+=ui.particleAnimTexVS},createShaderDefinition:function(t,e){var i="",n=_i(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?ui.particle_customFaceVS:ui.particle_billboardVS;return e.useCpu?(e.soft>0&&(i+=ui.screenDepthPS),i+=ui.particle_cpuVS,e.localSpace&&(i+=ui.particle_localShiftVS),e.animTex&&(i+=this._animTex(e)),e.alignToMotion&&(i+=ui.particle_pointAlongVS),i+=e.mesh?ui.particle_meshVS:s,1===e.normal&&(i+=ui.particle_normalVS),2===e.normal&&(i+=ui.particle_TBNVS),e.stretch>0&&(i+=ui.particle_stretchVS),i+=ui.particle_cpu_endVS,e.soft>0&&(i+=ui.particle_softVS)):(i+=ui.particle_initVS,i+=e.pack8?ui.particleInputRgba8PS:ui.particleInputFloatPS,e.soft>0&&(i+=ui.screenDepthPS),i+=ui.particleVS,e.localSpace&&(i+=ui.particle_localShiftVS),e.animTex&&(i+=this._animTex(e)),e.wrap&&(i+=ui.particle_wrapVS),e.alignToMotion&&(i+=ui.particle_pointAlongVS),i+=e.mesh?ui.particle_meshVS:s,1===e.normal&&(i+=ui.particle_normalVS),2===e.normal&&(i+=ui.particle_TBNVS),e.stretch>0&&(i+=ui.particle_stretchVS),i+=ui.particle_endVS,e.soft>0&&(i+=ui.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+=di(e.gamma),n+=fi(e.toneMap),"linear"===e.fog?n+=ui.fogLinearPS:"exp"===e.fog?n+=ui.fogExpPS:"exp2"===e.fog?n+=ui.fogExp2PS:n+=ui.fogNonePS,2===e.normal&&(n+="\nuniform sampler2D normalMap;\n"),e.soft>0&&(n+=ui.screenDepthPS),n+=ui.particlePS,e.soft>0&&(n+=ui.particle_softPS),1===e.normal&&(n+="\nvec3 normal = Normal;\n"),2===e.normal&&(n+=ui.particle_normalMapPS),e.normal>0&&(n+=e.halflambert?ui.particle_halflambertPS:ui.particle_lambertPS),e.normal>0&&(n+=ui.particle_lightingPS),2===e.blend?n+=ui.particle_blendNormalPS:1===e.blend?n+=ui.particle_blendAddPS:5===e.blend&&(n+=ui.particle_blendMultiplyPS),n+=ui.particle_endPS,{attributes:Si(i),vshader:i,fshader:n}}},Li={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=_i(t),i+=e.mip?ui.fixCubemapSeamsStretchPS:ui.fixCubemapSeamsNonePS,i+=e.useIntensity?ui.envMultiplyPS:ui.envConstPS,i+=di(e.gamma),i+=fi(e.toneMapping),i+=ui.decodePS,i+=ui.rgbmPS,i+=ui.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=_i(t),i+=e.useIntensity?ui.envMultiplyPS:ui.envConstPS,i+=di(e.gamma),i+=fi(e.toneMapping),i+=ui.decodePS,i+=ui.skyboxEnvPS.replace(/\$DECODE/g,{rgbm:"decodeRGBM",rgbe:"decodeRGBE",linear:"decodeLinear"}[e.encoding]||"decodeGamma")}return{attributes:{aPosition:ce},vshader:ui.skyboxVS,fshader:i}}},Di=1/255,ki=new Float32Array(1),Oi=new Int32Array(ki.buffer),Fi=function(){function t(){}return t.float2Half=function(t){ki[0]=t;var e=Oi[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-Di*s)),n>1){var a=65025*t%1;if(e[i+1]=Math.round(255*(s-Di*a)),n>2){var r=16581375*t%1;e[i+2]=Math.round(255*(a-Di*r)),n>3&&(e[i+3]=Math.round(255*r))}}},t.float2BytesRange=function(e,i,n,s,a,r){e=ot.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}(),Bi=null,Ni=null,Ui=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=Ge,this.projection=qe,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:Ge:e.hasOwnProperty("swizzleGGGR")&&(this.type=e.swizzleGGGR?Xe:Ge),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=Ye:e.projection&&e.projection!==Ye&&(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===te||this._format>=oe,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){Bi||((Bi=[])[0]=1,Bi[1]=1,Bi[2]=2,Bi[3]=2,Bi[4]=2,Bi[5]=2,Bi[6]=4,Bi[7]=4,Bi[11]=8,Bi[12]=8,Bi[13]=16,Bi[14]=16,Bi[15]=4,Bi[16]=4,Bi[17]=4,Bi[18]=4,Bi[19]=4,Bi[20]=4),Ni||((Ni=[])[21]=8,Ni[22]=8,Ni[24]=8,Ni[25]=8,Ni[26]=8,Ni[27]=8,Ni[8]=8,Ni[29]=8,Ni[23]=16,Ni[9]=16,Ni[10]=16,Ni[28]=16,Ni[30]=16);for(var r=Bi.hasOwnProperty(n)?Bi[n]:0,o=Ni.hasOwnProperty(n)?Ni[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!==he&&n!==le||(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 te:this._levels[t.level]=new Uint8Array(Math.floor((this._width+3)/4)*Math.floor((this._height+3)/4)*16*this._depth);break;case ee:this._levels[t.level]=new Uint16Array(this._width*this._height*this._depth*3);break;case ne:this._levels[t.level]=new Float32Array(this._width*this._height*this._depth*3);break;case ie:this._levels[t.level]=new Uint16Array(this._width*this._height*this._depth*4);break;case se: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 pt?this.localPosition.copy(t):this.localPosition.set(t,e,i),this._dirtyLocal||this._dirtifyLocal()},i.setLocalRotation=function(t,e,i,n){t instanceof Tt?this.localRotation.copy(t):this.localRotation.set(t,e,i,n),this._dirtyLocal||this._dirtifyLocal()},i.setLocalScale=function(t,e,i){t instanceof pt?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 Ui(t,{name:s,width:e,height:i,mipmaps:!1,format:n,addressU:1,addressV:1,type:Ge,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(pn,dn),fn[0]=dn.x,fn[1]=dn.y,fn[2]=dn.z,e.transformVector(mn,dn),fn[3]=dn.x,fn[4]=dn.y,fn[5]=dn.z,fn},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;Fi.float2Bytes(r[0]*a,t,e+0,2),Fi.float2Bytes(r[1]*a,t,e+2,2),Fi.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){Fi.float2Bytes(.499999*i._innerConeAngleCos+.5,t,e+0,2),Fi.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);Fi.float2BytesRange(s.bias,t,e,-1,20,2),Fi.float2Bytes(s.normalBias,t,e+2,2)},e.addLightDataPositionRange=function(t,e,i,n){var s=dn.sub2(n,this.boundsMin).div(this.boundsDelta);Fi.float2Bytes(s.x,t,e+0,4),Fi.float2Bytes(s.y,t,e+4,4),Fi.float2Bytes(s.z,t,e+8,4),Fi.float2Bytes(i.attenuationEnd*this.invMaxAttenuation,t,e+12,4)},e.addLightDataSpotDirection=function(t,e,i){this.getSpotDirection(dn,i),Fi.float2Bytes(.499999*dn.x+.5,t,e+0,4),Fi.float2Bytes(.499999*dn.y+.5,t,e+4,4),Fi.float2Bytes(.499999*dn.z+.5,t,e+8,4)},e.addLightDataLightProjMatrix=function(t,e,i){for(var n=i.data,s=0;s<12;s++)Fi.float2BytesRange(n[s],t,e+4*s,-2,2,4);for(var a=12;a<16;a++)Fi.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){Fi.float2Bytes(i.x,t,e+0,2),Fi.float2Bytes(i.y,t,e+2,2),Fi.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++)Fi.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=un.evalSpotCookieMatrix(e)):(h||r)&&(u=e.atlasViewport);var d=this.lights8,f=i*this.lightsTexture8.width*4;if(this.addLightDataFlags(d,f+4*_n.FLAGS,e,s,h),this.addLightDataColor(d,f+4*_n.COLOR_A,e,n,r),s&&this.addLightDataSpotAngles(d,f+4*_n.SPOT_ANGLES,e),e.castShadows&&this.addLightDataShadowBias(d,f+4*_n.SHADOW_BIAS,e),r&&this.addLightDataCookies(d,f+4*_n.COOKIE_A,e),t.lightTextureFormat===t.FORMAT_FLOAT){var p=this.lightsFloat,m=i*this.lightsTextureFloat.width*4;if(p[m+4*gn.POSITION_RANGE+0]=l.x,p[m+4*gn.POSITION_RANGE+1]=l.y,p[m+4*gn.POSITION_RANGE+2]=l.z,p[m+4*gn.POSITION_RANGE+3]=e.attenuationEnd,s&&(this.getSpotDirection(dn,e),p[m+4*gn.SPOT_DIRECTION+0]=dn.x,p[m+4*gn.SPOT_DIRECTION+1]=dn.y,p[m+4*gn.SPOT_DIRECTION+2]=dn.z),c)for(var _=c.data,g=0;g<16;g++)p[m+4*gn.PROJ_MAT_0+g]=_[g];if(u&&(p[m+4*gn.ATLAS_VIEWPORT+0]=u.x,p[m+4*gn.ATLAS_VIEWPORT+1]=u.y,p[m+4*gn.ATLAS_VIEWPORT+2]=u.z/3),o){var v=this.getLightAreaSizes(e);p[m+4*gn.AREA_DATA_WIDTH+0]=v[0],p[m+4*gn.AREA_DATA_WIDTH+1]=v[1],p[m+4*gn.AREA_DATA_WIDTH+2]=v[2],p[m+4*gn.AREA_DATA_HEIGHT+0]=v[3],p[m+4*gn.AREA_DATA_HEIGHT+1]=v[4],p[m+4*gn.AREA_DATA_HEIGHT+2]=v[5]}}else this.addLightDataPositionRange(d,f+4*_n.POSITION_X,e,l),s&&this.addLightDataSpotDirection(d,f+4*_n.SPOT_DIRECTION_X,e),c&&this.addLightDataLightProjMatrix(d,f+4*_n.PROJ_MAT_00,c),u&&this.addLightAtlasViewport(d,f+4*_n.ATLAS_VIEWPORT_A,u),o&&this.addLightAreaSizes(d,f+4*_n.AREA_DATA_WIDTH_X,e)},t}();vn.FORMAT_FLOAT=0,vn.FORMAT_8BIT=1,vn.lightTextureFormat=vn.FORMAT_8BIT,vn.shaderDefines="";var yn=[],xn={rgbm:"decodeRGBM",rgbe:"decodeRGBE",linear:"decodeLinear"},bn={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(yn[t]e.length){for(var i=e,n=i.charAt(i.length-1),s=yn[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 xn[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=ui,d={vertex_position:ce};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=ue),o.indexOf("vertex_tangent")>=0&&(d.vertex_tangent=de),o.indexOf("vertex_texCoord0")>=0&&(d.vertex_texCoord0=ge),o.indexOf("vertex_texCoord1")>=0&&(d.vertex_texCoord1=ve),o.indexOf("vertex_color")>=0&&(d.vertex_color=me),o.indexOf("vertex_boneWeights")>=0&&(d.vertex_boneWeights=fe),o.indexOf("vertex_boneIndices")>=0&&(d.vertex_boneIndices=pe),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=Ne,d.instance_line2=Ue,d.instance_line3=ze,d.instance_line4=Ve,h+=u.instancingVS),a&&(d.vertex_normal=ue,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=de,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 yn){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 yn){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=me,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=Ve,h+="attribute float morph_vertex_id;\n"):(h+="#define MORPHING\n",e.useMorphPosition?(d.morph_pos0=ke,d.morph_pos1=Oe,d.morph_pos2=Fe,d.morph_pos3=Be,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=ke,d.morph_nrm1=Oe,d.morph_nrm2=Fe,d.morph_nrm3=Be,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=Ne,d.morph_nrm5=Ue,d.morph_nrm6=ze,d.morph_nrm7=Ve,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=Ne,d.morph_pos5=Ue,d.morph_pos6=ze,d.morph_pos7=Ve,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=fe,d.vertex_boneIndices=pe,h+=mi(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=gi(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+=gi(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":_i(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 Y=e.useMetalness?"metalness":"specular";h+=this._addMap(Y,Y+"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 j=this._getUvSourceExpression("heightMapTransform","heightMapUv",e);e.hasTangents||(k=k.replace(/\$UV/g,j)),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_"+Ft[e.clusteredLightingShadowType]),e.clusteredLightingAreaLightsEnabled&&(h+="\n#define CLUSTER_AREALIGHTS"),h+=vn.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}}},Sn={begin:yi,dummyFragmentCode:vi,end:xi,fogCode:pi,gammaCode:di,precisionCode:_i,skinCode:mi,tonemapCode:fi,versionCode:gi,basic:Ri,particle:Ii,skybox:Li,standard:bn},wn=2.399963229728653,Tn=function(t,e,i){var n=e*wn,s=Math.sqrt(e)/Math.sqrt(i);t.x=s*Math.cos(n),t.y=s*Math.sin(n)},An=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=ot.lerp(n,s,e/i),r=Math.sqrt(1-a*a),o=wn*e;t.x=Math.cos(o)*r,t.y=a,t.z=Math.sin(o)*r},Mn=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)},Cn=function(t){switch(t.type){case We:return"RGBM";case He:return"RGBE";default:switch(t.format){case ee:case ne:case ie:case se:return"Linear";default:return"Gamma"}}},En=function(t){switch(t){case Ye:return"Cubemap";case Ke:return"Octahedral";default:return"Equirect"}},Pn=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))}},Rn=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()},In=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()},Ln=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()},Dn=function(t,e){var i=t*e,n=e/(1-t*t+i*i);return n*n*(1/Math.PI)},kn={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}},On=function(t,e,i){for(var n=i/t,s=1-Math.log2(e)/11,a=s*s,r=new pt,o=new pt,h=new pt(0,0,1),l=[],c=function(t,e){var i=kn[t];return i&&i[e]||t}(t,e),u=0;u0){var f=Dn(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},Fn=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),Xn(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 Ui(o,{name:"envPrefilteredAtlas",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 gt(0,0,512*l,256*l),u=qn(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&Nt),t.skin=n&&0!=(2&n),t.useInstancing=n&&0!=(32&n),t.useMorphPosition=n&&0!=(n&Ut),t.useMorphNormal=n&&0!=(n&zt),t.useMorphTextureBased=n&&0!=(n&Vt),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=[],yn)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===te||e.normalMap.type===Xe);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===se?2:0:null,t.lightMapFormat=e.lightMap?e.lightMap.type===We?1:e.lightMap.format===se?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(Tt.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&Bt)&&(t.dirLightMap=!0),0!=(i&Gt)&&(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)&&(!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")),yn)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(Tt.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?bn.optionsContextMin:bn.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}($n);ls.TEXTURE_PARAMETERS=is,ls.CUBEMAP_PARAMETERS=ss;var cs=function(t,e){os[t]=e},us=function(t,e,i,n){Object.defineProperty(ls.prototype,t,{get:n||function(){return this["_"+t]},set:i}),rs[t]={value:e}},ds=function(t){return t.defaultValue&&t.defaultValue.clone?function(t){var e="_"+t.name,i=t.dirtyShaderFunc||function(){return!0};us(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};us(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 fs(t,e,i,n,s,a){yn[t]=i,ds({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)}}),ds({name:t+"MapTiling",defaultValue:new _t(1,1)}),ds({name:t+"MapOffset",defaultValue:new _t(0,0)}),ds({name:t+"MapRotation",defaultValue:0}),ds({name:t+"MapUv",defaultValue:e}),i>0&&ds({name:t+"MapChannel",defaultValue:n||(i>1?"rgb":"g")}),s&&(ds({name:t+"VertexColor",defaultValue:!1}),i>0&&ds({name:t+"VertexColorChannel",defaultValue:n||(i>1?"rgb":"g")})),a&&ds({name:t+"Mode",defaultValue:"mul"});var r=t+"MapTiling",o=t+"MapOffset",h=t+"MapRotation",l=t+"MapTransform";cs(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*ot.DEG_TO_RAD),d=Math.sin(a*ot.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 ps(t,e){ds({name:t,defaultValue:e,getterFunc:function(){return this._dirtyShader=!0,this["_"+t]}}),cs(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 ms(t,e,i){ds({name:t,defaultValue:e,dirtyShaderFunc:function(t,e){return(0===t||1===t)!=(0===e||1===e)}}),cs(t,i)}function _s(t,e){ds({name:t,defaultValue:null,dirtyShaderFunc:function(t,e){return!!t==!!e}}),cs(t,e)}function gs(t,e){ds({name:t,defaultValue:e})}!function(){ps("ambient",new ct(.7,.7,.7)),ps("diffuse",new ct(1,1,1)),ps("specular",new ct(0,0,0)),ps("emissive",new ct(0,0,0)),ms("emissiveIntensity",1),ms("shininess",25,(function(t,e,i){return 0===t.shadingModel?Math.pow(2,.01*t.shininess*11):.01*t.shininess})),ms("heightMapFactor",1,(function(t,e,i){return.025*t.heightMapFactor})),ms("opacity",1),ms("alphaFade",1),ms("alphaTest",0),ms("bumpiness",1),ms("normalDetailMapBumpiness",1),ms("reflectivity",1),ms("occludeSpecularIntensity",1),ms("refraction",0),ms("refractionIndex",1/1.5),ms("metalness",1),ms("anisotropy",0),ms("clearCoat",0),ms("clearCoatGlossiness",1),ms("clearCoatBumpiness",1),ms("aoUvSet",0,null),_s("ambientSH"),_s("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})),gs("ambientTint",!1),gs("diffuseTint",!1),gs("specularTint",!1),gs("emissiveTint",!1),gs("fastTbn",!1),gs("specularAntialias",!1),gs("useMetalness",!1),gs("enableGGXSpecular",!1),gs("occludeDirect",!1),gs("normalizeNormalMap",!0),gs("conserveEnergy",!0),gs("opacityFadesSpecular",!0),gs("occludeSpecular",1),gs("shadingModel",1),gs("fresnelModel",2),gs("cubeMapProjection",0),gs("customFragmentShader",null),gs("forceFragmentPrecision",null),gs("useFog",!0),gs("useLighting",!0),gs("useGammaTonemap",!0),gs("useSkybox",!0),gs("forceUv1",!1),gs("pixelSnap",!1),gs("twoSidedLighting",!1),gs("nineSlicedMode",void 0),fs("diffuse",0,3,"",!0),fs("specular",0,3,"",!0),fs("emissive",0,3,"",!0),fs("normal",0,-1,"",!1),fs("metalness",0,1,"",!0),fs("gloss",0,1,"",!0),fs("opacity",0,1,"a",!0),fs("height",0,1,"",!1),fs("ao",0,1,"",!0),fs("light",1,3,"",!0),fs("msdf",0,3,"",!1),fs("diffuseDetail",0,3,"",!1,!0),fs("normalDetail",0,-1,"",!1),fs("clearCoat",0,1,"",!0),fs("clearCoatGloss",0,1,"",!0),fs("clearCoatNormal",0,-1,"",!1),_s("cubeMap"),_s("sphereMap"),_s("envAtlas");var t=[null,null,null,null,null,null];us("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=Yn.generatePrefilteredAtlas(e,{target:this.envAtlas}):this.envAtlas&&(this.envAtlas.destroy(),this.envAtlas=null),this._dirtyShader=!0)}),(function(){return this._prefilteredCubemaps}))}();var vs=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 ls;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 ci(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;h<=|&+-]/g,ia=function(){function t(){}return t.run=function(t){return t=(t=t.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm,"$1")).split(/\r?\n/).map((function(t){return t.trimEnd()})).join("\n"),null!==(t=this._preprocess(t))&&(t=(t=t.split(/\r?\n/).map((function(t){return""===t.trim()?"":t})).join("\n")).replace(/(\n\n){3,}/gm,"\n\n")),t},t._preprocess=function(e){for(var i,n=e,s=[],a=!1,r=new Map;null!==(i=js.exec(e));){var o=i[1];switch(o){case"define":Ks.lastIndex=i.index;var h=Ks.exec(e);a||(a=null===h);var l=h[1];Js.lastIndex=h.index;var c=Js.exec(l)[1],u=l.substring(c.length).trim();""===u&&(u="true"),t._keep(s)&&r.set(c,u),js.lastIndex=h.index+h[0].length;break;case"undef":Zs.lastIndex=i.index;var d=Zs.exec(e),f=d[1].trim();t._keep(s)&&r.delete(f),js.lastIndex=d.index+d[0].length;break;case"ifdef":case"ifndef":case"if":$s.lastIndex=i.index;var p=$s.exec(e),m=p[2],_=t.evaluate(m,r);a||(a=_.error);var g=_.result;"ifndef"===o&&(g=!g),s.push({anyKeep:g,keep:g,start:i.index,end:$s.lastIndex}),js.lastIndex=p.index+p[0].length;break;case"endif":case"else":case"elif":Qs.lastIndex=i.index;var v=Qs.exec(e),y=s.pop(),x=y.keep?e.substring(y.end,i.index):"";e=e.substring(0,y.start)+x+e.substring(Qs.lastIndex),js.lastIndex=y.start+x.length;var b=v[1];if("else"===b||"elif"===b){var S=!1;if(!y.anyKeep)if("else"===b)S=!y.keep;else{var w=t.evaluate(v[2],r);S=w.result,a||(a=w.error)}s.push({anyKeep:y.anyKeep||S,keep:S,start:js.lastIndex,end:js.lastIndex})}}}return a?(console.warn("Failed to preprocess shader: ",{source:n}),n):e},t._keep=function(t){for(var e=0;ee||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 ra=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=aa(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=aa(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}(),oa=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)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");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 ha(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 la,ca=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.defaultFramebufferAlpha=i.alpha,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=ha(r,r.FLOAT):n.textureFloatRenderable=!1,n.extColorBufferHalfFloat?n.textureHalfFloatRenderable=!!n.extColorBufferHalfFloat:n.extTextureHalfFloat?n.webgl2?n.textureHalfFloatRenderable=!!n.extColorBufferFloat:n.textureHalfFloatRenderable=ha(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.areaLightLutFormat=7,n.extTextureHalfFloat&&n.textureHalfFloatUpdatable&&n.extTextureHalfFloatLinear?n.areaLightLutFormat=ie:n.extTextureFloat&&n.extTextureFloatLinear&&(n.areaLightLutFormat=se),n}j(e,t);var i=e.prototype;return i.destroy=function(){t.prototype.destroy.call(this);var e=this.gl;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 qs},i.createIndexBufferImpl=function(t){return new Ys(t)},i.createShaderImpl=function(t){return new sa(t)},i.createTextureImpl=function(){return new ra},i.createRenderTargetImpl=function(t){return new oa},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?(this.activeTexture(e),this.bindTexture(t),t._parameterFlags&&(this.setTextureParameters(t),t._parameterFlags=0),(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?ie:this.textureFloatRenderable?se: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=Ti(t,ui.fullscreenQuadVS,ui.precisionTestPS,"ptest1"),i=Ti(t,ui.fullscreenQuadVS,ui.precisionTest2PS,"ptest2"),n={format:se,width:1,height:1,mipmaps:!1,minFilter:0,magFilter:0,name:"testFHP"},s=new Ui(t,n),a=new Ss({colorBuffer:s,depth:!1});li(t,a,e),n.format=7;var r=new Ui(t,n),o=new Ss({colorBuffer:r,depth:!1});t.constantTexSource.setValue(s),li(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}(xs),ua=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 da(){return la}function fa(t){la=t}var pa=0,ma=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}();ma.DEFAULT_COMPONENTS_POSITION=3,ma.DEFAULT_COMPONENTS_NORMAL=3,ma.DEFAULT_COMPONENTS_UV=2,ma.DEFAULT_COMPONENTS_COLORS=4;var _a=function(t,e,i,n){this.data=t,this.componentCount=e,this.dataType=i,this.dataTypeNormalize=n},ga=function(t){function e(e){var i;return(i=t.call(this)||this).id=pa++,i.device=e||da().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 Rt,i.boneAabb=null,i}j(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 _a(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 Us(this.vertexBuffer).readData(t,e));return i},i.setPositions=function(t,e,i){void 0===e&&(e=ma.DEFAULT_COMPONENTS_POSITION),this.setVertexStream(ce,t,e,i,6,!1)},i.setNormals=function(t,e,i){void 0===e&&(e=ma.DEFAULT_COMPONENTS_NORMAL),this.setVertexStream(ue,t,e,i,6,!1)},i.setUvs=function(t,e,i,n){void 0===i&&(i=ma.DEFAULT_COMPONENTS_UV),this.setVertexStream(_e+t,e,i,n,6,!1)},i.setColors=function(t,e,i){void 0===e&&(e=ma.DEFAULT_COMPONENTS_COLORS),this.setVertexStream(me,t,e,i,6,!1)},i.setColors32=function(t,e){this.setVertexStream(me,t,ma.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(ce,t)},i.getNormals=function(t){return this.getVertexStream(ue,t)},i.getUvs=function(t,e){return this.getVertexStream(_e+t,e)},i.getColors=function(t){return this.getVertexStream(me,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 ai(this.device,e,t)},i._updateVertexBuffer=function(){if(!this.vertexBuffer){var t=this._geometryData.maxVertices,e=this._buildVertexFormat(t);this.vertexBuffer=new ni(this.device,e,t,this._geometryData.verticesUsage)}var i=new Us(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 As(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 Je[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 As(this.vertexBuffer.device,t,e.length);new Je[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}(ua),va=4/64,ya=.875,xa=[];function ba(t,e){for(var i=e.length/3,n=t.length/3,s=new pt,a=new pt,r=new pt,o=new pt,h=new pt,l=new pt,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)*ya+va,T=T*ya+va,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 Ma(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=Aa(i,i,n,s,a,!1);return r&&(o.tangents=Sa(o.positions,o.normals,o.uvs,o.indices)),wa(t,o.positions,o)}function Ca(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=Aa(i,i,n-2*i,s,a,!0);return r&&(o.tangents=Sa(o.positions,o.normals,o.uvs,o.indices)),wa(t,o.positions,o)}function Ea(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=Aa(i,n,s,a,r,!1);return o&&(h.tangents=Sa(h.positions,h.normals,h.uvs,h.indices)),wa(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(Fa,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 ja(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 nr=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 Oa(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=ir(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===ir(E))if(Za(y,E.parameters)){var P=E._staticLightList;if(b&&P){if(!$a(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===ce)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 Ya(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=vr.z/3,h=this.lightTextureAtlas.cubeSlotsOffsets[r];vr.x+=o*h.x,vr.y+=o*h.y,vr.z=o,vr.w=o,this.invViewProjId.setValue(t._invViewProjMatrices[r].data)}vr.mulScalar(i.colorBuffer.width),li(a,i,s,vr)}}},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}();yr._invViewProjMatrices=null;var xr=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 Pr.min=n,Pr.max=s,Pr}function Ir(t,e){return Math.exp(-t*t/(2*e*e))}var Lr=new Rt,Dr=new wt,kr=new wt,Or=new Float32Array(2),Fr=new gt(1,1,0,0),Br={r:1,g:2,b:3,a:4},Nr=new pt,Ur=new wt;function zr(t){var e=t.material,i=t.skinInstance?10:0,n=0;if(e.opacityMap){var s=e.opacityMapChannel;s&&(n=Br[s])}return i+n}var Vr=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=[ui.blurVSMPS,"#define GAUSS\n"+ui.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=un.create("ShadowCamera",i,n);return s.clearColor=e>=1&&e<=3?new ct(0,0,0,0):new ct(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(Nr.dot(v)*x)/x,S=Math.ceil(Nr.dot(g)*x)/x,w=v.mulScalar(b),T=g.mulScalar(S),A=Nr.dot(y),M=y.mulScalar(A);Nr.add2(w,T).add(M),o.setPosition(Nr),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 Y=6*O;p[Y]=F,p[Y+1]=B,p[Y+2]=N,p[Y+3]=U,p[Y+4]=z,p[Y+5]=V}for(var j=0;j=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>ft&&(ft=yt),xt>mt&&(mt=xt)}h.set(lt,ct,ut),l.set(dt,ft,mt);var bt=new Rt;bt.setMinMax(h,l);var St=new ga(e);St.vertexBuffer=w,St.indexBuffer[0]=ht,St.primitive[0].type=4,St.primitive[0].base=0,St.primitive[0].count=ot.length,St.primitive[0].indexed=!0,St.aabb=bt;var Tt=new Ya(St,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(qr.vertexBuffer),t.draw(i.primitive[n],qr.count)):(Yr=e.node.worldTransform,this.modelMatrixId.setValue(Yr.data),s&&(jr=e.node.normalMatrix,e.node._dirtyNormal&&(Yr.invertTo3x3(jr),jr.transpose(),e.node._dirtyNormal=!1),this.normalMatrixId.setValue(jr.data)),t.draw(i.primitive[n]))},e.drawInstance2=function(t,e,i,n){(qr=e.instancingData)?qr.count>0&&(this._instancedDrawCalls++,t.draw(i.primitive[n],qr.count,!0)):t.draw(i.primitive[n],void 0,!0)},e.renderShadows=function(t,e){for(var i=this.scene.clusteredLightingEnabled,n=0;n0&&n.cull<3){i.flipFaces&&(a*=-1),e&&(a*=-1);var r=i.node.worldTransform;r.getX(lo),r.getY(co),r.getZ(uo),lo.cross(lo,co),lo.dot(uo)<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(lo),o.getY(co),o.getZ(uo),lo.cross(lo,co),lo.dot(uo)<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;i=0&&r._shaderVersion!==i&&(r.updateShader!==$n.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(xo);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)}}},q(t,[{key:"hasDirectionalShadowLights",get:function(){return this.directionalLights.length>0}}]),t}(),Po=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&&Co(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|Bo[this._cookieChannel.charAt(0)]<<18|(this._cookieTransform?1:0)<<12|this._shape<<10|this.numCascades-1<<8;3===this._cookieChannel.length&&(t|=Bo[this._cookieChannel.charAt(1)]<<16,t|=Bo[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=No[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 wt),this._cookieMatrix}},{key:"atlasViewport",get:function(){return this._atlasViewport||(this._atlasViewport=new gt(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;Tn(Xo,t,e),Xo.mulScalar(.5*n),i._node.rotateLocal(Xo.x,0,Xo.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}(Ho),Yo=function(){function t(t){this.renderPasses=[],this.device=t}var e=t.prototype;return e.add=function(t){this.renderPasses.push(t)},e.reset=function(){this.renderPasses.length=0},e.render=function(){for(var t=this.renderPasses,e=0;ef)return!1;this.morphTextureWidth=p,this.morphTextureHeight=m;var _=!1,g=3,v=Fi.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 Ya(this.mesh,this.material,th)),this.positions.length=0,this.colors.length=0,t.list.push(this.meshInstance),t.length++)},t}(),nh=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 ih(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}(),sh=[],ah=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 Da;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 nh(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:ce},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 ci(this.device,e)}return this.textureShader},e.getDepthTextureShader=function(){if(!this.depthTextureShader){var e=this.device.webgl2?"#define GL2":"",i={attributes:{aPosition:ce},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"+ui.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 ci(this.device,i)}return this.depthTextureShader},e.getQuadMesh=function(){return this.quadMesh||(this.quadMesh=new ga(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 Ya(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){sh.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(sh,i),sh.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=ot.clamp(Math.floor(t),1,255)}},{key:"ambientBakeSpherePart",get:function(){return this._ambientBakeSpherePart},set:function(t){this._ambientBakeSpherePart=ot.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=Yn.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),oh=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 lh=null;var ch=function(){function t(t){this._requestId=0,this._pendingRequests={},this._filenamePrefix=t,this._worker=new Worker(function(){if(!lh){var t="("+hh.toString()+")(true)\n\n",e=new Blob([t],{type:"application/javascript"});lh=URL.createObjectURL(e)}return lh}()),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}();hh();var uh=function(){function t(t){this.handlerType="bundle",this._assets=t.assets,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;lt.get(t.load,{responseType:ht.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 ch(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 eh(t).untar(i._assets.prefix);e(null,n)}},e.open=function(t,e){return new oh(e)},e.patch=function(t,e){},t}(),dh=function(){function t(t){this._handlers={},this._requests={},this._cache={},this._app=t}var e=t.prototype;return e.addHandler=function(t,e){this._handlers[t]=e,e._loader=this},e.removeHandler=function(t){delete this._handlers[t]},e.getHandler=function(t){return this._handlers[t]},e.load=function(t,e,i,n){var s=this._handlers[e];if(s)if(t){var a=t+e;if(void 0!==this._cache[a])i(null,this._cache[a]);else if(this._requests[a])this._requests[a].push(i);else{this._requests[a]=[i];var r=this,o=function(t,e){t?r._onFailure(a,t):s.load(e,(function(t,i,o){if(r._requests[a])if(t)r._onFailure(a,t);else try{r._onSuccess(a,s.open(e.original,i,n),o)}catch(t){r._onFailure(a,t)}}),n)},h=t.split("?")[0];if(this._app.enableBundles&&this._app.bundles.hasUrl(h)){if(!this._app.bundles.canLoadUrl(h))return void o("Bundle for "+t+" not loaded yet");this._app.bundles.loadUrl(h,(function(t,e){o(t,{load:e,original:h})}))}else o(null,{load:t,original:n&&n.file.filename||t})}}else this._loadNull(s,i,n);else i("No handler for asset type: '"+e+"' when loading ["+t+"]")},e._loadNull=function(t,e,i){t.load(null,(function(n,s,a){if(n)e(n);else try{e(null,t.open(null,s,i),a)}catch(t){e(t)}}),i)},e._onSuccess=function(t,e,i){this._cache[t]=e;for(var n=0;n=0&&t<=1?0:1})),_h(["fr","pt"],(function(t){return t>=0&&t<2?0:1})),_h(["da"],(function(t){return 1===t||!Number.isInteger(t)&&t>=0&&t<=1?0:1})),_h(["de","en","it","el","es","tr","fi","sv","nb","no","ur"],(function(t){return 1===t?0:1})),_h(["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})),_h(["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})),_h(["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 yh=mh[gh(fh)];function xh(t){return mh[t]||yh}var bh=new RegExp("^\\s*(?:(?:[a-z]+[a-z0-9\\-\\+\\.]*:)?//|data:|blob:)","i"),Sh=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}(),wh=-1,Th={pvr:"extCompressedTexturePVRTC",dxt:"extCompressedTextureS3TC",etc2:"extCompressedTextureETC",etc1:"extCompressedTextureETC1",basis:"canvas"},Ah=["pvr","dxt","etc2","etc1","basis"],Mh=function(t){function e(e,i,n,s,a){var r;return(r=t.call(this)||this)._id=wh--,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}j(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&&!bh.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=vh(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)||da(),a=null==s?void 0:s.graphicsDevice;if(a)for(var r=function(i,n){var r=Ah[i];if(t.variants[r]&&a[Th[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=Ah.length;o0?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;Ih.app=this._app,this._loadScript(e.load,(function(e,a,r){if(e)i(e);else if(Ih.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?i[0]:null},e}(m),Dh=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(!Bh.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}(Nh);Uh.scriptMethods={initialize:"initialize",postInitialize:"postInitialize",update:"update",postUpdate:"postUpdate",swap:"swap"};var zh=new RegExp("^\\s*function(?:\\s|\\s*\\/\\*.*\\*\\/\\s*)+([^\\(\\s\\/]*)\\s*"),Vh=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}j(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(zh);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,Uh.scriptMethods.initialize)),this._initialized&&!this._postInitialized&&this.enabled&&!this.entity.script._beingEnabled&&(this._postInitialized=!0,this.postInitialize&&this.entity.script._scriptMethod(this,Uh.scriptMethods.postInitialize)))}}],[{key:"scriptName",get:function(){return this.__name}},{key:"attributes",get:function(){return this.hasOwnProperty("__attributes")||(this.__attributes=new Bh(this)),this.__attributes}}]),e}(m);Vh.__name=null;var Gh=function(t){function e(e){var i;return(i=t.call(this)||this).app=e,i._scripts={},i._list=[],i}j(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.loopIndex0&&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 Lo("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 To(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===$h&&(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(){var t;if(this._allowResize&&(null==(t=this.xr)||!t.active)&&this._resolutionMode===Jh){var e=this.graphicsDevice.canvas;this.graphicsDevice.resizeCanvas(e.clientWidth,e.clientHeight)}},n.onLibrariesLoaded=function(){this._librariesLoaded=!0,this.systems.rigidbody&&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){Zo.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._firstBake=function(){this.lightmapper&&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=ct.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=ct.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 wt;o.setTRS(new pt(t,e,0),Tt.IDENTITY,new pt(i,n,0)),a||((a=new $n).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 $n;a.shader=this.scene.immediate.getDepthTextureShader(),a.update(),this.drawTexture(t,e,i,n,null,a,s)},n.destroy=function(){var t;if(this._inFrameUpdate)this._destroyRequested=!0;else{var e=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 n=this.assets.list(),s=0;s0&&e.push(new ul(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|=Bt),this.scene.ambientBake&&(u|=Gt),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=P)&&this.calcSpawnPosition(i,n,s,a,M);var k=R>0&&R0&&(1===u.emitterShape?(xl.copy(bl).mulScalar(2).sub(pt.ONE).normalize(),Tl.add(xl.mulScalar(u.initialVelocity))):Tl.add(pt.FORWARD.mulScalar(u.initialVelocity))),wl.x+=(Al.x-wl.x)*bl.x,wl.y+=(Al.y-wl.y)*bl.y,wl.z+=(Al.z-wl.z)*bl.z,_+=(g-_)*bl.y,L=(L+1e4*C%1*(v-L))*_l,D=1e3*C%1*(x-y),u.meshInstance.node&&(u.localSpace?(Tl.x/=hl.x,Tl.y/=hl.y,Tl.z/=hl.z):gl.transformPoint(Tl,Tl)),u.localSpace?(vl.transformPoint(wl,wl),Tl.add(wl).add(Cl)):(Tl.add(wl.mul(hl)),Tl.add(Cl.mul(hl))),Rl.copy(Tl),El.copy(Sl).add(Tl.mulScalar(r)),Pl.copy(El),i[4*M]=Pl.x,i[4*M+1]=Pl.y,i[4*M+2]=Pl.z,i[4*M+3]+=_*r,u.wrap&&u.wrapBounds&&(u.localSpace||Pl.sub(a),Pl.x=kl(Pl.x,u.wrapBounds.x)-.5*u.wrapBounds.x,Pl.y=kl(Pl.y,u.wrapBounds.y)-.5*u.wrapBounds.y,Pl.z=kl(Pl.z,u.wrapBounds.z)-.5*u.wrapBounds.z,u.localSpace||Pl.add(a)),u.sort>0&&(1===u.sort?(Il.copy(Pl).sub(S),u.particleDistance[M]=-(Il.x*Il.x+Il.y*Il.y+Il.z*Il.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,G=u.particleDistance,W=0;Wt.maxTextureSize&&(this.numParticles=t.maxTextureSize),ic("rate",1),ic("rate2",this.rate),ic("lifetime",50),ic("emitterExtents",new pt(0,0,0)),ic("emitterExtentsInner",new pt(0,0,0)),ic("emitterRadius",0),ic("emitterRadiusInner",0),ic("emitterShape",0),ic("initialVelocity",1),ic("wrap",!1),ic("localSpace",!1),ic("screenSpace",!1),ic("wrapBounds",null),ic("colorMap",this.defaultParamTexture),ic("normalMap",null),ic("loop",!0),ic("preWarm",!1),ic("sort",0),ic("mode",0),ic("scene",null),ic("lighting",!1),ic("halfLambert",!1),ic("intensity",1),ic("stretch",0),ic("alignToMotion",!1),ic("depthSoftening",0),ic("mesh",null),ic("particleNormal",new pt(0,1,0)),ic("orientation",0),ic("depthWrite",!1),ic("noFog",!1),ic("blendType",2),ic("node",null),ic("startAngle",0),ic("startAngle2",this.startAngle),ic("animTilesX",1),ic("animTilesY",1),ic("animStartFrame",0),ic("animNumFrames",1),ic("animNumAnimations",1),ic("animIndex",0),ic("randomizeAnimIndex",!1),ic("animSpeed",1),ic("animLoop",!0),this._gpuUpdater=new zl(this,i),this._cpuUpdater=new Fl(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]),ic("colorGraph",Kl),ic("colorGraph2",this.colorGraph),ic("scaleGraph",Yl),ic("scaleGraph2",this.scaleGraph),ic("alphaGraph",Yl),ic("alphaGraph2",this.alphaGraph),ic("localVelocityGraph",jl),ic("localVelocityGraph2",this.localVelocityGraph),ic("velocityGraph",jl),ic("velocityGraph2",this.velocityGraph),ic("rotationSpeedGraph",ql),ic("rotationSpeedGraph2",this.rotationSpeedGraph),ic("radialSpeedGraph",ql),ic("radialSpeedGraph2",this.radialSpeedGraph),this.lightCube=new Float32Array(18),this.lightCubeDir=new Array(6),this.lightCubeDir[0]=new pt(-1,0,0),this.lightCubeDir[1]=new pt(1,0,0),this.lightCubeDir[2]=new pt(0,-1,0),this.lightCubeDir[3]=new pt(0,1,0),this.lightCubeDir[4]=new pt(0,0,-1),this.lightCubeDir[5]=new pt(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 Rt,this.worldBoundsNoTrail=new Rt,this.worldBoundsTrail=[new Rt,new Rt],this.worldBounds=new Rt,this.worldBoundsSize=new pt,this.prevWorldBoundsSize=new pt,this.prevWorldBoundsCenter=new pt,this.prevEmitterExtents=this.emitterExtents,this.prevEmitterRadius=this.emitterRadius,this.worldBoundsMul=new pt,this.worldBoundsAdd=new pt,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?wt.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,Zl=this.useCpu||this.pack8?4:2,this.useMesh=!1,this.mesh)&&(this.numParticles*this.mesh.vertexBuffer.numVertices>65535||(this.useMesh=!0));this.numParticlesPot=ot.nextPowerOfTwo(this.numParticles),this.rebuildGraphs(),this.calculateLocalBounds(),this.resetWorldBounds(),this.node&&(this.worldBounds.setFromTransformedAabb(this.localBounds,this.localSpace?wt.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?wt.IDENTITY:this.node.getWorldTransform()).transformVector(this.particleNormal).normalize();var n=new pt(1,0,0);1===Math.abs(n.dot(i))&&n.set(0,0,1);var s=(new pt).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:Me,components:4,type:6},{semantic:Ce,components:4,type:6},{semantic:Ee,components:4,type:6},{semantic:Pe,components:1,type:6},{semantic:Re,components:this.useMesh?4:2,type:6}],s=new ai(this.graphicsDevice,n);this.vertexBuffer=new ni(this.graphicsDevice,s,e,1),this.indexBuffer=new As(this.graphicsDevice,1,i)}else{var a=[{semantic:Me,components:4,type:6}];this.useMesh&&a.push({semantic:Ce,components:2,type:6});var r=new ai(this.graphicsDevice,a);this.vertexBuffer=new ni(this.graphicsDevice,r,e,1),this.indexBuffer=new As(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 oc.get(this.graphicsDevice,(function(){for(var e=16,i=new Float32Array(1024),n=0;n>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 Lo("picker"),this.layerComp.pushOpaque(this.layer)},e.prepare=function(t,e,i){t instanceof Hi&&(t=t.node.camera),i instanceof To&&(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;ci){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.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}(),Ac=function(){function t(){this._left=1/0,this._right=-1/0,this._len=0,this._recip=0,this._p0=0,this._p1=0,this._t=0,this._hermite={valid:!1,p0:0,m0:0,p1:0,m1:0}}var e=t.prototype;return e.update=function(t,e){if(t=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}(),Ec=function(){function t(t,e,i,n){this._paths=t,this._input=e,this._output=i,this._interpolation=n}return q(t,[{key:"paths",get:function(){return this._paths}},{key:"input",get:function(){return this._input}},{key:"output",get:function(){return this._output}},{key:"interpolation",get:function(){return this._interpolation}}]),t}(),Pc=function(){function t(t,e){this._components=t,this._data=e}return q(t,[{key:"components",get:function(){return this._components}},{key:"data",get:function(){return this._data}}]),t}(),Rc="NONE",Ic="PREV_STATE",Lc="NEXT_STATE",Dc="PREV_STATE_NEXT_STATE",kc="NEXT_STATE_PREV_STATE",Oc="GREATER_THAN",Fc="LESS_THAN",Bc="GREATER_THAN_EQUAL_TO",Nc="LESS_THAN_EQUAL_TO",Uc="EQUAL_TO",zc="NOT_EQUAL_TO",Vc="INTEGER",Gc="FLOAT",Wc="BOOLEAN",Hc="TRIGGER",Xc="2D_DIRECTIONAL",qc="2D_CARTESIAN",Yc="DIRECT",jc="START",Kc="END",Zc="ANY",$c=[jc,Kc,Zc],Qc="OVERWRITE",Jc="ADDITIVE",tu=function(){function t(e,i){this._component=e,this.mask=new Int8Array(e.layers.length),this.weights=new Float32Array(e.layers.length),this.totalWeight=0,this.counter=0,this.layerCounter=0,this.valueType=i,this.dirty=!0,this.value=i===t.TYPE_QUAT?[0,0,0,1]:[0,0,0],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:ot.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===Qc&&(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){return t.createAnimTarget((function(t){for(var e=0;e=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!==ru?this._blendTree.getNodeCount():1}},{key:"playable",get:function(){return-1!==$c.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}(),fu=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?Rc: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}(),pu=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})),Co(i),this._findTransitionsBetweenStatesCache[t+"->"+e]=i),i},e._transitionHasConditionsMet=function(t){for(var e=t.conditions,i=0;in.value))return!1;break;case Fc:if(!(s.value=n.value))return!1;break;case Nc:if(!(s.value<=n.value))return!1;break;case Uc:if(s.value!==n.value)return!1;break;case zc: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 Ic:n=(n=n.concat(this._findTransitionsFromState(this._previousStateName))).concat(this._findTransitionsFromState(Zc));break;case Lc:n=(n=n.concat(this._findTransitionsFromState(this._activeStateName))).concat(this._findTransitionsFromState(Zc));break;case Dc:n=(n=(n=n.concat(this._findTransitionsFromState(this._previousStateName))).concat(this._findTransitionsFromState(this._activeStateName))).concat(this._findTransitionsFromState(Zc));break;case kc:n=(n=(n=n.concat(this._findTransitionsFromState(this._activeStateName))).concat(this._findTransitionsFromState(this._previousStateName))).concat(this._findTransitionsFromState(Zc))}else n=(n=n.concat(this._findTransitionsFromState(this._activeStateName))).concat(this._findTransitionsFromState(Zc));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)})),n.length>0){var s=n[0];if(s.to===Kc){var a=this._findTransitionsFromState(jc)[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 fu({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 du(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!==$c.indexOf(t))return!1;var e=this._findState(t);return!!e&&(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=jc,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;ryu?yu:i.width||512,a=i.height>yu?yu:i.height||512,r=document.createElement("canvas");r.height=a,r.width=s;var o=new Ui(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}j(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 Ui(this.app.graphicsDevice,{format:7,mipmaps:!0,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(),en)return 0;var o=0;return a===bu?o=1-s*(r-i)/(n-i):a===Su?o=i/(i+s*(r-i)):a===wu&&(o=Math.pow(r/i,-s)),ot.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 Eu=function(){function t(t){this._manager=t,this.position=new pt,this.velocity=new pt,this.orientation=new wt}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}(),Pu="running",Ru="suspended",Iu="interrupted",Lu=["click","contextmenu","auxclick","dblclick","mousedown","mouseup","pointerup","touchend","keydown","keyup"],Du=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,(Tu()||i._forceWebAudioApi)&&i._addAudioContextUserInteractionListeners(),i.listener=new Eu(Z(i)),i._volume=1,i.suspended=!1,i}j(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!==Iu&&this._state!==Ru||this._safelyResumeContext()},i.destroy=function(){var t=this;this._resumeContext&&this._resumeContextAttached&&Lu.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 Au&&(i=new Au(this,t,e)).play(),i},i.playSound3d=function(t,e,i){void 0===i&&(i={});var n=null;return Mu&&((n=new Mu(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!==Pu&&t._addAudioContextUserInteractionListeners()})).catch((function(){t._addAudioContextUserInteractionListeners()}))},i._addAudioContextUserInteractionListeners=function(){var t=this;this._resumeContext||(this._resumeContext=function(){t.context&&t.context.state!==Pu?t.context.resume():(Lu.forEach((function(e){window.removeEventListener(e,t._resumeContext)})),t._resumeContextAttached=!1)}),this._resumeContextAttached||(Lu.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=ot.clamp(t,0,1),this._volume=t,this.fire("volumechange",t)}},{key:"context",get:function(){var t=this;return this._context||(Tu()||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!==Iu&&t._state!==Ru||t._safelyResumeContext(),t._state=t._context.state)})),this._context}}]),e}(m),ku=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}();function Ou(t,e){return t%e||0}var Fu=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?ot.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=0,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,Tu()?(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}j(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>0?this._suspendEndEvent--:(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=Ou(this._startOffset,this.duration);return t=Ou(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++,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=Ou(this._startOffset,this.duration),t=Ou(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===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=Ou(this._startTime,this.source.buffer.duration),this._duration&&(this.source.loopEnd=Math.max(this.source.loopStart,Ou(this._startTime+this._duration,this.source.buffer.duration)))),this.source},i._updateCurrentTime=function(){this._currentTime=Ou((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?Ou(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=ot.clamp(t,0,1),this._volume=t,this.gain&&(this.gain.gain.value=t*this._manager.volume)}}]),e}(m);Tu()||(Object.assign(Fu.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++,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++,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=Ou(this._startOffset,this.duration);t=Ou(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>Ou(this._startTime+this._duration,this.source.duration)&&(this.loop?this.source.currentTime=Ou(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(Fu.prototype,"volume",{get:function(){return this._volume},set:function(t){t=ot.clamp(t,0,1),this._volume=t,this.source&&(this.source.volume=t*this._manager.volume)}}),Object.defineProperty(Fu.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(Fu.prototype,"sound",{get:function(){return this._sound},set:function(t){this.stop(),this._sound=t}}),Object.defineProperty(Fu.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=Ou(this._startTime+Ou(t,this.duration),this._sound.duration),this._startOffset=null))}}));var Bu=function(t){function e(e,i,n){var s;return void 0===n&&(n={}),(s=t.call(this,e,i,n)||this)._position=new pt,s._velocity=new pt,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:bu,s}return j(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}(Fu);if(!Tu()){var Nu=new pt;Object.defineProperty(Bu.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=(Nu=Nu.sub2(t,e)).length();if(rn)return 0;var o=0;return a===bu?o=1-s*(r-i)/(n-i):a===Su?o=i/(i+s*(r-i)):a===wu&&(o=Math.pow(r/i,-s)),ot.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(Bu.prototype,"maxDistance",{get:function(){return this._maxDistance},set:function(t){this._maxDistance=t}}),Object.defineProperty(Bu.prototype,"refDistance",{get:function(){return this._refDistance},set:function(t){this._refDistance=t}}),Object.defineProperty(Bu.prototype,"rollOffFactor",{get:function(){return this._rollOffFactor},set:function(t){this._rollOffFactor=t}}),Object.defineProperty(Bu.prototype,"distanceModel",{get:function(){return this._distanceModel},set:function(t){this._distanceModel=t}})}function Uu(){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;lt.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 lt.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,maxRetries:this.maxRetries};t.load.startsWith("blob:")&&(i.responseType=ht.ResponseType.JSON),lt.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 Pc(1,t)})),a=e.outputs.map((function(t){return new Pc(t.components,t.data)})),r=e.curves.map((function(t){return new Ec([t.path],t.inputIndex,t.outputIndex,t.interpolation)}));return new su(i,n,s,a,r)},e.patch=function(t,e){},t}(),Qu=function(){function t(t){this.handlerType="animstategraph",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=ht.ResponseType.JSON),lt.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 mu(e)},e.patch=function(t,e){},t}(),Ju=function(t){function e(){var e;return(e=t.call(this)||this)._meshes=null,e}j(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){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}();ed._skinInstanceCache=new Map;var id=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},_d=new wt,gd=new pt,vd=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);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,i){var a,r,h,l,c=n.GetAttributeByUniqueId(e,t),u=o*c.num_components();switch(c.data_type()){case s.DT_UINT8:l=1,h=1,a=s._malloc(u*h),n.GetAttributeDataArrayForAllPoints(e,c,s.DT_UINT8,u*h,a),r=new Uint8Array(s.HEAPU8.buffer,a,u).slice();break;case s.DT_UINT16:l=3,h=2,a=s._malloc(u*h),n.GetAttributeDataArrayForAllPoints(e,c,s.DT_UINT16,u*h,a),r=new Uint16Array(s.HEAPU16.buffer,a,u).slice();break;case s.DT_FLOAT32:default:l=6,h=4,a=s._malloc(u*h),n.GetAttributeDataArrayForAllPoints(e,c,s.DT_FLOAT32,u*h,a),r=new Float32Array(s.HEAPF32.buffer,a,u).slice()}return s._free(a),{values:r,numComponents:c.num_components(),componentSizeInBytes:h,storageType:l,normalized:i===me&&1===l||c.normalized()}},l={},c=i.attributes;for(var u in c)if(c.hasOwnProperty(u)&&hd.hasOwnProperty(u)){var d=hd[u],f=h(c[u],d),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(ue)||fd(l,a),md(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")?cd(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)&&hd.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=cd(p,s),_=s[p.bufferView],g=hd[f],v=ad(p.type)*od(p.componentType),y=_.hasOwnProperty("byteStride")?_.byteStride:v;d[g]={buffer:m.buffer,size:v,offset:m.byteOffset,stride:y,count:p.count,components:ad(p.type),type:rd(p.componentType),normalize:p.normalized}}d.hasOwnProperty(ue)||fd(d,i),u=md(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:default:return 4;case 5:return 5;case 6:return 6}}(h));var C=null;if(c){if((C=new ga(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 As(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=dd(R),f&&h.hasOwnProperty("targets")){var I=[];h.targets.forEach((function(t,s){var a={};t.hasOwnProperty("POSITION")&&(R=i[t.POSITION],a.deltaPositions=ud(R,n),a.deltaPositionsType=6,a.aabb=dd(R)),t.hasOwnProperty("NORMAL")&&(R=i[t.NORMAL],a.deltaNormals=ud(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 ml(a))})),C.morph=new $o(I,t)}}o.push(C)})),o},yd=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")&&(_d.data.set(t.matrix),_d.getTranslation(gd),i.setLocalPosition(gd),_d.getEulerAngles(gd),i.setLocalEulerAngles(gd),_d.getScale(gd),i.setLocalScale(gd)),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},bd=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*ot.RAD_TO_DEG,n.aspectRatio&&(s.aspectRatioMode=1,s.aspectRatio=n.aspectRatio));var a=new rl(t.name);return a.addComponent("camera",s),a},Sd=function(t,e){var i={enabled:!1,type:"point"===t.type?"omni":t.type,color:t.hasOwnProperty("color")?new ct(t.color):ct.WHITE,range:t.hasOwnProperty("range")?t.range:9999,falloffMode:1,intensity:t.hasOwnProperty("intensity")?ot.clamp(t.intensity,0,2):1};t.hasOwnProperty("spot")&&(i.innerConeAngle=t.spot.hasOwnProperty("innerConeAngle")?t.spot.innerConeAngle*ot.RAD_TO_DEG:0,i.outerConeAngle=t.spot.hasOwnProperty("outerConeAngle")?t.spot.outerConeAngle*ot.RAD_TO_DEG:Math.PI/4);var n=new rl(e.name);return n.rotateLocal(90,0,0),n.addComponent("light",i),n},wd=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=cd(i[d],n,!0),p=[];for(r=0;r0){var s=i&&i.camera&&i.camera.preprocess,a=i&&i.camera&&i.camera.process||bd,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=Td(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||yd,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 vd(t,r,e.accessors,i,n,s,a)}))}(t,e,i,a,h),_=wd(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})},Rd=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;Mh.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 id(e,n,s._assets,s._defaultMaterial))}))}),n,this.maxRetries)},e.open=function(t,e,i){return e},e.patch=function(t,e){},t}(),Ld=function(){function t(t){this.handlerType="animation",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=ht.ResponseType.ARRAY_BUFFER:i.responseType=ht.ResponseType.JSON),lt.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=Id.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 bc;i.name=e.name,i.duration=e.duration;for(var n=0;n0)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}(),kd=[".ogg",".mp3",".wav",".mp4a",".m4a",".mp4",".aac",".opus"],Od=function(){function t(t){this.handlerType="audio",this.manager=t.soundManager,this.maxRetries=0}var e=t.prototype;return e._isSupported=function(t){var e=v.getExtension(t);return kd.indexOf(e)>-1},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 ku(t))}),i)}else i(null)},e.open=function(t,e){return e},e.patch=function(t,e){},e._createSound=function(t,e,i){if(Tu()){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=ht.ResponseType.ARRAY_BUFFER),lt.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")}Dd&&document.body.appendChild(a);a.onerror=function(){a.onerror=null,Dd&&document.body.removeChild(a),i()},a.addEventListener("canplaythrough",(function t(){a.removeEventListener("canplaythrough",t),Dd&&document.body.removeChild(a),e(a)})),a.src=t}},t}(),Fd=function(){function t(t){this.handlerType="binary",this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t}),lt.get(t.load,{responseType:ht.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}(),Bd=function(){function t(){}var e=t.prototype;return e.instantiateModelEntity=function(t){return null},e.instantiateRenderEntity=function(t){return null},t}(),Nd=function(){function t(t){this.handlerType="container",this.glbParser=new Id(t.graphicsDevice,t.assets,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){},q(t,[{key:"maxRetries",get:function(){return this.glbParser.maxRetries},set:function(t){for(var e in this.glbParser.maxRetries=t,this.parsers)this.parsers.hasOwnProperty(e)&&(this.parsers[e].maxRetries=t)}}]),t}(),Ud=function(){function t(t){this.handlerType="css",this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t}),lt.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 zd=function(){function t(t){this.handlerType="cubemap",this._device=t.graphicsDevice,this._registry=t.assets,this._loader=t.loader}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:Ge: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 Ui(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=Gd(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=Gd(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)}))},Zd=function(){function t(t){this.handlerType="hierarchy",this._app=t,this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){Kd(t,this.maxRetries,e)},e.open=function(t,e){this._app.systems.script.preloading=!0;var i=new jd(this._app,!1).parse(e);return this._app.systems.script.preloading=!1,i},t}(),$d=function(){function t(t){this.handlerType="html",this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t}),lt.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}(),Qd=function(){function t(t){this.handlerType="json",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=ht.ResponseType.JSON),lt.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}(),Jd=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=es,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 Ui||this.setInvalid(n,t)):"number"!=typeof t[n]&&null!==t[n]&&(t[n]instanceof Ui||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 Ui&&t[n].cubemap||this.setInvalid(n,t));else if("chunks"===s)for(var r=Object.keys(t[n]),o=0;o=0}},t}(),tf=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 ls;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=Y({},e.chunks)),e){var n=es[i],s=e[i];if("vec2"===n)t[i]=new _t(s[0],s[1]);else if("rgb"===n)t[i]=new ct(s[0],s[1],s[2]);else if("texture"===n)s instanceof Ui?t[i]=s:t[i]instanceof Ui&&"number"==typeof s&&s>0||(t[i]=null);else if("cubemap"===n)s instanceof Ui?t[i]=s:t[i]instanceof Ui&&"number"==typeof s&&s>0||(t[i]=null),"cubeMap"!==i||s||(t.prefilteredCubemaps=null);else if("boundingbox"===n){var a=new pt(s.center[0],s.center[1],s.center[2]),r=new pt(s.halfExtents[0],s.halfExtents[1],s.halfExtents[2]);t[i]=new Rt(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 Ui(this._device,{width:2,height:2,format:7,name:"material_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=nf[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=is;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&&hf(s,null,this._device.getBoneLimit());for(i=0;i0&&(h>65535&&this._device.extUintElement?(s=new As(this._device,2,r),a=new Uint32Array(s.lock())):(s=new As(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=ht.ResponseType.ARRAY_BUFFER:i.responseType=ht.ResponseType.JSON),lt.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,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}();function bf(t){this.resource&&(this.resource.atlas=t.resource)}function Sf(t){this.registry.load(t)}var wf=function(){function t(t){this.handlerType="sprite",this._assets=t.assets,this._device=t.graphicsDevice,this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t}),".json"===v.getExtension(t.original)&<.get(t.load,{retry:this.maxRetries>0,maxRetries:this.maxRetries},(function(t,i){t?e(t):e(null,i)}))},e.open=function(t,e){var i=new _c(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,bf,t),this._assets.on("load:"+t.data.textureAtlasAsset,bf,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,Sf,t),this._assets.on("add:"+t.data.textureAtlasAsset,Sf,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,bf,t),this._assets.off("add:"+n.textureAtlasAsset,Sf,t))},t}(),Tf=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 jd(this._app,!0);this._templateRoot=t.parse(this._data)},t}(),Af=function(){function t(t){this.handlerType="template",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};lt.get(t.load,i,(function(i,n){i?e("Error requesting template: "+t.original):e(i,n)}))},e.open=function(t,e){return new Tf(this._app,e)},t}(),Mf=function(){function t(t){this.handlerType="text",this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t}),lt.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}(),Cf=function(){function t(t,e){this.device=e,this.maxRetries=0}var e=t.prototype;return e.load=function(t,e,i){var n=this.device;Mh.fetchArrayBuffer(t.load,(function(s,a){s?e(s):function(s){var a,r,o;Zu(n,t.load,s,e,{isGGGR:0!=(8&(null==i||null==(a=i.file)||null==(r=a.variants)||null==(o=r.basis)?void 0:o.opt))})||e("Basis module not found. Asset '"+i.name+"' basis texture variant will not be loaded.")}(a)}),i,this.maxRetries)},e.open=function(t,e,i){var n=new Ui(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},t}(),Ef=function(){function t(t){this.crossOrigin=t.prefix?"anonymous":null,this.maxRetries=0,this.useImageBitmap=!1}var e=t.prototype;return e.load=function(t,e,i){var n,s=!(null==i||null==(n=i.file)||!n.contents);s&&(t={load:URL.createObjectURL(new Blob([i.file.contents])),original:t.original});var a,r=function(i,n){s&&URL.revokeObjectURL(t.load),e(i,n)};i&&i.options&&i.options.hasOwnProperty("crossOrigin")?a=i.options.crossOrigin:bh.test(t.load)&&(a=this.crossOrigin),this.useImageBitmap?this._loadImageBitmap(t.load,t.original,a,r):this._loadImage(t.load,t.original,a,r)},e.open=function(t,e,i){var n=v.getExtension(t).toLowerCase(),s=".jpg"===n||".jpeg"===n?6:7,a=new Ui(i,{name:t,width:e.width,height:e.height,format:s});return a.setSource(e),a},e._loadImage=function(t,e,i,n){var s=new Image;i&&(s.crossOrigin=i);var a,r=0,o=this.maxRetries;s.onload=function(){n(null,s)},s.onerror=function(){if(!a)if(o>0&&++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};lt.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}(),Pf=[1481919403,3140563232,169478669],Rf={33776:8,33778:9,33779:te,36196:oe,37492:22,37496:23,35840:26,35841:he,35842:27,35843:le,32849:6,32856:7,35905:19,35907:20,35898:18,34843:ee,34842:ie};var If=function(){function t(t){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e,i){Mh.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 Ui(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(Pf[0]!==e[0]||Pf[1]!==e[1]||Pf[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=Rf[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}(),Lf=166,Df=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;Mh.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 Ui(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 Ui(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!==se||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=Bf[n.minfilter]),n.hasOwnProperty("magfilter")&&(i.magFilter=Bf[n.magfilter]),i.cubemap||(n.hasOwnProperty("addressu")&&(i.addressU=Ff[n.addressu]),n.hasOwnProperty("addressv")&&(i.addressV=Ff[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=Nf[n.type]:n.hasOwnProperty("rgbm")&&n.rgbm?i.type=We:t.file&&0!=(8&t.file.opt)&&(i.type=Xe)}},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}(),Vf={repeat:0,clamp:1,mirror:2},Gf={nearest:0,linear:1,nearest_mip_nearest:2,linear_mip_nearest:4,nearest_mip_linear:3,linear_mip_linear:5},Wf=/^data\.frames\.(\d+)$/,Hf=function(){function t(t){this.handlerType="textureatlas",this._loader=t.loader,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);lt.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 vc;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!==Gf[t.data.minfilter]&&(i.minFilter=Gf[t.data.minfilter]),t.data.hasOwnProperty("magfilter")&&i.magFilter!==Gf[t.data.magfilter]&&(i.magFilter=Gf[t.data.magfilter]),t.data.hasOwnProperty("addressu")&&i.addressU!==Vf[t.data.addressu]&&(i.addressU=Vf[t.data.addressu]),t.data.hasOwnProperty("addressv")&&i.addressV!==Vf[t.data.addressv]&&(i.addressV=Vf[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:Ge;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 gt(r.rect),pivot:new _t(r.pivot),border:new gt(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 gt(n.rect),pivot:new _t(n.pivot),border:new gt(n.border)};t.resource.frames=s}else{var r=e.match(Wf);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 gt(i.rect),pivot:new _t(i.pivot),border:new gt(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}(),Xf=function(t){function e(e,i){var n;return(n=t.call(this)||this)._assets=new Set,n._loadingAssets=new Set,n._waitingAssets=new Set,n._registry=i,n._loading=!1,n._loaded=!1,n._failed=[],e.forEach((function(t){if(t instanceof Mh)t.registry||(t.registry=i),n._assets.add(t);else{var e=i.get(t);e?n._assets.add(e):n._waitForAsset(t)}})),n}j(e,t);var i=e.prototype;return i.destroy=function(){var t=this;this._registry.off("load",this._onLoad),this._registry.off("error",this._onError),this._waitingAssets.forEach((function(e){t._registry.off("add:"+e,this._onAddAsset)})),this.off("progress"),this.off("load")},i._assetHasDependencies=function(t){var e;return"model"===t.type&&(null==(e=t.file)?void 0:e.url)&&t.file.url&&t.file.url.match(/.json$/g)},i.load=function(t,e){var i=this;if(!this._loading){this._loading=!0,this._callback=t,this._scope=e,this._registry.on("load",this._onLoad,this),this._registry.on("error",this._onError,this);var n=!1;this._assets.forEach((function(t){t.loaded||(n=!0,i._assetHasDependencies(t)&&i._registry.loadFromUrl(t.file.url,t.type,(function(e,n){e?i._onError(e,t):i._onLoad(t)})),i._loadingAssets.add(t),i._registry.add(t))})),this._loadingAssets.forEach((function(t){i._assetHasDependencies(t)||i._registry.load(t)})),n||0!==this._waitingAssets.size||this.fire("load",Array.from(this._assets))}},i.ready=function(t,e){void 0===e&&(e=this),this._loaded?t.call(e,Array.from(this._assets)):this.once("load",(function(i){t.call(e,i)}))},i._loadingComplete=function(){this._loaded||(this._loaded=!0,this._registry.off("load",this._onLoad,this),this._registry.off("error",this._onError,this),this._failed.length?(this._callback&&this._callback.call(this._scope,"Failed to load some assets",this._failed),this.fire("error",this._failed)):(this._callback&&this._callback.call(this._scope),this.fire("load",Array.from(this._assets))))},i._onLoad=function(t){var e=this;this._loadingAssets.has(t)&&(this.fire("progress",t),this._loadingAssets.delete(t)),0===this._loadingAssets.size&&setTimeout((function(){e._loadingComplete(e._failed)}),0)},i._onError=function(t,e){var i=this;this._loadingAssets.has(e)&&(this._failed.push(e),this._loadingAssets.delete(e)),0===this._loadingAssets.size&&setTimeout((function(){i._loadingComplete(i._failed)}),0)},i._onAddAsset=function(t){this._waitingAssets.delete(t),this._assets.add(t),t.loaded||(this._loadingAssets.add(t),this._registry.load(t))},i._waitForAsset=function(t){this._waitingAssets.add(t),this._registry.once("add:"+t,this._onAddAsset,this)},e}(m),qf=function(t){function e(e){var i;return(i=t.call(this)||this)._app=e,e.i18n.on("set:locale",i._onSetLocale,Z(i)),i._autoLoad=!1,i._disableLocalization=!1,i._defaultAsset=null,i._localizedAsset=null,i}j(e,t);var i=e.prototype;return i._bindDefaultAsset=function(){var t=this._app.assets.get(this._defaultAsset);t?this._onDefaultAssetAdd(t):this._app.assets.once("add:"+this._defaultAsset,this._onDefaultAssetAdd,this)},i._unbindDefaultAsset=function(){if(this._defaultAsset){this._app.assets.off("add:"+this._defaultAsset,this._onDefaultAssetAdd,this);var t=this._app.assets.get(this._defaultAsset);t&&(t.off("add:localized",this._onLocaleAdd,this),t.off("remove:localized",this._onLocaleRemove,this),t.off("remove",this._onDefaultAssetRemove,this))}},i._onDefaultAssetAdd=function(t){this._defaultAsset===t.id&&(t.on("add:localized",this._onLocaleAdd,this),t.on("remove:localized",this._onLocaleRemove,this),t.once("remove",this._onDefaultAssetRemove,this))},i._onDefaultAssetRemove=function(t){this._defaultAsset===t.id&&(t.off("add:localized",this._onLocaleAdd,this),t.off("remove:localized",this._onLocaleAdd,this),this._app.assets.once("add:"+this._defaultAsset,this._onDefaultAssetAdd,this))},i._bindLocalizedAsset=function(){if(this._autoLoad){var t=this._app.assets.get(this._localizedAsset);t&&(t.on("load",this._onLocalizedAssetLoad,this),t.on("change",this._onLocalizedAssetChange,this),t.on("remove",this._onLocalizedAssetRemove,this),t.resource?this._onLocalizedAssetLoad(t):this._app.assets.load(t))}},i._unbindLocalizedAsset=function(){var t=this._app.assets.get(this._localizedAsset);t&&(t.off("load",this._onLocalizedAssetLoad,this),t.off("change",this._onLocalizedAssetChange,this),t.off("remove",this._onLocalizedAssetRemove,this))},i._onLocalizedAssetAdd=function(t){this._localizedAsset===t.id&&this._bindLocalizedAsset()},i._onLocalizedAssetLoad=function(t){this.fire("load",t)},i._onLocalizedAssetChange=function(t,e,i,n){this.fire("change",t,e,i,n)},i._onLocalizedAssetRemove=function(t){this._localizedAsset===t.id&&(this.localizedAsset=this._defaultAsset),this.fire("remove",t)},i._onLocaleAdd=function(t,e){this._app.i18n.locale===t&&this._onSetLocale(t)},i._onLocaleRemove=function(t,e){this._app.i18n.locale===t&&this._onSetLocale(t)},i._onSetLocale=function(t){if(this._defaultAsset){var e=this._app.assets.get(this._defaultAsset);if(e&&!this._disableLocalization){var i=e.getLocalizedAssetId(t);this.localizedAsset=i||this._defaultAsset}else this.localizedAsset=this._defaultAsset}else this.localizedAsset=null},i.destroy=function(){this.defaultAsset=null,this._app.i18n.off("set:locale",this._onSetLocale,this),this.off()},q(e,[{key:"defaultAsset",get:function(){return this._defaultAsset},set:function(t){var e=t instanceof Mh?t.id:t;this._defaultAsset!==e&&(this._defaultAsset&&this._unbindDefaultAsset(),this._defaultAsset=e,this._defaultAsset&&this._bindDefaultAsset(),this._onSetLocale(this._app.i18n.locale))}},{key:"localizedAsset",get:function(){return this._localizedAsset},set:function(t){var e=t instanceof Mh?t.id:t;this._localizedAsset!==e&&(this._localizedAsset&&(this._app.assets.off("add:"+this._localizedAsset,this._onLocalizedAssetAdd,this),this._unbindLocalizedAsset(),this._localizedAsset=null),this._localizedAsset=e,this._localizedAsset&&(this._app.assets.get(this._localizedAsset)?this._bindLocalizedAsset():this._app.assets.once("add:"+this._localizedAsset,this._onLocalizedAssetAdd,this)))}},{key:"autoLoad",get:function(){return this._autoLoad},set:function(t){this._autoLoad!==t&&(this._autoLoad=t,this._autoLoad&&this._localizedAsset&&(this._unbindLocalizedAsset(),this._bindLocalizedAsset()))}},{key:"disableLocalization",get:function(){return this._disableLocalization},set:function(t){this._disableLocalization!==t&&(this._disableLocalization=t,this._onSetLocale(this._app.i18n.locale))}}]),e}(m),Yf=new Set(["system","entity","create","destroy","swap","move","scripts","_scripts","_scriptsIndex","_scriptsData","enabled","_oldState","onEnable","onDisable","onPostStateChange","_onSetEnabled","_checkState","_onBeforeRemove","_onInitializeAttributes","_onInitialize","_onPostInitialize","_onUpdate","_onPostUpdate","_callbacks","has","get","on","off","fire","once","hasEvent"]);function jf(t,e){if(Ih.legacy)return null;if(Yf.has(t))throw new Error("script name: '"+t+"' is reserved, please change script name");var i=function(t){m.prototype.initEventHandler.call(this),Vh.prototype.initScriptType.call(this,t)};return(i.prototype=Object.create(Vh.prototype)).constructor=i,i.extend=Vh.extend,i.attributes=new Bh(i),Zf(i,t,e),i}var Kf={};function Zf(t,e,i){if(!t.legacy){if("function"!=typeof t)throw new Error("script class: '"+t+"' must be a constructor function (i.e. class).");if(!(t.prototype instanceof Vh))throw new Error("script class: '"+Vh.__getScriptName(t)+"' does not extend pc.ScriptType.");if(e=e||t.__name||Vh.__getScriptName(t),Yf.has(e))throw new Error("script name: '"+e+"' is reserved, please change script name");t.__name=e,(i?i.scripts:il.getApplication().scripts).add(t),Eh._push(t)}}Bh.reservedNames.forEach((function(t,e,i){Kf[t]=1})),jf.reservedAttributes=Kf;var $f="mouse",Qf="keyboard",Jf="gamepad",tp="mousedown",ep="mousemove",ip="mouseup",np="mousewheel",sp=function(t,e){e?(this.key=e.keyCode,this.element=e.target,this.event=e):(this.key=null,this.element=null,this.event=null)},ap=new sp;function rp(t){return ap.key=t.keyCode,ap.element=t.target,ap.event=t,ap}function op(t){return"string"==typeof t?t.toUpperCase().charCodeAt(0):t}var hp={9:"Tab",13:"Enter",16:"Shift",17:"Control",18:"Alt",27:"Escape",37:"Left",38:"Up",39:"Right",40:"Down",46:"Delete",91:"Win"},lp=function(t){function e(e,i){var n;return void 0===i&&(i={}),(n=t.call(this)||this)._element=null,n._keyDownHandler=n._handleKeyDown.bind(Z(n)),n._keyUpHandler=n._handleKeyUp.bind(Z(n)),n._keyPressHandler=n._handleKeyPress.bind(Z(n)),n._visibilityChangeHandler=n._handleVisibilityChange.bind(Z(n)),n._windowBlurHandler=n._handleWindowBlur.bind(Z(n)),n._keymap={},n._lastmap={},e&&n.attach(e),n.preventDefault=i.preventDefault||!1,n.stopPropagation=i.stopPropagation||!1,n}j(e,t);var i=e.prototype;return i.attach=function(t){this._element&&this.detach(),this._element=t,this._element.addEventListener("keydown",this._keyDownHandler,!1),this._element.addEventListener("keypress",this._keyPressHandler,!1),this._element.addEventListener("keyup",this._keyUpHandler,!1),document.addEventListener("visibilitychange",this._visibilityChangeHandler,!1),window.addEventListener("blur",this._windowBlurHandler,!1)},i.detach=function(){this._element&&(this._element.removeEventListener("keydown",this._keyDownHandler),this._element.removeEventListener("keypress",this._keyPressHandler),this._element.removeEventListener("keyup",this._keyUpHandler),this._element=null,document.removeEventListener("visibilitychange",this._visibilityChangeHandler,!1),window.removeEventListener("blur",this._windowBlurHandler,!1))},i.toKeyIdentifier=function(t){t=op(t);var e=hp[t.toString()];if(e)return e;for(var i=t.toString(16).toUpperCase(),n=i.length,s=0;s<4-n;s++)i="0"+i;return"U+"+i},i._handleKeyDown=function(t){var e=t.keyCode||t.charCode;if(void 0!==e){var i=this.toKeyIdentifier(e);this._keymap[i]=!0,this.fire("keydown",rp(t)),this.preventDefault&&t.preventDefault(),this.stopPropagation&&t.stopPropagation()}},i._handleKeyUp=function(t){var e=t.keyCode||t.charCode;if(void 0!==e){var i=this.toKeyIdentifier(e);delete this._keymap[i],this.fire("keyup",rp(t)),this.preventDefault&&t.preventDefault(),this.stopPropagation&&t.stopPropagation()}},i._handleKeyPress=function(t){this.fire("keypress",rp(t)),this.preventDefault&&t.preventDefault(),this.stopPropagation&&t.stopPropagation()},i._handleVisibilityChange=function(){"hidden"===document.visibilityState&&this._handleWindowBlur()},i._handleWindowBlur=function(){this._keymap={},this._lastmap={}},i.update=function(){for(var t in this._lastmap)delete this._lastmap[t];for(var e in this._keymap)this._keymap.hasOwnProperty(e)&&(this._lastmap[e]=this._keymap[e])},i.isPressed=function(t){var e=op(t),i=this.toKeyIdentifier(e);return!!this._keymap[i]},i.wasPressed=function(t){var e=op(t),i=this.toKeyIdentifier(e);return!!this._keymap[i]&&!this._lastmap[i]},i.wasReleased=function(t){var e=op(t),i=this.toKeyIdentifier(e);return!this._keymap[i]&&!!this._lastmap[i]},e}(m);function cp(){return!!(document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement)}var up,dp,fp=function t(e,i){var n={x:0,y:0};if(i){if(i instanceof t)throw Error("Expected MouseEvent");n=e._getTargetCoords(i)}else i={};if(n)this.x=n.x,this.y=n.y;else{if(!cp())return;this.x=0,this.y=0}this.wheelDelta=0,"wheel"===i.type&&(i.deltaY>0?this.wheelDelta=1:i.deltaY<0&&(this.wheelDelta=-1)),cp()?(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},pp=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}j(e,t),e.isPointerLocked=function(){return cp()};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 fp(this,t);e.event&&this.fire(ip,e)},i._handleDown=function(t){this._buttons[t.button]=!0;var e=new fp(this,t);e.event&&this.fire(tp,e)},i._handleMove=function(t){var e=new fp(this,t);e.event&&(this.fire(ep,e),this._lastX=e.x,this._lastY=e.y)},i._handleWheel=function(t){var e=new fp(this,t);e.event&&this.fire(np,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),mp=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:Qf,keys:e}):this._actions[t]=[{type:Qf,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:$f,button:e}):this._actions[t]=[{type:$f,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:Jf,button:i,pad:e}):this._actions[t]=[{type:Jf,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(ep,(function(t){n._axesValues[e][i]=t.dx/10}));break;case"mousey":n._mouse.on(ep,(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 pp,!this._element)throw new Error("Controller must be attached to an Element");this._mouse.attach(this._element)},e._enableKeyboard=function(){if(this._keyboard=new lp,!this._element)throw new Error("Controller must be attached to an Element");this._keyboard.attach(this._element)},t}(),_p=new pt,gp=new pt,vp=new qt,yp=new qt,xp=new qt;vp.end=new pt,yp.end=new pt,xp.end=new pt;var bp=new pt,Sp=new pt,wp=new pt,Tp=new pt,Ap=new pt,Mp=new pt,Cp=new pt,Ep=new pt,Pp=new pt,Rp=new pt,Ip=new pt,Lp=new pt,Dp=new pt,kp=new pt,Op=new pt,Fp=new pt,Bp=new pt,Np=new pt,Up=new pt,zp=new pt,Vp=new gt;function Gp(t,e,i){return Ip.cross(t,e).dot(i)}var Wp=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}(),Hp=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,pp.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 j(e,t),e}(Wp),Xp=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 j(e,t),e}(Wp),qp=function(t){function e(e,i,n,s){var a;return(a=t.call(this,e,i,n)||this).inputSource=s,a}return j(e,t),e}(Wp),Yp=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&&(pp.isPointerLocked()||(this._calcMouseCoords(t),null!==up&&this._onElementMouseEvent("mouseup",t)))},e._handleDown=function(t){this._enabled&&(pp.isPointerLocked()||(this._calcMouseCoords(t),null!==up&&this._onElementMouseEvent("mousedown",t)))},e._handleMove=function(t){this._enabled&&(this._calcMouseCoords(t),null!==up&&(this._onElementMouseEvent("mousemove",t),this._lastX=up,this._lastY=dp))},e._handleWheel=function(t){this._enabled&&(this._calcMouseCoords(t),null!==up&&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 Xp(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,up,dp)));r--);i&&(this._fireEvent(t,new Hp(e,i,s,up,dp,this._lastX,this._lastY)),this._hoveredElement=i,"mousedown"===t&&(this._pressedElement=i)),n!==this._hoveredElement&&(n&&this._fireEvent("mouseleave",new Hp(e,n,s,up,dp,this._lastX,this._lastY)),this._hoveredElement&&this._fireEvent("mouseenter",new Hp(e,this._hoveredElement,s,up,dp,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 Hp(e,this._hoveredElement,s,up,dp,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(xp,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 qp(i,r,a,e)),s&&this._fireEvent("selectenter",new qp(i,s,a,e))),"selectstart"===t&&(this._selectedPressedElements[e.id]=s,s&&this._fireEvent("selectstart",new qp(i,s,a,e)));var l=this._selectedPressedElements[e.id];!e.elementInput&&l&&(delete this._selectedPressedElements[e.id],r&&this._fireEvent("selectend",new qp(i,r,a,e))),"selectend"===t&&e.elementInput&&(delete this._selectedPressedElements[e.id],r&&this._fireEvent("selectend",new qp(i,r,a,e)),l&&l===r&&this._fireEvent("click",new qp(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?(up=null,dp=null):(up=t.clientX-i,dp=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,yp)?yp: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||Vp;Dp.copy(t.entity.up),kp.copy(Dp).mulScalar(-1),Fp.copy(t.entity.right),Op.copy(Fp).mulScalar(-1),Dp.mulScalar(r.w*n),kp.mulScalar(r.y*n),Fp.mulScalar(r.z*i),Op.mulScalar(r.x*i),Bp.copy(a[0]).add(kp).add(Op),Np.copy(a[1]).add(kp).add(Fp),Up.copy(a[2]).add(Dp).add(Fp),zp.copy(a[3]).add(Dp).add(Op),a=[Bp,Np,Up,zp]}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(Lp.set(i,i,i);e&&!e.screen;)Lp.mul(e.getLocalScale()),e=e.parent;return Lp},e._calculateScaleToWorld=function(t){var e=t.entity;for(Lp.set(1,1,1);e;)Lp.mul(e.getLocalScale()),e=e.parent;return Lp},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,_p),i.screenToWorld(d,f,i.farClip,gp),n.origin.copy(_p),n.direction.set(0,0,-1),n.end.copy(gp),!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){bp.sub2(e,t),Sp.sub2(i[0],t),wp.sub2(i[1],t),Tp.sub2(i[2],t),Mp.cross(Tp,bp);var n,s,a=Sp.dot(Mp);if(a>=0){if((n=-wp.dot(Mp))<0)return-1;if((s=Gp(bp,wp,Sp))<0)return-1;var r=1/(n+a+s);Cp.copy(i[0]).mulScalar(n*r),Ep.copy(i[1]).mulScalar(a*r),Pp.copy(i[2]).mulScalar(s*r),Rp.copy(Cp).add(Ep).add(Pp)}else{if(Ap.sub2(i[3],t),(n=Ap.dot(Mp))<0)return-1;if((s=Gp(bp,Sp,Ap))<0)return-1;var o=1/(n+(a=-a)+s);Cp.copy(i[0]).mulScalar(n*o),Ep.copy(i[3]).mulScalar(a*o),Pp.copy(i[2]).mulScalar(s*o),Rp.copy(Cp).add(Ep).add(Pp)}return bp.sub2(i[0],i[2]).lengthSq()<1e-8||bp.sub2(i[1],i[3]).lengthSq()<1e-8?-1:Rp.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||da()},set:function(t){this._app=t}}]),t}(),jp={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"]}},Kp={"Product: 0268":"PS3"},Zp=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 jp[Kp[e]];return jp.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.prevAnim,this.blending&&(this.blend=0,this.blendSpeed=1/e),this.skeleton&&(this.blending?(this.fromSkel.animation=i,this.fromSkel.addTime(this.skeleton._time),this.toSkel.animation=n):this.skeleton.animation=n),this.animEvaluator){var s=this.animEvaluator;if(this.blending)for(;s.clips.length>1;)s.removeClip(0);else this.animEvaluator.removeClips();var a=new Cc(this.animations[this.currAnim],0,1,!0,this.loop);a.name=this.currAnim,a.blendWeight=this.blending?0:1,a.reset(),this.animEvaluator.addClip(a)}}this.playing=!0}},i.getAnimation=function(t){return this.animations[t]},i.setModel=function(t){t!==this.model&&(this._resetAnimationController(),this.model=t,this.animations&&this.currAnim&&this.animations[this.currAnim]&&this.play(this.currAnim))},i.onSetAnimations=function(){var t=this.entity.model;if(t){var e=t.model;e&&e!==this.model&&this.setModel(e)}if(!this.currAnim&&this.activate&&this.enabled&&this.entity.enabled){var i=Object.keys(this._animations);i.length>0&&this.play(i[0])}},i._resetAnimationController=function(){this.skeleton=null,this.fromSkel=null,this.toSkel=null,this.animEvaluator=null},i._createAnimationController=function(){var t=this.model,e=this.animations,i=!1,n=!1;for(var s in e){if(e.hasOwnProperty(s))e[s].constructor===su?n=!0:i=!0}var a=t.getGraph();i?(this.fromSkel=new wc(a),this.toSkel=new wc(a),this.skeleton=new wc(a),this.skeleton.looping=this.loop,this.skeleton.setGraph(a)):n&&(this.animEvaluator=new eu(new au(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.onBeforeRemove=function(){for(var t=0;t=1&&(this.blend=1)),this.playing){var e=this.skeleton;if(null!==e&&null!==this.model){if(this.blending)e.blend(this.fromSkel,this.toSkel,this.blend);else{var i=t*this.speed;e.addTime(i),(this.speed>0&&e._time===e.animation.duration&&!this.loop||this.speed<0&&0===e._time&&!this.loop)&&(this.playing=!1)}this.blending&&1===this.blend&&(e.animation=this.toSkel.animation),e.updateGraph()}}var n=this.animEvaluator;if(n){for(var s=0;s1&&(n.clips[1].blendWeight=this.blend),n.update(t)}this.blending&&1===this.blend&&(this.blending=!1)},q(e,[{key:"animations",get:function(){return this._animations},set:function(t){this._animations=t,this.onSetAnimations()}},{key:"assets",get:function(){return this._assets},set:function(t){var e=this._assets;if(e&&e.length)for(var i=0;i0)return t[t.length-1].time}return 0},set:function(t){if(this.skeleton&&(this.skeleton.currentTime=t,this.skeleton.addTime(0),this.skeleton.updateGraph()),this.animEvaluator)for(var e=this.animEvaluator.clips,i=0;i1){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 _t:a=this._setter(t,i,e._packVec2),r="vector",o=2;break;case pt:a=this._setter(t,i,e._packVec3),r="vector",o=3;break;case gt:a=this._setter(t,i,e._packVec4),r="vector",o=4;break;case ct:a=this._setter(t,i,e._packColor),r="vector",o=4;break;case Tt:a=this._setter(t,i,e._packQuat),r="quaternion",o=4;break;default:return null}return-1!==i.indexOf("material")?new iu((function(e){a(e),t.material.update()}),r,o,n):new iu(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}(Nh),_m=function(){this.enabled=!0},gm=["enabled"],vm=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="anim",i.ComponentType=mm,i.DataType=_m,i.schema=gm,i.on("beforeremove",i.onBeforeRemove,Z(i)),i.app.systems.on("animationUpdate",i.onAnimationUpdate,Z(i)),i}j(e,t);var i=e.prototype;return i.initializeComponentData=function(e,i,n){t.prototype.initializeComponentData.call(this,e,i,gm);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}(im);Nh._buildAccessors(mm.prototype,gm);var ym=function(t){function e(e,i){return t.call(this,e,i)||this}j(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}(Nh),xm=function(){this.enabled=!0},bm=["enabled"],Sm=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="audiolistener",i.ComponentType=ym,i.DataType=xm,i.schema=bm,i.manager=e.soundManager,i.current=null,i.app.systems.on("update",i.onUpdate,Z(i)),i}j(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}(im);Nh._buildAccessors(ym.prototype,bm);var wm=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}j(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 ct(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}(Nh);function Gm(t){return new ct(t.r,t.g,t.b)}var Wm=function(){this.enabled=!0,this.active=!0,this.imageEntity=null,this.hitPadding=new gt,this.transitionMode=0,this.hoverTint=new ct(.75,.75,.75),this.pressedTint=new ct(.5,.5,.5),this.inactiveTint=new ct(.25,.25,.25),this.fadeDuration=0,this.hoverSpriteAsset=null,this.hoverSpriteFrame=0,this.pressedSpriteAsset=null,this.pressedSpriteFrame=0,this.inactiveSpriteAsset=null,this.inactiveSpriteFrame=0},Hm=["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"],Xm=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="button",i.ComponentType=Vm,i.DataType=Wm,i.schema=Hm,i.on("beforeremove",i._onRemoveComponent,Z(i)),i.app.systems.on("update",i.onUpdate,Z(i)),i}j(e,t);var i=e.prototype;return i.initializeComponentData=function(e,i,n){t.prototype.initializeComponentData.call(this,e,i,Hm)},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}(im);Nh._buildAccessors(Vm.prototype,Hm);var qm,Ym,jm,Km=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}j(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 Mh&&(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 Mh&&(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}(),n_=new wt,s_=new pt,a_=new Tt,r_=new on,o_=["enabled","type","halfExtents","radius","axis","height","asset","renderAsset","shape","model","render"],h_=function(){function t(t){this.system=t}var e=t.prototype;return e.beforeInitialize=function(t,e){e.shape=null,e.model=new Jo,e.model.graph=new on},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 i_(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}(),l_=function(t){function e(){return t.apply(this,arguments)||this}return j(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}(h_),c_=function(t){function e(){return t.apply(this,arguments)||this}return j(e,t),e.prototype.createPhysicalShape=function(t,e){if("undefined"!=typeof Ammo)return new Ammo.btSphereShape(e.radius)},e}(h_),u_=function(t){function e(){return t.apply(this,arguments)||this}return j(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}(h_),d_=function(t){function e(){return t.apply(this,arguments)||this}return j(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}(h_),f_=function(t){function e(){return t.apply(this,arguments)||this}return j(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}(h_),p_=function(t){function e(){return t.apply(this,arguments)||this}j(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){var s=e.calculatedWidth/e.calculatedHeight;e.fitMode===Lm&&s>this._targetAspectRatio||e.fitMode===Dm&&s0&&(this._targetAspectRatio=i.rect.z/i.rect.w)}this.mesh=t?e:this._defaultMesh,this.refreshMesh()},e.refreshMesh=function(){this.mesh&&(this._element._beingInitialized?this._meshDirty=!0:this._updateMesh(this.mesh))},e._updateAabb=function(t){return t.center.set(0,0,0),t.halfExtents.set(.5*this._outerScale.x,.5*this._outerScale.y,.001),t.setFromTransformedAabb(t,this._renderable.node.getWorldTransform()),t},e._toggleMask=function(){this._element._dirtifyMask();var t=this._element._isScreenSpace();this._updateMaterial(t),this._renderable.setMask(!!this._mask)},e._onMaterialLoad=function(t){this.material=t.resource},e._onMaterialAdded=function(t){this._system.app.assets.off("add:"+t.id,this._onMaterialAdded,this),this._materialAsset===t.id&&this._bindMaterialAsset(t)},e._bindMaterialAsset=function(t){this._entity.enabled&&(t.on("load",this._onMaterialLoad,this),t.on("change",this._onMaterialChange,this),t.on("remove",this._onMaterialRemove,this),t.resource?this._onMaterialLoad(t):this._system.app.assets.load(t))},e._unbindMaterialAsset=function(t){t.off("load",this._onMaterialLoad,this),t.off("change",this._onMaterialChange,this),t.off("remove",this._onMaterialRemove,this)},e._onMaterialChange=function(){},e._onMaterialRemove=function(){},e._onTextureAdded=function(t){this._system.app.assets.off("add:"+t.id,this._onTextureAdded,this),this._textureAsset===t.id&&this._bindTextureAsset(t)},e._bindTextureAsset=function(t){this._entity.enabled&&(t.on("load",this._onTextureLoad,this),t.on("change",this._onTextureChange,this),t.on("remove",this._onTextureRemove,this),t.resource?this._onTextureLoad(t):this._system.app.assets.load(t))},e._unbindTextureAsset=function(t){t.off("load",this._onTextureLoad,this),t.off("change",this._onTextureChange,this),t.off("remove",this._onTextureRemove,this)},e._onTextureLoad=function(t){this.texture=t.resource},e._onTextureChange=function(t){},e._onTextureRemove=function(t){},e._onSpriteAssetAdded=function(t){this._system.app.assets.off("add:"+t.id,this._onSpriteAssetAdded,this),this._spriteAsset===t.id&&this._bindSpriteAsset(t)},e._bindSpriteAsset=function(t){this._entity.enabled&&(t.on("load",this._onSpriteAssetLoad,this),t.on("change",this._onSpriteAssetChange,this),t.on("remove",this._onSpriteAssetRemove,this),t.resource?this._onSpriteAssetLoad(t):this._system.app.assets.load(t))},e._unbindSpriteAsset=function(t){t.off("load",this._onSpriteAssetLoad,this),t.off("change",this._onSpriteAssetChange,this),t.off("remove",this._onSpriteAssetRemove,this),t.data.textureAtlasAsset&&this._system.app.assets.off("load:"+t.data.textureAtlasAsset,this._onTextureAtlasLoad,this)},e._onSpriteAssetLoad=function(t){if(t&&t.resource)if(t.resource.atlas)this.sprite=t.resource;else{var e=t.data.textureAtlasAsset;if(e){var i=this._system.app.assets;i.off("load:"+e,this._onTextureAtlasLoad,this),i.once("load:"+e,this._onTextureAtlasLoad,this)}}else this.sprite=null},e._onSpriteAssetChange=function(t){this._onSpriteAssetLoad(t)},e._onSpriteAssetRemove=function(t){},e._bindSprite=function(t){t.on("set:meshes",this._onSpriteMeshesChange,this),t.on("set:pixelsPerUnit",this._onSpritePpuChange,this),t.on("set:atlas",this._onAtlasTextureChange,this),t.atlas&&t.atlas.on("set:texture",this._onAtlasTextureChange,this)},e._unbindSprite=function(t){t.off("set:meshes",this._onSpriteMeshesChange,this),t.off("set:pixelsPerUnit",this._onSpritePpuChange,this),t.off("set:atlas",this._onAtlasTextureChange,this),t.atlas&&t.atlas.off("set:texture",this._onAtlasTextureChange,this)},e._onSpriteMeshesChange=function(){this._sprite&&(this._spriteFrame=ot.clamp(this._spriteFrame,0,this._sprite.frameKeys.length-1)),this._updateSprite()},e._onSpritePpuChange=function(){0!==this.sprite.renderMode&&null===this._pixelsPerUnit&&this._updateSprite()},e._onAtlasTextureChange=function(){this.sprite&&this.sprite.atlas&&this.sprite.atlas.texture?(this._renderable.setParameter("texture_emissiveMap",this._sprite.atlas.texture),this._renderable.setParameter("texture_opacityMap",this._sprite.atlas.texture)):(this._renderable.deleteParameter("texture_emissiveMap"),this._renderable.deleteParameter("texture_opacityMap"))},e._onTextureAtlasLoad=function(t){var e=this._spriteAsset;e instanceof Mh?this._onSpriteAssetLoad(e):this._onSpriteAssetLoad(this._system.app.assets.get(e))},e.onEnable=function(){if(this._materialAsset){var t=this._system.app.assets.get(this._materialAsset);t&&t.resource!==this._material&&this._bindMaterialAsset(t)}if(this._textureAsset){var e=this._system.app.assets.get(this._textureAsset);e&&e.resource!==this._texture&&this._bindTextureAsset(e)}if(this._spriteAsset){var i=this._system.app.assets.get(this._spriteAsset);i&&i.resource!==this._sprite&&this._bindSpriteAsset(i)}this._element.addModelToLayers(this._renderable.model)},e.onDisable=function(){this._element.removeModelFromLayers(this._renderable.model)},e._setStencil=function(t){this._renderable.meshInstance.stencilFront=t,this._renderable.meshInstance.stencilBack=t;var e=0;if(this._element.maskedBy&&(e=this._element.maskedBy.element._image._maskRef),this._renderable.unmaskMeshInstance){var i=new gc({ref:e+1,func:2,zpass:5});this._renderable.unmaskMeshInstance.stencilFront=i,this._renderable.unmaskMeshInstance.stencilBack=i}},q(t,[{key:"color",get:function(){return this._color},set:function(t){var e=t.r,i=t.g,n=t.b;this._color.r===e&&this._color.g===i&&this._color.b===n||(this._color.r=e,this._color.g=i,this._color.b=n,this._colorUniform[0]=e,this._colorUniform[1]=i,this._colorUniform[2]=n,this._renderable.setParameter("material_emissive",this._colorUniform)),this._element&&this._element.fire("set:color",this._color)}},{key:"opacity",get:function(){return this._color.a},set:function(t){t!==this._color.a&&(this._color.a=t,this._renderable.setParameter("material_opacity",t)),this._element&&this._element.fire("set:opacity",t)}},{key:"rect",get:function(){return this._rect},set:function(t){var e,i,n,s;t instanceof gt?(e=t.x,i=t.y,n=t.z,s=t.w):(e=t[0],i=t[1],n=t[2],s=t[3]),e===this._rect.x&&i===this._rect.y&&n===this._rect.z&&s===this._rect.w||(this._rect.set(e,i,n,s),this._renderable.mesh&&(this._element._beingInitialized?this._meshDirty=!0:this._updateMesh(this._renderable.mesh)))}},{key:"material",get:function(){return this._material},set:function(t){if(this._material!==t){if(!t){var e=this._element._isScreenSpace();t=this.mask?e?this._system.defaultScreenSpaceImageMaskMaterial:this._system.defaultImageMaskMaterial:e?this._system.defaultScreenSpaceImageMaterial:this._system.defaultImageMaterial}this._material=t,t&&(this._renderable.setMaterial(t),this._hasUserMaterial()?(this._renderable.deleteParameter("material_opacity"),this._renderable.deleteParameter("material_emissive")):(this._colorUniform[0]=this._color.r,this._colorUniform[1]=this._color.g,this._colorUniform[2]=this._color.b,this._renderable.setParameter("material_emissive",this._colorUniform),this._renderable.setParameter("material_opacity",this._color.a)))}}},{key:"materialAsset",get:function(){return this._materialAsset},set:function(t){var e=this._system.app.assets,i=t;if(t instanceof Mh&&(i=t.id),this._materialAsset!==i){if(this._materialAsset){e.off("add:"+this._materialAsset,this._onMaterialAdded,this);var n=e.get(this._materialAsset);n&&(n.off("load",this._onMaterialLoad,this),n.off("change",this._onMaterialChange,this),n.off("remove",this._onMaterialRemove,this))}if(this._materialAsset=i,this._materialAsset){var s=e.get(this._materialAsset);s?this._bindMaterialAsset(s):(this.material=null,e.on("add:"+this._materialAsset,this._onMaterialAdded,this))}else this.material=null}}},{key:"texture",get:function(){return this._texture},set:function(t){if(this._texture!==t){if(this._textureAsset){var e=this._system.app.assets.get(this._textureAsset);e&&e.resource!==t&&(this.textureAsset=null)}if(this._texture=t,t){this._spriteAsset&&(this.spriteAsset=null),this._renderable.setParameter("texture_emissiveMap",this._texture),this._renderable.setParameter("texture_opacityMap",this._texture),this._colorUniform[0]=this._color.r,this._colorUniform[1]=this._color.g,this._colorUniform[2]=this._color.b,this._renderable.setParameter("material_emissive",this._colorUniform),this._renderable.setParameter("material_opacity",this._color.a);var i=this._texture.width/this._texture.height;i!=this._targetAspectRatio&&(this._targetAspectRatio=i,this._element.fitMode!==Im&&this.refreshMesh())}else this._renderable.deleteParameter("texture_emissiveMap"),this._renderable.deleteParameter("texture_opacityMap"),this._targetAspectRatio=-1,this._element.fitMode!==Im&&this.refreshMesh()}}},{key:"textureAsset",get:function(){return this._textureAsset},set:function(t){var e=this._system.app.assets,i=t;if(t instanceof Mh&&(i=t.id),this._textureAsset!==i){if(this._textureAsset){e.off("add:"+this._textureAsset,this._onTextureAdded,this);var n=e.get(this._textureAsset);n&&(n.off("load",this._onTextureLoad,this),n.off("change",this._onTextureChange,this),n.off("remove",this._onTextureRemove,this))}if(this._textureAsset=i,this._textureAsset){var s=e.get(this._textureAsset);s?this._bindTextureAsset(s):(this.texture=null,e.on("add:"+this._textureAsset,this._onTextureAdded,this))}else this.texture=null}}},{key:"spriteAsset",get:function(){return this._spriteAsset},set:function(t){var e=this._system.app.assets,i=t;if(t instanceof Mh&&(i=t.id),this._spriteAsset!==i){if(this._spriteAsset){e.off("add:"+this._spriteAsset,this._onSpriteAssetAdded,this);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}this._element&&this._element.fire("set:spriteAsset",i)}},{key:"sprite",get:function(){return this._sprite},set:function(t){if(this._sprite!==t){if(this._sprite&&this._unbindSprite(this._sprite),this._spriteAsset){var e=this._system.app.assets.get(this._spriteAsset);e&&e.resource!==t&&(this.spriteAsset=null)}this._sprite=t,this._sprite&&(this._bindSprite(this._sprite),this._textureAsset&&(this.textureAsset=null)),this._sprite&&this._sprite.atlas&&this._sprite.atlas.texture?(this._renderable.setParameter("texture_emissiveMap",this._sprite.atlas.texture),this._renderable.setParameter("texture_opacityMap",this._sprite.atlas.texture)):(this._renderable.deleteParameter("texture_emissiveMap"),this._renderable.deleteParameter("texture_opacityMap")),this._sprite&&(this._spriteFrame=ot.clamp(this._spriteFrame,0,this._sprite.frameKeys.length-1)),this._updateSprite()}}},{key:"spriteFrame",get:function(){return this._spriteFrame},set:function(t){var e=this._spriteFrame;this._sprite?this._spriteFrame=ot.clamp(t,0,this._sprite.frameKeys.length-1):this._spriteFrame=t,this._spriteFrame!==e&&this._updateSprite(),this._element&&this._element.fire("set:spriteFrame",t)}},{key:"mesh",get:function(){return this._renderable.mesh},set:function(t){this._renderable.setMesh(t),this._defaultMesh===t?this._renderable.setAabbFunc(null):this._renderable.setAabbFunc(this._updateAabbFunc)}},{key:"mask",get:function(){return this._mask},set:function(t){this._mask!==t&&(this._mask=t,this._toggleMask())}},{key:"pixelsPerUnit",get:function(){return this._pixelsPerUnit},set:function(t){this._pixelsPerUnit!==t&&(this._pixelsPerUnit=t,!this._sprite||1!==this._sprite.renderMode&&2!==this._sprite.renderMode||this._updateSprite())}},{key:"aabb",get:function(){return this._renderable.meshInstance?this._renderable.meshInstance.aabb:null}}]),t}(),y_=/[A-Z|a-z|0-9|_|-|/]/,x_=function(){function t(t){this._symbols=t,this._index=0,this._last=0,this._cur=this._symbols.length>0?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"\\":if(this._next(),"["===this._cur)this._store();else 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(y_)},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 S_(t,e){for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];n instanceof Object?(t.hasOwnProperty(i)||(t[i]={}),S_(t[i],e[i])):t[i]=n}}function w_(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;)C_.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],C_.test(y))_++,(!this._wrapLines||this._maxLines<0||c0){var z=this._font.data.kerning;if(z){var V=z[W.getCodePoint(this._symbols[L-1])||0];V&&(U=V[W.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 G=E_.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&&(nt=Math.floor(this._element.fontSize*this._element.calculatedWidth/(this.width||1e-4)),(nt=ot.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=ot.clamp(this._fontSize-1,i,n))!==this._element.fontSize){this._fontSize=nt,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 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 _t?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)&&(null==(t=this.system.app.batcher)||t.insert(Oa.ELEMENT,this.batchGroupId,this.entity));this.fire("enableelement")},i.onDisable=function(){var t;(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)&&(null==(t=this.system.app.batcher)||t.remove(Oa.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 gt?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){if(this._batchGroupId!==t){var e,i;if(this.entity.enabled&&this._batchGroupId>=0)null==(e=this.system.app.batcher)||e.remove(Oa.ELEMENT,this.batchGroupId,this.entity);if(this.entity.enabled&&t>=0)null==(i=this.system.app.batcher)||i.insert(Oa.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 gt?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),void 0!==i.fitMode&&(e.fitMode=i.fitMode),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===Pm?(void 0!==i.rect&&(e.rect=i.rect),void 0!==i.color&&((s=i.color)instanceof ct||(s=new ct(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===Rm&&(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 ct||(s=new ct(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===Pm&&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,fitMode:i.fitMode,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 ls,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 ls,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 ls,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 ls,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 ls;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}(im);Nh._buildAccessors(H_.prototype,Y_);var K_="free",Z_="limited",$_="locked",Q_=["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"],J_=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=$_,n._linearLimitsX=new _t(0,0),n._linearSpringX=!1,n._linearStiffnessX=0,n._linearDampingX=1,n._linearEquilibriumX=0,n._linearMotionY=$_,n._linearLimitsY=new _t(0,0),n._linearSpringY=!1,n._linearStiffnessY=0,n._linearDampingY=1,n._linearEquilibriumY=0,n._linearMotionZ=$_,n._linearLimitsZ=new _t(0,0),n._linearSpringZ=!1,n._linearStiffnessZ=0,n._linearDampingZ=1,n._linearEquilibriumZ=0,n._angularMotionX=$_,n._angularLimitsX=new _t(0,0),n._angularSpringX=!1,n._angularStiffnessX=0,n._angularDampingX=1,n._angularEquilibriumX=0,n._angularMotionY=$_,n._angularLimitsY=new _t(0,0),n._angularSpringY=!1,n._angularStiffnessY=0,n._angularDampingY=1,n._angularEquilibriumY=0,n._angularMotionZ=$_,n._angularLimitsZ=new _t(0,0),n._angularSpringZ=!1,n._angularEquilibriumZ=0,n._angularDampingZ=1,n._angularStiffnessZ=0,n.on("set_enabled",n._onSetEnabled,Z(n)),n}j(e,t);var i=e.prototype;return i._convertTransform=function(t,e){var i=t.getTranslation(),n=new Tt;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===Z_?(e=this._angularLimitsX.x*ot.DEG_TO_RAD,s=this._angularLimitsX.y*ot.DEG_TO_RAD):this._angularMotionX===K_?(e=1,s=0):e=s=0,this._angularMotionY===Z_?(i=this._angularLimitsY.x*ot.DEG_TO_RAD,a=this._angularLimitsY.y*ot.DEG_TO_RAD):this._angularMotionY===K_?(i=1,a=0):i=a=0,this._angularMotionZ===Z_?(n=this._angularLimitsZ.x*ot.DEG_TO_RAD,r=this._angularLimitsZ.y*ot.DEG_TO_RAD):this._angularMotionZ===K_?(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===Z_?(e=this._linearLimitsX.x,s=this._linearLimitsX.y):this._linearMotionX===K_?(e=1,s=0):e=s=0,this._linearMotionY===Z_?(i=this._linearLimitsY.x,a=this._linearLimitsY.y):this._linearMotionY===K_?(i=1,a=0):i=a=0,this._linearMotionZ===Z_?(n=this._linearLimitsZ.x,r=this._linearLimitsZ.y):this._linearMotionZ===K_?(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 wt,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(Q_);!(e=i()).done;){var n=e.value;t.hasOwnProperty(n)&&(t[n]instanceof _t?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}(Nh),tg={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(J_.prototype,n,{get:function(){return this[s]},set:function(t){this[s]!==t&&(this[s]=t,this._constraint[tg[e]](a,t))}})}))}))}));var eg=function(){this.enabled=!0},ig=["enabled"],ng=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="joint",i.app=e,i.ComponentType=J_,i.DataType=eg,i.schema=ig,i}return j(e,t),e.prototype.initializeComponentData=function(t,e,i){t.initFromData(e)},e}(im);Nh._buildAccessors(J_.prototype,ig);var sg=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 j(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}(Nh),ag=function(){this.enabled=!0},rg=["enabled"],og=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="layoutchild",i.ComponentType=sg,i.DataType=ag,i.schema=rg,i}j(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}(im);Nh._buildAccessors(sg.prototype,rg);var hg={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"}},lg={0:1,1:0},cg={minWidth:0,minHeight:0,maxWidth:Number.POSITIVE_INFINITY,maxHeight:Number.POSITIVE_INFINITY,width:null,height:null,fitWidthProportion:0,fitHeightProportion:0},ug="NONE",dg="APPLY_STRETCHING",fg="APPLY_SHRINKING",pg=new _t;function mg(t){var e,i=hg[t],n=hg[lg[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 ug;case 1:return e=i?fg:ug;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,pg.x=e.containerSize.x-e.padding.x-e.padding.z,pg.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>pg[i.axis]&&0!==n[n.length-1].length&&(a=h,n.push([])),n[n.length-1].push(t[o]),r&&a>pg[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,pg[n.axis]);m===dg?c(a,p,n):m===fg&&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}(im);Nh._buildAccessors(xg.prototype,Sg);var Tg=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._type="asset",n._asset=null,n._model=null,n._mapping={},n._castShadows=!0,n._receiveShadows=!0,n._materialAsset=null,n._material=void 0,n._castShadowsLightmap=!0,n._lightmapped=!1,n._lightmapSizeMultiplier=1,n._isStatic=!1,n._layers=[0],n._batchGroupId=-1,n._customAabb=null,n._area=null,n._materialEvents=null,n._clonedModel=!1,n._material=e.defaultMaterial,i.on("remove",n.onRemoveChild,Z(n)),i.on("removehierarchy",n.onRemoveChild,Z(n)),i.on("insert",n.onInsertChild,Z(n)),i.on("inserthierarchy",n.onInsertChild,Z(n)),n}j(e,t);var i=e.prototype;return i.addModelToLayers=function(){for(var t=this.system.app.scene.layers,e=0;e=0&&(null==(n=t.batcher)||n.insert(Oa.MODEL,this.batchGroupId,this.entity))},i.onDisable=function(){var t,e=this.system.app,i=e.scene;(i.off("set:layers",this.onLayersChanged,this),i.layers&&(i.layers.off("add",this.onLayerAdded,this),i.layers.off("remove",this.onLayerRemoved,this)),this._batchGroupId>=0)&&(null==(t=e.batcher)||t.remove(Oa.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)null==(e=this.system.app.batcher)||e.remove(Oa.MODEL,this.batchGroupId,this.entity);if(this.entity.enabled&&t>=0)null==(i=this.system.app.batcher)||i.insert(Oa.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 Mh&&(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))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 ga||(s=null),this.emitter=new hc(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;v=0&&(null==(i=t.batcher)||i.insert(Oa.RENDER,this.batchGroupId,this.entity))},i.onDisable=function(){var t,e=this.system.app,i=e.scene;(i.off("set:layers",this.onLayersChanged,this),i.layers&&(i.layers.off("add",this.onLayerAdded,this),i.layers.off("remove",this.onLayerRemoved,this)),this._batchGroupId>=0)&&(null==(t=e.batcher)||t.remove(Oa.RENDER,this.batchGroupId,this.entity));this.removeFromLayers()},i.hide=function(){if(this._meshInstances)for(var t=0;t=0)null==(e=this.system.app.batcher)||e.remove(Oa.RENDER,this.batchGroupId,this.entity);if(this.entity.enabled&&t>=0)null==(i=this.system.app.batcher)||i.insert(Oa.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;ethis._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}(),Zg=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._angularDamping=0,n._angularFactor=new pt(1,1,1),n._angularVelocity=new pt,n._body=null,n._friction=.5,n._group=2,n._linearDamping=0,n._linearFactor=new pt(1,1,1),n._linearVelocity=new pt,n._mask=e_,n._mass=1,n._restitution=0,n._rollingFriction=0,n._simulationEnabled=!1,n._type=$m,n}j(e,t),e.onLibraryLoaded=function(){"undefined"==typeof Ammo||Gg||(Gg=new Ammo.btTransform,Wg=new Ammo.btVector3,Hg=new Ammo.btVector3,Xg=new Ammo.btQuaternion,qg=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===Qm?this._mass:0;this._getEntityTransform(Gg);var n=this.system.createBody(i,t,Gg);if(n.setRestitution(this._restitution),n.setFriction(this._friction),n.setRollingFriction(this._rollingFriction),n.setDamping(this._linearDamping,this._angularDamping),this._type===Qm){var s=this._linearFactor;Wg.setValue(s.x,s.y,s.z),n.setLinearFactor(Wg);var a=this._angularFactor;Wg.setValue(a.x,a.y,a.z),n.setAngularFactor(Wg)}else this._type===Jm&&(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 Qm:this.system._dynamic.push(this),e.forceActivationState(1),this.syncEntityToBody();break;case Jm:this.system._kinematic.push(this),e.forceActivationState(4);break;case $m: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(),Wg.setValue(t,e,i),void 0!==n?(Hg.setValue(n,s,a),r.applyForce(Wg,Hg)):r.applyForce(Wg,qg))},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(),Wg.setValue(t,e,i),n.applyTorque(Wg))},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(),Wg.setValue(t,e,i),void 0!==n?(Hg.setValue(n,s,a),r.applyImpulse(Wg,Hg)):r.applyImpulse(Wg,qg))},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(),Wg.setValue(t,e,i),n.applyTorqueImpulse(Wg))},i.isStatic=function(){return this._type===$m},i.isStaticOrKinematic=function(){return this._type===$m||this._type===Jm},i.isKinematic=function(){return this._type===Jm},i._getEntityTransform=function(t){var e=this.entity,i=e.getPosition(),n=e.getRotation();Wg.setValue(i.x,i.y,i.z),Xg.setValue(n.x,n.y,n.z,n.w),t.setOrigin(Wg),t.setRotation(Xg)},i.syncEntityToBody=function(){var t=this._body;if(t){if(this._getEntityTransform(Gg),t.setWorldTransform(Gg),this._type===Jm){var e=t.getMotionState();e&&e.setWorldTransform(Gg)}t.activate()}},i._updateDynamic=function(){var t=this._body;if(t.isActive()){var e=t.getMotionState();if(e){e.getWorldTransform(Gg);var i=Gg.getOrigin(),n=Gg.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(Gg),t.setWorldTransform(Gg))},i.teleport=function(){arguments.length<3?(arguments[0]&&this.entity.setPosition(arguments[0]),arguments[1]&&(arguments[1]instanceof Tt?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===Qm&&(Wg.setValue(t.x,t.y,t.z),this._body.setAngularFactor(Wg)))}},{key:"angularVelocity",get:function(){if(this._body&&this._type===Qm){var t=this._body.getAngularVelocity();this._angularVelocity.set(t.x(),t.y(),t.z())}return this._angularVelocity},set:function(t){this._body&&this._type===Qm&&(this._body.activate(),Wg.setValue(t.x,t.y,t.z),this._body.setAngularVelocity(Wg),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===Qm&&(Wg.setValue(t.x,t.y,t.z),this._body.setLinearFactor(Wg)))}},{key:"linearVelocity",get:function(){if(this._body&&this._type===Qm){var t=this._body.getLinearVelocity();this._linearVelocity.set(t.x(),t.y(),t.z())}return this._linearVelocity},set:function(t){this._body&&this._type===Qm&&(this._body.activate(),Wg.setValue(t.x,t.y,t.z),this._body.setLinearVelocity(Wg),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===Qm)){var e=this.enabled&&this.entity.enabled;e&&this.disableSimulation(),this._body.getCollisionShape().calculateLocalInertia(t,Wg),this._body.setMassProps(t,Wg),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 Qm:this._group=1,this._mask=t_;break;case Jm:this._group=4,this._mask=t_;break;default:this._group=2,this._mask=e_}this.createBody()}}}]),e}(Nh),$g=function(){this.enabled=!0},Qg=function(t,e,i){this.entity=t,this.point=e,this.normal=i},Jg=function(t,e,i){0===arguments.length?(this.a=null,this.b=null,this.impulse=0,this.localPointA=new pt,this.localPointB=new pt,this.pointA=new pt,this.pointB=new pt,this.normal=new pt):(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)},tv=function(t,e,i,n,s,a){void 0===t&&(t=new pt),void 0===e&&(e=new pt),void 0===i&&(i=new pt),void 0===n&&(n=new pt),void 0===s&&(s=new pt),void 0===a&&(a=0),this.localPoint=t,this.localPointOther=e,this.point=i,this.pointOther=n,this.normal=s,this.impulse=a},ev=function(t,e){this.other=t,this.contacts=e},iv=["enabled"],nv=function(t){function e(e){var i;return(i=t.call(this,e)||this).maxSubSteps=10,i.fixedTimeStep=1/60,i.gravity=new pt(0,-9.81,0),i._dynamic=[],i._kinematic=[],i._triggers=[],i._compounds=[],i.id="rigidbody",i._stats=e.stats.frame,i.ComponentType=Zg,i.DataType=$g,i.contactPointPool=null,i.contactResultPool=null,i.singleContactResultPool=null,i.schema=iv,i.collisions={},i.frameCollisions={},i.on("beforeremove",i.onBeforeRemove,Z(i)),i.on("remove",i.onRemove,Z(i)),i}j(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)}Yg=new Ammo.btVector3,jg=new Ammo.btVector3,Zg.onLibraryLoaded(),this.contactPointPool=new Kg(tv,1),this.contactResultPool=new Kg(ev,1),this.singleContactResultPool=new Kg(Jg,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=[];Yg.setValue(t.x,t.y,t.z),jg.setValue(e.x,e.y,e.z);var n=new Ammo.AllHitsRayResultCallback(Yg,jg);if(this.dynamicsWorld.rayTest(Yg,jg,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&&n!==t.element.drawOrder)null==(i=this.system.app.batcher)||i.markGroupDirty(t.element._batchGroupId)}t.particlesystem&&(t.particlesystem.drawOrder=e++);for(var s=t.children,a=0;a255&&(t=255),this._priority=t}}]),e}(Nh),hv=function(){this.enabled=!0},lv=["enabled"],cv=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="screen",i.ComponentType=ov,i.DataType=hv,i.schema=lv,i.windowResolution=new _t,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}j(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 _t?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 _t?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;e=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,mv),t.data.postInitialized=!0},i._updateInstances=function(t,e,i){for(var n=0,s=e.length;n0){var i=Av.sub(wv).dot(Mv)/e,n=wv.add(Tv.mulScalar(i));return Cv.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?(bv.x=t.x*e,bv.y=t.y*e):t.changedTouches?(bv.x=t.changedTouches[0].x*e,bv.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?(wv.set(bv.x,-bv.y,0),Tv.set(0,0,-1)):(Sv.copy(this._dragCamera.screenToWorld(bv.x,bv.y,1)),wv.copy(this._dragCamera.entity.getPosition()),Tv.copy(Sv).sub(wv).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=Ev[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),Rv=new _t,Iv=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._viewportReference=new Cm(Z(n),"viewportEntity",{"element#gain":n._onViewportElementGain,"element#resize":n._onSetContentOrViewportSize}),n._contentReference=new Cm(Z(n),"contentEntity",{"element#gain":n._onContentElementGain,"element#lose":n._onContentElementLose,"element#resize":n._onSetContentOrViewportSize}),n._scrollbarUpdateFlags={},n._scrollbarReferences={},n._scrollbarReferences[0]=new Cm(Z(n),"horizontalScrollbarEntity",{"scrollbar#set:value":n._onSetHorizontalScrollbarValue,"scrollbar#gain":n._onHorizontalScrollbarGain}),n._scrollbarReferences[1]=new Cm(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 _t,n._velocity=new pt,n._dragStartPosition=new pt,n._disabledContentInput=!1,n._disabledContentInputEntities=[],n._toggleLifecycleListeners("on",e),n._toggleElementListeners("on"),n}j(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](np,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 Pv(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 ot.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:ot.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 Rv.x=0===e?0:t.x/e,Rv.y=0===i?0:t.y/-i,Rv},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=ot.clamp(this._scroll.x+i,0,this._getMaxScrollValue(0)),a=ot.clamp(this._scroll.y+n,0,this._getMaxScrollValue(1));this.scroll=new _t(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=ot.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=ot.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}(Nh),Fv=function(){this.enabled=!0},Bv=[{name:"enabled",type:"boolean"},{name:"orientation",type:"number"},{name:"value",type:"number"},{name:"handleSize",type:"number"},{name:"handleEntity",type:"entity"}],Nv=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="scrollbar",i.ComponentType=Ov,i.DataType=Fv,i.schema=Bv,i.on("beforeremove",i._onRemoveComponent,Z(i)),i}j(e,t);var i=e.prototype;return i.initializeComponentData=function(e,i,n){t.prototype.initializeComponentData.call(this,e,i,Bv)},i._onRemoveComponent=function(t,e){e.onRemove()},e}(im);Nh._buildAccessors(Ov.prototype,Bv);var Uv={volume:0,pitch:0,loop:!1,startTime:0,duration:0,position:new pt,maxDistance:0,refDistance:0,rollOffFactor:0,distanceModel:0,onPlay:null,onPause:null,onResume:null,onStop:null,onEnd:null},zv=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?ot.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 Mh&&(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}j(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 zv?n[t[s].name]=t[s]:t[s].name&&(n[t[s].name]=new zv(this,t[s].name,t[s]));this._slots=n,this.enabled&&this.entity.enabled&&this.onEnable()}}]),e}(Nh),Gv=function(){this.enabled=!0},Wv=["enabled"],Hv=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="sound",i.ComponentType=Vv,i.DataType=Gv,i.schema=Wv,i.manager=e.soundManager,i.app.systems.on("update",i.onUpdate,Z(i)),i.on("beforeremove",i.onBeforeRemove,Z(i)),i}j(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=ot.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 Mh&&(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),jv="texture_emissiveMap",Kv="texture_opacityMap",Zv="material_emissive",$v="material_opacity",Qv=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._type=Xv,n._material=e.defaultMaterial,n._color=new ct(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 _t(1,1),n._outerScaleUniform=new Float32Array(2),n._innerOffset=new gt,n._innerOffsetUniform=new Float32Array(4),n._atlasRect=new gt,n._atlasRectUniform=new Float32Array(4),n._batchGroupId=-1,n._batchGroup=null,n._node=new on,n._model=new Jo,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 Yv(Z(n),{name:n.entity.name,fps:0,loop:!1,spriteAsset:null}),n._currentClip=n._defaultClip,n}j(e,t);var i=e.prototype;return i.onEnable=function(){var t,e=this.system.app,i=e.scene;(i.on("set:layers",this._onLayersChanged,this),i.layers&&(i.layers.on("add",this._onLayerAdded,this),i.layers.on("remove",this._onLayerRemoved,this)),this._showModel(),this._autoPlayClip&&this._tryAutoPlay(),this._batchGroupId>=0)&&(null==(t=e.batcher)||t.insert(Oa.SPRITE,this._batchGroupId,this.entity))},i.onDisable=function(){var t,e=this.system.app,i=e.scene;(i.off("set:layers",this._onLayersChanged,this),i.layers&&(i.layers.off("add",this._onLayerAdded,this),i.layers.off("remove",this._onLayerRemoved,this)),this.stop(),this._hideModel(),this._batchGroupId>=0)&&(null==(t=e.batcher)||t.remove(Oa.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)null==(e=this.system.app.batcher)||e.remove(Oa.SPRITE,n,this.entity);if(this.entity.enabled&&t>=0)null==(i=this.system.app.batcher)||i.insert(Oa.SPRITE,t,this.entity);else n>=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 Yv?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}(Nh),Jv=function(){this.enabled=!0},ty=["enabled"],ey=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="sprite",i.ComponentType=Qv,i.DataType=Jv,i.schema=ty,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}j(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 ct?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 Ui(this.app.graphicsDevice,{width:1,height:1,format:7,name:"sprite"}),e=new Uint8Array(t.lock());e[0]=e[1]=e[2]=e[3]=255,t.unlock();var i=new ls;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}(im);Nh._buildAccessors(Qv.prototype,ty);var iy=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this)._oldState=!0,n._size=new pt,n.on("set_enabled",n._onSetEnabled,Z(n)),n}j(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 pt?this._size.copy(t):t instanceof Array&&t.length>=3&&this.size.set(t[0],t[1],t[2])}}]),e}(Nh),ny=function(){this.enabled=!0},sy=["enabled"],ay=function(t){function e(e){var i;return(i=t.call(this,e)||this).id="zone",i.ComponentType=iy,i.DataType=ny,i.schema=sy,i.on("beforeremove",i._onBeforeRemove,Z(i)),i}j(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 pt?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}(im);Nh._buildAccessors(iy.prototype,sy);var ry=function(t,e){this.effect=t,this.inputTarget=e,this.outputTarget=null,this.name=t.constructor.name},oy=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 Ui(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 Ss({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 ry(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;s0}},{key:"renderSceneDepthMap",get:function(){return this._renderSceneDepthMap>0}},{key:"frustum",get:function(){return this._camera.frustum}},{key:"layers",get:function(){return this._camera.layers},set:function(t){for(var e=this._camera.layers,i=0;i=0&&(this.cameras.splice(e,1),Co(this.cameras))},i.destroy=function(){t.prototype.destroy.call(this),this.app.systems.off("update",this.onUpdate,this)},e}(im);Nh._buildAccessors(ly.prototype,uy);var fy=[],py=[],my=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}j(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;tNumber.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}(im),wy="inline",Ty="immersive-vr",Ay="immersive-ar",My="viewer",Cy="left",Ey="cpu-optimized",Py="gpu-optimized",Ry="luminance-alpha",Iy=[],Ly=[],Dy=function(t){function e(e,i,n){var s;return(s=t.call(this)||this).manager=void 0,s._xrHitTestSource=void 0,s._transient=void 0,s.manager=e,s._xrHitTestSource=i,s._transient=n,s}j(e,t);var i=e.prototype;return i.remove=function(){if(this._xrHitTestSource){var t=this.manager.hitTest.sources,e=t.indexOf(this);-1!==e&&t.splice(e,1),this.onStop()}},i.onStop=function(){this._xrHitTestSource.cancel(),this._xrHitTestSource=null,this.fire("remove"),this.manager.hitTest.fire("remove",this)},i.update=function(t){if(this._transient)for(var e=t.getHitTestResultsForTransientInput(this._xrHitTestSource),i=0;ithis.views.length)for(var a=0;a<=s-this.views.length;a++){var r=this.viewsPool.pop();r||(r={viewport:new gt,projMat:new wt,viewMat:new wt,viewOffMat:new wt,viewInvMat:new wt,viewInvOffMat:new wt,projViewOffMat:new wt,viewMat3:new mt,position:new Float32Array(3),rotation:new Tt}),this.views.push(r)}else if(s<=this.views.length)for(var o=0;o=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