新增sceneTransition 用于场景过渡
This commit is contained in:
@@ -9,6 +9,10 @@ class Physics {
|
||||
this._spatialHash = new SpatialHash(this.spatialHashCellSize);
|
||||
}
|
||||
|
||||
public static clear(){
|
||||
this._spatialHash.clear();
|
||||
}
|
||||
|
||||
public static overlapCircleAll(center: Vector2, randius: number, results: any[], layerMask = -1){
|
||||
return this._spatialHash.overlapCircle(center, randius, results, layerMask);
|
||||
}
|
||||
|
||||
@@ -53,10 +53,8 @@ class Polygon extends Shape {
|
||||
public collidesWithShape(other: Shape){
|
||||
let result = new CollisionResult();
|
||||
if (other instanceof Polygon){
|
||||
result = ShapeCollisions.polygonToPolygon(this, other);
|
||||
return result;
|
||||
return ShapeCollisions.polygonToPolygon(this, other);
|
||||
}
|
||||
|
||||
|
||||
if (other instanceof Circle){
|
||||
result = ShapeCollisions.circleToPolygon(other, this);
|
||||
|
||||
@@ -52,6 +52,10 @@ class SpatialHash {
|
||||
}
|
||||
}
|
||||
|
||||
public clear(){
|
||||
this._cellDict.clear();
|
||||
}
|
||||
|
||||
public overlapCircle(circleCenter: Vector2, radius: number, results: Collider[], layerMask) {
|
||||
let bounds = new Rectangle(circleCenter.x - radius, circleCenter.y - radius, radius * 2, radius * 2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user