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.
Namespace: Cinemachine
Syntax
[Serializable]
[DocumentationSorting(DocumentationSortingAttribute.Level.UserRef)]
public struct LensSettings
Constructors
LensSettings(Single, Single, Single, Single, Single)
Explicit constructor for this LensSettings
Declaration
public LensSettings(float fov, float orthographicSize, float nearClip, float farClip, float dutch)
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 after shot composition. |
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 |
LensShift
For physical cameras only: position of the gate relative to the film back
Declaration
public Vector2 LensShift
Field Value
Type | Description |
---|---|
Vector2 |
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 |
Properties
Aspect
Sensor aspect, not screen aspect. For nonphysical cameras, this is the same thing.
Declaration
public float Aspect { get; }
Property Value
Type | Description |
---|---|
System.Single |
IsPhysicalCamera
This is set every frame by the virtual camera, based on the value found in the currently associated Unity camera
Declaration
public bool IsPhysicalCamera { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Orthographic
This is set every frame by the virtual camera, based on the value found in the currently associated Unity camera
Declaration
public bool Orthographic { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
SensorSize
This is set every frame by the virtual camera, based on the value found in the currently associated Unity camera
Declaration
public Vector2 SensorSize { get; set; }
Property Value
Type | Description |
---|---|
Vector2 |
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 |
SnapshotCameraReadOnlyProperties(Camera)
Snapshot the properties that are read-only in the Camera
Declaration
public void SnapshotCameraReadOnlyProperties(Camera camera)
Parameters
Type | Name | Description |
---|---|---|
Camera | camera | The Camera from which we will take the info |
SnapshotCameraReadOnlyProperties(ref LensSettings)
Snapshot the properties that are read-only in the Camera
Declaration
public void SnapshotCameraReadOnlyProperties(ref LensSettings lens)
Parameters
Type | Name | Description |
---|---|---|
LensSettings | lens | The LensSettings from which we will take the info |
Validate()
Make sure lens settings are sane. Call this from OnValidate().
Declaration
public void Validate()