Terrain

Struct Terrain 

Source
pub struct Terrain {
Show 40 fields pub m_BakeLightProbesForTrees: bool, pub m_ChunkDynamicUVST: Vector4f, pub m_DetailObjectDensity: f32, pub m_DetailObjectDistance: f32, pub m_DrawHeightmap: bool, pub m_DrawTreesAndFoliage: bool, pub m_DynamicUVST: Vector4f, pub m_Enabled: u8, pub m_GameObject: PPtr, pub m_HeightmapMaximumLOD: i32, pub m_HeightmapPixelError: f32, pub m_LightmapIndex: u16, pub m_LightmapIndexDynamic: u16, pub m_LightmapTilingOffset: Vector4f, pub m_LightmapTilingOffsetDynamic: Vector4f, pub m_MaterialTemplate: PPtr, pub m_ReflectionProbeUsage: i32, pub m_SplatMapDistance: f32, pub m_TerrainData: PPtr, pub m_TreeBillboardDistance: f32, pub m_TreeCrossFadeLength: f32, pub m_TreeDistance: f32, pub m_TreeMaximumFullLODCount: i32, pub m_AllowAutoConnect: Option<bool>, pub m_CastShadows: Option<bool>, pub m_DefaultSmoothness: Option<f32>, pub m_DrawInstanced: Option<bool>, pub m_EnableHeightmapRayTracing: Option<bool>, pub m_EnableTreesAndDetailsRayTracing: Option<bool>, pub m_ExplicitProbeSetHash: Option<Hash128>, pub m_GroupingID: Option<i32>, pub m_IgnoreQualitySettings: Option<bool>, pub m_LegacyShininess: Option<f32>, pub m_LegacySpecular: Option<ColorRGBA>, pub m_MaterialType: Option<i32>, pub m_PreserveTreePrototypeLayers: Option<bool>, pub m_RenderingLayerMask: Option<u32>, pub m_ShadowCastingMode: Option<i32>, pub m_StaticShadowCaster: Option<bool>, pub m_UseDefaultSmoothness: Option<bool>,
}
Expand description

Terrain is a class of the Unity engine since version 5.0.0f4. Exert from Unity’s scripting documentation: The Terrain component renders the terrain.

Fields§

§m_BakeLightProbesForTrees: bool

Specifies if an array of internal light probes should be baked for terrain trees. Available only in editor.

§m_ChunkDynamicUVST: Vector4f§m_DetailObjectDensity: f32

Density of detail objects.

§m_DetailObjectDistance: f32

Detail objects will be displayed up to this distance.

§m_DrawHeightmap: bool

Indicates whether Unity draws the Terrain geometry itself.

§m_DrawTreesAndFoliage: bool

Specify if terrain trees and details should be drawn.

§m_DynamicUVST: Vector4f§m_Enabled: u8

Enabled Behaviours are Updated, disabled Behaviours are not.

§m_GameObject: PPtr

The game object this component is attached to. A component is always attached to a game object. PPtr<GameObject>: (5.0.0f4 - 2022.3.2f1)

§m_HeightmapMaximumLOD: i32

Lets you essentially lower the heightmap resolution used for rendering.

§m_HeightmapPixelError: f32

An approximation of how many pixels the terrain will pop in the worst case when switching lod.

§m_LightmapIndex: u16

The index of the baked lightmap applied to this terrain.

§m_LightmapIndexDynamic: u16§m_LightmapTilingOffset: Vector4f§m_LightmapTilingOffsetDynamic: Vector4f§m_MaterialTemplate: PPtr

The custom material Unity uses to render the Terrain. PPtr<Material>: (5.0.0f4 - 2022.3.2f1)

§m_ReflectionProbeUsage: i32

How reflection probes are used for terrain. See ReflectionProbeUsage.

§m_SplatMapDistance: f32§m_TerrainData: PPtr

The Terrain Data that stores heightmaps, terrain textures, detail meshes and trees. PPtr<TerrainData>: (5.0.0f4 - 2022.3.2f1)

§m_TreeBillboardDistance: f32

Distance from the camera where trees will be rendered as billboards only.

§m_TreeCrossFadeLength: f32

Total distance delta that trees will use to transition from billboard orientation to mesh orientation.

§m_TreeDistance: f32

The maximum distance at which trees are rendered.

§m_TreeMaximumFullLODCount: i32

Maximum number of trees rendered at full LOD.

§m_AllowAutoConnect: Option<bool>

Specifies if the terrain tile will be automatically connected to adjacent tiles. bool: (2018.3.0f2 - 2022.3.2f1)

§m_CastShadows: Option<bool>

bool: (5.0.0f4 - 2018.4.36f1)

§m_DefaultSmoothness: Option<f32>

f32: (5.0.0f4 - 5.0.0f4)

§m_DrawInstanced: Option<bool>

Set to true to enable the terrain instance renderer. The default value is false. bool: (2018.3.0f2 - 2022.3.2f1)

§m_EnableHeightmapRayTracing: Option<bool>

When this options is enabled, Terrain heightmap geometries will be added in acceleration structures used for Ray Tracing. bool: (2022.2.0b1 - 2022.3.2f1)

§m_EnableTreesAndDetailsRayTracing: Option<bool>

bool: (2022.2.0b1 - 2022.3.2f1)

§m_ExplicitProbeSetHash: Option<Hash128>

Hash128: (2017.2.0b2 - 2022.3.2f1)

§m_GroupingID: Option<i32>

Grouping ID for auto connect. i32: (2018.3.0f2 - 2022.3.2f1)

§m_IgnoreQualitySettings: Option<bool>

When enabled, the terrain ignores the terrain overrides set in the QualitySettings. bool: (2022.2.0b1 - 2022.3.2f1)

§m_LegacyShininess: Option<f32>

f32: (5.0.0f4 - 2019.2.0a7)

§m_LegacySpecular: Option<ColorRGBA>

ColorRGBA: (5.0.0f4 - 2019.2.0a7)

§m_MaterialType: Option<i32>

i32: (5.0.0f4 - 2019.2.0a7)

§m_PreserveTreePrototypeLayers: Option<bool>

Allows you to specify how Unity chooses the layer for tree instances. bool: (2018.2.0f2 - 2022.3.2f1)

§m_RenderingLayerMask: Option<u32>

Determines which rendering layers the Terrain renderer lives on. u32: (2019.3.0b1 - 2022.3.2f1)

§m_ShadowCastingMode: Option<i32>

Allows you to set the shadow casting mode for the terrain. i32: (2019.1.0b1 - 2022.3.2f1)

§m_StaticShadowCaster: Option<bool>

bool: (2021.1.0b1 - 2022.3.2f1)

§m_UseDefaultSmoothness: Option<bool>

bool: (5.0.0f4 - 5.0.0f4)

Trait Implementations§

Source§

impl Debug for Terrain

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Terrain

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Terrain

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,