UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::FDynamicMesh3 Class Reference

#include <DynamicMesh3.h>

Classes

struct  FAppendInfo
 
struct  FCollapseEdgeOptions
 
struct  FEdge
 
struct  FMergeVerticesOptions
 
struct  FMeshDifferenceInfo
 
struct  FSameAsOptions
 
struct  FValidityOptions
 

Public Types

using FEdgeFlipInfo = DynamicMeshInfo::FEdgeFlipInfo
 
using FEdgeSplitInfo = DynamicMeshInfo::FEdgeSplitInfo
 
using FEdgeCollapseInfo = DynamicMeshInfo::FEdgeCollapseInfo
 
using FMergeEdgesInfo = DynamicMeshInfo::FMergeEdgesInfo
 
using FMergeVerticesInfo = DynamicMeshInfo::FMergeVerticesInfo
 
using FPokeTriangleInfo = DynamicMeshInfo::FPokeTriangleInfo
 
using FVertexSplitInfo = DynamicMeshInfo::FVertexSplitInfo
 
using FLocalIntArray = TArray< int32, TInlineAllocator< 8 > >
 
using FLocalBoolArray = TArray< bool, TInlineAllocator< 8 > >
 
typedef FRefCountVector::IndexEnumerable vertex_iterator
 
typedef FRefCountVector::IndexEnumerable triangle_iterator
 
typedef FRefCountVector::IndexEnumerable edge_iterator
 
template<typename T >
using value_iteration = FRefCountVector::MappedEnumerable< T >
 
using vtx_triangles_enumerable = TPairExpandEnumerable< FSmallListSet::ValueIterator >
 

Public Member Functions

GEOMETRYCORE_API FDynamicMesh3 ()
 
GEOMETRYCORE_API FDynamicMesh3 (const FDynamicMesh3 &CopyMesh)
 
GEOMETRYCORE_API FDynamicMesh3 (FDynamicMesh3 &&MoveMesh)
 
GEOMETRYCORE_API const FDynamicMesh3operator= (const FDynamicMesh3 &CopyMesh)
 
GEOMETRYCORE_API const FDynamicMesh3operator= (FDynamicMesh3 &&MoveMesh)
 
virtual GEOMETRYCORE_API ~FDynamicMesh3 ()
 
GEOMETRYCORE_API FDynamicMesh3 (bool bWantNormals, bool bWantColors, bool bWantUVs, bool bWantTriGroups)
 
GEOMETRYCORE_API FDynamicMesh3 (EMeshComponents flags)
 
GEOMETRYCORE_API FDynamicMesh3 (const FMeshShapeGenerator *Generator)
 
GEOMETRYCORE_API void Copy (const FDynamicMesh3 &CopyMesh, bool bNormals=true, bool bColors=true, bool bUVs=true, bool bAttributes=true)
 
GEOMETRYCORE_API bool Copy (const FMeshShapeGenerator *Generator)
 
GEOMETRYCORE_API void AppendWithOffsets (const FDynamicMesh3 &ToAppend, FAppendInfo *OutAppendInfo=nullptr)
 
GEOMETRYCORE_API void CompactCopy (const FDynamicMesh3 &CopyMesh, bool bNormals=true, bool bColors=true, bool bUVs=true, bool bAttributes=true, FCompactMaps *CompactInfo=nullptr)
 
GEOMETRYCORE_API void Clear ()
 
GEOMETRYCORE_API void EnableMatchingAttributes (const FDynamicMesh3 &ToMatch, bool bClearExisting=true, bool bDiscardExtraAttributes=false)
 
GEOMETRYCORE_API void Serialize (FArchive &Ar)
 
int VertexCount () const
 
int TriangleCount () const
 
int EdgeCount () const
 
int MaxVertexID () const
 
int MaxTriangleID () const
 
int MaxEdgeID () const
 
int MaxGroupID () const
 
bool HasVertexNormals () const
 
bool HasVertexColors () const
 
bool HasVertexUVs () const
 
bool HasTriangleGroups () const
 
bool HasAttributes () const
 
GEOMETRYCORE_API int GetComponentsFlags () const
 
bool IsVertex (int VertexID) const
 
bool IsReferencedVertex (int VertexID) const
 
bool IsTriangle (int TriangleID) const
 
bool IsEdge (int EdgeID) const
 
void SetShapeChangeStampEnabled (bool bEnabled)
 
void SetTopologyChangeStampEnabled (bool bEnabled)
 
bool HasShapeChangeStampEnabled () const
 
bool HasTopologyChangeStampEnabled () const
 
void UpdateChangeStamps (bool bShapeChange, bool bTopologyChange)
 
uint32 GetShapeChangeStamp () const
 
uint32 GetTopologyChangeStamp () const
 
uint64 GetChangeStamp () const
 
vertex_iterator VertexIndicesItr () const
 
triangle_iterator TriangleIndicesItr () const
 
edge_iterator EdgeIndicesItr () const
 
FRefCountVector::FilteredEnumerable BoundaryEdgeIndicesItr () const
 
value_iteration< FVector3dVerticesItr () const
 
value_iteration< FIndex3iTrianglesItr () const
 
value_iteration< FEdgeEdgesItr () const
 
FSmallListSet::MappedValueEnumerable VtxVerticesItr (int VertexID) const
 
void EnumerateVertexVertices (int32 VertexID, TFunctionRef< void(int32)> VertexFunc) const
 
FSmallListSet::ValueEnumerable VtxEdgesItr (int VertexID) const
 
void EnumerateVertexEdges (int32 VertexID, TFunctionRef< void(int32)> EdgeFunc) const
 
vtx_triangles_enumerable VtxTrianglesItr (int VertexID) const
 
GEOMETRYCORE_API void EnumerateVertexTriangles (int32 VertexID, TFunctionRef< void(int32)> ApplyFunc) const
 
GEOMETRYCORE_API int32 GetSingleVertexTriangle (int32 VID) const
 
GEOMETRYCORE_API void EnumerateEdgeTriangles (int32 EdgeID, TFunctionRef< void(int32)> ApplyFunc) const
 
GEOMETRYCORE_API int AppendVertex (const FVertexInfo &VertInfo)
 
int AppendVertex (const FVector3d &Position)
 
GEOMETRYCORE_API int AppendVertex (const FDynamicMesh3 &SourceMesh, int SourceVertexID)
 
GEOMETRYCORE_API int AppendTriangle (const FIndex3i &TriVertices, int GroupID=0)
 
int AppendTriangle (int Vertex0, int Vertex1, int Vertex2, int GroupID=0)
 
virtual void BeginUnsafeVerticesInsert ()
 
virtual void EndUnsafeVerticesInsert ()
 
GEOMETRYCORE_API EMeshResult InsertVertex (int VertexID, const FVertexInfo &VertInfo, bool bUnsafe=false)
 
virtual void BeginUnsafeTrianglesInsert ()
 
virtual void EndUnsafeTrianglesInsert ()
 
GEOMETRYCORE_API EMeshResult InsertTriangle (int TriangleID, const FIndex3i &TriVertices, int GroupID=0, bool bUnsafe=false)
 
FVector3d GetVertex (int VertexID) const
 
const FVector3dGetVertexRef (int VertexID) const
 
void SetVertex (int VertexID, const FVector3d &vNewPos, bool bTrackChange=true)
 
GEOMETRYCORE_API bool GetVertex (int VertexID, FVertexInfo &VertInfo, bool bWantNormals, bool bWantColors, bool bWantUVs) const
 
GEOMETRYCORE_API FVertexInfo GetVertexInfo (int VertexID) const
 
int GetVtxEdgeCount (int VertexID) const
 
GEOMETRYCORE_API int GetMaxVtxEdgeCount () const
 
FIndex3i GetTriangle (int TriangleID) const
 
const FIndex3iGetTriangleRef (int TriangleID) const
 
FIndex3i GetTriEdges (int TriangleID) const
 
const FIndex3iGetTriEdgesRef (int TriangleID) const
 
int GetTriEdge (int TriangleID, int j) const
 
void EnumerateTriEdgeIDsFromTriID (const int TriID, const TFunctionRef< void(FMeshTriEdgeID TriEdgeID)> &TriEdgeFunc) const
 
GEOMETRYCORE_API FIndex3i GetTriNeighbourTris (int TriangleID) const
 
template<typename VecType >
void GetTriVertices (int TriangleID, VecType &v0, VecType &v1, VecType &v2) const
 
FVector3d GetTriVertex (int TriangleID, int j) const
 
FEdge GetEdge (int EdgeID) const
 
const FEdgeGetEdgeRef (int EdgeID) const
 
FIndex2i GetEdgeV (int EdgeID) const
 
bool GetEdgeV (int EdgeID, FVector3d &a, FVector3d &b) const
 
FIndex2i GetEdgeT (int EdgeID) const
 
GEOMETRYCORE_API FIndex2i GetOrientedBoundaryEdgeV (int EdgeID) const
 
FMeshTriEdgeID GetTriEdgeIDFromEdgeID (int EdgeID) const
 
void EnumerateTriEdgeIDsFromEdgeID (const int32 EdgeID, const TFunctionRef< void(FMeshTriEdgeID TriEdgeID)> &TriEdgeFunc) const
 
GEOMETRYCORE_API void EnableMeshComponents (int MeshComponentsFlags)
 
GEOMETRYCORE_API void EnableVertexNormals (const FVector3f &InitialNormal)
 
GEOMETRYCORE_API void DiscardVertexNormals ()
 
FVector3f GetVertexNormal (int vID) const
 
void SetVertexNormal (int vID, const FVector3f &vNewNormal)
 
GEOMETRYCORE_API void EnableVertexColors (const FVector3f &InitialColor)
 
GEOMETRYCORE_API void DiscardVertexColors ()
 
FVector3f GetVertexColor (int vID) const
 
void SetVertexColor (int vID, const FVector3f &vNewColor)
 
GEOMETRYCORE_API void EnableVertexUVs (const FVector2f &InitialUV)
 
GEOMETRYCORE_API void DiscardVertexUVs ()
 
FVector2f GetVertexUV (int vID) const
 
void SetVertexUV (int vID, const FVector2f &vNewUV)
 
GEOMETRYCORE_API void EnableTriangleGroups (int InitialGroupID=0)
 
GEOMETRYCORE_API void DiscardTriangleGroups ()
 
int AllocateTriangleGroup ()
 
int GetTriangleGroup (int tID) const
 
void SetTriangleGroup (int tid, int group_id)
 
FDynamicMeshAttributeSetAttributes ()
 
const FDynamicMeshAttributeSetAttributes () const
 
GEOMETRYCORE_API void EnableAttributes ()
 
GEOMETRYCORE_API void DiscardAttributes ()
 
bool IsBoundaryEdge (int EdgeID) const
 
GEOMETRYCORE_API bool IsBoundaryVertex (int VertexID) const
 
GEOMETRYCORE_API bool IsBoundaryTriangle (int TriangleID) const
 
GEOMETRYCORE_API int FindEdge (int VertexA, int VertexB) const
 
GEOMETRYCORE_API int FindEdgeFromTri (int VertexA, int VertexB, int TriangleID) const
 
GEOMETRYCORE_API int FindEdgeFromTriPair (int TriangleA, int TriangleB) const
 
GEOMETRYCORE_API int FindTriangle (int A, int B, int C) const
 
GEOMETRYCORE_API FIndex2i GetEdgeOpposingV (int EdgeID) const
 
GEOMETRYCORE_API void GetVtxNbrhood (int EdgeID, int VertexID, int &OtherVertOut, int &OppVert1Out, int &OppVert2Out, int &Tri1Out, int &Tri2Out) const
 
GEOMETRYCORE_API int GetVtxBoundaryEdges (int VertexID, int &Edge0Out, int &Edge1Out) const
 
