UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UVPacking.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "BoxTypes.h"
6#include "Containers/Array.h"
7#include "IndexTypes.h"
9#include "Math/Vector2D.h"
10#include "VectorTypes.h"
11
12template <typename FuncType> class TFunctionRef;
13
14namespace UE
15{
16namespace Geometry
17{
18
25{
26public:
27
28 // abstract interface to apply UV packer a mesh
30 {
31 virtual ~IUVMeshView() {}
32 virtual FIndex3i GetTriangle(int32 TID) const = 0;
33 virtual FIndex3i GetUVTriangle(int32 TID) const = 0;
34 virtual FVector3d GetVertex(int32 VID) const = 0;
35 virtual FVector2f GetUV(int32 EID) const = 0;
36 virtual void SetUV(int32 EID, FVector2f UV) = 0;
37 };
38
39
42
44 float GutterSize = 1.0;
45
47 bool bPreserveScale = false;
48
50 bool bPreserveRotation = false;
51
53 bool bAllowFlips = false;
54
57
64
67 {
68 return StandardPack(Mesh, UVIslands.Num(), [&UVIslands](int Idx, TArray<int32>& IslandOut)
69 {
70 IslandOut = UVIslands[Idx];
71 });
72 }
73
80
83 {
84 return StackPack(Mesh, UVIslands.Num(), [&UVIslands](int Idx, TArray<int32>& IslandOut)
85 {
86 IslandOut = UVIslands[Idx];
87 });
88 }
89
90protected:
91
96
97};
98
99
100} // end namespace UE::Geometry
101} // end namespace UE
102
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
Definition Array.h:670
Definition AssetRegistryState.h:50
Definition UVPacking.h:25
bool bPreserveScale
Definition UVPacking.h:47
int32 TextureResolution
Definition UVPacking.h:41
bool StackPack(IUVMeshView *Mesh, const TArray< TArray< int > > &UVIslands)
Version of StackPack that takes an array of arrays instead of a TFunctionRef, for convenience.
Definition UVPacking.h:82
GEOMETRYCORE_API bool StackPack(IUVMeshView *Mesh, int NumIslands, TFunctionRef< void(int, TArray< int32 > &)> CopyIsland)
Definition UVPacking.cpp:937
GEOMETRYCORE_API void GetIslandStats(IUVMeshView *Mesh, const TArray< int32 > &Island, FAxisAlignedBox2d &IslandBoundsOut, double &IslandScaleFactorOut, double &UVAreaOut)
Definition UVPacking.cpp:1007
bool bAllowFlips
Definition UVPacking.h:53
GEOMETRYCORE_API bool StandardPack(IUVMeshView *Mesh, int NumIslands, TFunctionRef< void(int, TArray< int32 > &)> CopyIsland)
Definition UVPacking.cpp:835
bool StandardPack(IUVMeshView *Mesh, const TArray< TArray< int > > &UVIslands)
Version of StandardPack that takes an array of arrays instead of a TFunctionRef, for convenience.
Definition UVPacking.h:66
bool bScaleIslandsByWorldSpaceTexelRatio
Definition UVPacking.h:56
bool bPreserveRotation
Definition UVPacking.h:50
float GutterSize
Definition UVPacking.h:44
Definition AdvancedWidgetsModule.cpp:13
Definition IndexTypes.h:158
Definition UVPacking.h:30
virtual ~IUVMeshView()
Definition UVPacking.h:31
virtual FIndex3i GetUVTriangle(int32 TID) const =0
virtual void SetUV(int32 EID, FVector2f UV)=0
virtual FIndex3i GetTriangle(int32 TID) const =0
virtual FVector2f GetUV(int32 EID) const =0
virtual FVector3d GetVertex(int32 VID) const =0
Definition BoxTypes.h:637