@@ -98,11 +98,11 @@ function loading(p5, fn){
98
98
*
99
99
* @method loadModel
100
100
* @param {String|Request } path path of the model to be loaded.
101
+ * @param {String } [fileType] model’s file extension. Either `'.obj'` or `'.stl'`.
101
102
* @param {Boolean } normalize if `true`, scale the model to fit the canvas.
102
103
* @param {function(p5.Geometry) } [successCallback] function to call once the model is loaded. Will be passed
103
104
* the <a href="#/p5.Geometry">p5.Geometry</a> object.
104
105
* @param {function(Event) } [failureCallback] function to call if the model fails to load. Will be passed an `Error` event object.
105
- * @param {String } [fileType] model’s file extension. Either `'.obj'` or `'.stl'`.
106
106
* @return {Promise<p5.Geometry> } the <a href="#/p5.Geometry">p5.Geometry</a> object
107
107
*
108
108
* @example
@@ -168,8 +168,8 @@ function loading(p5, fn){
168
168
* let shape;
169
169
*
170
170
* // Load the file and create a p5.Geometry object.
171
- * function setup() {
172
- * loadModel('assets/teapot.obj', true, handleModel);
171
+ * async function setup() {
172
+ * await loadModel('assets/teapot.obj', true, handleModel);
173
173
*
174
174
* createCanvas(100, 100, WEBGL);
175
175
*
@@ -202,8 +202,8 @@ function loading(p5, fn){
202
202
* let shape;
203
203
*
204
204
* // Load the file and create a p5.Geometry object.
205
- * function setup() {
206
- * loadModel('assets/wrong .obj', true, handleModel, handleError);
205
+ * async function setup() {
206
+ * await loadModel('assets/teapot .obj', true, handleModel, handleError);
207
207
*
208
208
* createCanvas(100, 100, WEBGL);
209
209
*
@@ -241,8 +241,8 @@ function loading(p5, fn){
241
241
* let shape;
242
242
*
243
243
* // Load the file and create a p5.Geometry object.
244
- * function setup() {
245
- * loadModel('assets/teapot.obj', true, handleModel, handleError, '.obj' );
244
+ * async function setup() {
245
+ * await loadModel('assets/teapot.obj', '.obj', true, handleModel, handleError);
246
246
*
247
247
* createCanvas(100, 100, WEBGL);
248
248
*
@@ -279,15 +279,15 @@ function loading(p5, fn){
279
279
*
280
280
* let shape;
281
281
* let options = {
282
+ * fileType: '.obj',
282
283
* normalize: true,
283
284
* successCallback: handleModel,
284
- * failureCallback: handleError,
285
- * fileType: '.obj'
285
+ * failureCallback: handleError
286
286
* };
287
287
*
288
288
* // Load the file and create a p5.Geometry object.
289
- * function setup() {
290
- * loadModel('assets/teapot.obj', options);
289
+ * async function setup() {
290
+ * await loadModel('assets/teapot.obj', options);
291
291
*
292
292
* createCanvas(100, 100, WEBGL);
293
293
*
@@ -321,18 +321,18 @@ function loading(p5, fn){
321
321
/**
322
322
* @method loadModel
323
323
* @param {String|Request } path
324
+ * @param {String } [fileType]
324
325
* @param {function(p5.Geometry) } [successCallback]
325
326
* @param {function(Event) } [failureCallback]
326
- * @param {String } [fileType]
327
327
* @return {Promise<p5.Geometry> } new <a href="#/p5.Geometry">p5.Geometry</a> object.
328
328
*/
329
329
/**
330
330
* @method loadModel
331
331
* @param {String|Request } path
332
332
* @param {Object } [options] loading options.
333
+ * @param {String } [options.fileType]
333
334
* @param {function(p5.Geometry) } [options.successCallback]
334
335
* @param {function(Event) } [options.failureCallback]
335
- * @param {String } [options.fileType]
336
336
* @param {Boolean } [options.normalize]
337
337
* @param {Boolean } [options.flipU]
338
338
* @param {Boolean } [options.flipV]
0 commit comments