From d8fa9cb79d6c0c969afc01e2ecee0b3ab99deeb1 Mon Sep 17 00:00:00 2001 From: Jacek Pietal Date: Thu, 29 Feb 2024 04:28:32 +0100 Subject: [PATCH] feat: recompile --- dist/base-system.d.ts | 4 +- dist/demo/demo.js | 183 +++++++++++++----------- dist/intersect.d.ts | 2 +- dist/intersect.js | 14 +- dist/model.d.ts | 1 + dist/utils.d.ts | 41 +++--- dist/utils.js | 169 ++++++++++++---------- docs/assets/navigation.js | 2 +- docs/assets/search.js | 2 +- docs/classes/System.html | 30 ++-- docs/demo/demo.js | 183 +++++++++++++----------- docs/functions/bodyMoved.html | 2 +- docs/functions/checkAInB.html | 4 +- docs/functions/circleInCircle.html | 4 +- docs/functions/clockwise.html | 4 +- docs/functions/clonePointsArray.html | 2 +- docs/functions/cloneResponse.html | 2 +- docs/functions/createBox.html | 4 +- docs/functions/createEllipse.html | 2 +- docs/functions/dashLineTo.html | 2 +- docs/functions/deg2rad-1.html | 2 +- docs/functions/distance.html | 4 +- docs/functions/drawBVH.html | 4 +- docs/functions/drawPolygon.html | 2 +- docs/functions/ensurePolygonPoints.html | 4 +- docs/functions/ensureVectorPoint.html | 4 +- docs/functions/extendBody.html | 4 +- docs/functions/getBounceDirection.html | 2 +- docs/functions/getSATTest.html | 4 +- docs/functions/intersectAABB.html | 4 +- docs/functions/mapArrayToVector.html | 4 +- docs/functions/mapVectorToArray.html | 4 +- docs/functions/notIntersectAABB.html | 4 +- docs/functions/rad2deg-1.html | 2 +- docs/functions/returnTrue.html | 3 +- docs/modules.html | 1 + docs/types/InTest.html | 1 + docs/types/TraverseFunction.html | 2 +- docs/variables/DEG2RAD.html | 2 +- docs/variables/RAD2DEG.html | 2 +- package.json | 2 +- 41 files changed, 382 insertions(+), 336 deletions(-) create mode 100644 docs/types/InTest.html diff --git a/dist/base-system.d.ts b/dist/base-system.d.ts index afb2d99d..48378270 100644 --- a/dist/base-system.d.ts +++ b/dist/base-system.d.ts @@ -4,7 +4,7 @@ import { Ellipse } from "./bodies/ellipse"; import { Line } from "./bodies/line"; import { Point } from "./bodies/point"; import { Polygon } from "./bodies/polygon"; -import { Body, BodyOptions, ChildrenData, Data, Leaf, PotentialVector, RBush, TraverseFunction, Vector } from "./model"; +import { Body, BodyOptions, ChildrenData, Data, InTest, Leaf, PotentialVector, RBush, TraverseFunction, Vector } from "./model"; /** * very base collision system (create, insert, update, draw, remove) */ @@ -58,7 +58,7 @@ export declare class BaseSystem extends RBush /** * remove body aabb from collision tree */ - remove(body: TBody, equals?: (a: TBody, b: TBody) => boolean): RBush; + remove(body: TBody, equals?: InTest): RBush; /** * get object potential colliders * @deprecated because it's slower to use than checkOne() or checkAll() diff --git a/dist/demo/demo.js b/dist/demo/demo.js index b957d4d1..ef6ed4c4 100644 --- a/dist/demo/demo.js +++ b/dist/demo/demo.js @@ -1044,13 +1044,13 @@ exports.pointOnCircle = pointOnCircle; /** * https://stackoverflow.com/a/68197894/1749528 */ -function circleInCircle(a, b) { - const x1 = a.pos.x; - const y1 = a.pos.y; - const x2 = b.pos.x; - const y2 = b.pos.y; - const r1 = a.r; - const r2 = b.r; +function circleInCircle(bodyA, bodyB) { + const x1 = bodyA.pos.x; + const y1 = bodyA.pos.y; + const x2 = bodyB.pos.x; + const y2 = bodyB.pos.y; + const r1 = bodyA.r; + const r2 = bodyB.r; const distSq = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); return distSq + r2 === r1 || distSq + r2 < r1; } @@ -1515,11 +1515,31 @@ exports.System = System; "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.returnTrue = exports.cloneResponse = exports.drawBVH = exports.drawPolygon = exports.getSATTest = exports.getBounceDirection = exports.mapArrayToVector = exports.mapVectorToArray = exports.dashLineTo = exports.clonePointsArray = exports.checkAInB = exports.intersectAABB = exports.notIntersectAABB = exports.bodyMoved = exports.extendBody = exports.clockwise = exports.distance = exports.ensurePolygonPoints = exports.ensureVectorPoint = exports.createBox = exports.createEllipse = exports.rad2deg = exports.deg2rad = exports.RAD2DEG = exports.DEG2RAD = void 0; +exports.returnTrue = exports.cloneResponse = exports.drawBVH = exports.drawPolygon = exports.dashLineTo = exports.getSATTest = exports.getBounceDirection = exports.mapArrayToVector = exports.mapVectorToArray = exports.clonePointsArray = exports.checkAInB = exports.intersectAABB = exports.notIntersectAABB = exports.bodyMoved = exports.extendBody = exports.clockwise = exports.distance = exports.ensurePolygonPoints = exports.ensureVectorPoint = exports.createBox = exports.createEllipse = exports.rad2deg = exports.deg2rad = exports.RAD2DEG = exports.DEG2RAD = void 0; const sat_1 = __webpack_require__(/*! sat */ "./node_modules/sat/SAT.js"); const intersect_1 = __webpack_require__(/*! ./intersect */ "./dist/intersect.js"); const model_1 = __webpack_require__(/*! ./model */ "./dist/model.js"); const optimized_1 = __webpack_require__(/*! ./optimized */ "./dist/optimized.js"); +/* helpers for faster getSATTest() and checkAInB() */ +const testMap = { + satCircleCircle: sat_1.testCircleCircle, + satCirclePolygon: sat_1.testCirclePolygon, + satPolygonCircle: sat_1.testPolygonCircle, + satPolygonPolygon: sat_1.testPolygonPolygon, + inCircleCircle: intersect_1.circleInCircle, + inCirclePolygon: intersect_1.circleInPolygon, + inPolygonCircle: intersect_1.polygonInCircle, + inPolygonPolygon: intersect_1.polygonInPolygon, +}; +function createMap(bodyType, testType) { + return Object.values(model_1.BodyType).reduce((result, type) => (Object.assign(Object.assign({}, result), { [type]: type === model_1.BodyType.Circle + ? testMap[`${testType}${bodyType}Circle`] + : testMap[`${testType}${bodyType}Polygon`] })), {}); +} +const circleSATFunctions = createMap(model_1.BodyType.Circle, "sat"); +const circleInFunctions = createMap(model_1.BodyType.Circle, "in"); +const polygonSATFunctions = createMap(model_1.BodyType.Polygon, "sat"); +const polygonInFunctions = createMap(model_1.BodyType.Polygon, "in"); exports.DEG2RAD = Math.PI / 180; exports.RAD2DEG = 180 / Math.PI; /** @@ -1542,16 +1562,18 @@ exports.rad2deg = rad2deg; function createEllipse(radiusX, radiusY = radiusX, step = 1) { const steps = Math.PI * Math.hypot(radiusX, radiusY) * 2; const length = Math.max(8, Math.ceil(steps / Math.max(1, step))); - return Array.from({ length }, (_, index) => { + const ellipse = []; + for (let index = 0; index < length; index++) { const value = (index / length) * 2 * Math.PI; const x = Math.cos(value) * radiusX; const y = Math.sin(value) * radiusY; - return new sat_1.Vector(x, y); - }); + ellipse.push(new sat_1.Vector(x, y)); + } + return ellipse; } exports.createEllipse = createEllipse; /** - * creates box polygon points + * creates box shaped polygon points */ function createBox(width, height) { return [ @@ -1563,7 +1585,7 @@ function createBox(width, height) { } exports.createBox = createBox; /** - * ensure Vector point + * ensure SATVector type point result */ function ensureVectorPoint(point = {}) { return point instanceof sat_1.Vector @@ -1574,10 +1596,7 @@ exports.ensureVectorPoint = ensureVectorPoint; /** * ensure Vector points (for polygon) in counter-clockwise order */ -function ensurePolygonPoints(points) { - if (!points) { - throw new Error("No points array provided"); - } +function ensurePolygonPoints(points = []) { const polygonPoints = (0, optimized_1.map)(points, ensureVectorPoint); return clockwise(polygonPoints) ? polygonPoints.reverse() : polygonPoints; } @@ -1585,25 +1604,27 @@ exports.ensurePolygonPoints = ensurePolygonPoints; /** * get distance between two Vector points */ -function distance(a, b) { - return Math.hypot(a.x - b.x, a.y - b.y); +function distance(bodyA, bodyB) { + const xDiff = bodyA.x - bodyB.x; + const yDiff = bodyA.y - bodyB.y; + return Math.hypot(xDiff, yDiff); } exports.distance = distance; /** - * check direction of polygon + * check [is clockwise] direction of polygon */ function clockwise(points) { + const length = points.length; let sum = 0; - for (let i = 0; i < points.length; i++) { - const v1 = points[i]; - const v2 = points[(i + 1) % points.length]; + (0, optimized_1.forEach)(points, (v1, index) => { + const v2 = points[(index + 1) % length]; sum += (v2.x - v1.x) * (v2.y + v1.y); - } + }); return sum > 0; } exports.clockwise = clockwise; /** - * used for all types of bodies + * used for all types of bodies in constructor */ function extendBody(body, options) { body.isStatic = !!(options === null || options === void 0 ? void 0 : options.isStatic); @@ -1619,83 +1640,51 @@ exports.extendBody = extendBody; * check if body moved outside of its padding */ function bodyMoved(body) { - return (body.bbox.minX < body.minX || - body.bbox.minY < body.minY || - body.bbox.maxX > body.maxX || - body.bbox.maxY > body.maxY); + const { bbox, minX, minY, maxX, maxY } = body; + return (bbox.minX < minX || bbox.minY < minY || bbox.maxX > maxX || bbox.maxY > maxY); } exports.bodyMoved = bodyMoved; /** * returns true if two boxes not intersect */ -function notIntersectAABB(a, b) { - return (b.minX > a.maxX || b.minY > a.maxY || b.maxX < a.minX || b.maxY < a.minY); +function notIntersectAABB(bodyA, bodyB) { + return (bodyB.minX > bodyA.maxX || + bodyB.minY > bodyA.maxY || + bodyB.maxX < bodyA.minX || + bodyB.maxY < bodyA.minY); } exports.notIntersectAABB = notIntersectAABB; /** * checks if two boxes intersect */ -function intersectAABB(a, b) { - return !notIntersectAABB(a, b); +function intersectAABB(bodyA, bodyB) { + return !notIntersectAABB(bodyA, bodyB); } exports.intersectAABB = intersectAABB; /** * checks if body a is in body b */ -function checkAInB(a, b) { - if (a.type === model_1.BodyType.Circle) { - if (b.type !== model_1.BodyType.Circle) { - return (0, intersect_1.circleInPolygon)(a, b); - } - return (0, intersect_1.circleInCircle)(a, b); - } - if (b.type === model_1.BodyType.Circle) { - return (0, intersect_1.polygonInCircle)(a, b); - } - return (0, intersect_1.polygonInPolygon)(a, b); +function checkAInB(bodyA, bodyB) { + const check = bodyA.type === model_1.BodyType.Circle ? circleInFunctions : polygonInFunctions; + return check[bodyB.type](bodyA, bodyB); } exports.checkAInB = checkAInB; /** * clone sat vector points array into vector points array */ function clonePointsArray(points) { - return (0, optimized_1.map)(points, ({ x, y }) => ({ - x, - y, - })); + return (0, optimized_1.map)(points, ({ x, y }) => ({ x, y })); } exports.clonePointsArray = clonePointsArray; /** - * draws dashed line on canvas context - */ -function dashLineTo(context, fromX, fromY, toX, toY, dash = 2, gap = 4) { - const xDiff = toX - fromX; - const yDiff = toY - fromY; - const arc = Math.atan2(yDiff, xDiff); - const offsetX = Math.cos(arc); - const offsetY = Math.sin(arc); - let posX = fromX; - let posY = fromY; - let dist = Math.hypot(xDiff, yDiff); - while (dist > 0) { - const step = Math.min(dist, dash); - context.moveTo(posX, posY); - context.lineTo(posX + offsetX * step, posY + offsetY * step); - posX += offsetX * (dash + gap); - posY += offsetY * (dash + gap); - dist -= dash + gap; - } -} -exports.dashLineTo = dashLineTo; -/** - * change format from poly-decomp to SAT.js + * change format from SAT.js to poly-decomp */ function mapVectorToArray({ x, y } = { x: 0, y: 0 }) { return [x, y]; } exports.mapVectorToArray = mapVectorToArray; /** - * change format from SAT.js to poly-decomp + * change format from poly-decomp to SAT.js */ function mapArrayToVector([x, y] = [0, 0]) { return { x, y }; @@ -1714,13 +1703,33 @@ exports.getBounceDirection = getBounceDirection; /** * returns correct sat.js testing function based on body types */ -function getSATTest(body, wall) { - if (body.type === model_1.BodyType.Circle) { - return wall.type === model_1.BodyType.Circle ? sat_1.testCircleCircle : sat_1.testCirclePolygon; - } - return wall.type === model_1.BodyType.Circle ? sat_1.testPolygonCircle : sat_1.testPolygonPolygon; +function getSATTest(bodyA, bodyB) { + const check = bodyA.type === model_1.BodyType.Circle ? circleSATFunctions : polygonSATFunctions; + return check[bodyB.type]; } exports.getSATTest = getSATTest; +/** + * draws dashed line on canvas context + */ +function dashLineTo(context, fromX, fromY, toX, toY, dash = 2, gap = 4) { + const xDiff = toX - fromX; + const yDiff = toY - fromY; + const arc = Math.atan2(yDiff, xDiff); + const offsetX = Math.cos(arc); + const offsetY = Math.sin(arc); + let posX = fromX; + let posY = fromY; + let dist = Math.hypot(xDiff, yDiff); + while (dist > 0) { + const step = Math.min(dist, dash); + context.moveTo(posX, posY); + context.lineTo(posX + offsetX * step, posY + offsetY * step); + posX += offsetX * (dash + gap); + posY += offsetY * (dash + gap); + dist -= dash + gap; + } +} +exports.dashLineTo = dashLineTo; /** * draw polygon */ @@ -1748,7 +1757,7 @@ function drawPolygon(context, { pos, calcPoints, }, isTrigger = false) { } exports.drawPolygon = drawPolygon; /** - * draw body bounding body + * draw body bounding body box */ function drawBVH(context, body) { drawPolygon(context, { @@ -1762,16 +1771,20 @@ exports.drawBVH = drawBVH; */ function cloneResponse(response) { const clone = new sat_1.Response(); - clone.a = response.a; - clone.b = response.b; - clone.overlap = response.overlap; - clone.overlapN = response.overlapN.clone(); - clone.overlapV = response.overlapV.clone(); - clone.aInB = response.aInB; - clone.bInA = response.bInA; + const { a, b, overlap, overlapN, overlapV, aInB, bInA } = response; + clone.a = a; + clone.b = b; + clone.overlap = overlap; + clone.overlapN = overlapN.clone(); + clone.overlapV = overlapV.clone(); + clone.aInB = aInB; + clone.bInA = bInA; return clone; } exports.cloneResponse = cloneResponse; +/** + * dummy fn used as default, for optimization + */ function returnTrue() { return true; } diff --git a/dist/intersect.d.ts b/dist/intersect.d.ts index 2a12adea..0529d323 100644 --- a/dist/intersect.d.ts +++ b/dist/intersect.d.ts @@ -18,7 +18,7 @@ export declare function pointOnCircle(point: Vector, circle: Pick, b: Pick): boolean; +export declare function circleInCircle(bodyA: Pick, bodyB: Pick): boolean; /** * https://stackoverflow.com/a/68197894/1749528 */ diff --git a/dist/intersect.js b/dist/intersect.js index 69d877d4..0a1e5e94 100644 --- a/dist/intersect.js +++ b/dist/intersect.js @@ -38,13 +38,13 @@ exports.pointOnCircle = pointOnCircle; /** * https://stackoverflow.com/a/68197894/1749528 */ -function circleInCircle(a, b) { - const x1 = a.pos.x; - const y1 = a.pos.y; - const x2 = b.pos.x; - const y2 = b.pos.y; - const r1 = a.r; - const r2 = b.r; +function circleInCircle(bodyA, bodyB) { + const x1 = bodyA.pos.x; + const y1 = bodyA.pos.y; + const x2 = bodyB.pos.x; + const y2 = bodyB.pos.y; + const r1 = bodyA.r; + const r2 = bodyB.r; const distSq = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); return distSq + r2 === r1 || distSq + r2 < r1; } diff --git a/dist/model.d.ts b/dist/model.d.ts index 8a171d8b..9f1e3e01 100644 --- a/dist/model.d.ts +++ b/dist/model.d.ts @@ -165,4 +165,5 @@ export interface BodyProps extends Required = (bodyA: T, bodyB: Y, response: Response) => boolean; +export type InTest = (bodyA: TBody, bodyB: TBody) => boolean; export type TraverseFunction = (child: Leaf, children: Leaf[], index: number) => boolean | void; diff --git a/dist/utils.d.ts b/dist/utils.d.ts index ecec6c05..1b0f5a12 100644 --- a/dist/utils.d.ts +++ b/dist/utils.d.ts @@ -1,8 +1,8 @@ import { BBox } from "rbush"; import { Point as DecompPoint } from "poly-decomp"; -import { Response, testCircleCircle, testCirclePolygon, testPolygonCircle, testPolygonPolygon, Vector as SATVector } from "sat"; +import { Response, Vector as SATVector } from "sat"; import { Polygon } from "./bodies/polygon"; -import { Body, BodyOptions, PotentialVector, SATPolygon, Vector } from "./model"; +import { Body, BodyOptions, PotentialVector, SATPolygon, Vector, SATTest } from "./model"; export declare const DEG2RAD: number; export declare const RAD2DEG: number; /** @@ -18,27 +18,27 @@ export declare function rad2deg(radians: number): number; */ export declare function createEllipse(radiusX: number, radiusY?: number, step?: number): SATVector[]; /** - * creates box polygon points + * creates box shaped polygon points */ export declare function createBox(width: number, height: number): SATVector[]; /** - * ensure Vector point + * ensure SATVector type point result */ export declare function ensureVectorPoint(point?: PotentialVector): SATVector; /** * ensure Vector points (for polygon) in counter-clockwise order */ -export declare function ensurePolygonPoints(points: PotentialVector[]): SATVector[]; +export declare function ensurePolygonPoints(points?: PotentialVector[]): SATVector[]; /** * get distance between two Vector points */ -export declare function distance(a: Vector, b: Vector): number; +export declare function distance(bodyA: Vector, bodyB: Vector): number; /** - * check direction of polygon + * check [is clockwise] direction of polygon */ export declare function clockwise(points: Vector[]): boolean; /** - * used for all types of bodies + * used for all types of bodies in constructor */ export declare function extendBody(body: Body, options?: BodyOptions): void; /** @@ -48,29 +48,25 @@ export declare function bodyMoved(body: Body): boolean; /** * returns true if two boxes not intersect */ -export declare function notIntersectAABB(a: BBox, b: BBox): boolean; +export declare function notIntersectAABB(bodyA: BBox, bodyB: BBox): boolean; /** * checks if two boxes intersect */ -export declare function intersectAABB(a: BBox, b: BBox): boolean; +export declare function intersectAABB(bodyA: BBox, bodyB: BBox): boolean; /** * checks if body a is in body b */ -export declare function checkAInB(a: Body, b: Body): boolean; +export declare function checkAInB(bodyA: Body, bodyB: Body): boolean; /** * clone sat vector points array into vector points array */ export declare function clonePointsArray(points: SATVector[]): Vector[]; /** - * draws dashed line on canvas context - */ -export declare function dashLineTo(context: CanvasRenderingContext2D, fromX: number, fromY: number, toX: number, toY: number, dash?: number, gap?: number): void; -/** - * change format from poly-decomp to SAT.js + * change format from SAT.js to poly-decomp */ export declare function mapVectorToArray({ x, y }?: Vector): DecompPoint; /** - * change format from SAT.js to poly-decomp + * change format from poly-decomp to SAT.js */ export declare function mapArrayToVector([x, y]?: DecompPoint): Vector; /** @@ -80,7 +76,11 @@ export declare function getBounceDirection(body: Vector, collider: Vector): SATV /** * returns correct sat.js testing function based on body types */ -export declare function getSATTest(body: Body, wall: Body): typeof testCircleCircle | typeof testCirclePolygon | typeof testPolygonCircle | typeof testPolygonPolygon; +export declare function getSATTest(bodyA: Body, bodyB: Body): SATTest; +/** + * draws dashed line on canvas context + */ +export declare function dashLineTo(context: CanvasRenderingContext2D, fromX: number, fromY: number, toX: number, toY: number, dash?: number, gap?: number): void; /** * draw polygon */ @@ -88,11 +88,14 @@ export declare function drawPolygon(context: CanvasRenderingContext2D, { pos, ca pos: Vector; }, isTrigger?: boolean): void; /** - * draw body bounding body + * draw body bounding body box */ export declare function drawBVH(context: CanvasRenderingContext2D, body: Body): void; /** * clone response object returning new response with previous ones values */ export declare function cloneResponse(response: Response): Response; +/** + * dummy fn used as default, for optimization + */ export declare function returnTrue(): boolean; diff --git a/dist/utils.js b/dist/utils.js index ec7b32d4..f6b7e2c8 100644 --- a/dist/utils.js +++ b/dist/utils.js @@ -1,10 +1,30 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.returnTrue = exports.cloneResponse = exports.drawBVH = exports.drawPolygon = exports.getSATTest = exports.getBounceDirection = exports.mapArrayToVector = exports.mapVectorToArray = exports.dashLineTo = exports.clonePointsArray = exports.checkAInB = exports.intersectAABB = exports.notIntersectAABB = exports.bodyMoved = exports.extendBody = exports.clockwise = exports.distance = exports.ensurePolygonPoints = exports.ensureVectorPoint = exports.createBox = exports.createEllipse = exports.rad2deg = exports.deg2rad = exports.RAD2DEG = exports.DEG2RAD = void 0; +exports.returnTrue = exports.cloneResponse = exports.drawBVH = exports.drawPolygon = exports.dashLineTo = exports.getSATTest = exports.getBounceDirection = exports.mapArrayToVector = exports.mapVectorToArray = exports.clonePointsArray = exports.checkAInB = exports.intersectAABB = exports.notIntersectAABB = exports.bodyMoved = exports.extendBody = exports.clockwise = exports.distance = exports.ensurePolygonPoints = exports.ensureVectorPoint = exports.createBox = exports.createEllipse = exports.rad2deg = exports.deg2rad = exports.RAD2DEG = exports.DEG2RAD = void 0; const sat_1 = require("sat"); const intersect_1 = require("./intersect"); const model_1 = require("./model"); const optimized_1 = require("./optimized"); +/* helpers for faster getSATTest() and checkAInB() */ +const testMap = { + satCircleCircle: sat_1.testCircleCircle, + satCirclePolygon: sat_1.testCirclePolygon, + satPolygonCircle: sat_1.testPolygonCircle, + satPolygonPolygon: sat_1.testPolygonPolygon, + inCircleCircle: intersect_1.circleInCircle, + inCirclePolygon: intersect_1.circleInPolygon, + inPolygonCircle: intersect_1.polygonInCircle, + inPolygonPolygon: intersect_1.polygonInPolygon, +}; +function createMap(bodyType, testType) { + return Object.values(model_1.BodyType).reduce((result, type) => (Object.assign(Object.assign({}, result), { [type]: type === model_1.BodyType.Circle + ? testMap[`${testType}${bodyType}Circle`] + : testMap[`${testType}${bodyType}Polygon`] })), {}); +} +const circleSATFunctions = createMap(model_1.BodyType.Circle, "sat"); +const circleInFunctions = createMap(model_1.BodyType.Circle, "in"); +const polygonSATFunctions = createMap(model_1.BodyType.Polygon, "sat"); +const polygonInFunctions = createMap(model_1.BodyType.Polygon, "in"); exports.DEG2RAD = Math.PI / 180; exports.RAD2DEG = 180 / Math.PI; /** @@ -27,16 +47,18 @@ exports.rad2deg = rad2deg; function createEllipse(radiusX, radiusY = radiusX, step = 1) { const steps = Math.PI * Math.hypot(radiusX, radiusY) * 2; const length = Math.max(8, Math.ceil(steps / Math.max(1, step))); - return Array.from({ length }, (_, index) => { + const ellipse = []; + for (let index = 0; index < length; index++) { const value = (index / length) * 2 * Math.PI; const x = Math.cos(value) * radiusX; const y = Math.sin(value) * radiusY; - return new sat_1.Vector(x, y); - }); + ellipse.push(new sat_1.Vector(x, y)); + } + return ellipse; } exports.createEllipse = createEllipse; /** - * creates box polygon points + * creates box shaped polygon points */ function createBox(width, height) { return [ @@ -48,7 +70,7 @@ function createBox(width, height) { } exports.createBox = createBox; /** - * ensure Vector point + * ensure SATVector type point result */ function ensureVectorPoint(point = {}) { return point instanceof sat_1.Vector @@ -59,10 +81,7 @@ exports.ensureVectorPoint = ensureVectorPoint; /** * ensure Vector points (for polygon) in counter-clockwise order */ -function ensurePolygonPoints(points) { - if (!points) { - throw new Error("No points array provided"); - } +function ensurePolygonPoints(points = []) { const polygonPoints = (0, optimized_1.map)(points, ensureVectorPoint); return clockwise(polygonPoints) ? polygonPoints.reverse() : polygonPoints; } @@ -70,25 +89,27 @@ exports.ensurePolygonPoints = ensurePolygonPoints; /** * get distance between two Vector points */ -function distance(a, b) { - return Math.hypot(a.x - b.x, a.y - b.y); +function distance(bodyA, bodyB) { + const xDiff = bodyA.x - bodyB.x; + const yDiff = bodyA.y - bodyB.y; + return Math.hypot(xDiff, yDiff); } exports.distance = distance; /** - * check direction of polygon + * check [is clockwise] direction of polygon */ function clockwise(points) { + const length = points.length; let sum = 0; - for (let i = 0; i < points.length; i++) { - const v1 = points[i]; - const v2 = points[(i + 1) % points.length]; + (0, optimized_1.forEach)(points, (v1, index) => { + const v2 = points[(index + 1) % length]; sum += (v2.x - v1.x) * (v2.y + v1.y); - } + }); return sum > 0; } exports.clockwise = clockwise; /** - * used for all types of bodies + * used for all types of bodies in constructor */ function extendBody(body, options) { body.isStatic = !!(options === null || options === void 0 ? void 0 : options.isStatic); @@ -104,83 +125,51 @@ exports.extendBody = extendBody; * check if body moved outside of its padding */ function bodyMoved(body) { - return (body.bbox.minX < body.minX || - body.bbox.minY < body.minY || - body.bbox.maxX > body.maxX || - body.bbox.maxY > body.maxY); + const { bbox, minX, minY, maxX, maxY } = body; + return (bbox.minX < minX || bbox.minY < minY || bbox.maxX > maxX || bbox.maxY > maxY); } exports.bodyMoved = bodyMoved; /** * returns true if two boxes not intersect */ -function notIntersectAABB(a, b) { - return (b.minX > a.maxX || b.minY > a.maxY || b.maxX < a.minX || b.maxY < a.minY); +function notIntersectAABB(bodyA, bodyB) { + return (bodyB.minX > bodyA.maxX || + bodyB.minY > bodyA.maxY || + bodyB.maxX < bodyA.minX || + bodyB.maxY < bodyA.minY); } exports.notIntersectAABB = notIntersectAABB; /** * checks if two boxes intersect */ -function intersectAABB(a, b) { - return !notIntersectAABB(a, b); +function intersectAABB(bodyA, bodyB) { + return !notIntersectAABB(bodyA, bodyB); } exports.intersectAABB = intersectAABB; /** * checks if body a is in body b */ -function checkAInB(a, b) { - if (a.type === model_1.BodyType.Circle) { - if (b.type !== model_1.BodyType.Circle) { - return (0, intersect_1.circleInPolygon)(a, b); - } - return (0, intersect_1.circleInCircle)(a, b); - } - if (b.type === model_1.BodyType.Circle) { - return (0, intersect_1.polygonInCircle)(a, b); - } - return (0, intersect_1.polygonInPolygon)(a, b); +function checkAInB(bodyA, bodyB) { + const check = bodyA.type === model_1.BodyType.Circle ? circleInFunctions : polygonInFunctions; + return check[bodyB.type](bodyA, bodyB); } exports.checkAInB = checkAInB; /** * clone sat vector points array into vector points array */ function clonePointsArray(points) { - return (0, optimized_1.map)(points, ({ x, y }) => ({ - x, - y, - })); + return (0, optimized_1.map)(points, ({ x, y }) => ({ x, y })); } exports.clonePointsArray = clonePointsArray; /** - * draws dashed line on canvas context - */ -function dashLineTo(context, fromX, fromY, toX, toY, dash = 2, gap = 4) { - const xDiff = toX - fromX; - const yDiff = toY - fromY; - const arc = Math.atan2(yDiff, xDiff); - const offsetX = Math.cos(arc); - const offsetY = Math.sin(arc); - let posX = fromX; - let posY = fromY; - let dist = Math.hypot(xDiff, yDiff); - while (dist > 0) { - const step = Math.min(dist, dash); - context.moveTo(posX, posY); - context.lineTo(posX + offsetX * step, posY + offsetY * step); - posX += offsetX * (dash + gap); - posY += offsetY * (dash + gap); - dist -= dash + gap; - } -} -exports.dashLineTo = dashLineTo; -/** - * change format from poly-decomp to SAT.js + * change format from SAT.js to poly-decomp */ function mapVectorToArray({ x, y } = { x: 0, y: 0 }) { return [x, y]; } exports.mapVectorToArray = mapVectorToArray; /** - * change format from SAT.js to poly-decomp + * change format from poly-decomp to SAT.js */ function mapArrayToVector([x, y] = [0, 0]) { return { x, y }; @@ -199,13 +188,33 @@ exports.getBounceDirection = getBounceDirection; /** * returns correct sat.js testing function based on body types */ -function getSATTest(body, wall) { - if (body.type === model_1.BodyType.Circle) { - return wall.type === model_1.BodyType.Circle ? sat_1.testCircleCircle : sat_1.testCirclePolygon; - } - return wall.type === model_1.BodyType.Circle ? sat_1.testPolygonCircle : sat_1.testPolygonPolygon; +function getSATTest(bodyA, bodyB) { + const check = bodyA.type === model_1.BodyType.Circle ? circleSATFunctions : polygonSATFunctions; + return check[bodyB.type]; } exports.getSATTest = getSATTest; +/** + * draws dashed line on canvas context + */ +function dashLineTo(context, fromX, fromY, toX, toY, dash = 2, gap = 4) { + const xDiff = toX - fromX; + const yDiff = toY - fromY; + const arc = Math.atan2(yDiff, xDiff); + const offsetX = Math.cos(arc); + const offsetY = Math.sin(arc); + let posX = fromX; + let posY = fromY; + let dist = Math.hypot(xDiff, yDiff); + while (dist > 0) { + const step = Math.min(dist, dash); + context.moveTo(posX, posY); + context.lineTo(posX + offsetX * step, posY + offsetY * step); + posX += offsetX * (dash + gap); + posY += offsetY * (dash + gap); + dist -= dash + gap; + } +} +exports.dashLineTo = dashLineTo; /** * draw polygon */ @@ -233,7 +242,7 @@ function drawPolygon(context, { pos, calcPoints, }, isTrigger = false) { } exports.drawPolygon = drawPolygon; /** - * draw body bounding body + * draw body bounding body box */ function drawBVH(context, body) { drawPolygon(context, { @@ -247,16 +256,20 @@ exports.drawBVH = drawBVH; */ function cloneResponse(response) { const clone = new sat_1.Response(); - clone.a = response.a; - clone.b = response.b; - clone.overlap = response.overlap; - clone.overlapN = response.overlapN.clone(); - clone.overlapV = response.overlapV.clone(); - clone.aInB = response.aInB; - clone.bInA = response.bInA; + const { a, b, overlap, overlapN, overlapV, aInB, bInA } = response; + clone.a = a; + clone.b = b; + clone.overlap = overlap; + clone.overlapN = overlapN.clone(); + clone.overlapV = overlapV.clone(); + clone.aInB = aInB; + clone.bInA = bInA; return clone; } exports.cloneResponse = cloneResponse; +/** + * dummy fn used as default, for optimization + */ function returnTrue() { return true; } diff --git a/docs/assets/navigation.js b/docs/assets/navigation.js index 40ab04d3..c6605a5c 100644 --- a/docs/assets/navigation.js +++ b/docs/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAE52XXW+bMBSG/wvX6bpma7flDpJ+SZ1apag30y5cOE2sEBvZJgua9t8nPhKwfThEufX7vg9g+/iYX38DA3sTzIJIpmVc5hBMgpyZdTALQBRbfXkY/7Q22yyYBBsu0mD2/d+kl9x3oSRjWkMV29uJq2k/M+cqycCPNeNU8jbLeK6RaCtQ2ScukGA1SqVeJBfGj9XDdC4rV1JgyVqgssuo0Gs/WQ97uUmjB7PA6PSC6wvYG1CCZUGfCDqXApu4g3Ie9zWMhxbzKJ1NHpzCTjub/QaJkQpFN9KZ5FIb2CLYepxa88gqJC4MqA+WVLXkFdP0+uakl6mK9zk3XAqNkzvde4CDeVEyH4bUKoWYr3mWKhALZhhK6Rso0CBgLHgPJgyjKNRD09w3UKAXaUAYzjJ3B/VYjofCLVmZMG0euEFJnUxBiFcZf4NqAbuoKfN2UZ3M5x/frq6n1ppCspnLLOOaSzFnWfbOko1Lwl1j7AUkcps7R28D7EmnUpxTxOYgx4hPegL24QKqsbHcaxjHoL1vaIfH0rFiO1Aa7gqRVFXqYlx9dD5u76fLcNFhdkxx9p5Vs9FINuFLP7wMF9PF7T0WbiUi/C7T8qfcQdrFP9qX1pdH0QbcfO0BkmobhY8iwgBHkQLUrehRuN2qR7EcJ6C8jeWz0O2FwJ4Lo3kKo0TbR2EzmWz+cI1/6UGkAQLqKtOhUqwc4FieMZx/CXFY+F3EBilgBqxDvAc5iKMA7x7pQtD7pAVKmV5Xl8dYYpROpRCwmiqGFkUrXVxRca4NEwn6FQeNiiv2J3p7QNONNBImtmtPJiAgdKFgLsUO0PXs66OY9nHNfhymWbZRaNM+nUbkInsmCrg3IFK72/ZIR5VArMBEshAJLLgCpyV0KN9FI70mZaHQXmUh6tuGhqS+P2EUy3AKqCqc4YMasZ0KtX8BB5D+HyENvGP45KHGU8FEbWE+Cqtf+TYfmMpWI+JblteHeyzdW2aHcT00rvHEcrCvuB4CJ6R5HNt+rofA5VUNk53ddoyhnon7hmUgQfWjqKuLYzkFRn6i7SFwiqXTFFYYpZXIBqbAFErEqkC/qlM9xO//nJ8SULoSAAA=" \ No newline at end of file +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAE52XXW+bMBSG/wvX6bpma7flDpJ+ROrUqkW9mXbhwmlihdjINlnQtP8+8ZGA7cMhyq3f930A28fH/PobGNibYBZEMi3jModgEuTMrINZAKLY6svD+Ke12WbBJNhwkQaz7/8mveS+CyUZ0xqq2N5OXE37mTlXSQZ+rBmnkrdZxnONRFuByj5ygQSrUSr1LLkwfqwepnNZuZICS9YClX2JCr32k/Wwl5s0ejALjE4vuL6AvQElWBb0iaBzKbCJOyjncV/DeGgxj9LZ5MEp7LSz2W+QGKlQdCOdSS61gS2CrcepNY+sQuLCgPpgSVVLXjFNr29OepmqeJ9yw6XQOLnTvQc4mGcl82FIrVKI+ZpnqQKxYIahlL6BAg0CxoL3YMIwikI9NM19AwV6lgaE4Sxzd1CP5Xgo3AsrE6bNAzcoqZMpCPEq429QLWAXNWXeLqqT+fzj29X11FpTSDZzmWVccynmLMveWbJxSbhrjL2ARG5z5+htgD3pVIpzitgc5BjxSUsRg/ZepRkdyz4C+3CT1dhY7jWMsYe2w2PpWLEdKA13hUiqCncxrj46l7f305dw0WF2THH2nlUz2Ug24Us//BIupovbeyzcSkT4XablT7mDtIt/tC+tL4+iDbj52gMk1RYMlyLCAEeRAtRtbCncTtejWI4TUN6m9Fno1kRgT4XRPIVRou2jsJlMNn+4xr/0INIAAXWF6lApVg5wLM8Yzr/AOCz8HmODFDADVgPoQQ7iKMC7g7oQ9C5qgVKm19XFM5YYpVMpBKymiqFF0UoXV1Sca8NEgn7FQaPiiv2J3h7QdCONhInt2pMJCAhdKJhLsQN0Pfv6KKZ9XLMfh2mWbRTatF6nibnInokC7g2I1O7UPdJRJRArMJEsRAILrsBpCR3Kd9FIr0lZKLRXWYj6pqIhqe9eGMUynAKqCmf4oEZsp0Lt38cBpP83SQPvGD55qPFUMFFbmI/C6le+zQemstWI+Jbl9eEeS/eG2mFcD41rPLEc7Cuuh8AJaZZj28/1ELi8qmGys9uOMdQTcd+wDCSofhR1dXEsp8DIT7Q9BE6xdJrCCqO0EtnAFJhCiVgV6Fd1qof4/R/5KnJH9hIAAA==" \ No newline at end of file diff --git a/docs/assets/search.js b/docs/assets/search.js index b6fea198..a32ae83c 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE72dW4/bOLLHv8qB89qTMYu65i2X3dkBzsEsZoI9O2gMAsVWEiPdtmG7c8FgvvuBKFEqlqp4kb3nYZGdNsW/yCKrij9S0p+r0+HrefXi/s/V591+u3oB67pUOdyt9s1ju3qxetNuDo/Hfx4evn887Fd3q6fTw+rF6vL92J5/dH57/uny+LC6W20emvO5Pa9erFZ/3YVq3e0vQp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Rkr8/t5cZJshQvmLzn8oOWJstqtKGS0tnwWaAWky1zxZPOHJoHttAbndblLbR304LsOENbCqlxW27c4cyKNMrnd1CazOLVsCOGLB5h1ayzS7H4bvgTntQx9t0tBpRtu1Hi4rALnjATge9lk19mc3hDE0tu1lV2SmsbTfaxoBdOYNNdbUSh8alcblIhZw8iDBhdugD9/davGr4zDeaa8g5ZcNYK8c1hu3G3LZnbZ3UeALDZuwapAl+OTX78wP10zji6vFsgR3kdpaDHf9aSc5w+kwljlo4fGSSpe2l9os0jsWRwxPh0uzwEcZvQ5/ZMW+XZ8q6RGURMdj5ASJ/etqbIbntUxAnuqCWigto+yFY3EP4VjMpl+gvpE4vR3HQHopS9rSOqsYM31rTDihtvYrOxIYaQWdv185+179gymEHrrIRCaxDg3IcngmKrhLO+m3oU9bVgB4XqnYjSMxdeyWOfxW4Nesxaxl3xa2YbShU0mxg0mqH0AuXORtwTvYvNWZ+fAzTewtCQNzXdbczsM8b1+WDm7WxCUbqaEtYQgHWP+m1NJDdo19402tMhgY5O5bsdoOyERDsviLYDVLNO9o/7lbH3bHHxC/u//jrr/8DuyyqvskNAQA="; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE72dW4/jNrLHv8qB59WZmEVd520uu9kA5yCLZLBng0Yw0NiabmO6bcNWzwVBvvuBKFEqlqpISvaeh8Vs2lT9RRbJKv5ISX+uzsevl9Wruz9Xn/eH3eoVbMpcpbBeHaqnevVq9a7eHp9O/zw+fr8/Hlbr1fP5cfVq1Xw/1Zcfnd9ePjRPj6v1avtYXS71ZfVqtfprHbK6PzSCzf2hmWXx7UO9/fz2+Pi4v+yPh7fV4+PHavuZGOcLeXWyNNXZoPLhQ2so3uqL4QJkfL06Vef60Mh3PcoXg/Sb4+77eyxeH56fLj/aP3srocYa/O3xcX+6eK28GMvwdz3cCqvw3/uD33xfYIntt/vz9tFvfSiyxP6b4zev8e73JZbdvs7ZtiWWWXfHJ2/flolWoIPsv+vqE+n87Z/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LUwo0yYPIICanRXB7b8Sr+g+Qo7GG5sukb6x8GGu2GbMhP7eTlF1Rapuxa5AGeHOuDpdHOk/jiGuX8coSBrCjHGz/1yBNhuMHNHHUwuEjlTxtL7XfynE8jiYhkUlNTi9hEtZXwfZ5tRla0w7ucghLtroit3o+mD6563IQJ7ygqooraPuNWtxEGJUnUjLRXUhnvRRFA3ucStnuowo7Z9mBAbZHaTut6ESsqBF0NoXt8HcnGAyqbERSNiSBndGgGPrnDEVHqcCZuZ1qVDGsZwZ8YTeQQBp+nRIHwDJcG7uQUMMMU1oxW1EopeHA5NXOzpBwmbNx5yyzpGabHjzD1N+SEBD3g91tEDR9DTtydgDZ4AQDdrTRwyIKsBOU3kgd2T00hufYYbXWy9m+ZH9QNgSC3Y8Eu7Gq+Zn2j/XqtD91ePnV3R9//fV/M5KLBQsPAQA="; \ No newline at end of file diff --git a/docs/classes/System.html b/docs/classes/System.html index 30f72d41..8e99c528 100644 --- a/docs/classes/System.html +++ b/docs/classes/System.html @@ -41,7 +41,7 @@ is a reasonable choice for most applications. Higher value means faster insertion and slower search, and vice versa.

