Skip to content

Commit 257f66c

Browse files
authored
Merge pull request mrdoob#17326 from Mugen87/dev29
BufferGeometryLoader: Inherit from Loader.
2 parents ba9ec37 + 2ea1004 commit 257f66c

File tree

5 files changed

+17
-33
lines changed

5 files changed

+17
-33
lines changed

docs/api/en/loaders/BufferGeometryLoader.html

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
<link type="text/css" rel="stylesheet" href="page.css" />
99
</head>
1010
<body>
11+
[page:Loader] &rarr;
12+
1113
<h1>[name]</h1>
1214

1315
<p class="desc">
@@ -57,15 +59,11 @@ <h3>[name]( [param:LoadingManager manager] )</h3>
5759
Creates a new [name].
5860
</p>
5961

60-
6162
<h2>Properties</h2>
62-
63-
<h3>[property:LoadingManager manager]</h3>
64-
<p>
65-
The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager].
66-
</p>
63+
<p>See the base [page:Loader] class for common properties.</p>
6764

6865
<h2>Methods</h2>
66+
<p>See the base [page:Loader] class for common methods.</p>
6967

7068
<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
7169
<p>
@@ -85,14 +83,6 @@ <h3>[method:BufferGeometry parse]( [param:Object json] )</h3>
8583
Parse a <em>JSON</em> structure and return a [page:BufferGeometry].
8684
</p>
8785

88-
<h3>[method:BufferGeometryLoader setPath]( [param:String path] )</h3>
89-
<p>
90-
[page:String path] — Base path of the file to load.<br /><br />
91-
92-
Sets the base path or URL from which to load files. This can be useful if
93-
you are loading many geometries from the same directory.
94-
</p>
95-
9686
<h2>Source</h2>
9787

9888
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

docs/api/zh/loaders/BufferGeometryLoader.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
<link type="text/css" rel="stylesheet" href="page.css" />
99
</head>
1010
<body>
11+
[page:Loader] &rarr;
12+
1113
<h1>[name]</h1>
1214

1315
<p class="desc">
@@ -57,15 +59,11 @@ <h3>[name]( [param:LoadingManager manager] )</h3>
5759
创建一个新的[name].
5860
</p>
5961

60-
6162
<h2>属性</h2>
62-
63-
<h3>[property:LoadingManager manager]</h3>
64-
<p>
65-
正在使用的[page:LoadingManager loadingManager]。默认为[page:DefaultLoadingManager].
66-
</p>
63+
<p>See the base [page:Loader] class for common properties.</p>
6764

6865
<h2>方法</h2>
66+
<p>See the base [page:Loader] class for common methods.</p>
6967

7068
<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
7169
<p>

src/loaders/AnimationLoader.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ function AnimationLoader( manager ) {
1414

1515
AnimationLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
1616

17+
constructor: AnimationLoader,
18+
1719
load: function ( url, onLoad, onProgress, onError ) {
1820

1921
var scope = this;

src/loaders/BufferGeometryLoader.d.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1+
import { Loader } from './Loader';
12
import { LoadingManager } from './LoadingManager';
23
import { BufferGeometry } from './../core/BufferGeometry';
34

4-
export class BufferGeometryLoader {
5+
export class BufferGeometryLoader extends Loader {
56

67
constructor( manager?: LoadingManager );
78

8-
manager: LoadingManager;
9-
109
load(
1110
url: string,
1211
onLoad: ( bufferGeometry: BufferGeometry ) => void,

src/loaders/BufferGeometryLoader.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Vector3 } from '../math/Vector3.js';
33
import { BufferAttribute } from '../core/BufferAttribute.js';
44
import { BufferGeometry } from '../core/BufferGeometry.js';
55
import { FileLoader } from './FileLoader.js';
6-
import { DefaultLoadingManager } from './LoadingManager.js';
6+
import { Loader } from './Loader.js';
77
import { InstancedBufferGeometry } from '../core/InstancedBufferGeometry.js';
88
import { InstancedBufferAttribute } from '../core/InstancedBufferAttribute.js';
99

@@ -13,11 +13,13 @@ import { InstancedBufferAttribute } from '../core/InstancedBufferAttribute.js';
1313

1414
function BufferGeometryLoader( manager ) {
1515

16-
this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
16+
Loader.call( this, manager );
1717

1818
}
1919

20-
Object.assign( BufferGeometryLoader.prototype, {
20+
BufferGeometryLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
21+
22+
constructor: BufferGeometryLoader,
2123

2224
load: function ( url, onLoad, onProgress, onError ) {
2325

@@ -121,13 +123,6 @@ Object.assign( BufferGeometryLoader.prototype, {
121123

122124
return geometry;
123125

124-
},
125-
126-
setPath: function ( value ) {
127-
128-
this.path = value;
129-
return this;
130-
131126
}
132127

133128
} );

0 commit comments

Comments
 (0)