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
-
objectPlaneTerrain
- 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
originHeightfloatgradeXfloatgradeZfloat
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
originHeightfloatgradeXfloatgradeZfloatbiomeTerrainBiome
Properties
Biome
The biome returned at every coordinate.
public TerrainBiome Biome { get; }
Property Value
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
xfloatzfloat
Returns
GetHeight(float, float)
Returns OriginHeight + x * GradeX + z * GradeZ in metres.
public float GetHeight(float x, float z)
Parameters
xfloatzfloat
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
xfloatzfloatweightfloatwidthfloat