-
Notifications
You must be signed in to change notification settings - Fork 0
/
arcamera.js
1 lines (1 loc) · 7.64 KB
/
arcamera.js
1
var a0_0x226d39=a0_0x1e2b;(function(_0x123f6a,_0x53b649){var _0x395c82=a0_0x1e2b,_0xcd8c51=_0x123f6a();while(!![]){try{var _0x53c00f=parseInt(_0x395c82(0x181))/0x1+-parseInt(_0x395c82(0x195))/0x2*(parseInt(_0x395c82(0x189))/0x3)+parseInt(_0x395c82(0x186))/0x4*(-parseInt(_0x395c82(0x178))/0x5)+parseInt(_0x395c82(0x177))/0x6*(parseInt(_0x395c82(0x170))/0x7)+parseInt(_0x395c82(0x15b))/0x8+parseInt(_0x395c82(0x167))/0x9*(parseInt(_0x395c82(0x159))/0xa)+parseInt(_0x395c82(0x184))/0xb;if(_0x53c00f===_0x53b649)break;else _0xcd8c51['push'](_0xcd8c51['shift']());}catch(_0x238d6c){_0xcd8c51['push'](_0xcd8c51['shift']());}}}(a0_0x135b,0xca1ae));function a0_0x135b(){var _0x3d8244=['clearRect','width','JIuAc','pause','resolve','188736hybSaj','4978205OTjzek','FRAMERATE','getBoundingClientRect','cameraPaused','cBiSE','(((.+)+)+)+$','innerWidth','startWebcam','video','1137978WSHfay','SUBSCRIBED_TRACKERS','getCameraTexture','210221KOpIog','left','4QVtORG','FOV','play','1863sFSPGu','arCamera','innerHeight','setFramerate','SoOzp','getContext','lastDetectTime','style','now','setCamDims','unityInstance','pgSVd','3062QlPntl','setTransform','unityCanvas','videoBackground','ARCamera','position','TYHrp','-100','toString','push','height','search','unityCanvas\x20is\x20null.\x20Please\x20call\x20new\x20ARCamera(unityCanvas,\x20videoBackground)\x20properly\x20before\x20starting\x20the\x20Webcam','apply','videoBackground\x20canvas\x20is\x20null.\x20Please\x20call\x20new\x20ARCamera(unityCanvas,\x20videoBackground)\x20properly\x20before\x20starting\x20the\x20Webcam','20musAkZ','update','2696072mtYtyE','SendMessage','VIDEO','absolute','resizeCanvas','forEach','isCameraStarted','videoHeight','100%','videoWidth','top','constructor','2929482GFRumM','updateUnityVideoTextureCallback','reject','atan','zIndex','lastUpdateTime','drawImage','fVXEf','aeMBW','140UjBTrP','ctx'];a0_0x135b=function(){return _0x3d8244;};return a0_0x135b();}var a0_0x359cd3=(function(){var _0x5a2fb9=!![];return function(_0x27d0de,_0x298f90){var _0x4fc453=_0x5a2fb9?function(){var _0x5e9fc0=a0_0x1e2b;if('pgSVd'!==_0x5e9fc0(0x194)){var _0x4bfafc=_0x271213?function(){var _0x2a705a=_0x5e9fc0;if(_0x565afe){var _0x579acb=_0x496c0a[_0x2a705a(0x157)](_0x205240,arguments);return _0x3fa7a3=null,_0x579acb;}}:function(){};return _0x1d0642=![],_0x4bfafc;}else{if(_0x298f90){if(_0x5e9fc0(0x18d)!==_0x5e9fc0(0x18d)){;return;}else{var _0x25e5c5=_0x298f90[_0x5e9fc0(0x157)](_0x27d0de,arguments);return _0x298f90=null,_0x25e5c5;}}}}:function(){};return _0x5a2fb9=![],_0x4fc453;};}()),a0_0xb1526d=a0_0x359cd3(this,function(){var _0x3f47a4=a0_0x1e2b;return a0_0xb1526d[_0x3f47a4(0x19d)]()[_0x3f47a4(0x1a0)](_0x3f47a4(0x17d))[_0x3f47a4(0x19d)]()[_0x3f47a4(0x166)](a0_0xb1526d)['search'](_0x3f47a4(0x17d));});a0_0xb1526d();function a0_0x1e2b(_0x43c7b7,_0x29a7ea){var _0x429ba6=a0_0x135b();return a0_0x1e2b=function(_0xb1526d,_0x359cd3){_0xb1526d=_0xb1526d-0x156;var _0x135b07=_0x429ba6[_0xb1526d];return _0x135b07;},a0_0x1e2b(_0x43c7b7,_0x29a7ea);}class ARCamera{#p000;[a0_0x226d39(0x182)];constructor(_0x2c0b40,_0x4f4a97){var _0x3cb9e3=a0_0x226d39;this[_0x3cb9e3(0x198)]=_0x4f4a97,this[_0x3cb9e3(0x197)]=_0x2c0b40,this[_0x3cb9e3(0x171)]=_0x4f4a97[_0x3cb9e3(0x18e)]('2d'),this[_0x3cb9e3(0x179)]=0x1e,this[_0x3cb9e3(0x182)]=[];;}['pauseCamera'](){var _0x3f1e00=a0_0x226d39;this[_0x3f1e00(0x17b)]=!![],this[_0x3f1e00(0x15d)][_0x3f1e00(0x175)]();}['unpauseCamera'](){var _0x55435c=a0_0x226d39;this[_0x55435c(0x17b)]=![],this[_0x55435c(0x15d)]['play']();}async[a0_0x226d39(0x17f)](_0x1ac747){var _0x419455=a0_0x226d39;;this[_0x419455(0x15d)]=_0x1ac747;try{if(_0x419455(0x16e)===_0x419455(0x16f))return _0x38fe41[_0x419455(0x19d)]()[_0x419455(0x1a0)](_0x419455(0x17d))[_0x419455(0x19d)]()[_0x419455(0x166)](_0x5e8b14)[_0x419455(0x1a0)](_0x419455(0x17d));else{await _0x1ac747[_0x419455(0x188)]();;if(!this[_0x419455(0x198)]){var _0x555002=_0x419455(0x158);return Promise[_0x419455(0x169)](_0x555002);}else{if(!this[_0x419455(0x197)]){var _0x555002=_0x419455(0x156);return Promise[_0x419455(0x169)](_0x555002);}}return this[_0x419455(0x15f)](),this[_0x419455(0x16c)]=Date[_0x419455(0x191)](),this[_0x419455(0x18f)]=Date[_0x419455(0x191)](),this['lastMatchTrackTime']=Date[_0x419455(0x191)](),this.#p000=setInterval(this.#f000,0x1/this[_0x419455(0x179)]*0x3e8),this[_0x419455(0x161)]=!![],Promise[_0x419455(0x176)]();}}catch(_0x1a3ca9){return Promise[_0x419455(0x169)](_0x1a3ca9);}}#f000(){var _0x56225f=a0_0x226d39;if(arCamera[_0x56225f(0x17b)]){;return;}if(!arCamera[_0x56225f(0x15d)]){;return;}var _0x5041be=arCamera[_0x56225f(0x15d)],_0x19fc03=arCamera[_0x56225f(0x198)],_0x3e4e9a=_0x19fc03[_0x56225f(0x173)]/_0x5041be[_0x56225f(0x164)],_0x3aecad=_0x19fc03[_0x56225f(0x19f)]/_0x5041be[_0x56225f(0x162)],_0x1cf417=Math['max'](_0x3e4e9a,_0x3aecad),_0xe2484=(_0x19fc03[_0x56225f(0x173)]-_0x5041be[_0x56225f(0x164)]*_0x1cf417)/0x2,_0x1f6933=(_0x19fc03['height']-_0x5041be[_0x56225f(0x162)]*_0x1cf417)/0x2;arCamera['ctx'][_0x56225f(0x172)](0x0,0x0,_0x19fc03[_0x56225f(0x173)],_0x19fc03[_0x56225f(0x19f)]),arCamera['ctx'][_0x56225f(0x196)](_0x1cf417,0x0,0x0,_0x1cf417,_0xe2484,_0x1f6933),arCamera['ctx'][_0x56225f(0x16d)](arCamera[_0x56225f(0x15d)],0x0,0x0),arCamera[_0x56225f(0x182)][_0x56225f(0x160)](_0x443e82=>{var _0x51e7cb=_0x56225f;_0x443e82[_0x51e7cb(0x15a)](arCamera[_0x51e7cb(0x180)],arCamera[_0x51e7cb(0x198)]);}),arCamera[_0x56225f(0x168)]&&arCamera[_0x56225f(0x168)]();}['subscribeToWebcamUpdates'](_0x3d8797){var _0x3084c3=a0_0x226d39;if(this[_0x3084c3(0x182)]['includes'](_0x3d8797)){;return;}this[_0x3084c3(0x182)][_0x3084c3(0x19e)](_0x3d8797);}[a0_0x226d39(0x18c)](_0x59de7f){var _0x19cd29=a0_0x226d39;this[_0x19cd29(0x179)]=_0x59de7f,clearInterval(this.#p000),this.#p000=setInterval(this.#f000,0x1/this['FRAMERATE']*0x3e8);}[a0_0x226d39(0x15f)](){var _0x2f0e3a=a0_0x226d39;;if(!window['arCamera'])window[_0x2f0e3a(0x18a)]=this;var _0x47b728=this[_0x2f0e3a(0x198)];if(!_0x47b728)return;;_0x47b728[_0x2f0e3a(0x173)]=window[_0x2f0e3a(0x17e)],_0x47b728[_0x2f0e3a(0x19f)]=window[_0x2f0e3a(0x18b)];var _0x46816e=window['innerWidth']/window[_0x2f0e3a(0x18b)];;this['SUBSCRIBED_TRACKERS'][_0x2f0e3a(0x160)](_0x492929=>{var _0x590188=_0x2f0e3a;if(_0x590188(0x19b)!==_0x590188(0x19b)){;return;}else _0x492929[_0x590188(0x192)](_0x46816e);}),_0x47b728[_0x2f0e3a(0x190)][_0x2f0e3a(0x185)]=0x0,_0x47b728[_0x2f0e3a(0x190)][_0x2f0e3a(0x165)]=0x0,_0x47b728[_0x2f0e3a(0x190)][_0x2f0e3a(0x173)]=_0x2f0e3a(0x163),_0x47b728[_0x2f0e3a(0x190)][_0x2f0e3a(0x19f)]=_0x2f0e3a(0x163),_0x47b728['style'][_0x2f0e3a(0x19a)]=_0x2f0e3a(0x15e),_0x47b728['style'][_0x2f0e3a(0x16b)]=_0x2f0e3a(0x19c),this.#f001();}#f001(){var _0xe44759=a0_0x226d39,_0x425e2f=this['unityCanvas'],_0x3969be=this[_0xe44759(0x198)],_0x2b50f2=window[_0xe44759(0x17e)]/window['innerHeight'];_0x425e2f[_0xe44759(0x190)][_0xe44759(0x173)]='100%',_0x425e2f[_0xe44759(0x190)]['height']=_0xe44759(0x163);var _0x54beea=this[_0xe44759(0x198)][_0xe44759(0x17a)]();;var _0x4aae53=_0x2b50f2,_0x2a44c9=window[_0xe44759(0x17e)],_0x5563df=window[_0xe44759(0x18b)],_0x32d2df=0.5/_0x4aae53,_0x55f565=0x1,_0x9529ec=0x2*Math[_0xe44759(0x16a)](_0x32d2df/_0x55f565)*0xb4/Math['PI'];this[_0xe44759(0x187)]=_0x9529ec;;window[_0xe44759(0x193)]&&(_0xe44759(0x174)!==_0xe44759(0x17c)?(window['unityInstance'][_0xe44759(0x15c)](_0xe44759(0x199),'SetCameraFov',_0x9529ec),window['unityInstance']['SendMessage'](_0xe44759(0x199),'Resize',_0x3969be[_0xe44759(0x173)]+','+_0x3969be[_0xe44759(0x19f)])):(this[_0xe44759(0x17b)]=![],this[_0xe44759(0x15d)][_0xe44759(0x188)]()));}[a0_0x226d39(0x183)](_0x266e1f){var _0x57e0f6=this['videoBackground'],_0x2615af=_0x57e0f6['toDataURL'](_0x266e1f);return _0x2615af;}['getVideoDims'](){var _0x571820=a0_0x226d39;return this[_0x571820(0x198)][_0x571820(0x173)]+','+this['videoBackground'][_0x571820(0x19f)];}};