Version: 2022.2
言語: 日本語

TerrainData

class in UnityEngine

/

継承:Object

マニュアルに切り替える

説明

TerrainData クラスはハイトマップ、メッシュの位置の詳細、ツリーインスタンス、地形テクスチャのアルファマップなどを格納します。

Terrain コンポーネントは地形データにリンクして、レンダリングを行ないます。

Static 変数

AlphamapTextureNameThe name for the Terrain alpha map textures.
HolesTextureNameThe name for the Terrain holes Texture.

変数

alphamapHeightHeight of the alpha map. (Read only.)
alphamapLayersアルファマップレイヤーの数
alphamapResolutionThe size of the alpha map in texels for either the width or the height.
alphamapTextureCountReturns the number of alphamap textures.
alphamapTexturesTerrain で使用されるアルファマップテクスチャ。Undo のため Terrain インスペクターで使用されます。
alphamapWidthアルファマップの幅
baseMapResolution地形のパッチのレンダリングで使用されるベースマップの解像度
boundsThe local bounding box of the TerrainData object.
detailHeightThe resolution of the detail data stored in TerrainData.
detailPatchCountThe number of patches along a terrain tile edge. This is squared to make a grid of patches.
detailPrototypesContains the detail texture/meshes that the Terrain has.
detailResolutionTerrainData の詳細な解像度
detailResolutionPerPatch各パッチの詳細解像度。大きい値は詳細オブジェクトによって使用されるバッチの数に減らされます。
detailScatterModeSee Also: DetailScatterMode
detailWidthThe resolution of the detail data stored in TerrainData.
enableHolesTextureCompressionEnable the Terrain holes Texture compression.
heightmapResolutionThe size of the heightmap in texels for either the width or the height.
heightmapScaleReturns a Vector3 where the x and z components are the size of each heightmap sample (i.e. the space between two neighboring heightmap samples), and the y component is the entire Terrain's height range in world space.
heightmapTextureReturns the heightmap texture.
holesResolutionReturns the Terrain holes resolution for both the data and the Texture.
holesTextureReturns the Terrain holes Texture.
maxDetailScatterPerResThe maximum value of each sample in the detail map of the terrain data.
sizeワールド単位での地形の合計サイズ
terrainLayersRetrieves the terrain layers used by the current terrain.
treeInstanceCountツリーインスタンスの数を返します。
treeInstances地形に配置された現在の樹木を含みます。
treePrototypesThe list of tree prototypes available in the inspector.
wavingGrassAmount草の量
wavingGrassSpeed草が揺れる速さ
wavingGrassStrength草が揺れる強さ
wavingGrassTint草のカラー

Public 関数

ComputeDetailCoverageThis function computes and returns the coverage (how many instances fit in a square unit) of a detail prototype, given its index.
ComputeDetailInstanceTransformsThis function computes and returns an array of detail object transforms for the specified patch and the specified prototype. You can use this function to retrieve the exact same transform data the Unity engine uses for detail rendering.
CopyActiveRenderTextureToHeightmapCopies the specified part of the active RenderTexture to the Terrain heightmap texture.
CopyActiveRenderTextureToTextureCopies the specified part of the active RenderTexture to the Terrain texture.
DirtyHeightmapRegionMarks the specified part of the heightmap as dirty.
DirtyTextureRegionMarks the specified part of the Terrain texture as dirty.
GetAlphamaps(x, y, width, height)を設定し、てアルファマップを取得します
GetAlphamapTextureReturns the alphamap texture at the specified index.
GetClampedDetailPatchesReturns an array of detail patches, which are each identified by X-Z coordinates. Detail objects in the patches are clamped to the maximum count.
GetDetailLayerReturns a 2D array of the detail object density (i.e. the number of detail objects for this layer) in the specific location.
GetHeightGets the world space height of the Terrain at a certain point x,y without adding the Terrain's world position y.
GetHeightsGets an array of heightmap samples.
GetHolesGets an array of Terrain holes samples.
GetInterpolatedHeightGets an interpolated height at a point x,y. The x and y coordinates are clamped to [0, 1].
GetInterpolatedHeightsGets an array of terrain height values using the normalized x,y coordinates.
GetInterpolatedNormal指定した場所の補完された法線を取得します
GetMaximumHeightErrorReturns an array of tesselation maximum height error values per renderable terrain patch. The returned array can be modified and passed to OverrideMaximumHeightError.
GetPatchMinMaxHeightsReturns an array of min max height values for all the renderable patches in a terrain. The returned array can be modified and then passed to OverrideMinMaxPatchHeights.
GetSteepness地形の (x,y) ポイントの勾配を取得します。
GetSupportedLayersエリア内のすべてのサポートされている、レイヤーのインデックス配列を取得します
GetTreeInstanceGets the tree instance at the specified index. It is used as a faster version of treeInstances[index] as this function doesn't create the entire tree instances array.
IsHoleGets whether a certain point at x,y is a hole.
OverrideMaximumHeightErrorOverride the maximum tessellation height error with user provided values. Note that the overriden values get reset when the terrain resolution is changed and stays unchanged when the terrain heightmap is painted or changed via script.
OverrideMinMaxPatchHeightsOverride the minimum and maximum patch heights for every renderable terrain patch. Note that the overriden values get reset when the terrain resolution is changed and stays unchanged when the terrain heightmap is painted or changed via script.
RefreshPrototypesTerrainData オブジェクトで利用可能なプロトタイプ (すなわち、詳細メッシュアセット) のすべての値を再度読み込みます。
RemoveDetailPrototypeRemoves the detail prototype at the specified index.
SetAlphamaps指定されたマップ領域のすべての splat 値を割り当てます。
SetBaseMapDirtyMarks the terrain data as dirty to trigger an update of the terrain basemap texture.
SetDetailLayer詳細なレイヤーの密度マップを設定します
SetDetailResolutionSets the resolution of the detail map.
SetDetailScatterModeSets the DetailScatterMode.
SetHeightsSets an array of heightmap samples.
SetHeightsDelayLODSets an array of heightmap samples.
SetHolesSets an array of Terrain holes samples.
SetHolesDelayLODSets an array of Terrain holes samples.
SetTerrainLayersRegisterUndoThis function sets the terrainLayers property, and in addition, registers the action to the Editor's undo stack.
SetTreeInstanceSets the tree instance with new parameters at the specified index. However, you cannot change TreeInstance.prototypeIndex and TreeInstance.position. If you change them, the method throws an ArgumentException.
SetTreeInstancesSets the Tree Instance array, and optionally snaps Trees onto the surface of the Terrain heightmap.
SyncHeightmapPerforms synchronization queued by previous calls to CopyActiveRenderTextureToHeightmap and DirtyHeightmapRegion, which makes the height data and LOD data used for tessellation up to date.
SyncTexturePerforms synchronization queued by previous calls to CopyActiveRenderTextureToTexture and DirtyTextureRegion, which makes CPU data of the Terrain textures up to date.

継承メンバー

変数

hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameオブジェクト名

Public 関数

GetInstanceIDGets the instance ID of the object.
ToStringReturns the name of the object.

Static 関数

DestroyRemoves a GameObject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindAnyObjectByTypeRetrieves any active loaded object of Type type.
FindFirstObjectByTypeRetrieves the first active loaded object of Type type.
FindObjectOfTypeタイプ type から最初に見つけたアクティブのオブジェクトを返します
FindObjectsByTypeRetrieves a list of all loaded objects of Type type.
FindObjectsOfTypeGets a list of all loaded objects of Type type.
Instantiateoriginal のオブジェクトをクローンします

Operator

boolオブジェクトが存在するかどうか
operator !=二つのオブジェクトが異なるオブジェクトを参照しているか比較します
operator ==2つのオブジェクト参照が同じオブジェクトを参照しているか比較します。