-

Returns System<TBody>

Properties

ray: Line

for raycasting

+

Returns System<TBody>

Properties

ray: Line

for raycasting

response: Response = ...

the last collision result

Methods

  • Returns all items contained in the tree.

    Returns TBody[]

  • check all bodies collisions with callback

    @@ -74,14 +74,14 @@

Returns number

Example

class MyRBush<T> extends RBush<T> {
toBBox([x, y]) { return { minX: x, minY: y, maxX: x, maxY: y }; }
compareMinX(a, b) { return a.x - b.x; }
compareMinY(a, b) { return a.y - b.y; }
}
const tree = new MyRBush<[number, number]>();
tree.insert([20, 50]); // accepts [x, y] points
  • create box at position with options and add to system

    -

    Parameters

    Returns Box

  • create ellipse at position with options and add to system

    -

    Parameters

    Returns Ellipse

  • draw exact bodies colliders outline

    -

    Parameters

    • context: CanvasRenderingContext2D

    Returns void

  • draw bounding boxes hierarchy outline

    -

    Parameters

    • context: CanvasRenderingContext2D

    Returns void

  • create ellipse at position with options and add to system

    +

    Parameters

    Returns Ellipse

  • draw exact bodies colliders outline

    +

    Parameters

    • context: CanvasRenderingContext2D

    Returns void

  • draw bounding boxes hierarchy outline

    +

    Parameters

    • context: CanvasRenderingContext2D

    Returns void

  • Imports previously exported data into the tree (i.e., data that was emitted by toJSON()).

    Importing and exporting as JSON allows you to use RBush on both the server (using Node.js) and the browser combined, e.g. first indexing the @@ -92,9 +92,9 @@

    Parameters

    • data: any

      The previously exported JSON data.

    Returns RBush<TBody>

  • get object potential colliders

    Parameters

    Returns TBody[]

    Deprecated

    because it's slower to use than checkOne() or checkAll()

    -
  • Bulk-inserts the given items into the tree.

    Bulk insertion is usually ~2-3 times faster than inserting items one by one. After bulk loading (bulk insertion into an empty tree), subsequent query performance is also ~20-30% better.

    @@ -106,7 +106,7 @@

    Parameters

    • items: readonly TBody[]

      The items to load.

    Returns RBush<TBody>

  • Returns an array of data items (points or rectangles) that the given bounding box intersects.

    Note that the search method accepts a bounding box in {minX, minY, maxX, maxY} format regardless of the data format.

    Parameters

    • box: BBox

      The bounding box in which to search.

      @@ -128,6 +128,6 @@

      Note that the maxEntries option from the constructor must be the same in both trees for export/import to work properly.

      Returns any

  • used to find body deep inside data with finder function returning boolean found or not

    -

    Parameters

    Returns undefined | TBody

  • update all bodies aabb

    -

    Returns void

  • updates body in collision tree

    -

    Parameters

    Returns void

