Class Heightmap
[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
- 
      objectHeightmap
- Extension Methods
Fields
Bytes
Byte height array.
[DataMember(30)]
[Display(null, null, Browsable = false)]
public byte[] BytesField Value
- byte[]
Floats
Float height array.
[DataMember(10)]
[Display(null, null, Browsable = false)]
public float[] FloatsField Value
- float[]
HeightRange
The range of the height.
[DataMember(60)]
public Vector2 HeightRangeField Value
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 HeightScaleField Value
HeightType
The type of the height.
[DataMember(40)]
[Display(null, null, Browsable = false)]
public HeightfieldTypes HeightTypeField Value
Shorts
Short height array.
[DataMember(20)]
[Display(null, null, Browsable = false)]
public short[] ShortsField Value
- short[]
Size
The size of the heightmap.
[DataMember(50)]
public Int2 SizeField Value
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
- sizeInt2
- heightTypeHeightfieldTypes
- heightRangeVector2
- heightScalefloat
- dataT[]
Returns
Type Parameters
- T