新增Physics.linecast/linecastAll方法

This commit is contained in:
YHH
2020-08-22 12:21:40 +08:00
parent 73f0f54ba7
commit 6c1cfec928
16 changed files with 537 additions and 145 deletions

View File

@@ -93,5 +93,18 @@ module es {
return t;
}
/**
* 由上移量向上移。start可以小于或大于end。例如:开始是2结束是10移位是4结果是6
* @param start
* @param end
* @param shift
*/
public static approach(start: number, end: number, shift: number): number {
if (start < end)
return Math.min(start + shift, end);
return Math.max(start - shift, end);
}
}
}