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
|
|
@ -97,6 +97,14 @@ class Vector3{
|
|||
return $this->add(-$x, -$y, -$z);
|
||||
}
|
||||
}
|
||||
|
||||
public function multiply($number){
|
||||
return new Vector3($this->x * $number, $this->y * $number, $this->z * $number);
|
||||
}
|
||||
|
||||
public function divide($number){
|
||||
return new Vector3($this->x / $number, $this->y / $number, $this->z / $number);
|
||||
}
|
||||
|
||||
public function ceil(){
|
||||
return new Vector3((int) ($this->x + 1), (int) ($this->y + 1), (int) ($this->z + 1));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue