Files
UnrealEngineUWP/Engine/Source/Runtime/ClothingSystemRuntimeCommon/Public/ClothConfig.h
kriss gossart cc62b91a3e Chaos Cloth - Significantly reduce the cloth initialization hitch by caching the Long Range Attachment tether calculations. Move the tether code to its own files inside the cloth common runtime module.
Cloth - Tidy up ClothingAsset and ClothPhysicalMeshData to allow for more cloth data caching.

#rb Benn.Gallagher, Cedric.Caillaud, Michael.Forot
#preflight 16823444


#ROBOMERGE-SOURCE: CL 16882246
#ROBOMERGE-BOT: (v836-16769935)

[CL 16913004 by kriss gossart in ue5-main branch]
2021-07-21 14:52:47 -04:00

74 lines
2.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "ClothConfigBase.h"
#include "ClothConfig.generated.h"
struct FClothConfig_Legacy;
/** Different mass modes deciding the setup process. */
UENUM()
enum class EClothMassMode : uint8
{
/** The mass value is used to set the same mass for each particle. */
UniformMass,
/** The mass value is used to set the mass of the entire cloth, distributing it to each particle depending on the amount of connected surface area. */
TotalMass,
/** The mass value is used to set the density of the cloth, calculating the mass for each particle depending on its connected surface area. */
Density,
MaxClothMassMode UMETA(Hidden)
};
/** Common configuration base class. */
UCLASS(Abstract)
class CLOTHINGSYSTEMRUNTIMECOMMON_API UClothConfigCommon : public UClothConfigBase
{
GENERATED_BODY()
public:
UClothConfigCommon();
virtual ~UClothConfigCommon() override;
/** Migrate from the legacy FClothConfig structure. */
virtual void MigrateFrom(const FClothConfig_Legacy&) {}
/** Migrate from shared configs. */
virtual void MigrateFrom(const class UClothSharedConfigCommon*) {}
/**
* Migrate to the legacy FClothConfig structure.
* Useful for converting configs that are compatible with this legacy structure.
* @return true when the migration is possible, false otherwise.
*/
virtual bool MigrateTo(FClothConfig_Legacy&) const { return false; }
//~ Begin UClothConfigBase Interface
/** Return whether to pre-compute self collision data. */
virtual bool NeedsSelfCollisionData() const override { return false; }
/** Return whether to pre-compute inverse masses. */
virtual bool NeedsInverseMasses() const override { return false; }
/** Return whether to pre-compute the influences. */
virtual bool NeedsNumInfluences() const override { return true; }
/** Return whether to pre-compute the long range attachment tethers. */
virtual bool NeedsTethers() const override { return false; }
/** Return the self collision radius to precomute self collision data. */
virtual float GetSelfCollisionRadius() const override { return 0.f; }
/** Return whether tethers need to be calculated using geodesic distances instead of eclidean. */
virtual bool TethersUseGeodesicDistance() const override { return false; }
//~ End UClothConfigBase Interface
};
/** Common shared configuration base class. */
UCLASS(Abstract)
class CLOTHINGSYSTEMRUNTIMECOMMON_API UClothSharedConfigCommon : public UClothConfigCommon
{
GENERATED_BODY()
public:
UClothSharedConfigCommon();
virtual ~UClothSharedConfigCommon() override;
};