mirror of
https://github.com/photonstorm/phaser
synced 2024-11-26 14:40:38 +00:00
GameObject.Vertex
is a new micro class that encapsulates all of the data required for a single vertex, such as position, uv, color and alpha. This class is now created internally by the Mesh Game Object.
This commit is contained in:
parent
3fa0070e50
commit
8fc969088c
1 changed files with 91 additions and 0 deletions
91
src/gameobjects/mesh/Vertex.js
Normal file
91
src/gameobjects/mesh/Vertex.js
Normal file
|
@ -0,0 +1,91 @@
|
|||
/**
|
||||
* @author Richard Davey <rich@photonstorm.com>
|
||||
* @copyright 2020 Photon Storm Ltd.
|
||||
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
||||
*/
|
||||
|
||||
var Class = require('../../utils/Class');
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* A Vertex Game Object.
|
||||
*
|
||||
* This tiny class consists of all the information for a single vertex within a Mesh
|
||||
* Game Object.
|
||||
*
|
||||
* @class Vertex
|
||||
* @memberof Phaser.GameObjects
|
||||
* @constructor
|
||||
* @since 3.50.0
|
||||
*
|
||||
* @param {number} x - The x coordinate of this vertex.
|
||||
* @param {number} y - The y coordinate of this vertex.
|
||||
* @param {number} u - The UV u coordinate of this vertex.
|
||||
* @param {number} v - The UV v coordinate of this vertex.
|
||||
* @param {number} color - The color value of this vertex.
|
||||
* @param {number} alpha - The alpha value of this vertex.
|
||||
*/
|
||||
var Vertex = new Class({
|
||||
|
||||
initialize:
|
||||
|
||||
function Vertex (x, y, u, v, color, alpha)
|
||||
{
|
||||
/**
|
||||
* The x coordinate of this vertex.
|
||||
*
|
||||
* @name Phaser.GameObjects.Vertex#x
|
||||
* @type {number}
|
||||
* @since 3.50.0
|
||||
*/
|
||||
this.x = x;
|
||||
|
||||
/**
|
||||
* The y coordinate of this vertex.
|
||||
*
|
||||
* @name Phaser.GameObjects.Vertex#y
|
||||
* @type {number}
|
||||
* @since 3.50.0
|
||||
*/
|
||||
this.y = y;
|
||||
|
||||
/**
|
||||
* UV u coordinate of this vertex.
|
||||
*
|
||||
* @name Phaser.GameObjects.Vertex#u
|
||||
* @type {number}
|
||||
* @since 3.50.0
|
||||
*/
|
||||
this.u = u;
|
||||
|
||||
/**
|
||||
* UV v coordinate of this vertex.
|
||||
*
|
||||
* @name Phaser.GameObjects.Vertex#v
|
||||
* @type {number}
|
||||
* @since 3.50.0
|
||||
*/
|
||||
this.v = v;
|
||||
|
||||
/**
|
||||
* The color value of this vertex.
|
||||
*
|
||||
* @name Phaser.GameObjects.Vertex#color
|
||||
* @type {number}
|
||||
* @since 3.50.0
|
||||
*/
|
||||
this.color = color;
|
||||
|
||||
/**
|
||||
* The alpha value of this vertex.
|
||||
*
|
||||
* @name Phaser.GameObjects.Vertex#alpha
|
||||
* @type {number}
|
||||
* @since 3.50.0
|
||||
*/
|
||||
this.alpha = alpha;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
module.exports = Vertex;
|
Loading…
Reference in a new issue