UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PhysicalMaterial.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
7#include "CoreMinimal.h"
8#include "HAL/Platform.h"
12#include "Templates/UniquePtr.h"
13#include "UObject/Object.h"
15#include "UObject/ObjectPtr.h"
17
18#include "PhysicalMaterial.generated.h"
19
21
23{
25}
26
27
31USTRUCT(BlueprintType)
33{
35
37
42 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "PhysicalMaterial|Strength", meta = (ClampMin = 0, ForceUnits = "MPa"))
43 float TensileStrength;
44
49 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "PhysicalMaterial|Strength", meta = (ClampMin = 0, ForceUnits = "MPa"))
50 float CompressionStrength;
51
56 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "PhysicalMaterial|Strength", meta = (ClampMin = 0, ForceUnits = "MPa"))
57 float ShearStrength;
58};
59
60
64USTRUCT(BlueprintType)
66{
68
70
76 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "PhysicalMaterial|DamageModifier", meta = (ClampMin = 0))
77 float DamageThresholdMultiplier;
78};
79
85UENUM()
87{
88 // No soft collisionss
89 None,
90
91 // SoftCollisionThickess is a fraction of the bounds (minimum axis). Should be less than 0.5
93
94 // SoftCollisionThickess is an absolute value in cm
96};
97
98
102UCLASS(BlueprintType, Blueprintable, CollapseCategories, HideCategories = Object, MinimalAPI)
104{
106
109 //
110 // Surface properties.
111 //
112
114 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=PhysicalMaterial, meta=(ClampMin=0))
115 float Friction;
116
118 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = PhysicalMaterial, meta = (ClampMin = 0))
119 float StaticFriction;
120
122 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = PhysicalMaterial, meta = (editcondition = "bOverrideFrictionCombineMode"))
123 TEnumAsByte<EFrictionCombineMode::Type> FrictionCombineMode;
124
126 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = PhysicalMaterial)
127 bool bOverrideFrictionCombineMode;
128
130 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = PhysicalMaterial, meta=(ClampMin=0, ClampMax=1))
131 float Restitution;
132
134 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = PhysicalMaterial, meta = (editcondition = "bOverrideRestitutionCombineMode"))
135 TEnumAsByte<EFrictionCombineMode::Type> RestitutionCombineMode;
136
138 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = PhysicalMaterial)
139 bool bOverrideRestitutionCombineMode;
140
141 //
142 // Object properties.
143 //
144
146 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = PhysicalMaterial, meta = (ClampMin = 0, ForceUnits = "g/cm3"))
147 float Density;
148
150 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = PhysicalMaterial, meta = (ClampMin = 0))
151 float SleepLinearVelocityThreshold;
152
154 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = PhysicalMaterial, meta = (ClampMin = 0))
155 float SleepAngularVelocityThreshold;
156
158 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = PhysicalMaterial, meta = (ClampMin = 0))
159 int32 SleepCounterThreshold;
160
166 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Advanced, meta=(ClampMin=0.1, ClampMax=1))
167 float RaiseMassToPower;
168
170 UE_DEPRECATED(5.3, "This property is not used anywhere, use Geometry Collection damage threshold related features instead")
171 UPROPERTY()
172 float DestructibleDamageThresholdScale_DEPRECATED;
173
174 UPROPERTY()
175 TObjectPtr<class UDEPRECATED_PhysicalMaterialPropertyBase> PhysicalMaterialProperty_DEPRECATED;
176
180 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = PhysicalProperties)
182
183 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = PhysicalProperties)
185
186 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = PhysicalProperties)
187 FPhysicalMaterialDamageModifier DamageModifier;
188
190 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Debugging", AdvancedDisplay)
191 FLinearColor DebugColor;
192
193 //
194 // Experimental properties
195 //
196
199 UPROPERTY(VisibleAnywhere, Transient, Category = "Experimental")
200 bool bShowExperimentalProperties = PhysicalMaterialCVars::bShowExperimentalProperties;
201
203 UPROPERTY(EditAnywhere, Category = "Experimental|Softness", meta = (EditCondition = "bShowExperimentalProperties"))
204 EPhysicalMaterialSoftCollisionMode SoftCollisionMode;
205
208 UPROPERTY(EditAnywhere, Category = "Experimental|Softness", meta = (ClampMin = 0, EditCondition = "bShowExperimentalProperties"))
209 float SoftCollisionThickness;
210
214 UPROPERTY(EditAnywhere, Category = "Experimental|Stickiness", meta = (ClampMin = 0, Units = kgcm, EditCondition = "bShowExperimentalProperties"))
215 float BaseFrictionImpulse;
216
217public:
218
220
222
223 //~ Begin UObject Interface
224#if WITH_EDITOR
225 PHYSICSCORE_API virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
227#endif // WITH_EDITOR
228 PHYSICSCORE_API virtual void PostLoad() override;
229 PHYSICSCORE_API virtual void FinishDestroy() override;
230 //~ End UObject Interface
231
232 PHYSICSCORE_API virtual void Serialize(FArchive& Ar) override;
233
235 PHYSICSCORE_API FPhysicsMaterialHandle& GetPhysicsMaterial();
236
237 static PHYSICSCORE_API void SetEngineDefaultPhysMaterial(UPhysicalMaterial* Material);
238
239 static PHYSICSCORE_API void SetEngineDefaultDestructiblePhysMaterial(UPhysicalMaterial* Material);
240
242 static PHYSICSCORE_API EPhysicalSurface DetermineSurfaceType(UPhysicalMaterial const* PhysicalMaterial);
243};
244
245
246
EPhysicalSurface
Definition ChaosEngineInterface.h:21
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
EPhysicalMaterialSoftCollisionMode
Definition PhysicalMaterial.h:87
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition Archive.h:1208
Definition ObjectMacros.h:180
Definition EnumAsByte.h:22
Definition UniquePtr.h:107
Definition Object.h:95
Definition PhysicalMaterial.h:104
FChaosUserData UserData
Definition PhysicalMaterial.h:221
TUniquePtr< FPhysicsMaterialHandle > MaterialHandle
Definition PhysicalMaterial.h:219
Definition PhysicalMaterial.cpp:17
bool bShowExperimentalProperties
Definition PhysicalMaterial.cpp:18
Definition PhysicalMaterials.h:24
Definition PhysicsInterfaceTypesCore.h:199
Definition Color.h:48
Definition PhysicalMaterial.h:66
Definition PhysicalMaterial.h:33
Definition UnrealType.h:6865
Definition ObjectPtr.h:488