Skip to content

Commit

Permalink
feat: publish / recompile checkArea()
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacek Pietal committed May 24, 2024
1 parent 5f8a232 commit 4fbcc6c
Show file tree
Hide file tree
Showing 39 changed files with 543 additions and 360 deletions.
2 changes: 1 addition & 1 deletion dist/base-system.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export declare class BaseSystem<TBody extends Body = Body> extends RBush<TBody>
*/
createPolygon(position: PotentialVector, points: PotentialVector[], options?: BodyOptions): Polygon;
/**
* re-insert body into collision tree and update its aabb
* re-insert body into collision tree and update its bbox
* every body can be part of only one system
*/
insert(body: TBody): RBush<TBody>;
Expand Down
4 changes: 1 addition & 3 deletions dist/base-system.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class BaseSystem extends model_1.RBush {
return polygon;
}
/**
* re-insert body into collision tree and update its aabb
* re-insert body into collision tree and update its bbox
* every body can be part of only one system
*/
insert(body) {
Expand All @@ -81,8 +81,6 @@ class BaseSystem extends model_1.RBush {
body.minY = body.bbox.minY - body.padding;
body.maxX = body.bbox.maxX + body.padding;
body.maxY = body.bbox.maxY + body.padding;
// set system for later body.system.updateBody(body)
body.system = this;
// reinsert bounding box to collision tree
return super.insert(body);
}
Expand Down
4 changes: 2 additions & 2 deletions dist/bodies/circle.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BBox } from "rbush";
import { Circle as SATCircle } from "sat";
import { BaseSystem } from "../base-system";
import { System } from "../system";
import { BodyGroup, BodyOptions, BodyProps, BodyType, PotentialVector, SATVector, Vector } from "../model";
/**
* collider - circle
Expand Down Expand Up @@ -53,7 +53,7 @@ export declare class Circle extends SATCircle implements BBox, BodyProps {
/**
* reference to collision system
*/
system?: BaseSystem;
system?: System;
/**
* was the polygon modified and needs update in the next checkCollision
*/
Expand Down
Loading

0 comments on commit 4fbcc6c

Please sign in to comment.