Socket
Socket
Sign inDemoInstall

@pixi/math

Package Overview
Dependencies
Maintainers
3
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/math - npm Package Compare versions

Comparing version 6.1.3 to 6.2.0

4

dist/browser/math.min.js
/*!
* @pixi/math - v6.1.3
* Compiled Mon, 13 Sep 2021 15:29:31 UTC
* @pixi/math - v6.2.0
* Compiled Mon, 01 Nov 2021 16:52:10 UTC
*

@@ -5,0 +5,0 @@ * @pixi/math is licensed under the MIT License.

/*!
* @pixi/math - v6.1.3
* Compiled Mon, 13 Sep 2021 15:29:31 UTC
* @pixi/math - v6.2.0
* Compiled Mon, 01 Nov 2021 16:52:10 UTC
*

@@ -294,3 +294,2 @@ * @pixi/math is licensed under the MIT License.

*
* @class
* @memberof PIXI

@@ -300,5 +299,5 @@ */

/**
* @param {number} [x=0] - The X coordinate of the center of this circle
* @param {number} [y=0] - The Y coordinate of the center of this circle
* @param {number} [radius=0] - The radius of the circle
* @param x - The X coordinate of the center of this circle
* @param y - The Y coordinate of the center of this circle
* @param radius - The radius of the circle
*/

@@ -309,25 +308,5 @@ function Circle(x, y, radius) {

if (radius === void 0) { radius = 0; }
/**
* @member {number}
* @default 0
*/
this.x = x;
/**
* @member {number}
* @default 0
*/
this.y = y;
/**
* @member {number}
* @default 0
*/
this.radius = radius;
/**
* The type of the object, mainly used to avoid `instanceof` checks
*
* @member {number}
* @readOnly
* @default PIXI.SHAPES.CIRC
* @see PIXI.SHAPES
*/
this.type = exports.SHAPES.CIRC;

@@ -338,3 +317,3 @@ }

*
* @return {PIXI.Circle} a copy of the Circle
* @return A copy of the Circle
*/

