Inner Types
Public Methods
void
AddMesh
(
)
Add a mesh to the list of meshes to rasterize.
void
AddMesh
(
)
Add a mesh to the list of meshes to rasterize.
int
AddMeshBuffers
(
Vector3[] | vertices | |
int[] | triangles | |
)
Add vertex and triangle buffers that can later be used to create a GatheredMesh.
The returned index can be used in the GatheredMesh.meshDataIndex field of the GatheredMesh struct.
You can use the returned index multiple times with different matrices, to create instances of the same object in multiple locations.
int
AddMeshBuffers
(
NativeArray<Vector3> | vertices | |
NativeArray<int> | triangles | |
)
Add vertex and triangle buffers that can later be used to create a GatheredMesh.
The returned index can be used in the GatheredMesh.meshDataIndex field of the GatheredMesh struct.
You can use the returned index multiple times with different matrices, to create instances of the same object in multiple locations.
void
Collect2DColliderMeshes
()
void
CollectColliderMeshes
()
void
CollectRecastMeshObjs
()
Find all relevant RecastMeshObj components and create ExtraMeshes for them.
void
CollectSceneMeshes
()
void
CollectTerrainMeshes
(
bool | rasterizeTrees | |
float | desiredChunkSize | |
)
GatheredMesh?
ConvertColliderToGatheredMesh
(
)
Rasterizes a collider to a mesh assuming it's vertices should be multiplied with the matrix.
Note that the bounds of the returned RasterizationMesh is based on collider.bounds. So you might want to call myExtraMesh.RecalculateBounds on the returned mesh to recalculate it if the collider.bounds would not give the correct value.
Public Static Methods
void
GenerateHeightmapChunk
(
)
Generates a terrain chunk mesh.
Public Variables
UnityEngine.SceneManagement.Scene
scene
Private/Protected Members
void
AddRecastMeshObj
(
)
int
AreaFromSurfaceMode
(
)
int[]
BoxColliderTris = {
0, 1, 2,
0, 2, 3,
6, 5, 4,
7, 6, 4,
0, 5, 1,
0, 4, 5,
1, 6, 2,
1, 5, 6,
2, 7, 3,
2, 6, 7,
3, 4, 0,
3, 7, 4
}
Box Collider triangle indices can be reused for multiple instances.
WarningThis array should never be changed
Vector3[]
BoxColliderVerts = {
new Vector3(-1, -1, -1),
new Vector3(1, -1, -1),
new Vector3(1, -1, 1),
new Vector3(-1, -1, 1),
new Vector3(-1, 1, -1),
new Vector3(1, 1, -1),
new Vector3(1, 1, 1),
new Vector3(-1, 1, 1),
}
Box Collider vertices can be reused for multiple instances.
WarningThis array should never be changed
void
CalculateBounds
(
refUnsafeSpan<float3> | vertices | |
ref float4x4 | localToWorldMatrix | |
out Bounds | bounds | |
)
int
CeilDivision
(
)
Returns ceil(lhs/rhs), i.e lhs/rhs rounded up.
float
CircleRadiusAdjustmentFactor
(
)
If a circle is approximated by fewer segments, it will be slightly smaller than the original circle.
This factor is used to adjust the radius of the circle so that the resulting circle will have roughly the same area as the original circle.
void
CollectTreeMeshes
(
)
GatheredMesh?
ConvertColliderToGatheredMesh
(
)
Rasterizes a collider to a mesh.
This will pass the col.transform.localToWorldMatrix to the other overload of this function.
bool
ConvertMeshToGatheredMesh
(
)
bool
GenerateTerrainChunks
(
)
bool
MeshFilterShouldBeIncluded
(
)
int
NonNegativeModulus
(
)
bool
ShouldIncludeCollider
(
)
bool
ShouldIncludeCollider2D
(
)
Dictionary<GameObject,TreeInfo>
cachedTreePrefabs = new Dictionary<GameObject, TreeInfo>()
List<Material>
dummyMaterials = new List<Material>()
float
maxColliderApproximationError
List<(UnityEngine.Object, Mesh)>
meshesUnreadableAtRuntime = new List<(UnityEngine.Object, Mesh)>()
int
terrainDownsamplingFactor
List<NativeArray<int>>
triangleBuffers
List<NativeArray<Vector3>>
vertexBuffers