修复polygon数组错误 修复emit空注册报错

This commit is contained in:
yhh
2020-06-15 20:08:21 +08:00
parent c3120d791f
commit 5186bc0187
16 changed files with 398 additions and 32 deletions

View File

@@ -18,6 +18,18 @@ class Circle extends Shape {
return ShapeCollisions.circleToRect(this, other as Box);
}
if (other instanceof Circle){
// TODO CIRCLETOCIRCLE
}
if (other instanceof Polygon){
return ShapeCollisions.circleToPolygon(this, other);
}
throw new Error(`Collisions of Circle to ${other} are not supported`);
}
public recalculateBounds(collider: Collider) {
this.center = collider.localOffset;
}
}