UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
StereoLayerComponent.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
8#include "IStereoLayers.h"
9#include "StereoLayerComponent.generated.h"
10
11class UTexture;
12
14UENUM()
16{
18 SLT_WorldLocked UMETA(DisplayName = "World Locked"),
19
21 SLT_TrackerLocked UMETA(DisplayName = "Tracker Locked"),
22
24 SLT_FaceLocked UMETA(DisplayName = "Face Locked"),
25
27};
28
30UENUM()
32{
34 SLSH_QuadLayer UMETA(DisplayName = "Quad Layer"),
35
37 SLSH_CylinderLayer UMETA(DisplayName = "Cylinder Layer"),
38
40 SLSH_CubemapLayer UMETA(DisplayName = "Cubemap Layer"),
41
43 SLSH_EquirectLayer UMETA(DisplayName = "Equirect Layer"),
44
46};
47
48UCLASS()
50{
52
53public:
54 UFUNCTION()
55 static TArray<FName> GetFlagNames();
56};
57
58UCLASS(EditInlineNew, Abstract, BlueprintType, CollapseCategories, MinimalAPI)
60{
62
63public:
64 ENGINE_API virtual void ApplyShape(IStereoLayers::FLayerDesc& LayerDesc);
65#if WITH_EDITOR
66 ENGINE_API virtual void DrawShapeVisualization(const class FSceneView* View, class FPrimitiveDrawInterface* PDI);
67#endif
68
69protected:
70 ENGINE_API void MarkStereoLayerDirty();
71};
72
73UCLASS(meta = (DisplayName = "Quad Layer"), MinimalAPI)
75{
77public:
78 ENGINE_API virtual void ApplyShape(IStereoLayers::FLayerDesc& LayerDesc) override;
79#if WITH_EDITOR
80 ENGINE_API virtual void DrawShapeVisualization(const class FSceneView* View, class FPrimitiveDrawInterface* PDI) override;
81#endif
82};
83
84UCLASS(meta = (DisplayName = "Cylinder Layer"), MinimalAPI)
86{
88
89public:
91 : Radius(100)
92 , OverlayArc(100)
93 , Height(50)
94 {}
95
97 UPROPERTY(EditAnywhere, BlueprintReadOnly, export, Category = "Cylinder Properties")
98 float Radius;
99
101 UPROPERTY(EditAnywhere, BlueprintReadOnly, export, Category = "Cylinder Properties")
102 float OverlayArc;
103
105 UPROPERTY(EditAnywhere, BlueprintReadOnly, export, Category = "Cylinder Properties")
106 int Height;
107
108 UFUNCTION(BlueprintCallable, Category = "Components|Stereo Layer")
109 ENGINE_API void SetRadius(float InRadius);
110 UFUNCTION(BlueprintCallable, Category = "Components|Stereo Layer")
111 ENGINE_API void SetOverlayArc(float InOverlayArc);
112 UFUNCTION(BlueprintCallable, Category = "Components|Stereo Layer")
113 ENGINE_API void SetHeight(int InHeight);
114
115 ENGINE_API virtual void ApplyShape(IStereoLayers::FLayerDesc& LayerDesc) override;
116#if WITH_EDITOR
117 ENGINE_API virtual void DrawShapeVisualization(const class FSceneView* View, class FPrimitiveDrawInterface* PDI) override;
118#endif
119};
120
121UCLASS(meta = (DisplayName = "Cubemap Layer"), MinimalAPI)
123{
125public:
126 ENGINE_API virtual void ApplyShape(IStereoLayers::FLayerDesc& LayerDesc) override;
127};
128
130USTRUCT(BlueprintType)
132{
134public:
135
136 UPROPERTY(EditAnywhere, BlueprintReadOnly, export, Category = "StereoLayer | Equirect Layer Properties")
138 FBox2D LeftUVRect;
139
140 UPROPERTY(EditAnywhere, BlueprintReadOnly, export, Category = "StereoLayer | Equirect Layer Properties")
142 FBox2D RightUVRect;
143
144 UPROPERTY(EditAnywhere, BlueprintReadOnly, export, Category = "StereoLayer | Equirect Layer Properties")
146 FVector2D LeftScale;
147
148 UPROPERTY(EditAnywhere, BlueprintReadOnly, export, Category = "StereoLayer | Equirect Layer Properties")
150 FVector2D RightScale;
151
152 UPROPERTY(EditAnywhere, BlueprintReadOnly, export, Category = "StereoLayer | Equirect Layer Properties")
154 FVector2D LeftBias;
155
156 UPROPERTY(EditAnywhere, BlueprintReadOnly, export, Category = "StereoLayer | Equirect Layer Properties")
158 FVector2D RightBias;
159
160 UPROPERTY(EditAnywhere, BlueprintReadOnly, export, Category = "StereoLayer | Equirect Layer Properties")
162 float Radius;
163
164public:
165
167 : LeftUVRect(FBox2D(FVector2D(0.0f, 0.0f), FVector2D(1.0f, 1.0f)))
168 , RightUVRect(FBox2D(FVector2D(0.0f, 0.0f), FVector2D(1.0f, 1.0f)))
169 , LeftScale(FVector2D(1.0f, 1.0f))
170 , RightScale(FVector2D(1.0f, 1.0f))
171 , LeftBias(FVector2D(0.0f, 0.0f))
172 , RightBias(FVector2D(0.0f, 0.0f))
173 , Radius(0.0f)
174 {}
175
177 : LeftUVRect(InLeftUVRect)
178 , RightUVRect(InRightUVRect)
179 , LeftScale(InLeftScale)
180 , RightScale(InRightScale)
181 , LeftBias(InLeftBias)
182 , RightBias(InRightBias)
183 , Radius(Radius)
184 { }
185
192 bool operator==(const FEquirectProps& Other) const;
193
200 bool operator==(const class UStereoLayerShapeEquirect& Other) const;
201};
202
203UCLASS(meta = (DisplayName = "Equirect Layer"), MinimalAPI)
205{
207
208public:
210 : LeftUVRect(FBox2D(FVector2D(0.0f, 0.0f), FVector2D(1.0f, 1.0f)))
211 , RightUVRect(FBox2D(FVector2D(0.0f, 0.0f), FVector2D(1.0f, 1.0f)))
212 , LeftScale(FVector2D(1.0f, 1.0f))
213 , RightScale(FVector2D(1.0f, 1.0f))
214 , LeftBias(FVector2D(0.0f, 0.0f))
215 , RightBias(FVector2D(0.0f, 0.0f))
216 , Radius(0.0)
217 {}
218
219 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Equirect Properties")
221 FBox2D LeftUVRect;
222
223 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Equirect Properties")
225 FBox2D RightUVRect;
226
227 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Equirect Properties")
229 FVector2D LeftScale;
230
231 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Equirect Properties")
233 FVector2D RightScale;
234
235 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Equirect Properties")
237 FVector2D LeftBias;
238
239 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Equirect Properties")
241 FVector2D RightBias;
242
243 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Equirect Properties")
245 float Radius;
246
255 UFUNCTION(BlueprintCallable, Category = "Components|Stereo Layer")
256 ENGINE_API void SetEquirectProps(FEquirectProps InScaleBiases);
257
258 ENGINE_API virtual void ApplyShape(IStereoLayers::FLayerDesc& LayerDesc) override;
259#if WITH_EDITOR
260 ENGINE_API virtual void DrawShapeVisualization(const class FSceneView* View, class FPrimitiveDrawInterface* PDI) override;
261#endif
262};
263
267UCLASS(ClassGroup="HeadMountedDisplay", hidecategories=(Object,LOD,Lighting,TextureStreaming), editinlinenew, meta=(DisplayName="Stereo Layer", BlueprintSpawnableComponent), MinimalAPI)
268class UStereoLayerComponent : public USceneComponent
269{
272
273public:
274
275 //~ Begin UObject Interface
276 ENGINE_API virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
277 ENGINE_API virtual void OnUnregister() override;
279 //~ End UObject Interface
280
281 //~ Begin UActorComponent Interface
282 ENGINE_API virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override;
283 //~ End UActorComponent Interface
284
291 UFUNCTION(BlueprintCallable, Category="Components|Stereo Layer")
292 ENGINE_API void SetTexture(UTexture* InTexture);
293
298 UFUNCTION(BlueprintCallable, Category="Components|Stereo Layer")
300
301 // @return the texture mapped to the stereo layer.
302 UFUNCTION(BlueprintCallable, Category="Components|Stereo Layer")
303 UTexture* GetTexture() const { return Texture; }
304
305 // @return the texture mapped to the stereo layer for left eye, if stereoscopic layer textures are supported on the platform.
306 UFUNCTION(BlueprintCallable, Category = "Components|Stereo Layer")
307 UTexture* GetLeftTexture() const { return LeftTexture; }
308
313 UFUNCTION(BlueprintCallable, Category="Components|Stereo Layer")
315
316 // @return the height and width of the rendered quad
317 UFUNCTION(BlueprintCallable, Category="Components|Stereo Layer")
318 FVector2D GetQuadSize() const { return QuadSize; }
319
324 UFUNCTION(BlueprintCallable, Category="Components|Stereo Layer")
326
327 // @return the UV coordinates mapped to the quad face
328 UFUNCTION(BlueprintCallable, Category="Components|Stereo Layer")
329 FBox2D GetUVRect() const { return UVRect; }
330
339 UFUNCTION(BlueprintCallable, Category = "Components|Stereo Layer", meta = (DeprecatedFunction, DeprecationMessage = "Use UStereoLayerShapeEquirect::SetEquirectProps() instead."))
340 ENGINE_API void SetEquirectProps(FEquirectProps InEquirectProps);
341
346 UFUNCTION(BlueprintCallable, Category="Components|Stereo Layer")
347 ENGINE_API void SetPriority(int32 InPriority);
348
349 // @return the render priority
350 UFUNCTION(BlueprintCallable, Category="Components|Stereo Layer")
351 int32 GetPriority() const { return Priority; }
352
353 // Manually mark the stereo layer texture for updating
354 UFUNCTION(BlueprintCallable, Category="Components|Stereo Layer")
355 ENGINE_API void MarkTextureForUpdate();
356
358 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= "StereoLayer")
360
362 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "StereoLayer")
364
366 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= "StereoLayer")
368
369 ENGINE_API void MarkStereoLayerDirty();
372 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category= "StereoLayer")
374
376 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Stereoscopic Properties")
377 TObjectPtr<class UTexture> LeftTexture;
378
379public:
381 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "StereoLayer")
383
385 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "StereoLayer", Meta=(GetOptions= "EditorFlagCollector.GetFlagNames"))
387
390 UPROPERTY(EditAnywhere, BlueprintReadOnly, export, Category="StereoLayer")
391 FVector2D QuadSize;
392
394 UPROPERTY(EditAnywhere, BlueprintReadOnly, export, Category="StereoLayer")
395 FBox2D UVRect;
396
398 UPROPERTY(EditAnywhere, BlueprintReadOnly, export, Category="StereoLayer")
400
402 UPROPERTY(EditAnywhere, BlueprintReadOnly, NoClear, Instanced, Category = "StereoLayer", DisplayName="Stereo Layer Shape")
404
405
407 UPROPERTY(EditAnywhere, BlueprintReadOnly, export, Category= "StereoLayer")
409
411 uint32 LayerId;
412
413private:
415 bool bIsDirty;
416
419
422
424 bool bLastVisible;
425};
426
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
ELevelTick
Definition EngineBaseTypes.h:70
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#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
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
EStereoLayerShape
Definition StereoLayerComponent.h:32
@ UMETA
Definition StereoLayerComponent.h:18
@ SLSH_MAX
Definition StereoLayerComponent.h:45
EStereoLayerType
Definition StereoLayerComponent.h:16
@ SLT_MAX
Definition StereoLayerComponent.h:26
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition NameTypes.h:617
Definition PrimitiveDrawInterface.h:19
Definition SceneView.h:1425
Definition IStereoLayers.h:18
Definition Array.h:670
Definition EnumAsByte.h:22
Definition StereoLayerComponent.h:50
Definition Object.h:95
Definition StereoLayerComponent.h:123
Definition StereoLayerComponent.h:86
UStereoLayerShapeCylinder()
Definition StereoLayerComponent.h:90
Definition StereoLayerComponent.h:205
UStereoLayerShapeEquirect()
Definition StereoLayerComponent.h:209
Definition StereoLayerComponent.h:75
Definition StereoLayerComponent.h:60
Definition Texture.h:1219
Definition EngineTypes.h:3429
Definition EngineBaseTypes.h:571
Definition StereoLayerComponent.h:132
FEquirectProps(FBox2D InLeftUVRect, FBox2D InRightUVRect, FVector2D InLeftScale, FVector2D InRightScale, FVector2D InLeftBias, FVector2D InRightBias, float Radius)
Definition StereoLayerComponent.h:176
Definition IStereoLayers.h:92
Definition ObjectPtr.h:488