Quellcode durchsuchen

Merge pull request #17395 from Mugen87/dev37

Examples: Inherit loaders from Loader II.
Michael Herzog vor 6 Jahren
Ursprung
Commit
9a6d53f535

+ 3 - 6
docs/examples/en/loaders/OBJLoader.html

@@ -8,6 +8,7 @@
 		<link type="text/css" rel="stylesheet" href="page.css" />
 	</head>
 	<body>
+		[page:Loader] &rarr;
 
 		<h1>[name]</h1>
 
@@ -64,9 +65,10 @@
 		</p>
 
 		<h2>Properties</h2>
-
+		<p>See the base [page:Loader] class for common properties.</p>
 
 		<h2>Methods</h2>
+		<p>See the base [page:Loader] class for common methods.</p>
 
 		<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
 		<p>
@@ -97,11 +99,6 @@
 		Sets materials loaded by MTLLoader or any other supplier of a [page:MTLLoaderMaterialCreator MTLLoader.MaterialCreator].
 		</p>
 
-		<h3>[method:OBJLoader setPath]( [param:String path] )</h3>
-		<p>
-		Sets the base path or URL from which to load files. This can be useful to avoid repetition if you are calling [page:OBJLoader.load .load] multiple times on the same directory.
-		</p>
-
 		<h2>Source</h2>
 
 		<p>

+ 3 - 8
docs/examples/en/loaders/PCDLoader.html

@@ -8,6 +8,7 @@
 		<link type="text/css" rel="stylesheet" href="page.css" />
 	</head>
 	<body>
+		[page:Loader] &rarr;
 
 		<h1>[name]</h1>
 
@@ -62,6 +63,7 @@
 		</p>
 
 		<h2>Properties</h2>
+		<p>See the base [page:Loader] class for common properties.</p>
 
 		<h3>[page:Boolean littleEndian]</h3>
 		<p>
@@ -69,6 +71,7 @@
 		</p>
 
 		<h2>Methods</h2>
+		<p>See the base [page:Loader] class for common methods.</p>
 
 		<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
 		<p>
@@ -93,14 +96,6 @@
 		The object is converted to [page:Points] with a [page:BufferGeometry] and a [page:PointsMaterial].
 		</p>
 
-		<h3>[method:PCDLoader setPath]( [param:String path] )</h3>
-		<p>
-		[page:String path] — Base path.
-		</p>
-		<p>
-		Set the base path for the file.
-		</p>
-
 		<h2>Source</h2>
 
 		<p>

+ 3 - 9
docs/examples/en/loaders/PDBLoader.html

@@ -8,6 +8,7 @@
 		<link type="text/css" rel="stylesheet" href="page.css" />
 	</head>
 	<body>
+		[page:Loader] &rarr;
 
 		<h1>[name]</h1>
 
@@ -64,9 +65,10 @@
 		</p>
 
 		<h2>Properties</h2>
-
+		<p>See the base [page:Loader] class for common properties.</p>
 
 		<h2>Methods</h2>
+		<p>See the base [page:Loader] class for common methods.</p>
 
 		<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
 		<p>
@@ -87,14 +89,6 @@
 		Parse a <em>pdb</em> text and return a <em>JSON</em> structure.<br />
 		</p>
 
-		<h3>[method:PDBLoader setPath]( [param:String path] )</h3>
-		<p>
-		[page:String path] — Base path.
-		</p>
-		<p>
-		Set the base path for the file.
-		</p>
-
 		<h2>Source</h2>
 
 		<p>

+ 3 - 15
docs/examples/en/loaders/PRWMLoader.html

@@ -8,6 +8,7 @@
 		<link type="text/css" rel="stylesheet" href="page.css" />
 	</head>
 	<body>
+		[page:Loader] &rarr;
 
 		<h1>[name]</h1>
 
@@ -65,9 +66,10 @@
 		</p>
 
 		<h2>Properties</h2>
-
+		<p>See the base [page:Loader] class for common properties.</p>
 
 		<h2>Methods</h2>
+		<p>See the base [page:Loader] class for common methods.</p>
 
 		<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
 		<p>
@@ -94,25 +96,11 @@
 		Return true if the endianness of the platform is Big Endian, false otherwise.
 		</p>
 
-		<h3>[method:PRWMLoader setPath]( [param:String path] )</h3>
-		<p>
-		[page:String path] — Base path.
-		</p>
-		<p>
-		Set the base path for the file.
-		</p>
-
 		<h2>Source</h2>
 
 		<p>
 			[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/PRWMLoader.js examples/js/loaders/PRWMLoader.js]
 		</p>
 
-		<h2>Additional notes</h2>
-
-		<p>
-		This loader is additionally available on npm as <a href="https://www.npmjs.com/package/three-prwm-loader">three-prwm-loader</a>.
-		</p>
-
 	</body>
 </html>

+ 3 - 9
docs/examples/en/loaders/SVGLoader.html

@@ -8,6 +8,7 @@
 		<link type="text/css" rel="stylesheet" href="page.css" />
 	</head>
 	<body>
+		[page:Loader] &rarr;
 
 		<h1>[name]</h1>
 
@@ -85,9 +86,10 @@
 		</p>
 
 		<h2>Properties</h2>
-
+		<p>See the base [page:Loader] class for common properties.</p>
 
 		<h2>Methods</h2>
+		<p>See the base [page:Loader] class for common methods.</p>
 
 		<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
 		<p>
@@ -100,14 +102,6 @@
 		Begin loading from url and call onLoad with the response content.
 		</p>
 
-		<h3>[method:SVGLoader setPath]( [param:String path] )</h3>
-		<p>
-		[page:String path] — Base path.
-		</p>
-		<p>
-		Set the base path for the file.
-		</p>
-
 		<h2>Source</h2>
 
 		<p>

+ 3 - 6
docs/examples/zh/loaders/OBJLoader.html

@@ -8,6 +8,7 @@
 		<link type="text/css" rel="stylesheet" href="page.css" />
 	</head>
 	<body>
+		[page:Loader] &rarr;
 
 		<h1>[name]</h1>
 
@@ -64,9 +65,10 @@
 		</p>
 
 		<h2>Properties</h2>
-
+		<p>See the base [page:Loader] class for common properties.</p>
 
 		<h2>Methods</h2>
+		<p>See the base [page:Loader] class for common methods.</p>
 
 		<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
 		<p>
@@ -97,11 +99,6 @@
 		Sets materials loaded by MTLLoader or any other supplier of a [page:MTLLoaderMaterialCreator MTLLoader.MaterialCreator].
 		</p>
 
-		<h3>[method:OBJLoader setPath]( [param:String path] )</h3>
-		<p>
-		Sets the base path or URL from which to load files. This can be useful to avoid repetition if you are calling [page:OBJLoader.load .load] multiple times on the same directory.
-		</p>
-
 		<h2>Source</h2>
 
 		<p>

+ 3 - 8
docs/examples/zh/loaders/PCDLoader.html

@@ -8,6 +8,7 @@
 		<link type="text/css" rel="stylesheet" href="page.css" />
 	</head>
 	<body>
+		[page:Loader] &rarr;
 
 		<h1>[name]</h1>
 
@@ -62,6 +63,7 @@
 		</p>
 
 		<h2>Properties</h2>
+		<p>See the base [page:Loader] class for common properties.</p>
 
 		<h3>[page:Boolean littleEndian]</h3>
 		<p>
@@ -69,6 +71,7 @@
 		</p>
 
 		<h2>Methods</h2>
+		<p>See the base [page:Loader] class for common methods.</p>
 
 		<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
 		<p>
@@ -93,14 +96,6 @@
 		The object is converted to [page:Points] with a [page:BufferGeometry] and a [page:PointsMaterial].
 		</p>
 
