Struct LensSettings
Describes the FOV and clip planes for a camera. This generally mirrors the Unity Camera's lens settings, and will be used to drive the Unity camera when the vcam is active.
Inherited Members
Namespace: Cinemachine
Syntax
[DocumentationSorting(DocumentationSortingAttribute.Level.UserRef)]
public struct LensSettings
Constructors
LensSettings(Single, Single, Single, Single, Single, Boolean, Single)
Explicit constructor for this LensSettings
Declaration
public LensSettings(float fov, float orthographicSize, float nearClip, float farClip, float dutch, bool ortho, float aspect)
Parameters
Type | Name | Description |
---|---|---|
System.Single | fov | The Vertical field of view |
System.Single | orthographicSize | If orthographic, this is the half-height of the screen |
System.Single | nearClip | The near clip plane |
System.Single | farClip | The far clip plane |
System.Single | dutch | Camera roll, in degrees. This is applied at the end Whether the lens is orthographic The aspect ratio of the lens Width/height after shot composition. |
System.Boolean | ortho | |
System.Single | aspect |
Fields
Default
Default Lens Settings
Declaration
public static LensSettings Default
Field Value
Type | Description |
---|---|
LensSettings |
Dutch
The dutch (tilt) to be applied to the camera. In degrees
Declaration
public float Dutch
Field Value
Type | Description |
---|---|
System.Single |
FarClipPlane
The far clip plane for this LensSettings
Declaration
public float FarClipPlane
Field Value
Type | Description |
---|---|
System.Single |
FieldOfView
This is the camera view in vertical degrees. For cinematic people, a 50mm lens on a super-35mm sensor would equal a 19.6 degree FOV
Declaration
public float FieldOfView
Field Value
Type | Description |
---|---|
System.Single |
NearClipPlane
The near clip plane for this LensSettings
Declaration
public float NearClipPlane
Field Value
Type | Description |
---|---|
System.Single |
OrthographicSize
When using an orthographic camera, this defines the height, in world co-ordinates, of the camera view.
Declaration
public float OrthographicSize
Field Value
Type | Description |
---|---|
System.Single |
Methods
FromCamera(Camera)
Creates a new LensSettings, copying the values from the supplied Camera
Declaration
public static LensSettings FromCamera(Camera fromCamera)
Parameters
Type | Name | Description |
---|---|---|
Camera | fromCamera | The Camera from which the FoV, near and far clip planes will be copied. |
Returns
Type | Description |
---|---|
LensSettings |
Lerp(LensSettings, LensSettings, Single)
Linearly blends the fields of two LensSettings and returns the result
Declaration
public static LensSettings Lerp(LensSettings lensA, LensSettings lensB, float t)
Parameters
Type | Name | Description |
---|---|---|
LensSettings | lensA | The LensSettings to blend from |
LensSettings | lensB | The LensSettings to blend to |
System.Single | t | The interpolation value. Internally clamped to the range [0,1] |
Returns
Type | Description |
---|---|
LensSettings | Interpolated settings |
Validate()
Make sure lens settings are sane. Call this from OnValidate().
Declaration
public void Validate()