template<typename ArrayType = FLocalIntArray>
GEOMETRYCORE_API int GetAllVtxBoundaryEdges (int VertexID, ArrayType &EdgeListOut) const
 
GEOMETRYCORE_API int GetVtxTriangleCount (int VertexID) const
 
template<typename ArrayType = FLocalIntArray>
GEOMETRYCORE_API EMeshResult GetVtxTriangles (int VertexID, ArrayType &TrianglesOut) const
 
GEOMETRYCORE_API int GetVtxSingleTriangle (int VertexID) const
 
template<typename IntArrayType = FLocalIntArray, typename BoolArrayType = FLocalBoolArray>
GEOMETRYCORE_API EMeshResult GetVtxContiguousTriangles (int VertexID, IntArrayType &TrianglesOut, IntArrayType &ContiguousGroupLengths, BoolArrayType &GroupIsLoop) const
 
GEOMETRYCORE_API bool IsGroupBoundaryEdge (int EdgeID) const
 
GEOMETRYCORE_API bool IsGroupBoundaryVertex (int VertexID) const
 
GEOMETRYCORE_API bool IsGroupJunctionVertex (int VertexID) const
 
GEOMETRYCORE_API bool GetVertexGroups (int VertexID, FIndex4i &GroupsOut) const
 
template<typename ArrayType = FLocalIntArray>
GEOMETRYCORE_API bool GetAllVertexGroups (int VertexID, ArrayType &GroupsOut) const
 
GEOMETRYCORE_API bool IsBowtieVertex (int VertexID) const
 
bool IsCompact () const
 
bool IsCompactV () const
 
bool IsCompactT () const
 
double CompactMetric () const
 
GEOMETRYCORE_API bool IsClosed () const
 
GEOMETRYCORE_API FAxisAlignedBox3d GetBounds (bool bParallel=false) const
 
GEOMETRYCORE_API FFrame3d GetVertexFrame (int VertexID, bool bFrameNormalY=false, FVector3d *UseNormal=nullptr) const
 
GEOMETRYCORE_API FVector3d GetTriNormal (int TriangleID) const
 
GEOMETRYCORE_API double GetTriArea (int TriangleID) const
 
GEOMETRYCORE_API void GetTriInfo (int TriangleID, FVector3d &Normal, double &Area, FVector3d &Centroid) const
 
GEOMETRYCORE_API FVector3d GetTriCentroid (int TriangleID) const
 
GEOMETRYCORE_API FVector3d GetTriBaryPoint (int TriangleID, double Bary0, double Bary1, double Bary2) const
 
GEOMETRYCORE_API FVector3d GetTriBaryNormal (int TriangleID, double Bary0, double Bary1, double Bary2) const
 
GEOMETRYCORE_API void GetTriBaryPoint (int TriangleID, double Bary0, double Bary1, double Bary2, FVertexInfo &VertInfo) const
 
GEOMETRYCORE_API FAxisAlignedBox3d GetTriBounds (int TriangleID) const
 
GEOMETRYCORE_API FFrame3d GetTriFrame (int TriangleID, int Edge=0) const
 
GEOMETRYCORE_API double GetTriSolidAngle (int TriangleID, const FVector3d &p) const
 
GEOMETRYCORE_API double GetTriInternalAngleR (int TriangleID, int i) const
 
GEOMETRYCORE_API FVector3d GetTriInternalAnglesR (int TriangleID) const
 
GEOMETRYCORE_API FVector3d GetEdgeNormal (int EdgeID) const
 
GEOMETRYCORE_API FVector3d GetEdgePoint (int EdgeID, double ParameterT) const
 
GEOMETRYCORE_API void GetVtxOneRingCentroid (int VertexID, FVector3d &CentroidOut) const
 
GEOMETRYCORE_API double CalculateWindingNumber (const FVector3d &QueryPoint) const
 
const TDynamicVector< FVector3d > & GetVerticesBuffer () const
 
const FRefCountVectorGetVerticesRefCounts () const
 
const TDynamicVector< FVector3f > * GetNormalsBuffer () const
 
const TDynamicVector< FVector3f > * GetColorsBuffer () const
 
const TDynamicVector< FVector2f > * GetUVBuffer () const
 
const TDynamicVector< FIndex3i > & GetTrianglesBuffer () const
 
const FRefCountVectorGetTrianglesRefCounts () const
 
const TDynamicVector< int > * GetTriangleGroupsBuffer () const
 
const TDynamicVector< FEdge > & GetEdgesBuffer () const
 
const FRefCountVectorGetEdgesRefCounts () const
 
const FSmallListSetGetVertexEdges () const
 
const TDynamicVector< FIndex3i > & GetTriangleEdges () const
 
GEOMETRYCORE_API void CompactInPlace (FCompactMaps *CompactInfo=nullptr)
 
GEOMETRYCORE_API int32 RemoveUnusedVertices ()
 
GEOMETRYCORE_API bool HasUnusedVertices () const
 
GEOMETRYCORE_API void ReverseOrientation (bool bFlipNormals=true)
 
GEOMETRYCORE_API EMeshResult ReverseTriOrientation (int TriangleID)
 
GEOMETRYCORE_API EMeshResult RemoveVertex (int VertexID, bool bPreserveManifold=false)
 
GEOMETRYCORE_API EMeshResult RemoveTriangle (int TriangleID, bool bRemoveIsolatedVertices=true, bool bPreserveManifold=false)
 
virtual GEOMETRYCORE_API EMeshResult SetTriangle (int TriangleID, const FIndex3i &NewVertices, bool bRemoveIsolatedVertices=true)
 
virtual GEOMETRYCORE_API EMeshResult SplitEdge (int EdgeAB, FEdgeSplitInfo &SplitInfo, double SplitParameterT=0.5)
 
GEOMETRYCORE_API EMeshResult SplitEdge (int EdgeVertA, int EdgeVertB, FEdgeSplitInfo &SplitInfo)
 
virtual GEOMETRYCORE_API EMeshResult FlipEdge (int EdgeAB, FEdgeFlipInfo &FlipInfo)
 
virtual GEOMETRYCORE_API EMeshResult FlipEdge (int EdgeVertA, int EdgeVertB, FEdgeFlipInfo &FlipInfo)
 
virtual GEOMETRYCORE_API EMeshResult SplitVertex (int VertexID, const TArrayView< const int > &TrianglesToUpdate, FVertexSplitInfo &SplitInfo)
 
virtual GEOMETRYCORE_API bool SplitVertexWouldLeaveIsolated (int VertexID, const TArrayView< const int > &TrianglesToUpdate)
 
virtual GEOMETRYCORE_API EMeshResult CanCollapseEdge (int vKeep, int vRemove, const FCollapseEdgeOptions &Options) const
 
virtual GEOMETRYCORE_API EMeshResult CanCollapseEdge (int vKeep, int vRemove, double EdgeParameterT=0) const
 
virtual GEOMETRYCORE_API EMeshResult CollapseEdge (int KeepVertID, int RemoveVertID, double EdgeParameterT, const FCollapseEdgeOptions &Options, FEdgeCollapseInfo &CollapseInfo)
 
virtual EMeshResult CollapseEdge (int KeepVertID, int RemoveVertID, const FCollapseEdgeOptions &Options, FEdgeCollapseInfo &CollapseInfo)
 
virtual GEOMETRYCORE_API EMeshResult CollapseEdge (int KeepVertID, int RemoveVertID, double EdgeParameterT, FEdgeCollapseInfo &CollapseInfo)
 
virtual EMeshResult CollapseEdge (int KeepVertID, int RemoveVertID, FEdgeCollapseInfo &CollapseInfo)
 
virtual GEOMETRYCORE_API EMeshResult MergeEdges (int KeepEdgeID, int DiscardEdgeID, double InterpolationT, FMergeEdgesInfo &MergeInfo, bool bCheckValidOrientation=true)
 
virtual GEOMETRYCORE_API EMeshResult MergeEdges (int KeepEdgeID, int DiscardEdgeID, FMergeEdgesInfo &MergeInfo, bool bCheckValidOrientation=true)
 
virtual GEOMETRYCORE_API EMeshResult MergeVertices (int KeepVid, int DiscardVid, double InterpolationT, const FMergeVerticesOptions &Options, FMergeVerticesInfo &MergeInfo)
 
virtual EMeshResult MergeVertices (int KeepVid, int DiscardVid, double InterpolationT, FMergeVerticesInfo &MergeInfo)
 
virtual EMeshResult MergeVertices (int KeepVid, int DiscardVid, FMergeVerticesInfo &MergeInfo)
 
virtual GEOMETRYCORE_API EMeshResult PokeTriangle (int TriangleID, const FVector3d &BaryCoordinates, FPokeTriangleInfo &PokeInfo)
 
virtual EMeshResult PokeTriangle (int TriangleID, FPokeTriangleInfo &PokeInfo)
 
virtual GEOMETRYCORE_API FString MeshInfoString () const
 
GEOMETRYCORE_API SIZE_T GetByteCount () const
 
virtual GEOMETRYCORE_API bool IsSameAs (const FDynamicMesh3 &OtherMesh, const FSameAsOptions &Options) const
 
virtual GEOMETRYCORE_API bool IsSameAs (const FDynamicMesh3 &OtherMesh, const FSameAsOptions &Options, FMeshDifferenceInfo &OutMeshDifferenceInfo) const
 
virtual GEOMETRYCORE_API bool CheckValidity (FValidityOptions ValidityOptions=FValidityOptions(), EValidityCheckFailMode FailMode=EValidityCheckFailMode::Check) const
 
template<typename ArrayType >
int GetAllVtxBoundaryEdges (int vID, ArrayType &EdgeListOut) const
 
template<typename ArrayType >
EMeshResult GetVtxTriangles (int vID, ArrayType &TrianglesOut) const
 
template<typename IntArray , typename BoolArray >
EMeshResult GetVtxContiguousTriangles (int VertexID, IntArray &TrianglesOut, IntArray &SpanLengths, BoolArray &IsLoop) const
 
template<typename ArrayType >
bool GetAllVertexGroups (int vID, ArrayType &GroupsOut) const
 

Static Public Attributes

static constexpr int InvalidID = IndexConstants::InvalidID
 
static constexpr int NonManifoldID = -2
 
static constexpr int DuplicateTriangleID = -3
 
GEOMETRYCORE_API static const FVector3d InvalidVertex = FVector3d(TNumericLimits<double>::Max(), 0.0, 0.0)
 
static constexpr FIndex3i InvalidTriangle {InvalidID, InvalidID, InvalidID}
 
static constexpr FIndex2i InvalidEdge {InvalidID, InvalidID}
 

Protected Member Functions

void SetTriangleInternal (int TriangleID, int v0, int v1, int v2)
 
void SetTriangleEdgesInternal (int TriangleID, int e0, int e1, int e2)
 
int AddEdgeInternal (int vA, int vB, int tA, int tB=InvalidID)
 
GEOMETRYCORE_API int AddTriangleInternal (int a, int b, int c, int e0, int e1, int e2)
 
int ReplaceTriangleVertex (int TriangleID, int vOld, int vNew)
 
void AllocateEdgesList (int VertexID)
 
template<typename ArrayType = FLocalIntArray>
void GetVertexEdgesList (int VertexID, ArrayType &EdgesOut) const
 
void SetEdgeVerticesInternal (int EdgeID, int a, int b)
 
void SetEdgeTrianglesInternal (int EdgeID, int t0, int t1)
 
GEOMETRYCORE_API int ReplaceEdgeVertex (int EdgeID, int vOld, int vNew)
 
GEOMETRYCORE_API int ReplaceEdgeTriangle (int EdgeID, int tOld, int tNew)
 
GEOMETRYCORE_API int ReplaceTriangleEdge (int EdgeID, int eOld, int eNew)
 
