Skip to content

Commit

Permalink
feat: improve lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Prozi committed Nov 1, 2024
1 parent 3bf2f7b commit edf3f15
Show file tree
Hide file tree
Showing 147 changed files with 16,263 additions and 80,955 deletions.
170 changes: 66 additions & 104 deletions dist/base-system.d.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
import {
Body,
BodyOptions,
ChildrenData,
Data,
InTest,
Leaf,
PotentialVector,
RBush,
TraverseFunction,
Vector,
} from "./model";
import { Body, BodyOptions, ChildrenData, Data, InTest, Leaf, PotentialVector, RBush, TraverseFunction, Vector } from "./model";
import { Box } from "./bodies/box";
import { Circle } from "./bodies/circle";
import { Ellipse } from "./bodies/ellipse";
Expand All @@ -19,96 +8,69 @@ import { Polygon } from "./bodies/polygon";
/**
* very base collision system (create, insert, update, draw, remove)
*/
export declare class BaseSystem<TBody extends Body = Body>
extends RBush
implements Data<TBody>
{
data: ChildrenData<TBody>;
/**
* create point at position with options and add to system
*/
createPoint(position: PotentialVector, options?: BodyOptions): Point;
/**
* create line at position with options and add to system
*/
createLine(start: Vector, end: Vector, options?: BodyOptions): Line;
/**
* create circle at position with options and add to system
*/
createCircle(
position: PotentialVector,
radius: number,
options?: BodyOptions,
): Circle;
/**
* create box at position with options and add to system
*/
createBox(
position: PotentialVector,
width: number,
height: number,
options?: BodyOptions,
): Box;
/**
* create ellipse at position with options and add to system
*/
createEllipse(
position: PotentialVector,
radiusX: number,
radiusY?: number,
step?: number,
options?: BodyOptions,
): Ellipse;
/**
* create polygon at position with options and add to system
*/
createPolygon(
position: PotentialVector,
points: PotentialVector[],
options?: BodyOptions,
): Polygon;
/**
* re-insert body into collision tree and update its bbox
* every body can be part of only one system
*/
insert(body: TBody): this;
/**
* updates body in collision tree
*/
updateBody(body: TBody): void;
/**
* update all bodies aabb
*/
update(): void;
/**
* draw exact bodies colliders outline
*/
draw(context: CanvasRenderingContext2D): void;
/**
* draw bounding boxes hierarchy outline
*/
drawBVH(context: CanvasRenderingContext2D, isTrigger?: boolean): void;
/**
* remove body aabb from collision tree
*/
remove(body: TBody, equals?: InTest<TBody>): this;
/**
* get object potential colliders
* @deprecated because it's slower to use than checkOne() or checkAll()
*/
getPotentials(body: TBody): TBody[];
/**
* used to find body deep inside data with finder function returning boolean found or not
*
* @param traverseFunction
* @param tree
*/
traverse(
traverseFunction: TraverseFunction<TBody>,
{
children,
}?: {
children?: Leaf<TBody>[];
},
): TBody | undefined;
export declare class BaseSystem<TBody extends Body = Body> extends RBush implements Data<TBody> {
data: ChildrenData<TBody>;
/**
* create point at position with options and add to system
*/
createPoint(position: PotentialVector, options?: BodyOptions): Point;
/**
* create line at position with options and add to system
*/
createLine(start: Vector, end: Vector, options?: BodyOptions): Line;
/**
* create circle at position with options and add to system
*/
createCircle(position: PotentialVector, radius: number, options?: BodyOptions): Circle;
/**
* create box at position with options and add to system
*/
createBox(position: PotentialVector, width: number, height: number, options?: BodyOptions): Box;
/**
* create ellipse at position with options and add to system
*/
createEllipse(position: PotentialVector, radiusX: number, radiusY?: number, step?: number, options?: BodyOptions): Ellipse;
/**
* create polygon at position with options and add to system
*/
createPolygon(position: PotentialVector, points: PotentialVector[], options?: BodyOptions): Polygon;
/**
* re-insert body into collision tree and update its bbox
* every body can be part of only one system
*/
insert(body: TBody): this;
/**
* updates body in collision tree
*/
updateBody(body: TBody): void;
/**
* update all bodies aabb
*/
update(): void;
/**
* draw exact bodies colliders outline
*/
draw(context: CanvasRenderingContext2D): void;
/**
* draw bounding boxes hierarchy outline
*/
drawBVH(context: CanvasRenderingContext2D, isTrigger?: boolean): void;
/**
* remove body aabb from collision tree
*/
remove(body: TBody, equals?: InTest<TBody>): this;
/**
* get object potential colliders
* @deprecated because it's slower to use than checkOne() or checkAll()
*/
getPotentials(body: TBody): TBody[];
/**
* used to find body deep inside data with finder function returning boolean found or not
*
* @param traverseFunction
* @param tree
*/
traverse(traverseFunction: TraverseFunction<TBody>, { children }?: {
children?: Leaf<TBody>[];
}): TBody | undefined;
}
Loading

0 comments on commit edf3f15

Please sign in to comment.