diff --git a/src/quadtree/Circle.ts b/src/quadtree/Circle.ts index 31703ff..9122d3a 100644 --- a/src/quadtree/Circle.ts +++ b/src/quadtree/Circle.ts @@ -4,7 +4,7 @@ * @Description: 原型 */ -import { Graphics, Rect } from "cc"; +import { Rect } from "cc"; import { Shape } from "./Shape"; export class Circle extends Shape { @@ -21,9 +21,4 @@ export class Circle extends Shape { public getBoundingBox(): Rect { return this.boundingBox; } - - /** @internal */ - public drawShape(draw: Graphics): void { - draw && draw.circle(this.position.x, this.position.y, this.radius * this.scale); - } } \ No newline at end of file diff --git a/src/quadtree/Polygon.ts b/src/quadtree/Polygon.ts index 594edd9..93c2715 100644 --- a/src/quadtree/Polygon.ts +++ b/src/quadtree/Polygon.ts @@ -4,7 +4,7 @@ * @Description: 多边形 */ -import { Graphics, Rect, v2, Vec2 } from "cc"; +import { Rect, v2, Vec2 } from "cc"; import { Shape } from "./Shape"; @@ -82,16 +82,4 @@ export class Polygon extends Shape { this._realPoints[i] = v2(pts[i].x, pts[i].y); } } - - /** @internal */ - public drawShape(draw: Graphics): void { - if (draw) { - let points = this.points; - draw.moveTo(points[0].x, points[0].y); - for (let i = 1; i < points.length; i++) { - draw.lineTo(points[i].x, points[i].y); - } - draw.lineTo(points[0].x, points[0].y); - } - } } \ No newline at end of file diff --git a/src/quadtree/QuadTree.ts b/src/quadtree/QuadTree.ts index 086ca8e..5e37539 100644 --- a/src/quadtree/QuadTree.ts +++ b/src/quadtree/QuadTree.ts @@ -299,7 +299,6 @@ export class QuadTree { this._trees[quadrant].insert(shapes.splice(i, 1)[0]); } } - shape.drawShape(this._graphics); } } } diff --git a/src/quadtree/Shape.ts b/src/quadtree/Shape.ts index b8cc3a8..0dffc33 100644 --- a/src/quadtree/Shape.ts +++ b/src/quadtree/Shape.ts @@ -4,7 +4,7 @@ * @Description: 四叉树的 形状基类 */ -import { Graphics, Rect, Vec2 } from "cc"; +import { Rect, Vec2 } from "cc"; export abstract class Shape { /** @@ -71,10 +71,5 @@ export abstract class Shape { public destroy(): void { this._valid = false; } - - /** @internal */ - public drawShape(draw: Graphics): void { - - } }