@@ -347,5 +326,5 @@ Circle.prototype.clone = function () {

*
* @param {number} x - The X coordinate of the point to test
* @param {number} y - The Y coordinate of the point to test
* @return {boolean} Whether the x/y coordinates are within this Circle
* @param x - The X coordinate of the point to test
* @param y - The Y coordinate of the point to test
* @return Whether the x/y coordinates are within this Circle
*/

@@ -366,3 +345,3 @@ Circle.prototype.contains = function (x, y) {

*
* @return {PIXI.Rectangle} the framing rectangle
* @return The framing rectangle
*/

@@ -381,3 +360,2 @@ Circle.prototype.getBounds = function () {

*
* @class
* @memberof PIXI

@@ -387,6 +365,6 @@ */

/**
* @param {number} [x=0] - The X coordinate of the center of this ellipse
* @param {number} [y=0] - The Y coordinate of the center of this ellipse
* @param {number} [halfWidth=0] - The half width of this ellipse
* @param {number} [halfHeight=0] - The half height of this ellipse
* @param x - The X coordinate of the center of this ellipse
* @param y - The Y coordinate of the center of this ellipse
* @param halfWidth - The half width of this ellipse
* @param halfHeight - The half height of this ellipse
*/

@@ -398,30 +376,6 @@ function Ellipse(x, y, halfWidth, halfHeight) {

if (halfHeight === void 0) { halfHeight = 0; }
/**
* @member {number}
* @default 0
*/
this.x = x;
/**
* @member {number}
* @default 0
*/
this.y = y;
/**
* @member {number}
* @default 0
*/
this.width = halfWidth;
/**
* @member {number}
* @default 0
*/
this.height = halfHeight;
/**
* The type of the object, mainly used to avoid `instanceof` checks
*
* @member {number}
* @readOnly
* @default PIXI.SHAPES.ELIP
* @see PIXI.SHAPES
*/
this.type = exports.SHAPES.ELIP;

@@ -432,3 +386,3 @@ }

*
* @return {PIXI.Ellipse} a copy of the ellipse
* @return {PIXI.Ellipse} A copy of the ellipse
*/

@@ -441,5 +395,5 @@ Ellipse.prototype.clone = function () {

*
* @param {number} x - The X coordinate of the point to test
* @param {number} y - The Y coordinate of the point to test
* @return {boolean} Whether the x/y coords are within this ellipse
* @param x - The X coordinate of the point to test
* @param y - The Y coordinate of the point to test
* @return Whether the x/y coords are within this ellipse
*/

@@ -460,3 +414,3 @@ Ellipse.prototype.contains = function (x, y) {

*
* @return {PIXI.Rectangle} the framing rectangle
* @return The framing rectangle
*/

@@ -762,5 +716,3 @@ Ellipse.prototype.getBounds = function () {

*
* @class
* @memberof PIXI
* @implements IPoint
*/

@@ -854,5 +806,3 @@ var ObservablePoint = /** @class */ (function () {

Object.defineProperty(ObservablePoint.prototype, "x", {
/** Position of the observable point on the x axis
* @type {number}
*/
/** Position of the observable point on the x axis. */
get: function () {

@@ -871,5 +821,3 @@ return this._x;

Object.defineProperty(ObservablePoint.prototype, "y", {
/** Position of the observable point on the y axis
* @type {number}
*/
/** Position of the observable point on the y axis. */
get: function () {

@@ -899,3 +847,3 @@ return this._y;

* ```
* @class
*
* @memberof PIXI

@@ -905,8 +853,8 @@ */

/**
* @param {number} [a=1] - x scale
* @param {number} [b=0] - y skew
* @param {number} [c=0] - x skew
* @param {number} [d=1] - y scale
* @param {number} [tx=0] - x translation
* @param {number} [ty=0] - y translation
* @param a - x scale
* @param b - y skew
* @param c - x skew
* @param d - y scale
* @param tx - x translation
* @param ty - y translation
*/

@@ -921,31 +869,7 @@ function Matrix(a, b, c, d, tx, ty) {

this.array = null;
/**
* @member {number}
* @default 1
*/
this.a = a;
/**
* @member {number}
* @default 0
*/
this.b = b;
/**
* @member {number}
* @default 0
*/
this.c = c;
/**
* @member {number}
* @default 1
*/
this.d = d;
/**
* @member {number}
* @default 0
*/
this.tx = tx;
/**
* @member {number}
* @default 0
*/
this.ty = ty;

@@ -963,3 +887,3 @@ }

*
* @param {number[]} array - The array that the matrix will be populated from.
* @param array - The array that the matrix will be populated from.
*/

@@ -975,12 +899,11 @@ Matrix.prototype.fromArray = function (array) {

/**
* sets the matrix properties
* Sets the matrix properties.
*
* @param {number} a - Matrix component
* @param {number} b - Matrix component
* @param {number} c - Matrix component
* @param {number} d - Matrix component
* @param {number} tx - Matrix component
* @param {number} ty - Matrix component
*
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param a - Matrix component
* @param b - Matrix component
* @param c - Matrix component
* @param d - Matrix component
* @param tx - Matrix component
* @param ty - Matrix component
* @return This matrix. Good for chaining method calls.
*/

@@ -999,5 +922,5 @@ Matrix.prototype.set = function (a, b, c, d, tx, ty) {

*
* @param {boolean} transpose - Whether we need to transpose the matrix or not
* @param {Float32Array} [out=new Float32Array(9)] - If provided the array will be assigned to out
* @return {number[]} the newly created array which contains the matrix
* @param transpose - Whether we need to transpose the matrix or not
* @param [out=new Float32Array(9)] - If provided the array will be assigned to out
* @return The newly created array which contains the matrix
*/

@@ -1037,3 +960,3 @@ Matrix.prototype.toArray = function (transpose, out) {

*
* @param {PIXI.IPointData} pos - The origin
* @param pos - The origin
* @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)

@@ -1054,3 +977,3 @@ * @return {PIXI.Point} The new point, transformed through this matrix

*
* @param {PIXI.IPointData} pos - The origin
* @param pos - The origin
* @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)

@@ -1071,5 +994,5 @@ * @return {PIXI.Point} The new point, inverse-transformed through this matrix

*
* @param {number} x - How much to translate x by
* @param {number} y - How much to translate y by
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param x - How much to translate x by
* @param y - How much to translate y by
* @return This matrix. Good for chaining method calls.
*/

@@ -1084,5 +1007,5 @@ Matrix.prototype.translate = function (x, y) {

*
* @param {number} x - The amount to scale horizontally
* @param {number} y - The amount to scale vertically
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param x - The amount to scale horizontally
* @param y - The amount to scale vertically
* @return This matrix. Good for chaining method calls.
*/

@@ -1101,4 +1024,4 @@ Matrix.prototype.scale = function (x, y) {

*
* @param {number} angle - The angle in radians.
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param angle - The angle in radians.
* @return This matrix. Good for chaining method calls.
*/

@@ -1122,4 +1045,4 @@ Matrix.prototype.rotate = function (angle) {

*
* @param {PIXI.Matrix} matrix - The matrix to append.
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param matrix - The matrix to append.
* @return This matrix. Good for chaining method calls.
*/

@@ -1142,12 +1065,12 @@ Matrix.prototype.append = function (matrix) {

*
* @param {number} x - Position on the x axis
* @param {number} y - Position on the y axis
* @param {number} pivotX - Pivot on the x axis
* @param {number} pivotY - Pivot on the y axis
* @param {number} scaleX - Scale on the x axis
* @param {number} scaleY - Scale on the y axis
* @param {number} rotation - Rotation in radians
* @param {number} skewX - Skew on the x axis
* @param {number} skewY - Skew on the y axis
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param x - Position on the x axis
* @param y - Position on the y axis
* @param pivotX - Pivot on the x axis
* @param pivotY - Pivot on the y axis
* @param scaleX - Scale on the x axis
* @param scaleY - Scale on the y axis
* @param rotation - Rotation in radians
* @param skewX - Skew on the x axis
* @param skewY - Skew on the y axis
* @return This matrix. Good for chaining method calls.
*/

@@ -1166,4 +1089,4 @@ Matrix.prototype.setTransform = function (x, y, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY) {

*
* @param {PIXI.Matrix} matrix - The matrix to prepend
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param matrix - The matrix to prepend
* @return This matrix. Good for chaining method calls.
*/

@@ -1187,4 +1110,4 @@ Matrix.prototype.prepend = function (matrix) {

*
* @param {PIXI.Transform} transform - The transform to apply the properties to.
* @return {PIXI.Transform} The transform with the newly applied properties
* @param transform - The transform to apply the properties to.
* @return The transform with the newly applied properties
*/

@@ -1221,3 +1144,3 @@ Matrix.prototype.decompose = function (transform) {

*
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @return This matrix. Good for chaining method calls.
*/

@@ -1242,3 +1165,3 @@ Matrix.prototype.invert = function () {

*
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @return This matrix. Good for chaining method calls.
*/

@@ -1257,3 +1180,3 @@ Matrix.prototype.identity = function () {

*
* @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls.
* @return A copy of this matrix. Good for chaining method calls.
*/

@@ -1273,4 +1196,4 @@ Matrix.prototype.clone = function () {

*
* @param {PIXI.Matrix} matrix - The matrix to copy to.
* @return {PIXI.Matrix} The matrix given in parameter with its values updated.
* @param matrix - The matrix to copy to.
* @return The matrix given in parameter with its values updated.
*/

@@ -1308,5 +1231,3 @@ Matrix.prototype.copyTo = function (matrix) {

*
* @static
* @const
* @member {PIXI.Matrix}
* @readonly
*/

@@ -1323,5 +1244,3 @@ get: function () {

*
* @static
* @const
* @member {PIXI.Matrix}
* @readonly
*/

@@ -1677,5 +1596,4 @@ get: function () {

/**
* Transform that takes care about its versions
* Transform that takes care about its versions.
*
* @class
* @memberof PIXI

@@ -1685,121 +1603,23 @@ */

function Transform() {
/**
* The world transformation matrix.
*
* @member {PIXI.Matrix}
*/
this.worldTransform = new Matrix();
/**
* The local transformation matrix.
*
* @member {PIXI.Matrix}
*/
this.localTransform = new Matrix();
/**
* The coordinate of the object relative to the local coordinates of the parent.
*
* @member {PIXI.ObservablePoint}
*/
this.position = new ObservablePoint(this.onChange, this, 0, 0);
/**
* The scale factor of the object.
*
* @member {PIXI.ObservablePoint}
*/
this.scale = new ObservablePoint(this.onChange, this, 1, 1);
/**
* The pivot point of the displayObject that it rotates around.
*
* @member {PIXI.ObservablePoint}
*/
this.pivot = new ObservablePoint(this.onChange, this, 0, 0);
/**
* The skew amount, on the x and y axis.
*
* @member {PIXI.ObservablePoint}
*/
this.skew = new ObservablePoint(this.updateSkew, this, 0, 0);
/**
* The rotation amount.
*
* @protected
* @member {number}
*/
this._rotation = 0;
/**
* The X-coordinate value of the normalized local X axis,
* the first column of the local transformation matrix without a scale.
*
* @protected
* @member {number}
*/
this._cx = 1;
/**
* The Y-coordinate value of the normalized local X axis,
* the first column of the local transformation matrix without a scale.
*
* @protected
* @member {number}
*/
this._sx = 0;
/**
* The X-coordinate value of the normalized local Y axis,
* the second column of the local transformation matrix without a scale.
*
* @protected
* @member {number}
*/
this._cy = 0;
/**
* The Y-coordinate value of the normalized local Y axis,
* the second column of the local transformation matrix without a scale.
*
* @protected
* @member {number}
*/
this._sy = 1;
/**
* The locally unique ID of the local transform.
*
* @protected
* @member {number}
*/
this._localID = 0;
/**
* The locally unique ID of the local transform
* used to calculate the current local transformation matrix.
*
* @protected
* @member {number}
*/
this._currentLocalID = 0;
/**
* The locally unique ID of the world transform.
*
* @protected
* @member {number}
*/
this._worldID = 0;
/**
* The locally unique ID of the parent's world transform
* used to calculate the current world transformation matrix.
*
* @protected
* @member {number}
*/
this._parentID = 0;
}
/**
* Called when a value changes.
*
* @protected
*/
/** Called when a value changes. */
Transform.prototype.onChange = function () {
this._localID++;
};
/**
* Called when the skew or the rotation changes.
*
* @protected
*/
/** Called when the skew or the rotation changes. */
Transform.prototype.updateSkew = function () {

@@ -1820,5 +1640,3 @@ this._cx = Math.cos(this._rotation + this.skew.y);

};
/**
* Updates the local transformation matrix.
*/
/** Updates the local transformation matrix. */
Transform.prototype.updateLocalTransform = function () {

@@ -1842,3 +1660,3 @@ var lt = this.localTransform;

*
* @param {PIXI.Transform} parentTransform - The parent transform
* @param parentTransform - The parent transform
*/

@@ -1877,3 +1695,3 @@ Transform.prototype.updateTransform = function (parentTransform) {

*
* @param {PIXI.Matrix} matrix - The matrix to decompose
* @param matrix - The matrix to decompose
*/

@@ -1885,7 +1703,3 @@ Transform.prototype.setFromMatrix = function (matrix) {

Object.defineProperty(Transform.prototype, "rotation", {
/**
* The rotation of the object in radians.
*
* @member {number}
*/
/** The rotation of the object in radians. */
get: function () {

@@ -1903,9 +1717,3 @@ return this._rotation;

});
/**
* A default (identity) transform
*
* @static
* @constant
* @member {PIXI.Transform}
*/
/** A default (identity) transform. */
Transform.IDENTITY = new Transform();

@@ -1912,0 +1720,0 @@ return Transform;

/*!
* @pixi/math - v6.1.3
* Compiled Mon, 13 Sep 2021 15:29:31 UTC
* @pixi/math - v6.2.0
* Compiled Mon, 01 Nov 2021 16:52:10 UTC
*

@@ -5,0 +5,0 @@ * @pixi/math is licensed under the MIT License.

/*!
* @pixi/math - v6.1.3
* Compiled Mon, 13 Sep 2021 15:29:31 UTC
* @pixi/math - v6.2.0
* Compiled Mon, 01 Nov 2021 16:52:10 UTC
*

@@ -303,3 +303,2 @@ * @pixi/math is licensed under the MIT License.

*
* @class
* @memberof PIXI

@@ -309,5 +308,5 @@ */

/**
* @param {number} [x=0] - The X coordinate of the center of this circle
* @param {number} [y=0] - The Y coordinate of the center of this circle
* @param {number} [radius=0] - The radius of the circle
* @param x - The X coordinate of the center of this circle
* @param y - The Y coordinate of the center of this circle
* @param radius - The radius of the circle
*/

@@ -318,25 +317,5 @@ function Circle(x, y, radius) {

if (radius === void 0) { radius = 0; }
/**
* @member {number}
* @default 0
*/
this.x = x;
/**
* @member {number}
* @default 0
*/
this.y = y;
/**
* @member {number}
* @default 0
*/
this.radius = radius;
/**
* The type of the object, mainly used to avoid `instanceof` checks
*
* @member {number}
* @readOnly
* @default PIXI.SHAPES.CIRC
* @see PIXI.SHAPES
*/
this.type = SHAPES.CIRC;

@@ -347,3 +326,3 @@ }

*
* @return {PIXI.Circle} a copy of the Circle
* @return A copy of the Circle
*/

@@ -356,5 +335,5 @@ Circle.prototype.clone = function () {

*
* @param {number} x - The X coordinate of the point to test
* @param {number} y - The Y coordinate of the point to test
* @return {boolean} Whether the x/y coordinates are within this Circle
* @param x - The X coordinate of the point to test
* @param y - The Y coordinate of the point to test
* @return Whether the x/y coordinates are within this Circle
*/

@@ -375,3 +354,3 @@ Circle.prototype.contains = function (x, y) {

*
* @return {PIXI.Rectangle} the framing rectangle
* @return The framing rectangle
*/

@@ -390,3 +369,2 @@ Circle.prototype.getBounds = function () {

*
* @class
* @memberof PIXI

@@ -396,6 +374,6 @@ */

/**
* @param {number} [x=0] - The X coordinate of the center of this ellipse
* @param {number} [y=0] - The Y coordinate of the center of this ellipse
* @param {number} [halfWidth=0] - The half width of this ellipse
* @param {number} [halfHeight=0] - The half height of this ellipse
* @param x - The X coordinate of the center of this ellipse
* @param y - The Y coordinate of the center of this ellipse
* @param halfWidth - The half width of this ellipse
* @param halfHeight - The half height of this ellipse
*/

@@ -407,30 +385,6 @@ function Ellipse(x, y, halfWidth, halfHeight) {

if (halfHeight === void 0) { halfHeight = 0; }
/**
* @member {number}
* @default 0
*/
this.x = x;
/**
* @member {number}
* @default 0
*/
this.y = y;
/**
* @member {number}
* @default 0
*/
this.width = halfWidth;
/**
* @member {number}
* @default 0
*/
this.height = halfHeight;
/**
* The type of the object, mainly used to avoid `instanceof` checks
*
* @member {number}
* @readOnly
* @default PIXI.SHAPES.ELIP
* @see PIXI.SHAPES
*/
this.type = SHAPES.ELIP;

@@ -441,3 +395,3 @@ }

*
* @return {PIXI.Ellipse} a copy of the ellipse
* @return {PIXI.Ellipse} A copy of the ellipse
*/

@@ -450,5 +404,5 @@ Ellipse.prototype.clone = function () {

*
* @param {number} x - The X coordinate of the point to test
* @param {number} y - The Y coordinate of the point to test
* @return {boolean} Whether the x/y coords are within this ellipse
* @param x - The X coordinate of the point to test
* @param y - The Y coordinate of the point to test
* @return Whether the x/y coords are within this ellipse
*/

@@ -469,3 +423,3 @@ Ellipse.prototype.contains = function (x, y) {

*
* @return {PIXI.Rectangle} the framing rectangle
* @return The framing rectangle
*/

@@ -771,5 +725,3 @@ Ellipse.prototype.getBounds = function () {

*
* @class
* @memberof PIXI
* @implements IPoint
*/

@@ -863,5 +815,3 @@ var ObservablePoint = /** @class */ (function () {

Object.defineProperty(ObservablePoint.prototype, "x", {
/** Position of the observable point on the x axis
* @type {number}
*/
/** Position of the observable point on the x axis. */
get: function () {

@@ -880,5 +830,3 @@ return this._x;

Object.defineProperty(ObservablePoint.prototype, "y", {
/** Position of the observable point on the y axis
* @type {number}
*/
/** Position of the observable point on the y axis. */
get: function () {

@@ -908,3 +856,3 @@ return this._y;

* ```
* @class
*
* @memberof PIXI

@@ -914,8 +862,8 @@ */

/**
* @param {number} [a=1] - x scale
* @param {number} [b=0] - y skew
* @param {number} [c=0] - x skew
* @param {number} [d=1] - y scale
* @param {number} [tx=0] - x translation
* @param {number} [ty=0] - y translation
* @param a - x scale
* @param b - y skew
* @param c - x skew
* @param d - y scale
* @param tx - x translation
* @param ty - y translation
*/

@@ -930,31 +878,7 @@ function Matrix(a, b, c, d, tx, ty) {

this.array = null;
/**
* @member {number}
* @default 1
*/
this.a = a;
/**
* @member {number}
* @default 0
*/
this.b = b;
/**
* @member {number}
* @default 0
*/
this.c = c;
/**
* @member {number}
* @default 1
*/
this.d = d;
/**
* @member {number}
* @default 0
*/
this.tx = tx;
/**
* @member {number}
* @default 0
*/
this.ty = ty;

@@ -972,3 +896,3 @@ }

*
* @param {number[]} array - The array that the matrix will be populated from.
* @param array - The array that the matrix will be populated from.
*/

@@ -984,12 +908,11 @@ Matrix.prototype.fromArray = function (array) {

/**
* sets the matrix properties
* Sets the matrix properties.
*
* @param {number} a - Matrix component
* @param {number} b - Matrix component
* @param {number} c - Matrix component
* @param {number} d - Matrix component
* @param {number} tx - Matrix component
* @param {number} ty - Matrix component
*
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param a - Matrix component
* @param b - Matrix component
* @param c - Matrix component
* @param d - Matrix component
* @param tx - Matrix component
* @param ty - Matrix component
* @return This matrix. Good for chaining method calls.
*/

@@ -1008,5 +931,5 @@ Matrix.prototype.set = function (a, b, c, d, tx, ty) {

*
* @param {boolean} transpose - Whether we need to transpose the matrix or not
* @param {Float32Array} [out=new Float32Array(9)] - If provided the array will be assigned to out
* @return {number[]} the newly created array which contains the matrix
* @param transpose - Whether we need to transpose the matrix or not
* @param [out=new Float32Array(9)] - If provided the array will be assigned to out
* @return The newly created array which contains the matrix
*/

@@ -1046,3 +969,3 @@ Matrix.prototype.toArray = function (transpose, out) {

*
* @param {PIXI.IPointData} pos - The origin
* @param pos - The origin
* @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)

@@ -1063,3 +986,3 @@ * @return {PIXI.Point} The new point, transformed through this matrix

*
* @param {PIXI.IPointData} pos - The origin
* @param pos - The origin
* @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)

@@ -1080,5 +1003,5 @@ * @return {PIXI.Point} The new point, inverse-transformed through this matrix

*
* @param {number} x - How much to translate x by
* @param {number} y - How much to translate y by
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param x - How much to translate x by
* @param y - How much to translate y by
* @return This matrix. Good for chaining method calls.
*/

@@ -1093,5 +1016,5 @@ Matrix.prototype.translate = function (x, y) {

*
* @param {number} x - The amount to scale horizontally
* @param {number} y - The amount to scale vertically
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param x - The amount to scale horizontally
* @param y - The amount to scale vertically
* @return This matrix. Good for chaining method calls.
*/

@@ -1110,4 +1033,4 @@ Matrix.prototype.scale = function (x, y) {

*
* @param {number} angle - The angle in radians.
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param angle - The angle in radians.
* @return This matrix. Good for chaining method calls.
*/

@@ -1131,4 +1054,4 @@ Matrix.prototype.rotate = function (angle) {

*
* @param {PIXI.Matrix} matrix - The matrix to append.
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param matrix - The matrix to append.
* @return This matrix. Good for chaining method calls.
*/

@@ -1151,12 +1074,12 @@ Matrix.prototype.append = function (matrix) {

*
* @param {number} x - Position on the x axis
* @param {number} y - Position on the y axis
* @param {number} pivotX - Pivot on the x axis
* @param {number} pivotY - Pivot on the y axis
* @param {number} scaleX - Scale on the x axis
* @param {number} scaleY - Scale on the y axis
* @param {number} rotation - Rotation in radians
* @param {number} skewX - Skew on the x axis
* @param {number} skewY - Skew on the y axis
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param x - Position on the x axis
* @param y - Position on the y axis
* @param pivotX - Pivot on the x axis
* @param pivotY - Pivot on the y axis
* @param scaleX - Scale on the x axis
* @param scaleY - Scale on the y axis
* @param rotation - Rotation in radians
* @param skewX - Skew on the x axis
* @param skewY - Skew on the y axis
* @return This matrix. Good for chaining method calls.
*/

@@ -1175,4 +1098,4 @@ Matrix.prototype.setTransform = function (x, y, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY) {

*
* @param {PIXI.Matrix} matrix - The matrix to prepend
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param matrix - The matrix to prepend
* @return This matrix. Good for chaining method calls.
*/

@@ -1196,4 +1119,4 @@ Matrix.prototype.prepend = function (matrix) {

*
* @param {PIXI.Transform} transform - The transform to apply the properties to.
* @return {PIXI.Transform} The transform with the newly applied properties
* @param transform - The transform to apply the properties to.
* @return The transform with the newly applied properties
*/

@@ -1230,3 +1153,3 @@ Matrix.prototype.decompose = function (transform) {

*
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @return This matrix. Good for chaining method calls.
*/

@@ -1251,3 +1174,3 @@ Matrix.prototype.invert = function () {

*
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @return This matrix. Good for chaining method calls.
*/

@@ -1266,3 +1189,3 @@ Matrix.prototype.identity = function () {

*
* @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls.
* @return A copy of this matrix. Good for chaining method calls.
*/

@@ -1282,4 +1205,4 @@ Matrix.prototype.clone = function () {

*
* @param {PIXI.Matrix} matrix - The matrix to copy to.
* @return {PIXI.Matrix} The matrix given in parameter with its values updated.
* @param matrix - The matrix to copy to.
* @return The matrix given in parameter with its values updated.
*/

@@ -1317,5 +1240,3 @@ Matrix.prototype.copyTo = function (matrix) {

*
* @static
* @const
* @member {PIXI.Matrix}
* @readonly
*/

@@ -1332,5 +1253,3 @@ get: function () {

*
* @static
* @const
* @member {PIXI.Matrix}
* @readonly
*/

@@ -1686,5 +1605,4 @@ get: function () {

/**
* Transform that takes care about its versions
* Transform that takes care about its versions.
*
* @class
* @memberof PIXI

@@ -1694,121 +1612,23 @@ */

function Transform() {
/**
* The world transformation matrix.
*
* @member {PIXI.Matrix}
*/
this.worldTransform = new Matrix();
/**
* The local transformation matrix.
*
* @member {PIXI.Matrix}
*/
this.localTransform = new Matrix();
/**
* The coordinate of the object relative to the local coordinates of the parent.
*
* @member {PIXI.ObservablePoint}
*/
this.position = new ObservablePoint(this.onChange, this, 0, 0);
/**
* The scale factor of the object.
*
* @member {PIXI.ObservablePoint}
*/
this.scale = new ObservablePoint(this.onChange, this, 1, 1);
/**
* The pivot point of the displayObject that it rotates around.
*
* @member {PIXI.ObservablePoint}
*/
this.pivot = new ObservablePoint(this.onChange, this, 0, 0);
/**
* The skew amount, on the x and y axis.
*
* @member {PIXI.ObservablePoint}
*/
this.skew = new ObservablePoint(this.updateSkew, this, 0, 0);
/**
* The rotation amount.
*
* @protected
* @member {number}
*/
this._rotation = 0;
/**
* The X-coordinate value of the normalized local X axis,
* the first column of the local transformation matrix without a scale.
*
* @protected
* @member {number}
*/
this._cx = 1;
/**
* The Y-coordinate value of the normalized local X axis,
* the first column of the local transformation matrix without a scale.
*
* @protected
* @member {number}
*/
this._sx = 0;
/**
* The X-coordinate value of the normalized local Y axis,
* the second column of the local transformation matrix without a scale.
*
* @protected
* @member {number}
*/
this._cy = 0;
/**
* The Y-coordinate value of the normalized local Y axis,
* the second column of the local transformation matrix without a scale.
*
* @protected
* @member {number}
*/
this._sy = 1;
/**
* The locally unique ID of the local transform.
*
* @protected
* @member {number}
*/
this._localID = 0;
/**
* The locally unique ID of the local transform
* used to calculate the current local transformation matrix.
*
* @protected
* @member {number}
*/
this._currentLocalID = 0;
/**
* The locally unique ID of the world transform.
*
* @protected
* @member {number}
*/
this._worldID = 0;
/**
* The locally unique ID of the parent's world transform
* used to calculate the current world transformation matrix.
*
* @protected
* @member {number}
*/
this._parentID = 0;
}
/**
* Called when a value changes.
*
* @protected
*/
/** Called when a value changes. */
Transform.prototype.onChange = function () {
this._localID++;
};
/**
* Called when the skew or the rotation changes.
*
* @protected
*/
/** Called when the skew or the rotation changes. */
Transform.prototype.updateSkew = function () {

@@ -1829,5 +1649,3 @@ this._cx = Math.cos(this._rotation + this.skew.y);

};
/**
* Updates the local transformation matrix.
*/
/** Updates the local transformation matrix. */
Transform.prototype.updateLocalTransform = function () {

@@ -1851,3 +1669,3 @@ var lt = this.localTransform;

*
* @param {PIXI.Transform} parentTransform - The parent transform
* @param parentTransform - The parent transform
*/

@@ -1886,3 +1704,3 @@ Transform.prototype.updateTransform = function (parentTransform) {

*
* @param {PIXI.Matrix} matrix - The matrix to decompose
* @param matrix - The matrix to decompose
*/

@@ -1894,7 +1712,3 @@ Transform.prototype.setFromMatrix = function (matrix) {

Object.defineProperty(Transform.prototype, "rotation", {
/**
* The rotation of the object in radians.
*
* @member {number}
*/
/** The rotation of the object in radians. */
get: function () {

@@ -1912,9 +1726,3 @@ return this._rotation;

});
/**
* A default (identity) transform
*
* @static
* @constant
* @member {PIXI.Transform}
*/
/** A default (identity) transform. */
Transform.IDENTITY = new Transform();

@@ -1921,0 +1729,0 @@ return Transform;

/*!
* @pixi/math - v6.1.3
* Compiled Mon, 13 Sep 2021 15:29:31 UTC
* @pixi/math - v6.2.0
* Compiled Mon, 01 Nov 2021 16:52:10 UTC
*

@@ -5,0 +5,0 @@ * @pixi/math is licensed under the MIT License.

@@ -7,14 +7,22 @@ /// <reference path="./global.d.ts" />

*
* @class
* @memberof PIXI
*/
export declare class Circle {
/** @default 0 */
x: number;
/** @default 0 */
y: number;
/** @default 1 */
radius: number;
/**
* The type of the object, mainly used to avoid `instanceof` checks
*
* @default PIXI.SHAPES.CIRC
* @see PIXI.SHAPES
*/
readonly type: SHAPES.CIRC;
/**
* @param {number} [x=0] - The X coordinate of the center of this circle
* @param {number} [y=0] - The Y coordinate of the center of this circle
* @param {number} [radius=0] - The radius of the circle
* @param x - The X coordinate of the center of this circle
* @param y - The Y coordinate of the center of this circle
* @param radius - The radius of the circle
*/

@@ -25,3 +33,3 @@ constructor(x?: number, y?: number, radius?: number);

*
* @return {PIXI.Circle} a copy of the Circle
* @return A copy of the Circle
*/

@@ -32,5 +40,5 @@ clone(): Circle;

*
* @param {number} x - The X coordinate of the point to test
* @param {number} y - The Y coordinate of the point to test
* @return {boolean} Whether the x/y coordinates are within this Circle
* @param x - The X coordinate of the point to test
* @param y - The Y coordinate of the point to test
* @return Whether the x/y coordinates are within this Circle
*/

@@ -41,3 +49,3 @@ contains(x: number, y: number): boolean;

*
* @return {PIXI.Rectangle} the framing rectangle
* @return The framing rectangle
*/

@@ -60,16 +68,25 @@ getBounds(): Rectangle;

*
* @class
* @memberof PIXI
*/
export declare class Ellipse {
/** @default 0 */
x: number;
/** @default 0 */
y: number;
/** @default 0 */
width: number;
/** @default 0 */
height: number;
/**
* The type of the object, mainly used to avoid `instanceof` checks
*
* @default PIXI.SHAPES.ELIP
* @see PIXI.SHAPES
*/
readonly type: SHAPES.ELIP;
/**
* @param {number} [x=0] - The X coordinate of the center of this ellipse
* @param {number} [y=0] - The Y coordinate of the center of this ellipse
* @param {number} [halfWidth=0] - The half width of this ellipse
* @param {number} [halfHeight=0] - The half height of this ellipse
* @param x - The X coordinate of the center of this ellipse
* @param y - The Y coordinate of the center of this ellipse
* @param halfWidth - The half width of this ellipse
* @param halfHeight - The half height of this ellipse
*/

@@ -80,3 +97,3 @@ constructor(x?: number, y?: number, halfWidth?: number, halfHeight?: number);

*
* @return {PIXI.Ellipse} a copy of the ellipse
* @return {PIXI.Ellipse} A copy of the ellipse
*/

@@ -87,5 +104,5 @@ clone(): Ellipse;

*
* @param {number} x - The X coordinate of the point to test
* @param {number} y - The Y coordinate of the point to test
* @return {boolean} Whether the x/y coords are within this ellipse
* @param x - The X coordinate of the point to test
* @param y - The Y coordinate of the point to test
* @return Whether the x/y coords are within this ellipse
*/

@@ -96,3 +113,3 @@ contains(x: number, y: number): boolean;

*
* @return {PIXI.Rectangle} the framing rectangle
* @return The framing rectangle
*/

@@ -370,20 +387,26 @@ getBounds(): Rectangle;

* ```
* @class
*
* @memberof PIXI
*/
export declare class Matrix {
/** @default 1 */
a: number;
/** @default 0 */
b: number;
/** @default 0 */
c: number;
/** @default 1 */
d: number;
/** @default 0 */
tx: number;
/** @default 0 */
ty: number;
array: Float32Array | null;
/**
* @param {number} [a=1] - x scale
* @param {number} [b=0] - y skew
* @param {number} [c=0] - x skew
* @param {number} [d=1] - y scale
* @param {number} [tx=0] - x translation
* @param {number} [ty=0] - y translation
* @param a - x scale
* @param b - y skew
* @param c - x skew
* @param d - y scale
* @param tx - x translation
* @param ty - y translation
*/

@@ -401,16 +424,15 @@ constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number);

*
* @param {number[]} array - The array that the matrix will be populated from.
* @param array - The array that the matrix will be populated from.
*/
fromArray(array: number[]): void;
/**
* sets the matrix properties
* Sets the matrix properties.
*
* @param {number} a - Matrix component
* @param {number} b - Matrix component
* @param {number} c - Matrix component
* @param {number} d - Matrix component
* @param {number} tx - Matrix component
* @param {number} ty - Matrix component
*
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param a - Matrix component
* @param b - Matrix component
* @param c - Matrix component
* @param d - Matrix component
* @param tx - Matrix component
* @param ty - Matrix component
* @return This matrix. Good for chaining method calls.
*/

@@ -421,5 +443,5 @@ set(a: number, b: number, c: number, d: number, tx: number, ty: number): this;

*
* @param {boolean} transpose - Whether we need to transpose the matrix or not
* @param {Float32Array} [out=new Float32Array(9)] - If provided the array will be assigned to out
* @return {number[]} the newly created array which contains the matrix
* @param transpose - Whether we need to transpose the matrix or not
* @param [out=new Float32Array(9)] - If provided the array will be assigned to out
* @return The newly created array which contains the matrix
*/

@@ -431,3 +453,3 @@ toArray(transpose: boolean, out?: Float32Array): Float32Array;

*
* @param {PIXI.IPointData} pos - The origin
* @param pos - The origin
* @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)

@@ -441,3 +463,3 @@ * @return {PIXI.Point} The new point, transformed through this matrix

*
* @param {PIXI.IPointData} pos - The origin
* @param pos - The origin
* @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)

@@ -450,5 +472,5 @@ * @return {PIXI.Point} The new point, inverse-transformed through this matrix

*
* @param {number} x - How much to translate x by
* @param {number} y - How much to translate y by
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param x - How much to translate x by
* @param y - How much to translate y by
* @return This matrix. Good for chaining method calls.
*/

@@ -459,5 +481,5 @@ translate(x: number, y: number): this;

*
* @param {number} x - The amount to scale horizontally
* @param {number} y - The amount to scale vertically
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param x - The amount to scale horizontally
* @param y - The amount to scale vertically
* @return This matrix. Good for chaining method calls.
*/

@@ -468,4 +490,4 @@ scale(x: number, y: number): this;

*
* @param {number} angle - The angle in radians.
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param angle - The angle in radians.
* @return This matrix. Good for chaining method calls.
*/

@@ -476,4 +498,4 @@ rotate(angle: number): this;

*
* @param {PIXI.Matrix} matrix - The matrix to append.
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param matrix - The matrix to append.
* @return This matrix. Good for chaining method calls.
*/

@@ -484,12 +506,12 @@ append(matrix: Matrix): this;

*
* @param {number} x - Position on the x axis
* @param {number} y - Position on the y axis
* @param {number} pivotX - Pivot on the x axis
* @param {number} pivotY - Pivot on the y axis
* @param {number} scaleX - Scale on the x axis
* @param {number} scaleY - Scale on the y axis
* @param {number} rotation - Rotation in radians
* @param {number} skewX - Skew on the x axis
* @param {number} skewY - Skew on the y axis
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param x - Position on the x axis
* @param y - Position on the y axis
* @param pivotX - Pivot on the x axis
* @param pivotY - Pivot on the y axis
* @param scaleX - Scale on the x axis
* @param scaleY - Scale on the y axis
* @param rotation - Rotation in radians
* @param skewX - Skew on the x axis
* @param skewY - Skew on the y axis
* @return This matrix. Good for chaining method calls.
*/

@@ -500,4 +522,4 @@ setTransform(x: number, y: number, pivotX: number, pivotY: number, scaleX: number, scaleY: number, rotation: number, skewX: number, skewY: number): this;

*
* @param {PIXI.Matrix} matrix - The matrix to prepend
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @param matrix - The matrix to prepend
* @return This matrix. Good for chaining method calls.
*/

@@ -508,4 +530,4 @@ prepend(matrix: Matrix): this;

*
* @param {PIXI.Transform} transform - The transform to apply the properties to.
* @return {PIXI.Transform} The transform with the newly applied properties
* @param transform - The transform to apply the properties to.
* @return The transform with the newly applied properties
*/

@@ -516,3 +538,3 @@ decompose(transform: Transform): Transform;

*
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @return This matrix. Good for chaining method calls.
*/

@@ -523,3 +545,3 @@ invert(): this;

*
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
* @return This matrix. Good for chaining method calls.
*/

@@ -530,3 +552,3 @@ identity(): this;

*
* @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls.
* @return A copy of this matrix. Good for chaining method calls.
*/

@@ -537,4 +559,4 @@ clone(): Matrix;

*
* @param {PIXI.Matrix} matrix - The matrix to copy to.
* @return {PIXI.Matrix} The matrix given in parameter with its values updated.
* @param matrix - The matrix to copy to.
* @return The matrix given in parameter with its values updated.
*/

@@ -553,5 +575,3 @@ copyTo(matrix: Matrix): Matrix;

*
* @static
* @const
* @member {PIXI.Matrix}
* @readonly
*/

@@ -562,5 +582,3 @@ static get IDENTITY(): Matrix;

*
* @static
* @const
* @member {PIXI.Matrix}
* @readonly
*/

@@ -579,5 +597,3 @@ static get TEMP_MATRIX(): Matrix;

*
* @class
* @memberof PIXI
* @implements IPoint
*/

@@ -642,10 +658,6 @@ export declare class ObservablePoint<T = any> implements IPoint {

toString(): string;
/** Position of the observable point on the x axis
* @type {number}
*/
/** Position of the observable point on the x axis. */
get x(): number;
set x(value: number);
/** Position of the observable point on the y axis
* @type {number}
*/
/** Position of the observable point on the y axis. */
get y(): number;

@@ -949,48 +961,64 @@ set y(value: number);

/**
* Transform that takes care about its versions
* Transform that takes care about its versions.
*
* @class
* @memberof PIXI
*/
export declare class Transform {
/**
* A default (identity) transform
*
* @static
* @constant
* @member {PIXI.Transform}
*/
/** A default (identity) transform. */
static readonly IDENTITY: Transform;
/** The world transformation matrix. */
worldTransform: Matrix;
/** The local transformation matrix. */
localTransform: Matrix;
/** The coordinate of the object relative to the local coordinates of the parent. */
position: ObservablePoint;
/** The scale factor of the object. */
scale: ObservablePoint;
/** The pivot point of the displayObject that it rotates around. */
pivot: ObservablePoint;
/** The skew amount, on the x and y axis. */
skew: ObservablePoint;
/**
* The locally unique ID of the parent's world transform
* used to calculate the current world transformation matrix.
*/
_parentID: number;
/** The locally unique ID of the world transform. */
_worldID: number;
/** The rotation amount. */
protected _rotation: number;
/**
* The X-coordinate value of the normalized local X axis,
* the first column of the local transformation matrix without a scale.
*/
protected _cx: number;
/**
* The Y-coordinate value of the normalized local X axis,
* the first column of the local transformation matrix without a scale.
*/
protected _sx: number;
/**
* The X-coordinate value of the normalized local Y axis,
* the second column of the local transformation matrix without a scale.
*/
protected _cy: number;
/**
* The Y-coordinate value of the normalized local Y axis,
* the second column of the local transformation matrix without a scale.
*/
protected _sy: number;
/** The locally unique ID of the local transform. */
protected _localID: number;
/**
* The locally unique ID of the local transform
* used to calculate the current local transformation matrix.
*/
protected _currentLocalID: number;
constructor();
/**
* Called when a value changes.
*
* @protected
*/
/** Called when a value changes. */
protected onChange(): void;
/**
* Called when the skew or the rotation changes.
*
* @protected
*/
/** Called when the skew or the rotation changes. */
protected updateSkew(): void;
toString(): string;
/**
* Updates the local transformation matrix.
*/
/** Updates the local transformation matrix. */
updateLocalTransform(): void;

@@ -1000,3 +1028,3 @@ /**

*
* @param {PIXI.Transform} parentTransform - The parent transform
* @param parentTransform - The parent transform
*/

@@ -1007,10 +1035,6 @@ updateTransform(parentTransform: Transform): void;

*
* @param {PIXI.Matrix} matrix - The matrix to decompose
* @param matrix - The matrix to decompose
*/
setFromMatrix(matrix: Matrix): void;
/**
* The rotation of the object in radians.
*
* @member {number}
*/
/** The rotation of the object in radians. */
get rotation(): number;

@@ -1017,0 +1041,0 @@ set rotation(value: number);

{
"name": "@pixi/math",
"version": "6.1.3",
"version": "6.2.0",
"main": "dist/cjs/math.js",

@@ -27,3 +27,3 @@ "module": "dist/esm/math.js",

],
"gitHead": "2342b551124751206078602eb0e4408df230923e"
"gitHead": "793f21c0d0f2d2a423bd4339f40a569e1ea68711"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc