arcamera.js 10 KB

1
  1. var a0_0x49a817=a0_0x29cc;function a0_0x3646(){var _0x1fe66b=['update','getCameraTexture','zIndex','33Jcfecf','resolve','40OuXzfM','apply','maxFrameSize','1039332pETQgh','1656600WuekZS','videoCapture','toDataURL','Resize','4ByogSM','9149IfXNwI','unityCanvas','getVideoDims','(((.+)+)+)+$','ePJeG','FRAMERATE','canvas','height','806772nprRtT','100%','setFrameSize','arCamera','231658MyatUe','now','jRdgh','absolute','innerWidth','lastDetectTime','SetCameraFov','width','play','appendChild','BZIns','setCamDims','subscribeToWebcamUpdates','QZhij','1794VEOxFm','drawImage','updateUnityVideoTextureCallback','clearRect','FOV','forEach','lastMatchTrackTime','style','pause','ARCamera','oolSk','videoWidth','1329908KCllrE','startWebcam','innerHeight','setTransform','capture_ctx','lzoth','isCameraStarted','video_ctx','qnRtZ','toString','cameraPaused','atan','getBoundingClientRect','search','max','videoCanvas','SUBSCRIBED_TRACKERS','unityInstance','VIDEO','getContext','-100','constructor','lastUpdateTime','mgRDI','5bAtTZY','body','1108062VcgRdR','push','SendMessage','reject','unityCanvas\x20is\x20null.\x20Please\x20call\x20new\x20ARCamera(unityCanvas,\x20videoCapture)\x20properly\x20before\x20starting\x20the\x20Webcam','videoHeight'];a0_0x3646=function(){return _0x1fe66b;};return a0_0x3646();}(function(_0x584b55,_0xa57b95){var _0x246d5d=a0_0x29cc,_0x1fc6e6=_0x584b55();while(!![]){try{var _0x4ce788=parseInt(_0x246d5d(0x139))/0x1+parseInt(_0x246d5d(0x12c))/0x2*(parseInt(_0x246d5d(0x135))/0x3)+parseInt(_0x246d5d(0xff))/0x4*(parseInt(_0x246d5d(0x117))/0x5)+parseInt(_0x246d5d(0xf3))/0x6*(-parseInt(_0x246d5d(0x12d))/0x7)+-parseInt(_0x246d5d(0x128))/0x8+-parseInt(_0x246d5d(0x119))/0x9*(parseInt(_0x246d5d(0x124))/0xa)+parseInt(_0x246d5d(0x122))/0xb*(parseInt(_0x246d5d(0x127))/0xc);if(_0x4ce788===_0xa57b95)break;else _0x1fc6e6['push'](_0x1fc6e6['shift']());}catch(_0x43d36f){_0x1fc6e6['push'](_0x1fc6e6['shift']());}}}(a0_0x3646,0x42474));var a0_0x28470f=(function(){var _0x317e91=!![];return function(_0x21e0a2,_0x186e48){var _0x231647=a0_0x29cc;if('BZIns'!==_0x231647(0xef))this[_0x231647(0x109)]=![],this[_0x231647(0x111)][_0x231647(0xed)]();else{var _0x3cb68b=_0x317e91?function(){var _0x25f146=_0x231647;if(_0x186e48){var _0x52a931=_0x186e48[_0x25f146(0x125)](_0x21e0a2,arguments);return _0x186e48=null,_0x52a931;}}:function(){};return _0x317e91=![],_0x3cb68b;}};}()),a0_0x4b6037=a0_0x28470f(this,function(){var _0x1794cd=a0_0x29cc;return a0_0x4b6037[_0x1794cd(0x108)]()['search']('(((.+)+)+)+$')[_0x1794cd(0x108)]()[_0x1794cd(0x114)](a0_0x4b6037)[_0x1794cd(0x10c)](_0x1794cd(0x130));});a0_0x4b6037();function a0_0x29cc(_0x2f5f2f,_0x5a1dbe){var _0x21fc94=a0_0x3646();return a0_0x29cc=function(_0x4b6037,_0x28470f){_0x4b6037=_0x4b6037-0xea;var _0x3646db=_0x21fc94[_0x4b6037];return _0x3646db;},a0_0x29cc(_0x2f5f2f,_0x5a1dbe);}class ARCamera{#p000;[a0_0x49a817(0x10f)];constructor(_0x1fd65e,_0x52d92f){var _0x3d84a5=a0_0x49a817;this[_0x3d84a5(0x12e)]=_0x1fd65e,this[_0x3d84a5(0x10e)]=_0x52d92f,this[_0x3d84a5(0x106)]=this[_0x3d84a5(0x10e)][_0x3d84a5(0x112)]('2d'),this[_0x3d84a5(0x132)]=0x1e,this['SUBSCRIBED_TRACKERS']=[],this['maxFrameSize']=0x12c,this[_0x3d84a5(0x129)]=document['createElement'](_0x3d84a5(0x133)),this[_0x3d84a5(0x129)]['id']=_0x3d84a5(0x129),document[_0x3d84a5(0x118)][_0x3d84a5(0xee)](this[_0x3d84a5(0x129)]),this[_0x3d84a5(0x103)]=this[_0x3d84a5(0x129)][_0x3d84a5(0x112)]('2d'),this[_0x3d84a5(0x129)]['style']['position']=_0x3d84a5(0x13c),this['videoCapture']['style'][_0x3d84a5(0x121)]=_0x3d84a5(0x113),this['setFrameSize'](this['maxFrameSize']);;}['pauseCamera'](){var _0x45c316=a0_0x49a817;this['cameraPaused']=!![],this[_0x45c316(0x111)][_0x45c316(0xfb)]();}['unpauseCamera'](){var _0x289ce7=a0_0x49a817;this[_0x289ce7(0x109)]=![],this[_0x289ce7(0x111)]['play']();}async[a0_0x49a817(0x100)](_0x4fec31){var _0x2fb2d6=a0_0x49a817;;this['VIDEO']=_0x4fec31;try{if('qnRtZ'===_0x2fb2d6(0x107)){await _0x4fec31[_0x2fb2d6(0xed)]();;if(!this['videoCapture']){var _0x15e599='videoCapture\x20canvas\x20is\x20null.\x20Please\x20call\x20new\x20ARCamera(unityCanvas,\x20videoCapture)\x20properly\x20before\x20starting\x20the\x20Webcam';return Promise['reject'](_0x15e599);}else{if(!this[_0x2fb2d6(0x12e)]){if(_0x2fb2d6(0xfd)!==_0x2fb2d6(0xf2)){var _0x15e599=_0x2fb2d6(0x11d);return Promise[_0x2fb2d6(0x11c)](_0x15e599);}else return this['VIDEO'][_0x2fb2d6(0xfe)]+','+this['VIDEO'][_0x2fb2d6(0x11e)];}}return this['resizeCanvas'](),this[_0x2fb2d6(0x115)]=Date['now'](),this[_0x2fb2d6(0xea)]=Date[_0x2fb2d6(0x13a)](),this[_0x2fb2d6(0xf9)]=Date['now'](),this.#p000=setInterval(this.#f000,0x1/this[_0x2fb2d6(0x132)]*0x3e8),this[_0x2fb2d6(0x105)]=!![],Promise[_0x2fb2d6(0x123)]();}else{var _0xfda495=this[_0x2fb2d6(0x129)],_0x16a993=_0xfda495[_0x2fb2d6(0x12a)](_0x33bf62);return _0x16a993;}}catch(_0x1f1e3d){return Promise[_0x2fb2d6(0x11c)](_0x1f1e3d);}}#f000(){var _0x223e82=a0_0x49a817;if(arCamera['cameraPaused']){;return;}if(!arCamera['VIDEO']){;return;}var _0x458612=arCamera[_0x223e82(0x111)],_0x759f92=arCamera[_0x223e82(0x129)],_0x573144=arCamera['videoCanvas'],_0x2a038d=_0x759f92[_0x223e82(0xec)]/_0x458612[_0x223e82(0xfe)],_0x4645a7=_0x759f92['height']/_0x458612[_0x223e82(0x11e)],_0x4dfbce=Math['max'](_0x2a038d,_0x4645a7),_0xd2c8fb=(_0x759f92[_0x223e82(0xec)]-_0x458612[_0x223e82(0xfe)]*_0x4dfbce)/0x2,_0x28de06=(_0x759f92[_0x223e82(0x134)]-_0x458612[_0x223e82(0x11e)]*_0x4dfbce)/0x2;arCamera[_0x223e82(0x103)]['clearRect'](0x0,0x0,_0x759f92['width'],_0x759f92[_0x223e82(0x134)]),arCamera[_0x223e82(0x103)]['setTransform'](_0x4dfbce,0x0,0x0,_0x4dfbce,_0xd2c8fb,_0x28de06),arCamera['capture_ctx'][_0x223e82(0xf4)](arCamera[_0x223e82(0x111)],0x0,0x0),_0x573144[_0x223e82(0xec)]=window[_0x223e82(0x13d)],_0x573144[_0x223e82(0x134)]=window[_0x223e82(0x101)];var _0x328f97=_0x573144[_0x223e82(0xec)]/_0x458612[_0x223e82(0xfe)],_0x4485cd=_0x573144[_0x223e82(0x134)]/_0x458612[_0x223e82(0x11e)],_0x4ce016=Math[_0x223e82(0x10d)](_0x328f97,_0x4485cd),_0x54842f=(_0x573144[_0x223e82(0xec)]-_0x458612[_0x223e82(0xfe)]*_0x4ce016)/0x2,_0xd125a6=(_0x573144['height']-_0x458612[_0x223e82(0x11e)]*_0x4ce016)/0x2;arCamera[_0x223e82(0x106)][_0x223e82(0xf6)](0x0,0x0,_0x573144['width'],_0x573144[_0x223e82(0x134)]),arCamera[_0x223e82(0x106)][_0x223e82(0x102)](_0x4ce016,0x0,0x0,_0x4ce016,_0x54842f,_0xd125a6),arCamera[_0x223e82(0x106)][_0x223e82(0xf4)](arCamera[_0x223e82(0x111)],0x0,0x0),arCamera[_0x223e82(0x10f)][_0x223e82(0xf8)](_0x2b2303=>{var _0x38d5ec=_0x223e82;_0x2b2303[_0x38d5ec(0x11f)]();});if(arCamera[_0x223e82(0xf5)]){if(_0x223e82(0x131)===_0x223e82(0x104)){var _0x58f8fa=this['unityCanvas'],_0x157b4b=this[_0x223e82(0x129)],_0xc39ac2=this[_0x223e82(0x111)];if(!_0xc39ac2||_0xc39ac2[_0x223e82(0xfe)]<=0x0||_0xc39ac2[_0x223e82(0x11e)]<=0x0)return;var _0x209f21=_0x389200[_0x223e82(0x13d)]/_0x22d133['innerHeight'],_0x442eaf=_0xc39ac2[_0x223e82(0xfe)]/_0xc39ac2['videoHeight'];_0x58f8fa[_0x223e82(0xfa)][_0x223e82(0xec)]=_0x223e82(0x136),_0x58f8fa[_0x223e82(0xfa)][_0x223e82(0x134)]=_0x223e82(0x136);var _0x5aff38=this[_0x223e82(0x129)][_0x223e82(0x10b)]();;var _0x1cbdf6=_0x37518b[_0x223e82(0x13d)],_0x1c75f8=_0x40d592[_0x223e82(0x101)],_0x5ba7a8=0.5/_0x5036d1['max'](_0x442eaf,_0x209f21),_0x291ac9=0x1,_0x21bd86=0x2*_0x3d006a[_0x223e82(0x10a)](_0x5ba7a8/_0x291ac9)*0xb4/_0x4fb6c0['PI'];this[_0x223e82(0xf7)]=_0x21bd86;;_0x209554[_0x223e82(0x110)]&&(_0x5eeaf4[_0x223e82(0x110)][_0x223e82(0x11b)](_0x223e82(0xfc),_0x223e82(0xeb),_0x21bd86),_0x9f1394[_0x223e82(0x110)][_0x223e82(0x11b)](_0x223e82(0xfc),_0x223e82(0x12b),_0xc39ac2['videoWidth']+','+_0xc39ac2[_0x223e82(0x11e)]));}else arCamera[_0x223e82(0xf5)]();}}[a0_0x49a817(0xf1)](_0x32f32c,_0x2d894c){var _0x1367aa=a0_0x49a817;if(this[_0x1367aa(0x10f)]['includes'](_0x32f32c)){;return;}this[_0x1367aa(0x10f)][_0x1367aa(0x11a)](_0x32f32c);}[a0_0x49a817(0x137)](_0x2509c7){var _0x4f536c=a0_0x49a817;;this['maxFrameSize']=_0x2509c7;var _0x4f04b6=this[_0x4f536c(0x129)],_0x159593=this['VIDEO'];if(!_0x159593||_0x159593[_0x4f536c(0xfe)]<=0x0||_0x159593[_0x4f536c(0x11e)]<=0x0)return;const _0x1c27dc=Math['min'](this[_0x4f536c(0x126)]/_0x159593[_0x4f536c(0xfe)],this[_0x4f536c(0x126)]/_0x159593['videoHeight']);;_0x4f04b6[_0x4f536c(0xec)]=_0x1c27dc*_0x159593[_0x4f536c(0xfe)],_0x4f04b6[_0x4f536c(0x134)]=_0x1c27dc*_0x159593[_0x4f536c(0x11e)];;}['setFramerate'](_0x1a8e42){var _0x53812a=a0_0x49a817;this[_0x53812a(0x132)]=_0x1a8e42,clearInterval(this.#p000),this.#p000=setInterval(this.#f000,0x1/this[_0x53812a(0x132)]*0x3e8);}['resizeCanvas'](){var _0x2a2ab8=a0_0x49a817;;if(!window[_0x2a2ab8(0x138)])window[_0x2a2ab8(0x138)]=this;var _0x24e885=this[_0x2a2ab8(0x129)],_0xc14ac1=this[_0x2a2ab8(0x111)];if(!_0x24e885||!_0xc14ac1||_0xc14ac1[_0x2a2ab8(0xfe)]<=0x0||_0xc14ac1[_0x2a2ab8(0x11e)]<=0x0)return;;var _0xcb84db=window[_0x2a2ab8(0x13d)]/window[_0x2a2ab8(0x101)];;this['setFrameSize'](this[_0x2a2ab8(0x126)]),this[_0x2a2ab8(0x10f)]['forEach'](_0x150c1d=>{var _0x9b0ee0=_0x2a2ab8;if(_0x9b0ee0(0x116)===_0x9b0ee0(0x13b))return _0x39e578[_0x9b0ee0(0x108)]()[_0x9b0ee0(0x10c)](_0x9b0ee0(0x130))[_0x9b0ee0(0x108)]()[_0x9b0ee0(0x114)](_0x43c1fd)[_0x9b0ee0(0x10c)](_0x9b0ee0(0x130));else _0x150c1d[_0x9b0ee0(0xf0)](_0x24e885[_0x9b0ee0(0xec)],_0x24e885['height']);}),this.#f001();}#f001(){var _0x111450=a0_0x49a817,_0x19b0bb=this[_0x111450(0x12e)],_0x2a3b9f=this[_0x111450(0x129)],_0x2e72b6=this['VIDEO'];if(!_0x2e72b6||_0x2e72b6[_0x111450(0xfe)]<=0x0||_0x2e72b6[_0x111450(0x11e)]<=0x0)return;var _0x465c8a=window[_0x111450(0x13d)]/window[_0x111450(0x101)],_0x4f4101=_0x2e72b6[_0x111450(0xfe)]/_0x2e72b6[_0x111450(0x11e)];_0x19b0bb[_0x111450(0xfa)][_0x111450(0xec)]=_0x111450(0x136),_0x19b0bb[_0x111450(0xfa)][_0x111450(0x134)]=_0x111450(0x136);var _0x4246d6=this[_0x111450(0x129)]['getBoundingClientRect']();;var _0x3c3bff=window[_0x111450(0x13d)],_0x26a396=window['innerHeight'],_0x4f52b1=0.5/Math[_0x111450(0x10d)](_0x4f4101,_0x465c8a),_0x536958=0x1,_0x57ddd8=0x2*Math['atan'](_0x4f52b1/_0x536958)*0xb4/Math['PI'];this['FOV']=_0x57ddd8;;window[_0x111450(0x110)]&&(window[_0x111450(0x110)][_0x111450(0x11b)](_0x111450(0xfc),_0x111450(0xeb),_0x57ddd8),window[_0x111450(0x110)][_0x111450(0x11b)](_0x111450(0xfc),'Resize',_0x2e72b6[_0x111450(0xfe)]+','+_0x2e72b6[_0x111450(0x11e)]));}[a0_0x49a817(0x120)](_0x42cf34){var _0x275ddd=a0_0x49a817,_0x101f31=this[_0x275ddd(0x129)],_0xc6a0c=_0x101f31[_0x275ddd(0x12a)](_0x42cf34);return _0xc6a0c;}[a0_0x49a817(0x12f)](){var _0x2559f4=a0_0x49a817;return this[_0x2559f4(0x111)][_0x2559f4(0xfe)]+','+this[_0x2559f4(0x111)][_0x2559f4(0x11e)];}};