Generated using TypeDoc

\ No newline at end of file +

Parameters

Returns undefined | TBody

  • update all bodies aabb

    +

    Returns void

  • updates body in collision tree

    +

    Parameters

    Returns void

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/demo/demo.js b/docs/demo/demo.js index b957d4d1..ef6ed4c4 100644 --- a/docs/demo/demo.js +++ b/docs/demo/demo.js @@ -1044,13 +1044,13 @@ exports.pointOnCircle = pointOnCircle; /** * https://stackoverflow.com/a/68197894/1749528 */ -function circleInCircle(a, b) { - const x1 = a.pos.x; - const y1 = a.pos.y; - const x2 = b.pos.x; - const y2 = b.pos.y; - const r1 = a.r; - const r2 = b.r; +function circleInCircle(bodyA, bodyB) { + const x1 = bodyA.pos.x; + const y1 = bodyA.pos.y; + const x2 = bodyB.pos.x; + const y2 = bodyB.pos.y; + const r1 = bodyA.r; + const r2 = bodyB.r; const distSq = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); return distSq + r2 === r1 || distSq + r2 < r1; } @@ -1515,11 +1515,31 @@ exports.System = System; "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.returnTrue = exports.cloneResponse = exports.drawBVH = exports.drawPolygon = exports.getSATTest = exports.getBounceDirection = exports.mapArrayToVector = exports.mapVectorToArray = exports.dashLineTo = exports.clonePointsArray = exports.checkAInB = exports.intersectAABB = exports.notIntersectAABB = exports.bodyMoved = exports.extendBody = exports.clockwise = exports.distance = exports.ensurePolygonPoints = exports.ensureVectorPoint = exports.createBox = exports.createEllipse = exports.rad2deg = exports.deg2rad = exports.RAD2DEG = exports.DEG2RAD = void 0; +exports.returnTrue = exports.cloneResponse = exports.drawBVH = exports.drawPolygon = exports.dashLineTo = exports.getSATTest = exports.getBounceDirection = exports.mapArrayToVector = exports.mapVectorToArray = exports.clonePointsArray = exports.checkAInB = exports.intersectAABB = exports.notIntersectAABB = exports.bodyMoved = exports.extendBody = exports.clockwise = exports.distance = exports.ensurePolygonPoints = exports.ensureVectorPoint = exports.createBox = exports.createEllipse = exports.rad2deg = exports.deg2rad = exports.RAD2DEG = exports.DEG2RAD = void 0; const sat_1 = __webpack_require__(/*! sat */ "./node_modules/sat/SAT.js"); const intersect_1 = __webpack_require__(/*! ./intersect */ "./dist/intersect.js"); const model_1 = __webpack_require__(/*! ./model */ "./dist/model.js"); const optimized_1 = __webpack_require__(/*! ./optimized */ "./dist/optimized.js"); +/* helpers for faster getSATTest() and checkAInB() */ +const testMap = { + satCircleCircle: sat_1.testCircleCircle, + satCirclePolygon: sat_1.testCirclePolygon, + satPolygonCircle: sat_1.testPolygonCircle, + satPolygonPolygon: sat_1.testPolygonPolygon, + inCircleCircle: intersect_1.circleInCircle, + inCirclePolygon: intersect_1.circleInPolygon, + inPolygonCircle: intersect_1.polygonInCircle, + inPolygonPolygon: intersect_1.polygonInPolygon, +}; +function createMap(bodyType, testType) { + return Object.values(model_1.BodyType).reduce((result, type) => (Object.assign(Object.assign({}, result), { [type]: type === model_1.BodyType.Circle + ? testMap[`${testType}${bodyType}Circle`] + : testMap[`${testType}${bodyType}Polygon`] })), {}); +} +const circleSATFunctions = createMap(model_1.BodyType.Circle, "sat"); +const circleInFunctions = createMap(model_1.BodyType.Circle, "in"); +const polygonSATFunctions = createMap(model_1.BodyType.Polygon, "sat"); +const polygonInFunctions = createMap(model_1.BodyType.Polygon, "in"); exports.DEG2RAD = Math.PI / 180; exports.RAD2DEG = 180 / Math.PI; /** @@ -1542,16 +1562,18 @@ exports.rad2deg = rad2deg; function createEllipse(radiusX, radiusY = radiusX, step = 1) { const steps = Math.PI * Math.hypot(radiusX, radiusY) * 2; const length = Math.max(8, Math.ceil(steps / Math.max(1, step))); - return Array.from({ length }, (_, index) => { + const ellipse = []; + for (let index = 0; index < length; index++) { const value = (index / length) * 2 * Math.PI; const x = Math.cos(value) * radiusX; const y = Math.sin(value) * radiusY; - return new sat_1.Vector(x, y); - }); + ellipse.push(new sat_1.Vector(x, y)); + } + return ellipse; } exports.createEllipse = createEllipse; /** - * creates box polygon points + * creates box shaped polygon points */ function createBox(width, height) { return [ @@ -1563,7 +1585,7 @@ function createBox(width, height) { } exports.createBox = createBox; /** - * ensure Vector point + * ensure SATVector type point result */ function ensureVectorPoint(point = {}) { return point instanceof sat_1.Vector @@ -1574,10 +1596,7 @@ exports.ensureVectorPoint = ensureVectorPoint; /** * ensure Vector points (for polygon) in counter-clockwise order */ -function ensurePolygonPoints(points) { - if (!points) { - throw new Error("No points array provided"); - } +function ensurePolygonPoints(points = []) { const polygonPoints = (0, optimized_1.map)(points, ensureVectorPoint); return clockwise(polygonPoints) ? polygonPoints.reverse() : polygonPoints; } @@ -1585,25 +1604,27 @@ exports.ensurePolygonPoints = ensurePolygonPoints; /** * get distance between two Vector points */ -function distance(a, b) { - return Math.hypot(a.x - b.x, a.y - b.y); +function distance(bodyA, bodyB) { + const xDiff = bodyA.x - bodyB.x; + const yDiff = bodyA.y - bodyB.y; + return Math.hypot(xDiff, yDiff); } exports.distance = distance; /** - * check direction of polygon + * check [is clockwise] direction of polygon */ function clockwise(points) { + const length = points.length; let sum = 0; - for (let i = 0; i < points.length; i++) { - const v1 = points[i]; - const v2 = points[(i + 1) % points.length]; + (0, optimized_1.forEach)(points, (v1, index) => { + const v2 = points[(index + 1) % length]; sum += (v2.x - v1.x) * (v2.y + v1.y); - } + }); return sum > 0; } exports.clockwise = clockwise; /** - * used for all types of bodies + * used for all types of bodies in constructor */ function extendBody(body, options) { body.isStatic = !!(options === null || options === void 0 ? void 0 : options.isStatic); @@ -1619,83 +1640,51 @@ exports.extendBody = extendBody; * check if body moved outside of its padding */ function bodyMoved(body) { - return (body.bbox.minX < body.minX || - body.bbox.minY < body.minY || - body.bbox.maxX > body.maxX || - body.bbox.maxY > body.maxY); + const { bbox, minX, minY, maxX, maxY } = body; + return (bbox.minX < minX || bbox.minY < minY || bbox.maxX > maxX || bbox.maxY > maxY); } exports.bodyMoved = bodyMoved; /** * returns true if two boxes not intersect */ -function notIntersectAABB(a, b) { - return (b.minX > a.maxX || b.minY > a.maxY || b.maxX < a.minX || b.maxY < a.minY); +function notIntersectAABB(bodyA, bodyB) { + return (bodyB.minX > bodyA.maxX || + bodyB.minY > bodyA.maxY || + bodyB.maxX < bodyA.minX || + bodyB.maxY < bodyA.minY); } exports.notIntersectAABB = notIntersectAABB; /** * checks if two boxes intersect */ -function intersectAABB(a, b) { - return !notIntersectAABB(a, b); +function intersectAABB(bodyA, bodyB) { + return !notIntersectAABB(bodyA, bodyB); } exports.intersectAABB = intersectAABB; /** * checks if body a is in body b */ -function checkAInB(a, b) { - if (a.type === model_1.BodyType.Circle) { - if (b.type !== model_1.BodyType.Circle) { - return (0, intersect_1.circleInPolygon)(a, b); - } - return (0, intersect_1.circleInCircle)(a, b); - } - if (b.type === model_1.BodyType.Circle) { - return (0, intersect_1.polygonInCircle)(a, b); - } - return (0, intersect_1.polygonInPolygon)(a, b); +function checkAInB(bodyA, bodyB) { + const check = bodyA.type === model_1.BodyType.Circle ? circleInFunctions : polygonInFunctions; + return check[bodyB.type](bodyA, bodyB); } exports.checkAInB = checkAInB; /** * clone sat vector points array into vector points array */ function clonePointsArray(points) { - return (0, optimized_1.map)(points, ({ x, y }) => ({ - x, - y, - })); + return (0, optimized_1.map)(points, ({ x, y }) => ({ x, y })); } exports.clonePointsArray = clonePointsArray; /** - * draws dashed line on canvas context - */ -function dashLineTo(context, fromX, fromY, toX, toY, dash = 2, gap = 4) { - const xDiff = toX - fromX; - const yDiff = toY - fromY; - const arc = Math.atan2(yDiff, xDiff); - const offsetX = Math.cos(arc); - const offsetY = Math.sin(arc); - let posX = fromX; - let posY = fromY; - let dist = Math.hypot(xDiff, yDiff); - while (dist > 0) { - const step = Math.min(dist, dash); - context.moveTo(posX, posY); - context.lineTo(posX + offsetX * step, posY + offsetY * step); - posX += offsetX * (dash + gap); - posY += offsetY * (dash + gap); - dist -= dash + gap; - } -} -exports.dashLineTo = dashLineTo; -/** - * change format from poly-decomp to SAT.js + * change format from SAT.js to poly-decomp */ function mapVectorToArray({ x, y } = { x: 0, y: 0 }) { return [x, y]; } exports.mapVectorToArray = mapVectorToArray; /** - * change format from SAT.js to poly-decomp + * change format from poly-decomp to SAT.js */ function mapArrayToVector([x, y] = [0, 0]) { return { x, y }; @@ -1714,13 +1703,33 @@ exports.getBounceDirection = getBounceDirection; /** * returns correct sat.js testing function based on body types */ -function getSATTest(body, wall) { - if (body.type === model_1.BodyType.Circle) { - return wall.type === model_1.BodyType.Circle ? sat_1.testCircleCircle : sat_1.testCirclePolygon; - } - return wall.type === model_1.BodyType.Circle ? sat_1.testPolygonCircle : sat_1.testPolygonPolygon; +function getSATTest(bodyA, bodyB) { + const check = bodyA.type === model_1.BodyType.Circle ? circleSATFunctions : polygonSATFunctions; + return check[bodyB.type]; } exports.getSATTest = getSATTest; +/** + * draws dashed line on canvas context + */ +function dashLineTo(context, fromX, fromY, toX, toY, dash = 2, gap = 4) { + const xDiff = toX - fromX; + const yDiff = toY - fromY; + const arc = Math.atan2(yDiff, xDiff); + const offsetX = Math.cos(arc); + const offsetY = Math.sin(arc); + let posX = fromX; + let posY = fromY; + let dist = Math.hypot(xDiff, yDiff); + while (dist > 0) { + const step = Math.min(dist, dash); + context.moveTo(posX, posY); + context.lineTo(posX + offsetX * step, posY + offsetY * step); + posX += offsetX * (dash + gap); + posY += offsetY * (dash + gap); + dist -= dash + gap; + } +} +exports.dashLineTo = dashLineTo; /** * draw polygon */ @@ -1748,7 +1757,7 @@ function drawPolygon(context, { pos, calcPoints, }, isTrigger = false) { } exports.drawPolygon = drawPolygon; /** - * draw body bounding body + * draw body bounding body box */ function drawBVH(context, body) { drawPolygon(context, { @@ -1762,16 +1771,20 @@ exports.drawBVH = drawBVH; */ function cloneResponse(response) { const clone = new sat_1.Response(); - clone.a = response.a; - clone.b = response.b; - clone.overlap = response.overlap; - clone.overlapN = response.overlapN.clone(); - clone.overlapV = response.overlapV.clone(); - clone.aInB = response.aInB; - clone.bInA = response.bInA; + const { a, b, overlap, overlapN, overlapV, aInB, bInA } = response; + clone.a = a; + clone.b = b; + clone.overlap = overlap; + clone.overlapN = overlapN.clone(); + clone.overlapV = overlapV.clone(); + clone.aInB = aInB; + clone.bInA = bInA; return clone; } exports.cloneResponse = cloneResponse; +/** + * dummy fn used as default, for optimization + */ function returnTrue() { return true; } diff --git a/docs/functions/bodyMoved.html b/docs/functions/bodyMoved.html index 6b043088..7e00eaf9 100644 --- a/docs/functions/bodyMoved.html +++ b/docs/functions/bodyMoved.html @@ -1,2 +1,2 @@ bodyMoved | Detect-Collisions

