You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb devin.doucette [FYI] brian.karis, rune.stubbe, zousar.shaker #preflight 62bbdeabd8366789fdc55c95 #ROBOMERGE-AUTHOR: graham.wihlidal #ROBOMERGE-SOURCE: CL 20878146 via CL 20878158 via CL 20878172 #ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v971-20777995) [CL 20880187 by graham wihlidal in ue5-main branch]
73 lines
2.2 KiB
C++
73 lines
2.2 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "MeshBuilder.h"
|
|
|
|
DECLARE_LOG_CATEGORY_EXTERN(LogStaticMeshBuilder, Log, All);
|
|
|
|
class UStaticMesh;
|
|
class FStaticMeshRenderData;
|
|
class FStaticMeshLODGroup;
|
|
class USkeletalMesh;
|
|
struct FOverlappingCorners;
|
|
struct FMeshDescription;
|
|
struct FMeshBuildSettings;
|
|
|
|
|
|
class MESHBUILDER_API FStaticMeshBuilder : public FMeshBuilder
|
|
{
|
|
public:
|
|
FStaticMeshBuilder();
|
|
virtual ~FStaticMeshBuilder() {}
|
|
|
|
virtual bool Build(
|
|
FStaticMeshRenderData& OutRenderData,
|
|
UStaticMesh* StaticMesh,
|
|
const FStaticMeshLODGroup& LODGroup,
|
|
bool bGenerateCoarseMeshStreamingLODs,
|
|
bool bAllowNanite) override;
|
|
|
|
//No support for skeletal mesh build in this class
|
|
virtual bool Build(const struct FSkeletalMeshBuildParameters& SkeletalMeshBuildParameters) override
|
|
{
|
|
bool No_Support_For_SkeletalMesh_Build_In_FStaticMeshBuilder_Class = false;
|
|
check(No_Support_For_SkeletalMesh_Build_In_FStaticMeshBuilder_Class);
|
|
return false;
|
|
}
|
|
|
|
virtual bool BuildMeshVertexPositions(
|
|
UStaticMesh* StaticMesh,
|
|
TArray<uint32>& Indices,
|
|
TArray<FVector3f>& Vertices) override;
|
|
|
|
private:
|
|
|
|
void OnBuildRenderMeshStart(class UStaticMesh* StaticMesh, const bool bInvalidateLighting);
|
|
void OnBuildRenderMeshFinish(class UStaticMesh* StaticMesh, const bool bRebuildBoundsAndCollision);
|
|
|
|
/** Used to refresh all components in the scene that may be using a mesh we're editing */
|
|
TSharedPtr<class FStaticMeshComponentRecreateRenderStateContext> RecreateRenderStateContext;
|
|
};
|
|
|
|
namespace UE::Private::StaticMeshBuilder
|
|
{
|
|
MESHBUILDER_API void BuildVertexBuffer(
|
|
UStaticMesh* StaticMesh,
|
|
const FMeshDescription& MeshDescription,
|
|
const FMeshBuildSettings& BuildSettings,
|
|
TArray<int32>& OutWedgeMap,
|
|
FStaticMeshSectionArray& OutSections,
|
|
TArray<TArray<uint32>>& OutPerSectionIndices,
|
|
TArray<FStaticMeshBuildVertex>& StaticMeshBuildVertices,
|
|
const FOverlappingCorners& OverlappingCorners,
|
|
TArray<int32>& RemapVerts
|
|
);
|
|
|
|
MESHBUILDER_API void BuildCombinedSectionIndices(
|
|
const TArray<TArray<uint32>>& PerSectionIndices,
|
|
FStaticMeshSectionArray& SectionsOut,
|
|
TArray<uint32>& CombinedIndicesOut,
|
|
bool& bNeeds32BitIndicesOut);
|
|
} |