Skip to content

Commit 6d64e25

Browse files
committed
Vector3: added zero() static method
1 parent f1ee1fe commit 6d64e25

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Vector3.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ public function __construct(float|int $x, float|int $y, float|int $z){
4444
$this->z = $z;
4545
}
4646

47+
public static function zero() : Vector3{
48+
//TODO: make this reuse a single object, once Vector3 becomes immutable
49+
return new self(0, 0, 0);
50+
}
51+
4752
public function getX() : float|int{
4853
return $this->x;
4954
}

0 commit comments

Comments
 (0)