Skip to content

Commit

Permalink
fix: checkOne allows static trigger bodies
Browse files Browse the repository at this point in the history
  • Loading branch information
Prozi committed Sep 15, 2024
1 parent f558bb5 commit 616ad6a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -4054,7 +4054,7 @@ which is good. See: http://baagoe.com/en/RandomMusings/hash/avalanche.xhtml
response = this.response,
) {
// no need to check static body collision
if (body.isStatic) {
if (body.isStatic && !body.isTrigger) {
return false;
}
const bodies = this.search(body);
Expand Down
2 changes: 1 addition & 1 deletion dist/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class System extends base_system_1.BaseSystem {
*/
checkOne(body, callback = utils_1.returnTrue, response = this.response) {
// no need to check static body collision
if (body.isStatic) {
if (body.isStatic && !body.isTrigger) {
return false;
}
const bodies = this.search(body);
Expand Down
2 changes: 1 addition & 1 deletion docs/demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -4054,7 +4054,7 @@ which is good. See: http://baagoe.com/en/RandomMusings/hash/avalanche.xhtml
response = this.response,
) {
// no need to check static body collision
if (body.isStatic) {
if (body.isStatic && !body.isTrigger) {
return false;
}
const bodies = this.search(body);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "detect-collisions",
"version": "9.15.3",
"version": "9.16.0",
"description": "Detect collisions between different shapes such as Points, Lines, Boxes, Polygons (including concave), Ellipses, and Circles. Features include RayCasting and support for offsets, rotation, scaling, bounding box padding, with options for static and trigger bodies (non-colliding).",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class System<TBody extends Body = Body> extends BaseSystem<TBody> {
response = this.response,
): boolean {
// no need to check static body collision
if (body.isStatic) {
if (body.isStatic && !body.isTrigger) {
return false;
}

Expand Down

0 comments on commit 616ad6a

Please sign in to comment.