This commit is contained in:
Akko
2025-08-04 18:57:35 +02:00
parent 8cf6e78a79
commit 9495868c2e
5030 changed files with 518594 additions and 17609 deletions

View File

@@ -0,0 +1,73 @@
import type { PointData } from './PointData';
import type { PointLike } from './PointLike';
export interface ObservablePoint extends PixiMixins.ObservablePoint {
}
/**
* Observer used to listen for observable point changes.
* @memberof maths
*/
export interface Observer<T> {
/** Callback to call when the point has updated. */
_onUpdate: (point?: T) => void;
}
/**
* The ObservablePoint object represents a location in a two-dimensional coordinate system, where `x` represents
* the position on the horizontal axis and `y` represents the position on the vertical axis.
*
* An `ObservablePoint` is a point that triggers the `onUpdate` method on an observer when the point's position is changed.
* @memberof maths
*/
export declare class ObservablePoint implements PointLike {
/** @ignore */
_x: number;
/** @ignore */
_y: number;
/** This object used to call the `onUpdate` callback when the point changes. */
private readonly _observer;
/**
* Creates a new `ObservablePoint`
* @param observer - Observer to pass to listen for change events.
* @param {number} [x=0] - position of the point on the x axis
* @param {number} [y=0] - position of the point on the y axis
*/
constructor(observer: Observer<ObservablePoint>, x?: number, y?: number);
/**
* Creates a clone of this point.
* @param observer - Optional observer to pass to the new observable point.
* @returns a copy of this observable point
*/
clone(observer?: Observer<ObservablePoint>): ObservablePoint;
/**
* Sets the point to a new `x` and `y` position.
* If `y` is omitted, both `x` and `y` will be set to `x`.
* @param {number} [x=0] - position of the point on the x axis
* @param {number} [y=x] - position of the point on the y axis
* @returns The observable point instance itself
*/
set(x?: number, y?: number): this;
/**
* Copies x and y from the given point (`p`)
* @param p - The point to copy from. Can be any of type that is or extends `PointData`
* @returns The observable point instance itself
*/
copyFrom(p: PointData): this;
/**
* Copies this point's x and y into that of the given point (`p`)
* @param p - The point to copy to. Can be any of type that is or extends `PointData`
* @returns The point (`p`) with values updated
*/
copyTo<T extends PointLike>(p: T): T;
/**
* Accepts another point (`p`) and returns `true` if the given point is equal to this point
* @param p - The point to check
* @returns Returns `true` if both `x` and `y` are equal
*/
equals(p: PointData): boolean;
toString(): string;
/** 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. */
get y(): number;
set y(value: number);
}

View File

