优化matrix
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user