新增visiblityComputer 表示从给定的一组遮挡物的原点可以看到哪些区域

This commit is contained in:
yhh
2020-12-07 21:01:21 +08:00
parent 06b2163aaa
commit 8c5e4537a6
8 changed files with 1378 additions and 1 deletions

View File

@@ -88,6 +88,10 @@ module es {
return Math.atan2(to.y - from.y, to.x - from.x);
}
public static angleToVector(angleRadians: number, length: number){
return new Vector2(Math.cos(angleRadians) * length, Math.sin(angleRadians) * length);
}
/**
* 增加t并确保它总是大于或等于0并且小于长度
* @param t