@@ -0,0 +1,95 @@
'use strict';
"use strict";
class ObservablePoint {
/**
* Creates a new `ObservablePoint`
* @param observer - Observer to pass to listen for change events.
* @param {number} [x=0] - position of the point on the x axis
* @param {number} [y=0] - position of the point on the y axis
*/
constructor(observer, x, y) {
this._x = x || 0;
this._y = y || 0;
this._observer = observer;
}
/**
* Creates a clone of this point.
* @param observer - Optional observer to pass to the new observable point.
* @returns a copy of this observable point
*/
clone(observer) {
return new ObservablePoint(observer ?? this._observer, this._x, this._y);
}
/**
* Sets the point to a new `x` and `y` position.
* If `y` is omitted, both `x` and `y` will be set to `x`.
* @param {number} [x=0] - position of the point on the x axis
* @param {number} [y=x] - position of the point on the y axis
* @returns The observable point instance itself
*/
set(x = 0, y = x) {
if (this._x !== x || this._y !== y) {
this._x = x;
this._y = y;
this._observer._onUpdate(this);
}
return this;
}
/**
* Copies x and y from the given point (`p`)
* @param p - The point to copy from. Can be any of type that is or extends `PointData`
* @returns The observable point instance itself
*/
copyFrom(p) {
if (this._x !== p.x || this._y !== p.y) {
this._x = p.x;
this._y = p.y;
this._observer._onUpdate(this);
}
return this;
}
/**
* Copies this point's x and y into that of the given point (`p`)
* @param p - The point to copy to. Can be any of type that is or extends `PointData`
* @returns The point (`p`) with values updated
*/
copyTo(p) {
p.set(this._x, this._y);
return p;
}
/**
* Accepts another point (`p`) and returns `true` if the given point is equal to this point
* @param p - The point to check
* @returns Returns `true` if both `x` and `y` are equal
*/
equals(p) {
return p.x === this._x && p.y === this._y;
}
toString() {
return `[pixi.js/math:ObservablePoint x=${0} y=${0} scope=${this._observer}]`;
}
/** Position of the observable point on the x axis. */
get x() {
return this._x;
}
set x(value) {
if (this._x !== value) {
this._x = value;
this._observer._onUpdate(this);
}
}
/** Position of the observable point on the y axis. */
get y() {
return this._y;
}
set y(value) {
if (this._y !== value) {
this._y = value;
this._observer._onUpdate(this);
}
}
}
exports.ObservablePoint = ObservablePoint;
//# sourceMappingURL=ObservablePoint.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,93 @@
"use strict";
class ObservablePoint {
/**
* Creates a new `ObservablePoint`
* @param observer - Observer to pass to listen for change events.
* @param {number} [x=0] - position of the point on the x axis
* @param {number} [y=0] - position of the point on the y axis
*/
constructor(observer, x, y) {
this._x = x || 0;
this._y = y || 0;
this._observer = observer;
}
/**
* Creates a clone of this point.
* @param observer - Optional observer to pass to the new observable point.
* @returns a copy of this observable point
*/
clone(observer) {
return new ObservablePoint(observer ?? this._observer, this._x, this._y);
}
/**
* Sets the point to a new `x` and `y` position.
* If `y` is omitted, both `x` and `y` will be set to `x`.
* @param {number} [x=0] - position of the point on the x axis
* @param {number} [y=x] - position of the point on the y axis
* @returns The observable point instance itself
*/
set(x = 0, y = x) {
if (this._x !== x || this._y !== y) {
this._x = x;
this._y = y;
this._observer._onUpdate(this);
}
return this;
}
/**
* Copies x and y from the given point (`p`)
* @param p - The point to copy from. Can be any of type that is or extends `PointData`
* @returns The observable point instance itself
*/
copyFrom(p) {
if (this._x !== p.x || this._y !== p.y) {
this._x = p.x;
this._y = p.y;
this._observer._onUpdate(this);
}
return this;
}
/**
* Copies this point's x and y into that of the given point (`p`)
* @param p - The point to copy to. Can be any of type that is or extends `PointData`
* @returns The point (`p`) with values updated
*/
copyTo(p) {
p.set(this._x, this._y);
return p;
}
/**
* Accepts another point (`p`) and returns `true` if the given point is equal to this point
* @param p - The point to check
* @returns Returns `true` if both `x` and `y` are equal
*/
equals(p) {
return p.x === this._x && p.y === this._y;
}
toString() {
return `[pixi.js/math:ObservablePoint x=${0} y=${0} scope=${this._observer}]`;
}
/** Position of the observable point on the x axis. */
get x() {
return this._x;
}
set x(value) {
if (this._x !== value) {
this._x = value;
this._observer._onUpdate(this);
}
}
/** Position of the observable point on the y axis. */
get y() {
return this._y;
}
set y(value) {
if (this._y !== value) {
this._y = value;
this._observer._onUpdate(this);
}
}
}
export { ObservablePoint };
//# sourceMappingURL=ObservablePoint.mjs.map

File diff suppressed because one or more lines are too long

63
node_modules/pixi.js/lib/maths/point/Point.d.ts generated vendored Normal file
View File

@@ -0,0 +1,63 @@
import type { PointData } from './PointData';
import type { PointLike } from './PointLike';
export interface Point extends PixiMixins.Point {
}
/**
* The Point object represents a location in a two-dimensional coordinate system, where `x` represents
* the position on the horizontal axis and `y` represents the position on the vertical axis.
* <br/>
* Many Pixi functions accept the `PointData` type as an alternative to `Point`,
* which only requires `x` and `y` properties.
* @class
* @implements {PointLike}
* @memberof maths
*/
export declare class Point implements PointLike {
/** Position of the point on the x axis */
x: number;
/** Position of the point on the y axis */
y: number;
/**
* Creates a new `Point`
* @param {number} [x=0] - position of the point on the x axis
* @param {number} [y=0] - position of the point on the y axis
*/
constructor(x?: number, y?: number);
/**
* Creates a clone of this point
* @returns A clone of this point
*/
clone(): Point;
/**
* Copies `x` and `y` from the given point into this point
* @param p - The point to copy from
* @returns The point instance itself
*/
copyFrom(p: PointData): this;
/**
* Copies this point's x and y into the given point (`p`).
* @param p - The point to copy to. Can be any of type that is or extends `PointData`
* @returns The point (`p`) with values updated
*/
copyTo<T extends PointLike>(p: T): T;
/**
* Accepts another point (`p`) and returns `true` if the given point is equal to this point
* @param p - The point to check
* @returns Returns `true` if both `x` and `y` are equal
*/
equals(p: PointData): boolean;
/**
* Sets the point to a new `x` and `y` position.
* If `y` is omitted, both `x` and `y` will be set to `x`.
* @param {number} [x=0] - position of the point on the `x` axis
* @param {number} [y=x] - position of the point on the `y` axis
* @returns The point instance itself
*/
set(x?: number, y?: number): this;
toString(): string;
/**
* A static Point object with `x` and `y` values of `0`. Can be used to avoid creating new objects multiple times.
* @readonly
*/
static get shared(): Point;
}

79
node_modules/pixi.js/lib/maths/point/Point.js generated vendored Normal file
View File

