Table of Contents

Struct HeightmapCompression

Namespace
Trailblazer.Heightmaps
Assembly
Trailblazer.dll

Describes deterministic quantization for compact heightmap samples.

public readonly struct HeightmapCompression
Inherited Members

Constructors

HeightmapCompression(Fixed64, Fixed64)

Creates compression metadata for short-backed height samples.

public HeightmapCompression(Fixed64 referenceHeight, Fixed64 heightStep)

Parameters

referenceHeight Fixed64

Ground height represented by compressed value zero.

heightStep Fixed64

Positive world-height delta represented by one compressed unit.

Exceptions

ArgumentOutOfRangeException

Thrown when heightStep is not positive.

Properties

HeightStep

World-height delta represented by one compressed unit.

public Fixed64 HeightStep { get; }

Property Value

Fixed64

IsValid

Gets whether this compression metadata can be used for height conversion.

public bool IsValid { get; }

Property Value

bool

ReferenceHeight

Ground height represented by a compressed value of zero.

public Fixed64 ReferenceHeight { get; }

Property Value

Fixed64

Methods

CompressClamped(Fixed64)

Quantizes a ground/contact Y value to the nearest representable short sample.

public short CompressClamped(Fixed64 groundY)

Parameters

groundY Fixed64

Returns

short

Decompress(short)

Converts a compressed sample into environment ground/contact Y.

public Fixed64 Decompress(short compressed)

Parameters

compressed short

Returns

Fixed64