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.

Public
AddMesh (gatheredMesh)

Add a mesh to the list of meshes to rasterize.

Public
AddMeshBuffers (vertices, triangles)

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

Public
AddMeshBuffers (vertices, triangles)

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

Public
Collect2DColliderMeshes ()
Public
CollectColliderMeshes ()
Public
CollectRecastMeshObjs ()

Find all relevant RecastMeshObj components and create ExtraMeshes for them.

Public
CollectSceneMeshes ()
Public
CollectTerrainMeshes (rasterizeTrees, desiredChunkSize)
Public
ConvertColliderToGatheredMesh (col, localToWorldMatrix)

Rasterizes a collider to a mesh assuming it's vertices should be multiplied with the matrix.

Public
ConvertHeightmapChunkToGatheredMesh (heights, holes, sampleSize, offset, x0, z0, width, depth, stride)

Generates a terrain chunk mesh.

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

Public Variables

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

Private/Protected Members

AddRecastMeshObj (recastMeshObj)
Private
AreaFromSurfaceMode (mode, surfaceID)
Private Static
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)
Private Static
CeilDivision (lhs, rhs)

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

Private Static
CircleRadiusAdjustmentFactor (steps)

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

Private Static
CircleSteps (matrix, radius, maxError)
Private Static
CollectTreeMeshes (terrain)
Private
ConvertColliderToGatheredMesh (col)

Rasterizes a collider to a mesh.

Private
ConvertMeshToGatheredMesh (renderer, mesh, gatheredMesh)
Private
GenerateTerrainChunks (terrain, bounds, desiredChunkSize)
Private
GetColliderMesh (collider, localToWorldMatrix)
Private
MeshFilterShouldBeIncluded (filter)
Private
MeshType
Private
RasterizeBoxCollider (collider, localToWorldMatrix)
Private
RasterizeCapsuleCollider (radius, height, bounds, localToWorldMatrix)
Private
ShouldIncludeCollider (collider)
Private
ShouldIncludeCollider2D (collider)
Private
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