Skip to content

InterpolatedFunction 5.46.0 ​

final class · pocketmine\world\generator\vanilla\density\InterpolatedFunction · source

Extends DensityFunction

"minecraft:interpolated": the input is sampled at cell corners and trilinearly interpolated in between. Chunk fillers evaluate the input at corners and push the interpolated value via $current before evaluating the outer function; compute() falls back to interpolating on the fly (used for single-point queries).

Properties ​

$cellHeight ​

php
public readonly int $cellHeight

$cellWidth ​

php
public readonly int $cellWidth

$current ​

php
public float $current

$input ​

php
public readonly \pocketmine\world\generator\vanilla\density\DensityFunction $input

$useCurrent ​

php
public bool $useCurrent

Set by chunk fillers while $current holds the value for the block being evaluated.

Methods ​

__construct() ​

php
public function __construct(\pocketmine\world\generator\vanilla\density\DensityFunction $input, int $cellWidth, int $cellHeight)

children() ​

php
public function children() : array

compute() ​

php
public function compute(float $x, float $y, float $z) : float

dependsOnY() ​

php
public function dependsOnY() : bool

lerp3() ​

php
public static function lerp3(float $fx, float $fy, float $fz, float $c000, float $c100, float $c010, float $c110, float $c001, float $c101, float $c011, float $c111) : float

Trilinear interpolation in the same order as vanilla's NoiseChunk (y first, then x, then z).

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.