Skip to content

Commit c85497b

Browse files
committed
Fixing jsdocs
1 parent ccaae46 commit c85497b

4 files changed

Lines changed: 177 additions & 4 deletions

File tree

src/renderer/webgl/pipelines/components/ModelViewProjection.js

Lines changed: 160 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,46 +4,74 @@
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
55
*/
66

7-
87
/**
98
* Implements a model view projection matrices.
109
* Pipelines can implement this for doing 2D and 3D rendering.
10+
*
11+
* @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection
12+
* @since 3.0.0
1113
*/
12-
1314
var ModelViewProjection = {
1415

1516
/**
1617
* Dirty flag for checking if model matrix needs to be updated on GPU.
18+
*
19+
* @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelMatrixDirty
20+
* @type {boolean}
21+
* @since 3.0.0
1722
*/
1823
modelMatrixDirty: false,
1924

2025
/**
2126
* Dirty flag for checking if view matrix needs to be updated on GPU.
27+
*
28+
* @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewMatrixDirty
29+
* @type {boolean}
30+
* @since 3.0.0
2231
*/
2332
viewMatrixDirty: false,
2433

2534
/**
2635
* Dirty flag for checking if projection matrix needs to be updated on GPU.
36+
*
37+
* @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projectionMatrixDirty
38+
* @type {boolean}
39+
* @since 3.0.0
2740
*/
2841
projectionMatrixDirty: false,
2942

3043
/**
3144
* Model matrix
45+
*
46+
* @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelMatrix
47+
* @type {?Float32Array}
48+
* @since 3.0.0
3249
*/
3350
modelMatrix: null,
3451

3552
/**
3653
* View matrix
54+
*
55+
* @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewMatrix
56+
* @type {?Float32Array}
57+
* @since 3.0.0
3758
*/
3859
viewMatrix: null,
3960

4061
/**
4162
* Projection matrix
63+
*
64+
* @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projectionMatrix
65+
* @type {?Float32Array}
66+
* @since 3.0.0
4267
*/
4368
projectionMatrix: null,
4469

4570
/**
4671
* Initializes MVP matrices with an identity matrix
72+
*
73+
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#mvpInit
74+
* @since 3.0.0
4775
*/
4876
mvpInit: function ()
4977
{
@@ -77,6 +105,9 @@ var ModelViewProjection = {
77105

78106
/**
79107
* If dirty flags are set then the matrices are uploaded to the GPU.
108+
*
109+
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#mvpUpdate
110+
* @since 3.0.0
80111
*/
81112
mvpUpdate: function ()
82113
{
@@ -105,6 +136,9 @@ var ModelViewProjection = {
105136

106137
/**
107138
* Loads an identity matrix to the model matrix
139+
*
140+
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelIdentity
141+
* @since 3.0.0
108142
*/
109143
modelIdentity: function ()
110144
{
@@ -134,6 +168,15 @@ var ModelViewProjection = {
134168

135169
/**
136170
* Scale model matrix
171+
*
172+
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelScale
173+
* @since 3.0.0
174+
*
175+
* @param {number} x - The x component.
176+
* @param {number} y - The y component.
177+
* @param {number} z - The z component.
178+
*
179+
* @return {this} This Model View Projection.
137180
*/
138181
modelScale: function (x, y, z)
139182
{
@@ -159,6 +202,15 @@ var ModelViewProjection = {
159202

160203
/**
161204
* Translate model matrix
205+
*
206+
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelTranslate
207+
* @since 3.0.0
208+
*
209+
* @param {number} x - The x component.
210+
* @param {number} y - The y component.
211+
* @param {number} z - The z component.
212+
*
213+
* @return {this} This Model View Projection.
162214
*/
163215
modelTranslate: function (x, y, z)
164216
{
@@ -174,9 +226,15 @@ var ModelViewProjection = {
174226
return this;
175227
},
176228

177-
178229
/**
179230
* Rotates the model matrix in the X axis.
231+
*
232+
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelRotateX
233+
* @since 3.0.0
234+
*
235+
* @param {number} radians - The amount to rotate by.
236+
*
237+
* @return {this} This Model View Projection.
180238
*/
181239
modelRotateX: function (radians)
182240
{
@@ -208,6 +266,13 @@ var ModelViewProjection = {
208266

209267
/**
210268
* Rotates the model matrix in the Y axis.
269+
*
270+
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelRotateY
271+
* @since 3.0.0
272+
*
273+
* @param {number} radians - The amount to rotate by.
274+
*
275+
* @return {this} This Model View Projection.
211276
*/
212277
modelRotateY: function (radians)
213278
{
@@ -239,6 +304,13 @@ var ModelViewProjection = {
239304

240305
/**
241306
* Rotates the model matrix in the Z axis.
307+
*
308+
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelRotateZ
309+
* @since 3.0.0
310+
*
311+
* @param {number} radians - The amount to rotate by.
312+
*
313+
* @return {this} This Model View Projection.
242314
*/
243315
modelRotateZ: function (radians)
244316
{
@@ -270,6 +342,11 @@ var ModelViewProjection = {
270342

271343
/**
272344
* Loads identity matrix into the view matrix
345+
*
346+
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewIdentity
347+
* @since 3.0.0
348+
*
349+
* @return {this} This Model View Projection.
273350
*/
274351
viewIdentity: function ()
275352
{
@@ -299,6 +376,15 @@ var ModelViewProjection = {
299376

300377
/**
301378
* Scales view matrix
379+
*
380+
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewScale
381+
* @since 3.0.0
382+
*
383+
* @param {number} x - The x component.
384+
* @param {number} y - The y component.
385+
* @param {number} z - The z component.
386+
*
387+
* @return {this} This Model View Projection.
302388
*/
303389
viewScale: function (x, y, z)
304390
{
@@ -324,6 +410,15 @@ var ModelViewProjection = {
324410

325411
/**
326412
* Translates view matrix
413+
*
414+
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewTranslate
415+
* @since 3.0.0
416+
*
417+
* @param {number} x - The x component.
418+
* @param {number} y - The y component.
419+
* @param {number} z - The z component.
420+
*
421+
* @return {this} This Model View Projection.
327422
*/
328423
viewTranslate: function (x, y, z)
329424
{
@@ -341,6 +436,13 @@ var ModelViewProjection = {
341436

342437
/**
343438
* Rotates view matrix in the X axis.
439+
*
440+
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewRotateX
441+
* @since 3.0.0
442+
*
443+
* @param {number} radians - The amount to rotate by.
444+
*
445+
* @return {this} This Model View Projection.
344446
*/
345447
viewRotateX: function (radians)
346448
{
@@ -372,6 +474,13 @@ var ModelViewProjection = {
372474

373475
/**
374476
* Rotates view matrix in the Y axis.
477+
*
478+
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewRotateY
479+
* @since 3.0.0
480+
*
481+
* @param {number} radians - The amount to rotate by.
482+
*
483+
* @return {this} This Model View Projection.
375484
*/
376485
viewRotateY: function (radians)
377486
{
@@ -403,6 +512,13 @@ var ModelViewProjection = {
403512

404513
/**
405514
* Rotates view matrix in the Z axis.
515+
*
516+
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewRotateZ
517+
* @since 3.0.0
518+
*
519+
* @param {number} radians - The amount to rotate by.
520+
*
521+
* @return {this} This Model View Projection.
406522
*/
407523
viewRotateZ: function (radians)
408524
{
@@ -434,6 +550,13 @@ var ModelViewProjection = {
434550

435551
/**
436552
* Loads a 2D view matrix (3x2 matrix) into a 4x4 view matrix
553+
*
554+
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewLoad2D
555+
* @since 3.0.0
556+
*
557+
* @param {Float32Array} matrix2D - The Matrix2D.
558+
*
559+
* @return {this} This Model View Projection.
437560
*/
438561
viewLoad2D: function (matrix2D)
439562
{
@@ -464,6 +587,13 @@ var ModelViewProjection = {
464587

465588
/**
466589
* Copies a 4x4 matrix into the view matrix
590+
*
591+
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewLoad
592+
* @since 3.0.0
593+
*
594+
* @param {Float32Array} matrix - The Matrix2D.
595+
*
596+
* @return {this} This Model View Projection.
467597
*/
468598
viewLoad: function (matrix)
469599
{
@@ -493,6 +623,11 @@ var ModelViewProjection = {
493623

494624
/**
495625
* Loads identity matrix into the projection matrix.
626+
*
627+
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projIdentity
628+
* @since 3.0.0
629+
*
630+
* @return {this} This Model View Projection.
496631
*/
497632
projIdentity: function ()
498633
{
@@ -522,6 +657,18 @@ var ModelViewProjection = {
522657

523658
/**
524659
* Sets up an orthographics projection matrix
660+
*
661+
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projOrtho
662+
* @since 3.0.0
663+
*
664+
* @param {number} left - The left value.
665+
* @param {number} right - The right value.
666+
* @param {number} bottom - The bottom value.
667+
* @param {number} top - The top value.
668+
* @param {number} near - The near value.
669+
* @param {number} far - The far value.
670+
*
671+
* @return {this} This Model View Projection.
525672
*/
526673
projOrtho: function (left, right, bottom, top, near, far)
527674
{
@@ -553,6 +700,16 @@ var ModelViewProjection = {
553700

554701
/**
555702
* Sets up a perspective projection matrix
703+
*
704+
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projPersp
705+
* @since 3.0.0
706+
*
707+
* @param {number} fovy - The fovy value.
708+
* @param {number} aspectRatio - The aspectRatio value.
709+
* @param {number} near - The near value.
710+
* @param {number} far - The far value.
711+
*
712+
* @return {this} This Model View Projection.
556713
*/
557714
projPersp: function (fovy, aspectRatio, near, far)
558715
{

src/renderer/webgl/pipelines/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module.exports = {
1212

1313
BitmapMaskPipeline: require('./BitmapMaskPipeline'),
1414
ForwardDiffuseLightPipeline: require('./ForwardDiffuseLightPipeline'),
15-
TextureTintPipeline: require('./TextureTintPipeline')
15+
TextureTintPipeline: require('./TextureTintPipeline'),
16+
ModelViewProjection: require('./components/ModelViewProjection')
1617

1718
};

src/tweens/builders/GetValueOp.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,25 @@
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
55
*/
66

7+
/**
8+
* @ignore
9+
*/
710
function hasGetStart (def)
811
{
912
return (!!def.getStart && typeof def.getStart === 'function');
1013
}
1114

15+
/**
16+
* @ignore
17+
*/
1218
function hasGetEnd (def)
1319
{
1420
return (!!def.getEnd && typeof def.getEnd === 'function');
1521
}
1622

23+
/**
24+
* @ignore
25+
*/
1726
function hasGetters (def)
1827
{
1928
return hasGetStart(def) || hasGetEnd(def);

src/utils/array/QuickSelect.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
55
*/
66

7+
/**
8+
* @ignore
9+
*/
710
function swap (arr, i, j)
811
{
912
var tmp = arr[i];
1013
arr[i] = arr[j];
1114
arr[j] = tmp;
1215
}
1316

17+
/**
18+
* @ignore
19+
*/
1420
function defaultCompare (a, b)
1521
{
1622
return a < b ? -1 : a > b ? 1 : 0;

0 commit comments

Comments
 (0)