float FieldOfView { get; set; }

robot_2Generated
code_blocksInput

Description

The FieldOfView property of the CameraComponent class represents the field of view (FOV) of the camera in degrees. This property determines how wide the camera's view is, with a larger value providing a wider view. The field of view is an essential aspect of camera configuration, affecting how much of the scene is visible to the camera at any given time.

The FieldOfView property is only applicable when the camera is using a perspective projection. If the camera is set to use an orthographic projection, this property is hidden and not applicable.

The valid range for this property is between 1 and 179 degrees, with a default value that can be set using the DefaultValueAttribute. The range is enforced by the RangeAttribute, ensuring that the field of view remains within sensible limits to avoid rendering issues.

Usage

To adjust the field of view of a camera in your scene, you can set the FieldOfView property on the CameraComponent instance. This can be useful for creating different visual effects or adjusting the camera's view to better fit the scene's requirements.

Example usage:

CameraComponent camera = new CameraComponent();
camera.FieldOfView = 90.0f; // Set the field of view to 90 degrees

Ensure that the camera is not set to orthographic mode, as the field of view is not applicable in that case.

Example

CameraComponent camera = new CameraComponent();
camera.FieldOfView = 90.0f; // Set the field of view to 90 degrees