Browse Source

Merge pull request #7 from mrdoob/dev

Update dev branch
Temdog007 6 years ago
parent
commit
8794c907f2
42 changed files with 404 additions and 130 deletions
  1. 3 3
      build/three.js
  2. 17 17
      build/three.min.js
  3. 3 3
      build/three.module.js
  4. 1 1
      docs/api/en/core/Object3D.html
  5. 8 3
      docs/api/en/textures/Texture.html
  6. 1 1
      docs/api/zh/core/Object3D.html
  7. 4 0
      docs/api/zh/textures/Texture.html
  8. 7 0
      docs/manual/en/introduction/How-to-dispose-of-objects.html
  9. 2 0
      editor/js/Editor.js
  10. 2 0
      editor/js/Sidebar.Geometry.js
  11. 1 0
      editor/js/Strings.js
  12. 1 0
      editor/js/Viewport.js
  13. 38 38
      editor/js/libs/three.html.js
  14. 5 3
      examples/js/loaders/KTXLoader.js
  15. 11 1
      examples/js/loaders/SVGLoader.js
  16. 7 0
      examples/jsm/exporters/ColladaExporter.d.ts
  17. 3 3
      examples/jsm/exporters/GLTFExporter.d.ts
  18. 7 0
      examples/jsm/exporters/MMDExporter.d.ts
  19. 7 0
      examples/jsm/exporters/OBJExporter.d.ts
  20. 7 0
      examples/jsm/exporters/PLYExporter.d.ts
  21. 7 0
      examples/jsm/exporters/STLExporter.d.ts
  22. 7 0
      examples/jsm/exporters/TypedGeometryExporter.d.ts
  23. 1 6
      examples/jsm/pmrem/PMREMCubeUVPacker.d.ts
  24. 5 0
      examples/jsm/utils/MathUtils.d.ts
  25. 40 32
      examples/jsm/utils/MathUtils.js
  26. 8 0
      examples/jsm/utils/ShadowMapViewer.d.ts
  27. 32 0
      examples/jsm/utils/SkeletonUtils.d.ts
  28. 58 0
      examples/jsm/utils/TypedArrayUtils.d.ts
  29. 3 0
      examples/jsm/utils/UVsDebug.d.ts
  30. 1 0
      examples/webgl_buffergeometry_morphtargets.html
  31. 0 2
      examples/webgl_custom_attributes_points.html
  32. 0 1
      examples/webgl_custom_attributes_points2.html
  33. 1 1
      examples/webgl_loader_lwo.html
  34. 3 0
      examples/webgl_materials_matcap.html
  35. 1 0
      src/animation/AnimationAction.d.ts
  36. 2 2
      src/cameras/CubeCamera.js
  37. 0 3
      src/core/BufferGeometry.d.ts
  38. 3 3
      src/materials/Materials.d.ts
  39. 15 7
      src/materials/MeshDepthMaterial.d.ts
  40. 25 0
      src/materials/MeshDistanceMaterial.d.ts
  41. 43 0
      src/materials/MeshMatcapMaterial.d.ts
  42. 14 0
      src/materials/MeshToonMaterial.d.ts

+ 3 - 3
build/three.js

@@ -185,7 +185,7 @@
 
 	} );
 
-	var REVISION = '103';
+	var REVISION = '104dev';
 	var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
 	var CullFaceNone = 0;
 	var CullFaceBack = 1;
@@ -40208,14 +40208,14 @@
 	 * @author alteredq / http://alteredqualia.com/
 	 */
 
