UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
InfoTypes.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "IndexTypes.h"
6#include "VectorTypes.h"
7
8namespace UE
9{
10namespace Geometry
11{
12
34
35
36
55{
57 unsigned TriEdgeIndex : 2;
59 unsigned TriangleID : 30;
60
62 {
63 TriEdgeIndex = 0;
64 TriangleID = 0;
65 }
66
72 {
73 checkSlow(EdgeIndexIn >= 0 && EdgeIndexIn <= 2);
74 checkSlow(TriangleIDIn >= 0 && TriangleIDIn < (1<<30));
75 TriEdgeIndex = (unsigned int)EdgeIndexIn;
76 TriangleID = (unsigned int)TriangleIDIn;
77 }
78
83 {
84 TriangleID = EncodedEdgeKey & 0x8FFFFFFF;
85 TriEdgeIndex = (EncodedEdgeKey & 0xC0000000) >> 30;
86 }
87
92 {
93 return (TriEdgeIndex << 30) | TriangleID;
94 }
95};
96
97
140
141
142
143
144} // end namespace UE::Geometry
145} // end namespace UE
146
147
148
149namespace DynamicMeshInfo
150{
151using namespace UE::Geometry;
152
155{
156 int OriginalEdge; // the edge that was split
157 FIndex2i OriginalVertices; // original edge vertices [a,b]
158 FIndex2i OtherVertices; // original opposing vertices [c,d] - d is InvalidID for boundary edges
159 FIndex2i OriginalTriangles; // original edge triangles [t0,t1]
160 bool bIsBoundary; // was the split edge a boundary edge? (redundant)
161
162 int NewVertex; // new vertex f that was created
163 FIndex2i NewTriangles; // new triangles [t2,t3], oriented as explained in SplitEdge() header comment
164 FIndex3i NewEdges; // new edges are [f,b], [f,c] and [f,d] if this is not a boundary edge
165
166 double SplitT; // parameter value for NewVertex along original edge
167};
168
171{
172 int EdgeID; // the edge that was flipped
173 FIndex2i OriginalVerts; // original verts of the flipped edge, that are no longer connected
174 FIndex2i OpposingVerts; // the opposing verts of the flipped edge, that are now connected
175 FIndex2i Triangles; // the two triangle IDs. Original tris vert [Vert0,Vert1,OtherVert0] and [Vert1,Vert0,OtherVert1].
176 // New triangles are [OtherVert0, OtherVert1, Vert1] and [OtherVert1, OtherVert0, Vert0]
177};
178
181{
182 int KeptVertex; // the vertex that was kept (ie collapsed "to")
183 int RemovedVertex; // the vertex that was removed
184 FIndex2i OpposingVerts; // the opposing vertices [c,d]. If the edge was a boundary edge, d is InvalidID
185 bool bIsBoundary; // was the edge a boundary edge
186
187 int CollapsedEdge; // the edge that was collapsed/removed
188 FIndex2i RemovedTris; // the triangles that were removed in the collapse (second is InvalidID for boundary edge)
189 FIndex2i RemovedEdges; // the edges that were removed (second is InvalidID for boundary edge)
190 FIndex2i KeptEdges; // the edges that were kept (second is InvalidID for boundary edge)
191
192 double CollapseT; // interpolation parameter along edge for new vertex in range [0,1] where 0 => KeptVertex and 1 => RemovedVertex
193};
194
197{
198 int KeptEdge; // the edge that was kept
199 int RemovedEdge; // the edge that was removed
200
201 FIndex2i KeptVerts; // The two vertices that were kept (redundant w/ KeptEdge?)
202 FIndex2i RemovedVerts; // The removed vertices of RemovedEdge. Either may be InvalidID if it was same as the paired KeptVert
203
204 FIndex2i ExtraRemovedEdges; // extra removed edges, see description below. Either may be or InvalidID
205 FIndex2i ExtraKeptEdges; // extra kept edges, paired with ExtraRemovedEdges
206
207 // Even more Removed and Kept edges, in cases where there were multiple such edges on one or both sides of the merged edge
208 // Only possible if the pre-merge mesh had non-manifold vertices (aka bowties), in almost all meshes these arrays will be empty
210
211 double InterpolationT = 0; // Interpolation parameter for each kept vertex in range [0,1] where 0 => KeptVertex and 1 => RemovedVertex
212};
213
216{
217 int KeptVertex; // the vertex that was kept
218 int RemovedVertex; // the vertex that was removed
219 double InterpolationT = 0; // Interpolation parameter for the kept vertex in range [0,1] where 0 => KeptVertex and 1 => RemovedVertex
220
221 // If the merge resolves as an edge collapse, the information is stored here
223 // If the merge resolves as an edge weld, the information is stored here
225};
226
229{
230 int OriginalTriangle; // the triangle that was poked
231 FIndex3i TriVertices; // vertices of the original triangle
232
233 int NewVertex; // the new vertex that was inserted
234 FIndex2i NewTriangles; // the two new triangles that were added (OriginalTriangle is re-used, see code for vertex orders)
235 FIndex3i NewEdges; // the three new edges connected to NewVertex
236
237 FVector3d BaryCoords; // barycentric coords that NewVertex was inserted at
238};
239
242{
245 // if needed could possibly add information about added edges? but it would be a dynamic array, and there is no use for it yet.
246 // modified triangles are passed as input to the function, no need to store those here.
247};
248}
#define checkSlow(expr)
Definition AssertionMacros.h:332
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Array.h:670
Definition DynamicMeshAttributeSet.h:26
constexpr int InvalidID
Definition IndexTypes.h:13
Definition ParametricSurfaceData.h:18
Definition AdvancedWidgetsModule.cpp:13
Definition InfoTypes.h:181
FIndex2i RemovedEdges
Definition InfoTypes.h:189
int KeptVertex
Definition InfoTypes.h:182
double CollapseT
Definition InfoTypes.h:192
FIndex2i RemovedTris
Definition InfoTypes.h:188
FIndex2i OpposingVerts
Definition InfoTypes.h:184
int CollapsedEdge
Definition InfoTypes.h:187
int RemovedVertex
Definition InfoTypes.h:183
FIndex2i KeptEdges
Definition InfoTypes.h:190
bool bIsBoundary
Definition InfoTypes.h:185
Definition InfoTypes.h:171
FIndex2i OriginalVerts
Definition InfoTypes.h:173
int EdgeID
Definition InfoTypes.h:172
FIndex2i Triangles
Definition InfoTypes.h:175
FIndex2i OpposingVerts
Definition InfoTypes.h:174
Definition InfoTypes.h:155
FIndex2i OriginalTriangles
Definition InfoTypes.h:159
FIndex2i NewTriangles
Definition InfoTypes.h:163
int OriginalEdge
Definition InfoTypes.h:156
bool bIsBoundary
Definition InfoTypes.h:160
FIndex2i OtherVertices
Definition InfoTypes.h:158
int NewVertex
Definition InfoTypes.h:162
FIndex2i OriginalVertices
Definition InfoTypes.h:157
double SplitT
Definition InfoTypes.h:166
FIndex3i NewEdges
Definition InfoTypes.h:164
Definition InfoTypes.h:197
FIndex2i ExtraRemovedEdges
Definition InfoTypes.h:204
TArray< int, TInlineAllocator< 4 > > BowtiesRemovedEdges
Definition InfoTypes.h:209
FIndex2i RemovedVerts
Definition InfoTypes.h:202
FIndex2i ExtraKeptEdges
Definition InfoTypes.h:205
FIndex2i KeptVerts
Definition InfoTypes.h:201
int RemovedEdge
Definition InfoTypes.h:199
int KeptEdge
Definition InfoTypes.h:198
TArray< int, TInlineAllocator< 4 > > BowtiesKeptEdges
Definition InfoTypes.h:209
double InterpolationT
Definition InfoTypes.h:211
Definition InfoTypes.h:216
double InterpolationT
Definition InfoTypes.h:219
int KeptVertex
Definition InfoTypes.h:217
TOptional< FMergeEdgesInfo > MergeEdgesInfo
Definition InfoTypes.h:224
int RemovedVertex
Definition InfoTypes.h:218
TOptional< FEdgeCollapseInfo > EdgeCollapseInfo
Definition InfoTypes.h:222
Definition InfoTypes.h:229
FIndex3i NewEdges
Definition InfoTypes.h:235
int OriginalTriangle
Definition InfoTypes.h:230
FIndex2i NewTriangles
Definition InfoTypes.h:234
FIndex3i TriVertices
Definition InfoTypes.h:231
FVector3d BaryCoords
Definition InfoTypes.h:237
int NewVertex
Definition InfoTypes.h:233
Definition InfoTypes.h:242
int NewVertex
Definition InfoTypes.h:244
int OriginalVertex
Definition InfoTypes.h:243
Definition Optional.h:131
Definition IndexTypes.h:27
Definition IndexTypes.h:158
Definition InfoTypes.h:55
FMeshTriEdgeID()
Definition InfoTypes.h:61
uint32 Encoded() const
Definition InfoTypes.h:91
FMeshTriEdgeID(uint32 EncodedEdgeKey)
Definition InfoTypes.h:82
unsigned TriEdgeIndex
Definition InfoTypes.h:57
FMeshTriEdgeID(int32 TriangleIDIn, int32 EdgeIndexIn)
Definition InfoTypes.h:71
unsigned TriangleID
Definition InfoTypes.h:59
Definition InfoTypes.h:115
unsigned VertIndexB
Definition InfoTypes.h:121
unsigned VertIndexA
Definition InfoTypes.h:119
FMeshTriOrderedEdgeID(int32 TriangleIDIn, int32 VertexIndexA, int32 VertexIndexB)
Definition InfoTypes.h:131
FMeshTriOrderedEdgeID()
Definition InfoTypes.h:124
int32 TriangleID
Definition InfoTypes.h:117
Definition InfoTypes.h:17
FVector3d Position
Definition InfoTypes.h:18
FVertexInfo(const FVector3d &PositionIn, const FVector3f &NormalIn, const FVector3f &ColorIn, const FVector2f &UVIn)
Definition InfoTypes.h:31
FVector3f Color
Definition InfoTypes.h:20
FVertexInfo(const FVector3d &PositionIn)
Definition InfoTypes.h:25
bool bHaveUV
Definition InfoTypes.h:22
FVector3f Normal
Definition InfoTypes.h:19
FVertexInfo(const FVector3d &PositionIn, const FVector3f &NormalIn, const FVector3f &ColorIn)
Definition InfoTypes.h:29
bool bHaveC
Definition InfoTypes.h:22
FVector2f UV
Definition InfoTypes.h:21
FVertexInfo(const FVector3d &PositionIn, const FVector3f &NormalIn)
Definition InfoTypes.h:27
bool bHaveN
Definition InfoTypes.h:22
static TVector2< float > Zero()
Definition Vector2D.h:79
static TVector< double > Zero()
Definition Vector.h:112