优化triggerListener与ArrayUtils

This commit is contained in:
yhh
2020-11-26 17:26:49 +08:00
parent de3f7bff60
commit ae2cfdafdd
15 changed files with 418 additions and 261 deletions

View File

@@ -1,11 +1,11 @@
///<reference path="./RaycastHit.ts" />
module es {
export class Physics {
public static _spatialHash: SpatialHash;
/** 调用reset并创建一个新的SpatialHash时使用的单元格大小 */
public static spatialHashCellSize = 100;
/** 接受layerMask的所有方法的默认值 */
public static readonly allLayers: number = -1;
private static _spatialHash: SpatialHash;
/**
* raycast是否检测配置为触发器的碰撞器
*/
@@ -120,13 +120,5 @@ module es {
return this._spatialHash.linecast(start, end, hits, layerMask);
}
/**
* debug绘制空间散列的内容
* @param secondsToDisplay
*/
public static debugDraw(secondsToDisplay) {
this._spatialHash.debugDraw(secondsToDisplay, 2);
}
}
}