![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <MeshNormals.h>
Public Member Functions | |
| FMeshNormals () | |
| FMeshNormals (const FDynamicMesh3 *Mesh) | |
| void | SetMesh (const FDynamicMesh3 *MeshIn) |
| const TArray< FVector3d > & | GetNormals () const |
| FVector3d & | operator[] (int i) |
| const FVector3d & | operator[] (int i) const |
| GEOMETRYCORE_API void | SetCount (int Count, bool bClearToZero) |
| void | ComputeVertexNormals (bool bWeightByArea=true, bool bWeightByAngle=true) |
| void | ComputeTriangleNormals () |
| GEOMETRYCORE_API void | SetDegenerateTriangleNormalsToNeighborNormal () |
| void | RecomputeOverlayNormals (const FDynamicMeshNormalOverlay *NormalOverlay, bool bWeightByArea=true, bool bWeightByAngle=true) |
| GEOMETRYCORE_API void | CopyToVertexNormals (FDynamicMesh3 *SetMesh, bool bInvert=false) const |
| GEOMETRYCORE_API void | CopyToOverlay (FDynamicMeshNormalOverlay *NormalOverlay, bool bInvert=false) const |
Protected Member Functions | |
| GEOMETRYCORE_API void | Compute_FaceAvg_AreaWeighted () |
| GEOMETRYCORE_API void | Compute_FaceAvg (bool bWeightByArea, bool bWeightByAngle) |
| GEOMETRYCORE_API void | Compute_Triangle () |
| GEOMETRYCORE_API void | Compute_Overlay_FaceAvg_AreaWeighted (const FDynamicMeshNormalOverlay *NormalOverlay) |
| GEOMETRYCORE_API void | Compute_Overlay_FaceAvg (const FDynamicMeshNormalOverlay *NormalOverlay, bool bWeightByArea, bool bWeightByAngle) |
Protected Attributes | |
| const FDynamicMesh3 * | Mesh |
| TArray< FVector3d > | Normals |
FMeshNormals is a utility class that can calculate and store various types of normal vectors for a FDynamicMesh.
|
inline |
|
inline |
Compute per-vertex normals using a custom combination of area-weighted and angle-weighted averaging of one-ring triangle normals
|
protected |
Compute per-vertex normals using area-weighted averaging of one-ring triangle normals
|
protected |
Recompute the element Normals of the given attribute overlay using a custom combination of area-weighted and angle-weighted averaging of one-ring triangle normals
|
protected |
Recompute the element Normals of the given attribute overlay using area-weighted averaging of one-ring triangle normals
|
protected |
Compute per-triangle normals
|
static |
| bWeightByArea | weight neighbor triangles by area |
| bWeightByAngle | weight neighbor triangles by angle |
|
inline |
Compute per-triangle normals
|
static |
Compute normal at mesh vertex by weighted sum of one-ring triangle normals. Can optionally weight by area, angle, or both (averaged)
| bWeightByArea | weight neighbor triangles by area |
| bWeightByAngle | weight neighbor triangles by angle |
|
static |
Compute normal at mesh vertex by weighted sum of subset of one-ring triangle normals. Can optionally weight by area, angle, or both (averaged)
| TriangleFilterFunc | Only one-ring triangles for which this function returns true will be included |
| bWeightByArea | weight neighbor triangles by area |
| bWeightByAngle | weight neighbor triangles by angle |
|
inline |
Compute standard per-vertex normals by averaging one-ring face normals
| void FMeshNormals::CopyToOverlay | ( | FDynamicMeshNormalOverlay * | NormalOverlay, |
| bool | bInvert = false |
||
| ) | const |
Copy the current set of normals to the NormalOverlay attribute layer
| bInvert | if true, normals are flipped |
| void FMeshNormals::CopyToVertexNormals | ( | FDynamicMesh3 * | SetMesh, |
| bool | bInvert = false |
||
| ) | const |
Copy the current set of normals to the vertex normals of SetMesh
| bInvert | if true, normals are flipped |
|
static |
Retrieve the area and/or angle weights for each vertex of a triangle
| Mesh | the mesh to query |
| TriID | the triangle index of the mesh to query |
| TriArea | the area of the triangle |
| bWeightByArea | if true, include weighting by the area of the triangle |
| bWeightByAngle | if true, include weighting by the interior angles of the triangle |
|
static |
Initialize the given Mesh with per-face normals, ie separate overlay element for each vertex of each triangle.
|
static |
Initialize the given triangles of NormalOverlay with per-vertex normals, ie single overlay element for each mesh vertex. Only the triangles included in the region are considered when calculating per-vertex normals.
|
static |
Initialize the given NormalOverlay with per-face normals, ie separate overlay element for each vertex of each triangle.
|
static |
Initialize the given NormalOverlay with per-vertex normals, ie single overlay element for each mesh vertex.
| bUseMeshVertexNormalsIfAvailable | if true and the parent mesh has per-vertex normals, use them instead of calculating new ones |
|
static |
|
static |
|
inline |
|
inline |
|
static |
Compute per-vertex normals for the given Mesh
| bInvert | if true, normals are flipped |
|
static |
Compute per-vertex normals for the vertices of a set of triangles of a Mesh
| bWeightByArea | weight neighbor triangles by area |
| bWeightByAngle | weight neighbor triangles by angle |
| bInvert | if true, normals are flipped |
|
static |
Compute overlay normals for the given mesh
| bInvert | if true, normals are flipped |
|
static |
Compute overlay normals for the given mesh, for the given set of element IDs
|
inline |
Recompute the per-element normals of the given overlay by averaging one-ring face normals
|
static |
Compute overlay normals for the given mesh, for the given set of triangles
Set the size of the Normals array to Count, and optionally clear all values to (0,0,0)
| void FMeshNormals::SetDegenerateTriangleNormalsToNeighborNormal | ( | ) |
Assumes that ComputeTriangleNormals() has already been run.
Looks through the normals for any that are zero, and tries to set them to the normal of some neighboring triangle, preferring the triangle on its longer side if possible. This is useful for finding connected components based on normals, as it prevents degenerate triangles with 0 normals from connecting otherwise disconnected components. This won't help if a whole mesh componenent is entirely made of such degenerate triangles (which is usually ok).
|
inline |
|
static |
Apply rounds of explicit uniform-weighted normal smoothing to the VertexNormals attribute of the given Mesh.
|
protected |
Target Mesh