Function bodyMoved

  • check if body moved outside of its padding

    -

    Parameters

    Returns boolean

Generated using TypeDoc

\ No newline at end of file +

Parameters

Returns boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/checkAInB.html b/docs/functions/checkAInB.html index ade6017b..d2ffcf05 100644 --- a/docs/functions/checkAInB.html +++ b/docs/functions/checkAInB.html @@ -1,2 +1,2 @@ -checkAInB | Detect-Collisions

Function checkAInB

  • checks if body a is in body b

    -

    Parameters

    Returns boolean

Generated using TypeDoc

\ No newline at end of file +checkAInB | Detect-Collisions

Function checkAInB

  • checks if body a is in body b

    +

    Parameters

    Returns boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/circleInCircle.html b/docs/functions/circleInCircle.html index bd52e244..a3475b53 100644 --- a/docs/functions/circleInCircle.html +++ b/docs/functions/circleInCircle.html @@ -1,2 +1,2 @@ -circleInCircle | Detect-Collisions

Function circleInCircle

Generated using TypeDoc

\ No newline at end of file +circleInCircle | Detect-Collisions

Function circleInCircle

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/clockwise.html b/docs/functions/clockwise.html index 94bc0663..cbba73b0 100644 --- a/docs/functions/clockwise.html +++ b/docs/functions/clockwise.html @@ -1,2 +1,2 @@ -clockwise | Detect-Collisions

Function clockwise

  • check direction of polygon

    -

    Parameters

    Returns boolean

Generated using TypeDoc

\ No newline at end of file +clockwise | Detect-Collisions

Function clockwise

  • check [is clockwise] direction of polygon

    +

    Parameters

    Returns boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/clonePointsArray.html b/docs/functions/clonePointsArray.html index 9249a833..6b544f30 100644 --- a/docs/functions/clonePointsArray.html +++ b/docs/functions/clonePointsArray.html @@ -1,2 +1,2 @@ clonePointsArray | Detect-Collisions

Function clonePointsArray

Generated using TypeDoc

\ No newline at end of file +

Parameters

Returns Vector[]

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/cloneResponse.html b/docs/functions/cloneResponse.html index 47feabac..057199dd 100644 --- a/docs/functions/cloneResponse.html +++ b/docs/functions/cloneResponse.html @@ -1,2 +1,2 @@ cloneResponse | Detect-Collisions

Function cloneResponse

Generated using TypeDoc

\ No newline at end of file +

Parameters

Returns Response

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/createBox.html b/docs/functions/createBox.html index 5de94c15..e6436b7f 100644 --- a/docs/functions/createBox.html +++ b/docs/functions/createBox.html @@ -1,2 +1,2 @@ -createBox | Detect-Collisions

