Heightmap
in package
Table of Contents
Properties
Methods
- __construct() : mixed
- castRay() : Vec3|null
- Casts a ray against the heightmap and returns the intersection point (binary search)
- getHeightAt() : float
- Returns the height at the given world space x and z coordinates
Properties
$data
private
FloatBuffer
$data
$height
private
int
$height
$ppu
private
float
$ppu
= 1.0
$width
private
int
$width
Methods
__construct()
public
__construct(FloatBuffer $data, int $width, int $height[, float $ppu = 1.0 ]) : mixed
Parameters
- $data : FloatBuffer
- $width : int
- $height : int
- $ppu : float = 1.0
castRay()
Casts a ray against the heightmap and returns the intersection point (binary search)
public
castRay(Ray $ray[, float $maxDistance = 1000 ][, int $lookups = 16 ]) : Vec3|null
Parameters
- $ray : Ray
- $maxDistance : float = 1000
- $lookups : int = 16
Return values
Vec3|nullgetHeightAt()
Returns the height at the given world space x and z coordinates
public
getHeightAt(float $x, float $y) : float
Parameters
- $x : float
- $y : float