bool TriangleHasVertex (int TriangleID, int VertexID) const
 
bool TriHasNeighbourTri (int CheckTriID, int NbrTriID) const
 
bool TriHasSequentialVertices (int TriangleID, int vA, int vB) const
 
GEOMETRYCORE_API int FindTriangleEdge (int TriangleID, int vA, int vB) const
 returns edge ID
 
GEOMETRYCORE_API int32 FindEdgeInternal (int32 vA, int32 vB, bool &bIsBoundary) const
 
bool EdgeHasVertex (int EdgeID, int VertexID) const
 
bool EdgeHasTriangle (int EdgeID, int TriangleID) const
 
int GetOtherEdgeVertex (int EdgeID, int VertexID) const
 
int GetOtherEdgeTriangle (int EdgeID, int TriangleID) const
 
void AddTriangleEdge (int TriangleID, int v0, int v1, int j, int EdgeID)
 
FIndex2i GetOrderedOneRingEdgeTris (int VertexID, int EdgeID) const
 
GEOMETRYCORE_API void ReverseTriOrientationInternal (int TriangleID)
 
template<int Variant>
void SerializeInternal (FArchive &Ar, void *Ptr)
 
virtual GEOMETRYCORE_API EMeshResult CanCollapseEdgeInternal (int vKeep, int vRemove, double collapse_t, FEdgeCollapseInfo *OutCollapseInfo) const
 
template<>
void SerializeInternal (FArchive &, void *)
 
template<>
void SerializeInternal (FArchive &Ar, void *)
 

Protected Attributes

TDynamicVector< FVector3dVertices {}
 
FRefCountVector VertexRefCounts {}
 
TOptional< TDynamicVector< FVector3f > > VertexNormals {}
 
TOptional< TDynamicVector< FVector3f > > VertexColors {}
 
TOptional< TDynamicVector< FVector2f > > VertexUVs {}
 
FSmallListSet VertexEdgeLists
 
TDynamicVector< FIndex3iTriangles
 
FRefCountVector TriangleRefCounts
 
TDynamicVector< FIndex3iTriangleEdges
 
TOptional< TDynamicVector< int > > TriangleGroups {}
 
int GroupIDCounter = 0
 
TDynamicVector< FEdgeEdges
 
FRefCountVector EdgeRefCounts
 
TUniquePtr< FDynamicMeshAttributeSetAttributeSet {}
 
bool bEnableShapeChangeStamp = false
 
std::atomic< uint32ShapeChangeStamp = 0
 
std::atomic< uint32TopologyChangeStamp = 0
 

Friends

class FDynamicMeshAttributeSet
 
class FDynamicMeshBulkEdit
 
FArchiveoperator<< (FArchive &Ar, FDynamicMesh3 &Mesh)
 

Detailed Description

FDynamicMesh3 is a dynamic triangle mesh class. The mesh has has connectivity, is an indexed mesh, and allows for gaps in the index space.

internally, all data is stored in POD-type buffers, except for the vertex->edge links, which are stored as List<int>'s. The arrays of POD data are stored in TDynamicVector's, so they grow in chunks, which is relatively efficient. The actual blocks are arrays, so they can be efficiently mem-copied into larger buffers if necessary.

Reference counts for verts/tris/edges are stored as separate FRefCountVector instances.

Vertices are stored as doubles, although this should be easily changed if necessary, as the internal data structure is not exposed

Per-vertex Vertex Normals, Colors, and UVs are optional and stored as floats. Note that in practice, these are generally only used as scratch space, in limited circumstances, usually when needed for performance reasons. Most of our geometry code instead prefers to read attributes from the per-triangle AttributeSet accessed via Attributes() (see TDynamicMeshOverlay for a description of the structure). For instance, an empty (but existing) attribute set will take precedence over non-empty vertex normals in much of our processing code.

For each vertex, VertexEdgeLists[i] is the unordered list of connected edges. The elements of the list are indices into the edges list. This list is unsorted but can be traversed in-order (ie cw/ccw) at some additional cost.

Triangles are stored as 3 ints, with optionally a per-triangle integer group id. The group IDs stored here DO get widely used and preserved in our geometry code (unlike the per-vertex attributes described earlier), even though the AttributeSet can store group IDs as well (potentially in multiple layers).

The edges of a triangle are similarly stored as 3 ints, in triangle_edes. If the triangle is [v1,v2,v3], then the triangle edges [e1,e2,e3] are e1=edge(v1,v2), e2=edge(v2,v3), e3=edge(v3,v1), where the e# are indexes into edges.

Edges are stored as tuples of 4 ints. If the edge is between v1 and v2, with neighbour tris t1 and t2, then the edge is [min(v1,v2), max(v1,v2), t1, t2]. For a boundary edge, t2 is InvalidID. t1 is never InvalidID.

Most of the class assumes that the mesh is manifold. Many functions will work if the topology is non-manifold, but behavior of operators like Split/Flip/Collapse edge is untested.

The function CheckValidity() does extensive sanity checking on the mesh data structure. Use this to test your code, both for mesh construction and editing!!

Member Typedef Documentation

◆ edge_iterator

◆ FEdgeCollapseInfo

◆ FEdgeFlipInfo

◆ FEdgeSplitInfo

◆ FLocalBoolArray

◆ FLocalIntArray

◆ FMergeEdgesInfo

◆ FMergeVerticesInfo

◆ FPokeTriangleInfo

◆ FVertexSplitInfo

◆ triangle_iterator

◆ value_iteration

◆ vertex_iterator

◆ vtx_triangles_enumerable

Constructor & Destructor Documentation

◆ FDynamicMesh3() [1/6]

FDynamicMesh3::FDynamicMesh3 ( )

Default constructor

◆ FDynamicMesh3() [2/6]

FDynamicMesh3::FDynamicMesh3 ( const FDynamicMesh3 CopyMesh)

Copy/Move construction

◆ FDynamicMesh3() [3/6]

FDynamicMesh3::FDynamicMesh3 ( FDynamicMesh3 &&  MoveMesh)

◆ ~FDynamicMesh3()

FDynamicMesh3::~FDynamicMesh3 ( )
virtualdefault

Destructor

◆ FDynamicMesh3() [4/6]

FDynamicMesh3::FDynamicMesh3 ( bool  bWantNormals,
bool  bWantColors,
bool  bWantUVs,
bool  bWantTriGroups 
)
explicit

Construct an empty mesh with specified attributes

◆ FDynamicMesh3() [5/6]

FDynamicMesh3::FDynamicMesh3 ( EMeshComponents  flags)
explicit

◆ FDynamicMesh3() [6/6]

FDynamicMesh3::FDynamicMesh3 ( const FMeshShapeGenerator Generator)

Construction from Mesh Generator

Member Function Documentation

◆ AddEdgeInternal()

int UE::Geometry::FDynamicMesh3::AddEdgeInternal ( int  vA,
int  vB,
int  tA,
int  tB = InvalidID 
)
inlineprotected

◆ AddTriangleEdge()

void UE::Geometry::FDynamicMesh3::AddTriangleEdge ( int  TriangleID,
int  v0,
int  v1,
int  j,
int  EdgeID 
)
inlineprotected

◆ AddTriangleInternal()

int FDynamicMesh3::AddTriangleInternal ( int  a,
int  b,
int  c,
int  e0,
int  e1,
int  e2 
)
protected

◆ AllocateEdgesList()

void UE::Geometry::FDynamicMesh3::AllocateEdgesList ( int  VertexID)
inlineprotected

◆ AllocateTriangleGroup()

int UE::Geometry::FDynamicMesh3::AllocateTriangleGroup ( )
inline

◆ AppendTriangle() [1/2]

int FDynamicMesh3::AppendTriangle ( const FIndex3i TriVertices,
int  GroupID = 0 
)

TriVertices must be distinct and refer to existing, valid vertices

◆ AppendTriangle() [2/2]

int UE::Geometry::FDynamicMesh3::AppendTriangle ( int  Vertex0,
int  Vertex1,
int  Vertex2,
int  GroupID = 0 
)
inline

Vertex0, Vertex1, and Vertex2 must be distinct and refer to existing, valid vertices

◆ AppendVertex() [1/3]

int FDynamicMesh3::AppendVertex ( const FDynamicMesh3 SourceMesh,
int  SourceVertexID 
)

Copy vertex SourceVertexID from existing SourceMesh, returns new vertex id

◆ AppendVertex() [2/3]

int UE::Geometry::FDynamicMesh3::AppendVertex ( const FVector3d Position)
inline

Append vertex at position, returns vid

◆ AppendVertex() [3/3]

int FDynamicMesh3::AppendVertex ( const FVertexInfo VertInfo)

Append vertex at position and other fields, returns vid

◆ AppendWithOffsets()

void FDynamicMesh3::AppendWithOffsets ( const FDynamicMesh3 ToAppend,
FAppendInfo OutAppendInfo = nullptr 
)

Append the ToAppend mesh geometry to this mesh, preserving element IDs aside from a constant offset.

Attributes from the ToAppend mesh will only be included if they already exist on this mesh. If more attributes are needed, consider calling EnableMatchingAttributes.

Note that OutAppendInfo optionally provides some offsets for convenience, but callers may also compute the offset for any element type by storing the corresponding MaxID before calling AppendWithOffsets.

Parameters
ToAppendMesh to append
OutAppendInfoOptionally stores offsets and number of IDs appended for mesh elements.

◆ Attributes() [1/2]

FDynamicMeshAttributeSet * UE::Geometry::FDynamicMesh3::Attributes ( )
inline

◆ Attributes() [2/2]

const FDynamicMeshAttributeSet * UE::Geometry::FDynamicMesh3::Attributes ( ) const
inline

◆ BeginUnsafeTrianglesInsert()

virtual void UE::Geometry::FDynamicMesh3::BeginUnsafeTrianglesInsert ( )
inlinevirtual

Call this before a set of unsafe InsertTriangle() calls

◆ BeginUnsafeVerticesInsert()

virtual void UE::Geometry::FDynamicMesh3::BeginUnsafeVerticesInsert ( )
inlinevirtual

Call this before a set of unsafe InsertVertex() calls

◆ BoundaryEdgeIndicesItr()

FRefCountVector::FilteredEnumerable UE::Geometry::FDynamicMesh3::BoundaryEdgeIndicesItr ( ) const
inline
Returns
enumerable object for boundary edge indices suitable for use with range-based for, ie for ( int i : BoundaryEdgeIndicesItr() )

◆ CalculateWindingNumber()

double FDynamicMesh3::CalculateWindingNumber ( const FVector3d QueryPoint) const

Compute mesh winding number, from Jacobson et. al., Robust Inside-Outside Segmentation using Generalized Winding Numbers http://igl.ethz.ch/projects/winding-number/ returns ~0 for points outside a closed, consistently oriented mesh, and a positive or negative integer for points inside, with value > 1 depending on how many "times" the point inside the mesh (like in 2D polygon winding)

◆ CanCollapseEdge() [1/2]

EMeshResult FDynamicMesh3::CanCollapseEdge ( int  vKeep,
int  vRemove,
const FCollapseEdgeOptions Options 
) const
virtual

◆ CanCollapseEdge() [2/2]

EMeshResult FDynamicMesh3::CanCollapseEdge ( int  vKeep,
int  vRemove,
double  EdgeParameterT = 0 
) const
virtual

Tests whether collapsing the specified edge using the CollapseEdge function would succeed. Equivalent to calling the options overload with default options.

Parameters
KeepVertIDindex of the vertex that should be kept
RemoveVertIDindex of the vertex that should be removed
EdgeParameterTvKeep is moved to Lerp(KeepPos, RemovePos, EdgeParameterT). Note: Does not currently affect whether the edge is collapsable.
Returns
Ok if the edge can be collapsed, or enum value indicating why the operation cannot be applied

