新增verlet物理引擎(实验性)

This commit is contained in:
yhh
2021-07-02 18:25:30 +08:00
parent 3d9c8699e7
commit 85bdd97d48
15 changed files with 1142 additions and 23 deletions

View File

@@ -227,15 +227,11 @@ module es {
* @param value
*/
public divide(value: Vector2): Vector2 {
this.x /= value.x;
this.y /= value.y;
return this;
return new Vector2(this.x / value.x, this.y / value.y);
}
public divideScaler(value: number): Vector2 {
this.x /= value;
this.y /= value;
return this;
return new Vector2(this.x / value, this.y / value);
}
/**