35 public function __construct(
float $x,
float $y,
float $z, ?
World $world,
float $yaw,
float $pitch){
37 $this->pitch = $pitch;
38 parent::__construct($x, $y, $z, $world);
45 return new Location($pos->x, $pos->y, $pos->z, $world ?? (($pos instanceof
Position) ? $pos->world :
null), $yaw, $pitch);
52 return new
Location($this->x, $this->y, $this->z, $this->world, $this->yaw, $this->pitch);
55 public function getYaw() : float{
59 public function getPitch() : float{
63 public function __toString(){
64 return "Location (world=" . ($this->isValid() ? $this->getWorld()->getDisplayName() :
"null") .
", x=$this->x, y=$this->y, z=$this->z, yaw=$this->yaw, pitch=$this->pitch)";
67 public function equals(Vector3 $v) : bool{
68 if($v instanceof Location){
69 return parent::equals($v) && $v->yaw == $this->yaw && $v->pitch == $this->pitch;
71 return parent::equals($v);