Fixing jsdocs

This commit is contained in:
Richard Davey 2019-02-12 11:59:31 +00:00
parent ccaae460a4
commit c85497b6c5
4 changed files with 177 additions and 4 deletions

View file

@ -4,46 +4,74 @@
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* Implements a model view projection matrices.
* Pipelines can implement this for doing 2D and 3D rendering.
*
* @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection
* @since 3.0.0
*/
var ModelViewProjection = {
/**
* Dirty flag for checking if model matrix needs to be updated on GPU.
*
* @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelMatrixDirty
* @type {boolean}
* @since 3.0.0
*/
modelMatrixDirty: false,
/**
* Dirty flag for checking if view matrix needs to be updated on GPU.
*
* @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewMatrixDirty
* @type {boolean}
* @since 3.0.0
*/
viewMatrixDirty: false,
/**
* Dirty flag for checking if projection matrix needs to be updated on GPU.
*
* @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projectionMatrixDirty
* @type {boolean}
* @since 3.0.0
*/
projectionMatrixDirty: false,
/**
* Model matrix
*
* @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelMatrix
* @type {?Float32Array}
* @since 3.0.0
*/
modelMatrix: null,
/**
* View matrix
*
* @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewMatrix
* @type {?Float32Array}
* @since 3.0.0
*/
viewMatrix: null,
/**
* Projection matrix
*
* @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projectionMatrix
* @type {?Float32Array}
* @since 3.0.0
*/
projectionMatrix: null,
/**
* Initializes MVP matrices with an identity matrix
*
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#mvpInit
* @since 3.0.0
*/
mvpInit: function ()
{
@ -77,6 +105,9 @@ var ModelViewProjection = {
/**
* If dirty flags are set then the matrices are uploaded to the GPU.
*
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#mvpUpdate
* @since 3.0.0
*/
mvpUpdate: function ()
{
@ -105,6 +136,9 @@ var ModelViewProjection = {
/**
* Loads an identity matrix to the model matrix
*
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelIdentity
* @since 3.0.0
*/
modelIdentity: function ()
{
@ -134,6 +168,15 @@ var ModelViewProjection = {
/**
* Scale model matrix
*
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelScale
* @since 3.0.0
*
* @param {number} x - The x component.
* @param {number} y - The y component.
* @param {number} z - The z component.
*
* @return {this} This Model View Projection.
*/
modelScale: function (x, y, z)
{
@ -159,6 +202,15 @@ var ModelViewProjection = {
/**
* Translate model matrix
*
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelTranslate
* @since 3.0.0
*
* @param {number} x - The x component.
* @param {number} y - The y component.
* @param {number} z - The z component.
*
* @return {this} This Model View Projection.
*/
modelTranslate: function (x, y, z)
{
@ -174,9 +226,15 @@ var ModelViewProjection = {
return this;
},
/**
* Rotates the model matrix in the X axis.
*
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelRotateX
* @since 3.0.0
*
* @param {number} radians - The amount to rotate by.
*
* @return {this} This Model View Projection.
*/
modelRotateX: function (radians)
{
@ -208,6 +266,13 @@ var ModelViewProjection = {
/**
* Rotates the model matrix in the Y axis.
*
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelRotateY
* @since 3.0.0
*
* @param {number} radians - The amount to rotate by.
*
* @return {this} This Model View Projection.
*/
modelRotateY: function (radians)
{
@ -239,6 +304,13 @@ var ModelViewProjection = {
/**
* Rotates the model matrix in the Z axis.
*
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelRotateZ
* @since 3.0.0
*
* @param {number} radians - The amount to rotate by.
*
* @return {this} This Model View Projection.
*/
modelRotateZ: function (radians)
{
@ -270,6 +342,11 @@ var ModelViewProjection = {
/**
* Loads identity matrix into the view matrix
*
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewIdentity
* @since 3.0.0
*
* @return {this} This Model View Projection.
*/
viewIdentity: function ()
{
@ -299,6 +376,15 @@ var ModelViewProjection = {
/**
* Scales view matrix
*
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewScale
* @since 3.0.0
*
* @param {number} x - The x component.
* @param {number} y - The y component.
* @param {number} z - The z component.
*
* @return {this} This Model View Projection.
*/
viewScale: function (x, y, z)
{
@ -324,6 +410,15 @@ var ModelViewProjection = {
/**
* Translates view matrix
*
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewTranslate
* @since 3.0.0
*
* @param {number} x - The x component.
* @param {number} y - The y component.
* @param {number} z - The z component.
*
* @return {this} This Model View Projection.
*/
viewTranslate: function (x, y, z)
{
@ -341,6 +436,13 @@ var ModelViewProjection = {
/**
* Rotates view matrix in the X axis.
*
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewRotateX
* @since 3.0.0
*
* @param {number} radians - The amount to rotate by.
*
* @return {this} This Model View Projection.
*/
viewRotateX: function (radians)
{
@ -372,6 +474,13 @@ var ModelViewProjection = {
/**
* Rotates view matrix in the Y axis.
*
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewRotateY
* @since 3.0.0
*
* @param {number} radians - The amount to rotate by.
*
* @return {this} This Model View Projection.
*/
viewRotateY: function (radians)
{
@ -403,6 +512,13 @@ var ModelViewProjection = {
/**
* Rotates view matrix in the Z axis.
*
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewRotateZ
* @since 3.0.0
*
* @param {number} radians - The amount to rotate by.
*
* @return {this} This Model View Projection.
*/
viewRotateZ: function (radians)
{
@ -434,6 +550,13 @@ var ModelViewProjection = {
/**
* Loads a 2D view matrix (3x2 matrix) into a 4x4 view matrix
*
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewLoad2D
* @since 3.0.0
*
* @param {Float32Array} matrix2D - The Matrix2D.
*
* @return {this} This Model View Projection.
*/
viewLoad2D: function (matrix2D)
{
@ -464,6 +587,13 @@ var ModelViewProjection = {
/**
* Copies a 4x4 matrix into the view matrix
*
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewLoad
* @since 3.0.0
*
* @param {Float32Array} matrix - The Matrix2D.
*
* @return {this} This Model View Projection.
*/
viewLoad: function (matrix)
{
@ -493,6 +623,11 @@ var ModelViewProjection = {
/**
* Loads identity matrix into the projection matrix.
*
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projIdentity
* @since 3.0.0
*
* @return {this} This Model View Projection.
*/
projIdentity: function ()
{
@ -522,6 +657,18 @@ var ModelViewProjection = {
/**
* Sets up an orthographics projection matrix
*
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projOrtho
* @since 3.0.0
*
* @param {number} left - The left value.
* @param {number} right - The right value.
* @param {number} bottom - The bottom value.
* @param {number} top - The top value.
* @param {number} near - The near value.
* @param {number} far - The far value.
*
* @return {this} This Model View Projection.
*/
projOrtho: function (left, right, bottom, top, near, far)
{
@ -553,6 +700,16 @@ var ModelViewProjection = {
/**
* Sets up a perspective projection matrix
*
* @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projPersp
* @since 3.0.0
*
* @param {number} fovy - The fovy value.
* @param {number} aspectRatio - The aspectRatio value.
* @param {number} near - The near value.
* @param {number} far - The far value.
*
* @return {this} This Model View Projection.
*/
projPersp: function (fovy, aspectRatio, near, far)
{

View file

@ -12,6 +12,7 @@ module.exports = {
BitmapMaskPipeline: require('./BitmapMaskPipeline'),
ForwardDiffuseLightPipeline: require('./ForwardDiffuseLightPipeline'),
TextureTintPipeline: require('./TextureTintPipeline')
TextureTintPipeline: require('./TextureTintPipeline'),
ModelViewProjection: require('./components/ModelViewProjection')
};

View file

@ -4,16 +4,25 @@
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @ignore
*/
function hasGetStart (def)
{
return (!!def.getStart && typeof def.getStart === 'function');
}
/**
* @ignore
*/
function hasGetEnd (def)
{
return (!!def.getEnd && typeof def.getEnd === 'function');
}
/**
* @ignore
*/
function hasGetters (def)
{
return hasGetStart(def) || hasGetEnd(def);

View file

@ -4,6 +4,9 @@
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @ignore
*/
function swap (arr, i, j)
{
var tmp = arr[i];
@ -11,6 +14,9 @@ function swap (arr, i, j)
arr[j] = tmp;
}
/**
* @ignore
*/
function defaultCompare (a, b)
{
return a < b ? -1 : a > b ? 1 : 0;