@@ -0,0 +1,79 @@
'use strict';
"use strict";
class Point {
/**
* Creates a new `Point`
* @param {number} [x=0] - position of the point on the x axis
* @param {number} [y=0] - position of the point on the y axis
*/
constructor(x = 0, y = 0) {
/** Position of the point on the x axis */
this.x = 0;
/** Position of the point on the y axis */
this.y = 0;
this.x = x;
this.y = y;
}
/**
* Creates a clone of this point
* @returns A clone of this point
*/
clone() {
return new Point(this.x, this.y);
}
/**
* Copies `x` and `y` from the given point into this point
* @param p - The point to copy from
* @returns The point instance itself
*/
copyFrom(p) {
this.set(p.x, p.y);
return this;
}
/**
* Copies this point's x and y into the given point (`p`).
* @param p - The point to copy to. Can be any of type that is or extends `PointData`
* @returns The point (`p`) with values updated
*/
copyTo(p) {
p.set(this.x, this.y);
return p;
}
/**
* Accepts another point (`p`) and returns `true` if the given point is equal to this point
* @param p - The point to check
* @returns Returns `true` if both `x` and `y` are equal
*/
equals(p) {
return p.x === this.x && p.y === this.y;
}
/**
* Sets the point to a new `x` and `y` position.
* If `y` is omitted, both `x` and `y` will be set to `x`.
* @param {number} [x=0] - position of the point on the `x` axis
* @param {number} [y=x] - position of the point on the `y` axis
* @returns The point instance itself
*/
set(x = 0, y = x) {
this.x = x;
this.y = y;
return this;
}
toString() {
return `[pixi.js/math:Point x=${this.x} y=${this.y}]`;
}
/**
* A static Point object with `x` and `y` values of `0`. Can be used to avoid creating new objects multiple times.
* @readonly
*/
static get shared() {
tempPoint.x = 0;
tempPoint.y = 0;
return tempPoint;
}
}
const tempPoint = new Point();
exports.Point = Point;
//# sourceMappingURL=Point.js.map

