# Stage Setup

## Stage Setup

The application allows the user to set up a representation of the stage boundaries, primarily useful for aligning the virtual scene in Unreal Engine.

<figure><img src="https://3763251240-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9BAa74uZVvvtnO0Rq9Vh%2Fuploads%2Fgit-blob-0ab31ede97a7f6cf6950c3a2758379b719ee3a54%2FScreenshot%202023-11-30%20at%204.26.33%20PM.png?alt=media" alt=""><figcaption></figcaption></figure>

Controls:

<img src="https://lh7-us.googleusercontent.com/orxexJ13oLgavNfcJz0TG_YlPQD2VUvSOjIkY-iHSil9Be8nK_OsaVI4f-c55HrWszHg3TSkAiJy3LnlWRHJDuZj0OtMs7d6pMCtZRq9q2Qyvr7rIkoIeaC1IWeLjNOPCwzLJBAYEffjZb-yf5Ozqrs" alt="" data-size="line">: Cancel stage editing and return to the main screen

<img src="https://lh7-us.googleusercontent.com/C1aVirtRNcL76ou5GO9OOPs8pi6lGBkMs4U1ggGkRamhe0Wm6Ue5f-bquuDO4sRp6HIdfpnxv89m2YYom-c95xv19S88qzPdWttjgWoDXbzCK8eoGNNtIcGEtpkF1Rszj9Kd2iqDHJ34X_xXrfenERI" alt="" data-size="line">: Delete last placed point

<img src="https://lh7-us.googleusercontent.com/ZOIRFdT0HBh0ofoY3D35kKUHlVeOPY7k5V1Sg4Mabzc-vB4JzlsuPtHqL121nPM0D9oOshumYALu8qFDXnCoeVLKcJXKigiiHGS-aKpT-mauaC4xRw2IX9LNowt9JymrbCB6gaAxEL6pvWHIEufFRqA" alt="" data-size="line">: Accept current stage and return to the main screen

### How to setup a stage in the app

**Steps**:

1. Enter stage setup mode from the main screen by pressing the <img src="https://lh7-us.googleusercontent.com/p23eHQclLiszLo1Iw5ex_QkKlx-bG5uhqdJ1HlrHu2BkqOi06Cxn-b87taE1-WQ7DHMdEbH8tXppvdcz6_7S5mVC26CxnKKstk2uIic0DBvTluhA0PpSOjKjSOgAQ1E7krL5v-Rz48UV9_tbCfX6a94" alt="" data-size="line"> button in the main drawer.
2. \[Optional] Move the device around until surfaces are recognized and displayed.
3. Point the target marker at the center of the screen over the location of the first point to be placed.
4. Tap anywhere on the screen to place the point.
5. Repeat steps 3-4 until at least 3 points have been added.
6. Press the <img src="https://lh7-us.googleusercontent.com/TbkdZp-DseZECbxc3MXrChqlKFD_R7I5YvD0s8HTs0oUzmn_OjrCycWqUDam7-hDAC9K1UTbi9TYrrdf5BNRXcKz0scrHywZVxg4F--JmUQLSe-4IwNzeEqaS6nzm5xx1WKtdkF4Zd2KgOTSug9gCWs" alt="" data-size="line"> button to accept the current stage.

At any point, the <img src="https://lh7-us.googleusercontent.com/xjIgSXhidaIS4Trjy9Cn47RhtGwCQmr0TsnhxEOaZztML2cRGLhP4-6T_kc02pfSeSALxhPPD0qv-kLWCqWt62jq1GcQuu313QUGmXeLv3a4epKHGjLqaR1TBbcK7cwleJYNcBqgBxQ0cZhdi56TR9s" alt="" data-size="line"> button can be used to remove the last placed point. Additionally, the <img src="https://lh7-us.googleusercontent.com/ihdVEZ4pjjBo8QSnqowP0qCUwGQAOuZo9MCBm5id7bDg1RcU3Raf7qDHtQctlOJEVRi7Vp0rVHnoNIugwFbx6yytFY7gnsJDJ8yOmGT50emRwFhGndUM_58PiGO5G9AcbUJw8hDCmGOVLxbDWjpv3xg" alt="" data-size="line"> button can be pressed to cancel the input and return to the previously set stage (if any). Finally, pressing the <img src="https://lh7-us.googleusercontent.com/TbkdZp-DseZECbxc3MXrChqlKFD_R7I5YvD0s8HTs0oUzmn_OjrCycWqUDam7-hDAC9K1UTbi9TYrrdf5BNRXcKz0scrHywZVxg4F--JmUQLSe-4IwNzeEqaS6nzm5xx1WKtdkF4Zd2KgOTSug9gCWs" alt="" data-size="line"> button with fewer than 3 points placed will clear the stage entirely.

### Stage Options in Unreal Engine

After the stage setup in the mobile application, the parameters of the stage are transmitted to Unreal Engine and the BP\_CT\_CameraActor renders the stage outline in a bright green color.

{% embed url="<https://www.youtube.com/watch?v=ePdF_NCLIbw>" %}

In the CameraTwinStage component there are the following parameters:

* Snap Parent to Ground ([video](https://www.youtube.com/watch?v=40J6wgPp7eQ))
  * This option allows for easily setting the camera at the right level as it snaps the physical stage level to the virtual ground level, lifting the camera to the right height. This is enabled by default and can be disabled to move the Camera Actor freely.
* Ground Level ([video](https://www.youtube.com/watch?v=nUfzpMQTiLo))
  * This parameter is used to add an offset in cm for the ground level height. Default is 0 cm offset
