"use strict";var Map=function(t,i,o){this.width=null,this.height=null,this.halfWidth=null,this.halfHeight=null,this.resize(t,i),this.projectionViewMatrix=o,this.projectionViewMatrixInv=null!==o?new THREE.Matrix4:null,null!==o&&this.projectionViewMatrixInv.getInverse(o),this._tmp_playerPosition=new THREE.Vector4,this._tmp_clipCoordinates=new THREE.Vector4,this._tmp_unproj_vector=new THREE.Vector4,this._tmp_unproj_vectorTransformed=new THREE.Vector4};Map.prototype.resize=function(t,i){this.width=t,this.height=i,this.halfWidth=.5*t,this.halfHeight=.5*i},Map.prototype.computeScreenCoordinates=function(t,i){this._tmp_playerPosition.x=t.x,this._tmp_playerPosition.y=t.y,this._tmp_playerPosition.z=t.z,this._tmp_playerPosition.w=1,this._tmp_playerPosition.applyMatrix4(this.projectionViewMatrix),this._tmp_playerPosition.x/=this._tmp_playerPosition.w,this._tmp_playerPosition.y/=this._tmp_playerPosition.w,i.x=Math.round(this.halfWidth*(this._tmp_playerPosition.x+1)),i.y=Math.round(this.halfHeight*(this._tmp_playerPosition.y+1))},Map.prototype.unprojectInplaceXZ=function(t){this._tmp_unproj_vector.x=2*t.x/this.width-1,this._tmp_unproj_vector.y=2*t.z/this.height-1,this._tmp_unproj_vector.z=0,this._tmp_unproj_vector.w=1,this._tmp_unproj_vectorTransformed.copy(this._tmp_unproj_vector),this._tmp_unproj_vectorTransformed.applyMatrix4(this.projectionViewMatrixInv),t.x=this._tmp_unproj_vectorTransformed.x/this._tmp_unproj_vectorTransformed.w,t.z=this._tmp_unproj_vectorTransformed.z/this._tmp_unproj_vectorTransformed.w};