CameraComponent Camera { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Camera property of the SceneRenderingWidget class specifies the camera component used for rendering the scene. If this property is set to null, the rendering will default to using the camera associated with the Scene property.

Usage

To use the Camera property, you can assign a CameraComponent instance to it. This will determine the perspective from which the scene is rendered. If you do not explicitly set this property, ensure that the Scene property has a valid camera to avoid rendering issues.

Example

// Example of setting the Camera property
var sceneWidget = new Editor.SceneRenderingWidget();
var cameraComponent = new CameraComponent();

// Assign the camera component to the SceneRenderingWidget
sceneWidget.Camera = cameraComponent;

// If Camera is null, it will fallback to Scene.Camera
sceneWidget.Camera = null; // This will use the Scene's camera for rendering