UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FRawMesh Struct Reference

#include <RawMesh.h>

Public Member Functions

RAWMESH_API void Empty ()
 
RAWMESH_API bool IsValid () const
 
RAWMESH_API bool IsValidOrFixable () const
 
FVector3f GetWedgePosition (int32 WedgeIndex) const
 
RAWMESH_API void CompactMaterialIndices ()
 

Public Attributes

TArray< int32FaceMaterialIndices
 
TArray< uint32FaceSmoothingMasks
 
TArray< FVector3fVertexPositions
 
TArray< uint32WedgeIndices
 
TArray< FVector3fWedgeTangentX
 
TArray< FVector3fWedgeTangentY
 
TArray< FVector3fWedgeTangentZ
 
TArray< FVector2fWedgeTexCoords [MAX_MESH_TEXTURE_COORDS]
 
TArray< FColorWedgeColors
 
TArray< int32MaterialIndexToImportIndex
 

Detailed Description

Raw mesh data used to construct optimized runtime rendering streams.

A note on terminology. Information is stored at various frequencies as defined here: Face - A single polygon in the mesh. Currently all code assumes this is a triangle but conceptually any polygon would do. Corner - Each face has N corners. As all faces are currently triangles, N=3. Wedge - Properties stored for each corner of each face. Index with FaceIndex * NumCorners + CornerIndex. Vertex - Properties shared by overlapping wedges of adjacent polygons. Typically these properties relate to position. Index with VertexIndices[WedgeIndex].

Additionally, to ease in backwards compatibility all properties should use only primitive types!

Member Function Documentation

◆ CompactMaterialIndices()

void FRawMesh::CompactMaterialIndices ( )

Compacts materials by removing any that have no associated triangles. Also updates the material index map.

◆ Empty()

void FRawMesh::Empty ( )

Empties all data streams.

◆ GetWedgePosition()

FVector3f FRawMesh::GetWedgePosition ( int32  WedgeIndex) const
inline

Helper for getting the position of a wedge.

◆ IsValid()

bool FRawMesh::IsValid ( ) const

Returns true if the mesh contains valid information.

  • Validates that stream sizes match.
  • Validates that there is at least one texture coordinate.
  • Validates that indices are valid positions in the vertex stream.

◆ IsValidOrFixable()

bool FRawMesh::IsValidOrFixable ( ) const

Returns true if the mesh contains valid information or slightly invalid information that we can fix.

  • Validates that stream sizes match.
  • Validates that there is at least one texture coordinate.
  • Validates that indices are valid positions in the vertex stream.

Member Data Documentation

◆ FaceMaterialIndices

TArray<int32> FRawMesh::FaceMaterialIndices

Material index. Array[FaceId] = int32

◆ FaceSmoothingMasks

TArray<uint32> FRawMesh::FaceSmoothingMasks

Smoothing mask. Array[FaceId] = uint32

◆ MaterialIndexToImportIndex

TArray<int32> FRawMesh::MaterialIndexToImportIndex

Map from material index -> original material index at import time. It's valid for this to be empty in which case material index == original material index.

◆ VertexPositions

TArray<FVector3f> FRawMesh::VertexPositions

Position in local space. Array[VertexId] = float3(x,y,z)

◆ WedgeColors

TArray<FColor> FRawMesh::WedgeColors

Color. Array[WedgeId]=float3(r,g,b,a)

◆ WedgeIndices

TArray<uint32> FRawMesh::WedgeIndices

Index of the vertex at this wedge. Array[WedgeId] = VertexId

◆ WedgeTangentX

TArray<FVector3f> FRawMesh::WedgeTangentX

Tangent, U direction. Array[WedgeId] = float3(x,y,z)

◆ WedgeTangentY

TArray<FVector3f> FRawMesh::WedgeTangentY

Tangent, V direction. Array[WedgeId] = float3(x,y,z)

◆ WedgeTangentZ

TArray<FVector3f> FRawMesh::WedgeTangentZ

Normal. Array[WedgeId] = float3(x,y,z)

◆ WedgeTexCoords

TArray<FVector2f> FRawMesh::WedgeTexCoords[MAX_MESH_TEXTURE_COORDS]

Texture coordinates. Array[UVId][WedgeId]=float2(u,v)


The documentation for this struct was generated from the following files: