Added normals parameters

This commit is contained in:
Richard Davey 2020-10-08 13:24:01 +01:00
parent e3f7048e22
commit 2f85c8a8ba

View file

@ -36,10 +36,13 @@ var Vertex = new Class({
initialize:
function Vertex (x, y, z, u, v, color, alpha)
function Vertex (x, y, z, u, v, color, alpha, nx, ny, nz)
{
if (color === undefined) { color = 0xffffff; }
if (alpha === undefined) { alpha = 1; }
if (nx === undefined) { nx = 0; }
if (ny === undefined) { ny = 0; }
if (nz === undefined) { nz = 0; }
Vector3.call(this, x, y, z);
@ -77,7 +80,7 @@ var Vertex = new Class({
* @type {number}
* @since 3.50.0
*/
this.nx = 0;
this.nx = nx;
/**
* The projected y coordinate of this vertex.
@ -86,7 +89,7 @@ var Vertex = new Class({
* @type {number}
* @since 3.50.0
*/
this.ny = 0;
this.ny = ny;
/**
* The projected z coordinate of this vertex.
@ -95,7 +98,7 @@ var Vertex = new Class({
* @type {number}
* @since 3.50.0
*/
this.nz = 0;
this.nz = nz;
/**
* UV u coordinate of this vertex.
@ -134,15 +137,6 @@ var Vertex = new Class({
this.alpha = alpha;
},
setNormals: function (nx, ny, nz)
{
this.nx = nx;
this.ny = ny;
this.nz = nz;
return this;
},
/**
* Transforms this vertex by the given matrix, storing the results in `vx`, `vy` and `vz`.
*