Worldmaker Implementations
Overview
Two concrete implementations of UCAbstractWorldmaker are provided. Both follow the same pipeline but differ in the mesh component type used for rendering.
UCWorldmaker_ProceduralMesh
Uses UProceduralMeshComponent for tile rendering. Vertices, triangles, normals, UVs and vertex colors are computed manually and passed to CreateMeshSection_LinearColor.
| Name | Description |
|---|---|
| isFirstStart | Returns true if proceduralMeshComponentMap is empty |
| cleanPmc | Clears mesh sections, unregisters and destroys the component |
| calculatePoint | Computes LOD, vertex count, vertex positions, triangles, normals, UVs and vertex colors for a tile |
| createPMC_sync | Creates UProceduralMeshComponent instances, calls CreateMeshSection_LinearColor, applies material and collision |
| debug | Swaps material to debug material on all components |
UCWorldmaker_DynamicMesh
Uses UDynamicMeshComponent (Geometry Script) for tile rendering. Leverages UGeometryScriptLibrary to append a rectangle primitive, then edits vertices in-place via EditMesh with ParallelFor.
| Name | Description |
|---|---|
| isFirstStart | Returns true if dynamicMeshComponentMap is empty |
| cleanPmc | Resets the dynamic mesh, unregisters and destroys the component |
| calculatePoint | Computes LOD, vertex count, cell size and transform for a tile |
| createPMC_sync | Creates UCdryxDynamicMeshComponent instances, appends rectangle, edits vertices in parallel, recomputes normals |
| debug | Swaps material to debug material on all components |
Comparison
| Aspect | ProceduralMesh | DynamicMesh |
|---|---|---|
| Component type | UProceduralMeshComponent |
UDynamicMeshComponent |
| Mesh construction | Manual arrays (vertices, triangles, normals, UVs) | Geometry Script primitives + in-place edit |
| Normal computation | Manual cross product per quad | RecomputeNormals (Geometry Script) |
| Navigation update | Automatic | Requires explicit FNavigationSystem::UpdateComponentData |
| Dependencies | ProceduralMeshComponent module |
GeometryFramework, GeometryCore, GeometryScriptingCore modules |