mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 12:22:03 +08:00
3 lines
834 KiB
JavaScript
3 lines
834 KiB
JavaScript
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("gsap"),r=0,n=1,i=2,a=0,o=1,s=2,l=3;function c(){}Object.assign(c.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var r=this._listeners[e];if(void 0!==r){var n=r.indexOf(t);-1!==n&&r.splice(n,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var r=t.slice(0),n=0,i=r.length;n<i;n++)r[n].call(this,e)}}}});for(var h=[],u=0;u<256;u++)h[u]=(u<16?"0":"")+u.toString(16);var d=1234567,p={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,r=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(h[255&e]+h[e>>8&255]+h[e>>16&255]+h[e>>24&255]+"-"+h[255&t]+h[t>>8&255]+"-"+h[t>>16&15|64]+h[t>>24&255]+"-"+h[63&r|128]+h[r>>8&255]+"-"+h[r>>16&255]+h[r>>24&255]+h[255&n]+h[n>>8&255]+h[n>>16&255]+h[n>>24&255]).toUpperCase()},clamp:function(e,t,r){return Math.max(t,Math.min(r,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,r,n,i){return n+(e-t)*(i-n)/(r-t)},lerp:function(e,t,r){return(1-r)*e+r*t},damp:function(e,t,r,n){return p.lerp(e,t,1-Math.exp(-r*n))},pingpong:function(e,t){return void 0===t&&(t=1),t-Math.abs(p.euclideanModulo(e,2*t)-t)},smoothstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*(3-2*e)},smootherstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return void 0!==e&&(d=e%2147483647),((d=16807*d%2147483647)-1)/2147483646},degToRad:function(e){return e*p.DEG2RAD},radToDeg:function(e){return e*p.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,r,n,i){var a=Math.cos,o=Math.sin,s=a(r/2),l=o(r/2),c=a((t+n)/2),h=o((t+n)/2),u=a((t-n)/2),d=o((t-n)/2),p=a((n-t)/2),f=o((n-t)/2);switch(i){case"XYX":e.set(s*h,l*u,l*d,s*c);break;case"YZY":e.set(l*d,s*h,l*u,s*c);break;case"ZXZ":e.set(l*u,l*d,s*h,s*c);break;case"XZX":e.set(s*h,l*f,l*p,s*c);break;case"YXY":e.set(l*p,s*h,l*f,s*c);break;case"ZYZ":e.set(l*f,l*p,s*h,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}},f=function(e,t){void 0===e&&(e=0),void 0===t&&(t=0),Object.defineProperty(this,"isVector2",{value:!0}),this.x=e,this.y=t},m={width:{configurable:!0},height:{configurable:!0}};m.width.get=function(){return this.x},m.width.set=function(e){this.x=e},m.height.get=function(){return this.y},m.height.set=function(e){this.y=e},f.prototype.set=function(e,t){return this.x=e,this.y=t,this},f.prototype.setScalar=function(e){return this.x=e,this.y=e,this},f.prototype.setX=function(e){return this.x=e,this},f.prototype.setY=function(e){return this.y=e,this},f.prototype.setComponent=function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this},f.prototype.getComponent=function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},f.prototype.clone=function(){return new this.constructor(this.x,this.y)},f.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},f.prototype.add=function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},f.p
|
||
|
//# sourceMappingURL=trois.min.js.map
|