Files
UnrealEngineUWP/Engine/Source/Developer/MeshBuilder/Public/MeshDescriptionHelper.h
graham wihlidal 7f322b7db8 Implemented DDC resource build for NaniteDisplacedMesh, including a stubbed out DisplaceNaniteMesh function that is just passthrough for now. Included exposing some of the static mesh and mesh description utilities to this plugin, and various other refactors.
#rb brian.karis, devin.doucette
[FYI] rune.stubbe, julien.stjean, richard.talbotwatkin
#preflight 62857333614041edb7af27a5

#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 20276443 via CL 20276454 via CL 20276457
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20277150 by graham wihlidal in ue5-main branch]
2022-05-19 03:57:40 -04:00

60 lines
1.7 KiB
C++

// Copyright 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 MESHBUILDER_API 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;
};
};