◆ CanCollapseEdgeInternal()

EMeshResult FDynamicMesh3::CanCollapseEdgeInternal ( int  vKeep,
int  vRemove,
double  collapse_t,
FEdgeCollapseInfo OutCollapseInfo 
) const
protectedvirtual

◆ CheckValidity()

bool FDynamicMesh3::CheckValidity ( FValidityOptions  ValidityOptions = FValidityOptions(),
EValidityCheckFailMode  FailMode = EValidityCheckFailMode::Check 
) const
virtual

Checks that the mesh is well-formed, ie all internal data structures are consistent

◆ Clear()

void FDynamicMesh3::Clear ( )

Discard all data

◆ CollapseEdge() [1/4]

virtual EMeshResult UE::Geometry::FDynamicMesh3::CollapseEdge ( int  KeepVertID,
int  RemoveVertID,
const FCollapseEdgeOptions Options,
FEdgeCollapseInfo CollapseInfo 
)
inlinevirtual

Collapse the edge between the two vertices, if topologically possible. Equivalent to using the other overload with 0 for EdgeParameterT.

◆ CollapseEdge() [2/4]

EMeshResult FDynamicMesh3::CollapseEdge ( int  KeepVertID,
int  RemoveVertID,
double  EdgeParameterT,
const FCollapseEdgeOptions Options,
FEdgeCollapseInfo CollapseInfo 
)
virtual

Collapse the edge between the two vertices, if topologically possible.

Parameters
KeepVertIDindex of the vertex that should be kept
RemoveVertIDindex of the vertex that should be removed
EdgeParameterTvKeep is moved to Lerp(KeepPos, RemovePos, EdgeParameterT)
OptionsSets options for the collapse
CollapseInforeturned information about new and modified mesh elements
Returns
Ok on success, or enum value indicates why operation cannot be applied. Mesh remains unmodified on error.

◆ CollapseEdge() [3/4]

EMeshResult FDynamicMesh3::CollapseEdge ( int  KeepVertID,
int  RemoveVertID,
double  EdgeParameterT,
FEdgeCollapseInfo CollapseInfo 
)
virtual

Collapse the edge between the two vertices, if topologically possible. Equivalent to calling the options overload with default options.

Parameters
KeepVertIDindex of the vertex that should be kept
RemoveVertIDindex of the vertex that should be removed
EdgeParameterTvKeep is moved to Lerp(KeepPos, RemovePos, EdgeParameterT)
CollapseInforeturned information about new and modified mesh elements
Returns
Ok on success, or enum value indicates why operation cannot be applied. Mesh remains unmodified on error.

◆ CollapseEdge() [4/4]

virtual EMeshResult UE::Geometry::FDynamicMesh3::CollapseEdge ( int  KeepVertID,
int  RemoveVertID,
FEdgeCollapseInfo CollapseInfo 
)
inlinevirtual

Collapse the edge between the two vertices, if topologically possible. Equivalent to calling the options overload with default options and using 0 for EdgeParameterT.

◆ CompactCopy()

void FDynamicMesh3::CompactCopy ( const FDynamicMesh3 CopyMesh,
bool  bNormals = true,
bool  bColors = true,
bool  bUVs = true,
bool  bAttributes = true,
FCompactMaps CompactInfo = nullptr 
)

Copy input mesh while compacting, i.e. removing unused vertices/triangles/edges. Note that it is currently unsafe to hold on to the attribute set pointer (returned from Attributes()) across the CompactCopy call, as the latter may rebuild an entirely new attribute set.

Parameters
CopyMeshMesh to copy
bNormalsif true, will copy normals
bColorsif true, will copy colors
bUVsif true, will copy UVs
bAttributesif true, will copy attributes
CompactInfoif not nullptr, will be filled with mapping indicating how vertex and triangle IDs were changed during compaction

◆ CompactInPlace()

void FDynamicMesh3::CompactInPlace ( FCompactMaps CompactInfo = nullptr)

Compact mesh in-place, by moving vertices around and rewriting indices. Should be faster if the amount of compacting is not too significant, and is useful in some places.

Parameters
CompactInfoif not nullptr, will be filled with mapping indicating how vertex and triangle IDs were changed during compaction

shift triangles

shift edges

◆ CompactMetric()

double UE::Geometry::FDynamicMesh3::CompactMetric ( ) const
inline

returns measure of compactness in range [0,1], where 1 is fully compacted

◆ Copy() [1/2]

void FDynamicMesh3::Copy ( const FDynamicMesh3 CopyMesh,
bool  bNormals = true,
bool  bColors = true,
bool  bUVs = true,
bool  bAttributes = true 
)

Set internal data structures to be a copy of input mesh using the specified attributes

◆ Copy() [2/2]

bool FDynamicMesh3::Copy ( const FMeshShapeGenerator Generator)

Initialize mesh from the output of a MeshShapeGenerator (assumes Generate() was already called)

Returns
false if any triangles defined in Generator were skipped due to invalid topology

◆ DiscardAttributes()

void FDynamicMesh3::DiscardAttributes ( )

◆ DiscardTriangleGroups()

void FDynamicMesh3::DiscardTriangleGroups ( )

◆ DiscardVertexColors()

void FDynamicMesh3::DiscardVertexColors ( )

◆ DiscardVertexNormals()

void FDynamicMesh3::DiscardVertexNormals ( )

◆ DiscardVertexUVs()

void FDynamicMesh3::DiscardVertexUVs ( )

◆ EdgeCount()

int UE::Geometry::FDynamicMesh3::EdgeCount ( ) const
inline
Returns
number of edges in the mesh

◆ EdgeHasTriangle()

bool UE::Geometry::FDynamicMesh3::EdgeHasTriangle ( int  EdgeID,
int  TriangleID 
) const
inlineprotected

◆ EdgeHasVertex()

bool UE::Geometry::FDynamicMesh3::EdgeHasVertex ( int  EdgeID,
int  VertexID 
) const
inlineprotected

◆ EdgeIndicesItr()

edge_iterator UE::Geometry::FDynamicMesh3::EdgeIndicesItr ( ) const
inline
Returns
enumerable object for valid edge indices suitable for use with range-based for, ie for ( int i : EdgeIndicesItr() )

◆ EdgesItr()

value_iteration< FEdge > UE::Geometry::FDynamicMesh3::EdgesItr ( ) const
inline

Enumerate edges. Each returned element is [v0,v1,t0,t1], where t1 will be InvalidID if this is a boundary edge

◆ EnableAttributes()

void FDynamicMesh3::EnableAttributes ( )

◆ EnableMatchingAttributes()

void FDynamicMesh3::EnableMatchingAttributes ( const FDynamicMesh3 ToMatch,
bool  bClearExisting = true,
bool  bDiscardExtraAttributes = false 
)

Ensure that all the same extended attributes available in ToMatch are also enabled. By default, clears existing attributes, so that there will be an exact match If bClearExisting is passed as false, existing attributes are not removed/cleared. If bDiscardExtraAttributes=true and bClearExisting=false, extra attributes not in ToMatch are discarded, but existing attributes are not cleared/reset

◆ EnableMeshComponents()

void FDynamicMesh3::EnableMeshComponents ( int  MeshComponentsFlags)

Enable requested set of mesh components (triangle groups and vertex normals/colors/UVs) and discard any that are not requested

Parameters
MeshComponentsFlagsA 'bitwise or' of requested EMeshComponents flags

◆ EnableTriangleGroups()

void FDynamicMesh3::EnableTriangleGroups ( int  InitialGroupID = 0)

◆ EnableVertexColors()

void FDynamicMesh3::EnableVertexColors ( const FVector3f InitialColor)

◆ EnableVertexNormals()

void FDynamicMesh3::EnableVertexNormals ( const FVector3f InitialNormal)

◆ EnableVertexUVs()

void FDynamicMesh3::EnableVertexUVs ( const FVector2f InitialUV)

◆ EndUnsafeTrianglesInsert()

virtual void UE::Geometry::FDynamicMesh3::EndUnsafeTrianglesInsert ( )
inlinevirtual

Call after a set of unsafe InsertTriangle() calls to rebuild free list

◆ EndUnsafeVerticesInsert()

virtual void UE::Geometry::FDynamicMesh3::EndUnsafeVerticesInsert ( )
inlinevirtual

Call after a set of unsafe InsertVertex() calls to rebuild free list

◆ EnumerateEdgeTriangles()

void FDynamicMesh3::EnumerateEdgeTriangles ( int32  EdgeID,
TFunctionRef< void(int32)>  ApplyFunc 
) const

Call ApplyFunc for each triangle connected to an Edge (1 or 2 triangles)

◆ EnumerateTriEdgeIDsFromEdgeID()

void UE::Geometry::FDynamicMesh3::EnumerateTriEdgeIDsFromEdgeID ( const int32  EdgeID,
const TFunctionRef< void(FMeshTriEdgeID TriEdgeID)> &  TriEdgeFunc 
) const
inline

Applies a given function to both TriEdgeIDs which a given EdgeID is associated with

◆ EnumerateTriEdgeIDsFromTriID()

void UE::Geometry::FDynamicMesh3::EnumerateTriEdgeIDsFromTriID ( const int  TriID,
const TFunctionRef< void(FMeshTriEdgeID TriEdgeID)> &  TriEdgeFunc 
) const
inline

Applies a given function to both TriEdgeIDs which each EdgeID in a given Triangle is associated with

◆ EnumerateVertexEdges()

void UE::Geometry::FDynamicMesh3::EnumerateVertexEdges ( int32  VertexID,
TFunctionRef< void(int32)>  EdgeFunc 
) const
inline

Call EdgeFunc for each one-ring edge of a vertex. Currently this is more efficient than VtxEdgesItr() due to overhead in the Values() enumerable

◆ EnumerateVertexTriangles()

void FDynamicMesh3::EnumerateVertexTriangles ( int32  VertexID,
TFunctionRef< void(int32)>  ApplyFunc 
) const

Call ApplyFunc for each one-ring triangle of a vertex. Currently this is significantly more efficient than VtxTrianglesItr() in many use cases.

◆ EnumerateVertexVertices()

void UE::Geometry::FDynamicMesh3::EnumerateVertexVertices ( int32  VertexID,
TFunctionRef< void(int32)>  VertexFunc 
) const
inline

Call VertexFunc for each one-ring vertex neighbour of a vertex. Currently this is more efficient than VtxVerticesItr() due to overhead in the Values() enumerable

◆ FindEdge()

int FDynamicMesh3::FindEdge ( int  VertexA,
int  VertexB 
) const

Find id of edge connecting A and B

◆ FindEdgeFromTri()

int FDynamicMesh3::FindEdgeFromTri ( int  VertexA,
int  VertexB,
int  TriangleID 
) const

Find edgeid for edge [a,b] from triangle that contains the edge. Faster than FindEdge() because it is constant-time.

◆ FindEdgeFromTriPair()

int FDynamicMesh3::FindEdgeFromTriPair ( int  TriangleA,
int  TriangleB 
) const

Find edgeid for edge connecting two triangles

◆ FindEdgeInternal()

int32 FDynamicMesh3::FindEdgeInternal ( int32  vA,
int32  vB,
bool bIsBoundary 
) const
protected

◆ FindTriangle()

int FDynamicMesh3::FindTriangle ( int  A,
int  B,
int  C 
) const

Find triangle made up of any permutation of vertices [a,b,c]

◆ FindTriangleEdge()

int FDynamicMesh3::FindTriangleEdge ( int  TriangleID,
int  vA,
int  vB 
) const
protected

returns edge ID

◆ FlipEdge() [1/2]

EMeshResult FDynamicMesh3::FlipEdge ( int  EdgeAB,
FEdgeFlipInfo FlipInfo 
)
virtual

