Class HeightmapSurface
- Namespace
- Trailblazer.Heightmaps
- Assembly
- Trailblazer.dll
Immutable compressed X/Z lattice that resolves environment ground/contact Y.
public sealed class HeightmapSurface
- Inheritance
-
HeightmapSurface
- Inherited Members
Properties
Compression
Compression metadata used by all stored samples.
public HeightmapCompression Compression { get; }
Property Value
Depth
Number of samples along Z.
public int Depth { get; }
Property Value
Interval
Distance between adjacent height samples along X and Z.
public Fixed64 Interval { get; }
Property Value
- Fixed64
MaxBounds
Maximum inclusive world-space X/Z sample coordinate. The Y value matches MinBounds.
public Vector3d MaxBounds { get; }
Property Value
- Vector3d
MinBounds
Minimum world-space X/Z sample coordinate. The Y value is descriptive metadata only.
public Vector3d MinBounds { get; }
Property Value
- Vector3d
Name
Stable authored surface name.
public string Name { get; }
Property Value
Width
Number of samples along X.
public int Width { get; }
Property Value
Methods
FromCompressed(string, SwiftShortArray2D, Vector3d, Fixed64, HeightmapCompression)
Creates a heightmap from already compressed baked samples. This is the preferred runtime construction path because it avoids setup-time quantization work.
public static HeightmapSurface FromCompressed(string name, SwiftShortArray2D samples, Vector3d minBounds, Fixed64 interval, HeightmapCompression compression)
Parameters
namestringStable authored surface name.
samplesSwiftShortArray2DCompressed X/Z samples indexed by X, then Z.
minBoundsVector3dMinimum world-space X/Z sample coordinate.
intervalFixed64Positive distance between adjacent samples.
compressionHeightmapCompressionCompression metadata used to decompress samples.
Returns
FromHeights(string, Fixed64[,], Vector3d, Fixed64, HeightmapCompression)
Creates a heightmap from fixed-point heights by quantizing them once into compressed storage. Use this for tests, generated data, or host tooling that already owns fixed-point heights; runtime sampling still uses the same compressed representation as FromCompressed(string, SwiftShortArray2D, Vector3d, Fixed64, HeightmapCompression).
public static HeightmapSurface FromHeights(string name, Fixed64[,] heights, Vector3d minBounds, Fixed64 interval, HeightmapCompression compression)
Parameters
namestringStable authored surface name.
heightsFixed64[,]Ground/contact Y samples indexed by X, then Z.
minBoundsVector3dMinimum world-space X/Z sample coordinate.
intervalFixed64Positive distance between adjacent samples.
compressionHeightmapCompressionCompression metadata used to quantize samples.
Returns
TrySampleGround(Vector3d, out Fixed64)
Attempts to sample environment ground/contact Y at the supplied world X/Z coordinate.
public bool TrySampleGround(Vector3d worldPosition, out Fixed64 groundY)
Parameters
worldPositionVector3dgroundYFixed64