Class RecastMeshGatherer

Public

Inner Types

Holds info about a mesh to be rasterized.

Public Methods

AddMesh ([renderer], gatheredMesh)

Add a mesh to the list of meshes to rasterize.

AddMeshBuffers (vertices, triangles)

Add vertex and triangle buffers that can later be used to create a GatheredMesh.

Find all relevant RecastNavmeshModifier components and create ExtraMeshes for them.

CollectTerrainMeshes (rasterizeTrees, desiredChunkSize)
ConvertColliderToGatheredMesh (col, [localToWorldMatrix])

Rasterizes a collider to a mesh...

RecastMeshGatherer (scene, bounds, terrainDownsamplingFactor, mask, tagMask, perLayerModifications, maxColliderApproximationError)

Public Static Methods

GenerateHeightmapChunk (heights, holes, heightmapWidth, heightmapDepth, x0, z0, width, depth, stride, verts, tris)

Generates a terrain chunk mesh.

Public Variables

bounds
Public Readonly
mask
Public Readonly
scene
Public Readonly
tagMask
Public Readonly

Private/Protected Members

AddNavmeshModifier (navmeshModifier)
AreaFromSurfaceMode (mode, surfaceID)
BoxColliderTris

Box Collider triangle indices can be reused for multiple instances.

Private Static Readonly
BoxColliderVerts

Box Collider vertices can be reused for multiple instances.

Private Static Readonly
CalculateBounds (vertices, localToWorldMatrix, bounds)
CeilDivision (lhs, rhs)

Returns ceil(lhs/rhs), i.e lhs/rhs rounded up.

If a circle is approximated by fewer segments, it will be slightly smaller than the original circle.

CircleSteps (matrix, radius, maxError)
CollectTreeMeshes (terrain)
ConvertMeshToGatheredMesh (renderer, mesh, gatheredMesh)
GenerateTerrainChunks (terrain, bounds, desiredChunkSize)
GetColliderMesh (collider, localToWorldMatrix)
MeshType
Private
RasterizeBoxCollider (collider, localToWorldMatrix)
RasterizeCapsuleCollider (radius, height, bounds, localToWorldMatrix)
cachedMeshes
Private
cachedTreePrefabs
Private Readonly
dummyMaterials
Private
maxColliderApproximationError
Private Readonly
meshData
Private Readonly
meshes
Private
meshesUnreadableAtRuntime
Private Readonly
modificationsByLayer
Private Readonly
modificationsByLayer2D
Private Readonly
terrainDownsamplingFactor
Private Readonly
triangleBuffers
Private Readonly
vertexBuffers
Private Readonly