Flip/Rotate an edge of the mesh. This does not change the number of edges, vertices, or triangles. Boundary edges of the mesh cannot be flipped.

On success, the edges of the new triangles are ordered such that the shared edge is on index 0. i.e., GetTriEdge(FlipInfo.Triangles[0], 0) == GetTriEdge(FlipInfo.Triangles[1], 0)

Parameters
EdgeABindex of edge to be flipped
FlipInforeturned information about new and modified mesh elements
Returns
Ok on success, or enum value indicates why operation cannot be applied. Mesh remains unmodified on error.

◆ FlipEdge() [2/2]

EMeshResult FDynamicMesh3::FlipEdge ( int  EdgeVertA,
int  EdgeVertB,
FEdgeFlipInfo FlipInfo 
)
virtual

calls FlipEdge() on the edge between two vertices, if it exists

Parameters
EdgeVertAindex of first vertex
EdgeVertBindex of second vertex
FlipInforeturned information about new and modified mesh elements
Returns
Ok on success, or enum value indicates why operation cannot be applied. Mesh remains unmodified on error.

◆ GetAllVertexGroups() [1/2]

template<typename ArrayType = FLocalIntArray>
GEOMETRYCORE_API bool UE::Geometry::FDynamicMesh3::GetAllVertexGroups ( int  VertexID,
ArrayType &  GroupsOut 
) const

Returns all group IDs at vertex. ArrayType must by TArray<int> or FLocalIntArray

◆ GetAllVertexGroups() [2/2]

template<typename ArrayType >
bool UE::Geometry::FDynamicMesh3::GetAllVertexGroups ( int  vID,
ArrayType &  GroupsOut 
) const

◆ GetAllVtxBoundaryEdges() [1/2]

template<typename ArrayType = FLocalIntArray>
GEOMETRYCORE_API int UE::Geometry::FDynamicMesh3::GetAllVtxBoundaryEdges ( int  VertexID,
ArrayType &  EdgeListOut 
) const

Find edge ids of boundary edges connected to vertex.

Parameters
vIDVertex ID
EdgeListOutboundary edge IDs are appended to this list
Returns
count of number of elements of e that were filled Note: ArrayType must by TArray<int> or FLocalIntArray

◆ GetAllVtxBoundaryEdges() [2/2]

template<typename ArrayType >
int UE::Geometry::FDynamicMesh3::GetAllVtxBoundaryEdges ( int  vID,
ArrayType &  EdgeListOut 
) const

◆ GetBounds()

FAxisAlignedBox3d FDynamicMesh3::GetBounds ( bool  bParallel = false) const

Returns bounding box of all mesh vertices (including unreferenced vertices)

Computes bounding box of all vertices.

◆ GetByteCount()

SIZE_T FDynamicMesh3::GetByteCount ( ) const

◆ GetChangeStamp()

uint64 UE::Geometry::FDynamicMesh3::GetChangeStamp ( ) const
inline

ChangeStamp is a combination of the Shape and Topology ChangeStamps. If neither flag is enabled, this value will never change.

◆ GetColorsBuffer()

const TDynamicVector< FVector3f > * UE::Geometry::FDynamicMesh3::GetColorsBuffer ( ) const
inline

◆ GetComponentsFlags()

int FDynamicMesh3::GetComponentsFlags ( ) const
Returns
bitwise-or of EMeshComponents flags specifying which extra data this mesh has

◆ GetEdge()

FEdge UE::Geometry::FDynamicMesh3::GetEdge ( int  EdgeID) const
inline

Get the vertices and triangles of an edge, returned as [v0,v1,t0,t1], where t1 may be InvalidID

◆ GetEdgeNormal()

FVector3d FDynamicMesh3::GetEdgeNormal ( int  EdgeID) const

Returns average normal of connected face normals

◆ GetEdgeOpposingV()

FIndex2i FDynamicMesh3::GetEdgeOpposingV ( int  EdgeID) const

If edge has vertices [a,b], and is connected two triangles [a,b,c] and [a,b,d], this returns [c,d], or [c,InvalidID] for a boundary edge

◆ GetEdgePoint()

FVector3d FDynamicMesh3::GetEdgePoint ( int  EdgeID,
double  ParameterT 
) const

Get point along edge, t clamped to range [0,1]

◆ GetEdgeRef()

const FEdge & UE::Geometry::FDynamicMesh3::GetEdgeRef ( int  EdgeID) const
inline

Get the vertices and triangles of an edge, returned as [v0,v1,t0,t1], where t1 may be InvalidID

◆ GetEdgesBuffer()

const TDynamicVector< FEdge > & UE::Geometry::FDynamicMesh3::GetEdgesBuffer ( ) const
inline

◆ GetEdgesRefCounts()

const FRefCountVector & UE::Geometry::FDynamicMesh3::GetEdgesRefCounts ( ) const
inline

◆ GetEdgeT()

FIndex2i UE::Geometry::FDynamicMesh3::GetEdgeT ( int  EdgeID) const
inline

Get the triangle pair for an edge. The second triangle may be InvalidID

◆ GetEdgeV() [1/2]

FIndex2i UE::Geometry::FDynamicMesh3::GetEdgeV ( int  EdgeID) const
inline

Get the vertex pair for an edge

◆ GetEdgeV() [2/2]

bool UE::Geometry::FDynamicMesh3::GetEdgeV ( int  EdgeID,
FVector3d a,
FVector3d b 
) const
inline

Get the vertex positions of an edge

◆ GetMaxVtxEdgeCount()

int FDynamicMesh3::GetMaxVtxEdgeCount ( ) const
Returns
the max valence of all vertices in the mesh

◆ GetNormalsBuffer()

const TDynamicVector< FVector3f > * UE::Geometry::FDynamicMesh3::GetNormalsBuffer ( ) const
inline

◆ GetOrderedOneRingEdgeTris()

FIndex2i UE::Geometry::FDynamicMesh3::GetOrderedOneRingEdgeTris ( int  VertexID,
int  EdgeID 
) const
inlineprotected

◆ GetOrientedBoundaryEdgeV()

FIndex2i FDynamicMesh3::GetOrientedBoundaryEdgeV ( int  EdgeID) const

Return edge vertex indices, but oriented based on attached triangle (rather than min-sorted)

◆ GetOtherEdgeTriangle()

int UE::Geometry::FDynamicMesh3::GetOtherEdgeTriangle ( int  EdgeID,
int  TriangleID 
) const
inlineprotected

◆ GetOtherEdgeVertex()

int UE::Geometry::FDynamicMesh3::GetOtherEdgeVertex ( int  EdgeID,
int  VertexID 
) const
inlineprotected

◆ GetShapeChangeStamp()

uint32 UE::Geometry::FDynamicMesh3::GetShapeChangeStamp ( ) const
inline

Returns the current ShapeChangeStamp. This is incremented any time a mesh vertex position is changed or the mesh topology is modified. Change stamps are disabled by default.

◆ GetSingleVertexTriangle()

int32 FDynamicMesh3::GetSingleVertexTriangle ( int32  VID) const
Returns
a single triangle connected to the given vertex, or INDEX_NONE if the vertex has no triangles

◆ GetTopologyChangeStamp()

uint32 UE::Geometry::FDynamicMesh3::GetTopologyChangeStamp ( ) const
inline

Returns the current TopologyChangeStamp. This is incremented when the mesh topology is modified. Change stamps are disabled by default.

◆ GetTriangle()

FIndex3i UE::Geometry::FDynamicMesh3::GetTriangle ( int  TriangleID) const
inline

Get triangle vertices

◆ GetTriangleEdges()

const TDynamicVector< FIndex3i > & UE::Geometry::FDynamicMesh3::GetTriangleEdges ( ) const
inline

◆ GetTriangleGroup()

int UE::Geometry::FDynamicMesh3::GetTriangleGroup ( int  tID) const
inline

◆ GetTriangleGroupsBuffer()

const TDynamicVector< int > * UE::Geometry::FDynamicMesh3::GetTriangleGroupsBuffer ( ) const
inline

◆ GetTriangleRef()

const FIndex3i & UE::Geometry::FDynamicMesh3::GetTriangleRef ( int  TriangleID) const
inline

Get triangle vertices

◆ GetTrianglesBuffer()

const TDynamicVector< FIndex3i > & UE::Geometry::FDynamicMesh3::GetTrianglesBuffer ( ) const
inline

◆ GetTrianglesRefCounts()

const FRefCountVector & UE::Geometry::FDynamicMesh3::GetTrianglesRefCounts ( ) const
inline

◆ GetTriArea()

double FDynamicMesh3::GetTriArea ( int  TriangleID) const

Calculate area triangle

◆ GetTriBaryNormal()

FVector3d FDynamicMesh3::GetTriBaryNormal ( int  TriangleID,
double  Bary0,
double  Bary1,
double  Bary2 
) const

Interpolate vertex normals of triangle using barycentric coordinates

◆ GetTriBaryPoint() [1/2]

FVector3d FDynamicMesh3::GetTriBaryPoint ( int  TriangleID,
double  Bary0,
double  Bary1,
double  Bary2 
) const

Interpolate vertex positions of triangle using barycentric coordinates

◆ GetTriBaryPoint() [2/2]

void FDynamicMesh3::GetTriBaryPoint ( int  TriangleID,
double  Bary0,
double  Bary1,
double  Bary2,
FVertexInfo VertInfo 
) const

Compute interpolated vertex attributes at point of triangle

◆ GetTriBounds()

FAxisAlignedBox3d FDynamicMesh3::GetTriBounds ( int  TriangleID) const

Construct bounding box of triangle as efficiently as possible

◆ GetTriCentroid()

FVector3d FDynamicMesh3::GetTriCentroid ( int  TriangleID) const

Compute centroid of triangle

◆ GetTriEdge()

int UE::Geometry::FDynamicMesh3::GetTriEdge ( int  TriangleID,
int  j 
) const
inline

Get one of the edges of a triangle

◆ GetTriEdgeIDFromEdgeID()

FMeshTriEdgeID UE::Geometry::FDynamicMesh3::GetTriEdgeIDFromEdgeID ( int  EdgeID) const
inline

Return (triangle, edge_index) representation for given Edge ID

◆ GetTriEdges()

FIndex3i UE::Geometry::FDynamicMesh3::GetTriEdges ( int  TriangleID) const
inline

Get triangle edges

◆ GetTriEdgesRef()

const FIndex3i & UE::Geometry::FDynamicMesh3::GetTriEdgesRef ( int  TriangleID) const
inline

Get triangle edges

◆ GetTriFrame()

FFrame3d FDynamicMesh3::GetTriFrame ( int  TriangleID,
int  Edge = 0 
) const

Construct stable frame at triangle centroid, where frame.Z is face normal, and frame.X is aligned with edge nEdge of triangle.

◆ GetTriInfo()

void FDynamicMesh3::GetTriInfo ( int  TriangleID,
FVector3d Normal,
double Area,
FVector3d Centroid 
) const

Compute triangle normal, area, and centroid all at once. Re-uses vertex lookups and computes normal & area simultaneously. However does not produce the same normal/area as separate calls, because of this.

◆ GetTriInternalAngleR()

double FDynamicMesh3::GetTriInternalAngleR ( int  TriangleID,
int  i 
) const

Compute internal angle at vertex i of triangle (where i is 0,1,2);

◆ GetTriInternalAnglesR()

FVector3d FDynamicMesh3::GetTriInternalAnglesR ( int  TriangleID) const

Compute internal angles at all vertices of triangle

◆ GetTriNeighbourTris()

FIndex3i FDynamicMesh3::GetTriNeighbourTris ( int  TriangleID) const

Find the neighbour triangles of a triangle (any of them might be InvalidID)

◆ GetTriNormal()

FVector3d FDynamicMesh3::GetTriNormal ( int  TriangleID) const

Calculate face normal of triangle

