ALimenSceneCaptureMirror
Overview
ALimenSceneCaptureMirror is a subclass of ALimenGameplayActor. It captures the scene using a USceneCaptureComponent2D and renders it onto a static mesh component, simulating a mirror. The actor adjusts its position and rotation based on the player's camera to create an illusion of reflection.
Properties
Type | Name | Access | Description |
|---|---|---|---|
TObjectPtr | SceneCapture | EditDefaultsOnly, BlueprintReadOnly | The scene capture component used to render the scene. |
TObjectPtr | SceneCapturePivot | EditDefaultsOnly, BlueprintReadOnly | A pivot component for positioning and rotating the scene capture relative to the mirror mesh. |
TObjectPtr | MirrorMesh | EditDefaultsOnly, BlueprintReadOnly | The static mesh component that displays the captured scene as a mirror. |
FName | RenderTargetMaterialParameterName | EditAnywhere, BlueprintReadOnly | The name of the material parameter used to set the render target texture in the mirror's material. |
float | ClipPlaneOffset | EditAnywhere, BlueprintReadOnly | The offset for the clipping plane, which determines where the reflection starts. |
Functions
Return Type | Signature | Description |
|---|---|---|
void | BeginPlay() | Initializes the scene capture component and sets up the initial material parameter value. |
void | Tick(float DeltaTime) | Updates the scene capture's position and rotation based on the player's camera, adjusts the clipping plane, and resizes the render target when necessary. |
Usage & Implementation Notes
The actor uses a
USceneCaptureComponent2Dto capture the scene and renders it onto a static mesh component.The mirror's material should have a parameter named "Texture" that is set to the render target texture captured by the scene capture component.
The clipping plane is used to simulate the reflection effect, starting from a specified offset.
The actor adjusts its position and rotation based on the player's camera to ensure the reflection appears correct.