Table of Contents

Class Heightmap

Namespace
Stride.Physics
Assembly
Stride.Physics.dll
[DataContract]
[ContentSerializer(typeof(DataContentSerializer<Heightmap>))]
[DataSerializerGlobal(typeof(CloneSerializer<Heightmap>), null, DataSerializerGenericMode.None, false, false, Profile = "Clone")]
[DataSerializerGlobal(typeof(ReferenceSerializer<Heightmap>), null, DataSerializerGenericMode.None, false, false, Profile = "Content")]
public class Heightmap
Inheritance
Heightmap
Extension Methods

Fields

Bytes

Byte height array.

[DataMember(30)]
[Display(null, null, Browsable = false)]
public byte[] Bytes

Field Value

byte[]

Floats

Float height array.

[DataMember(10)]
[Display(null, null, Browsable = false)]
public float[] Floats

Field Value

float[]

HeightRange

The range of the height.

[DataMember(60)]
public Vector2 HeightRange

Field Value

Vector2

Remarks

X is min height and Y is max height. (height * HeightScale) should be in this range. Positive and negative heights can not be handle at the same time when the height type is Byte.

HeightScale

Used to calculate the height when the height type is Short or Byte. HeightScale should be 1 when the height type is Float.

[DataMember(70)]
public float HeightScale

Field Value

float

HeightType

The type of the height.

[DataMember(40)]
[Display(null, null, Browsable = false)]
public HeightfieldTypes HeightType

Field Value

HeightfieldTypes

Shorts

Short height array.

[DataMember(20)]
[Display(null, null, Browsable = false)]
public short[] Shorts

Field Value

short[]

Size

The size of the heightmap.

[DataMember(50)]
public Int2 Size

Field Value

Int2

Remarks

X is width and Y is length. They should be greater than or equal to 2. For example, this size should be 65 * 65 when you want 64 * 64 size in a scene.

Methods

Create<T>(Int2, HeightfieldTypes, Vector2, float, T[])

public static Heightmap Create<T>(Int2 size, HeightfieldTypes heightType, Vector2 heightRange, float heightScale, T[] data)

Parameters

size Int2
heightType HeightfieldTypes
heightRange Vector2
heightScale float
data T[]

Returns

Heightmap

Type Parameters

T