Table of Contents

Class PlaneTerrain

Namespace
Valheim.Testing
Assembly
Valheim.Testing.dll

A deterministic plane with constant biome and no river: height is origin height plus x and z grades.

public sealed class PlaneTerrain : ITerrain
Inheritance
object
PlaneTerrain
Implements

Constructors

PlaneTerrain(float, float, float)

Creates a Meadows plane; defaults to 40 m high with zero grade.

public PlaneTerrain(float originHeight = 40, float gradeX = 0, float gradeZ = 0)

Parameters

originHeight float
gradeX float
gradeZ float

PlaneTerrain(float, float, float, TerrainBiome)

Creates a plane with the given origin height, x/z grades and constant biome.

public PlaneTerrain(float originHeight, float gradeX, float gradeZ, TerrainBiome biome)

Parameters

originHeight float
gradeX float
gradeZ float
biome TerrainBiome

Properties

Biome

The biome returned at every coordinate.

public TerrainBiome Biome { get; }

Property Value

TerrainBiome

GradeX

The change in height for one metre along x.

public float GradeX { get; }

Property Value

float

GradeZ

The change in height for one metre along z.

public float GradeZ { get; }

Property Value

float

OriginHeight

The height at x=0, z=0, in metres.

public float OriginHeight { get; }

Property Value

float

Methods

GetBiome(float, float)

Returns the constant Biome.

public TerrainBiome GetBiome(float x, float z)

Parameters

x float
z float

Returns

TerrainBiome

GetHeight(float, float)

Returns OriginHeight + x * GradeX + z * GradeZ in metres.

public float GetHeight(float x, float z)

Parameters

x float
z float

Returns

float

GetRiverWeight(float, float, out float, out float)

Returns zero river weight and width at every coordinate.

public void GetRiverWeight(float x, float z, out float weight, out float width)

Parameters

x float
z float
weight float
width float