3 #include "CoreMinimal.h" 4 #include "Components/ActorComponent.h" 5 #include "Components/PrimitiveComponent.h" 6 #include "Components/SceneCaptureComponentCube.h" 7 #include "Engine/TextureRenderTargetCube.h" 8 #include "Engine/DataAsset.h" 9 #include "Engine/TextureCube.h" 10 #include "VRTPMobile.generated.h" 14 enum class EVRTPMBackgroundMode : uint8
16 MM_COLOR UMETA(DisplayName =
"Color"),
17 MM_SKYBOX UMETA(DisplayName =
"Skybox")
22 enum class EVRTPMMaskMode : uint8
24 MM_OFF UMETA(DisplayName =
"Off"),
25 MM_MASK UMETA(DisplayName =
"Mask"),
26 MM_WINDOW UMETA(DisplayName =
"Window"),
27 MM_PORTAL UMETA(DisplayName =
"Portal"),
31 USTRUCT(BlueprintType)
34 GENERATED_USTRUCT_BODY()
37 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"Capture")
38 TSubclassOf<class AActor> SkyboxBlueprint;
41 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture")
42 UTextureCube* CubeMapOverride;
45 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Post Process")
46 UMaterial* PostProcessMaterial;
49 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Iris")
50 UStaticMesh* IrisMesh;
53 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Effect Settings")
54 FLinearColor EffectColor;
57 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Effect Settings", meta = (ClampMin = "0.0", ClampMax = "1.0"))
61 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Effect Settings", meta = (ClampMin = "0.0", ClampMax = "10.0"))
65 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Effect Settings")
66 EVRTPMBackgroundMode BackgroundMode;
69 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Effect Settings")
70 bool ApplyEffectColor;
73 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Effect Settings")
77 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Effect Settings|Mask Settings")
78 EVRTPMMaskMode MaskMode;
81 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Effect Settings|Mask Settings", meta = (ClampMin = "0", ClampMax = "255"))
85 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Motion Settings|Angular Velocity")
86 bool bUseAngularVelocity;
89 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Motion Settings|Angular Velocity", meta = (ClampMin = "0.0", ClampMax = "10.0"))
90 float AngularStrength;
93 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Motion Settings|Angular Velocity", meta = (ClampMin = "0.0", ClampMax = "180.0"))
97 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Motion Settings|Angular Velocity", meta = (ClampMin = "0.0", ClampMax = "180.0"))
101 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Motion Settings|Angular Velocity", meta = (ClampMin = "0.0", ClampMax = "1.0"))
102 float AngularSmoothing;
105 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Motion Settings|Velocity")
109 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Motion Settings|Velocity", meta = (ClampMin = "0.0", ClampMax = "10.0"))
110 float VelocityStrength;
113 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Motion Settings|Velocity", meta = (ClampMin = "0.0", ClampMax = "1000.0"))
117 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Motion Settings|Velocity", meta = (ClampMin = "0.0", ClampMax = "1000.0"))
121 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Motion Settings|Velocity", meta = (ClampMin = "0.0", ClampMax = "1.0"))
122 float VelocitySmoothing;
125 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Motion Settings|Acceleration")
126 bool bUseAcceleration;
129 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Motion Settings|Acceleration", meta = (ClampMin = "0.0", ClampMax = "10.0"))
130 float AccelerationStrength;
133 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Motion Settings|Acceleration", meta = (ClampMin = "0.0", ClampMax = "1000.0"))
134 float AccelerationMin;
137 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Motion Settings|Acceleration", meta = (ClampMin = "0.0", ClampMax = "1000.0"))
138 float AccelerationMax;
141 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Motion Settings|Acceleration", meta = (ClampMin = "0.0", ClampMax = "1.0"))
142 float AccelerationSmoothing;
146 SkyboxBlueprint = NULL;
147 CubeMapOverride = NULL;
148 PostProcessMaterial = NULL;
150 EffectColor = FLinearColor::Black;
153 BackgroundMode = EVRTPMBackgroundMode::MM_COLOR;
154 ApplyEffectColor =
false;
156 MaskMode = EVRTPMMaskMode::MM_OFF;
158 bUseAngularVelocity =
false;
162 AngularSmoothing = 0;
163 bUseVelocity =
false;
164 VelocityStrength = 0;
167 VelocitySmoothing = 0;
168 bUseAcceleration =
false;
169 AccelerationStrength = 0;
172 AccelerationSmoothing = 0;
184 UPROPERTY(EditAnywhere)
189 UCLASS(Blueprintable, meta = (BlueprintSpawnableComponent), ClassGroup = MotionController, HideCategories = ("VRTunnellingProMobile"))
199 virtual void PreEditChange(UProperty* PropertyAboutToChange)
override;
200 virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
override;
202 virtual void OnComponentDestroyed(
bool bDestroyingHierarchy)
override;
205 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"VR Tunnelling|Effect Preset")
209 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR Tunnelling|Effect Preset")
213 UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay, Category = "VR Tunnelling")
214 TSubclassOf<class AActor> SkyboxBlueprint;
215 UPROPERTY(EditAnywhere)
216 TSubclassOf<class AActor> SkyboxBlueprintSwap;
219 UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay, Category = "VR Tunnelling")
220 UTextureCube* CubeMapOverride;
221 UPROPERTY(EditAnywhere)
222 UTextureCube* CubeMapOverrideSwap;
225 UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay, Category = "VR Tunnelling")
226 UMaterial* PostProcessMaterial;
227 UPROPERTY(EditAnywhere)
228 UMaterial* PostProcessMaterialSwap;
231 UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay, Category = "VR Tunnelling")
232 UStaticMesh* IrisMesh;
233 UPROPERTY(EditAnywhere)
234 UStaticMesh* IrisMeshSwap;
237 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Effect Settings")
238 FLinearColor EffectColor;
239 UPROPERTY(EditAnywhere)
240 FLinearColor EffectColorSwap;
243 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Effect Settings", meta = (ClampMin = "0.0", ClampMax = "1.0"))
244 float EffectCoverage;
245 UPROPERTY(EditAnywhere)
246 float EffectCoverageSwap;
249 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Effect Settings", meta = (ClampMin = "0.0", ClampMax = "10.0"))
251 UPROPERTY(EditAnywhere)
252 float EffectFeatherSwap;
255 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Effect Settings")
256 EVRTPMBackgroundMode BackgroundMode;
257 UPROPERTY(EditAnywhere)
258 EVRTPMBackgroundMode BackgroundModeSwap;
261 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Effect Settings")
262 bool ApplyEffectColor;
263 UPROPERTY(EditAnywhere)
264 bool ApplyEffectColorSwap;
267 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Effect Settings")
269 UPROPERTY(EditAnywhere)
270 bool ForceEffectSwap;
273 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Effect Settings|Mask Settings")
274 EVRTPMMaskMode MaskMode;
275 UPROPERTY(EditAnywhere)
276 EVRTPMMaskMode MaskModeSwap;
279 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Effect Settings|Mask Settings", meta = (ClampMin = "0", ClampMax = "255"))
281 UPROPERTY(EditAnywhere)
282 int32 StencilIndexSwap;
285 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Motion Settings|Angular Velocity")
286 bool bUseAngularVelocity;
287 UPROPERTY(EditAnywhere)
288 bool bUseAngularVelocitySwap;
291 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Motion Settings|Angular Velocity", meta = (ClampMin = "0.0", ClampMax = "10.0"))
292 float AngularStrength;
293 UPROPERTY(EditAnywhere)
294 float AngularStrengthSwap;
297 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Motion Settings|Angular Velocity", meta = (ClampMin = "0.0", ClampMax = "180.0"))
299 UPROPERTY(EditAnywhere)
300 float AngularMinSwap;
303 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Motion Settings|Angular Velocity", meta = (ClampMin = "0.0", ClampMax = "180.0"))
305 UPROPERTY(EditAnywhere)
306 float AngularMaxSwap;
309 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Motion Settings|Angular Velocity", meta = (ClampMin = "0.0", ClampMax = "1.0"))
310 float AngularSmoothing;
311 UPROPERTY(EditAnywhere)
312 float AngularSmoothingSwap;
315 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Motion Settings|Velocity")
317 UPROPERTY(EditAnywhere)
318 bool bUseVelocitySwap;
321 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Motion Settings|Velocity", meta = (ClampMin = "0.0", ClampMax = "10.0"))
322 float VelocityStrength;
323 UPROPERTY(EditAnywhere)
324 float VelocityStrengthSwap;
327 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Motion Settings|Velocity", meta = (ClampMin = "0.0", ClampMax = "1000.0"))
329 UPROPERTY(EditAnywhere)
330 float VelocityMinSwap;
333 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Motion Settings|Velocity", meta = (ClampMin = "0.0", ClampMax = "1000.0"))
335 UPROPERTY(EditAnywhere)
336 float VelocityMaxSwap;
339 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Motion Settings|Velocity", meta = (ClampMin = "0.0", ClampMax = "1.0"))
340 float VelocitySmoothing;
341 UPROPERTY(EditAnywhere)
342 float VelocitySmoothingSwap;
345 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Motion Settings|Acceleration")
346 bool bUseAcceleration;
347 UPROPERTY(EditAnywhere)
348 bool bUseAccelerationSwap;
351 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Motion Settings|Acceleration", meta = (ClampMin = "0.0", ClampMax = "10.0"))
352 float AccelerationStrength;
353 UPROPERTY(EditAnywhere)
354 float AccelerationStrengthSwap;
357 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Motion Settings|Acceleration", meta = (ClampMin = "0.0", ClampMax = "1000.0"))
358 float AccelerationMin;
359 UPROPERTY(EditAnywhere)
360 float AccelerationMinSwap;
363 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Motion Settings|Acceleration", meta = (ClampMin = "0.0", ClampMax = "1000.0"))
364 float AccelerationMax;
365 UPROPERTY(EditAnywhere)
366 float AccelerationMaxSwap;
369 UPROPERTY(EditAnywhere, BlueprintReadWrite, SimpleDisplay, Category = "VR Tunnelling|Motion Settings|Acceleration", meta = (ClampMin = "0.0", ClampMax = "1.0"))
370 float AccelerationSmoothing;
371 UPROPERTY(EditAnywhere)
372 float AccelerationSmoothingSwap;
374 USceneCaptureComponentCube* SceneCaptureCube;
375 UTextureRenderTargetCube* TC;
378 UMaterialInstanceDynamic* PostProcessMID;
380 UStaticMeshComponent* Iris;
381 UMaterialInstanceDynamic* IrisOuterMID;
382 UMaterialInstanceDynamic* IrisInnerMID;
386 UFUNCTION(BlueprintCallable, Category = "VR Tunnelling")
390 UFUNCTION(BlueprintCallable, Category = "VR Tunnelling")
391 void SetBackgroundMode(EVRTPMBackgroundMode NewBackgroundMode);
394 UFUNCTION(BlueprintCallable, Category = "VR Tunnelling")
395 void SetMaskMode(EVRTPMMaskMode NewMaskMode);
398 UFUNCTION(BlueprintCallable, Category = "VR Tunnelling")
399 void SetEffectColor(FLinearColor NewColor);
402 UFUNCTION(BlueprintCallable, Category = "VR Tunnelling")
403 void ApplyColor(
bool Enabled);
406 UFUNCTION(BlueprintCallable, Category = "VR Tunnelling")
407 void SetStencilMask(int32 NewStencilIndex,
bool UpdateMaskedObjects = true);
410 UFUNCTION(BlueprintCallable, Category = "VR Tunnelling")
411 void UpdateMaskedObjects();
414 UFUNCTION(BlueprintCallable, Category = "VR Tunnelling")
415 void SetFeather(
float NewFeather);
418 virtual
void BeginPlay() override;
421 virtual
void TickComponent(
float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
425 FVector LastPosition;
429 float VelocitySmoothed;
430 float AccelerationSmoothed;
432 void CacheSettings();
436 void InitFromPreset();
438 void UpdateEffectSettings();
440 void CalculateMotion(
float DeltaTime);
441 void ApplyBackgroundMode();
442 void ApplyMaskMode();
443 void ApplyStencilMasks();
Mobile preset data asset definition.
Definition: VRTPMobile.h:178
Tunnelling actor component, for mobile applications.
Definition: VRTPMobile.h:190
VRTP Mobile Preset Definition (Applied to mobile version only)
Definition: VRTPMobile.h:32