arcamera.js 10 KB

1
  1. var a0_0x24eee5=a0_0x43a5;(function(_0x27fe80,_0x168581){var _0x550599=a0_0x43a5,_0x364ce1=_0x27fe80();while(!![]){try{var _0x2b51f0=-parseInt(_0x550599(0x1a9))/0x1*(parseInt(_0x550599(0x198))/0x2)+parseInt(_0x550599(0x197))/0x3+parseInt(_0x550599(0x18b))/0x4*(-parseInt(_0x550599(0x187))/0x5)+-parseInt(_0x550599(0x184))/0x6+-parseInt(_0x550599(0x16f))/0x7+parseInt(_0x550599(0x195))/0x8*(-parseInt(_0x550599(0x19f))/0x9)+parseInt(_0x550599(0x170))/0xa*(parseInt(_0x550599(0x186))/0xb);if(_0x2b51f0===_0x168581)break;else _0x364ce1['push'](_0x364ce1['shift']());}catch(_0x828c15){_0x364ce1['push'](_0x364ce1['shift']());}}}(a0_0x5c9a,0xabae6));var a0_0x4dd986=(function(){var _0x29ef86=!![];return function(_0x5dabc5,_0x16ded6){var _0x119440=a0_0x43a5;if(_0x119440(0x176)!==_0x119440(0x196)){var _0x2e4d00=_0x29ef86?function(){var _0x3e6acb=_0x119440;if(_0x16ded6){var _0x5240ed=_0x16ded6[_0x3e6acb(0x1ae)](_0x5dabc5,arguments);return _0x16ded6=null,_0x5240ed;}}:function(){};return _0x29ef86=![],_0x2e4d00;}else this[_0x119440(0x19d)]=_0x3af752;};}()),a0_0x37583b=a0_0x4dd986(this,function(){var _0x4d69ea=a0_0x43a5;return a0_0x37583b[_0x4d69ea(0x19a)]()['search'](_0x4d69ea(0x16a))[_0x4d69ea(0x19a)]()[_0x4d69ea(0x16e)](a0_0x37583b)[_0x4d69ea(0x17f)]('(((.+)+)+)+$');});function a0_0x43a5(_0x3f2d68,_0x597de1){var _0x2da895=a0_0x5c9a();return a0_0x43a5=function(_0x37583b,_0x4dd986){_0x37583b=_0x37583b-0x15c;var _0x5c9aae=_0x2da895[_0x37583b];return _0x5c9aae;},a0_0x43a5(_0x3f2d68,_0x597de1);}a0_0x37583b();class ARCamera{#p000;[a0_0x24eee5(0x164)];constructor(_0x4d38c2,_0x3d0ccc){var _0x4bb38e=a0_0x24eee5;this['unityCanvas']=_0x4d38c2,this['videoCanvas']=_0x3d0ccc,this[_0x4bb38e(0x161)]=this[_0x4bb38e(0x182)][_0x4bb38e(0x175)]('2d'),this[_0x4bb38e(0x18d)]=0x1e,this[_0x4bb38e(0x164)]=[],this['maxFrameSize']=0x12c,this[_0x4bb38e(0x191)]=document[_0x4bb38e(0x177)](_0x4bb38e(0x17e)),this['videoCapture']['id']='videoCapture',document[_0x4bb38e(0x1a3)][_0x4bb38e(0x1a7)](this[_0x4bb38e(0x191)]),this[_0x4bb38e(0x17a)]=this['videoCapture'][_0x4bb38e(0x175)]('2d'),this[_0x4bb38e(0x191)][_0x4bb38e(0x180)]['position']=_0x4bb38e(0x15d),this[_0x4bb38e(0x191)][_0x4bb38e(0x180)]['zIndex']=_0x4bb38e(0x18c),this[_0x4bb38e(0x188)](this[_0x4bb38e(0x17b)]),this[_0x4bb38e(0x19d)]=![];;}[a0_0x24eee5(0x183)](){var _0x37dad5=a0_0x24eee5;this['cameraPaused']=!![],this[_0x37dad5(0x173)][_0x37dad5(0x16c)]();}[a0_0x24eee5(0x178)](){var _0x154cd2=a0_0x24eee5;this[_0x154cd2(0x1ad)]=![],this[_0x154cd2(0x173)][_0x154cd2(0x185)]();}async['startWebcam'](_0xde9e67){var _0x3a896a=a0_0x24eee5;;this[_0x3a896a(0x173)]=_0xde9e67;try{await _0xde9e67['play']();;if(!this[_0x3a896a(0x191)]){var _0x551ccd=_0x3a896a(0x194);return Promise[_0x3a896a(0x18a)](_0x551ccd);}else{if(!this[_0x3a896a(0x1a8)]){var _0x551ccd='unityCanvas\x20is\x20null.\x20Please\x20call\x20new\x20ARCamera(unityCanvas,\x20videoCapture)\x20properly\x20before\x20starting\x20the\x20Webcam';return Promise[_0x3a896a(0x18a)](_0x551ccd);}}return this['resizeCanvas'](),this[_0x3a896a(0x172)]=Date[_0x3a896a(0x1a4)](),this[_0x3a896a(0x189)]=Date[_0x3a896a(0x1a4)](),this[_0x3a896a(0x181)]=Date['now'](),this.#p000=setInterval(this.#f000,0x1/this[_0x3a896a(0x18d)]*0x3e8),this[_0x3a896a(0x192)]=!![],Promise[_0x3a896a(0x18f)]();}catch(_0xa03db5){if(_0x3a896a(0x1aa)!==_0x3a896a(0x1aa)){var _0x186ceb=this[_0x3a896a(0x1a8)],_0x180a36=this['videoCapture'],_0x43cc83=this[_0x3a896a(0x173)];if(!_0x43cc83||_0x43cc83['videoWidth']<=0x0||_0x43cc83[_0x3a896a(0x193)]<=0x0)return;var _0x4f451b=_0x4ddfac['innerWidth']/_0x17d1e5[_0x3a896a(0x1a1)],_0x2aa986=_0x43cc83[_0x3a896a(0x19b)]/_0x43cc83['videoHeight'];_0x186ceb['style']['width']='100%',_0x186ceb[_0x3a896a(0x180)][_0x3a896a(0x171)]=_0x3a896a(0x169);var _0x493ea5=this[_0x3a896a(0x191)][_0x3a896a(0x165)]();;var _0x3d6e5e=_0x4475f9[_0x3a896a(0x174)],_0x39d104=_0x547fd3['innerHeight'],_0x23450a=0.5/_0x54a9b6[_0x3a896a(0x167)](_0x2aa986,_0x4f451b),_0x7ecd80=0x1,_0x5b47d9=0x2*_0x4b873a[_0x3a896a(0x15e)](_0x23450a/_0x7ecd80)*0xb4/_0x1e7b51['PI'];this[_0x3a896a(0x17c)]=_0x5b47d9;;_0x5754e2[_0x3a896a(0x19e)]&&(_0x167870[_0x3a896a(0x19e)][_0x3a896a(0x190)](_0x3a896a(0x166),_0x3a896a(0x179),_0x5b47d9),_0x21b07a['unityInstance'][_0x3a896a(0x190)](_0x3a896a(0x166),_0x3a896a(0x1a2),_0x43cc83[_0x3a896a(0x19b)]+','+_0x43cc83[_0x3a896a(0x193)]));}else return Promise[_0x3a896a(0x18a)](_0xa03db5);}}#f000(){var _0x506591=a0_0x24eee5;if(arCamera[_0x506591(0x1ad)]){;return;}if(!arCamera[_0x506591(0x173)]){;return;}var _0x354bd6=arCamera[_0x506591(0x173)],_0x4e90ab=arCamera['videoCapture'],_0x2ebdcb=arCamera[_0x506591(0x182)],_0x130667=_0x4e90ab[_0x506591(0x15f)]/_0x354bd6[_0x506591(0x19b)],_0x2a2ec3=_0x4e90ab[_0x506591(0x171)]/_0x354bd6['videoHeight'],_0x3fa57a=Math[_0x506591(0x167)](_0x130667,_0x2a2ec3),_0xa94504=(_0x4e90ab[_0x506591(0x15f)]-_0x354bd6['videoWidth']*_0x3fa57a)/0x2,_0x214cd9=(_0x4e90ab[_0x506591(0x171)]-_0x354bd6['videoHeight']*_0x3fa57a)/0x2;arCamera[_0x506591(0x17a)][_0x506591(0x17d)](0x0,0x0,_0x4e90ab[_0x506591(0x15f)],_0x4e90ab[_0x506591(0x171)]),arCamera[_0x506591(0x17a)]['setTransform'](_0x3fa57a,0x0,0x0,_0x3fa57a,_0xa94504,_0x214cd9),arCamera[_0x506591(0x17a)]['drawImage'](arCamera['VIDEO'],0x0,0x0);if(!arCamera[_0x506591(0x19d)]){_0x2ebdcb['width']=window[_0x506591(0x174)],_0x2ebdcb[_0x506591(0x171)]=window[_0x506591(0x1a1)];var _0x4656de=_0x2ebdcb[_0x506591(0x15f)]/_0x354bd6['videoWidth'],_0x1b10de=_0x2ebdcb['height']/_0x354bd6['videoHeight'],_0x135f92=Math[_0x506591(0x167)](_0x4656de,_0x1b10de),_0x31c2f1=(_0x2ebdcb[_0x506591(0x15f)]-_0x354bd6[_0x506591(0x19b)]*_0x135f92)/0x2,_0x3bd4c4=(_0x2ebdcb[_0x506591(0x171)]-_0x354bd6[_0x506591(0x193)]*_0x135f92)/0x2;arCamera[_0x506591(0x161)][_0x506591(0x17d)](0x0,0x0,_0x2ebdcb[_0x506591(0x15f)],_0x2ebdcb[_0x506591(0x171)]),arCamera['video_ctx'][_0x506591(0x16b)](_0x135f92,0x0,0x0,_0x135f92,_0x31c2f1,_0x3bd4c4),arCamera[_0x506591(0x161)]['drawImage'](arCamera[_0x506591(0x173)],0x0,0x0);}arCamera[_0x506591(0x164)][_0x506591(0x163)](_0x43d4a0=>{var _0x2a1bf6=_0x506591;_0x43d4a0[_0x2a1bf6(0x18e)]();});if(arCamera[_0x506591(0x1a0)]){if(_0x506591(0x15c)===_0x506591(0x15c))arCamera['updateUnityVideoTextureCallback']();else{var _0x1c6446=_0x53865b[_0x506591(0x1ae)](_0x3fc08f,arguments);return _0x39d29c=null,_0x1c6446;}}}[a0_0x24eee5(0x19c)](_0x3687ac,_0x135bcd){var _0x1fc2dc=a0_0x24eee5;if(this['SUBSCRIBED_TRACKERS'][_0x1fc2dc(0x168)](_0x3687ac)){;return;}this[_0x1fc2dc(0x164)][_0x1fc2dc(0x1a5)](_0x3687ac);}['setFrameSize'](_0x540d59){var _0xca64c4=a0_0x24eee5;;this['maxFrameSize']=_0x540d59;var _0x449f06=this[_0xca64c4(0x191)],_0x1d5497=this[_0xca64c4(0x173)];if(!_0x1d5497||_0x1d5497[_0xca64c4(0x19b)]<=0x0||_0x1d5497[_0xca64c4(0x193)]<=0x0)return;const _0x5595a0=Math[_0xca64c4(0x16d)](this[_0xca64c4(0x17b)]/_0x1d5497[_0xca64c4(0x19b)],this[_0xca64c4(0x17b)]/_0x1d5497[_0xca64c4(0x193)]);;_0x449f06['width']=_0x5595a0*_0x1d5497['videoWidth'],_0x449f06['height']=_0x5595a0*_0x1d5497[_0xca64c4(0x193)];;}[a0_0x24eee5(0x1ab)](_0x260813){var _0x4b087e=a0_0x24eee5;this[_0x4b087e(0x18d)]=_0x260813,clearInterval(this.#p000),this.#p000=setInterval(this.#f000,0x1/this[_0x4b087e(0x18d)]*0x3e8);}[a0_0x24eee5(0x1a6)](){var _0x2a427a=a0_0x24eee5;;if(!window[_0x2a427a(0x199)])window[_0x2a427a(0x199)]=this;var _0x1a7796=this[_0x2a427a(0x191)],_0xe550e9=this[_0x2a427a(0x173)];if(!_0x1a7796||!_0xe550e9||_0xe550e9[_0x2a427a(0x19b)]<=0x0||_0xe550e9[_0x2a427a(0x193)]<=0x0)return;;var _0x3fb9dd=window[_0x2a427a(0x174)]/window[_0x2a427a(0x1a1)];;this['setFrameSize'](this[_0x2a427a(0x17b)]),this['SUBSCRIBED_TRACKERS']['forEach'](_0x542f1f=>{var _0x46b8fd=_0x2a427a;if(_0x46b8fd(0x162)!==_0x46b8fd(0x162))return _0x109977[_0x46b8fd(0x18a)](_0x4defcb);else _0x542f1f[_0x46b8fd(0x1ac)](_0x1a7796[_0x46b8fd(0x15f)],_0x1a7796[_0x46b8fd(0x171)]);}),this.#f001();}#f001(){var _0x38100e=a0_0x24eee5,_0x40662e=this[_0x38100e(0x1a8)],_0xc874f3=this[_0x38100e(0x191)],_0x231025=this[_0x38100e(0x173)];if(!_0x231025||_0x231025[_0x38100e(0x19b)]<=0x0||_0x231025[_0x38100e(0x193)]<=0x0)return;var _0x1bba93=window[_0x38100e(0x174)]/window['innerHeight'],_0xe9dc8=_0x231025[_0x38100e(0x19b)]/_0x231025['videoHeight'];_0x40662e[_0x38100e(0x180)][_0x38100e(0x15f)]='100%',_0x40662e[_0x38100e(0x180)][_0x38100e(0x171)]=_0x38100e(0x169);var _0x516ae6=this[_0x38100e(0x191)][_0x38100e(0x165)]();;var _0x375dec=window['innerWidth'],_0x6e6710=window[_0x38100e(0x1a1)],_0x55235f=0.5/Math['max'](_0xe9dc8,_0x1bba93),_0xe2fcc8=0x1,_0x49d619=0x2*Math['atan'](_0x55235f/_0xe2fcc8)*0xb4/Math['PI'];this['FOV']=_0x49d619;;window[_0x38100e(0x19e)]&&(window['unityInstance'][_0x38100e(0x190)](_0x38100e(0x166),_0x38100e(0x179),_0x49d619),window[_0x38100e(0x19e)][_0x38100e(0x190)](_0x38100e(0x166),_0x38100e(0x1a2),_0x231025[_0x38100e(0x19b)]+','+_0x231025['videoHeight']));}[a0_0x24eee5(0x160)](_0x543b46){var _0x5665f4=this['videoCapture'],_0x1f8514=_0x5665f4['toDataURL'](_0x543b46);return _0x1f8514;}['getVideoDims'](){var _0x4a6f7d=a0_0x24eee5;return this[_0x4a6f7d(0x173)][_0x4a6f7d(0x19b)]+','+this[_0x4a6f7d(0x173)][_0x4a6f7d(0x193)];}['useUnityVideoPlane'](_0x8462d7){var _0x2d4c2e=a0_0x24eee5;this[_0x2d4c2e(0x19d)]=_0x8462d7;}};function a0_0x5c9a(){var _0x5ede07=['video_ctx','nIdov','forEach','SUBSCRIBED_TRACKERS','getBoundingClientRect','ARCamera','max','includes','100%','(((.+)+)+)+$','setTransform','pause','min','constructor','3999247frPUka','21561310Tduzrm','height','lastUpdateTime','VIDEO','innerWidth','getContext','OpwiS','createElement','unpauseCamera','SetCameraFov','capture_ctx','maxFrameSize','FOV','clearRect','canvas','search','style','lastMatchTrackTime','videoCanvas','pauseCamera','4160778gtFcZm','play','22pYJhBY','5729365luMIAy','setFrameSize','lastDetectTime','reject','4tgVDpj','-100','FRAMERATE','update','resolve','SendMessage','videoCapture','isCameraStarted','videoHeight','videoCapture\x20canvas\x20is\x20null.\x20Please\x20call\x20new\x20ARCamera(unityCanvas,\x20videoCapture)\x20properly\x20before\x20starting\x20the\x20Webcam','4468384XCxuxF','nLZou','345855okRzWu','4968gddgzC','arCamera','toString','videoWidth','subscribeToWebcamUpdates','usingUnityVideoPlane','unityInstance','9svIXEO','updateUnityVideoTextureCallback','innerHeight','Resize','body','now','push','resizeCanvas','appendChild','unityCanvas','304FVKSDO','NSkFn','setFramerate','setCamDims','cameraPaused','apply','SRubt','absolute','atan','width','getCameraTexture'];a0_0x5c9a=function(){return _0x5ede07;};return a0_0x5c9a();}