新增physics.debugDraw默认绘制
This commit is contained in:
@@ -323,12 +323,8 @@ module es {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 包装一个Unit32,列表碰撞器字典
|
||||
* 它的主要目的是将int、int x、y坐标散列到单个Uint32键中,使用O(1)查找。
|
||||
*/
|
||||
export class NumberDictionary {
|
||||
public _store: Map<number, Collider[]> = new Map<number, Collider[]>();
|
||||
public _store: Map<string, Collider[]> = new Map<string, Collider[]>();
|
||||
|
||||
public add(x: number, y: number, list: Collider[]) {
|
||||
this._store.set(this.getKey(x, y), list);
|
||||
@@ -351,7 +347,7 @@ module es {
|
||||
}
|
||||
|
||||
public getKey(x: number, y: number){
|
||||
return x << 16 | (y >>> 0);
|
||||
return `${x}_${y}`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user