/* v 3.17 author http://codecanyon.net/user/creativeinteractivemedia/portfolio?ref=creativeinteractivemedia */ var FLIPBOOK=FLIPBOOK||{};FLIPBOOK.PageWebGL=function(t,e,i,o,s,n){THREE.Object3D.call(this),this.book=t,this.index=e,this.pW=o.pageWidth,this.pH=o.pageHeight,this.nfacesw=o.pageSegmentsW,this.nfacesh=o.pageSegmentsH,this.mats=[],this.pageHardness=i,this.pageThickness=i,this.duration=o.pageFlipDuration,this.angle=.25*Math.PI*this.pW/this.pH,this.force=10,this.offset=0,this.to=null,this.mod=null,this.bend=null,this.pivot=null,this.isFlippedLeft=!1,this.isFlippedRight=!0,this.flippingLeft=!1,this.flippingRight=!1;var r=(this.options=o).rightToLeft?o.pages.length/2-this.index-1:this.index;this.indexF=o.rightToLeft?2*r+1:2*r,this.indexB=o.rightToLeft?2*r:2*r+1,this.showing=!1,this.preloaderMatF=s,this.preloaderMatB=n;var h=this;0==e&&this.options.cornerCurl&&(this.nfacesw=20,this.nfacesh=20,this.cornerCurlTween=new FLIPBOOK.TWEEN.Tween(0).to(1,1e3).easing(FLIPBOOK.TWEEN.Easing.Sinusoidal.Out).onUpdate(function(t){h.cornerCurl&&(h.b2.force=-1.8*t,h.modF.apply())}).repeat(11e3).start()),this.gF=new THREE.BoxGeometry(this.pW,this.pH,.01,this.nfacesw,this.nfacesh,0);var a=new THREE.MeshBasicMaterial({color:15592941}),p=[a,a,a,a,s,n],c=[a,a,a,a,a,a];this.options.pagePreloader&&(c=[a,a,a,a,s,n]),this.cube=new THREE.Mesh(this.gF,p),this.cube.position.x=.5*this.pW,this.options.shadows&&(this.cube.castShadow=!0,this.cube.receiveShadow=!0),this.gF.faceVertexUvs[1]=this.gF.faceVertexUvs[0],this.showMat(),this.cubeEmpty=new THREE.Mesh(new THREE.BoxGeometry(this.pW,this.pH,.01,1,1,0),c),this.cubeEmpty.position.x=.5*this.pW,this.pageFlippedAngle=Math.PI*this.options.pageFlippedAngle/180,this.bendF=new MOD3.Bend(0,0,0),this.bendF.constraint=MOD3.ModConstant.LEFT,this.pH>this.pW&&(this.bendF.switchAxes=!0),this.b2=new MOD3.Bend(0,0,0),this.b2.constraint=MOD3.ModConstant.LEFT,this.pH>this.pW&&(this.b2.switchAxes=!0),this.b2.offset=.98,this.b2.setAngle(1),this.modF=new MOD3.ModifierStack(new MOD3.LibraryThree,this.cube),this.modF.addModifier(this.bendF),0==e&&this.options.cornerCurl&&this.modF.addModifier(this.b2),this.modF.apply()},FLIPBOOK.PageWebGL.prototype=new THREE.Object3D,FLIPBOOK.PageWebGL.prototype.constructor=FLIPBOOK.PageWebGL,FLIPBOOK.PageWebGL.prototype.startCornerCurl=function(){this.cornerCurl=!0},FLIPBOOK.PageWebGL.prototype.stopCornerCurl=function(){this.cornerCurl=!1,this.b2.force=0,this.modF.apply()},FLIPBOOK.PageWebGL.prototype.onPageCanvasLoaded=function(t,e,i){var o,s,n;"front"==e&&this.sizeFront!=t.size?(this.sizeFront=t.size,s=t.canvas,(o=new THREE.CanvasTexture(s)).minFilter=THREE.LinearFilter,o.needsUpdate=!0,o.repeat.x=s.scaleX,o.repeat.y=s.scaleY,o.offset.y=1-s.scaleY,s.double&&(o.offset.x=.5),this.frontMaterial=this.createMaterial(o,"front"),this.frontMaterial.needsUpdate=!0,this.setFrontMat(this.frontMaterial)):"back"==e&&this.sizeBack!=t.size&&(this.sizeBack=t.size,s=t.canvas,(n=new THREE.CanvasTexture(s)).minFilter=THREE.LinearFilter,n.needsUpdate=!0,n.repeat.x=s.scaleX,n.repeat.y=s.scaleY,n.offset.y=1-s.scaleY,this.backMaterial=this.createMaterial(n,"back"),this.backMaterial.needsUpdate=!0,this.setBackMat(this.backMaterial)),i.call(this)},FLIPBOOK.PageWebGL.prototype.loadHTML=function(t,e){var i="front"==t?this.indexF:this.indexB,o=this;this.htmlLoaded?e.call(this):this.options.main.loadPageHTML(i,function(t){e.call(o)})},FLIPBOOK.PageWebGL.prototype.load=function(t,i){var e=this.book.model;if(e.wrapperH&&e.zoom){for(var o=this.book.pages,s=this,n=this.book.options,r=0;r").css("pointer-events","all").appendTo(this.$pageR),this.$pageL=jQuery(document.createElement("div")).addClass("L").css({width:1e3*this.options.pageWidth/this.options.pageHeight+"px",height:"1000px",position:"absolute",top:"-500px",left:-1e3*this.options.pageWidth/this.options.pageHeight+"px","pointer-events":"none"}).appendTo(e),this.$pageLInner=jQuery(document.createElement("div")).css("pointer-events","all").appendTo(this.$pageL),this.$pageC=jQuery(document.createElement("div")).addClass("C").css({width:2e3*this.options.pageWidth/this.options.pageHeight+"px",height:"1000px",position:"absolute",top:"-500px",left:-1e3*this.options.pageWidth/this.options.pageHeight+"px","pointer-events":"none"}).appendTo(e),this.$pageCInner=jQuery(document.createElement("div")).css("pointer-events","all").appendTo(this.$pageC),this.htmlLayer=new FLIPBOOK.CSS3DObject(t),this.Scene.add(this.htmlLayer),this.cssRenderer=new FLIPBOOK.CSS3DRenderer;this.wrapper;this.wrapper.appendChild(this.cssRenderer.domElement),this.cssRenderer.domElement.style.position="absolute",this.cssRenderer.domElement.style.top="0",this.cssRenderer.domElement.style.left="0",this.cssRenderer.domElement.style.pointerEvents="none",this.cssRenderer.domElement.className="cssRenderer "+Math.random();var i=this;this.model.on("toolSelect",function(){i.updateTool()}),this.model.on("toolMove",function(){i.updateTool()})},FLIPBOOK.BookWebGL.prototype.enablePrev=function(t){this.prevEnabled=t},FLIPBOOK.BookWebGL.prototype.enableNext=function(t){this.nextEnabled=t},FLIPBOOK.BookWebGL.prototype.isZoomed=function(){return this.options.zoom>this.options.zoomMin&&1this.options.pages.length&&(t=this.options.pages.length),1!=this.view||i||(s=e?0:300,t%2==0?this.focusLeft(s):this.focusRight(s)),t%2!=0&&t--,t==this.rightIndex)return this.loadPages(),void this.turnPageComplete();this.goingToPage=!0;var n=this,r=1e3*this.options.pageFlipDuration/6;if(void 0!==e&&e){if(t>n.rightIndex)for(;n.rightIndext;)this.prevPageInstant();return this.updateBookPosition(),this.loadPages(),void this.turnPageComplete()}this.rightIndex>t?(r=1/(this.rightIndex-t)*this.options.pageFlipDuration*1e3/6,10t?(this.prevPage(!1),0=this.options.numPages?this.focusLeft():this.focusBoth(),this.updateHtmlLayerPosition(),this.needsUpdate=!0},FLIPBOOK.BookWebGL.prototype.updateHtmlLayerPosition=function(){this.htmlLayer&&(this.htmlLayer.position.x=this.centerContainer.position.x,this.htmlLayer.position.y=this.centerContainer.position.y),this.needsUpdate=!0},FLIPBOOK.BookWebGL.prototype.turnPageComplete=function(){this.goingToPage=!1,this.options.main.turnPageComplete()},FLIPBOOK.BookWebGL.prototype.loadPages=function(){for(var t=this.pages,e=this.options.main,i=0;is.index+2&&(o.hideMat(),this.options.pdfMode||o.disposeMat())}var s=this.pages[this.flippedleft],n=this.pages[this.flippedleft-1],r=(this.pages[this.flippedleft-2],this.pages[this.flippedleft+1],this.pages[this.flippedleft-3],this.pages[this.flippedleft+2],this.updateHtmlLayer),h=this.loadMorePages,a=this,t=this.pages;(e=this.options.main).setLoadingProgress(.1),n?n.load("back",function(t){s?s.load("front",function(t){n.loadHTML("back",function(){s.loadHTML("front",function(){r.call(a)})}),e.setLoadingProgress(1),h.call(a)}):(n.loadHTML("back",function(){r.call(a)}),e.setLoadingProgress(1),h.call(a))}):s.load("front",function(t){s.loadHTML("front",function(){r.call(a)}),e.setLoadingProgress(1),h.call(a)})},FLIPBOOK.BookWebGL.prototype.focusLeft=function(t,e,i){this.options.pageHeight;var o=this.options.pageWidth,s=(this.wrapperW,this.wrapperH,this.zoom,.5*o*this.centerContainer.scale.x);this.moveToPos({x:s,y:0},t,e,i)},FLIPBOOK.BookWebGL.prototype.focusRight=function(t,e,i){this.options.pageHeight;var o=this.options.pageWidth,s=(this.wrapperW,this.wrapperH,this.zoom,.5*-o*this.centerContainer.scale.x);this.moveToPos({x:s,y:0},t,e,i)},FLIPBOOK.BookWebGL.prototype.focusBoth=function(t,e,i){this.options.pageHeight,this.options.pageWidth,this.wrapperW,this.wrapperH,this.zoom;this.moveToPos({x:0,y:0},t,e,i)},FLIPBOOK.BookWebGL.prototype.moveToPos=function(t,e,i,o){var s;e&&this.movingTo!=t&&this.centerContainer.position.x!=t.x?((s=this).movingTo=t,this.bookMoveTween&&this.bookMoveTween.stop(),this.bookMoveTween=new FLIPBOOK.TWEEN.Tween(this.centerContainer.position).to({x:t.x,y:t.y},e).easing(FLIPBOOK.TWEEN.Easing.Sinusoidal.Out).onUpdate(function(){s.updateHtmlLayerPosition()}).onComplete(function(){s.movingTo=null,s.updateHtmlLayerPosition(),o&&o.call(s)}).delay(i||0).start()):(this.centerContainer.position.x=t.x,this.centerContainer.position.y=t.y,o&&o.call(this))},FLIPBOOK.BookWebGL.prototype.isFocusedLeft=function(){return 0this.options.zoomMax?this.options.zoomMax:t,newZoom=tthis.options.tiltMax?this.options.tiltMax:e)this.options.panMax?this.options.panMax:e)=this.start&&t<=this.end},e.Range.prototype.normalize=function(t){return e.XMath.normalize(this.start,this.end,t)},e.Range.prototype.toRange=function(t){return e.XMath.toRange(this.start,this.end,t)},e.Range.prototype.trim=function(t){return e.XMath.trim(this.start,this.end,t)},e.Range.prototype.interpolate=function(t,e){return this.toRange(e.normalize(t))},e.Range.prototype.toString=function(){return"["+this.start+" - "+this.end+"]"}}(MOD3),function(t){t.Phase=function(t){void(this.value=0)!==t&&(this.value=t)},t.Phase.prototype.getPhasedValue=function(){return Math.sin(this.value)},t.Phase.prototype.getAbsPhasedValue=function(){return Math.abs(this.getPhasedValue())},t.Phase.prototype.getNormValue=function(){return.5*(this.getPhasedValue()+1)}}(MOD3),function(t){t.Point=function(t,e){this.y=this.x=0,void 0!==t&&(this.x=t),void 0!==e&&(this.y=e)},t.Point.prototype.clone=function(){return new t.Point(this.x,this.y)}}(MOD3),function(e){e.Matrix=function(t,e,i,o){this.m11=1,this.m21=this.m12=0,this.m22=1,void 0!==t&&(this.m11=t),void 0!==e&&(this.m12=e),void 0!==i&&(this.m21=i),void 0!==o&&(this.m22=o)},e.Matrix.prototype.rotate=function(t){var e=Math.cos(t),t=Math.sin(t);return this.m11=e,this.m12=-t,this.m21=t,this.m22=e,this},e.Matrix.prototype.scale=function(t,e){return this.m21=this.m12=0,void 0!==t&&(this.m22=this.m11=t),void 0!==e&&(this.m22=e),this},e.Matrix.prototype.multiply=function(t){var e=this.m11,i=this.m12,o=this.m21,s=this.m22,n=t.m11,r=t.m12,h=t.m21,t=t.m22;return this.m11=e*n+i*h,this.m12=e*r+i*t,this.m21=o*n+s*h,this.m22=o*r+s*t,this},e.Matrix.prototype.transformPoint=function(t){return new e.Point(this.m11*t.x+this.m12*t.y,this.m21*t.x+this.m22*t.y)}}(MOD3),function(a){a.Vector3=function(t,e,i){this.z=this.y=this.x=null,this.x=t,this.y=e,this.z=i},a.Vector3.ZERO=function(){return new a.Vector3(0,0,0)},a.Vector3.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},a.Vector3.prototype.clone=function(){return new a.Vector3(this.x,this.y,this.z)},a.Vector3.prototype.equals=function(t){return this.x==t.x&&this.y==t.y&&this.z==t.z},a.Vector3.prototype.zero=function(){this.x=this.y=this.z=0},a.Vector3.prototype.negate=function(){return new a.Vector3(-this.x,-this.y,-this.z)},a.Vector3.prototype.add=function(t){return new a.Vector3(this.x+t.x,this.y+t.y,this.z+t.z)},a.Vector3.prototype.subtract=function(t){return new a.Vector3(this.x-t.x,this.y-t.y,this.z-t.z)},a.Vector3.prototype.multiplyScalar=function(t){return new a.Vector3(this.x*t,this.y*t,this.z*t)},a.Vector3.prototype.multiply=function(t){return new a.Vector3(this.x*t.x,this.y*t.y,this.z*t.z)},a.Vector3.prototype.divide=function(t){return t=1/t,new a.Vector3(this.x*t,this.y*t,this.z*t)},a.Vector3.prototype.normalize=function(){var t=this.x,e=this.y,i=this.z;0<(t=t*t+e*e+i*i)&&(t=1/Math.sqrt(t),this.x*=t,this.y*=t,this.z*=t)},a.Vector3.prototype.getMagnitude=function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},a.Vector3.prototype.setMagnitude=function(t){this.normalize(),this.x*=t,this.y*=t,this.z*=t},a.Vector3.prototype.toString=function(){return"["+this.x+" , "+this.y+" , "+this.z+"]"},a.Vector3.prototype.sum=function(t,e){return t.add(e)},a.Vector3.prototype.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},a.Vector3.prototype.cross=function(t,e){var i=t.x,o=t.y,s=t.z,n=e.x,r=e.y,h=e.z;return new a.Vector3(o*h-s*r,s*n-i*h,i*r-o*n)},a.Vector3.prototype.distance=function(t,e){var i=t.x-e.x,o=t.y-e.y,s=t.z-e.z;return Math.sqrt(i*i+o*o+s*s)}}(MOD3),function(t){t.Matrix4=function(t,e,i,o,s,n,r,h,a,p,c,l,d,u,g,f){this.n11=1,this.n21=this.n14=this.n13=this.n12=0,this.n22=1,this.n32=this.n31=this.n24=this.n23=0,this.n33=1,this.n43=this.n42=this.n41=this.n34=0,this.n44=1,void 0!==t&&(this.n11=t),void 0!==e&&(this.n12=e),void 0!==i&&(this.n13=i),void 0!==o&&(this.n14=o),void 0!==s&&(this.n21=s),void 0!==n&&(this.n22=n),void 0!==r&&(this.n23=r),void 0!==h&&(this.n24=h),void 0!==a&&(this.n31=a),void 0!==p&&(this.n32=p),void 0!==c&&(this.n33=c),void 0!==l&&(this.n34=l),void 0!==d&&(this.n41=d),void 0!==u&&(this.n42=u),void 0!==g&&(this.n43=g),void 0!==f&&(this.n44=f)},t.Matrix4.prototype.translationMatrix=function(t,e,i){return this.n14=t,this.n24=e,this.n34=i,this},t.Matrix4.prototype.scaleMatrix=function(t,e,i){return this.n11=t,this.n22=e,this.n33=i,this},t.Matrix4.prototype.rotationMatrix=function(t,e,i,o){var s=Math.cos(o),n=Math.sin(o),r=t*e*(o=1-s),h=e*i*o,a=t*i*o,p=n*i,c=n*e;return n*=t,this.n11=s+t*t*o,this.n12=r-p,this.n13=c+a,this.n14=0,this.n21=p+r,this.n22=s+e*e*o,this.n23=h-n,this.n24=0,this.n31=a-c,this.n32=n+h,this.n33=s+i*i*o,this.n34=0,this},t.Matrix4.prototype.calculateMultiply=function(t,e){var i=t.n11,o=e.n11,s=t.n21,n=e.n21,r=t.n31,h=e.n31,a=t.n12,p=e.n12,c=t.n22,l=e.n22,d=t.n32,u=e.n32,g=t.n13,f=e.n13,m=t.n23,y=e.n23,x=t.n33,M=e.n33,P=t.n14,v=e.n14,L=t.n24,O=e.n24,b=t.n34,w=e.n34;this.n11=i*o+a*n+g*h,this.n12=i*p+a*l+g*u,this.n13=i*f+a*y+g*M,this.n14=i*v+a*O+g*w+P,this.n21=s*o+c*n+m*h,this.n22=s*p+c*l+m*u,this.n23=s*f+c*y+m*M,this.n24=s*v+c*O+m*w+L,this.n31=r*o+d*n+x*h,this.n32=r*p+d*l+x*u,this.n33=r*f+d*y+x*M,this.n34=r*v+d*O+x*w+b},t.Matrix4.prototype.multiply=function(t,e){return this.calculateMultiply(t,e),this},t.Matrix4.prototype.multiplyVector=function(t,e){var i=e.x,o=e.y,s=e.z;e.x=i*t.n11+o*t.n12+s*t.n13+t.n14,e.y=i*t.n21+o*t.n22+s*t.n23+t.n24,e.z=i*t.n31+o*t.n32+s*t.n33+t.n34}}(MOD3),function(i){i.VertexProxy=function(t){this.originalZ=this.originalY=this.originalX=this.ratioZ=this.ratioY=this.ratioX=null,void 0!==t&&(this.vertex=t)},i.VertexProxy.prototype.setVertex=function(){},i.VertexProxy.prototype.setRatios=function(t,e,i){this.ratioX=t,this.ratioY=e,this.ratioZ=i},i.VertexProxy.prototype.setOriginalPosition=function(t,e,i){this.originalX=t,this.originalY=e,this.originalZ=i},i.VertexProxy.prototype.getX=function(){},i.VertexProxy.prototype.getY=function(){},i.VertexProxy.prototype.getZ=function(){},i.VertexProxy.prototype.setX=function(){},i.VertexProxy.prototype.setY=function(){},i.VertexProxy.prototype.setZ=function(){},i.VertexProxy.prototype.getValue=function(t){switch(t){case i.ModConstant.X:return this.getX();case i.ModConstant.Y:return this.getY();case i.ModConstant.Z:return this.getZ()}return 0},i.VertexProxy.prototype.setValue=function(t,e){switch(t){case i.ModConstant.X:this.setX(e);break;case i.ModConstant.Y:this.setY(e);break;case i.ModConstant.Z:this.setZ(e)}},i.VertexProxy.prototype.getRatio=function(t){switch(t){case i.ModConstant.X:return this.ratioX;case i.ModConstant.Y:return this.ratioY;case i.ModConstant.Z:return this.ratioZ}return-1},i.VertexProxy.prototype.getOriginalValue=function(t){switch(t){case i.ModConstant.X:return this.originalX;case i.ModConstant.Y:return this.originalY;case i.ModConstant.Z:return this.originalZ}return 0},i.VertexProxy.prototype.reset=function(){this.setX(this.originalX),this.setY(this.originalY),this.setZ(this.originalZ)},i.VertexProxy.prototype.collapse=function(){this.originalX=this.getX(),this.originalY=this.getY(),this.originalZ=this.getZ()},i.VertexProxy.prototype.getVector=function(){return new i.Vector3(this.getX(),this.getY(),this.getZ())},i.VertexProxy.prototype.setVector=function(t){this.setX(t.x),this.setY(t.y),this.setZ(t.z)},i.VertexProxy.prototype.getRatioVector=function(){return new i.Vector3(this.ratioX,this.ratioY,this.ratioZ)}}(MOD3),function(t){t.FaceProxy=function(){this.vertices=[]},t.FaceProxy.prototype.addVertex=function(t){this.vertices.push(t)},t.FaceProxy.prototype.getVertices=function(){return this.vertices}}(MOD3),function(m){m.MeshProxy=function(){this.depth=this.height=this.width=this.minAxis=this.midAxis=this.maxAxis=this.minZ=this.minY=this.minX=this.maxZ=this.maxY=this.maxX=null,this.vertices=[],this.faces=[],this.mesh=null},m.MeshProxy.prototype.getVertices=function(){return this.vertices},m.MeshProxy.prototype.getFaces=function(){return this.faces},m.MeshProxy.prototype.analyzeGeometry=function(){for(var t,e,i,o,s,n,r,h,a,p,c=this.getVertices(),l=c.length,d=l,u=!0,g=Math.min,f=Math.max;0<=--d;)e=(t=c[d]).getX(),i=t.getY(),o=t.getZ(),u?(s=n=e,r=h=i,a=p=o,u=!1):(s=g(s,e),r=g(r,i),a=g(a,o),n=f(n,e),h=f(h,i),p=f(p,o)),t.setOriginalPosition(e,i,o);for(e=n-s,i=h-r,depth=p-a,this.width=e,this.height=i,this.depth=depth,this.minX=s,this.maxX=n,this.minY=r,this.maxY=h,this.minZ=a,this.maxZ=p,d=f(e,f(i,depth)),g=g(e,g(i,depth)),d==e&&g==i?(this.minAxis=m.ModConstant.Y,this.midAxis=m.ModConstant.Z,this.maxAxis=m.ModConstant.X):d==e&&g==depth?(this.minAxis=m.ModConstant.Z,this.midAxis=m.ModConstant.Y,this.maxAxis=m.ModConstant.X):d==i&&g==e?(this.minAxis=m.ModConstant.X,this.midAxis=m.ModConstant.Z,this.maxAxis=m.ModConstant.Y):d==i&&g==depth?(this.minAxis=m.ModConstant.Z,this.midAxis=m.ModConstant.X,this.maxAxis=m.ModConstant.Y):d==depth&&g==e?(this.minAxis=m.ModConstant.X,this.midAxis=m.ModConstant.Y,this.maxAxis=m.ModConstant.Z):d==depth&&g==i&&(this.minAxis=m.ModConstant.Y,this.midAxis=m.ModConstant.X,this.maxAxis=m.ModConstant.Z),d=l;0<=--d;)(t=c[d]).setRatios((t.getX()-s)/e,(t.getY()-r)/i,(t.getZ()-a)/depth)},m.MeshProxy.prototype.resetGeometry=function(){for(var t=this.getVertices(),e=t.length;0<=--e;)t[e].reset()},m.MeshProxy.prototype.collapseGeometry=function(){for(var t=this.getVertices(),e=t.length;0<=--e;)t[e].collapse();this.analyzeGeometry()},m.MeshProxy.prototype.getMin=function(t){switch(t){case m.ModConstant.X:return this.minX;case m.ModConstant.Y:return this.minY;case m.ModConstant.Z:return this.minZ}return-1},m.MeshProxy.prototype.getMax=function(t){switch(t){case m.ModConstant.X:return this.maxX;case m.ModConstant.Y:return this.maxY;case m.ModConstant.Z:return this.maxZ}return-1},m.MeshProxy.prototype.getSize=function(t){switch(t){case m.ModConstant.X:return this.width;case m.ModConstant.Y:return this.height;case m.ModConstant.Z:return this.depth}return-1},m.MeshProxy.prototype.setMesh=function(t){this.mesh=t,this.vertices=[],this.faces=[]},m.MeshProxy.prototype.postApply=function(){},m.MeshProxy.prototype.updateMeshPosition=function(){}}(MOD3),function(t){t.Modifier=function(){this.mod=null},t.Modifier.prototype.setModifiable=function(t){this.mod=t},t.Modifier.prototype.getVertices=function(){return this.mod.getVertices()},t.Modifier.prototype.apply=function(){}}(MOD3),MOD3.Library3d=function(){this.id="",this.vertexClass=this.meshClass=null},function(t){t.PluginFactory={},t.PluginFactory.getMeshProxy=function(t){return new t.meshClass}}(MOD3),function(i){i.ModifierStack=function(t,e){this.lib3d=t,this.stack=this.baseMesh=null,this.baseMesh=i.PluginFactory.getMeshProxy(t),this.baseMesh.setMesh(e),this.baseMesh.analyzeGeometry(),this.stack=[]},i.ModifierStack.prototype.addModifier=function(t){t.setModifiable(this.baseMesh),this.stack.push(t)},i.ModifierStack.prototype.apply=function(){this.baseMesh.resetGeometry();for(var t=this.stack,e=t.length,i=0;ih||(e=t.getRatio(r)-h,a&&(e=Math.abs(e)),i=t.getRatio(g),p&&(i=1-i),i=c+i*l,e=Math.pow(Math.abs(e),d)*f.XMath.sign(e,1),e=t.getValue(g)+u*e*i,t.setValue(g,e))},f.Skew.prototype.getDisplaceAxis=function(){switch(this.skewAxis){case f.ModConstant.X:return this.swapAxes?f.ModConstant.Z:f.ModConstant.Y;case f.ModConstant.Y:return this.swapAxes?f.ModConstant.Z:f.ModConstant.X;case f.ModConstant.Z:return this.swapAxes?f.ModConstant.Y:f.ModConstant.X;default:return 0}}}(MOD3),function(p){p.Taper=function(t){this.power=this.force=null,this.start=0,this.end=1,this.vector=new p.Vector3(1,0,1),this.vector2=new p.Vector3(0,1,0),void 0!==t&&(this.force=t),this.power=1},p.Taper.prototype=new p.Modifier,p.Taper.prototype.constructor=p.Taper,p.Taper.prototype.setFalloff=function(t,e){this.start=0,this.end=1,void 0!==t&&(this.start=t),void 0!==e&&(this.end=e)},p.Taper.prototype.apply=function(){for(var t,e,i,o=this.mod.getVertices(),s=o.length,n=this.vector,r=this.vector2,h=this.force,a=this.power;0<=--s;)e=(t=o[s]).getRatioVector().multiply(r),e=h*Math.pow(e.getMagnitude(),a),e=(new p.Matrix4).scaleMatrix(1+e*n.x,1+e*n.y,1+e*n.z),i=t.getVector(),(new p.Matrix4).multiplyVector(e,i),t.setVector(i)}}(MOD3),function(h){h.Wheel=function(){this.radius=this.roll=this.turn=this.speed=null,this.steerVector=new h.Vector3(0,1,0),this.rollVector=new h.Vector3(0,0,1),this.roll=this.turn=this.speed=0},h.Wheel.prototype=new h.Modifier,h.Wheel.prototype.constructor=h.Wheel,h.Wheel.prototype.setModifiable=function(t){h.Modifier.prototype.setModifiable.call(this,t),this.radius=.5*this.mod.width},h.Wheel.prototype.apply=function(){this.roll+=this.speed;for(var t,e=this.mod.getVertices(),i=e.length,o=this.steerVector,s=this.turn,n=this.rollVector,r=this.roll,r=0!=s?(t=(new h.Matrix4).rotationMatrix(o.x,o.y,o.z,s),o=n.clone(),(new h.Matrix4).multiplyVector(t,o),(new h.Matrix4).rotationMatrix(o.x,o.y,o.z,r)):(new h.Matrix4).rotationMatrix(n.x,n.y,n.z,r);0<=--i;)n=(o=e[i]).getVector().clone(),0!=s&&(new h.Matrix4).multiplyVector(t,n),(new h.Matrix4).multiplyVector(r,n),o.setX(n.x),o.setY(n.y),o.setZ(n.z)},h.Wheel.prototype.getStep=function(){return this.radius*this.speed*h.Constants.invPI},h.Wheel.prototype.getPerimeter=function(){return this.radius*h.Constants.doublePI}}(MOD3),function(a){a.Break=function(t,e){this.bv=new a.Vector3(0,1,0),this.angle=this.offset=0,void 0!==t&&(this.offset=t),void 0!==e&&(this.angle=e),this.range=new a.Range(0,1)},a.Break.prototype=new a.Modifier,a.Break.prototype.constructor=a.Break,a.Break.prototype.apply=function(){for(var t=this.mod,e=t.getVertices(),i=e.length,o=this.range,s=this.angle,n=this.bv,r=(t=new a.Vector3(0,0,-(t.minZ+t.depth*this.offset))).negate(),h=(new a.Matrix4).rotationMatrix(n.x,n.y,n.z,s);0<=--i;)0<=(n=(n=(s=e[i]).getVector()).add(t)).z&&o.isIn(s.ratioY)&&(new a.Matrix4).multiplyVector(h,n),n=n.add(r),s.setX(n.x),s.setY(n.y),s.setZ(n.z)}}(MOD3),function(e){e.Noise=function(t){this.force=0,this.axc=e.ModConstant.NONE,this.end=this.start=0,void 0!==t&&(this.force=t)},e.Noise.prototype=new e.Modifier,e.Noise.prototype.constructor=e.Noise,e.Noise.prototype.constraintAxes=function(t){this.axc=t},e.Noise.prototype.setFalloff=function(t,e){this.start=0,this.end=1,void 0!==t&&(this.start=t),void 0!==e&&(this.end=e)},e.Noise.prototype.apply=function(){for(var t,e,i,o=this.mod,s=this.axc,n=this.start,r=this.end,h=o.getVertices(),a=h.length,p=this.force,c=.5*p,l=Math.random;0<=--a;)t=h[a],e=l()*p-c,i=t.getRatio(o.maxAxis),n>1&1||t.setY(t.getY()+e*i),s>>2&1||t.setZ(t.getZ()+e*i)}}(MOD3),function(t){t.LibraryThree=function(){this.id="Three.js",this.meshClass=t.MeshThree,this.vertexClass=t.VertexThree},t.LibraryThree.prototype=new t.Library3d,t.LibraryThree.prototype.constructor=t.LibraryThree}(MOD3),function(t){t.VertexThree=function(t){this.mesh=t},t.VertexThree.prototype=new t.VertexProxy,t.VertexThree.prototype.setVertex=function(t){this.vertex=t,this.originalX=t.x,this.originalY=t.y,this.originalZ=t.z},t.VertexThree.prototype.getX=function(){return this.vertex.x},t.VertexThree.prototype.getY=function(){return this.vertex.y},t.VertexThree.prototype.getZ=function(){return this.vertex.z},t.VertexThree.prototype.setX=function(t){this.vertex.x=t,(t=this.mesh).geometry.verticesNeedUpdate=!0,t.geometry.normalsNeedUpdate=!0,t.geometry.buffersNeedUpdate=!0,t.geometry.dynamic=!0},t.VertexThree.prototype.setY=function(t){this.vertex.y=t,(t=this.mesh).geometry.verticesNeedUpdate=!0,t.geometry.normalsNeedUpdate=!0,t.geometry.buffersNeedUpdate=!0,t.geometry.dynamic=!0},t.VertexThree.prototype.setZ=function(t){this.vertex.z=t,(t=this.mesh).geometry.verticesNeedUpdate=!0,t.geometry.normalsNeedUpdate=!0,t.geometry.buffersNeedUpdate=!0,t.geometry.dynamic=!0}}(MOD3),function(h){h.MeshThree=function(){},h.MeshThree.prototype=new h.MeshProxy,h.MeshThree.prototype.setMesh=function(t){h.MeshProxy.prototype.setMesh.call(this,t);for(var e,t=[],i=0,o=this.mesh.geometry.vertices,s=o.length,n=this.mesh.geometry.faces,r=n.length,i=0;i