◆ GetTriSolidAngle()

double FDynamicMesh3::GetTriSolidAngle ( int  TriangleID,
const FVector3d p 
) const

Compute solid angle of oriented triangle tID relative to point p - see WindingNumber()

◆ GetTriVertex()

FVector3d UE::Geometry::FDynamicMesh3::GetTriVertex ( int  TriangleID,
int  j 
) const
inline

Get the position of one of the vertices of a triangle

◆ GetTriVertices()

template<typename VecType >
void UE::Geometry::FDynamicMesh3::GetTriVertices ( int  TriangleID,
VecType &  v0,
VecType &  v1,
VecType &  v2 
) const
inline

Get the three vertex positions of a triangle

◆ GetUVBuffer()

const TDynamicVector< FVector2f > * UE::Geometry::FDynamicMesh3::GetUVBuffer ( ) const
inline

◆ GetVertex() [1/2]

FVector3d UE::Geometry::FDynamicMesh3::GetVertex ( int  VertexID) const
inline
Returns
the vertex position

◆ GetVertex() [2/2]

bool FDynamicMesh3::GetVertex ( int  VertexID,
FVertexInfo VertInfo,
bool  bWantNormals,
bool  bWantColors,
bool  bWantUVs 
) const

Get extended vertex information

◆ GetVertexColor()

FVector3f UE::Geometry::FDynamicMesh3::GetVertexColor ( int  vID) const
inline

◆ GetVertexEdges()

const FSmallListSet & UE::Geometry::FDynamicMesh3::GetVertexEdges ( ) const
inline

◆ GetVertexEdgesList()

template<typename ArrayType = FLocalIntArray>
void UE::Geometry::FDynamicMesh3::GetVertexEdgesList ( int  VertexID,
ArrayType &  EdgesOut 
) const
inlineprotected

◆ GetVertexFrame()

FFrame3d FDynamicMesh3::GetVertexFrame ( int  VertexID,
bool  bFrameNormalY = false,
FVector3d UseNormal = nullptr 
) const

Compute a normal/tangent frame at vertex that is "stable" as long as the mesh topology doesn't change, meaning that one axis of the frame will be computed from projection of outgoing edge. By default, frame.Z is normal, and .X points along mesh edge. Requires that VertexNormals are available, or UseNormal != nullptr, otherwise returns default Frame3d

Parameters
bFrameNormalYif true, then frame.Y is normal (X still points along mesh edge)
UseNormalif defined, this normal is used instead of VertexNormals normal

◆ GetVertexGroups()

bool FDynamicMesh3::GetVertexGroups ( int  VertexID,
FIndex4i GroupsOut 
) const

Returns up to 4 group IDs at vertex. Returns false if > 4 encountered

◆ GetVertexInfo()

FVertexInfo FDynamicMesh3::GetVertexInfo ( int  VertexID) const

Get all vertex information available

◆ GetVertexNormal()

FVector3f UE::Geometry::FDynamicMesh3::GetVertexNormal ( int  vID) const
inline

◆ GetVertexRef()

const FVector3d & UE::Geometry::FDynamicMesh3::GetVertexRef ( int  VertexID) const
inline
Returns
the vertex position

◆ GetVertexUV()

FVector2f UE::Geometry::FDynamicMesh3::GetVertexUV ( int  vID) const
inline

◆ GetVerticesBuffer()

const TDynamicVector< FVector3d > & UE::Geometry::FDynamicMesh3::GetVerticesBuffer ( ) const
inline

◆ GetVerticesRefCounts()

const FRefCountVector & UE::Geometry::FDynamicMesh3::GetVerticesRefCounts ( ) const
inline

◆ GetVtxBoundaryEdges()

int FDynamicMesh3::GetVtxBoundaryEdges ( int  VertexID,
int &  Edge0Out,
int &  Edge1Out 
) const

Returns count of boundary edges at vertex, and the first two boundary edges if found. If return is > 2, call GetAllVtxBoundaryEdges

◆ GetVtxContiguousTriangles() [1/2]

template<typename IntArray , typename BoolArray >
EMeshResult UE::Geometry::FDynamicMesh3::GetVtxContiguousTriangles ( int  VertexID,
IntArray TrianglesOut,
IntArray SpanLengths,
BoolArray &  IsLoop 
) const

◆ GetVtxContiguousTriangles() [2/2]

template<typename IntArrayType = FLocalIntArray, typename BoolArrayType = FLocalBoolArray>
GEOMETRYCORE_API EMeshResult UE::Geometry::FDynamicMesh3::GetVtxContiguousTriangles ( int  VertexID,
IntArrayType TrianglesOut,
IntArrayType ContiguousGroupLengths,
BoolArrayType GroupIsLoop 
) const

Get triangles connected to vertex in contiguous order, with multiple groups if vertex is a bowtie.

Parameters
VertexIDVertex ID to search around
TrianglesOutAll triangles connected to the vertex, in contiguous order; if there are multiple contiguous groups they are packed one after another
ContiguousGroupLengthsLengths of contiguous groups packed into TrianglesOut (if not a bowtie, this will just be a length-one array w/ {TrianglesOut.Num()})
GroupIsLoopIndicates whether each contiguous group is a loop (first triangle connected to last) or not Note: ArrayTypes must by TArray<int>/<bool> or FLocalIntArray/FLocalBoolArry

◆ GetVtxEdgeCount()

int UE::Geometry::FDynamicMesh3::GetVtxEdgeCount ( int  VertexID) const
inline
Returns
the valence of a vertex (the number of connected edges)

◆ GetVtxNbrhood()

void FDynamicMesh3::GetVtxNbrhood ( int  EdgeID,
int  VertexID,
int &  OtherVertOut,
int &  OppVert1Out,
int &  OppVert2Out,
int &  Tri1Out,
int &  Tri2Out 
) const

Given an edge and vertex on that edge, returns other vertex of edge, the two opposing verts, and the two connected triangles (OppVert2Out and Tri2Out are be InvalidID for boundary edge)

◆ GetVtxOneRingCentroid()

void FDynamicMesh3::GetVtxOneRingCentroid ( int  VertexID,
FVector3d CentroidOut 
) const

Fastest possible one-ring centroid. This is used inside many other algorithms so it helps to have it be maximally efficient

◆ GetVtxSingleTriangle()

int FDynamicMesh3::GetVtxSingleTriangle ( int  VertexID) const
Returns
Triangle ID for a single triangle connected to VertexID, or InvalidID if VertexID does not exist or has no attached triangles

◆ GetVtxTriangleCount()

int FDynamicMesh3::GetVtxTriangleCount ( int  VertexID) const

return # of triangles attached to vID, or -1 if invalid vertex

◆ GetVtxTriangles() [1/2]

template<typename ArrayType = FLocalIntArray>
GEOMETRYCORE_API EMeshResult UE::Geometry::FDynamicMesh3::GetVtxTriangles ( int  VertexID,
ArrayType &  TrianglesOut 
) const

Get triangle one-ring at vertex. Note: ArrayType must by TArray<int> or FLocalIntArray

◆ GetVtxTriangles() [2/2]

template<typename ArrayType >
EMeshResult UE::Geometry::FDynamicMesh3::GetVtxTriangles ( int  vID,
ArrayType &  TrianglesOut 
) const

◆ HasAttributes()

bool UE::Geometry::FDynamicMesh3::HasAttributes ( ) const
inline
Returns
true if this mesh has attribute layers

◆ HasShapeChangeStampEnabled()

bool UE::Geometry::FDynamicMesh3::HasShapeChangeStampEnabled ( ) const
inline
Returns
true if shape ChangeStamp is enabled (disabled by default)

◆ HasTopologyChangeStampEnabled()

bool UE::Geometry::FDynamicMesh3::HasTopologyChangeStampEnabled ( ) const
inline
Returns
true if topology ChangeStamp is enabled (disabled by default)

◆ HasTriangleGroups()

bool UE::Geometry::FDynamicMesh3::HasTriangleGroups ( ) const
inline
Returns
true if this mesh has per-triangle groups

◆ HasUnusedVertices()

bool FDynamicMesh3::HasUnusedVertices ( ) const
Returns
true if any vertices are unused (not in any triangles)

◆ HasVertexColors()

bool UE::Geometry::FDynamicMesh3::HasVertexColors ( ) const
inline
Returns
true if this mesh has per-vertex colors

◆ HasVertexNormals()

bool UE::Geometry::FDynamicMesh3::HasVertexNormals ( ) const
inline
Returns
true if this mesh has per-vertex normals

◆ HasVertexUVs()

bool UE::Geometry::FDynamicMesh3::HasVertexUVs ( ) const
inline
Returns
true if this mesh has per-vertex UVs

◆ InsertTriangle()

EMeshResult FDynamicMesh3::InsertTriangle ( int  TriangleID,
const FIndex3i TriVertices,
int  GroupID = 0,
bool  bUnsafe = false 
)

Insert triangle at given index, assuming it is unused. If bUnsafe, we use fast id allocation that does not update free list. You should only be using this between BeginUnsafeTrianglesInsert() / EndUnsafeTrianglesInsert() calls

◆ InsertVertex()

EMeshResult FDynamicMesh3::InsertVertex ( int  VertexID,
const FVertexInfo VertInfo,
bool  bUnsafe = false 
)

Insert vertex at given index, assuming it is unused. If bUnsafe, we use fast id allocation that does not update free list. You should only be using this between BeginUnsafeVerticesInsert() / EndUnsafeVerticesInsert() calls

◆ IsBoundaryEdge()

bool UE::Geometry::FDynamicMesh3::IsBoundaryEdge ( int  EdgeID) const
inline

Returns true if edge is on the mesh boundary, ie only connected to one triangle

◆ IsBoundaryTriangle()

bool FDynamicMesh3::IsBoundaryTriangle ( int  TriangleID) const

Returns true if any edge of triangle is a boundary edge

◆ IsBoundaryVertex()

bool FDynamicMesh3::IsBoundaryVertex ( int  VertexID) const

Returns true if the vertex is part of any boundary edges

◆ IsBowtieVertex()

bool FDynamicMesh3::IsBowtieVertex ( int  vID) const

returns true if vID is a "bowtie" vertex, ie multiple disjoint triangle sets in one-ring

◆ IsClosed()

bool FDynamicMesh3::IsClosed ( ) const
Returns
true if mesh has no boundary edges

◆ IsCompact()

bool UE::Geometry::FDynamicMesh3::IsCompact ( ) const
inline

returns true if vertices, edges, and triangles are all dense (Count == MaxID)

◆ IsCompactT()

bool UE::Geometry::FDynamicMesh3::IsCompactT ( ) const
inline
Returns
true if triangle count == max triangle id

◆ IsCompactV()

bool UE::Geometry::FDynamicMesh3::IsCompactV ( ) const
inline
Returns
true if vertex count == max vertex id

◆ IsEdge()

bool UE::Geometry::FDynamicMesh3::IsEdge ( int  EdgeID) const
inline
Returns
true if EdgeID is a valid edge in this mesh

◆ IsGroupBoundaryEdge()

bool FDynamicMesh3::IsGroupBoundaryEdge ( int  EdgeID) const

Returns true if the two triangles connected to edge have different group IDs

◆ IsGroupBoundaryVertex()

bool FDynamicMesh3::IsGroupBoundaryVertex ( int  VertexID) const

Returns true if vertex has more than one tri group in its tri nbrhood

◆ IsGroupJunctionVertex()

bool FDynamicMesh3::IsGroupJunctionVertex ( int  VertexID) const

Returns true if more than two group boundary edges meet at vertex (ie 3+ groups meet at this vertex)

◆ IsReferencedVertex()

bool UE::Geometry::FDynamicMesh3::IsReferencedVertex ( int  VertexID) const
inline
Returns
true if VertexID is a valid vertex in this mesh AND is used by at least one triangle

