Terrain To Mesh
  • Terrain To Mesh
  • Quick Start
  • Editor Window Settings
    • Mesh
    • Material
    • Objects
    • Save
  • Update Splatmap Shader
  • Run-time API
    • TerrainToMesh
      • ExportMesh
      • ExportTerrainLayers
      • ExportSplatmapMaterial
      • ExportSplatmapTextures
      • HasHoles
      • ExportHolesmapTexture
      • ExportBasemapDiffuseTexture
      • ExportBasemapNormalTexture
      • ExportBasemapMaskTexture
      • ExportBasemapOcclusionTexture
      • ExportGrassTextures
      • ExportGrassAtlasTexture
      • HasPrototypes
      • CountPrototypes
      • ExportPrototypes
    • TerrainToMeshUtilities
      • GenerateGrassMesh
      • GenerateEdgeFallTexture
      • ConvertMeshToOBJ
      • ConvertMeshToOBJAndSaveToFile
      • ConvertMeshToOBJAndAppendToFile
      • GetDefaultMaterial
      • GetDefaultShader
      • GetDefaultShaderProperty
      • SetupDefaultMaterial
      • SetupAlphaCutoutForDefaultMaterial
      • ConvertPrototypesToTreeGameObjects
      • ConvertPrototypesToGrassGameObjects
      • ConvertPrototypesToGrassMeshes
      • ConvertPrototypesToDetailMeshGameObjects
      • ConvertPrototypesToDetailMeshes
      • CalculateExportedMeshVertexCount
      • SetMeshPivotPoint
    • TerrainToMeshEdgeFall
    • TerrainToMeshPrototype
    • TerrainToMeshConversionDetails
  • Help & Contact
Powered by GitBook
On this page
PreviousTerrainToMeshEdgeFallNextTerrainToMeshConversionDetails

Last updated 2 months ago

TerrainToMeshPrototype class

The TerrainToMeshPrototype class stores Tree, Grass or DetailMesh prefab's location in the object.

Properties

GameObject treePrefab

Reference to the tree prefab, in the case if current object represents a Tree.

Texture2D grassTexture

Reference to the texture, in the case if current object represents a Grass.

GameObject detailMeshPrefab

Reference to the detail mesh prefab, in the case if current object represents a DetailMesh.

int prototypeIndex

In the case of a Tree this is the index of object inside array.

In the case of a Grass or DetailMesh this is the index of object inside array.

Vector3 position

Object's local position related to the terrain-space

Quaternion rotation

Object's local rotation related to the terrain-space.

Vector3 scale

Object's local scale related to the terrain-space.

Vector3 surfaceNormal

Terrain's surface normal vector direction at the point of this object's position.

TerrainData
TerrainData.treePrototypes
TerrainData.detailPrototypes