Function createBox

Generated using TypeDoc

\ No newline at end of file +createBox | Detect-Collisions

Function createBox

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/createEllipse.html b/docs/functions/createEllipse.html index c4dda168..445f15ab 100644 --- a/docs/functions/createEllipse.html +++ b/docs/functions/createEllipse.html @@ -1,2 +1,2 @@ createEllipse | Detect-Collisions

Function createEllipse

  • creates ellipse-shaped polygon based on params

    -

    Parameters

    • radiusX: number
    • radiusY: number = radiusX
    • step: number = 1

    Returns SATVector[]

Generated using TypeDoc

\ No newline at end of file +

Parameters

  • radiusX: number
  • radiusY: number = radiusX
  • step: number = 1

Returns SATVector[]

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/dashLineTo.html b/docs/functions/dashLineTo.html index 59ad05f8..817e7765 100644 --- a/docs/functions/dashLineTo.html +++ b/docs/functions/dashLineTo.html @@ -1,2 +1,2 @@ dashLineTo | Detect-Collisions

Function dashLineTo

  • draws dashed line on canvas context

    -

    Parameters

    • context: CanvasRenderingContext2D
    • fromX: number
    • fromY: number
    • toX: number
    • toY: number
    • dash: number = 2
    • gap: number = 4

    Returns void

Generated using TypeDoc

\ No newline at end of file +

Parameters

  • context: CanvasRenderingContext2D
  • fromX: number
  • fromY: number
  • toX: number
  • toY: number
  • dash: number = 2
  • gap: number = 4

Returns void

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/deg2rad-1.html b/docs/functions/deg2rad-1.html index 0e243204..8c4a6cf3 100644 --- a/docs/functions/deg2rad-1.html +++ b/docs/functions/deg2rad-1.html @@ -1,2 +1,2 @@ deg2rad | Detect-Collisions

Function deg2rad

  • convert from degrees to radians

    -

    Parameters

    • degrees: number

    Returns number

Generated using TypeDoc

\ No newline at end of file +

Parameters

  • degrees: number

Returns number

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/distance.html b/docs/functions/distance.html index b84020b3..4e340abc 100644 --- a/docs/functions/distance.html +++ b/docs/functions/distance.html @@ -1,2 +1,2 @@ -distance | Detect-Collisions

Function distance

Generated using TypeDoc

\ No newline at end of file +distance | Detect-Collisions

Function distance

  • get distance between two Vector points

    +

    Parameters

    Returns number

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/drawBVH.html b/docs/functions/drawBVH.html index fe903830..54fafe44 100644 --- a/docs/functions/drawBVH.html +++ b/docs/functions/drawBVH.html @@ -1,2 +1,2 @@ -drawBVH | Detect-Collisions

Function drawBVH

  • draw body bounding body

    -

    Parameters

    • context: CanvasRenderingContext2D
    • body: Body

    Returns void

