UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DecalComponent.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3
4#pragma once
5
6#include "CoreMinimal.h"
10#include "PSOPrecache.h"
11
12#include "DecalComponent.generated.h"
13
16
23UCLASS(Blueprintable, editinlinenew, hidecategories=(Collision, Object, Physics, SceneComponent, Activation, "Components|Activation", Mobility), ClassGroup=Rendering, meta=(BlueprintSpawnableComponent), MinimalAPI)
24class UDecalComponent : public USceneComponent
25{
27
30 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Decal)
32
33public:
38 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Decal)
39 int32 SortOrder;
40
41 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Decal)
42 float FadeScreenSize;
43
47 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Decal)
48 float FadeStartDelay;
49
53 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Decal)
54 float FadeDuration;
55
56 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Decal)
57 float FadeInDuration;
58
59 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Decal)
60 float FadeInStartDelay;
61
65 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Decal)
67
68 UFUNCTION(BlueprintCallable, Category = "Rendering|Components|Decal")
69 ENGINE_API float GetFadeStartDelay() const;
70
71 UFUNCTION(BlueprintCallable, Category = "Rendering|Components|Decal")
72 ENGINE_API float GetFadeDuration() const;
73
74 UFUNCTION(BlueprintCallable, Category = "Rendering|Components|Decal")
75 ENGINE_API float GetFadeInStartDelay() const;
76
77 UFUNCTION(BlueprintCallable, Category = "Rendering|Components|Decal")
78 ENGINE_API float GetFadeInDuration() const;
79
81 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Decal, meta=(AllowPreserveRatio = "true"))
83
85 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Decal)
86 FLinearColor DecalColor = FLinearColor::White;
87
97 UFUNCTION(BlueprintCallable, Category = "Rendering|Components|Decal")
98 ENGINE_API void SetFadeOut(float StartDelay, float Duration, bool DestroyOwnerAfterFade = true);
99
100 UFUNCTION(BlueprintCallable, Category = "Rendering|Components|Decal")
101 ENGINE_API void SetFadeIn(float StartDelay, float Duration);
102
104 UFUNCTION(BlueprintCallable, Category = "Rendering|Components|Decal")
106
108 UFUNCTION(BlueprintCallable, Category = "Rendering|Components|Decal")
109 ENGINE_API void SetSortOrder(int32 Value);
110
112 UFUNCTION(BlueprintCallable, Category = "Rendering|Components|Decal")
114
116 UFUNCTION(BlueprintCallable, Category="Rendering|Components|Decal")
118
120 UFUNCTION(BlueprintCallable, Category="Rendering|Components|Decal")
122
124 UFUNCTION(BlueprintCallable, Category="Rendering|Components|Decal")
125 ENGINE_API virtual class UMaterialInstanceDynamic* CreateDynamicMaterialInstance();
126
127public:
128#if UE_WITH_PSO_PRECACHING
130 std::atomic<int> LatestPSOPrecacheJobSetCompleted = 0;
132#endif
133
135 FDeferredDecalProxy* SceneProxy;
136
140 UE_DEPRECATED(5.4, "This method has no effect, calls to this method may be safely removed.")
142
146
149
150public:
151
152 ENGINE_API void SetLifeSpan(const float LifeSpan);
153
159 ENGINE_API virtual void GetUsedMaterials( TArray<UMaterialInterface*>& OutMaterials, bool bGetDebugMaterials = false ) const;
160
161 ENGINE_API virtual FDeferredDecalProxy* CreateSceneProxy();
162 virtual int32 GetNumMaterials() const
163 {
164 return 1; // DecalMaterial
165 }
166
167 virtual UMaterialInterface* GetMaterial(int32 ElementIndex) const
168 {
169 return (ElementIndex == 0) ? DecalMaterial : NULL;
170 }
171 virtual void SetMaterial(int32 ElementIndex, UMaterialInterface* InMaterial)
172 {
173 if (ElementIndex == 0)
174 {
176 }
177 }
178
179
180 //~ Begin UActorComponent Interface
181 ENGINE_API virtual void OnRegister() override;
182 ENGINE_API virtual void BeginPlay() override;
183 ENGINE_API virtual void CreateRenderState_Concurrent(FRegisterComponentContext* Context) override;
184 ENGINE_API virtual void DestroyRenderState_Concurrent() override;
185 ENGINE_API virtual void SendRenderTransform_Concurrent() override;
186 ENGINE_API virtual const UObject* AdditionalStatObject() const override;
187 ENGINE_API virtual void PrecachePSOs() override;
188#if WITH_EDITOR
189 ENGINE_API virtual void CheckForErrors() override;
190#endif
191 //~ End UActorComponent Interface
192
193 //~ Begin UObject Interface.
194 ENGINE_API virtual void Serialize(FArchive& Ar) override;
195 ENGINE_API virtual bool IsPostLoadThreadSafe() const override;
196 ENGINE_API virtual void PostLoad() override;
197 //~ End UObject Interface
198
199 //~ Begin USceneComponent Interface
200#if WITH_EDITOR
201 ENGINE_API virtual bool GetMaterialPropertyPath(int32 ElementIndex, UObject*& OutOwner, FString& OutPropertyPath, FProperty*& OutProperty) override;
202#endif // WITH_EDITOR
203 ENGINE_API virtual FBoxSphereBounds CalcBounds(const FTransform& LocalToWorld) const override;
204 //~ End USceneComponent Interface
205
207 {
208 FTransform Ret = GetComponentToWorld();
209 Ret.SetScale3D(Ret.GetScale3D() * DecalSize);
210
211 return Ret;
212 }
213};
214
#define NULL
Definition oodle2base.h:134
virtual bool IsPostLoadThreadSafe() const override
#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
return true
Definition ExternalRpcRegistry.cpp:601
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition Archive.h:1208
Definition DeferredDecalProxy.h:16
Definition UnrealType.h:174
Definition ActorComponent.h:47
Definition Array.h:670
Definition MaterialInstanceDynamic.h:15
Definition MaterialInterface.h:296
Definition Object.h:95
ENGINE_API FBox CalcBounds(const FVector &P0, const FVector &P1, const FVector &P2, const FVector &P3)
Definition BezierUtilities.cpp:26
@ false
Definition radaudio_common.h:23
Definition Color.h:48
Definition TimerHandle.h:12
Definition ObjectPtr.h:488
Definition BoxSphereBounds.h:25
void SetScale3D(const TVector< T > &NewScale3D)
Definition TransformNonVectorized.h:874
TVector< T > GetScale3D() const
Definition TransformNonVectorized.h:1131