Skip to content

Commit

Permalink
Vector3: added zero() static method
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Oct 29, 2021
1 parent f1ee1fe commit 6d64e25
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Vector3.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public function __construct(float|int $x, float|int $y, float|int $z){
$this->z = $z;
}

public static function zero() : Vector3{
//TODO: make this reuse a single object, once Vector3 becomes immutable
return new self(0, 0, 0);
}

public function getX() : float|int{
return $this->x;
}
Expand Down

0 comments on commit 6d64e25

Please sign in to comment.