-		<h3>[method:PCDLoader setPath]( [param:String path] )</h3>
-		<p>
-		[page:String path] — Base path.
-		</p>
-		<p>
-		Set the base path for the file.
-		</p>
-
 		<h2>Source</h2>
 
 		<p>

+ 3 - 9
docs/examples/zh/loaders/PDBLoader.html

@@ -8,6 +8,7 @@
 		<link type="text/css" rel="stylesheet" href="page.css" />
 	</head>
 	<body>
+		[page:Loader] &rarr;
 
 		<h1>[name]</h1>
 
@@ -64,9 +65,10 @@
 		</p>
 
 		<h2>Properties</h2>
-
+		<p>See the base [page:Loader] class for common properties.</p>
 
 		<h2>Methods</h2>
+		<p>See the base [page:Loader] class for common methods.</p>
 
 		<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
 		<p>
@@ -87,14 +89,6 @@
 		Parse a <em>pdb</em> text and return a <em>JSON</em> structure.<br />
 		</p>
 
-		<h3>[method:PDBLoader setPath]( [param:String path] )</h3>
-		<p>
-		[page:String path] — Base path.
-		</p>
-		<p>
-		Set the base path for the file.
-		</p>
-
 		<h2>Source</h2>
 
 		<p>

+ 3 - 15
docs/examples/zh/loaders/PRWMLoader.html

@@ -8,6 +8,7 @@
 		<link type="text/css" rel="stylesheet" href="page.css" />
 	</head>
 	<body>
+		[page:Loader] &rarr;
 
 		<h1>[name]</h1>
 
@@ -65,9 +66,10 @@
 		</p>
 
 		<h2>Properties</h2>
-
+		<p>See the base [page:Loader] class for common properties.</p>
 
 		<h2>Methods</h2>
+		<p>See the base [page:Loader] class for common methods.</p>
 
 		<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
 		<p>
@@ -94,25 +96,11 @@
 		Return true if the endianness of the platform is Big Endian, false otherwise.
 		</p>
 
-		<h3>[method:PRWMLoader setPath]( [param:String path] )</h3>
-		<p>
-		[page:String path] — Base path.
-		</p>
-		<p>
-		Set the base path for the file.
-		</p>
-
 		<h2>Source</h2>
 
 		<p>
 			[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/PRWMLoader.js examples/js/loaders/PRWMLoader.js]
 		</p>
 
-		<h2>Additional notes</h2>
-
-		<p>
-		This loader is additionally available on npm as <a href="https://www.npmjs.com/package/three-prwm-loader">three-prwm-loader</a>.
-		</p>
-
 	</body>
 </html>

+ 3 - 9
docs/examples/zh/loaders/SVGLoader.html

@@ -8,6 +8,7 @@
 		<link type="text/css" rel="stylesheet" href="page.css" />
 	</head>
 	<body>
+		[page:Loader] &rarr;
 
 		<h1>[name]</h1>
 
@@ -85,9 +86,10 @@
 		</p>
 
 		<h2>Properties</h2>
-
+		<p>See the base [page:Loader] class for common properties.</p>
 
 		<h2>Methods</h2>
+		<p>See the base [page:Loader] class for common methods.</p>
 
 		<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
 		<p>
@@ -100,14 +102,6 @@
 		Begin loading from url and call onLoad with the response content.
 		</p>
 
-		<h3>[method:SVGLoader setPath]( [param:String path] )</h3>
-		<p>
-		[page:String path] — Base path.
-		</p>
-		<p>
-		Set the base path for the file.
-		</p>
-
 		<h2>Source</h2>
 
 		<p>

+ 4 - 4
docs/list.js

@@ -375,9 +375,9 @@ var list = {
 				"LoaderSupport": "examples/en/loaders/LoaderSupport",
 				"PCDLoader": "examples/en/loaders/PCDLoader",
 				"PDBLoader": "examples/en/loaders/PDBLoader",
+				"PRWMLoader": "examples/en/loaders/PRWMLoader",
 				"SVGLoader": "examples/en/loaders/SVGLoader",
-				"TGALoader": "examples/en/loaders/TGALoader",
-				"PRWMLoader": "examples/en/loaders/PRWMLoader"
+				"TGALoader": "examples/en/loaders/TGALoader"
 			},
 
 			"Objects": {
@@ -812,9 +812,9 @@ var list = {
 				"LoaderSupport": "examples/zh/loaders/LoaderSupport",
 				"PCDLoader": "examples/zh/loaders/PCDLoader",
 				"PDBLoader": "examples/zh/loaders/PDBLoader",
+				"PRWMLoader": "examples/zh/loaders/PRWMLoader",
 				"SVGLoader": "examples/zh/loaders/SVGLoader",
-				"TGALoader": "examples/zh/loaders/TGALoader",
-				"PRWMLoader": "examples/zh/loaders/PRWMLoader"
+				"TGALoader": "examples/zh/loaders/TGALoader"
 			},
 
 			"物体": {

+ 3 - 10
examples/js/loaders/MD2Loader.js

@@ -4,11 +4,11 @@
 
 THREE.MD2Loader = function ( manager ) {
 
-	this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
+	THREE.Loader.call( this, manager );
 
 };
 
-THREE.MD2Loader.prototype = {
+THREE.MD2Loader.prototype = Object.assign( Object.create( THREE.Loader.prototype ), {
 
 	constructor: THREE.MD2Loader,
 
@@ -27,13 +27,6 @@ THREE.MD2Loader.prototype = {
 
 	},
 
-	setPath: function ( value ) {
-
-		this.path = value;
-		return this;
-
-	},
-
 	parse: ( function () {
 
 		var normalData = [
@@ -384,4 +377,4 @@ THREE.MD2Loader.prototype = {
 
 	} )()
 
-};
+} );

+ 3 - 11
examples/js/loaders/OBJLoader.js

@@ -364,13 +364,13 @@ THREE.OBJLoader = ( function () {
 
 	function OBJLoader( manager ) {
 
-		this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
+		THREE.Loader.call( this, manager );
 
 		this.materials = null;
 
 	}
 
-	OBJLoader.prototype = {
+	OBJLoader.prototype = Object.assign( Object.create( THREE.Loader.prototype ), {
 
 		constructor: OBJLoader,
 
@@ -388,14 +388,6 @@ THREE.OBJLoader = ( function () {
 
 		},
 
-		setPath: function ( value ) {
-
-			this.path = value;
-
-			return this;
-
-		},
-
 		setMaterials: function ( materials ) {
 
 			this.materials = materials;
@@ -790,7 +782,7 @@ THREE.OBJLoader = ( function () {
 
 		}
 
-	};
+	} );
 
 	return OBJLoader;
 

+ 4 - 10
examples/js/loaders/PCDLoader.js

@@ -10,13 +10,14 @@
 
 THREE.PCDLoader = function ( manager ) {
 
-	this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
+	THREE.Loader.call( this, manager );
+
 	this.littleEndian = true;
 
 };
 
 
-THREE.PCDLoader.prototype = {
+THREE.PCDLoader.prototype = Object.assign( Object.create( THREE.Loader.prototype ), {
 
 	constructor: THREE.PCDLoader,
 
@@ -51,13 +52,6 @@ THREE.PCDLoader.prototype = {
 
 	},
 
-	setPath: function ( value ) {
-
-		this.path = value;
-		return this;
-
-	},
-
 	parse: function ( data, url ) {
 
 		function parseHeader( data ) {
@@ -305,4 +299,4 @@ THREE.PCDLoader.prototype = {
 
 	}
 
-};
+} );

+ 3 - 10
examples/js/loaders/PDBLoader.js

@@ -5,11 +5,11 @@
 
 THREE.PDBLoader = function ( manager ) {
 
-	this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
+	THREE.Loader.call( this, manager );
 
 };
 
-THREE.PDBLoader.prototype = {
+THREE.PDBLoader.prototype = Object.assign( Object.create( THREE.Loader.prototype ), {
 
 	constructor: THREE.PDBLoader,
 
@@ -27,13 +27,6 @@ THREE.PDBLoader.prototype = {
 
 	},
 
-	setPath: function ( value ) {
-
-		this.path = value;
-		return this;
-
-	},
-
 	// Based on CanvasMol PDB parser
 
 	parse: function ( text ) {
@@ -214,4 +207,4 @@ THREE.PDBLoader.prototype = {
 
 	}
 
-};
+} );

+ 4 - 11
examples/js/loaders/PRWMLoader.js

@@ -224,13 +224,13 @@ THREE.PRWMLoader = ( function () {
 
 	function PRWMLoader( manager ) {
 
-		this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
+		THREE.Loader.call( this, manager );
 
 	}
 
-	PRWMLoader.prototype = {
+	PRWMLoader.prototype = Object.assign( Object.create( THREE.Loader.prototype ), {
 
-		constructor: THREE.PRWMLoader,
+		constructor: PRWMLoader,
 
 		load: function ( url, onLoad, onProgress, onError ) {
 
@@ -250,13 +250,6 @@ THREE.PRWMLoader = ( function () {
 
 		},
 
-		setPath: function ( value ) {
-
-			this.path = value;
-			return this;
-
-		},
-
 		parse: function ( arrayBuffer ) {
 
 			var data = decodePrwm( arrayBuffer ),
@@ -282,7 +275,7 @@ THREE.PRWMLoader = ( function () {
 
 		}
 
-	};
+	} );
 
 	PRWMLoader.isBigEndianPlatform = function () {
 

+ 3 - 10
examples/js/loaders/SVGLoader.js

@@ -6,11 +6,11 @@
 
 THREE.SVGLoader = function ( manager ) {
 
-	this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
+	THREE.Loader.call( this, manager );
 
 };
 
-THREE.SVGLoader.prototype = {
+THREE.SVGLoader.prototype = Object.assign( Object.create( THREE.Loader.prototype ), {
 
 	constructor: THREE.SVGLoader,
 
@@ -28,13 +28,6 @@ THREE.SVGLoader.prototype = {
 
 	},
 
-	setPath: function ( value ) {
-
-		this.path = value;
-		return this;
-
-	},
-
 	parse: function ( text ) {
 
 		function parseNode( node, style ) {
@@ -1172,7 +1165,7 @@ THREE.SVGLoader.prototype = {
 
 	}
 
-};
+} );
 
 THREE.SVGLoader.getStrokeStyle = function ( width, color, lineJoin, lineCap, miterLimit ) {
 

+ 4 - 9
examples/js/loaders/VTKLoader.js

@@ -11,11 +11,13 @@
 
 THREE.VTKLoader = function ( manager ) {
 
-	this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
+	THREE.Loader.call( this, manager );
 
 };
 
-Object.assign( THREE.VTKLoader.prototype, THREE.EventDispatcher.prototype, {
+THREE.VTKLoader.prototype = Object.assign( Object.create( THREE.Loader.prototype ), {
+
+	constructor: THREE.VTKLoader,
 
 	load: function ( url, onLoad, onProgress, onError ) {
 
@@ -32,13 +34,6 @@ Object.assign( THREE.VTKLoader.prototype, THREE.EventDispatcher.prototype, {
 
 	},
 
-	setPath: function ( value ) {
-
-		this.path = value;
-		return this;
-
-	},
-
 	parse: function ( data ) {
 
 		function parseASCII( data ) {

+ 4 - 11
examples/jsm/loaders/MD2Loader.js

@@ -5,19 +5,19 @@
 import {
 	AnimationClip,
 	BufferGeometry,
-	DefaultLoadingManager,
 	FileLoader,
 	Float32BufferAttribute,
+	Loader,
 	Vector3
 } from "../../../build/three.module.js";
 
 var MD2Loader = function ( manager ) {
 
-	this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
+	Loader.call( this, manager );
 
 };
 
-MD2Loader.prototype = {
+MD2Loader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 	constructor: MD2Loader,
 
@@ -36,13 +36,6 @@ MD2Loader.prototype = {
 
 	},
 
-	setPath: function ( value ) {
-
-		this.path = value;
-		return this;
-
-	},
-
 	parse: ( function () {
 
 		var normalData = [
@@ -393,6 +386,6 @@ MD2Loader.prototype = {
 
 	} )()
 
-};
+} );
 
 export { MD2Loader };

+ 4 - 12
examples/jsm/loaders/OBJLoader.js

@@ -4,12 +4,12 @@
 
 import {
 	BufferGeometry,
-	DefaultLoadingManager,
 	FileLoader,
 	Float32BufferAttribute,
 	Group,
 	LineBasicMaterial,
 	LineSegments,
+	Loader,
 	Material,
 	Mesh,
 	MeshPhongMaterial,
@@ -381,13 +381,13 @@ var OBJLoader = ( function () {
 
 	function OBJLoader( manager ) {
 
-		this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
+		Loader.call( this, manager );
 
 		this.materials = null;
 
 	}
 
-	OBJLoader.prototype = {
+	OBJLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 		constructor: OBJLoader,
 
@@ -405,14 +405,6 @@ var OBJLoader = ( function () {
 
 		},
 
-		setPath: function ( value ) {
-
-			this.path = value;
-
-			return this;
-
-		},
-
 		setMaterials: function ( materials ) {
 
 			this.materials = materials;
@@ -807,7 +799,7 @@ var OBJLoader = ( function () {
 
 		}
 
-	};
+	} );
 
 	return OBJLoader;
 

+ 5 - 11
examples/jsm/loaders/PCDLoader.js

@@ -10,9 +10,9 @@
 
 import {
 	BufferGeometry,
-	DefaultLoadingManager,
 	FileLoader,
 	Float32BufferAttribute,
+	Loader,
 	LoaderUtils,
 	Points,
 	PointsMaterial,
@@ -21,13 +21,14 @@ import {
 
 var PCDLoader = function ( manager ) {
 
-	this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
+	Loader.call( this, manager );
+
 	this.littleEndian = true;
 
 };
 
 
-PCDLoader.prototype = {
+PCDLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 	constructor: PCDLoader,
 
@@ -62,13 +63,6 @@ PCDLoader.prototype = {
 
 	},
 
-	setPath: function ( value ) {
-
-		this.path = value;
-		return this;
-
-	},
-
 	parse: function ( data, url ) {
 
 		function parseHeader( data ) {
@@ -316,6 +310,6 @@ PCDLoader.prototype = {
 
 	}
 
-};
+} );
 
 export { PCDLoader };

+ 5 - 12
examples/jsm/loaders/PDBLoader.js

@@ -5,18 +5,18 @@
 
 import {
 	BufferGeometry,
-	DefaultLoadingManager,
 	FileLoader,
-	Float32BufferAttribute
+	Float32BufferAttribute,
+	Loader
 } from "../../../build/three.module.js";
 
 var PDBLoader = function ( manager ) {
 
-	this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
+	Loader.call( this, manager );
 
 };
 
-PDBLoader.prototype = {
+PDBLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 	constructor: PDBLoader,
 
@@ -34,13 +34,6 @@ PDBLoader.prototype = {
 
 	},
 
-	setPath: function ( value ) {
-
-		this.path = value;
-		return this;
-
-	},
-
 	// Based on CanvasMol PDB parser
 
 	parse: function ( text ) {
@@ -221,6 +214,6 @@ PDBLoader.prototype = {
 
 	}
 
-};
+} );
 
 export { PDBLoader };

+ 5 - 12
examples/jsm/loaders/PRWMLoader.js

@@ -6,8 +6,8 @@
 import {
 	BufferAttribute,
 	BufferGeometry,
-	DefaultLoadingManager,
-	FileLoader
+	FileLoader,
+	Loader
 } from "../../../build/three.module.js";
 
 var PRWMLoader = ( function () {
@@ -231,11 +231,11 @@ var PRWMLoader = ( function () {
 
 	function PRWMLoader( manager ) {
 
-		this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
+		Loader.call( this, manager );
 
 	}
 
-	PRWMLoader.prototype = {
+	PRWMLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 		constructor: PRWMLoader,
 
@@ -257,13 +257,6 @@ var PRWMLoader = ( function () {
 
 		},
 
-		setPath: function ( value ) {
-
-			this.path = value;
-			return this;
-
-		},
-
 		parse: function ( arrayBuffer ) {
 
 			var data = decodePrwm( arrayBuffer ),
@@ -289,7 +282,7 @@ var PRWMLoader = ( function () {
 
 		}
 
-	};
+	} );
 
 	PRWMLoader.isBigEndianPlatform = function () {
 

+ 4 - 11
examples/jsm/loaders/SVGLoader.js

@@ -7,9 +7,9 @@
 import {
 	BufferGeometry,
 	Color,
-	DefaultLoadingManager,
 	FileLoader,
 	Float32BufferAttribute,
+	Loader,
 	Matrix3,
 	Path,
 	ShapePath,
@@ -19,11 +19,11 @@ import {
 
 var SVGLoader = function ( manager ) {
 
-	this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
+	Loader.call( this, manager );
 
 };
 
-SVGLoader.prototype = {
+SVGLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 	constructor: SVGLoader,
 
@@ -41,13 +41,6 @@ SVGLoader.prototype = {
 
 	},
 
-	setPath: function ( value ) {
-
-		this.path = value;
-		return this;
-
-	},
-
 	parse: function ( text ) {
 
 		function parseNode( node, style ) {
@@ -1185,7 +1178,7 @@ SVGLoader.prototype = {
 
 	}
 
-};
+} );
 
 SVGLoader.getStrokeStyle = function ( width, color, lineJoin, lineCap, miterLimit ) {
 

+ 1 - 1
examples/jsm/loaders/TDSLoader.js

@@ -56,7 +56,7 @@ TDSLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 		var scope = this;
 
-		var path = this.path !== undefined ? this.path : LoaderUtils.extractUrlBase( url );
+		var path = ( scope.path === '' ) ? LoaderUtils.extractUrlBase( url ) : scope.path;
 
 		var loader = new FileLoader( this.manager );
 		loader.setPath( this.path );

+ 5 - 11
examples/jsm/loaders/VTKLoader.js

@@ -12,21 +12,22 @@
 import {
 	BufferAttribute,
 	BufferGeometry,
-	DefaultLoadingManager,
-	EventDispatcher,
 	FileLoader,
 	Float32BufferAttribute,
+	Loader,
 	LoaderUtils
 } from "../../../build/three.module.js";
 import { Zlib } from "../libs/inflate.module.min.js";
 
 var VTKLoader = function ( manager ) {
 
-	this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
+	Loader.call( this, manager );
 
 };
 
-Object.assign( VTKLoader.prototype, EventDispatcher.prototype, {
+VTKLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
+
+	constructor: VTKLoader,
 
 	load: function ( url, onLoad, onProgress, onError ) {
 
@@ -43,13 +44,6 @@ Object.assign( VTKLoader.prototype, EventDispatcher.prototype, {
 
 	},
 
-	setPath: function ( value ) {
-
-		this.path = value;
-		return this;
-
-	},
-
 	parse: function ( data ) {
 
 		function parseASCII( data ) {