Camera Component
UEstuaryCameraComponent
USceneComponent — captures an image (rendered scene or webcam), encodes it as JPEG, and sends it to the server for vision analysis. Add it to your character actor. See Vision for the full workflow.
:::caution Consent required
No frame is sent — including server-initiated captures — unless consent has been granted via SetCameraConsent(true).
:::
Methods
| Function | Returns | Description |
|---|---|---|
SetCameraConsent(bool bGranted) | void | Grant or revoke capture consent. Required before any send. |
SendCameraFrame() | bool | Capture and send the current rendered-scene frame. |
SetRenderTargetSize(int32 Width, int32 Height) | bool | Set the scene-capture resolution. |
SetCaptureSource(EEstuaryCaptureSource NewSource) | void | Switch between RenderedScene and Webcam. |
IsWebcamMode() const | bool | True when the source is webcam. |
StartWebcam(int32 DeviceIndex = 0) | bool | Open a webcam device. |
StopWebcam() | void | Close the webcam. |
SendWebcamFrame() | bool | Capture and send the current webcam frame. |
GetCharacterId() const | FString | Owning character's ID. |
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| Capture Source | EEstuaryCaptureSource | RenderedScene | Active capture source. |
| JPEG Quality | int32 | 75 | Compression quality (1–100). |
| Has User Consent | bool | false | Read-only; set via SetCameraConsent. |
| Webcam Blit Material | UMaterialInterface* | — | Material used to blit webcam frames (webcam mode). |
Example
CameraComponent->SetCameraConsent(true);
CameraComponent->SetRenderTargetSize(1280, 720);
CameraComponent->SendCameraFrame();
// Webcam
CameraComponent->SetCaptureSource(EEstuaryCaptureSource::Webcam);
CameraComponent->StartWebcam(0);
CameraComponent->SendWebcamFrame();
Bind UEstuaryCharacterComponent::OnVisionResponse to receive the streamed description, and OnCameraCaptureRequested to handle server-initiated captures. See Vision.