◆ IsSameAs() [1/2]

bool FDynamicMesh3::IsSameAs ( const FDynamicMesh3 OtherMesh,
const FSameAsOptions Options 
) const
virtual

Check if another mesh is the same as this mesh. By default only checks vertices and triangles, turn on other parameters w/ flags

◆ IsSameAs() [2/2]

bool FDynamicMesh3::IsSameAs ( const FDynamicMesh3 OtherMesh,
const FSameAsOptions Options,
FMeshDifferenceInfo OutMeshDifferenceInfo 
) const
virtual

Check if another mesh is the same as this mesh. By default only checks vertices and triangles, turn on other parameters w/ flags

Parameters
OutMeshDifferenceInfoIf the meshes are not the same, this struct may provide additional info as to the source of difference. Note it will only indicate the first difference found, not a complete report of differences.

◆ IsTriangle()

bool UE::Geometry::FDynamicMesh3::IsTriangle ( int  TriangleID) const
inline
Returns
true if TriangleID is a valid triangle in this mesh

◆ IsVertex()

bool UE::Geometry::FDynamicMesh3::IsVertex ( int  VertexID) const
inline
Returns
true if VertexID is a valid vertex in this mesh

◆ MaxEdgeID()

int UE::Geometry::FDynamicMesh3::MaxEdgeID ( ) const
inline
Returns
upper bound on edge IDs used in the mesh, i.e. all edge IDs in use are < MaxEdgeID

◆ MaxGroupID()

int UE::Geometry::FDynamicMesh3::MaxGroupID ( ) const
inline
Returns
upper bound on group IDs used in the mesh, i.e. all group IDs in use are < MaxGroupID

◆ MaxTriangleID()

int UE::Geometry::FDynamicMesh3::MaxTriangleID ( ) const
inline
Returns
upper bound on triangle IDs used in the mesh, i.e. all triangle IDs in use are < MaxTriangleID

◆ MaxVertexID()

int UE::Geometry::FDynamicMesh3::MaxVertexID ( ) const
inline
Returns
upper bound on vertex IDs used in the mesh, i.e. all vertex IDs in use are < MaxVertexID

◆ MergeEdges() [1/2]

EMeshResult UE::Geometry::FDynamicMesh3::MergeEdges ( int  KeepEdgeID,
int  DiscardEdgeID,
double  InterpolationT,
FMergeEdgesInfo MergeInfo,
bool  bCheckValidOrientation = true 
)
virtual

Given two edges of the mesh, weld both their vertices, so that one edge is removed. This could result in one neighbour edge-pair attached to each vertex also collapsing, so those cases are detected and handled (eg middle edge-pair in abysmal ascii drawing below)

._._._. (dots are vertices) ._./

Parameters
KeepEdgeIDindex of the edge that should be kept
DiscardEdgeIDindex of the edge that should be removed
InterpolationTeach kept vertex is moved to Lerp(KeptPos, RemovePos, InterpolationT)
MergeInforeturned information about new and modified mesh elements
CheckValidOrientationperform edge consistency orientation checks before merging. Specifically, check that each discarded vertex is closer to the vertex it is being collapsed to than the other kept vertex (where the pairing is determined by the adjoining triangle winding).
Returns
Ok on success, or enum value indicates why operation cannot be applied. Mesh remains unmodified on error.

◆ MergeEdges() [2/2]

EMeshResult FDynamicMesh3::MergeEdges ( int  KeepEdgeID,
int  DiscardEdgeID,
FMergeEdgesInfo MergeInfo,
bool  bCheckValidOrientation = true 
)
virtual

Weld one edge to the other. Equivalent to calling the other overload with 0 for InterpolationT (i.e. the vertices stay at unmodified kept vertex positions).

◆ MergeVertices() [1/3]

EMeshResult UE::Geometry::FDynamicMesh3::MergeVertices ( int  KeepVid,
int  DiscardVid,
double  InterpolationT,
const FMergeVerticesOptions Options,
FMergeVerticesInfo MergeInfo 
)
virtual

Weld DiscardVid to KeepVid, if topologically possible and options allow. If the vertices are connected by an existing edge, this resolves as a collapse of that edge, and therefore calls OnCollapseEdge in overlays. If not, but the two vertices share a vertex neighbor, this resolves as a weld of the intervening edges (failing if the edges are not boundary edges, since that would create non-manifold edge), and therefore calls OnMergeEdges in the overlays. Otherwise, the merge resolves as bowtie creation, and calls OnMergeVertices in the overlays.

Parameters
KeepVidvertex ID of the kept vertex
DiscardVidvertex ID of the vertex whose triangles are reattached to the kept vertex
InterpolationTthe kept vertex is moved to Lerp(KeptPos, RemovePos, InterpolationT)
Optionsset the options for the merge
MergeInforeturned information about new and modified mesh elements
Returns
Ok on success, or enum value indicates why operation cannot be applied. Mesh remains unmodified on error.

◆ MergeVertices() [2/3]

virtual EMeshResult UE::Geometry::FDynamicMesh3::MergeVertices ( int  KeepVid,
int  DiscardVid,
double  InterpolationT,
FMergeVerticesInfo MergeInfo 
)
inlinevirtual

Weld DiscardVid to KeepVid. Equivalent to calling the options overload with default options.

◆ MergeVertices() [3/3]

virtual EMeshResult UE::Geometry::FDynamicMesh3::MergeVertices ( int  KeepVid,
int  DiscardVid,
FMergeVerticesInfo MergeInfo 
)
inlinevirtual

Weld DiscardVid to KeepVid. Equivalent to calling the options overload with default options and 0 for InterpolationT.

◆ MeshInfoString()

FString FDynamicMesh3::MeshInfoString ( ) const
virtual

Returns a debug string that contains mesh statistics and other information

◆ operator=() [1/2]

const FDynamicMesh3 & FDynamicMesh3::operator= ( const FDynamicMesh3 CopyMesh)

Copy and move assignment

◆ operator=() [2/2]

const FDynamicMesh3 & FDynamicMesh3::operator= ( FDynamicMesh3 &&  MoveMesh)

◆ PokeTriangle() [1/2]

EMeshResult FDynamicMesh3::PokeTriangle ( int  TriangleID,
const FVector3d BaryCoordinates,
FPokeTriangleInfo PokeInfo 
)
virtual

Insert a new vertex inside a triangle, ie do a 1 to 3 triangle split

Parameters
TriangleIDindex of triangle to poke
BaryCoordinatesbarycentric coordinates of poke position
PokeInforeturned information about new and modified mesh elements
Returns
Ok on success, or enum value indicates why operation cannot be applied. Mesh remains unmodified on error.

◆ PokeTriangle() [2/2]

virtual EMeshResult UE::Geometry::FDynamicMesh3::PokeTriangle ( int  TriangleID,
FPokeTriangleInfo PokeInfo 
)
inlinevirtual

Call PokeTriangle at the centroid of the triangle

◆ RemoveTriangle()

EMeshResult FDynamicMesh3::RemoveTriangle ( int  TriangleID,
bool  bRemoveIsolatedVertices = true,
bool  bPreserveManifold = false 
)

Remove a triangle from the mesh. Also removes any unreferenced edges after tri is removed. If bRemoveIsolatedVertices is true, then if you remove all tris from a vert, that vert is also removed. If bPreserveManifold, we check that you will not create a bow tie vertex (and return false). If this check is not done, you have to make sure you don't create a bow tie, because other code assumes we don't have bow ties, and will not handle it properly

◆ RemoveUnusedVertices()

int32 FDynamicMesh3::RemoveUnusedVertices ( )

Remove unused vertices. Note: Does not compact the remaining vertices.

Returns
number of removed vertices

◆ RemoveVertex()

EMeshResult FDynamicMesh3::RemoveVertex ( int  VertexID,
bool  bPreserveManifold = false 
)

Remove vertex VertexID and all connected triangles. Returns Failed_VertexStillReferenced if VertexID is still referenced by any triangles. If bPreserveManifold is true, checks that we will not create a bowtie vertex first. In this case, returns Failed_WouldCreateBowtie if removing the triangles would create a bowtie.

◆ ReplaceEdgeTriangle()

int FDynamicMesh3::ReplaceEdgeTriangle ( int  EdgeID,
int  tOld,
int  tNew 
)
protected

◆ ReplaceEdgeVertex()

int FDynamicMesh3::ReplaceEdgeVertex ( int  EdgeID,
int  vOld,
int  vNew 
)
protected

◆ ReplaceTriangleEdge()

int FDynamicMesh3::ReplaceTriangleEdge ( int  EdgeID,
int  eOld,
int  eNew 
)
protected

◆ ReplaceTriangleVertex()

int UE::Geometry::FDynamicMesh3::ReplaceTriangleVertex ( int  TriangleID,
int  vOld,
int  vNew 
)
inlineprotected

◆ ReverseOrientation()

void FDynamicMesh3::ReverseOrientation ( bool  bFlipNormals = true)

Reverse the ccw/cw orientation of all triangles in the mesh, and optionally flip the vertex normals if they exist

◆ ReverseTriOrientation()

EMeshResult FDynamicMesh3::ReverseTriOrientation ( int  TriangleID)

Reverse the ccw/cw orientation of a triangle

◆ ReverseTriOrientationInternal()

void FDynamicMesh3::ReverseTriOrientationInternal ( int  TriangleID)
protected

◆ Serialize()

void FDynamicMesh3::Serialize ( FArchive Ar)

Serialize the mesh to an archive.

◆ SerializeInternal() [1/3]

template<>
void UE::Geometry::FDynamicMesh3::SerializeInternal ( FArchive ,
void  
)
protected

◆ SerializeInternal() [2/3]

template<>
void UE::Geometry::FDynamicMesh3::SerializeInternal ( FArchive Ar,
void  
)
protected

◆ SerializeInternal() [3/3]

template<int Variant>
void UE::Geometry::FDynamicMesh3::SerializeInternal ( FArchive Ar,
void Ptr 
)
protected

Internal implementations for serialization to allow for better code separation between different versions and other implementation details.

Template Parameters
VariantIdentifier for a specific implementation, e.g. depending on the version and/or specific options.
Parameters
PtrPointer to optional data, e.g. version specific options.

◆ SetEdgeTrianglesInternal()

void UE::Geometry::FDynamicMesh3::SetEdgeTrianglesInternal ( int  EdgeID,
int  t0,
int  t1 
)
inlineprotected

◆ SetEdgeVerticesInternal()

void UE::Geometry::FDynamicMesh3::SetEdgeVerticesInternal ( int  EdgeID,
int  a,
int  b 
)
inlineprotected

◆ SetShapeChangeStampEnabled()

void UE::Geometry::FDynamicMesh3::SetShapeChangeStampEnabled ( bool  bEnabled)
inline

Enable/Disable incrementing of the ShapeChangeStamp.

NOTE: Both change stamps are unreliable in many contexts, and may someday get removed. Specifically, they get reset on Clear(), copied to the destination rather than incremented in copies and moves, and do not track any changes via access to the buffers directly (through GetVerticesBuffer(), etc).

◆ SetTopologyChangeStampEnabled()

void UE::Geometry::FDynamicMesh3::SetTopologyChangeStampEnabled ( bool  bEnabled)
inline

Enable/disable incrementing of the TopologyChangeStamp.

◆ SetTriangle()

EMeshResult FDynamicMesh3::SetTriangle ( int  TriangleID,
const FIndex3i NewVertices,
bool  bRemoveIsolatedVertices = true 
)
virtual

Rewrite the triangle to reference the new tuple of vertices.

◆ SetTriangleEdgesInternal()

void UE::Geometry::FDynamicMesh3::SetTriangleEdgesInternal ( int  TriangleID,
int  e0,
int  e1,
int  e2 
)
inlineprotected

