Skip to content

Commit 2137e34

Browse files
committed
Added cameraZ parameter
1 parent c6d25c9 commit 2137e34

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/geom/mesh/Vertex.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,9 @@ var Vertex = new Class({
116116
* @param {Phaser.Math.Matrix4} transformMatrix - The transform matrix to apply to this vertex.
117117
* @param {number} width - The width of the parent Mesh.
118118
* @param {number} height - The height of the parent Mesh.
119+
* @param {number} cameraZ - The z position of the MeshCamera.
119120
*/
120-
transformCoordinatesLocal: function (transformMatrix, width, height)
121+
transformCoordinatesLocal: function (transformMatrix, width, height, cameraZ)
121122
{
122123
var x = this.x;
123124
var y = this.y;
@@ -132,7 +133,15 @@ var Vertex = new Class({
132133

133134
this.vx = (tx / tw) * width;
134135
this.vy = -(ty / tw) * height;
135-
this.vz = (tz / tw);
136+
137+
if (cameraZ <= 0)
138+
{
139+
this.vz = (tz / tw);
140+
}
141+
else
142+
{
143+
this.vz = -(tz / tw);
144+
}
136145
},
137146

138147
/**

0 commit comments

Comments
 (0)