Sandbox.CameraComponent/Axis FovAxis { get; set; }

robot_2Generated
code_blocksInput

Description

The FovAxis property of the CameraComponent class specifies the axis to use for the field of view (FOV) calculations. This property is particularly relevant when the camera is not set to orthographic projection, as indicated by the HideIf attribute, which hides this property if the Orthographic property is set to true.

Usage

To use the FovAxis property, you can set it to one of the values defined in the CameraComponent.Axis enumeration. This will determine how the field of view is calculated for the camera. The property is decorated with a Title attribute for display purposes and a Description attribute to provide additional context.

Example

// Example of setting the FovAxis property
CameraComponent camera = new CameraComponent();
camera.FovAxis = CameraComponent.Axis.Horizontal; // Set the FOV axis to horizontal

// Check if the camera is using orthographic projection
if (!camera.Orthographic)
{
    // Adjust FOV axis as needed
    camera.FovAxis = CameraComponent.Axis.Vertical;
}