本文整理匯總了PHP中pocketmine\level\Location::getPitch方法的典型用法代碼示例。如果您正苦於以下問題:PHP Location::getPitch方法的具體用法?PHP Location::getPitch怎麽用?PHP Location::getPitch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pocketmine\level\Location
的用法示例。
在下文中一共展示了Location::getPitch方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: tick
/**
* @param number $slowness
* @return Location|null
*/
public function tick($slowness)
{
if (($length = $this->length * $slowness) < 1.0E-7) {
return null;
}
if (($progress = $this->current++ / $length) > 1) {
return null;
}
return new Location($this->getOrigin()->getX() + $this->distance->getX() * $progress, 1.62 + $this->getOrigin()->getY() + $this->distance->getY() * $progress, $this->getOrigin()->getZ() + $this->distance->getZ() * $progress, $this->getOrigin()->getYaw() + $this->distance->getYaw() * $progress, $this->getOrigin()->getPitch() + $this->distance->getPitch() * $progress);
}
示例2: fromPosition
public static function fromPosition($name, Location $pos)
{
return new BaseLocation($name, $pos->getX(), $pos->getY(), $pos->getZ(), $pos->getLevel(), $pos->getYaw(), $pos->getPitch());
}
示例3: setHome
/**
* @param $home
* @param Location $pos
* @return bool
*/
public function setHome($home, Location $pos)
{
if (!$this->getPlugin()->validateName($home, false)) {
return false;
}
$this->homes[$home] = new BaseLocation($home, $pos->getX(), $pos->getY(), $pos->getZ(), $pos->getLevel(), $pos->getYaw(), $pos->getPitch());
return true;
}