@@ -9,68 +9,68 @@ import { Polygon, PolygonConstructor } from './bodies/polygon';
99 * very base collision system (create, insert, update, draw, remove)
1010 */
1111export declare class BaseSystem < TBody extends Body = Body > extends RBush implements Data < TBody > {
12- data : ChildrenData < TBody > ;
13- /**
14- * create point at position with options and add to system
15- */
16- createPoint < TPoint extends Point > ( position : PotentialVector , options ?: BodyOptions , Class ?: PointConstructor < TPoint > ) : TPoint | Point ;
17- /**
18- * create line at position with options and add to system
19- */
20- createLine < TLine extends Line > ( start : Vector , end : Vector , options ?: BodyOptions , Class ?: LineConstructor < TLine > ) : TLine | Line ;
21- /**
22- * create circle at position with options and add to system
23- */
24- createCircle < TCircle extends Circle > ( position : PotentialVector , radius : number , options ?: BodyOptions , Class ?: CircleConstructor < TCircle > ) : TCircle | Circle ;
25- /**
26- * create box at position with options and add to system
27- */
28- createBox < TBox extends Box > ( position : PotentialVector , width : number , height : number , options ?: BodyOptions , Class ?: BoxConstructor < TBox > ) : TBox | Box ;
29- /**
30- * create ellipse at position with options and add to system
31- */
32- createEllipse < TEllipse extends Ellipse > ( position : PotentialVector , radiusX : number , radiusY ?: number , step ?: number , options ?: BodyOptions , Class ?: EllipseConstructor < TEllipse > ) : TEllipse | Ellipse ;
33- /**
34- * create polygon at position with options and add to system
35- */
36- createPolygon < TPolygon extends Polygon > ( position : PotentialVector , points : PotentialVector [ ] , options ?: BodyOptions , Class ?: PolygonConstructor < TPolygon > ) : TPolygon | Polygon ;
37- /**
38- * re-insert body into collision tree and update its bbox
39- * every body can be part of only one system
40- */
41- insert ( body : TBody ) : this;
42- /**
43- * updates body in collision tree
44- */
45- updateBody ( body : TBody ) : void ;
46- /**
47- * update all bodies aabb
48- */
49- update ( ) : void ;
50- /**
51- * draw exact bodies colliders outline
52- */
53- draw ( context : CanvasRenderingContext2D ) : void ;
54- /**
55- * draw bounding boxes hierarchy outline
56- */
57- drawBVH ( context : CanvasRenderingContext2D , isTrigger ?: boolean ) : void ;
58- /**
59- * remove body aabb from collision tree
60- */
61- remove ( body : TBody , equals ?: InTest < TBody > ) : this;
62- /**
63- * get object potential colliders
64- * @deprecated because it's slower to use than checkOne() or checkAll()
65- */
66- getPotentials ( body : TBody ) : TBody [ ] ;
67- /**
68- * used to find body deep inside data with finder function returning boolean found or not
69- *
70- * @param traverseFunction
71- * @param tree
72- */
73- traverse ( traverseFunction : TraverseFunction < TBody > , { children } ?: {
74- children ?: Leaf < TBody > [ ] ;
75- } ) : TBody | undefined ;
12+ data : ChildrenData < TBody > ;
13+ /**
14+ * create point at position with options and add to system
15+ */
16+ createPoint < TPoint extends Point > ( position : PotentialVector , options ?: BodyOptions , Class ?: PointConstructor < TPoint > ) : TPoint | Point ;
17+ /**
18+ * create line at position with options and add to system
19+ */
20+ createLine < TLine extends Line > ( start : Vector , end : Vector , options ?: BodyOptions , Class ?: LineConstructor < TLine > ) : TLine | Line ;
21+ /**
22+ * create circle at position with options and add to system
23+ */
24+ createCircle < TCircle extends Circle > ( position : PotentialVector , radius : number , options ?: BodyOptions , Class ?: CircleConstructor < TCircle > ) : TCircle | Circle ;
25+ /**
26+ * create box at position with options and add to system
27+ */
28+ createBox < TBox extends Box > ( position : PotentialVector , width : number , height : number , options ?: BodyOptions , Class ?: BoxConstructor < TBox > ) : TBox | Box ;
29+ /**
30+ * create ellipse at position with options and add to system
31+ */
32+ createEllipse < TEllipse extends Ellipse > ( position : PotentialVector , radiusX : number , radiusY ?: number , step ?: number , options ?: BodyOptions , Class ?: EllipseConstructor < TEllipse > ) : TEllipse | Ellipse ;
33+ /**
34+ * create polygon at position with options and add to system
35+ */
36+ createPolygon < TPolygon extends Polygon > ( position : PotentialVector , points : PotentialVector [ ] , options ?: BodyOptions , Class ?: PolygonConstructor < TPolygon > ) : TPolygon | Polygon ;
37+ /**
38+ * re-insert body into collision tree and update its bbox
39+ * every body can be part of only one system
40+ */
41+ insert ( body : TBody ) : this;
42+ /**
43+ * updates body in collision tree
44+ */
45+ updateBody ( body : TBody ) : void ;
46+ /**
47+ * update all bodies aabb
48+ */
49+ update ( ) : void ;
50+ /**
51+ * draw exact bodies colliders outline
52+ */
53+ draw ( context : CanvasRenderingContext2D ) : void ;
54+ /**
55+ * draw bounding boxes hierarchy outline
56+ */
57+ drawBVH ( context : CanvasRenderingContext2D , isTrigger ?: boolean ) : void ;
58+ /**
59+ * remove body aabb from collision tree
60+ */
61+ remove ( body : TBody , equals ?: InTest < TBody > ) : this;
62+ /**
63+ * get object potential colliders
64+ * @deprecated because it's slower to use than checkOne() or checkAll()
65+ */
66+ getPotentials ( body : TBody ) : TBody [ ] ;
67+ /**
68+ * used to find body deep inside data with finder function returning boolean found or not
69+ *
70+ * @param traverseFunction
71+ * @param tree
72+ */
73+ traverse ( traverseFunction : TraverseFunction < TBody > , { children } ?: {
74+ children ?: Leaf < TBody > [ ] ;
75+ } ) : TBody | undefined ;
7676}
0 commit comments