优化matrix

This commit is contained in:
yhh
2020-07-23 13:25:10 +08:00
parent 1b52bc5fd1
commit e61dd0c16b
12 changed files with 1009 additions and 494 deletions

View File

@@ -34,6 +34,46 @@ module es {
this.y = y ? y : this.x;
}
/**
*
* @param value
*/
public add(value: Vector2): Vector2{
this.x += value.x;
this.y += value.y;
return this;
}
/**
*
* @param value
*/
public divide(value: Vector2): Vector2{
this.x /= value.x;
this.y /= value.y;
return this;
}
/**
*
* @param value
*/
public multiply(value: Vector2): Vector2{
this.x *= value.x;
this.y *= value.y;
return this;
}
/**
*
* @param value
*/
public subtract(value: Vector2){
this.x -= value.x;
this.y -= value.y;
return this;
}
/**
*
* @param value1