sdfsdfs
This commit is contained in:
10
node_modules/pixi.js/lib/maths/misc/Size.d.ts
generated
vendored
Normal file
10
node_modules/pixi.js/lib/maths/misc/Size.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Defines a size with a width and a height.
|
||||
* @memberof maths
|
||||
*/
|
||||
export interface Size {
|
||||
/** The width. */
|
||||
width: number;
|
||||
/** The height. */
|
||||
height: number;
|
||||
}
|
4
node_modules/pixi.js/lib/maths/misc/Size.js
generated
vendored
Normal file
4
node_modules/pixi.js/lib/maths/misc/Size.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
'use strict';
|
||||
|
||||
"use strict";
|
||||
//# sourceMappingURL=Size.js.map
|
1
node_modules/pixi.js/lib/maths/misc/Size.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/maths/misc/Size.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Size.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
2
node_modules/pixi.js/lib/maths/misc/Size.mjs
generated
vendored
Normal file
2
node_modules/pixi.js/lib/maths/misc/Size.mjs
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
//# sourceMappingURL=Size.mjs.map
|
1
node_modules/pixi.js/lib/maths/misc/Size.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/maths/misc/Size.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Size.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
41
node_modules/pixi.js/lib/maths/misc/const.d.ts
generated
vendored
Normal file
41
node_modules/pixi.js/lib/maths/misc/const.d.ts
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Two Pi.
|
||||
* @static
|
||||
* @member {number}
|
||||
* @memberof maths
|
||||
*/
|
||||
export declare const PI_2: number;
|
||||
/**
|
||||
* Conversion factor for converting radians to degrees.
|
||||
* @static
|
||||
* @member {number} RAD_TO_DEG
|
||||
* @memberof maths
|
||||
*/
|
||||
export declare const RAD_TO_DEG: number;
|
||||
/**
|
||||
* Conversion factor for converting degrees to radians.
|
||||
* @static
|
||||
* @member {number}
|
||||
* @memberof maths
|
||||
*/
|
||||
export declare const DEG_TO_RAD: number;
|
||||
/**
|
||||
* Constants that identify shapes, mainly to prevent `instanceof` calls.
|
||||
* @memberof maths
|
||||
*/
|
||||
export type SHAPE_PRIMITIVE = 'polygon' | 'rectangle' | 'circle' | 'ellipse' | 'triangle' | 'roundedRectangle';
|
||||
/**
|
||||
* The `maths` folder contains utility classes and functions for mathematical operations used throughout the project.
|
||||
* This includes constants such as conversion factors for radians and degrees, as well as shapes such as polygons,
|
||||
* rectangles, circles, ellipses, triangles, and rounded rectangles.
|
||||
* ```js
|
||||
* import { RAD_TO_DEG, Circle } from 'pixi.js';
|
||||
*
|
||||
* // Convert 180 degrees to radians
|
||||
* const radians = 180 * RAD_TO_DEG;
|
||||
*
|
||||
* // test if a point is inside a circle
|
||||
* const isPointInCircle = new Circle(0, 0, 10).contains(0, 0); // true
|
||||
* ```
|
||||
* @namespace maths
|
||||
*/
|
11
node_modules/pixi.js/lib/maths/misc/const.js
generated
vendored
Normal file
11
node_modules/pixi.js/lib/maths/misc/const.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
"use strict";
|
||||
const PI_2 = Math.PI * 2;
|
||||
const RAD_TO_DEG = 180 / Math.PI;
|
||||
const DEG_TO_RAD = Math.PI / 180;
|
||||
|
||||
exports.DEG_TO_RAD = DEG_TO_RAD;
|
||||
exports.PI_2 = PI_2;
|
||||
exports.RAD_TO_DEG = RAD_TO_DEG;
|
||||
//# sourceMappingURL=const.js.map
|
1
node_modules/pixi.js/lib/maths/misc/const.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/maths/misc/const.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"const.js","sources":["../../../src/maths/misc/const.ts"],"sourcesContent":["/**\n * Two Pi.\n * @static\n * @member {number}\n * @memberof maths\n */\nexport const PI_2 = Math.PI * 2;\n\n/**\n * Conversion factor for converting radians to degrees.\n * @static\n * @member {number} RAD_TO_DEG\n * @memberof maths\n */\nexport const RAD_TO_DEG = 180 / Math.PI;\n\n/**\n * Conversion factor for converting degrees to radians.\n * @static\n * @member {number}\n * @memberof maths\n */\nexport const DEG_TO_RAD = Math.PI / 180;\n\n/**\n * Constants that identify shapes, mainly to prevent `instanceof` calls.\n * @memberof maths\n */\nexport type SHAPE_PRIMITIVE =\n | 'polygon'\n | 'rectangle'\n | 'circle'\n | 'ellipse'\n | 'triangle'\n | 'roundedRectangle';\n\n/**\n * The `maths` folder contains utility classes and functions for mathematical operations used throughout the project.\n * This includes constants such as conversion factors for radians and degrees, as well as shapes such as polygons,\n * rectangles, circles, ellipses, triangles, and rounded rectangles.\n * ```js\n * import { RAD_TO_DEG, Circle } from 'pixi.js';\n *\n * // Convert 180 degrees to radians\n * const radians = 180 * RAD_TO_DEG;\n *\n * // test if a point is inside a circle\n * const isPointInCircle = new Circle(0, 0, 10).contains(0, 0); // true\n * ```\n * @namespace maths\n */\n"],"names":[],"mappings":";;;AAMa,MAAA,IAAA,GAAO,KAAK,EAAK,GAAA,EAAA;AAQjB,MAAA,UAAA,GAAa,MAAM,IAAK,CAAA,GAAA;AAQxB,MAAA,UAAA,GAAa,KAAK,EAAK,GAAA;;;;;;"}
|
7
node_modules/pixi.js/lib/maths/misc/const.mjs
generated
vendored
Normal file
7
node_modules/pixi.js/lib/maths/misc/const.mjs
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
const PI_2 = Math.PI * 2;
|
||||
const RAD_TO_DEG = 180 / Math.PI;
|
||||
const DEG_TO_RAD = Math.PI / 180;
|
||||
|
||||
export { DEG_TO_RAD, PI_2, RAD_TO_DEG };
|
||||
//# sourceMappingURL=const.mjs.map
|
1
node_modules/pixi.js/lib/maths/misc/const.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/maths/misc/const.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"const.mjs","sources":["../../../src/maths/misc/const.ts"],"sourcesContent":["/**\n * Two Pi.\n * @static\n * @member {number}\n * @memberof maths\n */\nexport const PI_2 = Math.PI * 2;\n\n/**\n * Conversion factor for converting radians to degrees.\n * @static\n * @member {number} RAD_TO_DEG\n * @memberof maths\n */\nexport const RAD_TO_DEG = 180 / Math.PI;\n\n/**\n * Conversion factor for converting degrees to radians.\n * @static\n * @member {number}\n * @memberof maths\n */\nexport const DEG_TO_RAD = Math.PI / 180;\n\n/**\n * Constants that identify shapes, mainly to prevent `instanceof` calls.\n * @memberof maths\n */\nexport type SHAPE_PRIMITIVE =\n | 'polygon'\n | 'rectangle'\n | 'circle'\n | 'ellipse'\n | 'triangle'\n | 'roundedRectangle';\n\n/**\n * The `maths` folder contains utility classes and functions for mathematical operations used throughout the project.\n * This includes constants such as conversion factors for radians and degrees, as well as shapes such as polygons,\n * rectangles, circles, ellipses, triangles, and rounded rectangles.\n * ```js\n * import { RAD_TO_DEG, Circle } from 'pixi.js';\n *\n * // Convert 180 degrees to radians\n * const radians = 180 * RAD_TO_DEG;\n *\n * // test if a point is inside a circle\n * const isPointInCircle = new Circle(0, 0, 10).contains(0, 0); // true\n * ```\n * @namespace maths\n */\n"],"names":[],"mappings":";AAMa,MAAA,IAAA,GAAO,KAAK,EAAK,GAAA,EAAA;AAQjB,MAAA,UAAA,GAAa,MAAM,IAAK,CAAA,GAAA;AAQxB,MAAA,UAAA,GAAa,KAAK,EAAK,GAAA;;;;"}
|
24
node_modules/pixi.js/lib/maths/misc/pow2.d.ts
generated
vendored
Normal file
24
node_modules/pixi.js/lib/maths/misc/pow2.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Rounds to next power of two.
|
||||
* @function nextPow2
|
||||
* @param {number} v - input value
|
||||
* @returns {number} - next rounded power of two
|
||||
* @memberof maths
|
||||
*/
|
||||
export declare function nextPow2(v: number): number;
|
||||
/**
|
||||
* Checks if a number is a power of two.
|
||||
* @function isPow2
|
||||
* @param {number} v - input value
|
||||
* @returns {boolean} `true` if value is power of two
|
||||
* @memberof maths
|
||||
*/
|
||||
export declare function isPow2(v: number): boolean;
|
||||
/**
|
||||
* Computes ceil of log base 2
|
||||
* @function log2
|
||||
* @param {number} v - input value
|
||||
* @returns {number} logarithm base 2
|
||||
* @memberof maths
|
||||
*/
|
||||
export declare function log2(v: number): number;
|
35
node_modules/pixi.js/lib/maths/misc/pow2.js
generated
vendored
Normal file
35
node_modules/pixi.js/lib/maths/misc/pow2.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
'use strict';
|
||||
|
||||
"use strict";
|
||||
function nextPow2(v) {
|
||||
v += v === 0 ? 1 : 0;
|
||||
--v;
|
||||
v |= v >>> 1;
|
||||
v |= v >>> 2;
|
||||
v |= v >>> 4;
|
||||
v |= v >>> 8;
|
||||
v |= v >>> 16;
|
||||
return v + 1;
|
||||
}
|
||||
function isPow2(v) {
|
||||
return !(v & v - 1) && !!v;
|
||||
}
|
||||
function log2(v) {
|
||||
let r = (v > 65535 ? 1 : 0) << 4;
|
||||
v >>>= r;
|
||||
let shift = (v > 255 ? 1 : 0) << 3;
|
||||
v >>>= shift;
|
||||
r |= shift;
|
||||
shift = (v > 15 ? 1 : 0) << 2;
|
||||
v >>>= shift;
|
||||
r |= shift;
|
||||
shift = (v > 3 ? 1 : 0) << 1;
|
||||
v >>>= shift;
|
||||
r |= shift;
|
||||
return r | v >> 1;
|
||||
}
|
||||
|
||||
exports.isPow2 = isPow2;
|
||||
exports.log2 = log2;
|
||||
exports.nextPow2 = nextPow2;
|
||||
//# sourceMappingURL=pow2.js.map
|
1
node_modules/pixi.js/lib/maths/misc/pow2.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/maths/misc/pow2.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"pow2.js","sources":["../../../src/maths/misc/pow2.ts"],"sourcesContent":["// Taken from the bit-twiddle package\n\n/**\n * Rounds to next power of two.\n * @function nextPow2\n * @param {number} v - input value\n * @returns {number} - next rounded power of two\n * @memberof maths\n */\nexport function nextPow2(v: number): number\n{\n v += v === 0 ? 1 : 0;\n --v;\n v |= v >>> 1;\n v |= v >>> 2;\n v |= v >>> 4;\n v |= v >>> 8;\n v |= v >>> 16;\n\n return v + 1;\n}\n\n/**\n * Checks if a number is a power of two.\n * @function isPow2\n * @param {number} v - input value\n * @returns {boolean} `true` if value is power of two\n * @memberof maths\n */\nexport function isPow2(v: number): boolean\n{\n return !(v & (v - 1)) && (!!v);\n}\n\n/**\n * Computes ceil of log base 2\n * @function log2\n * @param {number} v - input value\n * @returns {number} logarithm base 2\n * @memberof maths\n */\nexport function log2(v: number): number\n{\n let r = (v > 0xFFFF ? 1 : 0) << 4;\n\n v >>>= r;\n\n let shift = (v > 0xFF ? 1 : 0) << 3;\n\n v >>>= shift; r |= shift;\n shift = (v > 0xF ? 1 : 0) << 2;\n v >>>= shift; r |= shift;\n shift = (v > 0x3 ? 1 : 0) << 1;\n v >>>= shift; r |= shift;\n\n return r | (v >> 1);\n}\n"],"names":[],"mappings":";;;AASO,SAAS,SAAS,CACzB,EAAA;AACI,EAAK,CAAA,IAAA,CAAA,KAAM,IAAI,CAAI,GAAA,CAAA,CAAA;AACnB,EAAE,EAAA,CAAA,CAAA;AACF,EAAA,CAAA,IAAK,CAAM,KAAA,CAAA,CAAA;AACX,EAAA,CAAA,IAAK,CAAM,KAAA,CAAA,CAAA;AACX,EAAA,CAAA,IAAK,CAAM,KAAA,CAAA,CAAA;AACX,EAAA,CAAA,IAAK,CAAM,KAAA,CAAA,CAAA;AACX,EAAA,CAAA,IAAK,CAAM,KAAA,EAAA,CAAA;AAEX,EAAA,OAAO,CAAI,GAAA,CAAA,CAAA;AACf,CAAA;AASO,SAAS,OAAO,CACvB,EAAA;AACI,EAAA,OAAO,EAAE,CAAA,GAAK,CAAI,GAAA,CAAA,CAAA,IAAQ,CAAC,CAAC,CAAA,CAAA;AAChC,CAAA;AASO,SAAS,KAAK,CACrB,EAAA;AACI,EAAA,IAAI,CAAK,GAAA,CAAA,CAAA,GAAI,KAAS,GAAA,CAAA,GAAI,CAAM,KAAA,CAAA,CAAA;AAEhC,EAAO,CAAA,MAAA,CAAA,CAAA;AAEP,EAAA,IAAI,KAAS,GAAA,CAAA,CAAA,GAAI,GAAO,GAAA,CAAA,GAAI,CAAM,KAAA,CAAA,CAAA;AAElC,EAAO,CAAA,MAAA,KAAA,CAAA;AAAO,EAAK,CAAA,IAAA,KAAA,CAAA;AACnB,EAAS,KAAA,GAAA,CAAA,CAAA,GAAI,EAAM,GAAA,CAAA,GAAI,CAAM,KAAA,CAAA,CAAA;AAC7B,EAAO,CAAA,MAAA,KAAA,CAAA;AAAO,EAAK,CAAA,IAAA,KAAA,CAAA;AACnB,EAAS,KAAA,GAAA,CAAA,CAAA,GAAI,CAAM,GAAA,CAAA,GAAI,CAAM,KAAA,CAAA,CAAA;AAC7B,EAAO,CAAA,MAAA,KAAA,CAAA;AAAO,EAAK,CAAA,IAAA,KAAA,CAAA;AAEnB,EAAA,OAAO,IAAK,CAAK,IAAA,CAAA,CAAA;AACrB;;;;;;"}
|
31
node_modules/pixi.js/lib/maths/misc/pow2.mjs
generated
vendored
Normal file
31
node_modules/pixi.js/lib/maths/misc/pow2.mjs
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
function nextPow2(v) {
|
||||
v += v === 0 ? 1 : 0;
|
||||
--v;
|
||||
v |= v >>> 1;
|
||||
v |= v >>> 2;
|
||||
v |= v >>> 4;
|
||||
v |= v >>> 8;
|
||||
v |= v >>> 16;
|
||||
return v + 1;
|
||||
}
|
||||
function isPow2(v) {
|
||||
return !(v & v - 1) && !!v;
|
||||
}
|
||||
function log2(v) {
|
||||
let r = (v > 65535 ? 1 : 0) << 4;
|
||||
v >>>= r;
|
||||
let shift = (v > 255 ? 1 : 0) << 3;
|
||||
v >>>= shift;
|
||||
r |= shift;
|
||||
shift = (v > 15 ? 1 : 0) << 2;
|
||||
v >>>= shift;
|
||||
r |= shift;
|
||||
shift = (v > 3 ? 1 : 0) << 1;
|
||||
v >>>= shift;
|
||||
r |= shift;
|
||||
return r | v >> 1;
|
||||
}
|
||||
|
||||
export { isPow2, log2, nextPow2 };
|
||||
//# sourceMappingURL=pow2.mjs.map
|
1
node_modules/pixi.js/lib/maths/misc/pow2.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/maths/misc/pow2.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"pow2.mjs","sources":["../../../src/maths/misc/pow2.ts"],"sourcesContent":["// Taken from the bit-twiddle package\n\n/**\n * Rounds to next power of two.\n * @function nextPow2\n * @param {number} v - input value\n * @returns {number} - next rounded power of two\n * @memberof maths\n */\nexport function nextPow2(v: number): number\n{\n v += v === 0 ? 1 : 0;\n --v;\n v |= v >>> 1;\n v |= v >>> 2;\n v |= v >>> 4;\n v |= v >>> 8;\n v |= v >>> 16;\n\n return v + 1;\n}\n\n/**\n * Checks if a number is a power of two.\n * @function isPow2\n * @param {number} v - input value\n * @returns {boolean} `true` if value is power of two\n * @memberof maths\n */\nexport function isPow2(v: number): boolean\n{\n return !(v & (v - 1)) && (!!v);\n}\n\n/**\n * Computes ceil of log base 2\n * @function log2\n * @param {number} v - input value\n * @returns {number} logarithm base 2\n * @memberof maths\n */\nexport function log2(v: number): number\n{\n let r = (v > 0xFFFF ? 1 : 0) << 4;\n\n v >>>= r;\n\n let shift = (v > 0xFF ? 1 : 0) << 3;\n\n v >>>= shift; r |= shift;\n shift = (v > 0xF ? 1 : 0) << 2;\n v >>>= shift; r |= shift;\n shift = (v > 0x3 ? 1 : 0) << 1;\n v >>>= shift; r |= shift;\n\n return r | (v >> 1);\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,OAAO,IAAK,CAAK,IAAA,CAAA,CAAA;AACrB;;;;"}
|
1
node_modules/pixi.js/lib/maths/misc/squaredDistanceToLineSegment.d.ts
generated
vendored
Normal file
1
node_modules/pixi.js/lib/maths/misc/squaredDistanceToLineSegment.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function squaredDistanceToLineSegment(x: number, y: number, x1: number, y1: number, x2: number, y2: number): number;
|
33
node_modules/pixi.js/lib/maths/misc/squaredDistanceToLineSegment.js
generated
vendored
Normal file
33
node_modules/pixi.js/lib/maths/misc/squaredDistanceToLineSegment.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
'use strict';
|
||||
|
||||
"use strict";
|
||||
function squaredDistanceToLineSegment(x, y, x1, y1, x2, y2) {
|
||||
const a = x - x1;
|
||||
const b = y - y1;
|
||||
const c = x2 - x1;
|
||||
const d = y2 - y1;
|
||||
const dot = a * c + b * d;
|
||||
const lenSq = c * c + d * d;
|
||||
let param = -1;
|
||||
if (lenSq !== 0) {
|
||||
param = dot / lenSq;
|
||||
}
|
||||
let xx;
|
||||
let yy;
|
||||
if (param < 0) {
|
||||
xx = x1;
|
||||
yy = y1;
|
||||
} else if (param > 1) {
|
||||
xx = x2;
|
||||
yy = y2;
|
||||
} else {
|
||||
xx = x1 + param * c;
|
||||
yy = y1 + param * d;
|
||||
}
|
||||
const dx = x - xx;
|
||||
const dy = y - yy;
|
||||
return dx * dx + dy * dy;
|
||||
}
|
||||
|
||||
exports.squaredDistanceToLineSegment = squaredDistanceToLineSegment;
|
||||
//# sourceMappingURL=squaredDistanceToLineSegment.js.map
|
1
node_modules/pixi.js/lib/maths/misc/squaredDistanceToLineSegment.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/maths/misc/squaredDistanceToLineSegment.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"squaredDistanceToLineSegment.js","sources":["../../../src/maths/misc/squaredDistanceToLineSegment.ts"],"sourcesContent":["export function squaredDistanceToLineSegment(\n x: number, y: number,\n x1: number, y1: number,\n x2: number, y2: number\n): number\n{\n const a = x - x1;\n const b = y - y1;\n const c = x2 - x1;\n const d = y2 - y1;\n\n const dot = (a * c) + (b * d);\n const lenSq = (c * c) + (d * d);\n let param = -1;\n\n if (lenSq !== 0)\n {\n param = dot / lenSq;\n }\n\n let xx; let\n yy;\n\n if (param < 0)\n {\n xx = x1;\n yy = y1;\n }\n else if (param > 1)\n {\n xx = x2;\n yy = y2;\n }\n\n else\n {\n xx = x1 + (param * c);\n yy = y1 + (param * d);\n }\n\n const dx = x - xx;\n const dy = y - yy;\n\n return (dx * dx) + (dy * dy);\n}\n"],"names":[],"mappings":";;;AAAO,SAAS,6BACZ,CAAW,EAAA,CAAA,EACX,EAAY,EAAA,EAAA,EACZ,IAAY,EAEhB,EAAA;AACI,EAAA,MAAM,IAAI,CAAI,GAAA,EAAA,CAAA;AACd,EAAA,MAAM,IAAI,CAAI,GAAA,EAAA,CAAA;AACd,EAAA,MAAM,IAAI,EAAK,GAAA,EAAA,CAAA;AACf,EAAA,MAAM,IAAI,EAAK,GAAA,EAAA,CAAA;AAEf,EAAM,MAAA,GAAA,GAAO,CAAI,GAAA,CAAA,GAAM,CAAI,GAAA,CAAA,CAAA;AAC3B,EAAM,MAAA,KAAA,GAAS,CAAI,GAAA,CAAA,GAAM,CAAI,GAAA,CAAA,CAAA;AAC7B,EAAA,IAAI,KAAQ,GAAA,CAAA,CAAA,CAAA;AAEZ,EAAA,IAAI,UAAU,CACd,EAAA;AACI,IAAA,KAAA,GAAQ,GAAM,GAAA,KAAA,CAAA;AAAA,GAClB;AAEA,EAAI,IAAA,EAAA,CAAA;AAAI,EACJ,IAAA,EAAA,CAAA;AAEJ,EAAA,IAAI,QAAQ,CACZ,EAAA;AACI,IAAK,EAAA,GAAA,EAAA,CAAA;AACL,IAAK,EAAA,GAAA,EAAA,CAAA;AAAA,GACT,MAAA,IACS,QAAQ,CACjB,EAAA;AACI,IAAK,EAAA,GAAA,EAAA,CAAA;AACL,IAAK,EAAA,GAAA,EAAA,CAAA;AAAA,GAIT,MAAA;AACI,IAAA,EAAA,GAAK,KAAM,KAAQ,GAAA,CAAA,CAAA;AACnB,IAAA,EAAA,GAAK,KAAM,KAAQ,GAAA,CAAA,CAAA;AAAA,GACvB;AAEA,EAAA,MAAM,KAAK,CAAI,GAAA,EAAA,CAAA;AACf,EAAA,MAAM,KAAK,CAAI,GAAA,EAAA,CAAA;AAEf,EAAQ,OAAA,EAAA,GAAK,KAAO,EAAK,GAAA,EAAA,CAAA;AAC7B;;;;"}
|
31
node_modules/pixi.js/lib/maths/misc/squaredDistanceToLineSegment.mjs
generated
vendored
Normal file
31
node_modules/pixi.js/lib/maths/misc/squaredDistanceToLineSegment.mjs
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
function squaredDistanceToLineSegment(x, y, x1, y1, x2, y2) {
|
||||
const a = x - x1;
|
||||
const b = y - y1;
|
||||
const c = x2 - x1;
|
||||
const d = y2 - y1;
|
||||
const dot = a * c + b * d;
|
||||
const lenSq = c * c + d * d;
|
||||
let param = -1;
|
||||
if (lenSq !== 0) {
|
||||
param = dot / lenSq;
|
||||
}
|
||||
let xx;
|
||||
let yy;
|
||||
if (param < 0) {
|
||||
xx = x1;
|
||||
yy = y1;
|
||||
} else if (param > 1) {
|
||||
xx = x2;
|
||||
yy = y2;
|
||||
} else {
|
||||
xx = x1 + param * c;
|
||||
yy = y1 + param * d;
|
||||
}
|
||||
const dx = x - xx;
|
||||
const dy = y - yy;
|
||||
return dx * dx + dy * dy;
|
||||
}
|
||||
|
||||
export { squaredDistanceToLineSegment };
|
||||
//# sourceMappingURL=squaredDistanceToLineSegment.mjs.map
|
1
node_modules/pixi.js/lib/maths/misc/squaredDistanceToLineSegment.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/maths/misc/squaredDistanceToLineSegment.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"squaredDistanceToLineSegment.mjs","sources":["../../../src/maths/misc/squaredDistanceToLineSegment.ts"],"sourcesContent":["export function squaredDistanceToLineSegment(\n x: number, y: number,\n x1: number, y1: number,\n x2: number, y2: number\n): number\n{\n const a = x - x1;\n const b = y - y1;\n const c = x2 - x1;\n const d = y2 - y1;\n\n const dot = (a * c) + (b * d);\n const lenSq = (c * c) + (d * d);\n let param = -1;\n\n if (lenSq !== 0)\n {\n param = dot / lenSq;\n }\n\n let xx; let\n yy;\n\n if (param < 0)\n {\n xx = x1;\n yy = y1;\n }\n else if (param > 1)\n {\n xx = x2;\n yy = y2;\n }\n\n else\n {\n xx = x1 + (param * c);\n yy = y1 + (param * d);\n }\n\n const dx = x - xx;\n const dy = y - yy;\n\n return (dx * dx) + (dy * dy);\n}\n"],"names":[],"mappings":";AAAO,SAAS,6BACZ,CAAW,EAAA,CAAA,EACX,EAAY,EAAA,EAAA,EACZ,IAAY,EAEhB,EAAA;AACI,EAAA,MAAM,IAAI,CAAI,GAAA,EAAA,CAAA;AACd,EAAA,MAAM,IAAI,CAAI,GAAA,EAAA,CAAA;AACd,EAAA,MAAM,IAAI,EAAK,GAAA,EAAA,CAAA;AACf,EAAA,MAAM,IAAI,EAAK,GAAA,EAAA,CAAA;AAEf,EAAM,MAAA,GAAA,GAAO,CAAI,GAAA,CAAA,GAAM,CAAI,GAAA,CAAA,CAAA;AAC3B,EAAM,MAAA,KAAA,GAAS,CAAI,GAAA,CAAA,GAAM,CAAI,GAAA,CAAA,CAAA;AAC7B,EAAA,IAAI,KAAQ,GAAA,CAAA,CAAA,CAAA;AAEZ,EAAA,IAAI,UAAU,CACd,EAAA;AACI,IAAA,KAAA,GAAQ,GAAM,GAAA,KAAA,CAAA;AAAA,GAClB;AAEA,EAAI,IAAA,EAAA,CAAA;AAAI,EACJ,IAAA,EAAA,CAAA;AAEJ,EAAA,IAAI,QAAQ,CACZ,EAAA;AACI,IAAK,EAAA,GAAA,EAAA,CAAA;AAC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