API Referenceaurora
Terrain
Terrain object created from a heightmap or procedural generator, with biome support.
Module: aurora
Terrain object created from a heightmap or procedural generator, with biome support.
Declaration
export class Terrain extends GameObject { ... }Extends: GameObject
Properties
heightmap
heightmap: Resource;moistureTexture
moistureTexture: Texture;temperatureTexture
temperatureTexture: Texture;generator
generator: TerrainGenerator;createdWithMap
createdWithMap: boolean;width
width: number;length
length: number;height
height: number;maxPeak
maxPeak: number;seaLevel
seaLevel: number;Methods
attachTexture
Attaches a texture to this object.
attachTexture(texture: Texture): void;setPosition
Sets the position to an absolute value.
setPosition(position: Position3d): void;move
Translates by the supplied offset.
move(position: Position3d): void;setRotation
Replaces the rotation.
setRotation(rotation: Rotation3d): void;lookAt
Orients toward the target position.
lookAt(target: Position3d, up?: Normal3d): void;rotate
Applies an incremental rotation.
rotate(rotation: Rotation3d): void;setScale
Replaces the scale factors.
setScale(scale: Scale3d): void;scaleBy
Multiplies the current scale component-wise by the supplied factors.
scaleBy(scale: Scale3d): void;show
Makes the object visible.
show(): void;hide
Makes the object invisible.
hide(): void;addBiome
Adds a biome to the terrain.
addBiome(biome: Biome): void;fromGenerator
Creates terrain using the supplied height generator.
static fromGenerator<T extends TerrainGenerator>(generator: T): Terrain;fromHeightmap
Creates terrain from a heightmap resource.
static fromHeightmap(heightmap: Resource): Terrain;