◆ SetTriangleGroup()

void UE::Geometry::FDynamicMesh3::SetTriangleGroup ( int  tid,
int  group_id 
)
inline

◆ SetTriangleInternal()

void UE::Geometry::FDynamicMesh3::SetTriangleInternal ( int  TriangleID,
int  v0,
int  v1,
int  v2 
)
inlineprotected

◆ SetVertex()

void UE::Geometry::FDynamicMesh3::SetVertex ( int  VertexID,
const FVector3d vNewPos,
bool  bTrackChange = true 
)
inline

Set vertex position

Parameters
bTrackChangeif true, ShapeChangeStamp will be incremented (if enabled)

◆ SetVertexColor()

void UE::Geometry::FDynamicMesh3::SetVertexColor ( int  vID,
const FVector3f vNewColor 
)
inline

◆ SetVertexNormal()

void UE::Geometry::FDynamicMesh3::SetVertexNormal ( int  vID,
const FVector3f vNewNormal 
)
inline

◆ SetVertexUV()

void UE::Geometry::FDynamicMesh3::SetVertexUV ( int  vID,
const FVector2f vNewUV 
)
inline

◆ SplitEdge() [1/2]

EMeshResult FDynamicMesh3::SplitEdge ( int  EdgeAB,
FEdgeSplitInfo SplitInfo,
double  SplitParameterT = 0.5 
)
virtual

Split an edge of the mesh by inserting a vertex. This creates a new triangle on either side of the edge (ie a 2-4 split). If the original edge had vertices [a,b], with triangles t0=[a,b,c] and t1=[b,a,d], then the split inserts new vertex f. After the split t0=[a,f,c] and t1=[f,a,d], and we have t2=[f,b,c] and t3=[f,d,b] (it's best to draw it out on paper...)

Parameters
EdgeABindex of the edge to be split
SplitInforeturned information about new and modified mesh elements
SplitParameterTdefines the position along the edge that we split at, must be between 0 and 1, and is assumed to be based on the order of vertices returned by GetEdgeV()
Returns
Ok on success, or enum value indicates why operation cannot be applied. Mesh remains unmodified on error.

◆ SplitEdge() [2/2]

EMeshResult FDynamicMesh3::SplitEdge ( int  EdgeVertA,
int  EdgeVertB,
FEdgeSplitInfo SplitInfo 
)

Splits the edge between two vertices at the midpoint, if this edge exists

Parameters
EdgeVertAindex of first vertex
EdgeVertBindex of second vertex
SplitInforeturned information about new and modified mesh elements
Returns
Ok on success, or enum value indicates why operation cannot be applied. Mesh remains unmodified on error.

◆ SplitVertex()

EMeshResult FDynamicMesh3::SplitVertex ( int  VertexID,
const TArrayView< const int > &  TrianglesToUpdate,
FVertexSplitInfo SplitInfo 
)
virtual

Clones the given vertex and updates any provided triangles to use the new vertex if/where they used the old one.

Parameters
VertexIDthe vertex to split
TrianglesToUpdatetriangles that should be updated to use the new vertex anywhere they previously had the old one
SplitInforeturned info about the new and modified mesh elements
Returns
Ok on success, or enum value indicates why operation cannot be applied. Mesh remains unmodified on error.

◆ SplitVertexWouldLeaveIsolated()

bool FDynamicMesh3::SplitVertexWouldLeaveIsolated ( int  VertexID,
const TArrayView< const int > &  TrianglesToUpdate 
)
virtual

Tests whether splitting the given vertex with the given triangles would leave no triangles attached to the original vertex (creating an isolated vertex)

Parameters
VertexIDthe vertex to split
TrianglesToUpdatetriangles that should be updated to use the new vertex anywhere they previously had the old one
Returns
true if calling SplitVertex with these arguments would leave an isolated vertex at the original VertexID

◆ TriangleCount()

int UE::Geometry::FDynamicMesh3::TriangleCount ( ) const
inline
Returns
number of triangles in the mesh

◆ TriangleHasVertex()

bool UE::Geometry::FDynamicMesh3::TriangleHasVertex ( int  TriangleID,
int  VertexID 
) const
inlineprotected

◆ TriangleIndicesItr()

triangle_iterator UE::Geometry::FDynamicMesh3::TriangleIndicesItr ( ) const
inline
Returns
enumerable object for valid triangle indices suitable for use with range-based for, ie for ( int i : TriangleIndicesItr() )

◆ TrianglesItr()

value_iteration< FIndex3i > UE::Geometry::FDynamicMesh3::TrianglesItr ( ) const
inline

Enumerate all triangles in the mesh

◆ TriHasNeighbourTri()

bool UE::Geometry::FDynamicMesh3::TriHasNeighbourTri ( int  CheckTriID,
int  NbrTriID 
) const
inlineprotected

◆ TriHasSequentialVertices()

bool UE::Geometry::FDynamicMesh3::TriHasSequentialVertices ( int  TriangleID,
int  vA,
int  vB 
) const
inlineprotected

◆ UpdateChangeStamps()

void UE::Geometry::FDynamicMesh3::UpdateChangeStamps ( bool  bShapeChange,
bool  bTopologyChange 
)
inline

Increment the specified ChangeStamps, if they are enabled. Thread-safe.

◆ VertexCount()

int UE::Geometry::FDynamicMesh3::VertexCount ( ) const
inline
Returns
number of vertices in the mesh

◆ VertexIndicesItr()

vertex_iterator UE::Geometry::FDynamicMesh3::VertexIndicesItr ( ) const
inline
Returns
enumerable object for valid vertex indices suitable for use with range-based for, ie for ( int i : VertexIndicesItr() )

◆ VerticesItr()

value_iteration< FVector3d > UE::Geometry::FDynamicMesh3::VerticesItr ( ) const
inline

Enumerate positions of all vertices in mesh

◆ VtxEdgesItr()

FSmallListSet::ValueEnumerable UE::Geometry::FDynamicMesh3::VtxEdgesItr ( int  VertexID) const
inline
Returns
enumerable object for one-ring edges of a vertex, suitable for use with range-based for, ie for ( int i : VtxEdgesItr(VertexID) )

◆ VtxTrianglesItr()

vtx_triangles_enumerable UE::Geometry::FDynamicMesh3::VtxTrianglesItr ( int  VertexID) const
inline
Returns
enumerable object for one-ring triangles of a vertex, suitable for use with range-based for, ie for ( int i : VtxTrianglesItr(VertexID) )

◆ VtxVerticesItr()

FSmallListSet::MappedValueEnumerable UE::Geometry::FDynamicMesh3::VtxVerticesItr ( int  VertexID) const
inline
Returns
enumerable object for one-ring vertex neighbours of a vertex, suitable for use with range-based for, ie for ( int i : VtxVerticesItr(VertexID) )

Friends And Related Symbol Documentation

◆ FDynamicMeshAttributeSet

◆ FDynamicMeshBulkEdit

friend class FDynamicMeshBulkEdit
friend

◆ operator<<

FArchive & operator<< ( FArchive Ar,
FDynamicMesh3 Mesh 
)
friend

Serialization operator for FDynamicMesh3.

Parameters
ArArchive to serialize with.
MeshMesh to serialize.
Returns
Passing down serializing archive.

Member Data Documentation

◆ AttributeSet

TUniquePtr<FDynamicMeshAttributeSet> UE::Geometry::FDynamicMesh3::AttributeSet {}
protected

Extended Attributes for the Mesh (UV layers, Hard Normals, additional Polygroup Layers, etc)

◆ bEnableShapeChangeStamp

bool UE::Geometry::FDynamicMesh3::bEnableShapeChangeStamp = false
protected

◆ DuplicateTriangleID

constexpr int FDynamicMesh3::DuplicateTriangleID = -3
staticconstexpr

DuplicateTriangleID is returned by AppendTriangle() to indicate that the added triangle already exists in the mesh, and was ignored because we do not support duplicate triangles

◆ EdgeRefCounts

FRefCountVector UE::Geometry::FDynamicMesh3::EdgeRefCounts
protected

Reference counts of edge indices. Ref count is always 1 if the edge exists. Iterate over this to find out which edge indices are valid.

◆ Edges

TDynamicVector<FEdge> UE::Geometry::FDynamicMesh3::Edges
protected

List of edge elements. An edge is four elements [VertA, VertB, Tri0, Tri1], where VertA < VertB, and Tri1 may be InvalidID (if the edge is a boundary edge)

◆ GroupIDCounter

int UE::Geometry::FDynamicMesh3::GroupIDCounter = 0
protected

Upper bound on the triangle group IDs used in the mesh (may be larger than the actual maximum if triangles have been deleted)

◆ InvalidEdge

constexpr FIndex2i FDynamicMesh3::InvalidEdge {InvalidID, InvalidID}
staticconstexpr

◆ InvalidID

constexpr int FDynamicMesh3::InvalidID = IndexConstants::InvalidID
staticconstexpr

InvalidID indicates that a vertex/edge/triangle ID is invalid

◆ InvalidTriangle

constexpr FIndex3i FDynamicMesh3::InvalidTriangle {InvalidID, InvalidID, InvalidID}
staticconstexpr

◆ InvalidVertex

const FVector3d FDynamicMesh3::InvalidVertex = FVector3d(TNumericLimits<double>::Max(), 0.0, 0.0)
static

◆ NonManifoldID

constexpr int FDynamicMesh3::NonManifoldID = -2
staticconstexpr

NonManifoldID is returned by AppendTriangle() to indicate that the added triangle would result in nonmanifold geometry and hence was ignored

◆ ShapeChangeStamp

std::atomic<uint32> UE::Geometry::FDynamicMesh3::ShapeChangeStamp = 0
protected

◆ TopologyChangeStamp

std::atomic<uint32> UE::Geometry::FDynamicMesh3::TopologyChangeStamp = 0
protected

◆ TriangleEdges

TDynamicVector<FIndex3i> UE::Geometry::FDynamicMesh3::TriangleEdges
protected

List of triangle edge triplets [Edge0 Edge1 Edge2]

◆ TriangleGroups

TOptional<TDynamicVector<int> > UE::Geometry::FDynamicMesh3::TriangleGroups {}
protected

(optional) List of per-triangle group identifiers

◆ TriangleRefCounts

FRefCountVector UE::Geometry::FDynamicMesh3::TriangleRefCounts
protected

Reference counts of triangle indices. Ref count is always 1 if the triangle exists. Iterate over this to find out which triangle indices are valid.

◆ Triangles

TDynamicVector<FIndex3i> UE::Geometry::FDynamicMesh3::Triangles
protected

List of triangle vertex-index triplets [Vert0 Vert1 Vert2]

◆ VertexColors

TOptional<TDynamicVector<FVector3f> > UE::Geometry::FDynamicMesh3::VertexColors {}
protected

(optional) List of per-vertex colors

◆ VertexEdgeLists

FSmallListSet UE::Geometry::FDynamicMesh3::VertexEdgeLists
protected

List of per-vertex edge one-rings

◆ VertexNormals

TOptional<TDynamicVector<FVector3f> > UE::Geometry::FDynamicMesh3::VertexNormals {}
protected

(optional) List of per-vertex normals

◆ VertexRefCounts

FRefCountVector UE::Geometry::FDynamicMesh3::VertexRefCounts {}
protected

Reference counts of vertex indices. For vertices that exist, the count is 1 + num_triangle_using_vertex. Iterate over this to find out which vertex indices are valid.

◆ VertexUVs

TOptional<TDynamicVector<FVector2f> > UE::Geometry::FDynamicMesh3::VertexUVs {}
protected

(optional) List of per-vertex uv's

◆ Vertices

TDynamicVector<FVector3d> UE::Geometry::FDynamicMesh3::Vertices {}
protected

List of vertex positions


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