C# Class TerrainHelpers, tf_client

Utility class for working with terrains
Inheritance: System.Object
Afficher le fichier Open project: wids-eria/tf_client Class Usage Examples

Méthodes publiques

Méthode Description
Clone ( TerrainData source, int detailResolutionPerPatch ) : TerrainData

Clone TerrainData object

ControlTextureToFloatArray ( Texture2D tex, int xBase, int yBase, int width, int height, float scale ) : ].float[

Return a control texture as a float[height,width] for e.g., height or splat

ControlTextureToIntArray ( Texture2D tex, int xBase, int yBase, int width, int height, int res ) : ].int[

Return a control texture as an int[height,width] for e.g., detail distribution

SetTextureFromDetails ( Texture2D tex, int xBase, int yBase, int details, int res ) : void

Update a grayscale control texture using the supplied information

TerrainToTreePosition ( Terrain terrain, Vector3 terrainSpacePosition ) : Vector3

Convert terrainSpacePosition into a tree-space position

TerrainToTreePosition ( Vector3 inverseTerrainSize, Vector3 terrainSpacePosition ) : Vector3

Convert terrainSpacePosition into a tree-space position

TreeToTerrainPosition ( Terrain terrain, Vector3 treeSpacePosition ) : Vector3

Convert treeSpacePosition into a terrain-space position

Method Details

Clone() public static méthode

Clone TerrainData object
public static Clone ( TerrainData source, int detailResolutionPerPatch ) : TerrainData
source TerrainData /// A ///
detailResolutionPerPatch int /// A ///
Résultat TerrainData

ControlTextureToFloatArray() public static méthode

Return a control texture as a float[height,width] for e.g., height or splat
public static ControlTextureToFloatArray ( Texture2D tex, int xBase, int yBase, int width, int height, float scale ) : ].float[
tex UnityEngine.Texture2D /// A ///
xBase int /// A ///
yBase int /// A ///
width int /// A ///
height int /// A ///
scale float /// A ///
Résultat ].float[

ControlTextureToIntArray() public static méthode

Return a control texture as an int[height,width] for e.g., detail distribution
public static ControlTextureToIntArray ( Texture2D tex, int xBase, int yBase, int width, int height, int res ) : ].int[
tex UnityEngine.Texture2D /// A ///
xBase int /// A ///
yBase int /// A ///
width int /// A ///
height int /// A ///
res int /// A detail resolution ///
Résultat ].int[

SetTextureFromDetails() public static méthode

Update a grayscale control texture using the supplied information
public static SetTextureFromDetails ( Texture2D tex, int xBase, int yBase, int details, int res ) : void
tex UnityEngine.Texture2D /// A ///
xBase int /// A ///
yBase int /// A ///
details int /// A ///
res int /// A ///
Résultat void

TerrainToTreePosition() public static méthode

Convert terrainSpacePosition into a tree-space position
public static TerrainToTreePosition ( Terrain terrain, Vector3 terrainSpacePosition ) : Vector3
terrain Terrain /// A ///
terrainSpacePosition Vector3 /// A in terrain's local space ///
Résultat Vector3

TerrainToTreePosition() public static méthode

Convert terrainSpacePosition into a tree-space position
public static TerrainToTreePosition ( Vector3 inverseTerrainSize, Vector3 terrainSpacePosition ) : Vector3
inverseTerrainSize Vector3 /// A inverse of the size of the terrain of interest (e.g., (1/x, 1/y, 1/z)) ///
terrainSpacePosition Vector3 /// A in the local space of the terrain of interest ///
Résultat Vector3

TreeToTerrainPosition() public static méthode

Convert treeSpacePosition into a terrain-space position
public static TreeToTerrainPosition ( Terrain terrain, Vector3 treeSpacePosition ) : Vector3
terrain Terrain /// A ///
treeSpacePosition Vector3 /// A homogenous coordinate ///
Résultat Vector3