|
@@ -46,6 +46,15 @@ var BABYLON;
|
|
|
Color3.prototype.toString = function () {
|
|
|
return "{R: " + this.r + " G:" + this.g + " B:" + this.b + "}";
|
|
|
};
|
|
|
+ Color3.prototype.getClassName = function () {
|
|
|
+ return "Color3";
|
|
|
+ };
|
|
|
+ Color3.prototype.getHashCode = function () {
|
|
|
+ var hash = this.r || 0;
|
|
|
+ hash = (hash * 397) ^ (this.g || 0);
|
|
|
+ hash = (hash * 397) ^ (this.b || 0);
|
|
|
+ return hash;
|
|
|
+ };
|
|
|
// Operators
|
|
|
Color3.prototype.toArray = function (array, index) {
|
|
|
if (index === undefined) {
|
|
@@ -245,6 +254,16 @@ var BABYLON;
|
|
|
Color4.prototype.toString = function () {
|
|
|
return "{R: " + this.r + " G:" + this.g + " B:" + this.b + " A:" + this.a + "}";
|
|
|
};
|
|
|
+ Color4.prototype.getClassName = function () {
|
|
|
+ return "Color4";
|
|
|
+ };
|
|
|
+ Color4.prototype.getHashCode = function () {
|
|
|
+ var hash = this.r || 0;
|
|
|
+ hash = (hash * 397) ^ (this.g || 0);
|
|
|
+ hash = (hash * 397) ^ (this.b || 0);
|
|
|
+ hash = (hash * 397) ^ (this.a || 0);
|
|
|
+ return hash;
|
|
|
+ };
|
|
|
Color4.prototype.clone = function () {
|
|
|
return new Color4(this.r, this.g, this.b, this.a);
|
|
|
};
|
|
@@ -318,6 +337,14 @@ var BABYLON;
|
|
|
Vector2.prototype.toString = function () {
|
|
|
return "{X: " + this.x + " Y:" + this.y + "}";
|
|
|
};
|
|
|
+ Vector2.prototype.getClassName = function () {
|
|
|
+ return "Vector2";
|
|
|
+ };
|
|
|
+ Vector2.prototype.getHashCode = function () {
|
|
|
+ var hash = this.x || 0;
|
|
|
+ hash = (hash * 397) ^ (this.y || 0);
|
|
|
+ return hash;
|
|
|
+ };
|
|
|
// Operators
|
|
|
Vector2.prototype.toArray = function (array, index) {
|
|
|
if (index === void 0) { index = 0; }
|
|
@@ -513,6 +540,15 @@ var BABYLON;
|
|
|
Vector3.prototype.toString = function () {
|
|
|
return "{X: " + this.x + " Y:" + this.y + " Z:" + this.z + "}";
|
|
|
};
|
|
|
+ Vector3.prototype.getClassName = function () {
|
|
|
+ return "Vector3";
|
|
|
+ };
|
|
|
+ Vector3.prototype.getHashCode = function () {
|
|
|
+ var hash = this.x || 0;
|
|
|
+ hash = (hash * 397) ^ (this.y || 0);
|
|
|
+ hash = (hash * 397) ^ (this.z || 0);
|
|
|
+ return hash;
|
|
|
+ };
|
|
|
// Operators
|
|
|
Vector3.prototype.asArray = function () {
|
|
|
var result = [];
|
|
@@ -1014,6 +1050,16 @@ var BABYLON;
|
|
|
Vector4.prototype.toString = function () {
|
|
|
return "{X: " + this.x + " Y:" + this.y + " Z:" + this.z + "W:" + this.w + "}";
|
|
|
};
|
|
|
+ Vector4.prototype.getClassName = function () {
|
|
|
+ return "Vector4";
|
|
|
+ };
|
|
|
+ Vector4.prototype.getHashCode = function () {
|
|
|
+ var hash = this.x || 0;
|
|
|
+ hash = (hash * 397) ^ (this.y || 0);
|
|
|
+ hash = (hash * 397) ^ (this.z || 0);
|
|
|
+ hash = (hash * 397) ^ (this.w || 0);
|
|
|
+ return hash;
|
|
|
+ };
|
|
|
// Operators
|
|
|
Vector4.prototype.asArray = function () {
|
|
|
var result = [];
|
|
@@ -1268,6 +1314,17 @@ var BABYLON;
|
|
|
this.width = width;
|
|
|
this.height = height;
|
|
|
}
|
|
|
+ Size.prototype.toString = function () {
|
|
|
+ return "{W: " + this.width + ", H: " + this.height + "}";
|
|
|
+ };
|
|
|
+ Size.prototype.getClassName = function () {
|
|
|
+ return "Size";
|
|
|
+ };
|
|
|
+ Size.prototype.getHashCode = function () {
|
|
|
+ var hash = this.width || 0;
|
|
|
+ hash = (hash * 397) ^ (this.height || 0);
|
|
|
+ return hash;
|
|
|
+ };
|
|
|
Size.prototype.clone = function () {
|
|
|
return new Size(this.width, this.height);
|
|
|
};
|
|
@@ -1317,6 +1374,16 @@ var BABYLON;
|
|
|
Quaternion.prototype.toString = function () {
|
|
|
return "{X: " + this.x + " Y:" + this.y + " Z:" + this.z + " W:" + this.w + "}";
|
|
|
};
|
|
|
+ Quaternion.prototype.getClassName = function () {
|
|
|
+ return "Quaternion";
|
|
|
+ };
|
|
|
+ Quaternion.prototype.getHashCode = function () {
|
|
|
+ var hash = this.x || 0;
|
|
|
+ hash = (hash * 397) ^ (this.y || 0);
|
|
|
+ hash = (hash * 397) ^ (this.z || 0);
|
|
|
+ hash = (hash * 397) ^ (this.w || 0);
|
|
|
+ return hash;
|
|
|
+ };
|
|
|
Quaternion.prototype.asArray = function () {
|
|
|
return [this.x, this.y, this.z, this.w];
|
|
|
};
|
|
@@ -1799,6 +1866,16 @@ var BABYLON;
|
|
|
Matrix.prototype.clone = function () {
|
|
|
return Matrix.FromValues(this.m[0], this.m[1], this.m[2], this.m[3], this.m[4], this.m[5], this.m[6], this.m[7], this.m[8], this.m[9], this.m[10], this.m[11], this.m[12], this.m[13], this.m[14], this.m[15]);
|
|
|
};
|
|
|
+ Matrix.prototype.getClassName = function () {
|
|
|
+ return "Matrix";
|
|
|
+ };
|
|
|
+ Matrix.prototype.getHashCode = function () {
|
|
|
+ var hash = this.m[0] || 0;
|
|
|
+ for (var i = 1; i < 16; i++) {
|
|
|
+ hash = (hash * 397) ^ (this.m[i] || 0);
|
|
|
+ }
|
|
|
+ return hash;
|
|
|
+ };
|
|
|
Matrix.prototype.decompose = function (scale, rotation, translation) {
|
|
|
translation.x = this.m[12];
|
|
|
translation.y = this.m[13];
|
|
@@ -2263,6 +2340,14 @@ var BABYLON;
|
|
|
Plane.prototype.clone = function () {
|
|
|
return new Plane(this.normal.x, this.normal.y, this.normal.z, this.d);
|
|
|
};
|
|
|
+ Plane.prototype.getClassName = function () {
|
|
|
+ return "Plane";
|
|
|
+ };
|
|
|
+ Plane.prototype.getHashCode = function () {
|
|
|
+ var hash = this.normal.getHashCode();
|
|
|
+ hash = (hash * 397) ^ (this.d || 0);
|
|
|
+ return hash;
|
|
|
+ };
|
|
|
Plane.prototype.normalize = function () {
|
|
|
var norm = (Math.sqrt((this.normal.x * this.normal.x) + (this.normal.y * this.normal.y) + (this.normal.z * this.normal.z)));
|
|
|
var magnitude = 0;
|