![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <DynamicMeshBuilder.h>
A utility used to construct dynamically generated meshes, and render them to a FPrimitiveDrawInterface. Note: This is meant to be easy to use, not fast. It moves the data around more than necessary, and requires dynamically allocating RHI resources. Exercise caution.
| FDynamicMeshBuilder::FDynamicMeshBuilder | ( | ERHIFeatureLevel::Type | InFeatureLevel, |
| uint32 | InNumTexCoords = 1, |
||
| uint32 | InLightmapCoordinateIndex = 0, |
||
| bool | InUse16bitTexCoord = false, |
||
| FDynamicMeshBufferAllocator * | InDynamicMeshBufferAllocator = nullptr |
||
| ) |
Initialization constructor.
| FDynamicMeshBuilder::~FDynamicMeshBuilder | ( | ) |
Destructor.
Add many indices to the mesh.
| int32 FDynamicMeshBuilder::AddVertex | ( | const FDynamicMeshVertex & | InVertex | ) |
Adds a vertex to the mesh.
| int32 FDynamicMeshBuilder::AddVertex | ( | const FVector3f & | InPosition, |
| const FVector2f & | InTextureCoordinate, | ||
| const FVector3f & | InTangentX, | ||
| const FVector3f & | InTangentY, | ||
| const FVector3f & | InTangentZ, | ||
| const FColor & | InColor | ||
| ) |
Adds a vertex to the mesh.
| int32 FDynamicMeshBuilder::AddVertices | ( | const TArray< FDynamicMeshVertex > & | InVertices | ) |
Adds many vertices to the mesh.
Adds many vertices to the mesh. Returns start index of verts in the overall array.
| void FDynamicMeshBuilder::Draw | ( | FPrimitiveDrawInterface * | PDI, |
| const FMatrix & | LocalToWorld, | ||
| const FMaterialRenderProxy * | MaterialRenderProxy, | ||
| uint8 | DepthPriorityGroup, | ||
| bool | bDisableBackfaceCulling = false, |
||
| bool | bReceivesDecals = true, |
||
| const FHitProxyId | HitProxyId = FHitProxyId() |
||
| ) |
Draws the mesh to the given primitive draw interface.
| PDI | - The primitive draw interface to draw the mesh on. |
| LocalToWorld | - The local to world transform to apply to the vertices of the mesh. |
| FMaterialRenderProxy | - The material instance to render on the mesh. |
| DepthPriorityGroup | - The depth priority group to render the mesh in. |
| HitProxyId | - Hit proxy to use for this mesh. Use INDEX_NONE for no hit proxy. |
| void FDynamicMeshBuilder::GetMesh | ( | const FMatrix & | LocalToWorld, |
| const FMaterialRenderProxy * | MaterialRenderProxy, | ||
| uint8 | DepthPriorityGroup, | ||
| bool | bDisableBackfaceCulling, | ||
| bool | bReceivesDecals, | ||
| bool | bUseSelectionOutline, | ||
| int32 | ViewIndex, | ||
| FMeshElementCollector & | Collector, | ||
| const FHitProxyId | HitProxyId = FHitProxyId() |
||
| ) |
| void FDynamicMeshBuilder::GetMesh | ( | const FMatrix & | LocalToWorld, |
| const FMaterialRenderProxy * | MaterialRenderProxy, | ||
| uint8 | DepthPriorityGroup, | ||
| bool | bDisableBackfaceCulling, | ||
| bool | bReceivesDecals, | ||
| bool | bUseSelectionOutline, | ||
| int32 | ViewIndex, | ||
| FMeshElementCollector & | Collector, | ||
| HHitProxy * | HitProxy | ||
| ) |
| void FDynamicMeshBuilder::GetMesh | ( | const FMatrix & | LocalToWorld, |
| const FMaterialRenderProxy * | MaterialRenderProxy, | ||
| uint8 | DepthPriorityGroup, | ||
| bool | bDisableBackfaceCulling, | ||
| bool | bReceivesDecals, | ||
| int32 | ViewIndex, | ||
| FMeshElementCollector & | Collector | ||
| ) |
Adds a mesh of what's been built so far to the collector.
| void FDynamicMeshBuilder::GetMesh | ( | const FMatrix & | LocalToWorld, |
| const FMaterialRenderProxy * | MaterialRenderProxy, | ||
| uint8 | DepthPriorityGroup, | ||
| const FDynamicMeshBuilderSettings & | Settings, | ||
| FDynamicMeshDrawOffset const *const | DrawOffset, | ||
| int32 | ViewIndex, | ||
| FMeshElementCollector & | Collector, | ||
| const FHitProxyId | HitProxyId = FHitProxyId() |
||
| ) |
| void FDynamicMeshBuilder::GetMesh | ( | const FMatrix & | LocalToWorld, |
| const FMatrix & | PrevLocalToWorld, | ||
| const FMaterialRenderProxy * | MaterialRenderProxy, | ||
| uint8 | DepthPriorityGroup, | ||
| const FDynamicMeshBuilderSettings & | Settings, | ||
| FDynamicMeshDrawOffset const *const | DrawOffset, | ||
| int32 | ViewIndex, | ||
| FMeshElementCollector & | Collector, | ||
| const FHitProxyId | HitProxyId = FHitProxyId() |
||
| ) |
| void FDynamicMeshBuilder::GetMeshElement | ( | const FMatrix & | LocalToWorld, |
| const FMaterialRenderProxy * | MaterialRenderProxy, | ||
| uint8 | DepthPriorityGroup, | ||
| bool | bDisableBackfaceCulling, | ||
| bool | bReceivesDecals, | ||
| int32 | ViewIndex, | ||
| FMeshBuilderOneFrameResources & | OneFrameResource, | ||
| FMeshBatch & | Mesh | ||
| ) |
| void FDynamicMeshBuilder::GetMeshElement | ( | const FPrimitiveUniformShaderParameters & | PrimitiveParams, |
| const FMaterialRenderProxy * | MaterialRenderProxy, | ||
| uint8 | DepthPriorityGroup, | ||
| bool | bDisableBackfaceCulling, | ||
| int32 | ViewIndex, | ||
| FMeshBuilderOneFrameResources & | OneFrameResource, | ||
| FMeshBatch & | Mesh | ||
| ) |
Pre-allocate space for the given number of triangles.
Pre-allocate space for the given number of vertices.