mirror of
https://github.com/photonstorm/phaser
synced 2024-11-25 22:20:44 +00:00
Transform based on z value
This commit is contained in:
parent
55d7b36217
commit
f6a0a8d96b
1 changed files with 4 additions and 2 deletions
|
@ -116,7 +116,7 @@ var Mesh = new Class({
|
||||||
* @type {Phaser.GameObjects.MeshCamera}
|
* @type {Phaser.GameObjects.MeshCamera}
|
||||||
* @since 3.50.0
|
* @since 3.50.0
|
||||||
*/
|
*/
|
||||||
this.camera = new MeshCamera(45, 0, 0, -10, 0.001, 1000);
|
this.camera = new MeshCamera(45, 0, 0, 0, 0.001, 1000);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Animation State of this Mesh.
|
* The Animation State of this Mesh.
|
||||||
|
@ -1145,11 +1145,13 @@ var Mesh = new Class({
|
||||||
normalMatrix.invert();
|
normalMatrix.invert();
|
||||||
normalMatrix.transpose();
|
normalMatrix.transpose();
|
||||||
|
|
||||||
|
var z = camera.position.z;
|
||||||
|
|
||||||
var vertices = this.vertices;
|
var vertices = this.vertices;
|
||||||
|
|
||||||
for (var i = 0; i < vertices.length; i++)
|
for (var i = 0; i < vertices.length; i++)
|
||||||
{
|
{
|
||||||
vertices[i].transformCoordinatesLocal(transformMatrix, width, height);
|
vertices[i].transformCoordinatesLocal(transformMatrix, width, height, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.depthSort();
|
this.depthSort();
|
||||||
|
|
Loading…
Reference in a new issue