Skip to content

Commit 6a3ce21

Browse files
committed
GameObject.Face is a new micro class that consists of references to the three Vertex instances that construct the single Face.
1 parent 8fc9690 commit 6a3ce21

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

src/gameobjects/mesh/Face.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2020 Photon Storm Ltd.
4+
* @license {@link https://opensource.org/licenses/MIT|MIT License}
5+
*/
6+
7+
var Class = require('../../utils/Class');
8+
9+
/**
10+
* @classdesc
11+
* A Face Game Object.
12+
*
13+
* This class consists of 3 Vertex instances, for the 3 corners of the face.
14+
*
15+
* @class Face
16+
* @memberof Phaser.GameObjects
17+
* @constructor
18+
* @since 3.50.0
19+
*
20+
* @param {Phaser.GameObjects.Vertex} vertex1 - The first vertex in this Face.
21+
* @param {Phaser.GameObjects.Vertex} vertex2 - The second vertex in this Face.
22+
* @param {Phaser.GameObjects.Vertex} vertex3 - The third vertex in this Face.
23+
*/
24+
var Face = new Class({
25+
26+
initialize:
27+
28+
function Face (vertex1, vertex2, vertex3)
29+
{
30+
/**
31+
* The first vertex in this Face.
32+
*
33+
* @name Phaser.GameObjects.Face#vertex1
34+
* @type {Phaser.GameObjects.Vertex}
35+
* @since 3.50.0
36+
*/
37+
this.vertex1 = vertex1;
38+
39+
/**
40+
* The second vertex in this Face.
41+
*
42+
* @name Phaser.GameObjects.Face#vertex2
43+
* @type {Phaser.GameObjects.Vertex}
44+
* @since 3.50.0
45+
*/
46+
this.vertex2 = vertex2;
47+
48+
/**
49+
* The third vertex in this Face.
50+
*
51+
* @name Phaser.GameObjects.Face#vertex3
52+
* @type {Phaser.GameObjects.Vertex}
53+
* @since 3.50.0
54+
*/
55+
this.vertex3 = vertex3;
56+
}
57+
58+
});
59+
60+
module.exports = Face;

0 commit comments

Comments
 (0)