+	var fov = 90, aspect = 1;
+
 	function CubeCamera( near, far, cubeResolution, options ) {
 
 		Object3D.call( this );
 
 		this.type = 'CubeCamera';
 
-		var fov = 90, aspect = 1;
-
 		var cameraPX = new PerspectiveCamera( fov, aspect, near, far );
 		cameraPX.up.set( 0, - 1, 0 );
 		cameraPX.lookAt( new Vector3( 1, 0, 0 ) );

+ 17 - 17
build/three.min.js

@@ -181,8 +181,8 @@ e.uniformsList,p,ba),c.uniformsNeedUpdate=!1);c.isSpriteMaterial&&g.setValue(L,"
 b.specularMap);b.envMap&&(a.envMap.value=b.envMap,a.flipEnvMap.value=b.envMap.isCubeTexture?-1:1,a.reflectivity.value=b.reflectivity,a.refractionRatio.value=b.refractionRatio,a.maxMipLevel.value=Ba.get(b.envMap).__maxMipLevel);b.lightMap&&(a.lightMap.value=b.lightMap,a.lightMapIntensity.value=b.lightMapIntensity);b.aoMap&&(a.aoMap.value=b.aoMap,a.aoMapIntensity.value=b.aoMapIntensity);if(b.map)var c=b.map;else b.specularMap?c=b.specularMap:b.displacementMap?c=b.displacementMap:b.normalMap?c=b.normalMap:
 b.bumpMap?c=b.bumpMap:b.roughnessMap?c=b.roughnessMap:b.metalnessMap?c=b.metalnessMap:b.alphaMap?c=b.alphaMap:b.emissiveMap&&(c=b.emissiveMap);void 0!==c&&(c.isWebGLRenderTarget&&(c=c.texture),!0===c.matrixAutoUpdate&&c.updateMatrix(),a.uvTransform.value.copy(c.matrix))}function r(a,b){a.specular.value=b.specular;a.shininess.value=Math.max(b.shininess,1E-4);b.emissiveMap&&(a.emissiveMap.value=b.emissiveMap);b.bumpMap&&(a.bumpMap.value=b.bumpMap,a.bumpScale.value=b.bumpScale,1===b.side&&(a.bumpScale.value*=
 -1));b.normalMap&&(a.normalMap.value=b.normalMap,a.normalScale.value.copy(b.normalScale),1===b.side&&a.normalScale.value.negate());b.displacementMap&&(a.displacementMap.value=b.displacementMap,a.displacementScale.value=b.displacementScale,a.displacementBias.value=b.displacementBias)}function u(a,b){a.roughness.value=b.roughness;a.metalness.value=b.metalness;b.roughnessMap&&(a.roughnessMap.value=b.roughnessMap);b.metalnessMap&&(a.metalnessMap.value=b.metalnessMap);b.emissiveMap&&(a.emissiveMap.value=
-b.emissiveMap);b.bumpMap&&(a.bumpMap.value=b.bumpMap,a.bumpScale.value=b.bumpScale,1===b.side&&(a.bumpScale.value*=-1));b.normalMap&&(a.normalMap.value=b.normalMap,a.normalScale.value.copy(b.normalScale),1===b.side&&a.normalScale.value.negate());b.displacementMap&&(a.displacementMap.value=b.displacementMap,a.displacementScale.value=b.displacementScale,a.displacementBias.value=b.displacementBias);b.envMap&&(a.envMapIntensity.value=b.envMapIntensity)}console.log("THREE.WebGLRenderer","103");a=a||{};
-var x=void 0!==a.canvas?a.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),A=void 0!==a.context?a.context:null,w=void 0!==a.alpha?a.alpha:!1,y=void 0!==a.depth?a.depth:!0,D=void 0!==a.stencil?a.stencil:!0,J=void 0!==a.antialias?a.antialias:!1,ua=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,F=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,E=void 0!==a.powerPreference?a.powerPreference:"default",C=null,z=null;this.domElement=x;this.context=null;this.sortObjects=
+b.emissiveMap);b.bumpMap&&(a.bumpMap.value=b.bumpMap,a.bumpScale.value=b.bumpScale,1===b.side&&(a.bumpScale.value*=-1));b.normalMap&&(a.normalMap.value=b.normalMap,a.normalScale.value.copy(b.normalScale),1===b.side&&a.normalScale.value.negate());b.displacementMap&&(a.displacementMap.value=b.displacementMap,a.displacementScale.value=b.displacementScale,a.displacementBias.value=b.displacementBias);b.envMap&&(a.envMapIntensity.value=b.envMapIntensity)}console.log("THREE.WebGLRenderer","104dev");a=a||
+{};var x=void 0!==a.canvas?a.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),A=void 0!==a.context?a.context:null,w=void 0!==a.alpha?a.alpha:!1,y=void 0!==a.depth?a.depth:!0,D=void 0!==a.stencil?a.stencil:!0,J=void 0!==a.antialias?a.antialias:!1,ua=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,F=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,E=void 0!==a.powerPreference?a.powerPreference:"default",C=null,z=null;this.domElement=x;this.context=null;this.sortObjects=
 this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.clippingPlanes=[];this.localClippingEnabled=!1;this.gammaFactor=2;this.physicallyCorrectLights=this.gammaOutput=this.gammaInput=!1;this.toneMappingWhitePoint=this.toneMappingExposure=this.toneMapping=1;this.maxMorphTargets=8;this.maxMorphNormals=4;var fa=this,I=!1,M=null,N=null,X=null,Q=-1;var O=b=null;var da=!1;var S=null,T=null,R=new Y,W=new Y,V=null,Ea=x.width,U=x.height,H=1,Z=new Y(0,0,Ea,U),Ha=new Y(0,0,Ea,U),
 ea=!1,ja=new vd,aa=new dg,ha=!1,fe=!1,Fc=new P,kb=new n;try{w={alpha:w,depth:y,stencil:D,antialias:J,premultipliedAlpha:ua,preserveDrawingBuffer:F,powerPreference:E};x.addEventListener("webglcontextlost",d,!1);x.addEventListener("webglcontextrestored",e,!1);var L=A||x.getContext("webgl",w)||x.getContext("experimental-webgl",w);if(null===L){if(null!==x.getContext("webgl"))throw Error("Error creating WebGL context with your selected attributes.");throw Error("Error creating WebGL context.");}void 0===
 L.getShaderPrecisionFormat&&(L.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(uf){throw console.error("THREE.WebGLRenderer: "+uf.message),uf;}var na,Aa,ca,lb,Ba,ba,pa,sa,oa,la,ra,qa,ma,va,wa,ya,ia;c();var ka=null;"undefined"!==typeof navigator&&(ka="xr"in navigator?new dh(fa):new tf(fa));this.vr=ka;var za=new nf(fa,oa,Aa.maxTextureSize);this.shadowMap=za;this.getContext=function(){return L};this.getContextAttributes=function(){return L.getContextAttributes()};
@@ -956,20 +956,20 @@ qd;l.DirectionalLightHelper=vc;l.CameraHelper=rd;l.BoxHelper=fb;l.Box3Helper=sd;
 Sc;l.DodecahedronBufferGeometry=cc;l.PolyhedronGeometry=Oc;l.PolyhedronBufferGeometry=ka;l.TubeGeometry=Tc;l.TubeBufferGeometry=zb;l.TorusKnotGeometry=Uc;l.TorusKnotBufferGeometry=dc;l.TorusGeometry=Vc;l.TorusBufferGeometry=ec;l.TextGeometry=$c;l.TextBufferGeometry=fc;l.SphereGeometry=ad;l.SphereBufferGeometry=Cb;l.RingGeometry=bd;l.RingBufferGeometry=gc;l.PlaneGeometry=Dc;l.PlaneBufferGeometry=vb;l.LatheGeometry=cd;l.LatheBufferGeometry=hc;l.ShapeGeometry=Db;l.ShapeBufferGeometry=Eb;l.ExtrudeGeometry=
 Bb;l.ExtrudeBufferGeometry=Ya;l.EdgesGeometry=ic;l.ConeGeometry=dd;l.ConeBufferGeometry=ed;l.CylinderGeometry=Fb;l.CylinderBufferGeometry=db;l.CircleGeometry=fd;l.CircleBufferGeometry=jc;l.BoxGeometry=Rb;l.CubeGeometry=Rb;l.BoxBufferGeometry=ub;l.ShadowMaterial=Gb;l.SpriteMaterial=mb;l.RawShaderMaterial=kc;l.ShaderMaterial=Ca;l.PointsMaterial=Ka;l.MeshPhysicalMaterial=Hb;l.MeshStandardMaterial=Za;l.MeshPhongMaterial=La;l.MeshToonMaterial=Ib;l.MeshNormalMaterial=Jb;l.MeshLambertMaterial=Kb;l.MeshDepthMaterial=
 ib;l.MeshDistanceMaterial=jb;l.MeshBasicMaterial=Da;l.MeshMatcapMaterial=Lb;l.LineDashedMaterial=Mb;l.LineBasicMaterial=R;l.Material=O;l.Float64BufferAttribute=Cc;l.Float32BufferAttribute=E;l.Uint32BufferAttribute=tb;l.Int32BufferAttribute=Bc;l.Uint16BufferAttribute=sb;l.Int16BufferAttribute=Ac;l.Uint8ClampedBufferAttribute=zc;l.Uint8BufferAttribute=yc;l.Int8BufferAttribute=xc;l.BufferAttribute=S;l.ArcCurve=nc;l.CatmullRomCurve3=qa;l.CubicBezierCurve=Na;l.CubicBezierCurve3=$a;l.EllipseCurve=Ga;l.LineCurve=
-xa;l.LineCurve3=Oa;l.QuadraticBezierCurve=Pa;l.QuadraticBezierCurve3=ab;l.SplineCurve=Qa;l.REVISION="103";l.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2};l.CullFaceNone=0;l.CullFaceBack=1;l.CullFaceFront=2;l.CullFaceFrontBack=3;l.FrontFaceDirectionCW=0;l.FrontFaceDirectionCCW=1;l.BasicShadowMap=0;l.PCFShadowMap=1;l.PCFSoftShadowMap=2;l.FrontSide=0;l.BackSide=1;l.DoubleSide=2;l.FlatShading=1;l.SmoothShading=2;l.NoColors=0;l.FaceColors=1;l.VertexColors=2;l.NoBlending=0;l.NormalBlending=1;l.AdditiveBlending=2;l.SubtractiveBlending=
-3;l.MultiplyBlending=4;l.CustomBlending=5;l.AddEquation=100;l.SubtractEquation=101;l.ReverseSubtractEquation=102;l.MinEquation=103;l.MaxEquation=104;l.ZeroFactor=200;l.OneFactor=201;l.SrcColorFactor=202;l.OneMinusSrcColorFactor=203;l.SrcAlphaFactor=204;l.OneMinusSrcAlphaFactor=205;l.DstAlphaFactor=206;l.OneMinusDstAlphaFactor=207;l.DstColorFactor=208;l.OneMinusDstColorFactor=209;l.SrcAlphaSaturateFactor=210;l.NeverDepth=0;l.AlwaysDepth=1;l.LessDepth=2;l.LessEqualDepth=3;l.EqualDepth=4;l.GreaterEqualDepth=
-5;l.GreaterDepth=6;l.NotEqualDepth=7;l.MultiplyOperation=0;l.MixOperation=1;l.AddOperation=2;l.NoToneMapping=0;l.LinearToneMapping=1;l.ReinhardToneMapping=2;l.Uncharted2ToneMapping=3;l.CineonToneMapping=4;l.ACESFilmicToneMapping=5;l.UVMapping=300;l.CubeReflectionMapping=301;l.CubeRefractionMapping=302;l.EquirectangularReflectionMapping=303;l.EquirectangularRefractionMapping=304;l.SphericalReflectionMapping=305;l.CubeUVReflectionMapping=306;l.CubeUVRefractionMapping=307;l.RepeatWrapping=1E3;l.ClampToEdgeWrapping=
-1001;l.MirroredRepeatWrapping=1002;l.NearestFilter=1003;l.NearestMipMapNearestFilter=1004;l.NearestMipMapLinearFilter=1005;l.LinearFilter=1006;l.LinearMipMapNearestFilter=1007;l.LinearMipMapLinearFilter=1008;l.UnsignedByteType=1009;l.ByteType=1010;l.ShortType=1011;l.UnsignedShortType=1012;l.IntType=1013;l.UnsignedIntType=1014;l.FloatType=1015;l.HalfFloatType=1016;l.UnsignedShort4444Type=1017;l.UnsignedShort5551Type=1018;l.UnsignedShort565Type=1019;l.UnsignedInt248Type=1020;l.AlphaFormat=1021;l.RGBFormat=
-1022;l.RGBAFormat=1023;l.LuminanceFormat=1024;l.LuminanceAlphaFormat=1025;l.RGBEFormat=1023;l.DepthFormat=1026;l.DepthStencilFormat=1027;l.RedFormat=1028;l.RGB_S3TC_DXT1_Format=33776;l.RGBA_S3TC_DXT1_Format=33777;l.RGBA_S3TC_DXT3_Format=33778;l.RGBA_S3TC_DXT5_Format=33779;l.RGB_PVRTC_4BPPV1_Format=35840;l.RGB_PVRTC_2BPPV1_Format=35841;l.RGBA_PVRTC_4BPPV1_Format=35842;l.RGBA_PVRTC_2BPPV1_Format=35843;l.RGB_ETC1_Format=36196;l.RGBA_ASTC_4x4_Format=37808;l.RGBA_ASTC_5x4_Format=37809;l.RGBA_ASTC_5x5_Format=
-37810;l.RGBA_ASTC_6x5_Format=37811;l.RGBA_ASTC_6x6_Format=37812;l.RGBA_ASTC_8x5_Format=37813;l.RGBA_ASTC_8x6_Format=37814;l.RGBA_ASTC_8x8_Format=37815;l.RGBA_ASTC_10x5_Format=37816;l.RGBA_ASTC_10x6_Format=37817;l.RGBA_ASTC_10x8_Format=37818;l.RGBA_ASTC_10x10_Format=37819;l.RGBA_ASTC_12x10_Format=37820;l.RGBA_ASTC_12x12_Format=37821;l.LoopOnce=2200;l.LoopRepeat=2201;l.LoopPingPong=2202;l.InterpolateDiscrete=2300;l.InterpolateLinear=2301;l.InterpolateSmooth=2302;l.ZeroCurvatureEnding=2400;l.ZeroSlopeEnding=
-2401;l.WrapAroundEnding=2402;l.TrianglesDrawMode=0;l.TriangleStripDrawMode=1;l.TriangleFanDrawMode=2;l.LinearEncoding=3E3;l.sRGBEncoding=3001;l.GammaEncoding=3007;l.RGBEEncoding=3002;l.LogLuvEncoding=3003;l.RGBM7Encoding=3004;l.RGBM16Encoding=3005;l.RGBDEncoding=3006;l.BasicDepthPacking=3200;l.RGBADepthPacking=3201;l.TangentSpaceNormalMap=0;l.ObjectSpaceNormalMap=1;l.Face4=function(a,b,c,d,e,f,g){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");return new Qb(a,
-b,c,e,f,g)};l.LineStrip=0;l.LinePieces=1;l.MeshFaceMaterial=function(a){console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead.");return a};l.MultiMaterial=function(a){void 0===a&&(a=[]);console.warn("THREE.MultiMaterial has been removed. Use an Array instead.");a.isMultiMaterial=!0;a.materials=a;a.clone=function(){return a.slice()};return a};l.PointCloud=function(a,b){console.warn("THREE.PointCloud has been renamed to THREE.Points.");return new Xb(a,b)};l.Particle=function(a){console.warn("THREE.Particle has been renamed to THREE.Sprite.");
-return new Ic(a)};l.ParticleSystem=function(a,b){console.warn("THREE.ParticleSystem has been renamed to THREE.Points.");return new Xb(a,b)};l.PointCloudMaterial=function(a){console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.");return new Ka(a)};l.ParticleBasicMaterial=function(a){console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.");return new Ka(a)};l.ParticleSystemMaterial=function(a){console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.");
-return new Ka(a)};l.Vertex=function(a,b,c){console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead.");return new n(a,b,c)};l.DynamicBufferAttribute=function(a,b){console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.");return(new S(a,b)).setDynamic(!0)};l.Int8Attribute=function(a,b){console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.");return new xc(a,b)};l.Uint8Attribute=
-function(a,b){console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.");return new yc(a,b)};l.Uint8ClampedAttribute=function(a,b){console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.");return new zc(a,b)};l.Int16Attribute=function(a,b){console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.");return new Ac(a,b)};l.Uint16Attribute=function(a,b){console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.");
-return new sb(a,b)};l.Int32Attribute=function(a,b){console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.");return new Bc(a,b)};l.Uint32Attribute=function(a,b){console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.");return new tb(a,b)};l.Float32Attribute=function(a,b){console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.");return new E(a,b)};l.Float64Attribute=
-function(a,b){console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.");return new Cc(a,b)};l.ClosedSplineCurve3=Qf;l.SplineCurve3=Rf;l.Spline=Je;l.AxisHelper=function(a){console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper.");return new ud(a)};l.BoundingBoxHelper=function(a,b){console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead.");return new fb(a,b)};l.EdgesHelper=function(a,b){console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.");
-return new V(new ic(a.geometry),new R({color:void 0!==b?b:16777215}))};l.WireframeHelper=function(a,b){console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.");return new V(new Zb(a.geometry),new R({color:void 0!==b?b:16777215}))};l.XHRLoader=function(a){console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader.");return new Ma(a)};l.BinaryTextureLoader=function(a){console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.");return new me(a)};
-l.GeometryUtils={merge:function(a,b,c){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");if(b.isMesh){b.matrixAutoUpdate&&b.updateMatrix();var d=b.matrix;b=b.geometry}a.merge(b,d,c)},center:function(a){console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");return a.center()}};l.Projector=function(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js.");
+xa;l.LineCurve3=Oa;l.QuadraticBezierCurve=Pa;l.QuadraticBezierCurve3=ab;l.SplineCurve=Qa;l.REVISION="104dev";l.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2};l.CullFaceNone=0;l.CullFaceBack=1;l.CullFaceFront=2;l.CullFaceFrontBack=3;l.FrontFaceDirectionCW=0;l.FrontFaceDirectionCCW=1;l.BasicShadowMap=0;l.PCFShadowMap=1;l.PCFSoftShadowMap=2;l.FrontSide=0;l.BackSide=1;l.DoubleSide=2;l.FlatShading=1;l.SmoothShading=2;l.NoColors=0;l.FaceColors=1;l.VertexColors=2;l.NoBlending=0;l.NormalBlending=1;l.AdditiveBlending=2;
+l.SubtractiveBlending=3;l.MultiplyBlending=4;l.CustomBlending=5;l.AddEquation=100;l.SubtractEquation=101;l.ReverseSubtractEquation=102;l.MinEquation=103;l.MaxEquation=104;l.ZeroFactor=200;l.OneFactor=201;l.SrcColorFactor=202;l.OneMinusSrcColorFactor=203;l.SrcAlphaFactor=204;l.OneMinusSrcAlphaFactor=205;l.DstAlphaFactor=206;l.OneMinusDstAlphaFactor=207;l.DstColorFactor=208;l.OneMinusDstColorFactor=209;l.SrcAlphaSaturateFactor=210;l.NeverDepth=0;l.AlwaysDepth=1;l.LessDepth=2;l.LessEqualDepth=3;l.EqualDepth=
+4;l.GreaterEqualDepth=5;l.GreaterDepth=6;l.NotEqualDepth=7;l.MultiplyOperation=0;l.MixOperation=1;l.AddOperation=2;l.NoToneMapping=0;l.LinearToneMapping=1;l.ReinhardToneMapping=2;l.Uncharted2ToneMapping=3;l.CineonToneMapping=4;l.ACESFilmicToneMapping=5;l.UVMapping=300;l.CubeReflectionMapping=301;l.CubeRefractionMapping=302;l.EquirectangularReflectionMapping=303;l.EquirectangularRefractionMapping=304;l.SphericalReflectionMapping=305;l.CubeUVReflectionMapping=306;l.CubeUVRefractionMapping=307;l.RepeatWrapping=
+1E3;l.ClampToEdgeWrapping=1001;l.MirroredRepeatWrapping=1002;l.NearestFilter=1003;l.NearestMipMapNearestFilter=1004;l.NearestMipMapLinearFilter=1005;l.LinearFilter=1006;l.LinearMipMapNearestFilter=1007;l.LinearMipMapLinearFilter=1008;l.UnsignedByteType=1009;l.ByteType=1010;l.ShortType=1011;l.UnsignedShortType=1012;l.IntType=1013;l.UnsignedIntType=1014;l.FloatType=1015;l.HalfFloatType=1016;l.UnsignedShort4444Type=1017;l.UnsignedShort5551Type=1018;l.UnsignedShort565Type=1019;l.UnsignedInt248Type=1020;
+l.AlphaFormat=1021;l.RGBFormat=1022;l.RGBAFormat=1023;l.LuminanceFormat=1024;l.LuminanceAlphaFormat=1025;l.RGBEFormat=1023;l.DepthFormat=1026;l.DepthStencilFormat=1027;l.RedFormat=1028;l.RGB_S3TC_DXT1_Format=33776;l.RGBA_S3TC_DXT1_Format=33777;l.RGBA_S3TC_DXT3_Format=33778;l.RGBA_S3TC_DXT5_Format=33779;l.RGB_PVRTC_4BPPV1_Format=35840;l.RGB_PVRTC_2BPPV1_Format=35841;l.RGBA_PVRTC_4BPPV1_Format=35842;l.RGBA_PVRTC_2BPPV1_Format=35843;l.RGB_ETC1_Format=36196;l.RGBA_ASTC_4x4_Format=37808;l.RGBA_ASTC_5x4_Format=
+37809;l.RGBA_ASTC_5x5_Format=37810;l.RGBA_ASTC_6x5_Format=37811;l.RGBA_ASTC_6x6_Format=37812;l.RGBA_ASTC_8x5_Format=37813;l.RGBA_ASTC_8x6_Format=37814;l.RGBA_ASTC_8x8_Format=37815;l.RGBA_ASTC_10x5_Format=37816;l.RGBA_ASTC_10x6_Format=37817;l.RGBA_ASTC_10x8_Format=37818;l.RGBA_ASTC_10x10_Format=37819;l.RGBA_ASTC_12x10_Format=37820;l.RGBA_ASTC_12x12_Format=37821;l.LoopOnce=2200;l.LoopRepeat=2201;l.LoopPingPong=2202;l.InterpolateDiscrete=2300;l.InterpolateLinear=2301;l.InterpolateSmooth=2302;l.ZeroCurvatureEnding=
+2400;l.ZeroSlopeEnding=2401;l.WrapAroundEnding=2402;l.TrianglesDrawMode=0;l.TriangleStripDrawMode=1;l.TriangleFanDrawMode=2;l.LinearEncoding=3E3;l.sRGBEncoding=3001;l.GammaEncoding=3007;l.RGBEEncoding=3002;l.LogLuvEncoding=3003;l.RGBM7Encoding=3004;l.RGBM16Encoding=3005;l.RGBDEncoding=3006;l.BasicDepthPacking=3200;l.RGBADepthPacking=3201;l.TangentSpaceNormalMap=0;l.ObjectSpaceNormalMap=1;l.Face4=function(a,b,c,d,e,f,g){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");
+return new Qb(a,b,c,e,f,g)};l.LineStrip=0;l.LinePieces=1;l.MeshFaceMaterial=function(a){console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead.");return a};l.MultiMaterial=function(a){void 0===a&&(a=[]);console.warn("THREE.MultiMaterial has been removed. Use an Array instead.");a.isMultiMaterial=!0;a.materials=a;a.clone=function(){return a.slice()};return a};l.PointCloud=function(a,b){console.warn("THREE.PointCloud has been renamed to THREE.Points.");return new Xb(a,b)};l.Particle=
+function(a){console.warn("THREE.Particle has been renamed to THREE.Sprite.");return new Ic(a)};l.ParticleSystem=function(a,b){console.warn("THREE.ParticleSystem has been renamed to THREE.Points.");return new Xb(a,b)};l.PointCloudMaterial=function(a){console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.");return new Ka(a)};l.ParticleBasicMaterial=function(a){console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.");return new Ka(a)};l.ParticleSystemMaterial=
+function(a){console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.");return new Ka(a)};l.Vertex=function(a,b,c){console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead.");return new n(a,b,c)};l.DynamicBufferAttribute=function(a,b){console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.");return(new S(a,b)).setDynamic(!0)};l.Int8Attribute=function(a,b){console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.");
+return new xc(a,b)};l.Uint8Attribute=function(a,b){console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.");return new yc(a,b)};l.Uint8ClampedAttribute=function(a,b){console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.");return new zc(a,b)};l.Int16Attribute=function(a,b){console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.");return new Ac(a,b)};l.Uint16Attribute=
+function(a,b){console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.");return new sb(a,b)};l.Int32Attribute=function(a,b){console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.");return new Bc(a,b)};l.Uint32Attribute=function(a,b){console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.");return new tb(a,b)};l.Float32Attribute=function(a,b){console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.");
+return new E(a,b)};l.Float64Attribute=function(a,b){console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.");return new Cc(a,b)};l.ClosedSplineCurve3=Qf;l.SplineCurve3=Rf;l.Spline=Je;l.AxisHelper=function(a){console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper.");return new ud(a)};l.BoundingBoxHelper=function(a,b){console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead.");return new fb(a,b)};l.EdgesHelper=
+function(a,b){console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.");return new V(new ic(a.geometry),new R({color:void 0!==b?b:16777215}))};l.WireframeHelper=function(a,b){console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.");return new V(new Zb(a.geometry),new R({color:void 0!==b?b:16777215}))};l.XHRLoader=function(a){console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader.");return new Ma(a)};l.BinaryTextureLoader=function(a){console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.");
+return new me(a)};l.GeometryUtils={merge:function(a,b,c){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");if(b.isMesh){b.matrixAutoUpdate&&b.updateMatrix();var d=b.matrix;b=b.geometry}a.merge(b,d,c)},center:function(a){console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");return a.center()}};l.Projector=function(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js.");
 this.projectVector=function(a,b){console.warn("THREE.Projector: .projectVector() is now vector.project().");a.project(b)};this.unprojectVector=function(a,b){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject().");a.unproject(b)};this.pickingRay=function(){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}};l.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been removed")};l.JSONLoader=function(){console.error("THREE.JSONLoader has been removed.")};
 l.SceneUtils={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")}};l.LensFlare=function(){console.error("THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js")};Object.defineProperty(l,"__esModule",{value:!0})});

+ 3 - 3
build/three.module.js

@@ -179,7 +179,7 @@ Object.assign( EventDispatcher.prototype, {
 
 } );
 
-var REVISION = '103';
+var REVISION = '104dev';
 var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
 var CullFaceNone = 0;
 var CullFaceBack = 1;
@@ -40202,14 +40202,14 @@ Object.assign( StereoCamera.prototype, {
  * @author alteredq / http://alteredqualia.com/
  */
 
+var fov = 90, aspect = 1;
+
 function CubeCamera( near, far, cubeResolution, options ) {
 
 	Object3D.call( this );
 
 	this.type = 'CubeCamera';
 
-	var fov = 90, aspect = 1;
-
 	var cameraPX = new PerspectiveCamera( fov, aspect, near, far );
 	cameraPX.up.set( 0, - 1, 0 );
 	cameraPX.lookAt( new Vector3( 1, 0, 0 ) );

+ 1 - 1
docs/api/en/core/Object3D.html

@@ -46,7 +46,7 @@
 
 		<h3>[property:Material customDistanceMaterial]</h3>
 		<p>
-		Same as customDepthMaterial, but used with [page:PointLight]. Default is *undefined*.
+		Same as [page:.customDepthMaterial customDepthMaterial], but used with [page:PointLight]. Default is *undefined*.
 		</p>
 
 		<h3>[property:Boolean frustumCulled]</h3>

+ 8 - 3
docs/api/en/textures/Texture.html

@@ -187,13 +187,18 @@
 
 		<h3>[property:boolean premultiplyAlpha]</h3>
 		<p>
-		False by default, which is the norm for PNG images. Set to true if the RGB values have
-		been stored premultiplied by alpha.
+		If set to *true*, the alpha channel, if present, is multiplied into the color channels when the texture is uploaded to the GPU. Defaut is *false*.<br /><br />
+
+		Note that this property has no effect for [link:https://developer.mozilla.org/de/docs/Web/API/ImageBitmap ImageBitmap].
+		You need to configure on bitmap creation instead. See [page:ImageBitmapLoader].
 		</p>
 
 		<h3>[property:boolean flipY]</h3>
 		<p>
-		True by default. Flips the image's Y axis to match the WebGL texture coordinate space.
+		If set to *true*, the texture is flipped along the vertical axis when uploaded to the GPU. Default is *true*.<br /><br />
+
+		Note that this property has no effect for [link:https://developer.mozilla.org/de/docs/Web/API/ImageBitmap ImageBitmap].
+		You need to configure on bitmap creation instead. See [page:ImageBitmapLoader].
 		</p>
 
 		<h3>[property:number unpackAlignment]</h3>

+ 1 - 1
docs/api/zh/core/Object3D.html

@@ -44,7 +44,7 @@
 	</p>
 
 	<h3>[property:Material customDistanceMaterial]</h3>
-	<p>与customDepthMaterial相同,但与[page:PointLight]一起使用。默认值为*undefined*。
+	<p>与[page:.customDepthMaterial customDepthMaterial]相同,但与[page:PointLight]一起使用。默认值为*undefined*。
 	</p>
 
 	<h3>[property:Boolean frustumCulled]</h3>

+ 4 - 0
docs/api/zh/textures/Texture.html

@@ -188,11 +188,15 @@
 		<p>
 			默认为false,这是PNG图像的规范。
 			如果RGB值已被Alpha预乘,请将其设为true。
+			Note that this property has no effect for [link:https://developer.mozilla.org/de/docs/Web/API/ImageBitmap ImageBitmap].
+			You need to configure on bitmap creation instead. See [page:ImageBitmapLoader].
 		</p>
 
 		<h3>[property:boolean flipY]</h3>
 		<p>
 		默认为true。翻转图像的Y轴以匹配WebGL纹理坐标空间。
+		Note that this property has no effect for [link:https://developer.mozilla.org/de/docs/Web/API/ImageBitmap ImageBitmap].
+		You need to configure on bitmap creation instead. See [page:ImageBitmapLoader].
 		</p>
 
 		<h3>[property:number unpackAlignment]</h3>

+ 7 - 0
docs/manual/en/introduction/How-to-dispose-of-objects.html

@@ -54,6 +54,13 @@
 		for realizing custom rendering destinations. These objects are only deallocated by executing [page:WebGLRenderTarget.dispose]().
 	</p>
 
+	<h2>Scenes</h2>
+
+	<p>
+		The renderer maintains for scenes special data structures for sorting and rendering. If for some reasons a scene object becomes obsolete in an application,
+		call [page:Scene.dispose]() in order to free these resources.
+	</p>
+
 	<h2>Miscellaneous</h2>
 
 	<p>

+ 2 - 0
editor/js/Editor.js

@@ -498,6 +498,8 @@ Editor.prototype = {
 		this.storage.clear();
 
 		this.camera.copy( this.DEFAULT_CAMERA );
+		this.scene.name = "Scene";
+		this.scene.userData = {};
 		this.scene.background.setHex( 0xaaaaaa );
 		this.scene.fog = null;
 

+ 2 - 0
editor/js/Sidebar.Geometry.js

@@ -179,6 +179,8 @@ Sidebar.Geometry = function ( editor ) {
 
 			}
 
+			if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
+
 			geometryBoundingSphere.setValue( Math.floor( geometry.boundingSphere.radius * 1000 ) / 1000 );
 
 		} else {

+ 1 - 0
editor/js/Strings.js

@@ -299,6 +299,7 @@ var Strings = function ( config ) {
 			'menubar/add/icosahedron': '二十面体',
 			'menubar/add/torus': '圆环体',
 			'menubar/add/torusknot': '环面纽结体',
+			'menubar/add/tube': '管',
 			'menubar/add/lathe': '酒杯',
 			'menubar/add/sprite': '精灵',
 			'menubar/add/pointlight': '点光源',

+ 1 - 0
editor/js/Viewport.js

@@ -413,6 +413,7 @@ var Viewport = function ( editor ) {
 
 	signals.objectRemoved.add( function ( object ) {
 
+		controls.enabled = true; // see #14180
 		if ( object === transformControls.object ) {
 
 			transformControls.detach();

+ 38 - 38
editor/js/libs/three.html.js

@@ -2,74 +2,74 @@
  * @author mrdoob / http://mrdoob.com/
  */
 
- THREE.HTMLGroup = function ( dom ) {
+THREE.HTMLGroup = function ( dom ) {
 
- 	THREE.Group.call( this );
+	THREE.Group.call( this );
 
- 	this.type = 'HTMLGroup';
+	this.type = 'HTMLGroup';
 
- 	/*
- 	dom.addEventListener( 'mousemove', function ( event ) {
+	/*
+	dom.addEventListener( 'mousemove', function ( event ) {
 
- 		console.log( 'mousemove' );
+		console.log( 'mousemove' );
 
- 	} );
+	} );
 
- 	dom.addEventListener( 'click', function ( event ) {
+	dom.addEventListener( 'click', function ( event ) {
 
- 		console.log( 'click' );
+		console.log( 'click' );
 
- 	} );
- 	*/
+	} );
+	*/
 
- };
+};
 
- THREE.HTMLGroup.prototype = Object.assign( Object.create( THREE.Group.prototype ), {
+THREE.HTMLGroup.prototype = Object.assign( Object.create( THREE.Group.prototype ), {
 
- 	constructor: THREE.HTMLGroup
+	constructor: THREE.HTMLGroup
 
- } );
+} );
 
- THREE.HTMLMesh = function ( dom ) {
+THREE.HTMLMesh = function ( dom ) {
 
- 	var texture = new THREE.HTMLTexture( dom );
+	var texture = new THREE.HTMLTexture( dom );
 
- 	var geometry = new THREE.PlaneBufferGeometry( texture.image.width * 0.05, texture.image.height * 0.05 );
- 	var material = new THREE.MeshBasicMaterial( { map: texture } );
+	var geometry = new THREE.PlaneBufferGeometry( texture.image.width * 0.05, texture.image.height * 0.05 );
+	var material = new THREE.MeshBasicMaterial( { map: texture } );
 
- 	THREE.Mesh.call( this, geometry, material );
+	THREE.Mesh.call( this, geometry, material );
 
- 	this.type = 'HTMLMesh';
+	this.type = 'HTMLMesh';
 
- };
+};
 
- THREE.HTMLMesh.prototype = Object.assign( Object.create( THREE.Mesh.prototype ), {
+THREE.HTMLMesh.prototype = Object.assign( Object.create( THREE.Mesh.prototype ), {
 
- 	constructor: THREE.HTMLMesh
+	constructor: THREE.HTMLMesh
 
- } );
+} );
 
- THREE.HTMLTexture = function ( dom ) {
+THREE.HTMLTexture = function ( dom ) {
 
- 	THREE.CanvasTexture.call( this, html2canvas( dom ) );
+	THREE.CanvasTexture.call( this, html2canvas( dom ) );
 
- 	this.dom = dom;
+	this.dom = dom;
 
- 	this.anisotropy = 16;
+	this.anisotropy = 16;
 
- };
+};
 
- THREE.HTMLTexture.prototype = Object.assign( Object.create( THREE.CanvasTexture.prototype ), {
+THREE.HTMLTexture.prototype = Object.assign( Object.create( THREE.CanvasTexture.prototype ), {
 
- 	constructor: THREE.HTMLTexture,
+	constructor: THREE.HTMLTexture,
 
- 	update: function () {
+	update: function () {
 
- 		console.log( 'yo!', this, this.dom );
+		console.log( 'yo!', this, this.dom );
 
- 		this.image = html2canvas( this.dom );
- 		this.needsUpdate = true;
+		this.image = html2canvas( this.dom );
+		this.needsUpdate = true;
 
- 	}
+	}
 
- } );
+} );

+ 5 - 3
examples/js/loaders/KTXLoader.js

@@ -137,13 +137,15 @@ var KhronosTextureContainer = ( function () {
 		for ( var level = 0; level < mipmapCount; level ++ ) {
 
 			var imageSize = new Int32Array( this.arrayBuffer, dataOffset, 1 )[ 0 ]; // size per face, since not supporting array cubemaps
+			dataOffset += 4; // size of the image + 4 for the imageSize field
+			
 			for ( var face = 0; face < this.numberOfFaces; face ++ ) {
 
-				var byteArray = new Uint8Array( this.arrayBuffer, dataOffset + 4, imageSize );
+				var byteArray = new Uint8Array( this.arrayBuffer, dataOffset, imageSize );
 
 				mipmaps.push( { "data": byteArray, "width": width, "height": height } );
-
-				dataOffset += imageSize + 4; // size of the image + 4 for the imageSize field
+				
+				dataOffset += imageSize;
 				dataOffset += 3 - ( ( imageSize + 3 ) % 4 ); // add padding for odd sized image
 
 			}

+ 11 - 1
examples/js/loaders/SVGLoader.js

@@ -120,7 +120,17 @@ THREE.SVGLoader.prototype = {
 
 			if ( transform ) {
 
-				currentTransform.copy( transformStack.pop() );
+				transformStack.pop();
+
+				if ( transformStack.length > 0 ) {
+
+					currentTransform.copy( transformStack[ transformStack.length - 1 ] );
+
+				} else {
+
+					currentTransform.identity();
+
+				}
 
 			}
 

+ 7 - 0
examples/jsm/exporters/ColladaExporter.d.ts

@@ -0,0 +1,7 @@
+import {Object3D} from '../../../src/Three';
+
+export class ColladaExporter {
+	constructor();
+
+	parse(object: Object3D, onDone: (res: any) => void, options: object): null;
+}

+ 3 - 3
examples/jsm/exporters/GLTFExporter.d.ts

@@ -1,7 +1,7 @@
-import { Object3D } from '../../../src/Three';
+import {Object3D} from '../../../src/Three';
 
 export class GLTFExporter {
-  constructor();
+	constructor();
 
-  parse(input: Object3D, onCompleted: (gltf: object) => void, options: object): null;
+	parse(input: Object3D, onCompleted: (gltf: object) => void, options: object): null;
 }

+ 7 - 0
examples/jsm/exporters/MMDExporter.d.ts

@@ -0,0 +1,7 @@
+import {Object3D} from "../../..";
+
+export class MMDExporter {
+	constructor();
+
+	parseVpd(skin: Object3D, outputShiftJis: boolean, useOriginalBones: boolean): [] | Uint8Array
+}

+ 7 - 0
examples/jsm/exporters/OBJExporter.d.ts

@@ -0,0 +1,7 @@
+import {Object3D} from '../../../src/Three';
+
+export class OBJExporter {
+	constructor();
+
+	parse(object: Object3D): string;
+}

+ 7 - 0
examples/jsm/exporters/PLYExporter.d.ts

@@ -0,0 +1,7 @@
+import {Object3D} from "../../..";
+
+export class PLYExporter {
+	constructor();
+
+	parse(object: Object3D, onDone: (res: any) => void, options: object): null;
+}

+ 7 - 0
examples/jsm/exporters/STLExporter.d.ts

@@ -0,0 +1,7 @@
+import {Object3D} from "../../..";
+
+export class STLExporter {
+	constructor();
+
+	parse(scene: Object3D, options: {});
+}

+ 7 - 0
examples/jsm/exporters/TypedGeometryExporter.d.ts

@@ -0,0 +1,7 @@
+import {Object3D} from "../../..";
+
+export class TypedGeometryExporterD {
+	constructor();
+
+	parse(scene: Object3D, options: {}): DataView | string;
+}

+ 1 - 6
examples/jsm/pmrem/PMREMCubeUVPacker.d.ts

@@ -1,9 +1,4 @@
-import {
-  CubeTexture,
-  Renderer,
-  ShaderMaterial,
-  WebGLRenderTarget
-} from '../../../src/Three';
+import {CubeTexture, Renderer, WebGLRenderTarget} from '../../../src/Three';
 
 export class PMREMCubeUVPacker {
   CubeUVRenderTarget:WebGLRenderTarget;

+ 5 - 0
examples/jsm/utils/MathUtils.d.ts

@@ -0,0 +1,5 @@
+import {Quaternion} from "../../..";
+
+export namespace MathUtils {
+	export function setQuaternionFromProperEuler(q: Quaternion, a: number, b: number, c: number, order: string): void ;
+}

+ 40 - 32
examples/jsm/utils/MathUtils.js

@@ -7,61 +7,69 @@
 
 var MathUtils = {
 
-    setQuaternionFromProperEuler: function ( q, a, b, c, order ) {
 
-        // Intrinsic Proper Euler Angles - see https://en.wikipedia.org/wiki/Euler_angles
+	/**
+	 * @param {Quaternion} q
+	 * @param {number} a
+	 * @param {number} b
+	 * @param {number} c
+	 * @param {string} order
+	 */
+	setQuaternionFromProperEuler: function (q, a, b, c, order) {
 
-        // rotations are applied to the axes in the order specified by 'order'
-        // rotation by angle 'a' is applied first, then by angle 'b', then by angle 'c'
-        // angles are in radians
+		// Intrinsic Proper Euler Angles - see https://en.wikipedia.org/wiki/Euler_angles
 
-        var cos = Math.cos;
-        var sin = Math.sin;
+		// rotations are applied to the axes in the order specified by 'order'
+		// rotation by angle 'a' is applied first, then by angle 'b', then by angle 'c'
+		// angles are in radians
 
-        var c2 = cos( b / 2 );
-        var s2 = sin( b / 2 );
+		var cos = Math.cos;
+		var sin = Math.sin;
 
-        var c13 = cos( ( a + c ) / 2 );
-        var s13 = sin( ( a + c ) / 2 );
+		var c2 = cos(b / 2);
+		var s2 = sin(b / 2);
 
-        var c1_3 = cos( ( a - c ) / 2 );
-        var s1_3 = sin( ( a - c ) / 2 );
+		var c13 = cos((a + c) / 2);
+		var s13 = sin((a + c) / 2);
 
-        var c3_1 = cos( ( c - a ) / 2 );
-        var s3_1 = sin( ( c - a ) / 2 );
+		var c1_3 = cos((a - c) / 2);
+		var s1_3 = sin((a - c) / 2);
 
-        if ( order === 'XYX' ) {
+		var c3_1 = cos((c - a) / 2);
+		var s3_1 = sin((c - a) / 2);
 
-            q.set( c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13 );
+		if (order === 'XYX') {
 
-        } else if ( order === 'YZY' ) {
+			q.set(c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13);
 
-            q.set( s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13 );
+		} else if (order === 'YZY') {
 
-        } else if ( order === 'ZXZ' ) {
+			q.set(s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13);
 
-            q.set( s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13 );
+		} else if (order === 'ZXZ') {
 
-        } else if ( order === 'XZX' ) {
+			q.set(s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13);
 
-            q.set( c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13 );
+		} else if (order === 'XZX') {
 
-        } else if ( order === 'YXY' ) {
+			q.set(c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13);
 
-            q.set( s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13 );
+		} else if (order === 'YXY') {
 
-        } else if ( order === 'ZYZ' ) {
+			q.set(s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13);
 
-            q.set( s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13 );
+		} else if (order === 'ZYZ') {
 
-        } else {
+			q.set(s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13);
 
-            console.warn( 'THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.' );
+		} else {
 
-        }
+			console.warn('THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.');
 
-    }
+		}
+
+	}
 
 };
 
-export { MathUtils };
+export {MathUtils};

+ 8 - 0
examples/jsm/utils/ShadowMapViewer.d.ts

@@ -0,0 +1,8 @@
+import {Light} from "../../..";
+
+export class ShadowMapViewer {
+	constructor(light: Light)
+}
+
+
+

+ 32 - 0
examples/jsm/utils/SkeletonUtils.d.ts

@@ -0,0 +1,32 @@
+import {AnimationClip, Bone, Matrix4, Object3D, Skeleton, SkeletonHelper} from "../../..";
+
+export class SkeletonUtils {
+	retarget(target: Object3D | Skeleton,
+					 source: Object3D | Skeleton,
+					 options: {})
+
+	retargetClip(target: Skeleton | Object3D,
+							 source: Skeleton | Object3D,
+							 clip: AnimationClip,
+							 options: {}): AnimationClip;
+
+	getHelperFromSkeleton(skeleton: Skeleton): SkeletonHelper;
+
+	getSkeletonOffsets(target: Object3D | Skeleton,
+										 source: Object3D | Skeleton,
+										 options: {}): Matrix4[];
+
+	renameBones(skeleton: Skeleton, names: {}): any;
+
+	getBones(skeleton: Skeleton | Bone[]): Bone[];
+
+	getBoneByName(name: string, skeleton: Skeleton): Bone;
+
+	getNearestBone(bone: Bone, names: {}): Bone;
+
+	findBoneTrackData(name: string, tracks: any[]): {};
+
+	getEqualsBonesNames(skeleton: Skeleton, targetSkeleton: Skeleton);
+
+	clone(source: Skeleton): Skeleton;
+}

+ 58 - 0
examples/jsm/utils/TypedArrayUtils.d.ts

@@ -0,0 +1,58 @@
+export namespace TypedArrayUtils {
+	export function quicksortIP(arr: any[], eleSize: number, orderElement: number): any[];
+
+
+	export class Kdtree {
+		self: this;
+		root: Node;
+		private maxDepth: number;
+
+		constructor(points: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Float32Array | Float64Array | Uint8ClampedArray, metric: (a: any, b: any) => number, eleSize: number);
+
+		getPointSet(points: any, pos: number);
+
+		buildTree(): Node;
+
+		getMaxDepth(): number;
+
+		nearest(point: [], maxNodes: number, maxDistance: number): any[];
+
+	}
+
+	export namespace Kdtree {
+		export class Node {
+			obj: any;
+			left: Node | null;
+			right: Node | null;
+			parent: Node;
+			depth: number;
+			pos: any;
+
+			constructor(obj: any, depth: number, parent: Node, pos: any)
+		}
+
+
+		export class BinaryHeap {
+			content: any[];
+			scoreFunction: () => any;
+
+			constructor(scoreFunction?: () => any);
+		}
+
+		export namespace BinaryHeap {
+			export function push(element: any): void;
+
+			export function pop(): any;
+
+			export function peek(): any;
+
+			export function remove(node: any): any;
+
+			export function size(): number;
+
+			export function bubbleUp(n: number): void;
+
+			export function sinkDown(n: number): void;
+		}
+	}
+}

+ 3 - 0
examples/jsm/utils/UVsDebug.d.ts

@@ -0,0 +1,3 @@
+import {Geometry} from "../../..";
+
+export function UVsDebug(geometry: Geometry, size: number): HTMLCanvasElement;

+ 1 - 0
examples/webgl_buffergeometry_morphtargets.html

@@ -27,6 +27,7 @@
 		<div id="container"></div>
 		<div id="info">
 			<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - buffergeometry - morph targets
+			by <a href="https://discoverthreejs.com/" target="_blank" rel="noopener">Discover three.js</a>
 		</div>
 
 		<script src="../build/three.js"></script>

+ 0 - 2
examples/webgl_custom_attributes_points.html

@@ -38,7 +38,6 @@
 
 		<script type="x-shader/x-vertex" id="vertexshader">
 
-			uniform float amplitude;
 			attribute float size;
 			attribute vec3 customColor;
 
@@ -143,7 +142,6 @@
 			var material = new THREE.ShaderMaterial( {
 
 				uniforms: {
-					amplitude: { value: 1.0 },
 					color: { value: new THREE.Color( 0xffffff ) },
 					texture: { value: new THREE.TextureLoader().load( "textures/sprites/spark1.png" ) }
 				},

+ 0 - 1
examples/webgl_custom_attributes_points2.html

@@ -149,7 +149,6 @@
 			var material = new THREE.ShaderMaterial( {
 
 				uniforms: {
-					amplitude: { value: 1.0 },
 					color: { value: new THREE.Color( 0xffffff ) },
 					texture: { value: texture }
 				},

+ 1 - 1
examples/webgl_loader_lwo.html

@@ -31,7 +31,7 @@
 	<body>
 		<div id="info">
 			<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - LWOLoader<br />
-			<P>Loader for Lightwave LWO V3 file format</P>
+			<P>Loader for Lightwave LWO V3 file format, by <a href="https://discoverthreejs.com/" target="_blank" rel="noopener">Discover three.js</a></P>
 		</div>
 
 		<script src="../build/three.js"></script>

+ 3 - 0
examples/webgl_materials_matcap.html

@@ -192,6 +192,9 @@
 				mesh.material.matcap = new THREE.Texture( event.target );
 				mesh.material.matcap.needsUpdate = true;
 
+				mesh.material.matcap.encoding = THREE.sRGBEncoding; // assume it is sRGB
+				mesh.material.needsUpdate = true;
+
 				image.src = mesh.material.matcap.image.src; // corner div
 
 				render();

+ 1 - 0
src/animation/AnimationAction.d.ts

@@ -19,6 +19,7 @@ export class AnimationAction {
   stop(): AnimationAction;
   reset(): AnimationAction;
   isRunning(): boolean;
+  isScheduled(): boolean;
   startAt(time: number): AnimationAction;
   setLoop(
     mode: AnimationActionLoopStyles,

+ 2 - 2
src/cameras/CubeCamera.js

@@ -11,14 +11,14 @@ import { PerspectiveCamera } from './PerspectiveCamera.js';
  * @author alteredq / http://alteredqualia.com/
  */
 
+var fov = 90, aspect = 1;
+
 function CubeCamera( near, far, cubeResolution, options ) {
 
 	Object3D.call( this );
 
 	this.type = 'CubeCamera';
 
-	var fov = 90, aspect = 1;
-
 	var cameraPX = new PerspectiveCamera( fov, aspect, near, far );
 	cameraPX.up.set( 0, - 1, 0 );
 	cameraPX.lookAt( new Vector3( 1, 0, 0 ) );

+ 0 - 3
src/core/BufferGeometry.d.ts

@@ -9,9 +9,6 @@ import { Geometry } from './Geometry';
 import { DirectGeometry } from './DirectGeometry';
 import { EventDispatcher } from './EventDispatcher';
 import { InterleavedBufferAttribute } from './InterleavedBufferAttribute';
-/**
- * @deprecated Use {@link BufferAttribute#setDynamic THREE.BufferAttribute().setDynamic( true )} instead.
- */
 
 /**
  * This is a superefficent class for geometries because it saves all data in buffers.

+ 3 - 3
src/materials/Materials.d.ts

@@ -6,13 +6,13 @@ export * from './PointsMaterial';
 export * from './MeshPhysicalMaterial';
 export * from './MeshStandardMaterial';
 export * from './MeshPhongMaterial';
-//export * from './MeshToonMaterial';
+export * from './MeshToonMaterial';
 export * from './MeshNormalMaterial';
 export * from './MeshLambertMaterial';
 export * from './MeshDepthMaterial';
-//export * from './MeshDistanceMaterial';
+export * from './MeshDistanceMaterial';
 export * from './MeshBasicMaterial';
-//export * from './MeshMatcapMaterial';
+export * from './MeshMatcapMaterial';
 export * from './LineDashedMaterial';
 export * from './LineBasicMaterial';
 export * from './Material';

+ 15 - 7
src/materials/MeshDepthMaterial.d.ts

@@ -1,17 +1,25 @@
 import { DepthPackingStrategies } from '../constants';
 import { MaterialParameters, Material } from './Material';
+import { Texture } from './../textures/Texture';
 
 export interface MeshDepthMaterialParameters extends MaterialParameters {
-  wireframe?: boolean;
-  wireframeLinewidth?: number;
+	depthPacking?: DepthPackingStrategies;
+	displacementMap?: Texture;
+	displacementScale?: number;
+	displacementBias?: number;
+	wireframe?: boolean;
+	wireframeLinewidth?: number;
 }
 
 export class MeshDepthMaterial extends Material {
-  constructor(parameters?: MeshDepthMaterialParameters);
+	constructor(parameters?: MeshDepthMaterialParameters);
 
-  wireframe: boolean;
-  wireframeLinewidth: number;
-  depthPacking: DepthPackingStrategies;
+	depthPacking: DepthPackingStrategies;
+	displacementMap: Texture | null;
+	displacementScale: number;
+	displacementBias: number;
+	wireframe: boolean;
+	wireframeLinewidth: number;
 
-  setValues(parameters: MeshDepthMaterialParameters): void;
+	setValues(parameters: MeshDepthMaterialParameters): void;
 }

+ 25 - 0
src/materials/MeshDistanceMaterial.d.ts

@@ -0,0 +1,25 @@
+import { MaterialParameters, Material } from './Material';
+import { Vector3 } from './../math/Vector3';
+import { Texture } from './../textures/Texture';
+
+export interface MeshDistanceMaterialParameters extends MaterialParameters {
+	referencePosition?: Vector3;
+	nearDistance?: number;
+	farDistance?: number;
+	displacementMap?: Texture;
+	displacementScale?: number;
+	displacementBias?: number;
+}
+
+export class MeshDistanceMaterial extends Material {
+	constructor(parameters?: MeshDistanceMaterialParameters);
+
+	referencePosition: Vector3;
+	nearDistance: number;
+	farDistance: number;
+	displacementMap: Texture | null;
+	displacementScale: number;
+	displacementBias: number;
+
+	setValues(parameters: MeshDistanceMaterialParameters): void;
+}

+ 43 - 0
src/materials/MeshMatcapMaterial.d.ts

@@ -0,0 +1,43 @@
+import { Color } from './../math/Color';
+import { Texture } from './../textures/Texture';
+import { Vector2 } from './../math/Vector2';
+import { MaterialParameters, Material } from './Material';
+
+export interface MeshMatcapMaterialParameters extends MaterialParameters {
+
+	color?: Color | string | number;
+	matMap?: Texture;
+	map?: Texture;
+	bumpMap?: Texture;
+	bumpScale?: number;
+	normalMap?: Texture;
+	normalScale?: Vector2;
+	displacementMap?: Texture;
+	displacementScale?: number;
+	displacementBias?: number;
+	alphaMap?: Texture;
+	skinning?: boolean;
+	morphTargets?: boolean;
+	morphNormals?: boolean;
+}
+
+export class MeshMatcapMaterial extends Material {
+	constructor(parameters?: MeshMatcapMaterialParameters);
+
+	color: Color;
+	matMap: Texture | null;
+	map: Texture | null;
+	bumpMap: Texture | null;
+	bumpScale: number;
+	normalMap: Texture | null;
+	normalScale: Vector2;
+	displacementMap: Texture | null;
+	displacementScale: number;
+	displacementBias: number;
+	alphaMap: Texture | null;
+	skinning: boolean;
+	morphTargets: boolean;
+	morphNormals: boolean;
+
+	setValues(parameters: MeshMatcapMaterialParameters): void;
+}

+ 14 - 0
src/materials/MeshToonMaterial.d.ts

@@ -0,0 +1,14 @@
+import { Texture } from './../textures/Texture';
+import { MeshPhongMaterialParameters, MeshPhongMaterial } from './MeshPhongMaterial';
+
+export interface MeshToonMaterialParameters extends MeshPhongMaterialParameters {
+	gradientMap?: Texture;
+}
+
+export class MeshToonMaterial extends MeshPhongMaterial {
+	constructor(parameters?: MeshToonMaterialParameters);
+
+	gradientMap: Texture | null;
+
+	setValues(parameters: MeshToonMaterialParameters): void;
+}