Table of Contents

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

HeightmapCompression

Depth

Number of samples along Z.

public int Depth { get; }

Property Value

int

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

string

Width

Number of samples along X.

public int Width { get; }

Property Value

int

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

name string

Stable authored surface name.

samples SwiftShortArray2D

Compressed X/Z samples indexed by X, then Z.

minBounds Vector3d

Minimum world-space X/Z sample coordinate.

interval Fixed64

Positive distance between adjacent samples.

compression HeightmapCompression

Compression metadata used to decompress samples.

Returns

HeightmapSurface

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

name string

Stable authored surface name.

heights Fixed64[,]

Ground/contact Y samples indexed by X, then Z.

minBounds Vector3d

Minimum world-space X/Z sample coordinate.

interval Fixed64

Positive distance between adjacent samples.

compression HeightmapCompression

Compression metadata used to quantize samples.

Returns

HeightmapSurface

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

worldPosition Vector3d
groundY Fixed64

Returns

bool