Files
UnrealEngineUWP/Engine/Source/Runtime/Landscape/Classes/LandscapeMeshCollisionComponent.h
Benn Gallagher 8757cb3641 Physics interface cleanup.
* Removed deprecated or dead code paths
* Simplified build system setup for physics support
* Deprecated build system flags and unsupported macros

#jira none
#rb Chris.Caulfield, Kriss.Gossart
#preflight 62963ec0fe779f23c8ea0c5e

[CL 20450744 by Benn Gallagher in ue5-main branch]
2022-06-01 06:59:18 -04:00

100 lines
3.0 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/ObjectMacros.h"
#include "Misc/Guid.h"
#include "Templates/RefCounting.h"
#include "EngineDefines.h"
#include "Serialization/BulkData.h"
#include "LandscapeHeightfieldCollisionComponent.h"
#include "Chaos/PhysicalMaterials.h"
#include "LandscapeMeshCollisionComponent.generated.h"
class UPhysicalMaterial;
struct FNavigableGeometryExport;
namespace Chaos
{
class FTriangleMeshImplicitObject;
}
UCLASS()
class ULandscapeMeshCollisionComponent : public ULandscapeHeightfieldCollisionComponent
{
GENERATED_BODY()
public:
ULandscapeMeshCollisionComponent();
virtual ~ULandscapeMeshCollisionComponent();
// Keep the possibility to share projected height field PhysX object with editor mesh collision objects...
/** Guid used to share PhysX heightfield objects in the editor */
UPROPERTY()
FGuid MeshGuid;
struct FTriMeshGeometryRef : public FRefCountedObject
{
FGuid Guid;
TArray<Chaos::FMaterialHandle> UsedChaosMaterials;
TUniquePtr<Chaos::FTriangleMeshImplicitObject> Trimesh;
#if WITH_EDITORONLY_DATA
TUniquePtr<Chaos::FTriangleMeshImplicitObject> EditorTrimesh;
#endif // WITH_EDITORONLY_DATA
FTriMeshGeometryRef();
FTriMeshGeometryRef(FGuid& InGuid);
virtual ~FTriMeshGeometryRef();
void GetResourceSizeEx(FResourceSizeEx& CumulativeResourceSize);
};
#if WITH_EDITORONLY_DATA
/** The collision mesh values. */
FWordBulkData CollisionXYOffsetData; // X, Y Offset in raw format...
#endif //WITH_EDITORONLY_DATA
/** Physics engine version of heightfield data. */
TRefCountPtr<FTriMeshGeometryRef> MeshRef;
//~ Begin UActorComponent Interface.
protected:
virtual void OnCreatePhysicsState() override;
public:
virtual void ApplyWorldOffset(const FVector& InOffset, bool bWorldShift) override;
//~ End UActorComponent Interface.
//~ Begin USceneComponent Interface.
virtual void DestroyComponent(bool bPromoteChildren = false) override;
//~ End USceneComponent Interface.
//~ Begin UPrimitiveComponent Interface
virtual bool DoCustomNavigableGeometryExport(FNavigableGeometryExport& GeomExport) const override;
//End UPrimitiveComponent interface
//~ Begin UObject Interface.
virtual void Serialize(FArchive& Ar) override;
virtual void BeginDestroy() override;
virtual void GetResourceSizeEx(FResourceSizeEx& CumulativeResourceSize) override;
#if WITH_EDITOR
virtual void ExportCustomProperties(FOutputDevice& Out, uint32 Indent) override;
virtual void ImportCustomProperties(const TCHAR* SourceText, FFeedbackContext* Warn) override;
virtual bool CookCollisionData(const FName& Format, bool bUseOnlyDefMaterial, bool bCheckDDC, TArray<uint8>& OutCookedData, TArray<UPhysicalMaterial*>& InOutMaterials) const override;
virtual uint32 ComputeCollisionHash() const override { return 0; }
#endif
//~ End UObject Interface.
//~ Begin ULandscapeHeightfieldCollisionComponent Interface
virtual void CreateCollisionObject() override;
virtual bool RecreateCollision() override;
//~ End ULandscapeHeightfieldCollisionComponent Interface
};