新增arcadeRigidbody组件, 可以用于简单的,街机风格的物理学

This commit is contained in:
yhh
2020-12-07 11:48:42 +08:00
parent 2a0d4ef4dd
commit bddae046a0
12 changed files with 835 additions and 82 deletions

View File

@@ -246,6 +246,17 @@ module es {
return new Vector2(Math.round(this.x), Math.round(this.y));
}
/**
* 返回以自己为中心点的左右角,单位为度
* @param left
* @param right
*/
public angleBetween(left: Vector2, right: Vector2) {
let one = Vector2.subtract(left, this);
let two = Vector2.subtract(right, this);
return Vector2Ext.angle(one, two);
}
/**
* 比较当前实例是否等于指定的对象
* @param other 要比较的对象