@koreez/phaser3-isometric-plugin
Version:
Phaser3 isometirc plugin
88 lines • 2.54 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Point3 = (function () {
function Point3(x, y, z) {
if (x === void 0) { x = 0; }
if (y === void 0) { y = 0; }
if (z === void 0) { z = 0; }
this.x = x;
this.y = y;
this.z = z;
}
Point3.prototype.copyFrom = function (source) {
return this.setTo(source.x, source.y, source.z);
};
Point3.prototype.copyTo = function (dest) {
dest.x = this.x;
dest.y = this.y;
dest.z = this.z;
return dest;
};
Point3.prototype.equals = function (a) {
return a.x === this.x && a.y === this.y && a.z === this.z;
};
Point3.prototype.setTo = function (x, y, z) {
this.x = x || 0;
this.y = y || (y !== 0 ? this.x : 0);
this.z = z || (typeof y === 'undefined' ? this.x : 0);
return this;
};
Point3.prototype.add = function (x, y, z) {
this.x += x || 0;
this.y += y || 0;
this.z += z || 0;
return this;
};
Point3.prototype.subtract = function (x, y, z) {
this.x -= x || 0;
this.y -= y || 0;
this.z -= z || 0;
return this;
};
Point3.prototype.multiply = function (x, y, z) {
this.x *= x || 1;
this.y *= y || 1;
this.z *= z || 1;
return this;
};
Point3.prototype.divide = function (x, y, z) {
this.x /= x || 1;
this.y /= y || 1;
this.z /= z || 1;
return this;
};
Point3.add = function (a, b, out) {
if (out === void 0) { out = new Point3(); }
out.x = a.x + b.x;
out.y = a.y + b.y;
out.z = a.z + b.z;
return out;
};
Point3.subtract = function (a, b, out) {
if (out === void 0) { out = new Point3(); }
out.x = a.x - b.x;
out.y = a.y - b.y;
out.z = a.z - b.z;
return out;
};
Point3.multiply = function (a, b, out) {
if (out === void 0) { out = new Point3(); }
out.x = a.x * b.x;
out.y = a.y * b.y;
out.z = a.z * b.z;
return out;
};
Point3.divide = function (a, b, out) {
if (out === void 0) { out = new Point3(); }
out.x = a.x / b.x;
out.y = a.y / b.y;
out.z = a.z / b.z;
return out;
};
Point3.equals = function (a, b) {
return a.x === b.x && a.y === b.y && a.z === b.z;
};
return Point3;
}());
exports.Point3 = Point3;
//# sourceMappingURL=Point3.js.map