Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: HeightMapGenerator

[25:7] extends: FxObj

Wraps FXGL's HeightMapGenerator (com.almasb.fxgl.procedural.HeightMapGenerator), a CellGenerator that fills a Grid with Perlin-noise elevation values. The generator is bound to a target grid size (width, height) and a noise frequency. Each cell carries (x, y, height); the noise is sampled at (frequency * x / width, frequency * y / height) using FXGLMath.noise2D so the same width / height + frequency always produces the same map. The underlying Java class implements the CellGenerator interface, but Aussom's CellGenerator wrapper is a static helper (not an inheritable class), so this wrapper extends FxObj directly.

Methods

  • HeightMapGenerator (int Width = 0, int Height = 0, double Frequency = -1.0)

    Creates a new HeightMapGenerator.

    • @p Width is the target grid width in cells.
    • @p Height is the target grid height in cells.
    • @p Frequency is the noise frequency (default 10.0 when -1).
  • adopt (object Ajo)

    Wraps an existing HeightMapGenerator AussomJavaObject.

  • getWidth ()

  • getHeight ()

  • getFrequency ()

  • setFrequency (double V)

  • apply (int X, int Y)

    Generates the HeightData cell at (X, Y) by sampling the noise function. Returns a raw HeightData AJO (x, y, height fields).