> ## Documentation Index
> Fetch the complete documentation index at: https://docs.liv.tv/llms.txt
> Use this file to discover all available pages before exploring further.

# Camera Modes

> How to configure and switch between selfie, first person, and third person camera modes in the LIV Camera Kit (LCK) tablet interface for Unreal Engine, including custom camera mode creation.

## Overview

LCKTablet includes three built-in camera modes, each derived from `ULCKBaseCameraMode`. Camera modes control how the scene capture component is positioned and oriented relative to the player.

## ULCKBaseCameraMode

Abstract base class for camera mode implementations.

```cpp theme={null}
UCLASS(Abstract)
class LCKTABLET_API ULCKBaseCameraMode : public UActorComponent
{
    GENERATED_BODY()

public:
    virtual void ActivateMode(UCameraComponent* Camera);
    virtual void DeactivateMode(UCameraComponent* Camera);
    virtual void SetSmoothness(float Smoothness);
    virtual void SetDistance(float Distance);
    virtual void SetCameraRoot(USceneComponent* Root);
    virtual void SetSpringArm(USpringArmComponent* Arm);
};
```

***

## Selfie Camera Mode

Front-facing camera with optional follow mode that tracks tablet orientation.

<Tabs>
  <Tab title="Features">
    * **Follow Mode** — Camera follows tablet orientation smoothly
    * **Front/Rear Toggle** — Switch between selfie and outward-facing
    * **Adjustable FOV** — Customize field of view
    * **Smoothness Control** — Adjust camera movement smoothing
  </Tab>

  <Tab title="Settings">
    | Setting                | Type               | Description              |
    | ---------------------- | ------------------ | ------------------------ |
    | `SelfieFOV`            | `float`            | Field of view (60-120)   |
    | `SelfieSmoothness`     | `float`            | Movement smoothing (0-1) |
    | `SelfieIsFollowing`    | `bool`             | Enable follow mode       |
    | `SelfieFollowDistance` | `float`            | Distance in follow mode  |
    | `SelfieCameraFacing`   | `ELCKCameraFacing` | Front or Rear            |
  </Tab>

  <Tab title="Code">
    ```cpp theme={null}
    // Via data model
    ULCKTabletDataModel* Model = Tablet->GetDataModel();

    // Adjust FOV (direction: -1 decrease, +1 increase)
    Model->SetSelfieFOV(1);

    // Toggle follow mode
    Model->ToggleSelfieIsFollowing();

    // Toggle front/rear
    Model->ToggleSelfieCameraFacing();

    // Set smoothness
    Model->SetSelfieSmoothness(1);

    // Subscribe to changes
    Model->OnSelfieFOVChanged.AddLambda([](float NewFOV) {
        UE_LOG(LogTemp, Log, TEXT("Selfie FOV: %.1f"), NewFOV);
    });
    ```
  </Tab>
</Tabs>

***

## First Person Camera Mode

Point-of-view camera attached to the player's view for immersive capture.

<Tabs>
  <Tab title="Features">
    * **Direct POV** — Captures exactly what the player sees
    * **Adjustable FOV** — Match or differ from player FOV
    * **Smooth Movement** — Configurable smoothing for stability
  </Tab>

  <Tab title="Settings">
    | Setting                 | Type    | Description              |
    | ----------------------- | ------- | ------------------------ |
    | `FirstPersonFOV`        | `float` | Field of view (60-120)   |
    | `FirstPersonSmoothness` | `float` | Movement smoothing (0-1) |
  </Tab>

  <Tab title="Code">
    ```cpp theme={null}
    ULCKTabletDataModel* Model = Tablet->GetDataModel();

    // Adjust FOV
    Model->SetFirstPersonFOV(1);  // +1 to increase

    // Adjust smoothness
    Model->SetFirstPersonSmoothness(-1);  // -1 to decrease

    // Subscribe to changes
    Model->OnFirstPersonFOVChanged.AddLambda([](float NewFOV) {
        UE_LOG(LogTemp, Log, TEXT("First Person FOV: %.1f"), NewFOV);
    });
    ```
  </Tab>
</Tabs>

***

## Third Person Camera Mode

Behind-player camera with adjustable distance for action shots.

