UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GeometryCollectionToDynamicMesh.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6
7#include "GeometryBase.h"
8
9PREDECLARE_GEOMETRY(class FDynamicMesh3);
12
13namespace UE::Geometry
14{
15
17{
18 struct FMeshInfo
19 {
20 // Transform Index of the bone represented
22 // Mesh holding the geometry at (or under) a given bone, in a common coordinate space
24 // Stores the Transform that has *already* been applied to the Mesh vertices, which took it from local bone space to a common space
26 };
27
29
30
31
33 {
34 Skip,
36 };
37
48
50 {
51 // Whether to set faces with no 'visible' tag as visible (if true) or invisible (if false)
53 // Whether to set faces with no 'internal' tag as internal (if true) or external (if false)
55 // Whether the appended geometry is allowed to be added as a root transform (if NewMeshParentIndex == -1)
56 bool bAllowAppendAsRoot = false;
57
58 // Parent index to use if adding a new mesh (with no existing transform) -- if invalid, will add to root
60 };
61
62 // Convert all meshes in the given collection to dynamic meshes
64
65 // Convert the meshes in the collection at the given transforms to dynamic meshes
67
68 // Update a geometry collection with the current meshes array
69 // Note this updates a Geometry Collection rather than the more general FManagedArrayCollection because some of the updating code is specific to geometry collection
71
72 // Add a new mesh to the geometry collection
73 // Note this updates a Geometry Collection rather than the more general FManagedArrayCollection because some of the updating code is specific to geometry collection
74 // @return Index of added transform
76
77
78
79 // Get the name used for the polygroup that we optionally set on the dynamic mesh, corresponding to the internal face tags of the geometry collection triangles
81 // Get the name used for the polygroup that we optionally set on the dynamic mesh, corresponding to the invisible face tags of the geometry collection triangles
83
84private:
85
86 // private helper method with shared implementation for all Init* methods
87 // @param bTransformInComponentSpace If false, the Transforms array holds transforms that are relative to the corresponding bone parent. If true, the Transforms are all relative to a common coordinate space.
88 bool InitHelper(const FManagedArrayCollection& Collection, bool bTransformInComponentSpace, TConstArrayView<FTransform3f> Transforms, bool bAllTransforms, TConstArrayView<int32> TransformIndices, const FToMeshOptions& Options);
89 static TConstArrayView<FTransform3f> GetCollectionTransforms(const FManagedArrayCollection& Collection);
90
91 // Update an existing geometry in a collection w/ a new mesh (w/ the same number of faces and vertices!)
92 static bool UpdateCollection(const FTransform& FromCollection, const FDynamicMesh3& Mesh, int32 GeometryIdx, FGeometryCollection& Output, const FToCollectionOptions& Options);
93};
94
95} // namespace UE::Geometry::GeometryCollectionDynamicMeshConversion
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
#define PREDECLARE_GEOMETRY(TypeName)
Definition GeometryBase.h:14
void Init()
Definition LockFreeList.h:4
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition GeometryCollection.h:32
Definition NameTypes.h:617
Definition Array.h:670
Definition UniquePtr.h:107
Definition DynamicMesh3.h:108
Definition ParametricSurfaceData.h:18
Definition ManagedArrayCollection.h:56
Definition GeometryCollectionToDynamicMesh.h:19
TUniquePtr< FDynamicMesh3 > Mesh
Definition GeometryCollectionToDynamicMesh.h:23
int32 TransformIndex
Definition GeometryCollectionToDynamicMesh.h:21
FTransform Transform
Definition GeometryCollectionToDynamicMesh.h:25
Definition GeometryCollectionToDynamicMesh.h:50
int32 NewMeshParentIndex
Definition GeometryCollectionToDynamicMesh.h:59
bool bDefaultFaceInternal
Definition GeometryCollectionToDynamicMesh.h:54
bool bAllowAppendAsRoot
Definition GeometryCollectionToDynamicMesh.h:56
bool bDefaultFaceVisible
Definition GeometryCollectionToDynamicMesh.h:52
Definition GeometryCollectionToDynamicMesh.h:39
FTransform Transform
Definition GeometryCollectionToDynamicMesh.h:40
bool bWeldVertices
Definition GeometryCollectionToDynamicMesh.h:42
EInvisibleFaceConversion InvisibleFaces
Definition GeometryCollectionToDynamicMesh.h:46
bool bSaveIsolatedVertices
Definition GeometryCollectionToDynamicMesh.h:43
bool bInternalFaceTagsAsPolygroups
Definition GeometryCollectionToDynamicMesh.h:45
Definition GeometryCollectionToDynamicMesh.h:17
TArray< FMeshInfo > Meshes
Definition GeometryCollectionToDynamicMesh.h:28
static MESHCONVERSIONENGINETYPES_API FName VisibleFacePolyGroupName()
Definition GeometryCollectionToDynamicMesh.cpp:749
EInvisibleFaceConversion
Definition GeometryCollectionToDynamicMesh.h:33
MESHCONVERSIONENGINETYPES_API bool UpdateGeometryCollection(FGeometryCollection &Collection, const FToCollectionOptions &Options) const
Definition GeometryCollectionToDynamicMesh.cpp:369
static MESHCONVERSIONENGINETYPES_API FName InternalFacePolyGroupName()
Definition GeometryCollectionToDynamicMesh.cpp:745
static MESHCONVERSIONENGINETYPES_API int32 AppendMeshToCollection(FGeometryCollection &Collection, const FDynamicMesh3 &Mesh, const FTransform &MeshTransform, const FToCollectionOptions &Options)
Definition GeometryCollectionToDynamicMesh.cpp:468
MESHCONVERSIONENGINETYPES_API bool InitFromTransformSelection(const FManagedArrayCollection &Collection, TConstArrayView< int32 > TransformIndices, const FToMeshOptions &Options)
Definition GeometryCollectionToDynamicMesh.cpp:287
static CORE_API const TTransform< double > Identity
Definition TransformNonVectorized.h:58