mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Added more Vector math
This commit is contained in:
parent
4284211bd1
commit
808f5473d0
3 changed files with 50 additions and 0 deletions
|
|
@ -86,6 +86,14 @@ class Vector2{
|
|||
public function abs(){
|
||||
return new Vector2(abs($this->x), abs($this->y));
|
||||
}
|
||||
|
||||
public function multiply($number){
|
||||
return new Vector2($this->x * $number, $this->y * $number);
|
||||
}
|
||||
|
||||
public function divide($number){
|
||||
return new Vector2($this->x / $number, $this->y / $number);
|
||||
}
|
||||
|
||||
public function distance($x = 0, $y = 0){
|
||||
if(($x instanceof Vector2) === true){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue