fix: can't even remember my own APIs
This commit is contained in:
parent
3d79aafce5
commit
5377617dfc
|
@ -29,7 +29,7 @@ export class QuadTree {
|
|||
}
|
||||
});
|
||||
return nodes.filter((node) => {
|
||||
return Rectangle.isTouching(queryRectangle, node.data);
|
||||
return Rectangle.intersects(queryRectangle, node.data);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -37,10 +37,10 @@ export function intersects (l, r) {
|
|||
// avocado> Rectangle.intersects [0, 0, 16, 16], [16, 16]
|
||||
// false
|
||||
export function isTouching (r, v) {
|
||||
if (v[0] + v[2] < r[0]) {
|
||||
if (v[0] < r[0]) {
|
||||
return false;
|
||||
}
|
||||
if (v[1] + v[3] < r[1]) {
|
||||
if (v[1] < r[1]) {
|
||||
return false;
|
||||
}
|
||||
if (v[0] >= r[0] + r[2]) {
|
||||
|
|
|
@ -167,7 +167,7 @@ export class World extends AbstractWorld {
|
|||
body.position = Vector.add(body.position, potentialTranslation);
|
||||
for (const contact of contacts) {
|
||||
const contactBody = contact.body;
|
||||
if (Rectangle.isTouching(body.aabb, contactBody.aabb)) {
|
||||
if (Rectangle.intersects(body.aabb, contactBody.aabb)) {
|
||||
anyContact = true;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user