skinview3d
Advanced tools
Comparing version 1.2.1 to 2.0.0-alpha.1
@@ -1,21 +0,2 @@ | ||
/** | ||
* skinview3d (https://github.com/bs-community/skinview3d) | ||
* | ||
* MIT License | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("three")):"function"==typeof define&&define.amd?define(["exports","three"],t):t((e=e||self).skinview3d={},e.THREE)}(this,(function(e,t){"use strict"; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function a(e,t){function a(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}function i(e,n,a,i,o,r){return[new t.Vector2(e/o,1-i/r),new t.Vector2(a/o,1-i/r),new t.Vector2(a/o,1-n/r),new t.Vector2(e/o,1-n/r)]}function o(e,t,n,a){return i(e,t,n,a,64,64)}function r(e,t,n,a){return i(e,t,n,a,64,32)}function s(e,t,n,a,i,o,r){e.faceVertexUvs[0]=[],e.faceVertexUvs[0][0]=[o[3],o[0],o[2]],e.faceVertexUvs[0][1]=[o[0],o[1],o[2]],e.faceVertexUvs[0][2]=[a[3],a[0],a[2]],e.faceVertexUvs[0][3]=[a[0],a[1],a[2]],e.faceVertexUvs[0][4]=[t[3],t[0],t[2]],e.faceVertexUvs[0][5]=[t[0],t[1],t[2]],e.faceVertexUvs[0][6]=[n[0],n[3],n[1]],e.faceVertexUvs[0][7]=[n[3],n[2],n[1]],e.faceVertexUvs[0][8]=[i[3],i[0],i[2]],e.faceVertexUvs[0][9]=[i[0],i[1],i[2]],e.faceVertexUvs[0][10]=[r[3],r[0],r[2]],e.faceVertexUvs[0][11]=[r[0],r[1],r[2]]}var h=.002,c=function(e){function t(t,n){var a=e.call(this)||this;return a.innerLayer=t,a.outerLayer=n,t.name="inner",n.name="outer",a}return a(t,e),t}(t.Group),d=function(e){function n(n,a){var i=e.call(this)||this;i.modelListeners=[],i._slim=!1;var r=new t.BoxGeometry(8,8,8,0,0,0);s(r,o(8,0,16,8),o(16,0,24,8),o(0,8,8,16),o(8,8,16,16),o(16,8,24,16),o(24,8,32,16));var d=new t.Mesh(r,n),l=new t.BoxGeometry(9,9,9,0,0,0);s(l,o(40,0,48,8),o(48,0,56,8),o(32,8,40,16),o(40,8,48,16),o(48,8,56,16),o(56,8,64,16));var p=new t.Mesh(l,a);p.renderOrder=-1,i.head=new c(d,p),i.head.name="head",i.head.add(d,p),i.add(i.head);var u=new t.BoxGeometry(8,12,4,0,0,0);s(u,o(20,16,28,20),o(28,16,36,20),o(16,20,20,32),o(20,20,28,32),o(28,20,32,32),o(32,20,40,32));var m=new t.Mesh(u,n),f=new t.BoxGeometry(9,13.5,4.5,0,0,0);s(f,o(20,32,28,36),o(28,32,36,36),o(16,36,20,48),o(20,36,28,48),o(28,36,32,48),o(32,36,40,48));var g=new t.Mesh(f,a);i.body=new c(m,g),i.body.name="body",i.body.add(m,g),i.body.position.y=-10,i.add(i.body);var y=new t.BoxGeometry(1,1,1,0,0,0),v=new t.Mesh(y,n);i.modelListeners.push((function(){v.scale.x=(i.slim?3:4)-h,v.scale.y=12-h,v.scale.z=4-h,i.slim?s(y,o(44,16,47,20),o(47,16,50,20),o(40,20,44,32),o(44,20,47,32),o(47,20,51,32),o(51,20,54,32)):s(y,o(44,16,48,20),o(48,16,52,20),o(40,20,44,32),o(44,20,48,32),o(48,20,52,32),o(52,20,56,32)),y.uvsNeedUpdate=!0,y.elementsNeedUpdate=!0}));var w=new t.BoxGeometry(1,1,1,0,0,0),b=new t.Mesh(w,a);b.renderOrder=1,i.modelListeners.push((function(){b.scale.x=(i.slim?3.375:4.5)-h,b.scale.y=13.5-h,b.scale.z=4.5-h,i.slim?s(w,o(44,32,47,36),o(47,32,50,36),o(40,36,44,48),o(44,36,47,48),o(47,36,51,48),o(51,36,54,48)):s(w,o(44,32,48,36),o(48,32,52,36),o(40,36,44,48),o(44,36,48,48),o(48,36,52,48),o(52,36,56,48)),w.uvsNeedUpdate=!0,w.elementsNeedUpdate=!0}));var M=new t.Group;M.add(v,b),M.position.y=-6,i.rightArm=new c(v,b),i.rightArm.name="rightArm",i.rightArm.add(M),i.rightArm.position.y=-4,i.modelListeners.push((function(){i.rightArm.position.x=i.slim?-5.5:-6})),i.add(i.rightArm);var E=new t.BoxGeometry(1,1,1,0,0,0),x=new t.Mesh(E,n);i.modelListeners.push((function(){x.scale.x=(i.slim?3:4)-h,x.scale.y=12-h,x.scale.z=4-h,i.slim?s(E,o(36,48,39,52),o(39,48,42,52),o(32,52,36,64),o(36,52,39,64),o(39,52,43,64),o(43,52,46,64)):s(E,o(36,48,40,52),o(40,48,44,52),o(32,52,36,64),o(36,52,40,64),o(40,52,44,64),o(44,52,48,64)),E.uvsNeedUpdate=!0,E.elementsNeedUpdate=!0}));var O=new t.BoxGeometry(1,1,1,0,0,0),L=new t.Mesh(O,a);L.renderOrder=1,i.modelListeners.push((function(){L.scale.x=(i.slim?3.375:4.5)-h,L.scale.y=13.5-h,L.scale.z=4.5-h,i.slim?s(O,o(52,48,55,52),o(55,48,58,52),o(48,52,52,64),o(52,52,55,64),o(55,52,59,64),o(59,52,62,64)):s(O,o(52,48,56,52),o(56,48,60,52),o(48,52,52,64),o(52,52,56,64),o(56,52,60,64),o(60,52,64,64)),O.uvsNeedUpdate=!0,O.elementsNeedUpdate=!0}));var P=new t.Group;P.add(x,L),P.position.y=-6,i.leftArm=new c(x,L),i.leftArm.name="leftArm",i.leftArm.add(P),i.leftArm.position.y=-4,i.modelListeners.push((function(){i.leftArm.position.x=i.slim?5.5:6})),i.add(i.leftArm);var S=new t.BoxGeometry(4-h,12-h,4-h,0,0,0);s(S,o(4,16,8,20),o(8,16,12,20),o(0,20,4,32),o(4,20,8,32),o(8,20,12,32),o(12,20,16,32));var A=new t.Mesh(S,n),T=new t.BoxGeometry(4.5-h,13.5-h,4.5-h,0,0,0);s(T,o(4,32,8,36),o(8,32,12,36),o(0,36,4,48),o(4,36,8,48),o(8,36,12,48),o(12,36,16,48));var k=new t.Mesh(T,a);k.renderOrder=1;var j=new t.Group;j.add(A,k),j.position.y=-6,i.rightLeg=new c(A,k),i.rightLeg.name="rightLeg",i.rightLeg.add(j),i.rightLeg.position.y=-16,i.rightLeg.position.x=-2,i.add(i.rightLeg);var U=new t.BoxGeometry(4-h,12-h,4-h,0,0,0);s(U,o(20,48,24,52),o(24,48,28,52),o(16,52,20,64),o(20,52,24,64),o(24,52,28,64),o(28,52,32,64));var D=new t.Mesh(U,n),I=new t.BoxGeometry(4.5-h,13.5-h,4.5-h,0,0,0);s(I,o(4,48,8,52),o(8,48,12,52),o(0,52,4,64),o(4,52,8,64),o(8,52,12,64),o(12,52,16,64));var C=new t.Mesh(I,a);C.renderOrder=1;var V=new t.Group;return V.add(D,C),V.position.y=-6,i.leftLeg=new c(D,C),i.leftLeg.name="leftLeg",i.leftLeg.add(V),i.leftLeg.position.y=-16,i.leftLeg.position.x=2,i.add(i.leftLeg),i.slim=!1,i}return a(n,e),Object.defineProperty(n.prototype,"slim",{get:function(){return this._slim},set:function(e){this._slim=e,this.modelListeners.forEach((function(e){return e()}))},enumerable:!0,configurable:!0}),n.prototype.getBodyParts=function(){return this.children.filter((function(e){return e instanceof c}))},n.prototype.setInnerLayerVisible=function(e){this.getBodyParts().forEach((function(t){return t.innerLayer.visible=e}))},n.prototype.setOuterLayerVisible=function(e){this.getBodyParts().forEach((function(t){return t.outerLayer.visible=e}))},n}(t.Group),l=function(e){function n(n){var a=e.call(this)||this,i=new t.BoxGeometry(10,16,1,0,0,0);return s(i,r(1,0,11,1),r(11,0,21,1),r(11,1,12,17),r(12,1,22,17),r(0,1,1,17),r(1,1,11,17)),a.cape=new t.Mesh(i,n),a.cape.position.y=-8,a.cape.position.z=-.5,a.add(a.cape),a}return a(n,e),n}(t.Group),p=function(e){function t(t,n,a){var i=e.call(this)||this;return i.skin=new d(t,n),i.skin.name="skin",i.skin.visible=!1,i.add(i.skin),i.cape=new l(a),i.cape.name="cape",i.cape.position.z=-2,i.cape.position.y=-4,i.cape.rotation.x=25*Math.PI/180,i.cape.visible=!1,i.add(i.cape),i}return a(t,e),t}(t.Group);function u(e,t,n){e instanceof Function?e(t,n):e.play(t,n)}var m=function(){function e(e){this.paused=!1,this.speed=1,this._paused=!1,this._lastChange=null,this._speed=1,this._lastChangeX=null,this.animation=e}return e.prototype.play=function(e,t){if(null===this._lastChange)this._lastChange=t,this._lastChangeX=0;else if(this.paused!==this._paused||this.speed!==this._speed){var n=t-this._lastChange;!1===this._paused&&(this._lastChangeX+=n*this._speed),this._paused=this.paused,this._speed=this.speed,this._lastChange=t}if(!1===this.paused){n=t-this._lastChange;var a=this._lastChangeX+this.speed*n;u(this.animation,e,a)}},e.prototype.reset=function(){this._lastChange=null},e.prototype.remove=function(){},e}(),f=function(){function e(){this.handles=new Set}return e.prototype.add=function(e){var t=this,n=new m(e);return n.remove=function(){return t.handles.delete(n)},this.handles.add(n),n},e.prototype.play=function(e,t){this.handles.forEach((function(n){return n.play(e,t)}))},e}();function g(e,t,n,a,i){for(var o=e.getImageData(t,n,a,i),r=0;r<a;r++)for(var s=0;s<i;s++){var h=4*(r+s*a);if(255!==o.data[h+3])return!0}return!1}function y(e){return e/64}function v(e,t){var n=y(t),a=function(t,a,i,o,r,s,h){return function(e,t,n,a,i,o,r,s){var h=e.getImageData(t,n,a,i);if(s)for(var c=0;c<i;c++)for(var d=0;d<a/2;d++){var l=4*(d+c*a),p=4*(a-d-1+c*a),u=h.data[l],m=h.data[l+1],f=h.data[l+2],g=h.data[l+3],y=h.data[p],v=h.data[p+1],w=h.data[p+2],b=h.data[p+3];h.data[l]=y,h.data[l+1]=v,h.data[l+2]=w,h.data[l+3]=b,h.data[p]=u,h.data[p+1]=m,h.data[p+2]=f,h.data[p+3]=g}e.putImageData(h,o,r)}(e,t*n,a*n,i*n,o*n,r*n,s*n,h)};!function(e,t){if(!g(e,0,0,t,t/2)){var n=y(t),a=function(t,a,i,o){return e.clearRect(t*n,a*n,i*n,o*n)};a(40,0,8,8),a(48,0,8,8),a(32,8,8,8),a(40,8,8,8),a(48,8,8,8),a(56,8,8,8)}}(e,t),a(4,16,4,4,20,48,!0),a(8,16,4,4,24,48,!0),a(0,20,4,12,24,52,!0),a(4,20,4,12,20,52,!0),a(8,20,4,12,16,52,!0),a(12,20,4,12,28,52,!0),a(44,16,4,4,36,48,!0),a(48,16,4,4,40,48,!0),a(40,20,4,12,40,52,!0),a(44,20,4,12,36,52,!0),a(48,20,4,12,32,52,!0),a(52,20,4,12,44,52,!0)}function w(e,t){var n=!1;if(t.width!==t.height){if(t.width!==2*t.height)throw new Error("Bad skin size: "+t.width+"x"+t.height);n=!0}var a=e.getContext("2d");if(n){var i=t.width;e.width=i,e.height=i,a.clearRect(0,0,i,i),a.drawImage(t,0,0,i,i/2),v(a,i)}else e.width=t.width,e.height=t.height,a.clearRect(0,0,t.width,t.height),a.drawImage(t,0,0,e.width,e.height)}function b(e){if(e instanceof HTMLCanvasElement){var t=y((i=e).width),n=i.getContext("2d"),a=function(e,a,i,o){return g(n,e*t,a*t,i*t,o*t)};return a(50,16,2,4)||a(54,20,2,12)||a(42,48,2,4)||a(46,52,2,12)}var i,o=e;return w(i=document.createElement("canvas"),o),b(i)}var M=function(){function e(e){var n=this;this.detectModel=!0,this.animationPaused=!1,this.animationTime=0,this.disposed=!1,this._renderPaused=!1,this.domElement=e.domElement,this.animation=e.animation||null,!1===e.detectModel&&(this.detectModel=!1),this.skinImg=new Image,this.skinCanvas=document.createElement("canvas"),this.skinTexture=new t.Texture(this.skinCanvas),this.skinTexture.magFilter=t.NearestFilter,this.skinTexture.minFilter=t.NearestFilter,this.capeImg=new Image,this.capeCanvas=document.createElement("canvas"),this.capeTexture=new t.Texture(this.capeCanvas),this.capeTexture.magFilter=t.NearestFilter,this.capeTexture.minFilter=t.NearestFilter,this.layer1Material=new t.MeshBasicMaterial({map:this.skinTexture,side:t.FrontSide}),this.layer2Material=new t.MeshBasicMaterial({map:this.skinTexture,transparent:!0,opacity:1,side:t.DoubleSide,alphaTest:.5}),this.capeMaterial=new t.MeshBasicMaterial({map:this.capeTexture,transparent:!0,opacity:1,side:t.DoubleSide,alphaTest:.5}),this.scene=new t.Scene,this.camera=new t.PerspectiveCamera(40),this.camera.position.y=-12,this.camera.position.z=60,this.renderer=new t.WebGLRenderer({alpha:!0,antialias:!1}),this.renderer.setSize(300,300),this.domElement.appendChild(this.renderer.domElement),this.playerObject=new p(this.layer1Material,this.layer2Material,this.capeMaterial),this.playerObject.name="player",this.scene.add(this.playerObject),this.skinImg.crossOrigin="anonymous",this.skinImg.onerror=function(){return console.error("Failed loading "+n.skinImg.src)},this.skinImg.onload=function(){w(n.skinCanvas,n.skinImg),n.detectModel&&(n.playerObject.skin.slim=b(n.skinCanvas)),n.skinTexture.needsUpdate=!0,n.layer1Material.needsUpdate=!0,n.layer2Material.needsUpdate=!0,n.playerObject.skin.visible=!0},this.capeImg.crossOrigin="anonymous",this.capeImg.onerror=function(){return console.error("Failed loading "+n.capeImg.src)},this.capeImg.onload=function(){!function(e,t){var n=!1;if(t.width!==2*t.height){if(17*t.width!=22*t.height)throw new Error("Bad cape size: "+t.width+"x"+t.height);n=!0}var a=e.getContext("2d");if(n){var i=64*t.width/22;e.width=i,e.height=i/2}else e.width=t.width,e.height=t.height;a.clearRect(0,0,e.width,e.height),a.drawImage(t,0,0,t.width,t.height)}(n.capeCanvas,n.capeImg),n.capeTexture.needsUpdate=!0,n.capeMaterial.needsUpdate=!0,n.playerObject.cape.visible=!0},e.skinUrl&&(this.skinUrl=e.skinUrl),e.capeUrl&&(this.capeUrl=e.capeUrl),e.width&&(this.width=e.width),e.height&&(this.height=e.height),window.requestAnimationFrame((function(){return n.draw()}))}return e.prototype.draw=function(){var e=this;this.disposed||this._renderPaused||(this.animationPaused||(this.animationTime++,this.animation&&u(this.animation,this.playerObject,this.animationTime/100)),this.renderer.render(this.scene,this.camera),window.requestAnimationFrame((function(){return e.draw()})))},e.prototype.setSize=function(e,t){this.camera.aspect=e/t,this.camera.updateProjectionMatrix(),this.renderer.setSize(e,t)},e.prototype.dispose=function(){this.disposed=!0,this.domElement.removeChild(this.renderer.domElement),this.renderer.dispose(),this.skinTexture.dispose(),this.capeTexture.dispose()},Object.defineProperty(e.prototype,"renderPaused",{get:function(){return this._renderPaused},set:function(e){var t=this,n=!this.disposed&&!e&&this._renderPaused;this._renderPaused=e,n&&window.requestAnimationFrame((function(){return t.draw()}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"skinUrl",{get:function(){return this.skinImg.src},set:function(e){this.skinImg.src=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"capeUrl",{get:function(){return this.capeImg.src},set:function(e){this.capeImg.src=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var e=new t.Vector2;return this.renderer.getSize(e).width},set:function(e){this.setSize(e,this.height)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var e=new t.Vector2;return this.renderer.getSize(e).height},set:function(e){this.setSize(this.width,e)},enumerable:!0,configurable:!0}),e}(),E={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},x={type:"change"},O={type:"start"},L={type:"end"},P=function(e){function n(n,a,i){var o=e.call(this)||this;return o.object=n,o.domElement=void 0!==a?a:document,o.window=void 0!==i?i:window,o.enabled=!0,o.target=new t.Vector3,o.minDistance=0,o.maxDistance=1/0,o.minZoom=0,o.maxZoom=1/0,o.minPolarAngle=0,o.maxPolarAngle=Math.PI,o.minAzimuthAngle=-1/0,o.maxAzimuthAngle=1/0,o.enableDamping=!1,o.dampingFactor=.25,o.enableZoom=!0,o.zoomSpeed=1,o.enableRotate=!0,o.rotateSpeed=1,o.enablePan=!0,o.keyPanSpeed=7,o.autoRotate=!1,o.autoRotateSpeed=2,o.enableKeys=!0,o.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},o.mouseButtons={ORBIT:t.MOUSE.LEFT,ZOOM:t.MOUSE.MIDDLE,PAN:t.MOUSE.RIGHT},o.target0=o.target.clone(),o.position0=o.object.position.clone(),o.zoom0=o.object.zoom,o.updateOffset=new t.Vector3,o.updateQuat=(new t.Quaternion).setFromUnitVectors(n.up,new t.Vector3(0,1,0)),o.updateQuatInverse=o.updateQuat.clone().inverse(),o.updateLastPosition=new t.Vector3,o.updateLastQuaternion=new t.Quaternion,o.state=E.NONE,o.scale=1,o.spherical=new t.Spherical,o.sphericalDelta=new t.Spherical,o.panOffset=new t.Vector3,o.zoomChanged=!1,o.rotateStart=new t.Vector2,o.rotateEnd=new t.Vector2,o.rotateDelta=new t.Vector2,o.panStart=new t.Vector2,o.panEnd=new t.Vector2,o.panDelta=new t.Vector2,o.dollyStart=new t.Vector2,o.dollyEnd=new t.Vector2,o.dollyDelta=new t.Vector2,o.panLeftV=new t.Vector3,o.panUpV=new t.Vector3,o.panInternalOffset=new t.Vector3,o.onMouseDown=function(e){if(!1!==o.enabled){if(e.preventDefault(),e.button===o.mouseButtons.ORBIT){if(!1===o.enableRotate)return;o.rotateStart.set(e.clientX,e.clientY),o.state=E.ROTATE}else if(e.button===o.mouseButtons.ZOOM){if(!1===o.enableZoom)return;o.dollyStart.set(e.clientX,e.clientY),o.state=E.DOLLY}else if(e.button===o.mouseButtons.PAN){if(!1===o.enablePan)return;o.panStart.set(e.clientX,e.clientY),o.state=E.PAN}o.state!==E.NONE&&(document.addEventListener("mousemove",o.onMouseMove,!1),document.addEventListener("mouseup",o.onMouseUp,!1),o.dispatchEvent(O))}},o.onMouseMove=function(e){if(!1!==o.enabled)if(e.preventDefault(),o.state===E.ROTATE){if(!1===o.enableRotate)return;o.rotateEnd.set(e.clientX,e.clientY),o.rotateDelta.subVectors(o.rotateEnd,o.rotateStart);var t=o.domElement===document?o.domElement.body:o.domElement;o.rotateLeft(2*Math.PI*o.rotateDelta.x/t.clientWidth*o.rotateSpeed),o.rotateUp(2*Math.PI*o.rotateDelta.y/t.clientHeight*o.rotateSpeed),o.rotateStart.copy(o.rotateEnd),o.update()}else if(o.state===E.DOLLY){if(!1===o.enableZoom)return;o.dollyEnd.set(e.clientX,e.clientY),o.dollyDelta.subVectors(o.dollyEnd,o.dollyStart),o.dollyDelta.y>0?o.dollyIn(o.getZoomScale()):o.dollyDelta.y<0&&o.dollyOut(o.getZoomScale()),o.dollyStart.copy(o.dollyEnd),o.update()}else if(o.state===E.PAN){if(!1===o.enablePan)return;o.panEnd.set(e.clientX,e.clientY),o.panDelta.subVectors(o.panEnd,o.panStart),o.pan(o.panDelta.x,o.panDelta.y),o.panStart.copy(o.panEnd),o.update()}},o.onMouseUp=function(e){!1!==o.enabled&&(document.removeEventListener("mousemove",o.onMouseMove,!1),document.removeEventListener("mouseup",o.onMouseUp,!1),o.dispatchEvent(L),o.state=E.NONE)},o.onMouseWheel=function(e){!1===o.enabled||!1===o.enableZoom||o.state!==E.NONE&&o.state!==E.ROTATE||(e.preventDefault(),e.stopPropagation(),e.deltaY<0?o.dollyOut(o.getZoomScale()):e.deltaY>0&&o.dollyIn(o.getZoomScale()),o.update(),o.dispatchEvent(O),o.dispatchEvent(L))},o.onKeyDown=function(e){if(!1!==o.enabled&&!1!==o.enableKeys&&!1!==o.enablePan)switch(e.keyCode){case o.keys.UP:o.pan(0,o.keyPanSpeed),o.update();break;case o.keys.BOTTOM:o.pan(0,-o.keyPanSpeed),o.update();break;case o.keys.LEFT:o.pan(o.keyPanSpeed,0),o.update();break;case o.keys.RIGHT:o.pan(-o.keyPanSpeed,0),o.update()}},o.onTouchStart=function(e){if(!1!==o.enabled){switch(e.touches.length){case 1:if(!1===o.enableRotate)return;o.rotateStart.set(e.touches[0].pageX,e.touches[0].pageY),o.state=E.TOUCH_ROTATE;break;case 2:if(!1===o.enableZoom)return;var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+n*n);o.dollyStart.set(0,a),o.state=E.TOUCH_DOLLY;break;case 3:if(!1===o.enablePan)return;o.panStart.set(e.touches[0].pageX,e.touches[0].pageY),o.state=E.TOUCH_PAN;break;default:o.state=E.NONE}o.state!==E.NONE&&o.dispatchEvent(O)}},o.onTouchMove=function(e){if(!1!==o.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===o.enableRotate)return;if(o.state!==E.TOUCH_ROTATE)return;o.rotateEnd.set(e.touches[0].pageX,e.touches[0].pageY),o.rotateDelta.subVectors(o.rotateEnd,o.rotateStart);var t=o.domElement===document?o.domElement.body:o.domElement;o.rotateLeft(2*Math.PI*o.rotateDelta.x/t.clientWidth*o.rotateSpeed),o.rotateUp(2*Math.PI*o.rotateDelta.y/t.clientHeight*o.rotateSpeed),o.rotateStart.copy(o.rotateEnd),o.update();break;case 2:if(!1===o.enableZoom)return;if(o.state!==E.TOUCH_DOLLY)return;var n=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY,i=Math.sqrt(n*n+a*a);o.dollyEnd.set(0,i),o.dollyDelta.subVectors(o.dollyEnd,o.dollyStart),o.dollyDelta.y>0?o.dollyOut(o.getZoomScale()):o.dollyDelta.y<0&&o.dollyIn(o.getZoomScale()),o.dollyStart.copy(o.dollyEnd),o.update();break;case 3:if(!1===o.enablePan)return;if(o.state!==E.TOUCH_PAN)return;o.panEnd.set(e.touches[0].pageX,e.touches[0].pageY),o.panDelta.subVectors(o.panEnd,o.panStart),o.pan(o.panDelta.x,o.panDelta.y),o.panStart.copy(o.panEnd),o.update();break;default:o.state=E.NONE}},o.onTouchEnd=function(e){!1!==o.enabled&&(o.dispatchEvent(L),o.state=E.NONE)},o.onContextMenu=function(e){e.preventDefault()},o.domElement.addEventListener("contextmenu",o.onContextMenu,!1),o.domElement.addEventListener("mousedown",o.onMouseDown,!1),o.domElement.addEventListener("wheel",o.onMouseWheel,!1),o.domElement.addEventListener("touchstart",o.onTouchStart,!1),o.domElement.addEventListener("touchend",o.onTouchEnd,!1),o.domElement.addEventListener("touchmove",o.onTouchMove,!1),o.window.addEventListener("keydown",o.onKeyDown,!1),o.update(),o}return a(n,e),n.prototype.update=function(){var e=this.object.position;return this.updateOffset.copy(e).sub(this.target),this.updateOffset.applyQuaternion(this.updateQuat),this.spherical.setFromVector3(this.updateOffset),this.autoRotate&&this.state===E.NONE&&this.rotateLeft(this.getAutoRotationAngle()),this.spherical.theta+=this.sphericalDelta.theta,this.spherical.phi+=this.sphericalDelta.phi,this.spherical.theta=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,this.spherical.theta)),this.spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this.spherical.phi)),this.spherical.makeSafe(),this.spherical.radius*=this.scale,this.spherical.radius=Math.max(this.minDistance,Math.min(this.maxDistance,this.spherical.radius)),this.target.add(this.panOffset),this.updateOffset.setFromSpherical(this.spherical),this.updateOffset.applyQuaternion(this.updateQuatInverse),e.copy(this.target).add(this.updateOffset),this.object.lookAt(this.target),!0===this.enableDamping?(this.sphericalDelta.theta*=1-this.dampingFactor,this.sphericalDelta.phi*=1-this.dampingFactor):this.sphericalDelta.set(0,0,0),this.scale=1,this.panOffset.set(0,0,0),!!(this.zoomChanged||this.updateLastPosition.distanceToSquared(this.object.position)>1e-6||8*(1-this.updateLastQuaternion.dot(this.object.quaternion))>1e-6)&&(this.dispatchEvent(x),this.updateLastPosition.copy(this.object.position),this.updateLastQuaternion.copy(this.object.quaternion),this.zoomChanged=!1,!0)},n.prototype.panLeft=function(e,t){this.panLeftV.setFromMatrixColumn(t,0),this.panLeftV.multiplyScalar(-e),this.panOffset.add(this.panLeftV)},n.prototype.panUp=function(e,t){this.panUpV.setFromMatrixColumn(t,1),this.panUpV.multiplyScalar(e),this.panOffset.add(this.panUpV)},n.prototype.pan=function(e,n){var a=this.domElement===document?this.domElement.body:this.domElement;if(this.object instanceof t.PerspectiveCamera){var i=this.object.position;this.panInternalOffset.copy(i).sub(this.target);var o=this.panInternalOffset.length();o*=Math.tan(this.object.fov/2*Math.PI/180),this.panLeft(2*e*o/a.clientHeight,this.object.matrix),this.panUp(2*n*o/a.clientHeight,this.object.matrix)}else this.object instanceof t.OrthographicCamera?(this.panLeft(e*(this.object.right-this.object.left)/this.object.zoom/a.clientWidth,this.object.matrix),this.panUp(n*(this.object.top-this.object.bottom)/this.object.zoom/a.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)},n.prototype.dollyIn=function(e){this.object instanceof t.PerspectiveCamera?this.scale/=e:this.object instanceof t.OrthographicCamera?(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom*e)),this.object.updateProjectionMatrix(),this.zoomChanged=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)},n.prototype.dollyOut=function(e){this.object instanceof t.PerspectiveCamera?this.scale*=e:this.object instanceof t.OrthographicCamera?(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/e)),this.object.updateProjectionMatrix(),this.zoomChanged=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)},n.prototype.getAutoRotationAngle=function(){return 2*Math.PI/60/60*this.autoRotateSpeed},n.prototype.getZoomScale=function(){return Math.pow(.95,this.zoomSpeed)},n.prototype.rotateLeft=function(e){this.sphericalDelta.theta-=e},n.prototype.rotateUp=function(e){this.sphericalDelta.phi-=e},n.prototype.getPolarAngle=function(){return this.spherical.phi},n.prototype.getAzimuthalAngle=function(){return this.spherical.theta},n.prototype.dispose=function(){this.domElement.removeEventListener("contextmenu",this.onContextMenu,!1),this.domElement.removeEventListener("mousedown",this.onMouseDown,!1),this.domElement.removeEventListener("wheel",this.onMouseWheel,!1),this.domElement.removeEventListener("touchstart",this.onTouchStart,!1),this.domElement.removeEventListener("touchend",this.onTouchEnd,!1),this.domElement.removeEventListener("touchmove",this.onTouchMove,!1),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),this.window.removeEventListener("keydown",this.onKeyDown,!1)},n.prototype.reset=function(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(x),this.update(),this.state=E.NONE},n}(t.EventDispatcher);e.BodyPart=c,e.CapeObject=l,e.CompositeAnimation=f,e.OrbitControls=P,e.PlayerObject=p,e.RotatingAnimation=function(e,t){e.rotation.y=t},e.RunningAnimation=function(e,t){var n=e.skin;t*=15,n.leftLeg.rotation.x=1.3*Math.cos(t+Math.PI),n.rightLeg.rotation.x=1.3*Math.cos(t),n.leftArm.rotation.x=1.5*Math.cos(t),n.rightArm.rotation.x=1.5*Math.cos(t+Math.PI);var a=.1*Math.PI;n.leftArm.rotation.z=.1*Math.cos(t)+a,n.rightArm.rotation.z=.1*Math.cos(t+Math.PI)-a,e.position.y=Math.cos(2*t),e.position.x=.15*Math.cos(t),e.rotation.z=.01*Math.cos(t+Math.PI);var i=.3*Math.PI;e.cape.rotation.x=.1*Math.sin(2*t)+i},e.SkinObject=d,e.SkinViewer=M,e.WalkingAnimation=function(e,t){var n=e.skin;t*=8,n.leftLeg.rotation.x=.5*Math.sin(t),n.rightLeg.rotation.x=.5*Math.sin(t+Math.PI),n.leftArm.rotation.x=.5*Math.sin(t+Math.PI),n.rightArm.rotation.x=.5*Math.sin(t);var a=.02*Math.PI;n.leftArm.rotation.z=.03*Math.cos(t)+a,n.rightArm.rotation.z=.03*Math.cos(t+Math.PI)-a,n.head.rotation.y=.2*Math.sin(t/4),n.head.rotation.x=.1*Math.sin(t/5);var i=.06*Math.PI;e.cape.rotation.x=.06*Math.sin(t/1.5)+i},e.createOrbitControls=function(e){var n=new P(e.camera,e.renderer.domElement);return n.enablePan=!1,n.target=new t.Vector3(0,-12,0),n.minDistance=10,n.maxDistance=256,n.update(),n},e.invokeAnimation=u,e.isSlimSkin=b,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
/* @preserve skinview3d / MIT License / https://github.com/bs-community/skinview3d */ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("three")):"function"==typeof define&&define.amd?define(["exports","three"],e):e((t=t||self).skinview3d={},t.THREE)}(this,(function(t,e){"use strict";function s(t,s,i,a,n,h){return[new e.Vector2(t/n,1-a/h),new e.Vector2(i/n,1-a/h),new e.Vector2(i/n,1-s/h),new e.Vector2(t/n,1-s/h)]}function i(t,e,i,a){return s(t,e,i,a,64,64)}function a(t,e,i,a){return s(t,e,i,a,64,32)}function n(t,e,s,i,a,n,h){t.faceVertexUvs[0]=[],t.faceVertexUvs[0][0]=[n[3],n[0],n[2]],t.faceVertexUvs[0][1]=[n[0],n[1],n[2]],t.faceVertexUvs[0][2]=[i[3],i[0],i[2]],t.faceVertexUvs[0][3]=[i[0],i[1],i[2]],t.faceVertexUvs[0][4]=[e[3],e[0],e[2]],t.faceVertexUvs[0][5]=[e[0],e[1],e[2]],t.faceVertexUvs[0][6]=[s[0],s[3],s[1]],t.faceVertexUvs[0][7]=[s[3],s[2],s[1]],t.faceVertexUvs[0][8]=[a[3],a[0],a[2]],t.faceVertexUvs[0][9]=[a[0],a[1],a[2]],t.faceVertexUvs[0][10]=[h[3],h[0],h[2]],t.faceVertexUvs[0][11]=[h[0],h[1],h[2]]}const h=.002;class o extends e.Group{constructor(t,e){super(),this.innerLayer=t,this.outerLayer=e,t.name="inner",e.name="outer"}}class r extends e.Group{constructor(t){super(),this.modelListeners=[],this._slim=!1;const s=new e.MeshBasicMaterial({map:t,side:e.FrontSide}),a=new e.MeshBasicMaterial({map:t,transparent:!0,opacity:1,side:e.DoubleSide,alphaTest:.5}),r=new e.BoxGeometry(8,8,8,0,0,0);n(r,i(8,0,16,8),i(16,0,24,8),i(0,8,8,16),i(8,8,16,16),i(16,8,24,16),i(24,8,32,16));const d=new e.Mesh(r,s),c=new e.BoxGeometry(9,9,9,0,0,0);n(c,i(40,0,48,8),i(48,0,56,8),i(32,8,40,16),i(40,8,48,16),i(48,8,56,16),i(56,8,64,16));const l=new e.Mesh(c,a);l.renderOrder=-1,this.head=new o(d,l),this.head.name="head",this.head.add(d,l),this.add(this.head);const p=new e.BoxGeometry(8,12,4,0,0,0);n(p,i(20,16,28,20),i(28,16,36,20),i(16,20,20,32),i(20,20,28,32),i(28,20,32,32),i(32,20,40,32));const m=new e.Mesh(p,s),u=new e.BoxGeometry(9,13.5,4.5,0,0,0);n(u,i(20,32,28,36),i(28,32,36,36),i(16,36,20,48),i(20,36,28,48),i(28,36,32,48),i(32,36,40,48));const g=new e.Mesh(u,a);this.body=new o(m,g),this.body.name="body",this.body.add(m,g),this.body.position.y=-10,this.add(this.body);const f=new e.BoxGeometry(1,1,1,0,0,0),w=new e.Mesh(f,s);this.modelListeners.push(()=>{w.scale.x=(this.slim?3:4)-h,w.scale.y=11.998,w.scale.z=3.998,this.slim?n(f,i(44,16,47,20),i(47,16,50,20),i(40,20,44,32),i(44,20,47,32),i(47,20,51,32),i(51,20,54,32)):n(f,i(44,16,48,20),i(48,16,52,20),i(40,20,44,32),i(44,20,48,32),i(48,20,52,32),i(52,20,56,32)),f.uvsNeedUpdate=!0,f.elementsNeedUpdate=!0});const y=new e.BoxGeometry(1,1,1,0,0,0),b=new e.Mesh(y,a);b.renderOrder=1,this.modelListeners.push(()=>{b.scale.x=(this.slim?3.375:4.5)-h,b.scale.y=13.498,b.scale.z=4.498,this.slim?n(y,i(44,32,47,36),i(47,32,50,36),i(40,36,44,48),i(44,36,47,48),i(47,36,51,48),i(51,36,54,48)):n(y,i(44,32,48,36),i(48,32,52,36),i(40,36,44,48),i(44,36,48,48),i(48,36,52,48),i(52,36,56,48)),y.uvsNeedUpdate=!0,y.elementsNeedUpdate=!0});const v=new e.Group;v.add(w,b),v.position.y=-6,this.rightArm=new o(w,b),this.rightArm.name="rightArm",this.rightArm.add(v),this.rightArm.position.y=-4,this.modelListeners.push(()=>{this.rightArm.position.x=this.slim?-5.5:-6}),this.add(this.rightArm);const M=new e.BoxGeometry(1,1,1,0,0,0),x=new e.Mesh(M,s);this.modelListeners.push(()=>{x.scale.x=(this.slim?3:4)-h,x.scale.y=11.998,x.scale.z=3.998,this.slim?n(M,i(36,48,39,52),i(39,48,42,52),i(32,52,36,64),i(36,52,39,64),i(39,52,43,64),i(43,52,46,64)):n(M,i(36,48,40,52),i(40,48,44,52),i(32,52,36,64),i(36,52,40,64),i(40,52,44,64),i(44,52,48,64)),M.uvsNeedUpdate=!0,M.elementsNeedUpdate=!0});const E=new e.BoxGeometry(1,1,1,0,0,0),L=new e.Mesh(E,a);L.renderOrder=1,this.modelListeners.push(()=>{L.scale.x=(this.slim?3.375:4.5)-h,L.scale.y=13.498,L.scale.z=4.498,this.slim?n(E,i(52,48,55,52),i(55,48,58,52),i(48,52,52,64),i(52,52,55,64),i(55,52,59,64),i(59,52,62,64)):n(E,i(52,48,56,52),i(56,48,60,52),i(48,52,52,64),i(52,52,56,64),i(56,52,60,64),i(60,52,64,64)),E.uvsNeedUpdate=!0,E.elementsNeedUpdate=!0});const k=new e.Group;k.add(x,L),k.position.y=-6,this.leftArm=new o(x,L),this.leftArm.name="leftArm",this.leftArm.add(k),this.leftArm.position.y=-4,this.modelListeners.push(()=>{this.leftArm.position.x=this.slim?5.5:6}),this.add(this.leftArm);const S=new e.BoxGeometry(3.998,11.998,3.998,0,0,0);n(S,i(4,16,8,20),i(8,16,12,20),i(0,20,4,32),i(4,20,8,32),i(8,20,12,32),i(12,20,16,32));const P=new e.Mesh(S,s),A=new e.BoxGeometry(4.498,13.498,4.498,0,0,0);n(A,i(4,32,8,36),i(8,32,12,36),i(0,36,4,48),i(4,36,8,48),i(8,36,12,48),i(12,36,16,48));const I=new e.Mesh(A,a);I.renderOrder=1;const O=new e.Group;O.add(P,I),O.position.y=-6,this.rightLeg=new o(P,I),this.rightLeg.name="rightLeg",this.rightLeg.add(O),this.rightLeg.position.y=-16,this.rightLeg.position.x=-2,this.add(this.rightLeg);const j=new e.BoxGeometry(3.998,11.998,3.998,0,0,0);n(j,i(20,48,24,52),i(24,48,28,52),i(16,52,20,64),i(20,52,24,64),i(24,52,28,64),i(28,52,32,64));const D=new e.Mesh(j,s),V=new e.BoxGeometry(4.498,13.498,4.498,0,0,0);n(V,i(4,48,8,52),i(8,48,12,52),i(0,52,4,64),i(4,52,8,64),i(8,52,12,64),i(12,52,16,64));const U=new e.Mesh(V,a);U.renderOrder=1;const z=new e.Group;z.add(D,U),z.position.y=-6,this.leftLeg=new o(D,U),this.leftLeg.name="leftLeg",this.leftLeg.add(z),this.leftLeg.position.y=-16,this.leftLeg.position.x=2,this.add(this.leftLeg),this.slim=!1}get slim(){return this._slim}set slim(t){this._slim=t,this.modelListeners.forEach(t=>t())}getBodyParts(){return this.children.filter(t=>t instanceof o)}setInnerLayerVisible(t){this.getBodyParts().forEach(e=>e.innerLayer.visible=t)}setOuterLayerVisible(t){this.getBodyParts().forEach(e=>e.outerLayer.visible=t)}}class d extends e.Group{constructor(t){super();const s=new e.MeshBasicMaterial({map:t,transparent:!0,opacity:1,side:e.DoubleSide,alphaTest:.5}),i=new e.BoxGeometry(10,16,1,0,0,0);n(i,a(1,0,11,1),a(11,0,21,1),a(11,1,12,17),a(12,1,22,17),a(0,1,1,17),a(1,1,11,17)),this.cape=new e.Mesh(i,s),this.cape.position.y=-8,this.cape.position.z=-.5,this.add(this.cape)}}class c extends e.Group{constructor(t,e){super(),this.skin=new r(t),this.skin.name="skin",this.add(this.skin),this.cape=new d(e),this.cape.name="cape",this.cape.position.z=-2,this.cape.position.y=-4,this.cape.rotation.x=25*Math.PI/180,this.add(this.cape)}}function l(t,e,s){t instanceof Function?t(e,s):t.play(e,s)}class p{constructor(t){this.speed=1,this.paused=!1,this.progress=0,this.lastTime=0,this.started=!1,this.toResetAndRemove=!1,this.animation=t}play(t,e){if(this.toResetAndRemove)return l(this.animation,t,0),void this.remove();let s;this.started?s=e-this.lastTime:(s=0,this.started=!0),this.lastTime=e,this.paused||(this.progress+=s*this.speed),l(this.animation,t,this.progress)}reset(){this.progress=0}remove(){}resetAndRemove(){this.toResetAndRemove=!0}}class m{constructor(){this.handles=new Set}add(t){const e=new p(t);return e.remove=()=>{this.handles.delete(e)},this.handles.add(e),e}play(t,e){this.handles.forEach(s=>s.play(t,e))}}class u extends m{constructor(){super(...arguments),this.speed=1,this.progress=0,this.clock=new e.Clock(!0)}get animation(){return this}get paused(){return!this.clock.running}set paused(t){t?this.clock.stop():this.clock.start()}runAnimationLoop(t){0!==this.handles.size&&(this.progress+=this.clock.getDelta()*this.speed,this.play(t,this.progress))}reset(){this.progress=0}}function g(t,e,s,i,a){for(var n=t.getImageData(e,s,i,a),h=0;h<i;h++)for(var o=0;o<a;o++){var r=4*(h+o*i);if(255!==n.data[r+3])return!0}return!1}function f(t){return t/64}function w(t,e){var s=f(e),i=function(e,i,a,n,h,o,r){return function(t,e,s,i,a,n,h,o){var r=t.getImageData(e,s,i,a);if(o)for(var d=0;d<a;d++)for(var c=0;c<i/2;c++){var l=4*(c+d*i),p=4*(i-c-1+d*i),m=r.data[l],u=r.data[l+1],g=r.data[l+2],f=r.data[l+3],w=r.data[p],y=r.data[p+1],b=r.data[p+2],v=r.data[p+3];r.data[l]=w,r.data[l+1]=y,r.data[l+2]=b,r.data[l+3]=v,r.data[p]=m,r.data[p+1]=u,r.data[p+2]=g,r.data[p+3]=f}t.putImageData(r,n,h)}(t,e*s,i*s,a*s,n*s,h*s,o*s,r)};!function(t,e){if(!g(t,0,0,e,e/2)){var s=f(e),i=function(e,i,a,n){return t.clearRect(e*s,i*s,a*s,n*s)};i(40,0,8,8),i(48,0,8,8),i(32,8,8,8),i(40,8,8,8),i(48,8,8,8),i(56,8,8,8)}}(t,e),i(4,16,4,4,20,48,!0),i(8,16,4,4,24,48,!0),i(0,20,4,12,24,52,!0),i(4,20,4,12,20,52,!0),i(8,20,4,12,16,52,!0),i(12,20,4,12,28,52,!0),i(44,16,4,4,36,48,!0),i(48,16,4,4,40,48,!0),i(40,20,4,12,40,52,!0),i(44,20,4,12,36,52,!0),i(48,20,4,12,32,52,!0),i(52,20,4,12,44,52,!0)}const y=-1,b=0,v=1,M=2,x=3,E=4,L=5,k={type:"change"},S={type:"start"},P={type:"end"};class A extends e.EventDispatcher{constructor(t,s,i){super(),this.object=t,this.domElement=s,this.window=void 0!==i?i:window,this.enabled=!0,this.target=new e.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:e.MOUSE.LEFT,ZOOM:e.MOUSE.MIDDLE,PAN:e.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.updateOffset=new e.Vector3,this.updateQuat=(new e.Quaternion).setFromUnitVectors(t.up,new e.Vector3(0,1,0)),this.updateQuatInverse=this.updateQuat.clone().inverse(),this.updateLastPosition=new e.Vector3,this.updateLastQuaternion=new e.Quaternion,this.state=y,this.scale=1,this.spherical=new e.Spherical,this.sphericalDelta=new e.Spherical,this.panOffset=new e.Vector3,this.zoomChanged=!1,this.rotateStart=new e.Vector2,this.rotateEnd=new e.Vector2,this.rotateDelta=new e.Vector2,this.panStart=new e.Vector2,this.panEnd=new e.Vector2,this.panDelta=new e.Vector2,this.dollyStart=new e.Vector2,this.dollyEnd=new e.Vector2,this.dollyDelta=new e.Vector2,this.panLeftV=new e.Vector3,this.panUpV=new e.Vector3,this.panInternalOffset=new e.Vector3,this.onMouseDown=t=>{if(!1!==this.enabled){if(t.preventDefault(),t.button===this.mouseButtons.ORBIT){if(!1===this.enableRotate)return;this.rotateStart.set(t.clientX,t.clientY),this.state=b}else if(t.button===this.mouseButtons.ZOOM){if(!1===this.enableZoom)return;this.dollyStart.set(t.clientX,t.clientY),this.state=v}else if(t.button===this.mouseButtons.PAN){if(!1===this.enablePan)return;this.panStart.set(t.clientX,t.clientY),this.state=M}this.state!==y&&(document.addEventListener("mousemove",this.onMouseMove,!1),document.addEventListener("mouseup",this.onMouseUp,!1),this.dispatchEvent(S))}},this.onMouseMove=t=>{if(!1!==this.enabled)if(t.preventDefault(),this.state===b){if(!1===this.enableRotate)return;this.rotateEnd.set(t.clientX,t.clientY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart),this.rotateLeft(2*Math.PI*this.rotateDelta.x/this.domElement.clientWidth*this.rotateSpeed),this.rotateUp(2*Math.PI*this.rotateDelta.y/this.domElement.clientHeight*this.rotateSpeed),this.rotateStart.copy(this.rotateEnd),this.update()}else if(this.state===v){if(!1===this.enableZoom)return;this.dollyEnd.set(t.clientX,t.clientY),this.dollyDelta.subVectors(this.dollyEnd,this.dollyStart),this.dollyDelta.y>0?this.dollyIn(this.getZoomScale()):this.dollyDelta.y<0&&this.dollyOut(this.getZoomScale()),this.dollyStart.copy(this.dollyEnd),this.update()}else if(this.state===M){if(!1===this.enablePan)return;this.panEnd.set(t.clientX,t.clientY),this.panDelta.subVectors(this.panEnd,this.panStart),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd),this.update()}},this.onMouseUp=()=>{!1!==this.enabled&&(document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),this.dispatchEvent(P),this.state=y)},this.onMouseWheel=t=>{!1===this.enabled||!1===this.enableZoom||this.state!==y&&this.state!==b||(t.preventDefault(),t.stopPropagation(),t.deltaY<0?this.dollyOut(this.getZoomScale()):t.deltaY>0&&this.dollyIn(this.getZoomScale()),this.update(),this.dispatchEvent(S),this.dispatchEvent(P))},this.onKeyDown=t=>{if(!1!==this.enabled&&!1!==this.enableKeys&&!1!==this.enablePan)switch(t.keyCode){case this.keys.UP:this.pan(0,this.keyPanSpeed),this.update();break;case this.keys.BOTTOM:this.pan(0,-this.keyPanSpeed),this.update();break;case this.keys.LEFT:this.pan(this.keyPanSpeed,0),this.update();break;case this.keys.RIGHT:this.pan(-this.keyPanSpeed,0),this.update()}},this.onTouchStart=t=>{if(!1!==this.enabled){switch(t.touches.length){case 1:if(!1===this.enableRotate)return;this.rotateStart.set(t.touches[0].pageX,t.touches[0].pageY),this.state=x;break;case 2:{if(!1===this.enableZoom)return;const e=t.touches[0].pageX-t.touches[1].pageX,s=t.touches[0].pageY-t.touches[1].pageY,i=Math.sqrt(e*e+s*s);this.dollyStart.set(0,i),this.state=E;break}case 3:if(!1===this.enablePan)return;this.panStart.set(t.touches[0].pageX,t.touches[0].pageY),this.state=L;break;default:this.state=y}this.state!==y&&this.dispatchEvent(S)}},this.onTouchMove=t=>{if(!1!==this.enabled)switch(t.preventDefault(),t.stopPropagation(),t.touches.length){case 1:if(!1===this.enableRotate)return;if(this.state!==x)return;this.rotateEnd.set(t.touches[0].pageX,t.touches[0].pageY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart),this.rotateLeft(2*Math.PI*this.rotateDelta.x/this.domElement.clientWidth*this.rotateSpeed),this.rotateUp(2*Math.PI*this.rotateDelta.y/this.domElement.clientHeight*this.rotateSpeed),this.rotateStart.copy(this.rotateEnd),this.update();break;case 2:{if(!1===this.enableZoom)return;if(this.state!==E)return;const e=t.touches[0].pageX-t.touches[1].pageX,s=t.touches[0].pageY-t.touches[1].pageY,i=Math.sqrt(e*e+s*s);this.dollyEnd.set(0,i),this.dollyDelta.subVectors(this.dollyEnd,this.dollyStart),this.dollyDelta.y>0?this.dollyOut(this.getZoomScale()):this.dollyDelta.y<0&&this.dollyIn(this.getZoomScale()),this.dollyStart.copy(this.dollyEnd),this.update();break}case 3:if(!1===this.enablePan)return;if(this.state!==L)return;this.panEnd.set(t.touches[0].pageX,t.touches[0].pageY),this.panDelta.subVectors(this.panEnd,this.panStart),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd),this.update();break;default:this.state=y}},this.onTouchEnd=()=>{!1!==this.enabled&&(this.dispatchEvent(P),this.state=y)},this.onContextMenu=t=>{t.preventDefault()},this.domElement.addEventListener("contextmenu",this.onContextMenu,!1),this.domElement.addEventListener("mousedown",this.onMouseDown,!1),this.domElement.addEventListener("wheel",this.onMouseWheel,!1),this.domElement.addEventListener("touchstart",this.onTouchStart,!1),this.domElement.addEventListener("touchend",this.onTouchEnd,!1),this.domElement.addEventListener("touchmove",this.onTouchMove,!1),this.window.addEventListener("keydown",this.onKeyDown,!1),this.update()}update(){const t=this.object.position;return this.updateOffset.copy(t).sub(this.target),this.updateOffset.applyQuaternion(this.updateQuat),this.spherical.setFromVector3(this.updateOffset),this.autoRotate&&this.state===y&&this.rotateLeft(this.getAutoRotationAngle()),this.spherical.theta+=this.sphericalDelta.theta,this.spherical.phi+=this.sphericalDelta.phi,this.spherical.theta=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,this.spherical.theta)),this.spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this.spherical.phi)),this.spherical.makeSafe(),this.spherical.radius*=this.scale,this.spherical.radius=Math.max(this.minDistance,Math.min(this.maxDistance,this.spherical.radius)),this.target.add(this.panOffset),this.updateOffset.setFromSpherical(this.spherical),this.updateOffset.applyQuaternion(this.updateQuatInverse),t.copy(this.target).add(this.updateOffset),this.object.lookAt(this.target),!0===this.enableDamping?(this.sphericalDelta.theta*=1-this.dampingFactor,this.sphericalDelta.phi*=1-this.dampingFactor):this.sphericalDelta.set(0,0,0),this.scale=1,this.panOffset.set(0,0,0),!!(this.zoomChanged||this.updateLastPosition.distanceToSquared(this.object.position)>1e-6||8*(1-this.updateLastQuaternion.dot(this.object.quaternion))>1e-6)&&(this.dispatchEvent(k),this.updateLastPosition.copy(this.object.position),this.updateLastQuaternion.copy(this.object.quaternion),this.zoomChanged=!1,!0)}panLeft(t,e){this.panLeftV.setFromMatrixColumn(e,0),this.panLeftV.multiplyScalar(-t),this.panOffset.add(this.panLeftV)}panUp(t,e){this.panUpV.setFromMatrixColumn(e,1),this.panUpV.multiplyScalar(t),this.panOffset.add(this.panUpV)}pan(t,s){if(this.object instanceof e.PerspectiveCamera){const e=this.object.position;this.panInternalOffset.copy(e).sub(this.target);let i=this.panInternalOffset.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this.panLeft(2*t*i/this.domElement.clientHeight,this.object.matrix),this.panUp(2*s*i/this.domElement.clientHeight,this.object.matrix)}else this.object instanceof e.OrthographicCamera?(this.panLeft(t*(this.object.right-this.object.left)/this.object.zoom/this.domElement.clientWidth,this.object.matrix),this.panUp(s*(this.object.top-this.object.bottom)/this.object.zoom/this.domElement.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}dollyIn(t){this.object instanceof e.PerspectiveCamera?this.scale/=t:this.object instanceof e.OrthographicCamera?(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom*t)),this.object.updateProjectionMatrix(),this.zoomChanged=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}dollyOut(t){this.object instanceof e.PerspectiveCamera?this.scale*=t:this.object instanceof e.OrthographicCamera?(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/t)),this.object.updateProjectionMatrix(),this.zoomChanged=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}getAutoRotationAngle(){return 2*Math.PI/60/60*this.autoRotateSpeed}getZoomScale(){return Math.pow(.95,this.zoomSpeed)}rotateLeft(t){this.sphericalDelta.theta-=t}rotateUp(t){this.sphericalDelta.phi-=t}getPolarAngle(){return this.spherical.phi}getAzimuthalAngle(){return this.spherical.theta}dispose(){this.domElement.removeEventListener("contextmenu",this.onContextMenu,!1),this.domElement.removeEventListener("mousedown",this.onMouseDown,!1),this.domElement.removeEventListener("wheel",this.onMouseWheel,!1),this.domElement.removeEventListener("touchstart",this.onTouchStart,!1),this.domElement.removeEventListener("touchend",this.onTouchEnd,!1),this.domElement.removeEventListener("touchmove",this.onTouchMove,!1),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),this.window.removeEventListener("keydown",this.onKeyDown,!1)}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(k),this.update(),this.state=y}}t.BodyPart=o,t.CapeObject=d,t.CompositeAnimation=m,t.OrbitControls=A,t.PlayerObject=c,t.RootAnimation=u,t.RotatingAnimation=(t,e)=>{t.rotation.y=e},t.RunningAnimation=(t,e)=>{const s=t.skin;e*=15,s.leftLeg.rotation.x=1.3*Math.cos(e+Math.PI),s.rightLeg.rotation.x=1.3*Math.cos(e),s.leftArm.rotation.x=1.5*Math.cos(e),s.rightArm.rotation.x=1.5*Math.cos(e+Math.PI);const i=.1*Math.PI;s.leftArm.rotation.z=.1*Math.cos(e)+i,s.rightArm.rotation.z=.1*Math.cos(e+Math.PI)-i,t.position.y=Math.cos(2*e),t.position.x=.15*Math.cos(e),t.rotation.z=.01*Math.cos(e+Math.PI);const a=.3*Math.PI;t.cape.rotation.x=.1*Math.sin(2*e)+a},t.SkinObject=r,t.SkinViewer=class{constructor(t){this.animations=new u,this.detectModel=!0,this.disposed=!1,this._renderPaused=!1,this.domElement=t.domElement,!1===t.detectModel&&(this.detectModel=!1),this.skinImg=new Image,this.skinCanvas=document.createElement("canvas"),this.skinTexture=new e.Texture(this.skinCanvas),this.skinTexture.magFilter=e.NearestFilter,this.skinTexture.minFilter=e.NearestFilter,this.capeImg=new Image,this.capeCanvas=document.createElement("canvas"),this.capeTexture=new e.Texture(this.capeCanvas),this.capeTexture.magFilter=e.NearestFilter,this.capeTexture.minFilter=e.NearestFilter,this.scene=new e.Scene,this.camera=new e.PerspectiveCamera(40),this.camera.position.y=-12,this.camera.position.z=60,this.renderer=new e.WebGLRenderer({alpha:!0,antialias:!1}),this.renderer.setSize(300,300),this.domElement.appendChild(this.renderer.domElement),this.playerObject=new c(this.skinTexture,this.capeTexture),this.playerObject.name="player",this.playerObject.skin.visible=!1,this.playerObject.cape.visible=!1,this.scene.add(this.playerObject),this.skinImg.crossOrigin="anonymous",this.skinImg.onerror=()=>console.error("Failed loading "+this.skinImg.src),this.skinImg.onload=()=>{var t,e,s,i;!function(t,e){var s=!1;if(e.width!==e.height){if(e.width!==2*e.height)throw new Error("Bad skin size: "+e.width+"x"+e.height);s=!0}var i=t.getContext("2d");if(s){var a=e.width;t.width=a,t.height=a,i.clearRect(0,0,a,a),i.drawImage(e,0,0,a,a/2),w(i,a)}else t.width=e.width,t.height=e.height,i.clearRect(0,0,e.width,e.height),i.drawImage(e,0,0,t.width,t.height)}(this.skinCanvas,this.skinImg),this.detectModel&&(this.playerObject.skin.slim=(t=this.skinCanvas,e=f(t.width),s=t.getContext("2d"),(i=function(t,i,a,n){return g(s,t*e,i*e,a*e,n*e)})(50,16,2,4)||i(54,20,2,12)||i(42,48,2,4)||i(46,52,2,12))),this.skinTexture.needsUpdate=!0,this.playerObject.skin.visible=!0},this.capeImg.crossOrigin="anonymous",this.capeImg.onerror=()=>console.error("Failed loading "+this.capeImg.src),this.capeImg.onload=()=>{!function(t,e){var s=!1;if(e.width!==2*e.height){if(17*e.width!=22*e.height)throw new Error("Bad cape size: "+e.width+"x"+e.height);s=!0}var i=t.getContext("2d");if(s){var a=64*e.width/22;t.width=a,t.height=a/2}else t.width=e.width,t.height=e.height;i.clearRect(0,0,t.width,t.height),i.drawImage(e,0,0,e.width,e.height)}(this.capeCanvas,this.capeImg),this.capeTexture.needsUpdate=!0,this.playerObject.cape.visible=!0},t.skinUrl&&(this.skinUrl=t.skinUrl),t.capeUrl&&(this.capeUrl=t.capeUrl),t.width&&(this.width=t.width),t.height&&(this.height=t.height),window.requestAnimationFrame(()=>this.draw())}draw(){this.disposed||this._renderPaused||(this.animations.runAnimationLoop(this.playerObject),this.renderer.render(this.scene,this.camera),window.requestAnimationFrame(()=>this.draw()))}setSize(t,e){this.camera.aspect=t/e,this.camera.updateProjectionMatrix(),this.renderer.setSize(t,e)}dispose(){this.disposed=!0,this.domElement.removeChild(this.renderer.domElement),this.renderer.dispose(),this.skinTexture.dispose(),this.capeTexture.dispose()}get renderPaused(){return this._renderPaused}set renderPaused(t){const e=!this.disposed&&!t&&this._renderPaused;this._renderPaused=t,e&&window.requestAnimationFrame(()=>this.draw())}get skinUrl(){return this.skinImg.src}set skinUrl(t){this.skinImg.src=t}get capeUrl(){return this.capeImg.src}set capeUrl(t){this.capeImg.src=t}get width(){const t=new e.Vector2;return this.renderer.getSize(t).width}set width(t){this.setSize(t,this.height)}get height(){const t=new e.Vector2;return this.renderer.getSize(t).height}set height(t){this.setSize(this.width,t)}},t.WalkingAnimation=(t,e)=>{const s=t.skin;e*=8,s.leftLeg.rotation.x=.5*Math.sin(e),s.rightLeg.rotation.x=.5*Math.sin(e+Math.PI),s.leftArm.rotation.x=.5*Math.sin(e+Math.PI),s.rightArm.rotation.x=.5*Math.sin(e);const i=.02*Math.PI;s.leftArm.rotation.z=.03*Math.cos(e)+i,s.rightArm.rotation.z=.03*Math.cos(e+Math.PI)-i,s.head.rotation.y=.2*Math.sin(e/4),s.head.rotation.x=.1*Math.sin(e/5);const a=.06*Math.PI;t.cape.rotation.x=.06*Math.sin(e/1.5)+a},t.createOrbitControls=function(t){const s=new A(t.camera,t.renderer.domElement);return s.enablePan=!1,s.target=new e.Vector3(0,-12,0),s.minDistance=10,s.maxDistance=256,s.update(),s},t.invokeAnimation=l,Object.defineProperty(t,"__esModule",{value:!0})}));//# sourceMappingURL=skinview3d.min.js.map |
{ | ||
"name": "skinview3d", | ||
"version": "1.2.1", | ||
"version": "2.0.0-alpha.1", | ||
"description": "Three.js powered Minecraft skin viewer", | ||
"module": "dist/skinview3d.module.js", | ||
"main": "dist/skinview3d.js", | ||
"main": "jsm/skinview3d.js", | ||
"type": "module", | ||
"scripts": { | ||
"build": "rollup -c", | ||
"test": "karma start && npm run lint", | ||
"prepublishOnly": "rimraf dist && npm run build", | ||
"lint": "tslint --formatters-dir ./node_modules/tslint-formatter-beauty -t beauty -p .", | ||
"dev": "npm-run-all --parallel watch serve", | ||
"watch": "rollup -w -c", | ||
"serve": "ws" | ||
"clean": "rimraf jsm dist", | ||
"build:jsm": "tsc -p .", | ||
"build:umd": "rollup -c", | ||
"build": "npm run build:jsm && npm run build:umd", | ||
"test:lint": "eslint --ext .ts src", | ||
"test": "npm run test:lint", | ||
"dev:watch:jsm": "tsc -w -p .", | ||
"dev:watch:umd": "rollup -w -c", | ||
"dev:serve": "ws", | ||
"dev": "npm-run-all --parallel dev:watch:jsm dev:watch:umd dev:serve", | ||
"prepublishOnly": "npm run clean && npm run build" | ||
}, | ||
@@ -33,32 +37,22 @@ "repository": { | ||
"files": [ | ||
"jsm", | ||
"dist" | ||
], | ||
"dependencies": { | ||
"three": "^0.112.1" | ||
"three": "^0.112.1", | ||
"skinview-utils": "^0.2.0" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-node-resolve": "^6.0.0", | ||
"@types/chai": "^4.1.4", | ||
"@types/mocha": "^5.2.5", | ||
"chai": "^4.2.0", | ||
"karma": "^3.0.0", | ||
"karma-chrome-launcher": "^2.2.0", | ||
"karma-mocha": "^1.3.0", | ||
"karma-webpack": "^3.0.0", | ||
"local-web-server": "^2.6.0", | ||
"mocha": "^5.2.0", | ||
"npm-run-all": "^4.1.3", | ||
"puppeteer": "^1.7.0", | ||
"rimraf": "^2.6.2", | ||
"rollup": "^1.27.14", | ||
"rollup-plugin-license": "^0.13.0", | ||
"rollup-plugin-terser": "^5.1.3", | ||
"rollup-plugin-typescript2": "^0.25.3", | ||
"ts-loader": "^5.2.2", | ||
"tslint": "^5.11.0", | ||
"tslint-formatter-beauty": "^3.0.0-beta.2", | ||
"typescript": "^3.7.4", | ||
"url-loader": "^1.1.1", | ||
"webpack": "^4.41.4" | ||
"@rollup/plugin-node-resolve": "^7.0.0", | ||
"@rollup/plugin-typescript": "^2.1.0", | ||
"@typescript-eslint/eslint-plugin": "^2.17.0", | ||
"@typescript-eslint/parser": "^2.17.0", | ||
"eslint": "^6.8.0", | ||
"local-web-server": "^3.0.7", | ||
"npm-run-all": "^4.1.5", | ||
"rimraf": "^3.0.0", | ||
"rollup": "^1.29.1", | ||
"rollup-plugin-terser": "^5.2.0", | ||
"typescript": "^3.7.5" | ||
} | ||
} |
skinview3d | ||
======== | ||
![](https://github.com/bs-community/skinview3d/workflows/CI/badge.svg) | ||
[![npm](https://img.shields.io/npm/v/skinview3d.svg?style=flat-square)](https://www.npmjs.com/package/skinview3d) | ||
[![license](https://img.shields.io/badge/license-MIT-yellowgreen.svg?style=flat-square)](https://github.com/bs-community/skinview3d/blob/master/LICENSE) | ||
[![Gitter chat](https://img.shields.io/gitter/room/TechnologyAdvice/Stardust.svg?style=flat-square)](https://gitter.im/skinview3d/Lobby) | ||
[![CI Status](https://img.shields.io/github/workflow/status/bs-community/skinview3d/CI?label=CI&logo=github&style=flat-square)](https://github.com/bs-community/skinview3d/actions?query=workflow:CI) | ||
[![NPM Package](https://img.shields.io/npm/v/skinview3d.svg?style=flat-square)](https://www.npmjs.com/package/skinview3d) | ||
[![MIT License](https://img.shields.io/badge/license-MIT-yellowgreen.svg?style=flat-square)](https://github.com/bs-community/skinview3d/blob/master/LICENSE) | ||
[![Gitter Chat](https://img.shields.io/gitter/room/TechnologyAdvice/Stardust.svg?style=flat-square)](https://gitter.im/skinview3d/Lobby) | ||
@@ -45,12 +45,12 @@ Three.js powered Minecraft skin viewer. | ||
skinViewer.animation = new skinview3d.CompositeAnimation(); | ||
// Add an animation | ||
let walk = skinViewer.animation.add(skinview3d.WalkingAnimation); | ||
let walk = skinViewer.animations.add(skinview3d.WalkingAnimation); | ||
// Add another animation | ||
let rotate = skinViewer.animation.add(skinview3d.RotatingAnimation); | ||
let rotate = skinViewer.animations.add(skinview3d.RotatingAnimation); | ||
// Remove an animation, stop walking dude | ||
walk.remove(); | ||
// Remove the rotating animation, and make the player face forward | ||
rotate.resetAndRemove(); | ||
// And run for now! | ||
let run = skinViewer.animation.add(skinview3d.RunningAnimation); | ||
let run = skinViewer.animations.add(skinview3d.RunningAnimation); | ||
@@ -62,3 +62,3 @@ // Set the speed of an animation | ||
// Pause all animations! | ||
skinViewer.animationPaused = true; | ||
skinViewer.animations.paused = true; | ||
</script> | ||
@@ -65,0 +65,0 @@ ``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
220119
11
20
0
Yes
2
1343
2
1
+ Addedskinview-utils@^0.2.0
+ Addedskinview-utils@0.2.1(transitive)