text: /**
   * skylark-pox - A version of pox that ported to running on skylarkjs
   * @author Hudaokeji, Inc.
   * @version v0.9.0
   * @link https://github.com/skylark-integration/skylark-pox/
   * @license MIT
   */
  define(["./pox","./CanvasMatrix4","./Json2Canvas"],function(t,e,s){const i=e;return t.util={Cpanel:class{constructor(t,s){this.hide=!1,s||(s={}),void 0===s.width&&(s.width=100),void 0===s.height&&(s.height=50),void 0===s.font&&(s.font="10px monospace"),void 0===s.color&&(s.color="red"),void 0===s.lines&&(s.lines=5),void 0===s.lheight&&(s.lheight=10),void 0===s.ry&&(s.ry=40),void 0===s.pos&&(s.pos=[-.2,.2,-.8]),void 0===s.camFix&&(s.camFix=!0),this.pcanvas=document.createElement("canvas"),this.pcanvas.width=s.width,this.pcanvas.height=s.height,this.j2c=new json2canvas(this.pcanvas),this.j2c.default.font=s.font,this.j2c.default.textColor=s.color,this.clearColor=s.clearColor,this.ctx=this.j2c.ctx,this.dd=[];let i=s.lheight;for(let t=0;t<s.lines;t++,i+=s.lheight)this.dd.push({shape:"text",str:"",x:0,y:i,width:s.width});this.j2c.draw(this.dd),this.id=(new Date).getTime()+Math.floor(1e3*Math.random());const h={name:"cpanel"+this.id,canvas:this.pcanvas,opt:{flevel:1,repeat:2,nomipmap:!0}};t.addTex(h),this.model={geo:(new WWModel).primitive("plane",{wx:s.width/1e3,wy:s.height/1e3}).objModel(),camFix:s.camFix,layer:s.layer,bm:(new e).rotate(s.ry,0,1,0).translate(s.pos),blend:"alpha",vs_uni:{uvMatrix:[1,0,0,0,1,0,0,0,0]},fs_uni:{tex1:"cpanel"+this.id,colmode:2,shmode:1}},t.addModel(this.model)}show(t){this.hide=!t,this.model.hide=this.hide}update(t,e){if(!this.hide){this.j2c.clear(this.clearColor);for(let t=0;t<e.length;t++)null!==e[t]&&(this.dd[t].str=e[t]);this.j2c.draw(this.dd),t.updateTex("cpanel"+this.id,this.pcanvas)}}},Beam:class{constructor(t){this.len=200,this.color=[1,1,0,1],this.cofs=[.3,-.5,.2],this.vs=this.cofs.slice(0),this.ve=[this.len/2,this.len/2,-this.len],this.bv=[0,0,-1],t.addModel({name:"beam",geo:{mode:"lines",vtx_at:["position"],vtx:this.vs.concat(this.ve)},fs_uni:{colmode:0,shmode:1,bcolor:this.color}})}update(t,e){let s=t.getModelData("beam").geo.vtx,h=POX.poxp.gPad;if(h&&h.pose){this.ori=h.pose.orientation;let o=this.cofs[0]*("right"==h.hand?1:-1),a=this.cofs[1],n=this.cofs[2],l=i.v2q(-e.camRY,0,1,0),c=(new i).q2m(i.qMult(l,this.ori));c.translate(e.camCX,e.camCY,e.camCZ),this.vs=c.multVec4(o,0,n,1),this.vs[1]=a+e.camCY,this.ve=c.multVec4(0,0,-this.len,1),this.bv=i.V3norm(i.V3sub(this.ve,this.vs)),s[0]=this.vs[0],s[1]=this.vs[1],s[2]=this.vs[2],s[3]=this.ve[0],s[4]=this.ve[1],s[5]=this.ve[2],t.updateModel("beam","vbo",s)}}},Pool:class{constructor(){this._use=[],this._free=[]}CreateInstance(){return{}}InitInstance(t){return t}Rent(){let t;return this._free.length>0?(t=this._free[this._free.length-1],this._free.pop()):t=this.CreateInstance(),this.InitInstance(t),this._use.push(t),t}Return(t){for(let e in this._use)if(this._use[e]===t){this._use.splice(e,1);break}this._free.push(t)}Alloc(t){for(let e=0;e<t;e++)this._free.push(this.CreateInstance())}GetInstances(){return this._use}}}});
  //# sourceMappingURL=sourcemaps/util.js.map
  