<Tabs>
  <Tab title="Features">
    * **Adjustable Distance** — Control camera distance from player
    * **Front/Back Toggle** — Position camera in front or behind
    * **FOV Control** — Customize field of view
    * **Smooth Follow** — Configurable smoothing
  </Tab>

  <Tab title="Settings">
    | Setting                 | Type    | Description                 |
    | ----------------------- | ------- | --------------------------- |
    | `ThirdPersonFOV`        | `float` | Field of view (60-120)      |
    | `ThirdPersonSmoothness` | `float` | Movement smoothing (0-1)    |
    | `ThirdPersonDistance`   | `float` | Distance from player        |
    | `bThirdPersonIsFront`   | `bool`  | Position in front of player |
  </Tab>

  <Tab title="Code">
    ```cpp theme={null}
    ULCKTabletDataModel* Model = Tablet->GetDataModel();

    // Adjust distance
    Model->SetThirdPersonDistance(1);  // +1 to increase

    // Toggle front/back position
    Model->ToggleThirdPersonIsFront();

    // Subscribe to changes
    Model->OnThirdPersonDistanceChanged.AddLambda([](float NewDistance) {
        UE_LOG(LogTemp, Log, TEXT("Third Person Distance: %.1f"), NewDistance);
    });
    ```
  </Tab>
</Tabs>

***

## Switching Camera Modes

```cpp theme={null}
ULCKTabletDataModel* Model = Tablet->GetDataModel();

// Switch to a camera mode
Model->SetCameraMode(ULCKSelfieCameraMode::StaticClass());
Model->SetCameraMode(ULCKFirstPersonCameraMode::StaticClass());
Model->SetCameraMode(ULCKThirdPersonCameraMode::StaticClass());

// Subscribe to mode changes
Model->OnTabletCameraModeChanged.AddLambda([](UClass* NewModeClass) {
    UE_LOG(LogTemp, Log, TEXT("Camera mode changed to: %s"), *NewModeClass->GetName());
});
```

***

## Creating Custom Camera Modes

<Steps>
  <Step title="Create Subclass">
    Create a new class derived from `ULCKBaseCameraMode`:

    ```cpp theme={null}
    UCLASS()
    class UMyCustomCameraMode : public ULCKBaseCameraMode
    {
        GENERATED_BODY()

    public:
        virtual void ActivateMode(UCameraComponent* Camera) override;
        virtual void DeactivateMode(UCameraComponent* Camera) override;
    };
    ```
  </Step>

  <Step title="Implement Activation">
    ```cpp theme={null}
    void UMyCustomCameraMode::ActivateMode(UCameraComponent* Camera)
    {
        Super::ActivateMode(Camera);

        // Configure camera for this mode
        Camera->SetFieldOfView(90.0f);

        // Set up any custom behavior
    }

    void UMyCustomCameraMode::DeactivateMode(UCameraComponent* Camera)
    {
        // Clean up custom behavior

        Super::DeactivateMode(Camera);
    }
    ```
  </Step>

  <Step title="Register with Tablet">
    Add your custom camera mode component to the tablet actor and register it in the mode selection UI.
  </Step>
</Steps>

***

## Camera Mode Delegates

| Delegate                              | Description                     |
| ------------------------------------- | ------------------------------- |
| `OnTabletCameraModeChanged`           | Camera mode class changed       |
| `OnSelfieFOVChanged`                  | Selfie FOV value changed        |
| `OnSelfieSmoothnessChanged`           | Selfie smoothness changed       |
| `OnSelfieIsFollowingChanged`          | Follow mode toggled             |
| `OnSelfieFollowDistanceChanged`       | Follow distance changed         |
| `OnSelfieCameraFacingChanged`         | Front/rear changed              |
| `OnFirstPersonFOVChanged`             | First person FOV changed        |
| `OnFirstPersonSmoothnessChanged`      | First person smoothness changed |
| `OnThirdPersonFOVChanged`             | Third person FOV changed        |
| `OnThirdPersonSmoothnessChanged`      | Third person smoothness changed |
| `OnThirdPersonDistanceChanged`        | Third person distance changed   |
| `OnThirdPersonIsFrontPositionChanged` | Front/back position changed     |

<Tip>
  All camera mode delegates broadcast the new value when changed, making it easy to sync UI elements with current settings.
</Tip>