1
node_modules/pixi.js/lib/maths/point/Point.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Point.js","sources":["../../../src/maths/point/Point.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-use-before-define */\nimport type { PointData } from './PointData';\nimport type { PointLike } from './PointLike';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface Point extends PixiMixins.Point { }\n\n/**\n * The Point object represents a location in a two-dimensional coordinate system, where `x` represents\n * the position on the horizontal axis and `y` represents the position on the vertical axis.\n * <br/>\n * Many Pixi functions accept the `PointData` type as an alternative to `Point`,\n * which only requires `x` and `y` properties.\n * @class\n * @implements {PointLike}\n * @memberof maths\n */\nexport class Point implements PointLike\n{\n /** Position of the point on the x axis */\n public x = 0;\n /** Position of the point on the y axis */\n public y = 0;\n\n /**\n * Creates a new `Point`\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n constructor(x = 0, y = 0)\n {\n this.x = x;\n this.y = y;\n }\n\n /**\n * Creates a clone of this point\n * @returns A clone of this point\n */\n public clone(): Point\n {\n return new Point(this.x, this.y);\n }\n\n /**\n * Copies `x` and `y` from the given point into this point\n * @param p - The point to copy from\n * @returns The point instance itself\n */\n public copyFrom(p: PointData): this\n {\n this.set(p.x, p.y);\n\n return this;\n }\n\n /**\n * Copies this point's x and y into the given point (`p`).\n * @param p - The point to copy to. Can be any of type that is or extends `PointData`\n * @returns The point (`p`) with values updated\n */\n public copyTo<T extends PointLike>(p: T): T\n {\n p.set(this.x, this.y);\n\n return p;\n }\n\n /**\n * Accepts another point (`p`) and returns `true` if the given point is equal to this point\n * @param p - The point to check\n * @returns Returns `true` if both `x` and `y` are equal\n */\n public equals(p: PointData): boolean\n {\n return (p.x === this.x) && (p.y === this.y);\n }\n\n /**\n * Sets the point to a new `x` and `y` position.\n * If `y` is omitted, both `x` and `y` will be set to `x`.\n * @param {number} [x=0] - position of the point on the `x` axis\n * @param {number} [y=x] - position of the point on the `y` axis\n * @returns The point instance itself\n */\n public set(x = 0, y: number = x): this\n {\n this.x = x;\n this.y = y;\n\n return this;\n }\n\n // #if _DEBUG\n public toString(): string\n {\n return `[pixi.js/math:Point x=${this.x} y=${this.y}]`;\n }\n // #endif\n\n /**\n * A static Point object with `x` and `y` values of `0`. Can be used to avoid creating new objects multiple times.\n * @readonly\n */\n static get shared(): Point\n {\n tempPoint.x = 0;\n tempPoint.y = 0;\n\n return tempPoint;\n }\n}\n\nconst tempPoint = new Point();\n"],"names":[],"mappings":";;;AAiBO,MAAM,KACb,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWI,WAAY,CAAA,CAAA,GAAI,CAAG,EAAA,CAAA,GAAI,CACvB,EAAA;AAVA;AAAA,IAAA,IAAA,CAAO,CAAI,GAAA,CAAA,CAAA;AAEX;AAAA,IAAA,IAAA,CAAO,CAAI,GAAA,CAAA,CAAA;AASP,IAAA,IAAA,CAAK,CAAI,GAAA,CAAA,CAAA;AACT,IAAA,IAAA,CAAK,CAAI,GAAA,CAAA,CAAA;AAAA,GACb;AAAA;AAAA;AAAA;AAAA;AAAA,EAMO,KACP,GAAA;AACI,IAAA,OAAO,IAAI,KAAA,CAAM,IAAK,CAAA,CAAA,EAAG,KAAK,CAAC,CAAA,CAAA;AAAA,GACnC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,SAAS,CAChB,EAAA;AACI,IAAA,IAAA,CAAK,GAAI,CAAA,CAAA,CAAE,CAAG,EAAA,CAAA,CAAE,CAAC,CAAA,CAAA;AAEjB,IAAO,OAAA,IAAA,CAAA;AAAA,GACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,OAA4B,CACnC,EAAA;AACI,IAAA,CAAA,CAAE,GAAI,CAAA,IAAA,CAAK,CAAG,EAAA,IAAA,CAAK,CAAC,CAAA,CAAA;AAEpB,IAAO,OAAA,CAAA,CAAA;AAAA,GACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,OAAO,CACd,EAAA;AACI,IAAA,OAAQ,EAAE,CAAM,KAAA,IAAA,CAAK,CAAO,IAAA,CAAA,CAAE,MAAM,IAAK,CAAA,CAAA,CAAA;AAAA,GAC7C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,GAAI,CAAA,CAAA,GAAI,CAAG,EAAA,CAAA,GAAY,CAC9B,EAAA;AACI,IAAA,IAAA,CAAK,CAAI,GAAA,CAAA,CAAA;AACT,IAAA,IAAA,CAAK,CAAI,GAAA,CAAA,CAAA;AAET,IAAO,OAAA,IAAA,CAAA;AAAA,GACX;AAAA,EAGO,QACP,GAAA;AACI,IAAA,OAAO,CAAyB,sBAAA,EAAA,IAAA,CAAK,CAAC,CAAA,GAAA,EAAM,KAAK,CAAC,CAAA,CAAA,CAAA,CAAA;AAAA,GACtD;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,WAAW,MACX,GAAA;AACI,IAAA,SAAA,CAAU,CAAI,GAAA,CAAA,CAAA;AACd,IAAA,SAAA,CAAU,CAAI,GAAA,CAAA,CAAA;AAEd,IAAO,OAAA,SAAA,CAAA;AAAA,GACX;AACJ,CAAA;AAEA,MAAM,SAAA,GAAY,IAAI,KAAM,EAAA;;;;"}

77
node_modules/pixi.js/lib/maths/point/Point.mjs generated vendored Normal file
View File

@@ -0,0 +1,77 @@
"use strict";
class Point {
/**
* Creates a new `Point`
* @param {number} [x=0] - position of the point on the x axis
* @param {number} [y=0] - position of the point on the y axis
*/
constructor(x = 0, y = 0) {
/** Position of the point on the x axis */
this.x = 0;
/** Position of the point on the y axis */
this.y = 0;
this.x = x;
this.y = y;
}
/**
* Creates a clone of this point
* @returns A clone of this point
*/
clone() {
return new Point(this.x, this.y);
}
/**
* Copies `x` and `y` from the given point into this point
* @param p - The point to copy from
* @returns The point instance itself
*/
copyFrom(p) {
this.set(p.x, p.y);
return this;
}
/**
* Copies this point's x and y into the given point (`p`).
* @param p - The point to copy to. Can be any of type that is or extends `PointData`
* @returns The point (`p`) with values updated
*/
copyTo(p) {
p.set(this.x, this.y);
return p;
}
/**
* Accepts another point (`p`) and returns `true` if the given point is equal to this point
* @param p - The point to check
* @returns Returns `true` if both `x` and `y` are equal
*/
equals(p) {
return p.x === this.x && p.y === this.y;
}
/**
* Sets the point to a new `x` and `y` position.
* If `y` is omitted, both `x` and `y` will be set to `x`.
* @param {number} [x=0] - position of the point on the `x` axis
* @param {number} [y=x] - position of the point on the `y` axis
* @returns The point instance itself
*/
set(x = 0, y = x) {
this.x = x;
this.y = y;
return this;
}
toString() {
return `[pixi.js/math:Point x=${this.x} y=${this.y}]`;
}
/**
* A static Point object with `x` and `y` values of `0`. Can be used to avoid creating new objects multiple times.
* @readonly
*/
static get shared() {
tempPoint.x = 0;
tempPoint.y = 0;
return tempPoint;
}
}
const tempPoint = new Point();
export { Point };
//# sourceMappingURL=Point.mjs.map

1
node_modules/pixi.js/lib/maths/point/Point.mjs.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Point.mjs","sources":["../../../src/maths/point/Point.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-use-before-define */\nimport type { PointData } from './PointData';\nimport type { PointLike } from './PointLike';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface Point extends PixiMixins.Point { }\n\n/**\n * The Point object represents a location in a two-dimensional coordinate system, where `x` represents\n * the position on the horizontal axis and `y` represents the position on the vertical axis.\n * <br/>\n * Many Pixi functions accept the `PointData` type as an alternative to `Point`,\n * which only requires `x` and `y` properties.\n * @class\n * @implements {PointLike}\n * @memberof maths\n */\nexport class Point implements PointLike\n{\n /** Position of the point on the x axis */\n public x = 0;\n /** Position of the point on the y axis */\n public y = 0;\n\n /**\n * Creates a new `Point`\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n constructor(x = 0, y = 0)\n {\n this.x = x;\n this.y = y;\n }\n\n /**\n * Creates a clone of this point\n * @returns A clone of this point\n */\n public clone(): Point\n {\n return new Point(this.x, this.y);\n }\n\n /**\n * Copies `x` and `y` from the given point into this point\n * @param p - The point to copy from\n * @returns The point instance itself\n */\n public copyFrom(p: PointData): this\n {\n this.set(p.x, p.y);\n\n return this;\n }\n\n /**\n * Copies this point's x and y into the given point (`p`).\n * @param p - The point to copy to. Can be any of type that is or extends `PointData`\n * @returns The point (`p`) with values updated\n */\n public copyTo<T extends PointLike>(p: T): T\n {\n p.set(this.x, this.y);\n\n return p;\n }\n\n /**\n * Accepts another point (`p`) and returns `true` if the given point is equal to this point\n * @param p - The point to check\n * @returns Returns `true` if both `x` and `y` are equal\n */\n public equals(p: PointData): boolean\n {\n return (p.x === this.x) && (p.y === this.y);\n }\n\n /**\n * Sets the point to a new `x` and `y` position.\n * If `y` is omitted, both `x` and `y` will be set to `x`.\n * @param {number} [x=0] - position of the point on the `x` axis\n * @param {number} [y=x] - position of the point on the `y` axis\n * @returns The point instance itself\n */\n public set(x = 0, y: number = x): this\n {\n this.x = x;\n this.y = y;\n\n return this;\n }\n\n // #if _DEBUG\n public toString(): string\n {\n return `[pixi.js/math:Point x=${this.x} y=${this.y}]`;\n }\n // #endif\n\n /**\n * A static Point object with `x` and `y` values of `0`. Can be used to avoid creating new objects multiple times.\n * @readonly\n */\n static get shared(): Point\n {\n tempPoint.x = 0;\n tempPoint.y = 0;\n\n return tempPoint;\n }\n}\n\nconst tempPoint = new Point();\n"],"names":[],"mappings":";AAiBO,MAAM,KACb,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWI,WAAY,CAAA,CAAA,GAAI,CAAG,EAAA,CAAA,GAAI,CACvB,EAAA;AAVA;AAAA,IAAA,IAAA,CAAO,CAAI,GAAA,CAAA,CAAA;AAEX;AAAA,IAAA,IAAA,CAAO,CAAI,GAAA,CAAA,CAAA;AASP,IAAA,IAAA,CAAK,CAAI,GAAA,CAAA,CAAA;AACT,IAAA,IAAA,CAAK,CAAI,GAAA,CAAA,CAAA;AAAA,GACb;AAAA;AAAA;AAAA;AAAA;AAAA,EAMO,KACP,GAAA;AACI,IAAA,OAAO,IAAI,KAAA,CAAM,IAAK,CAAA,CAAA,EAAG,KAAK,CAAC,CAAA,CAAA;AAAA,GACnC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,SAAS,CAChB,EAAA;AACI,IAAA,IAAA,CAAK,GAAI,CAAA,CAAA,CAAE,CAAG,EAAA,CAAA,CAAE,CAAC,CAAA,CAAA;AAEjB,IAAO,OAAA,IAAA,CAAA;AAAA,GACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,OAA4B,CACnC,EAAA;AACI,IAAA,CAAA,CAAE,GAAI,CAAA,IAAA,CAAK,CAAG,EAAA,IAAA,CAAK,CAAC,CAAA,CAAA;AAEpB,IAAO,OAAA,CAAA,CAAA;AAAA,GACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,OAAO,CACd,EAAA;AACI,IAAA,OAAQ,EAAE,CAAM,KAAA,IAAA,CAAK,CAAO,IAAA,CAAA,CAAE,MAAM,IAAK,CAAA,CAAA,CAAA;AAAA,GAC7C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,GAAI,CAAA,CAAA,GAAI,CAAG,EAAA,CAAA,GAAY,CAC9B,EAAA;AACI,IAAA,IAAA,CAAK,CAAI,GAAA,CAAA,CAAA;AACT,IAAA,IAAA,CAAK,CAAI,GAAA,CAAA,CAAA;AAET,IAAO,OAAA,IAAA,CAAA;AAAA,GACX;AAAA,EAGO,QACP,GAAA;AACI,IAAA,OAAO,CAAyB,sBAAA,EAAA,IAAA,CAAK,CAAC,CAAA,GAAA,EAAM,KAAK,CAAC,CAAA,CAAA,CAAA,CAAA;AAAA,GACtD;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,WAAW,MACX,GAAA;AACI,IAAA,SAAA,CAAU,CAAI,GAAA,CAAA,CAAA;AACd,IAAA,SAAA,CAAU,CAAI,GAAA,CAAA,CAAA;AAEd,IAAO,OAAA,SAAA,CAAA;AAAA,GACX;AACJ,CAAA;AAEA,MAAM,SAAA,GAAY,IAAI,KAAM,EAAA;;;;"}

10
node_modules/pixi.js/lib/maths/point/PointData.d.ts generated vendored Normal file
View File

@@ -0,0 +1,10 @@
/**
* Common interface for points. Both Point and ObservablePoint implement it
* @memberof maths
*/
export interface PointData {
/** X coord */
x: number;
/** Y coord */
y: number;
}

4
node_modules/pixi.js/lib/maths/point/PointData.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
'use strict';
"use strict";
//# sourceMappingURL=PointData.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"PointData.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}

2
node_modules/pixi.js/lib/maths/point/PointData.mjs generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";
//# sourceMappingURL=PointData.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"PointData.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}

32
node_modules/pixi.js/lib/maths/point/PointLike.d.ts generated vendored Normal file
View File

@@ -0,0 +1,32 @@
import type { PointData } from './PointData';
/**
* Common interface for points. Both Point and ObservablePoint implement it
* @memberof maths
*/
export interface PointLike extends PointData {
/**
* Copies x and y from the given point
* @param {PointData} p - The point to copy from
* @returns {this} Returns itself.
*/
copyFrom: (p: PointData) => this;
/**
* Copies x and y into the given point
* @param {PointLike} p - The point to copy.
* @returns {PointLike} Given point with values updated
*/
copyTo: <T extends PointLike>(p: T) => T;
/**
* Returns true if the given point is equal to this point
* @param {PointData} p - The point to check
* @returns {boolean} Whether the given point equal to this point
*/
equals: (p: PointData) => boolean;
/**
* Sets the point to a new x and y position.
* If y is omitted, both x and y will be set to x.
* @param {number} [x=0] - position of the point on the x axis
* @param {number} [y=x] - position of the point on the y axis
*/
set: (x?: number, y?: number) => void;
}

4
node_modules/pixi.js/lib/maths/point/PointLike.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
'use strict';
"use strict";
//# sourceMappingURL=PointLike.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"PointLike.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}

2
node_modules/pixi.js/lib/maths/point/PointLike.mjs generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";
//# sourceMappingURL=PointLike.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"PointLike.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}

View File

@@ -0,0 +1,13 @@
/**
* Check if a point is inside a triangle.
* @param px - x coordinate of the point
* @param py - y coordinate of the point
* @param x1 - x coordinate of the first vertex of the triangle
* @param y1 - y coordinate of the first vertex of the triangle
* @param x2 - x coordinate of the second vertex of the triangle
* @param y2 - y coordinate of the second vertex of the triangle
* @param x3 - x coordinate of the third vertex of the triangle
* @param y3 - y coordinate of the third vertex of the triangle
* @returns `true` if the point is inside the triangle, `false` otherwise
*/
export declare function pointInTriangle(px: number, py: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): boolean;

View File

@@ -0,0 +1,23 @@
'use strict';
"use strict";
function pointInTriangle(px, py, x1, y1, x2, y2, x3, y3) {
const v2x = x3 - x1;
const v2y = y3 - y1;
const v1x = x2 - x1;
const v1y = y2 - y1;
const v0x = px - x1;
const v0y = py - y1;
const dot00 = v2x * v2x + v2y * v2y;
const dot01 = v2x * v1x + v2y * v1y;
const dot02 = v2x * v0x + v2y * v0y;
const dot11 = v1x * v1x + v1y * v1y;
const dot12 = v1x * v0x + v1y * v0y;
const invDenom = 1 / (dot00 * dot11 - dot01 * dot01);
const u = (dot11 * dot02 - dot01 * dot12) * invDenom;
const v = (dot00 * dot12 - dot01 * dot02) * invDenom;
return u >= 0 && v >= 0 && u + v < 1;
}
exports.pointInTriangle = pointInTriangle;
//# sourceMappingURL=pointInTriangle.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"pointInTriangle.js","sources":["../../../src/maths/point/pointInTriangle.ts"],"sourcesContent":["/**\n * Check if a point is inside a triangle.\n * @param px - x coordinate of the point\n * @param py - y coordinate of the point\n * @param x1 - x coordinate of the first vertex of the triangle\n * @param y1 - y coordinate of the first vertex of the triangle\n * @param x2 - x coordinate of the second vertex of the triangle\n * @param y2 - y coordinate of the second vertex of the triangle\n * @param x3 - x coordinate of the third vertex of the triangle\n * @param y3 - y coordinate of the third vertex of the triangle\n * @returns `true` if the point is inside the triangle, `false` otherwise\n */\nexport function pointInTriangle(\n px: number, py: number,\n x1: number, y1: number,\n x2: number, y2: number,\n x3: number, y3: number\n)\n{\n // Calculate vectors from point p to each vertex of the triangle\n const v2x = x3 - x1;\n const v2y = y3 - y1;\n const v1x = x2 - x1;\n const v1y = y2 - y1;\n const v0x = px - x1;\n const v0y = py - y1;\n\n // Compute dot products\n const dot00 = (v2x * v2x) + (v2y * v2y);\n const dot01 = (v2x * v1x) + (v2y * v1y);\n const dot02 = (v2x * v0x) + (v2y * v0y);\n const dot11 = (v1x * v1x) + (v1y * v1y);\n const dot12 = (v1x * v0x) + (v1y * v0y);\n\n // Calculate barycentric coordinates\n const invDenom = 1 / ((dot00 * dot11) - (dot01 * dot01));\n const u = ((dot11 * dot02) - (dot01 * dot12)) * invDenom;\n const v = ((dot00 * dot12) - (dot01 * dot02)) * invDenom;\n\n // Check if point is in triangle\n return (u >= 0) && (v >= 0) && (u + v < 1);\n}\n"],"names":[],"mappings":";;;AAYgB,SAAA,eAAA,CACZ,IAAY,EACZ,EAAA,EAAA,EAAY,IACZ,EAAY,EAAA,EAAA,EACZ,IAAY,EAEhB,EAAA;AAEI,EAAA,MAAM,MAAM,EAAK,GAAA,EAAA,CAAA;AACjB,EAAA,MAAM,MAAM,EAAK,GAAA,EAAA,CAAA;AACjB,EAAA,MAAM,MAAM,EAAK,GAAA,EAAA,CAAA;AACjB,EAAA,MAAM,MAAM,EAAK,GAAA,EAAA,CAAA;AACjB,EAAA,MAAM,MAAM,EAAK,GAAA,EAAA,CAAA;AACjB,EAAA,MAAM,MAAM,EAAK,GAAA,EAAA,CAAA;AAGjB,EAAM,MAAA,KAAA,GAAS,GAAM,GAAA,GAAA,GAAQ,GAAM,GAAA,GAAA,CAAA;AACnC,EAAM,MAAA,KAAA,GAAS,GAAM,GAAA,GAAA,GAAQ,GAAM,GAAA,GAAA,CAAA;AACnC,EAAM,MAAA,KAAA,GAAS,GAAM,GAAA,GAAA,GAAQ,GAAM,GAAA,GAAA,CAAA;AACnC,EAAM,MAAA,KAAA,GAAS,GAAM,GAAA,GAAA,GAAQ,GAAM,GAAA,GAAA,CAAA;AACnC,EAAM,MAAA,KAAA,GAAS,GAAM,GAAA,GAAA,GAAQ,GAAM,GAAA,GAAA,CAAA;AAGnC,EAAA,MAAM,QAAW,GAAA,CAAA,IAAM,KAAQ,GAAA,KAAA,GAAU,KAAQ,GAAA,KAAA,CAAA,CAAA;AACjD,EAAA,MAAM,CAAM,GAAA,CAAA,KAAA,GAAQ,KAAU,GAAA,KAAA,GAAQ,KAAU,IAAA,QAAA,CAAA;AAChD,EAAA,MAAM,CAAM,GAAA,CAAA,KAAA,GAAQ,KAAU,GAAA,KAAA,GAAQ,KAAU,IAAA,QAAA,CAAA;AAGhD,EAAA,OAAQ,CAAK,IAAA,CAAA,IAAO,CAAK,IAAA,CAAA,IAAO,IAAI,CAAI,GAAA,CAAA,CAAA;AAC5C;;;;"}

View File

@@ -0,0 +1,21 @@
"use strict";
function pointInTriangle(px, py, x1, y1, x2, y2, x3, y3) {
const v2x = x3 - x1;
const v2y = y3 - y1;
const v1x = x2 - x1;
const v1y = y2 - y1;
const v0x = px - x1;
const v0y = py - y1;
const dot00 = v2x * v2x + v2y * v2y;
const dot01 = v2x * v1x + v2y * v1y;
const dot02 = v2x * v0x + v2y * v0y;
const dot11 = v1x * v1x + v1y * v1y;
const dot12 = v1x * v0x + v1y * v0y;
const invDenom = 1 / (dot00 * dot11 - dot01 * dot01);
const u = (dot11 * dot02 - dot01 * dot12) * invDenom;
const v = (dot00 * dot12 - dot01 * dot02) * invDenom;
return u >= 0 && v >= 0 && u + v < 1;
}
export { pointInTriangle };
//# sourceMappingURL=pointInTriangle.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"pointInTriangle.mjs","sources":["../../../src/maths/point/pointInTriangle.ts"],"sourcesContent":["/**\n * Check if a point is inside a triangle.\n * @param px - x coordinate of the point\n * @param py - y coordinate of the point\n * @param x1 - x coordinate of the first vertex of the triangle\n * @param y1 - y coordinate of the first vertex of the triangle\n * @param x2 - x coordinate of the second vertex of the triangle\n * @param y2 - y coordinate of the second vertex of the triangle\n * @param x3 - x coordinate of the third vertex of the triangle\n * @param y3 - y coordinate of the third vertex of the triangle\n * @returns `true` if the point is inside the triangle, `false` otherwise\n */\nexport function pointInTriangle(\n px: number, py: number,\n x1: number, y1: number,\n x2: number, y2: number,\n x3: number, y3: number\n)\n{\n // Calculate vectors from point p to each vertex of the triangle\n const v2x = x3 - x1;\n const v2y = y3 - y1;\n const v1x = x2 - x1;\n const v1y = y2 - y1;\n const v0x = px - x1;\n const v0y = py - y1;\n\n // Compute dot products\n const dot00 = (v2x * v2x) + (v2y * v2y);\n const dot01 = (v2x * v1x) + (v2y * v1y);\n const dot02 = (v2x * v0x) + (v2y * v0y);\n const dot11 = (v1x * v1x) + (v1y * v1y);\n const dot12 = (v1x * v0x) + (v1y * v0y);\n\n // Calculate barycentric coordinates\n const invDenom = 1 / ((dot00 * dot11) - (dot01 * dot01));\n const u = ((dot11 * dot02) - (dot01 * dot12)) * invDenom;\n const v = ((dot00 * dot12) - (dot01 * dot02)) * invDenom;\n\n // Check if point is in triangle\n return (u >= 0) && (v >= 0) && (u + v < 1);\n}\n"],"names":[],"mappings":";AAYgB,SAAA,eAAA,CACZ,IAAY,EACZ,EAAA,EAAA,EAAY,IACZ,EAAY,EAAA,EAAA,EACZ,IAAY,EAEhB,EAAA;AAEI,EAAA,MAAM,MAAM,EAAK,GAAA,EAAA,CAAA;AACjB,EAAA,MAAM,MAAM,EAAK,GAAA,EAAA,CAAA;AACjB,EAAA,MAAM,MAAM,EAAK,GAAA,EAAA,CAAA;AACjB,EAAA,MAAM,MAAM,EAAK,GAAA,EAAA,CAAA;AACjB,EAAA,MAAM,MAAM,EAAK,GAAA,EAAA,CAAA;AACjB,EAAA,MAAM,MAAM,EAAK,GAAA,EAAA,CAAA;AAGjB,EAAM,MAAA,KAAA,GAAS,GAAM,GAAA,GAAA,GAAQ,GAAM,GAAA,GAAA,CAAA;AACnC,EAAM,MAAA,KAAA,GAAS,GAAM,GAAA,GAAA,GAAQ,GAAM,GAAA,GAAA,CAAA;AACnC,EAAM,MAAA,KAAA,GAAS,GAAM,GAAA,GAAA,GAAQ,GAAM,GAAA,GAAA,CAAA;AACnC,EAAM,MAAA,KAAA,GAAS,GAAM,GAAA,GAAA,GAAQ,GAAM,GAAA,GAAA,CAAA;AACnC,EAAM,MAAA,KAAA,GAAS,GAAM,GAAA,GAAA,GAAQ,GAAM,GAAA,GAAA,CAAA;AAGnC,EAAA,MAAM,QAAW,GAAA,CAAA,IAAM,KAAQ,GAAA,KAAA,GAAU,KAAQ,GAAA,KAAA,CAAA,CAAA;AACjD,EAAA,MAAM,CAAM,GAAA,CAAA,KAAA,GAAQ,KAAU,GAAA,KAAA,GAAQ,KAAU,IAAA,QAAA,CAAA;AAChD,EAAA,MAAM,CAAM,GAAA,CAAA,KAAA,GAAQ,KAAU,GAAA,KAAA,GAAQ,KAAU,IAAA,QAAA,CAAA;AAGhD,EAAA,OAAQ,CAAK,IAAA,CAAA,IAAO,CAAK,IAAA,CAAA,IAAO,IAAI,CAAI,GAAA,CAAA,CAAA;AAC5C;;;;"}