Skip to content

Commit 4541215

Browse files
committed
Added JSDocs
1 parent cfcfabf commit 4541215

1 file changed

Lines changed: 35 additions & 3 deletions

File tree

src/gameobjects/mesh/Mesh.js

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ var Mesh = new Class({
158158
/**
159159
* When rendering, skip any Face that isn't counter clockwise?
160160
*
161+
* Enable this to hide backward-facing Faces during rendering.
162+
* Disable it to render all Faces.
163+
*
161164
* @name Phaser.GameObjects.Mesh#hideCCW
162165
* @type {boolean}
163166
* @since 3.50.0
@@ -213,7 +216,7 @@ var Mesh = new Class({
213216
},
214217

215218
/**
216-
* This method will add the model data from a loaded Wavefront OBJ file to this Mesh.
219+
* This method will add the model data from a loaded triangulated Wavefront OBJ file to this Mesh.
217220
*
218221
* The obj should have been loaded via the OBJFile:
219222
*
@@ -255,7 +258,7 @@ var Mesh = new Class({
255258
},
256259

257260
/**
258-
* This method will add parsed OBJ model data to this Mesh.
261+
* This method will add parsed triangulated OBJ model data to this Mesh.
259262
*
260263
* The obj should have been parsed in advance via the ParseObj function:
261264
*
@@ -512,7 +515,36 @@ var Mesh = new Class({
512515
},
513516

514517
/**
515-
* TODO
518+
* Adds new vertices to this Mesh by parsing the given arrays.
519+
*
520+
* The `vertices` parameter is a numeric array consisting of `x` and `y` pairs.
521+
* The `uvs` parameter is a numeric array consisting of `u` and `v` pairs.
522+
* The `indicies` parameter is an optional array that, if given, is an indexed list of vertices to be added.
523+
*
524+
* The following example will create a 256 x 256 sized quad using an index array:
525+
*
526+
* ```javascript
527+
* const vertices = [
528+
* -128, 128,
529+
* 128, 128,
530+
* -128, -128,
531+
* 128, -128
532+
* ];
533+
*
534+
* const uvs = [
535+
* 0, 1,
536+
* 1, 1,
537+
* 0, 0,
538+
* 1, 0
539+
* ];
540+
*
541+
* const indices = [ 0, 2, 1, 2, 3, 1 ];
542+
*
543+
* Mesh.addVertices(vertices, uvs, indicies);
544+
* ```
545+
*
546+
* Vertices must be provided as x/y pairs, there is no `z` component used in this call. For that, please see
547+
* `addModel` instead.
516548
*
517549
* @method Phaser.GameObjects.Mesh#addVertices
518550
* @since 3.50.0

0 commit comments

Comments
 (0)