Table of Contents

Class GStylizedTerrain

Namespace
Pinwheel.Griffin
Assembly
Pinwheel.Polaris.Runtime.dll
[Serializable]
[ExecuteInEditMode]
public class GStylizedTerrain : MonoBehaviour
Inheritance
Object
Component
Behaviour
MonoBehaviour
GStylizedTerrain
Inherited Members
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.useGUILayout
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.transform
Component.gameObject
Component.tag
Object.GetInstanceID()
Object.GetHashCode()
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.ToString()
Object.name
Object.hideFlags

Properties

ActiveTerrains

Get a collection of all active Polaris terrain in the scene.

AutoConnect

If on, terrains in the same group will find their neighbors in some occasions.

BottomNeighbor

The neighbor terrain at negative-Z direction

Bounds

The bounding box of this terrain in world space.

GroupId

The group that this terrain belongs to. Terrain tools can use this id to selectively modify terrains. This also be used in seam matching, only terrains in the same group match their seams.

LeftNeighbor

The neighbor terrain at negative-X direction.

Rect

The bounding rect (on XZ plane) of this terrain in world space.

RightNeighbor

The neightbor terrain at positive-X direction.

TerrainData

The terrain data object assigned to this terrain. This object contains all terrain settings as well as height map, textures and foliage data.

TopNeighbor

The neighbor terrain at positive-Z direction.

Methods

ConnectAdjacentTiles()

Connect all terrains to their adjacent neighbor. There is no seam matching happens, just references assign.

ConnectNeighbor()

Find and assign the references to adjacent terrains.

ForceLOD(int)

Force the terrain to be rendered at a specified LOD.

GetChunkRects()

Get the rects (XZ-plane aligned) of all chunks in world space. Used for sweeptesting.

GetChunkRoot()

Get the root transform of all terrain chunk meshes. This is not the terrain transform itself, but a child object of it named "~Geometry".

GetChunks()

Get all the children chunks of this terrain. Chunks are just smaller unit of a terrain containing surface mesh, renderer and collider that render one small part of the terrain.

GetOrCreateChunkRoot()

Get the root transform of all terrain chunk meshes. This is not the terrain transform itself, but a child object of it named "~Geometry".

GetWorldToNormalizedMatrix()

Get a matrix to transform a point from world to normalzied [0-1] space. Use this matrix with Matrix4x4.MultiplyPoint()

MatchEdges(bool)

Match the height map and meshes at the edges of this terrain and its neighbors.

MatchEdges(int, bool)

Match the height map and meshes at the edges of all terrains in a group.

NormalizedToWorldPoint(Vector3)

Convert a point in normalized [0-1] space to world space.

Raycast(Ray, out RaycastHit, float)

Perform physics raycast against this terrain. This is just a convenient function, you can use Physics.Raycast as usual.

Raycast(Ray, out RaycastHit, float, int)

Perform raycast against all terrain within a group. This is a convenient function, you can use Physics.Raycast as usual.

Raycast(Vector3, out RaycastHit)

Perform a top-down raycast against this terrain. This is just a convenient function, you can use Physics.Raycast as usual.

Refresh()

Refresh terrain chunks components and meshes assignments.

UpdateGrassPatches()

Snap grass position to the terrain mesh or world objects depending on grass settings. Call this function after regenerate surface meshes.

UpdateTreesPosition()

Snap trees position to the terrain mesh or world objects depending on tree settings. Call this function after regenerate surface meshes.

WorldPointToNormalized(Vector3)

Convert a point in world space to terrain normalized [0-1] space.

WorldPointToUV(Vector3)

Convert a point in world space to terrain UV [0-1] space.