changes hitbox getters to get properties, adds aaContains
This commit is contained in:
@@ -19,8 +19,6 @@ export class Polygon {
|
||||
doodler.line(p1.copy().add(this.center), p2.copy().add(this.center), {
|
||||
color,
|
||||
});
|
||||
const { x, y, w, h } = this.aaHitbox();
|
||||
doodler.drawRect(new Vector(x, y), w, h, { color: "lime" });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +33,7 @@ export class Polygon {
|
||||
return center;
|
||||
}
|
||||
|
||||
circularHitbox(): CircleLike {
|
||||
get circularHitbox(): CircleLike {
|
||||
let greatestDistance = 0;
|
||||
for (const p of this.points) {
|
||||
greatestDistance = Math.max(
|
||||
@@ -50,7 +48,7 @@ export class Polygon {
|
||||
};
|
||||
}
|
||||
|
||||
aaHitbox(): axisAlignedBoundingBox {
|
||||
get aaHitbox(): axisAlignedBoundingBox {
|
||||
let smallestX, biggestX, smallestY, biggestY;
|
||||
smallestX =
|
||||
smallestY =
|
||||
|
Reference in New Issue
Block a user