Generated using TypeDoc

\ No newline at end of file +drawBVH | Detect-Collisions

Function drawBVH

  • draw body bounding body box

    +

    Parameters

    • context: CanvasRenderingContext2D
    • body: Body

    Returns void

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/drawPolygon.html b/docs/functions/drawPolygon.html index f94ef957..84634582 100644 --- a/docs/functions/drawPolygon.html +++ b/docs/functions/drawPolygon.html @@ -1,2 +1,2 @@ drawPolygon | Detect-Collisions

Function drawPolygon

  • draw polygon

    -

    Parameters

    • context: CanvasRenderingContext2D
    • __namedParameters: Pick<SATPolygon | Polygon, "calcPoints"> & {
          pos: Vector;
      }
    • isTrigger: boolean = false

    Returns void

Generated using TypeDoc

\ No newline at end of file +

Parameters

  • context: CanvasRenderingContext2D
  • __namedParameters: Pick<SATPolygon | Polygon, "calcPoints"> & {
        pos: Vector;
    }
  • isTrigger: boolean = false

Returns void

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/ensurePolygonPoints.html b/docs/functions/ensurePolygonPoints.html index e9514a1b..cd2aa6a0 100644 --- a/docs/functions/ensurePolygonPoints.html +++ b/docs/functions/ensurePolygonPoints.html @@ -1,2 +1,2 @@ -ensurePolygonPoints | Detect-Collisions

Function ensurePolygonPoints

Generated using TypeDoc

\ No newline at end of file +ensurePolygonPoints | Detect-Collisions

Function ensurePolygonPoints

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/ensureVectorPoint.html b/docs/functions/ensureVectorPoint.html index 86cb4538..0bb7803e 100644 --- a/docs/functions/ensureVectorPoint.html +++ b/docs/functions/ensureVectorPoint.html @@ -1,2 +1,2 @@ -ensureVectorPoint | Detect-Collisions

Function ensureVectorPoint

Generated using TypeDoc

\ No newline at end of file +ensureVectorPoint | Detect-Collisions

Function ensureVectorPoint

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/extendBody.html b/docs/functions/extendBody.html index 49688c48..77188fc1 100644 --- a/docs/functions/extendBody.html +++ b/docs/functions/extendBody.html @@ -1,2 +1,2 @@ -extendBody | Detect-Collisions

Function extendBody

Generated using TypeDoc

\ No newline at end of file +extendBody | Detect-Collisions

Function extendBody

  • used for all types of bodies in constructor

    +

    Parameters

    Returns void

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/getBounceDirection.html b/docs/functions/getBounceDirection.html index fede5cb8..262d52dd 100644 --- a/docs/functions/getBounceDirection.html +++ b/docs/functions/getBounceDirection.html @@ -1,2 +1,2 @@ getBounceDirection | Detect-Collisions

Function getBounceDirection

Generated using TypeDoc

\ No newline at end of file +

Parameters

Returns SATVector

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/getSATTest.html b/docs/functions/getSATTest.html index 4a238045..8bb5443e 100644 --- a/docs/functions/getSATTest.html +++ b/docs/functions/getSATTest.html @@ -1,2 +1,2 @@ -getSATTest | Detect-Collisions

Function getSATTest

  • returns correct sat.js testing function based on body types

    -

    Parameters

    Returns ((a, b, response?) => boolean) | ((circle, polygon, response?) => boolean) | ((polygon, circle, response?) => boolean) | ((a, b, response?) => boolean)

Generated using TypeDoc

\ No newline at end of file +getSATTest | Detect-Collisions

Function getSATTest

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/intersectAABB.html b/docs/functions/intersectAABB.html index 193f17fe..f3f76e12 100644 --- a/docs/functions/intersectAABB.html +++ b/docs/functions/intersectAABB.html @@ -1,2 +1,2 @@ -intersectAABB | Detect-Collisions

Function intersectAABB

  • checks if two boxes intersect

    -

    Parameters

    Returns boolean

Generated using TypeDoc

\ No newline at end of file +intersectAABB | Detect-Collisions

Function intersectAABB

  • checks if two boxes intersect

    +

    Parameters

    Returns boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/mapArrayToVector.html b/docs/functions/mapArrayToVector.html index 7bfed281..cf474d34 100644 --- a/docs/functions/mapArrayToVector.html +++ b/docs/functions/mapArrayToVector.html @@ -1,2 +1,2 @@ -mapArrayToVector | Detect-Collisions

Function mapArrayToVector

Generated using TypeDoc

\ No newline at end of file +mapArrayToVector | Detect-Collisions

Function mapArrayToVector

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/mapVectorToArray.html b/docs/functions/mapVectorToArray.html index fd05771f..5b1fa2d2 100644 --- a/docs/functions/mapVectorToArray.html +++ b/docs/functions/mapVectorToArray.html @@ -1,2 +1,2 @@ -mapVectorToArray | Detect-Collisions

Function mapVectorToArray

Generated using TypeDoc

\ No newline at end of file +mapVectorToArray | Detect-Collisions

Function mapVectorToArray

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/notIntersectAABB.html b/docs/functions/notIntersectAABB.html index e22e8946..e6675eb1 100644 --- a/docs/functions/notIntersectAABB.html +++ b/docs/functions/notIntersectAABB.html @@ -1,2 +1,2 @@ -notIntersectAABB | Detect-Collisions

Function notIntersectAABB

  • returns true if two boxes not intersect

    -

    Parameters

    Returns boolean

Generated using TypeDoc

\ No newline at end of file +notIntersectAABB | Detect-Collisions

Function notIntersectAABB

  • returns true if two boxes not intersect

    +

    Parameters

    Returns boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/rad2deg-1.html b/docs/functions/rad2deg-1.html index 17729ef8..c0eacde8 100644 --- a/docs/functions/rad2deg-1.html +++ b/docs/functions/rad2deg-1.html @@ -1,2 +1,2 @@ rad2deg | Detect-Collisions

Function rad2deg

  • convert from radians to degrees

    -

    Parameters

    • radians: number

    Returns number

Generated using TypeDoc

\ No newline at end of file +

Parameters

  • radians: number

Returns number

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/returnTrue.html b/docs/functions/returnTrue.html index 53ad2136..a9e41cc6 100644 --- a/docs/functions/returnTrue.html +++ b/docs/functions/returnTrue.html @@ -1 +1,2 @@ -returnTrue | Detect-Collisions

Function returnTrue

Generated using TypeDoc

\ No newline at end of file +returnTrue | Detect-Collisions

Function returnTrue

  • dummy fn used as default, for optimization

    +

    Returns boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules.html b/docs/modules.html index bde5cad9..33f62148 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -24,6 +24,7 @@ CheckCollisionCallback DecompPoint DecompPolygon +InTest Leaf SATTest TraverseFunction diff --git a/docs/types/InTest.html b/docs/types/InTest.html new file mode 100644 index 00000000..dd62cfc8 --- /dev/null +++ b/docs/types/InTest.html @@ -0,0 +1 @@ +InTest | Detect-Collisions

Type alias InTest<TBody>

InTest<TBody>: ((bodyA, bodyB) => boolean)

Type Parameters

Type declaration

    • (bodyA, bodyB): boolean
    • Parameters

      Returns boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/TraverseFunction.html b/docs/types/TraverseFunction.html index aad72da9..9c6d8d91 100644 --- a/docs/types/TraverseFunction.html +++ b/docs/types/TraverseFunction.html @@ -1 +1 @@ -TraverseFunction | Detect-Collisions

Type alias TraverseFunction<TBody>

TraverseFunction<TBody>: ((child, children, index) => boolean | void)

Type Parameters

Type declaration

    • (child, children, index): boolean | void
    • Parameters

      Returns boolean | void

Generated using TypeDoc

\ No newline at end of file +TraverseFunction | Detect-Collisions

Type alias TraverseFunction<TBody>

TraverseFunction<TBody>: ((child, children, index) => boolean | void)

Type Parameters

Type declaration

    • (child, children, index): boolean | void
    • Parameters

      Returns boolean | void

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/variables/DEG2RAD.html b/docs/variables/DEG2RAD.html index 18eba40c..f617466b 100644 --- a/docs/variables/DEG2RAD.html +++ b/docs/variables/DEG2RAD.html @@ -1 +1 @@ -DEG2RAD | Detect-Collisions

Generated using TypeDoc

\ No newline at end of file +DEG2RAD | Detect-Collisions

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/variables/RAD2DEG.html b/docs/variables/RAD2DEG.html index 440886fe..10a60bd1 100644 --- a/docs/variables/RAD2DEG.html +++ b/docs/variables/RAD2DEG.html @@ -1 +1 @@ -RAD2DEG | Detect-Collisions

Generated using TypeDoc

\ No newline at end of file +RAD2DEG | Detect-Collisions

Generated using TypeDoc

\ No newline at end of file diff --git a/package.json b/package.json index 861c1086..3f6c36e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "detect-collisions", - "version": "9.3.0", + "version": "9.3.1", "description": "detecting collisions between bodies: Points, Lines, Boxes, Polygons (Concave too), Ellipses and Circles. Also RayCasting. All bodies can have offset, rotation, scale, bounding box padding, can be static (non moving) or be trigger bodies (non colliding).", "main": "dist/index.js", "types": "dist/index.d.ts",