From ca2d93b475fc8dea35af84a868439e37fa700a3b Mon Sep 17 00:00:00 2001 From: gongxh Date: Mon, 26 May 2025 17:27:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=BD=A2=E7=8A=B6=E7=9A=84?= =?UTF-8?q?=E7=BB=98=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/quadtree/Circle.ts | 7 +------ src/quadtree/Polygon.ts | 14 +------------- src/quadtree/QuadTree.ts | 1 - src/quadtree/Shape.ts | 7 +------ 4 files changed, 3 insertions(+), 26 deletions(-) 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 { - - } }