You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -21,68 +22,117 @@ var ParseObj = require('../../geom/mesh/ParseObj');
21
22
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#obj.
22
23
*
23
24
* @class OBJFile
24
-
* @extends Phaser.Loader.File
25
+
* @extends Phaser.Loader.MultiFile
25
26
* @memberof Phaser.Loader.FileTypes
26
27
* @constructor
27
28
* @since 3.50.0
28
29
*
29
30
* @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.
30
31
* @param {(string|Phaser.Types.Loader.FileTypes.OBJFileConfig)} key - The key to use for this file, or a file configuration object.
31
-
* @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `<key>.obj`, i.e. if `key` was "alien" then the URL will be "alien.obj".
32
+
* @param {string} [objURL] - The absolute or relative URL to load the obj file from. If undefined or `null` it will be set to `<key>.obj`, i.e. if `key` was "alien" then the URL will be "alien.obj".
33
+
* @param {string} [matURL] - The absolute or relative URL to load the material file from. If undefined or `null` it will be set to `<key>.mat`, i.e. if `key` was "alien" then the URL will be "alien.mat".
32
34
* @param {boolean} [flipUV] - Flip the UV coordinates stored in the model data?
33
-
* @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.
35
+
* @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for these files.
* If given, the material will be parsed and stored along with the obj data in the cache.
164
+
*
104
165
* The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,
105
166
* or if it's already running, when the next free load slot becomes available. This happens automatically if you
106
167
* are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued
@@ -120,6 +181,7 @@ var OBJFile = new Class({
120
181
* this.load.obj({
121
182
* key: 'ufo',
122
183
* url: 'files/spaceship.obj',
184
+
* matURL: 'files/spaceship.mtl',
123
185
* flipUV: true
124
186
* });
125
187
* ```
@@ -152,25 +214,32 @@ var OBJFile = new Class({
152
214
* @since 3.50.0
153
215
*
154
216
* @param {(string|Phaser.Types.Loader.FileTypes.OBJFileConfig|Phaser.Types.Loader.FileTypes.OBJFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
155
-
* @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `<key>.obj`, i.e. if `key` was "alien" then the URL will be "alien.obj".
217
+
* @param {string} [objURL] - The absolute or relative URL to load the obj file from. If undefined or `null` it will be set to `<key>.obj`, i.e. if `key` was "alien" then the URL will be "alien.obj".
218
+
* @param {string} [matURL] - Optional absolute or relative URL to load the obj material file from.
156
219
* @param {boolean} [flipUV] - Flip the UV coordinates stored in the model data?
157
220
* @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.
Copy file name to clipboardExpand all lines: src/loader/filetypes/typedefs/OBJFileConfig.js
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -5,5 +5,7 @@
5
5
* @property {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `<key>.obj`, i.e. if `key` was "alien" then the URL will be "alien.obj".
6
6
* @property {string} [extension='obj'] - The default file extension to use if no url is provided.
7
7
* @property {boolean} [flipUV] - Flip the UV coordinates stored in the model data?
8
+
* @property {string} [matURL] - An optional absolute or relative URL to the object material file from. If undefined or `null`, no material file will be loaded.
9
+
* @property {string} [matExtension='mat'] - The default material file extension to use if no url is provided.
8
10
* @property {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.
0 commit comments