pocketmine\math\Math::floorFloat PHP Method

floorFloat() public static method

public static floorFloat ( $n )
    public static function floorFloat($n)
    {
        $i = (int) $n;
        return $n >= $i ? $i : $i - 1;
    }

Usage Example

Esempio n. 1
0
 public function isInsideOfSolid()
 {
     $block = $this->level->getBlock(new Vector3(Math::floorFloat($this->x), Math::floorFloat($y = $this->y + $this->getEyeHeight()), Math::floorFloat($this->z)));
     $bb = $block->getBoundingBox();
     if ($bb !== null and $block->isSolid() and !$block->isTransparent() and $bb->intersectsWith($this->getBoundingBox())) {
         return true;
     }
     return false;
 }
All Usage Examples Of pocketmine\math\Math::floorFloat