Files
UnrealEngineUWP/Engine/Source/Developer/MeshBuilder/Private/MeshDescriptionHelper.h
danny couture f618e01190 Allow creation of RenderMeshDescription directly from BulkData/RawMesh when MeshDescription is not in memory
Clear MeshDescriptions sooner to reduce memory usage on datasmith import
   - 37.92 GB -> 26.70 GB Peak Working Set when importing DATASET-0008a
   - 66.04 GB -> 52.33 GB Peak Working Set when importing DATASET-0022a

#jira UE-64172
#rb Richard.Talbot-Watkins

#ROBOMERGE-SOURCE: CL 9755311 in //UE4/Release-4.24/...
#ROBOMERGE-BOT: RELEASE (Release-4.24 -> Main) (v545-9751379)

[CL 9755316 by danny couture in Main branch]
2019-10-23 06:44:22 -04:00

60 lines
1.7 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "CoreTypes.h"
#include "Logging/LogMacros.h"
#include "OverlappingCorners.h"
DECLARE_LOG_CATEGORY_EXTERN(LogMeshBuilder, Log, All);
class UObject;
struct FMeshDescription;
struct FMeshBuildSettings;
struct FVertexInstanceID;
struct FMeshReductionSettings;
class FMeshDescriptionHelper
{
public:
FMeshDescriptionHelper(FMeshBuildSettings* InBuildSettings);
//Build a render mesh description with the BuildSettings. This will update the RenderMeshDescription in place
void SetupRenderMeshDescription(UObject* Owner, FMeshDescription& RenderMeshDescription);
void ReduceLOD(const FMeshDescription& BaseMesh, FMeshDescription& DestMesh, const struct FMeshReductionSettings& ReductionSettings, const FOverlappingCorners& InOverlappingCorners, float &OutMaxDeviation);
void FindOverlappingCorners(const FMeshDescription& MeshDescription, float ComparisonThreshold);
const FOverlappingCorners& GetOverlappingCorners() const { return OverlappingCorners; }
private:
//////////////////////////////////////////////////////////////////////////
//PRIVATE function declarations
//////////////////////////////////////////////////////////////////////////
//PRIVATE class members
FMeshBuildSettings* BuildSettings;
FOverlappingCorners OverlappingCorners;
//////////////////////////////////////////////////////////////////////////
//INLINE small helper use to optimize search and compare
/**
* Smoothing group interpretation helper structure.
*/
struct FFanFace
{
int32 FaceIndex;
int32 LinkedVertexIndex;
bool bFilled;
bool bBlendTangents;
bool bBlendNormals;
};
};