Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    Heightmap Class

    Namespace: Stride.Physics
    Assembly: Stride.Physics.dll
    System.Object → Heightmap
    Derived from 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
    Name Description
    Fields
    Bytes

    Byte height array.

    Floats

    Float height array.

    HeightRange

    The range of the height.

    HeightScale

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

    HeightType

    The type of the height.

    Shorts

    Short height array.

    Size

    The size of the heightmap.

    Methods
    Create<T>(Int2, HeightfieldTypes, Vector2, Single, T[])
    | Improve this Doc View Source

    Fields


    Bytes

    Byte height array.

    [DataMember(30)]
    [Display(null, null, Browsable = false)]
    public byte[] Bytes
    Field Value
    Type Description
    System.Byte[]

    Floats

    Float height array.

    [DataMember(10)]
    [Display(null, null, Browsable = false)]
    public float[] Floats
    Field Value
    Type Description
    System.Single[]

    HeightRange

    The range of the height.

    [DataMember(60)]
    public Vector2 HeightRange
    Field Value
    Type Description
    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
    Type Description
    System.Single

    HeightType

    The type of the height.

    [DataMember(40)]
    [Display(null, null, Browsable = false)]
    public HeightfieldTypes HeightType
    Field Value
    Type Description
    HeightfieldTypes

    Shorts

    Short height array.

    [DataMember(20)]
    [Display(null, null, Browsable = false)]
    public short[] Shorts
    Field Value
    Type Description
    System.Int16[]

    Size

    The size of the heightmap.

    [DataMember(50)]
    public Int2 Size
    Field Value
    Type Description
    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.

    | Improve this Doc View Source

    Methods


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

    public static Heightmap Create<T>(Int2 size, HeightfieldTypes heightType, Vector2 heightRange, float heightScale, T[] data)
    Parameters
    Type Name Description
    Int2 size
    HeightfieldTypes heightType
    Vector2 heightRange
    System.Single heightScale
    T[] data
    Returns
    Type Description
    Heightmap
    Type Parameters
    Name Description
    T

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    HeightmapExtensions.IsValid(Heightmap)
    HeightmapExtensions.CreateTexture(Heightmap, GraphicsDevice)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation