shapeCollisions拆分

This commit is contained in:
yhh
2021-04-28 14:43:48 +08:00
parent bc6920f829
commit 9fa0442b20
12 changed files with 821 additions and 899 deletions

View File

@@ -69,7 +69,7 @@ module es {
public collidesWithShape(other: Shape, result: CollisionResult): boolean {
// 特殊情况这一个高性能方式实现其他情况则使用polygon方法检测
if (other instanceof Box && (other as Box).isUnrotated) {
return ShapeCollisions.boxToBox(this, other, result);
return ShapeCollisionsBox.boxToBox(this, other, result);
}
// TODO: 让 minkowski 运行于 cricleToBox
@@ -86,7 +86,7 @@ module es {
public pointCollidesWithShape(point: es.Vector2, result: es.CollisionResult): boolean {
if (this.isUnrotated)
return ShapeCollisions.pointToBox(point, this, result);
return ShapeCollisionsPoint.pointToBox(point, this, result);
return super.pointCollidesWithShape(point, result);
}