Show / Hide Table of Contents

Class Camera

Inheritance
Object
Object
Component
Behaviour
Camera
Inherited Members
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.transform
Component.gameObject
Component.GetComponent(Type)
Component.GetComponent<T>()
Component.GetComponent(String)
Component.GetComponentInChildren(Type, Boolean)
Component.GetComponentInChildren(Type)
Component.GetComponentInChildren<T>(Boolean)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren(Type, Boolean)
Component.GetComponentsInChildren(Type)
Component.GetComponentsInChildren<T>(Boolean)
Component.GetComponentsInChildren<T>(Boolean, List<T>)
Component.GetComponentsInChildren<T>()
Component.GetComponentsInChildren<T>(List<T>)
Component.GetComponentInParent(Type)
Component.GetComponentInParent<T>()
Component.GetComponentsInParent(Type, Boolean)
Component.GetComponentsInParent(Type)
Component.GetComponentsInParent<T>(Boolean)
Component.GetComponentsInParent<T>(Boolean, List<T>)
Component.GetComponentsInParent<T>()
Component.GetComponents(Type)
Component.GetComponents(Type, List<Component>)
Component.GetComponents<T>(List<T>)
Component.tag
Component.GetComponents<T>()
Component.CompareTag(String)
Component.SendMessageUpwards(String, Object, SendMessageOptions)
Component.SendMessageUpwards(String, Object)
Component.SendMessageUpwards(String)
Component.SendMessageUpwards(String, SendMessageOptions)
Component.SendMessage(String, Object)
Component.SendMessage(String)
Component.SendMessage(String, Object, SendMessageOptions)
Component.SendMessage(String, SendMessageOptions)
Component.BroadcastMessage(String, Object, SendMessageOptions)
Component.BroadcastMessage(String, Object)
Component.BroadcastMessage(String)
Component.BroadcastMessage(String, SendMessageOptions)
Object.GetInstanceID()
Object.GetHashCode()
Object.Equals(Object)
Object.name
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Transform)
Object.Instantiate(Object, Transform, Boolean)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Instantiate<T>(T, Transform, Boolean)
Object.Destroy(Object, Single)
Object.Destroy(Object)
Object.DestroyImmediate(Object, Boolean)
Object.DestroyImmediate(Object)
Object.FindObjectsOfType(Type)
Object.DontDestroyOnLoad(Object)
Object.hideFlags
Object.DestroyObject(Object, Single)
Object.DestroyObject(Object)
Object.FindSceneObjectsOfType(Type)
Object.FindObjectsOfTypeIncludingAssets(Type)
Object.FindObjectsOfType<T>()
Object.FindObjectOfType<T>()
Object.FindObjectsOfTypeAll(Type)
Object.FindObjectOfType(Type)
Object.ToString()
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetType()
Object.MemberwiseClone()
Namespace: UnityEngine
Assembly: UnityEngine.dll
Syntax
[RequireComponent(typeof(Transform))]
public sealed class Camera : Behaviour

Fields

| Improve this Doc View Source

onPostRender

Declaration
public static Camera.CameraCallback onPostRender
Field Value
Type Description
Camera.CameraCallback
| Improve this Doc View Source

onPreCull

Declaration
public static Camera.CameraCallback onPreCull
Field Value
Type Description
Camera.CameraCallback
| Improve this Doc View Source

onPreRender

Declaration
public static Camera.CameraCallback onPreRender
Field Value
Type Description
Camera.CameraCallback

Properties

activeTexture

Declaration
public RenderTexture activeTexture { get; }
Property Value
Type Description
RenderTexture

actualRenderingPath

Declaration
public RenderingPath actualRenderingPath { get; }
Property Value
Type Description
RenderingPath
| Improve this Doc View Source

allCameras

Declaration
public static Camera[] allCameras { get; }
Property Value
Type Description
Camera[]
| Improve this Doc View Source

allCamerasCount

Declaration
public static int allCamerasCount { get; }
Property Value
Type Description
Int32

allowDynamicResolution

Declaration
public bool allowDynamicResolution { get; set; }
Property Value
Type Description
Boolean

allowHDR

Declaration
public bool allowHDR { get; set; }
Property Value
Type Description
Boolean

allowMSAA

Declaration
public bool allowMSAA { get; set; }
Property Value
Type Description
Boolean

areVRStereoViewMatricesWithinSingleCullTolerance

Declaration
public bool areVRStereoViewMatricesWithinSingleCullTolerance { get; }
Property Value
Type Description
Boolean

aspect

Declaration
public float aspect { get; set; }
Property Value
Type Description
Single

backgroundColor

Declaration
public Color backgroundColor { get; set; }
Property Value
Type Description
Color

cameraToWorldMatrix

Declaration
public Matrix4x4 cameraToWorldMatrix { get; }
Property Value
Type Description
Matrix4x4

cameraType

Declaration
public CameraType cameraType { get; set; }
Property Value
Type Description
CameraType

clearFlags

Declaration
public CameraClearFlags clearFlags { get; set; }
Property Value
Type Description
CameraClearFlags

clearStencilAfterLightingPass

Declaration
public bool clearStencilAfterLightingPass { get; set; }
Property Value
Type Description
Boolean

commandBufferCount

Declaration
public int commandBufferCount { get; }
Property Value
Type Description
Int32

cullingMask

Declaration
public int cullingMask { get; set; }
Property Value
Type Description
Int32

cullingMatrix

Declaration
public Matrix4x4 cullingMatrix { get; set; }
Property Value
Type Description
Matrix4x4

current

Declaration
public static Camera current { get; }
Property Value
Type Description
Camera

depth

Declaration
public float depth { get; set; }
Property Value
Type Description
Single

depthTextureMode

Declaration
public DepthTextureMode depthTextureMode { get; set; }
Property Value
Type Description
DepthTextureMode

eventMask

Declaration
public int eventMask { get; set; }
Property Value
Type Description
Int32

farClipPlane

Declaration
public float farClipPlane { get; set; }
Property Value
Type Description
Single

fieldOfView

Declaration
public float fieldOfView { get; set; }
Property Value
Type Description
Single

focalLength

Declaration
public float focalLength { get; set; }
Property Value
Type Description
Single

forceIntoRenderTexture

Declaration
public bool forceIntoRenderTexture { get; set; }
Property Value
Type Description
Boolean

gateFit

Declaration
public Camera.GateFitMode gateFit { get; set; }
Property Value
Type Description
Camera.GateFitMode
| Improve this Doc View Source

layerCullDistances

Declaration
public float[] layerCullDistances { get; set; }
Property Value
Type Description
Single[]

layerCullSpherical

Declaration
public bool layerCullSpherical { get; set; }
Property Value
Type Description
Boolean

lensShift

Declaration
public Vector2 lensShift { get; set; }
Property Value
Type Description
Vector2

main

Declaration
public static Camera main { get; }
Property Value
Type Description
Camera

nearClipPlane

Declaration
public float nearClipPlane { get; set; }
Property Value
Type Description
Single

nonJitteredProjectionMatrix

Declaration
public Matrix4x4 nonJitteredProjectionMatrix { get; set; }
Property Value
Type Description
Matrix4x4

opaqueSortMode

Declaration
public OpaqueSortMode opaqueSortMode { get; set; }
Property Value
Type Description
OpaqueSortMode

orthographic

Declaration
public bool orthographic { get; set; }
Property Value
Type Description
Boolean

orthographicSize

Declaration
public float orthographicSize { get; set; }
Property Value
Type Description
Single

pixelHeight

Declaration
public int pixelHeight { get; }
Property Value
Type Description
Int32

pixelRect

Declaration
public Rect pixelRect { get; set; }
Property Value
Type Description
Rect

pixelWidth

Declaration
public int pixelWidth { get; }
Property Value
Type Description
Int32

previousViewProjectionMatrix

Declaration
public Matrix4x4 previousViewProjectionMatrix { get; }
Property Value
Type Description
Matrix4x4

projectionMatrix

Declaration
public Matrix4x4 projectionMatrix { get; set; }
Property Value
Type Description
Matrix4x4

rect

Declaration
public Rect rect { get; set; }
Property Value
Type Description
Rect

renderingPath

Declaration
public RenderingPath renderingPath { get; set; }
Property Value
Type Description
RenderingPath

scaledPixelHeight

Declaration
public int scaledPixelHeight { get; }
Property Value
Type Description
Int32

scaledPixelWidth

Declaration
public int scaledPixelWidth { get; }
Property Value
Type Description
Int32

scene

Declaration
public Scene scene { get; set; }
Property Value
Type Description
Scene

sensorSize

Declaration
public Vector2 sensorSize { get; set; }
Property Value
Type Description
Vector2

stereoActiveEye

Declaration
public Camera.MonoOrStereoscopicEye stereoActiveEye { get; }
Property Value
Type Description
Camera.MonoOrStereoscopicEye

stereoConvergence

Declaration
public float stereoConvergence { get; set; }
Property Value
Type Description
Single

stereoEnabled

Declaration
public bool stereoEnabled { get; }
Property Value
Type Description
Boolean

stereoSeparation

Declaration
public float stereoSeparation { get; set; }
Property Value
Type Description
Single

stereoTargetEye

Declaration
public StereoTargetEyeMask stereoTargetEye { get; set; }
Property Value
Type Description
StereoTargetEyeMask

targetDisplay

Declaration
public int targetDisplay { get; set; }
Property Value
Type Description
Int32

targetTexture

Declaration
public RenderTexture targetTexture { get; set; }
Property Value
Type Description
RenderTexture

transparencySortAxis

Declaration
public Vector3 transparencySortAxis { get; set; }
Property Value
Type Description
Vector3

transparencySortMode

Declaration
public TransparencySortMode transparencySortMode { get; set; }
Property Value
Type Description
TransparencySortMode

useJitteredProjectionMatrixForTransparentRendering

Declaration
public bool useJitteredProjectionMatrixForTransparentRendering { get; set; }
Property Value
Type Description
Boolean

useOcclusionCulling

Declaration
public bool useOcclusionCulling { get; set; }
Property Value
Type Description
Boolean

usePhysicalProperties

Declaration
public bool usePhysicalProperties { get; set; }
Property Value
Type Description
Boolean

velocity

Declaration
public Vector3 velocity { get; }
Property Value
Type Description
Vector3

worldToCameraMatrix

Declaration
public Matrix4x4 worldToCameraMatrix { get; set; }
Property Value
Type Description
Matrix4x4

Methods

| Improve this Doc View Source

AddCommandBuffer(CameraEvent, CommandBuffer)

Declaration
public void AddCommandBuffer(CameraEvent evt, CommandBuffer buffer)
Parameters
Type Name Description
CameraEvent evt
CommandBuffer buffer
| Improve this Doc View Source

AddCommandBufferAsync(CameraEvent, CommandBuffer, ComputeQueueType)

Declaration
public void AddCommandBufferAsync(CameraEvent evt, CommandBuffer buffer, ComputeQueueType queueType)
Parameters
Type Name Description
CameraEvent evt
CommandBuffer buffer
ComputeQueueType queueType
| Improve this Doc View Source

CalculateFrustumCorners(Rect, Single, Camera.MonoOrStereoscopicEye, Vector3[])

Declaration
public void CalculateFrustumCorners(Rect viewport, float z, Camera.MonoOrStereoscopicEye eye, Vector3[] outCorners)
Parameters
Type Name Description
Rect viewport
Single z
Camera.MonoOrStereoscopicEye eye
Vector3[] outCorners

CalculateObliqueMatrix(Vector4)

Declaration
public Matrix4x4 CalculateObliqueMatrix(Vector4 clipPlane)
Parameters
Type Name Description
Vector4 clipPlane
Returns
Type Description
Matrix4x4
| Improve this Doc View Source

CalculateProjectionMatrixFromPhysicalProperties(out Matrix4x4, Single, Vector2, Vector2, Single, Single, Camera.GateFitParameters)

Declaration
public static void CalculateProjectionMatrixFromPhysicalProperties(out Matrix4x4 output, float focalLength, Vector2 sensorSize, Vector2 lensShift, float nearClip, float farClip, Camera.GateFitParameters gateFitParameters = default(Camera.GateFitParameters))
Parameters
Type Name Description
Matrix4x4 output
Single focalLength
Vector2 sensorSize
Vector2 lensShift
Single nearClip
Single farClip
Camera.GateFitParameters gateFitParameters

CopyFrom(Camera)

Declaration
public void CopyFrom(Camera other)
Parameters
Type Name Description
Camera other

CopyStereoDeviceProjectionMatrixToNonJittered(Camera.StereoscopicEye)

Declaration
public void CopyStereoDeviceProjectionMatrixToNonJittered(Camera.StereoscopicEye eye)
Parameters
Type Name Description
Camera.StereoscopicEye eye

FocalLengthToFOV(Single, Single)

Declaration
public static float FocalLengthToFOV(float focalLength, float sensorSize)
Parameters
Type Name Description
Single focalLength
Single sensorSize
Returns
Type Description
Single

FOVToFocalLength(Single, Single)

Declaration
public static float FOVToFocalLength(float fov, float sensorSize)
Parameters
Type Name Description
Single fov
Single sensorSize
Returns
Type Description
Single
| Improve this Doc View Source

GetAllCameras(Camera[])

Declaration
public static int GetAllCameras(Camera[] cameras)
Parameters
Type Name Description
Camera[] cameras
Returns
Type Description
Int32

GetCommandBuffers(CameraEvent)

Declaration
public CommandBuffer[] GetCommandBuffers(CameraEvent evt)
Parameters
Type Name Description
CameraEvent evt
Returns
Type Description
CommandBuffer[]

GetStereoNonJitteredProjectionMatrix(Camera.StereoscopicEye)

Declaration
public Matrix4x4 GetStereoNonJitteredProjectionMatrix(Camera.StereoscopicEye eye)
Parameters
Type Name Description
Camera.StereoscopicEye eye
Returns
Type Description
Matrix4x4

GetStereoProjectionMatrix(Camera.StereoscopicEye)

Declaration
public Matrix4x4 GetStereoProjectionMatrix(Camera.StereoscopicEye eye)
Parameters
Type Name Description
Camera.StereoscopicEye eye
Returns
Type Description
Matrix4x4

GetStereoViewMatrix(Camera.StereoscopicEye)

Declaration
public Matrix4x4 GetStereoViewMatrix(Camera.StereoscopicEye eye)
Parameters
Type Name Description
Camera.StereoscopicEye eye
Returns
Type Description
Matrix4x4

RemoveAllCommandBuffers()

Declaration
public void RemoveAllCommandBuffers()
| Improve this Doc View Source

RemoveCommandBuffer(CameraEvent, CommandBuffer)

Declaration
public void RemoveCommandBuffer(CameraEvent evt, CommandBuffer buffer)
Parameters
Type Name Description
CameraEvent evt
CommandBuffer buffer

RemoveCommandBuffers(CameraEvent)

Declaration
public void RemoveCommandBuffers(CameraEvent evt)
Parameters
Type Name Description
CameraEvent evt

Render()

Declaration
public void Render()

RenderDontRestore()

Declaration
public void RenderDontRestore()
| Improve this Doc View Source

RenderToCubemap(Cubemap)

Declaration
public bool RenderToCubemap(Cubemap cubemap)
Parameters
Type Name Description
Cubemap cubemap
Returns
Type Description
Boolean
| Improve this Doc View Source

RenderToCubemap(Cubemap, Int32)

Declaration
public bool RenderToCubemap(Cubemap cubemap, int faceMask)
Parameters
Type Name Description
Cubemap cubemap
Int32 faceMask
Returns
Type Description
Boolean
| Improve this Doc View Source

RenderToCubemap(RenderTexture)

Declaration
public bool RenderToCubemap(RenderTexture cubemap)
Parameters
Type Name Description
RenderTexture cubemap
Returns
Type Description
Boolean
| Improve this Doc View Source

RenderToCubemap(RenderTexture, Int32)

Declaration
public bool RenderToCubemap(RenderTexture cubemap, int faceMask)
Parameters
Type Name Description
RenderTexture cubemap
Int32 faceMask
Returns
Type Description
Boolean
| Improve this Doc View Source

RenderToCubemap(RenderTexture, Int32, Camera.MonoOrStereoscopicEye)

Declaration
public bool RenderToCubemap(RenderTexture cubemap, int faceMask, Camera.MonoOrStereoscopicEye stereoEye)
Parameters
Type Name Description
RenderTexture cubemap
Int32 faceMask
Camera.MonoOrStereoscopicEye stereoEye
Returns
Type Description
Boolean

RenderWithShader(Shader, String)

Declaration
public void RenderWithShader(Shader shader, string replacementTag)
Parameters
Type Name Description
Shader shader
String replacementTag

Reset()

Declaration
public void Reset()

ResetAspect()

Declaration
public void ResetAspect()

ResetCullingMatrix()

Declaration
public void ResetCullingMatrix()

ResetProjectionMatrix()

Declaration
public void ResetProjectionMatrix()

ResetReplacementShader()

Declaration
public void ResetReplacementShader()

ResetStereoProjectionMatrices()

Declaration
public void ResetStereoProjectionMatrices()

ResetStereoViewMatrices()

Declaration
public void ResetStereoViewMatrices()

ResetTransparencySortSettings()

Declaration
public void ResetTransparencySortSettings()

ResetWorldToCameraMatrix()

Declaration
public void ResetWorldToCameraMatrix()
| Improve this Doc View Source

ScreenPointToRay(Vector3)

Declaration
public Ray ScreenPointToRay(Vector3 pos)
Parameters
Type Name Description
Vector3 pos
Returns
Type Description
Ray
| Improve this Doc View Source

ScreenPointToRay(Vector3, Camera.MonoOrStereoscopicEye)

Declaration
public Ray ScreenPointToRay(Vector3 pos, Camera.MonoOrStereoscopicEye eye)
Parameters
Type Name Description
Vector3 pos
Camera.MonoOrStereoscopicEye eye
Returns
Type Description
Ray

ScreenToViewportPoint(Vector3)

Declaration
public Vector3 ScreenToViewportPoint(Vector3 position)
Parameters
Type Name Description
Vector3 position
Returns
Type Description
Vector3
| Improve this Doc View Source

ScreenToWorldPoint(Vector3)

Declaration
public Vector3 ScreenToWorldPoint(Vector3 position)
Parameters
Type Name Description
Vector3 position
Returns
Type Description
Vector3

ScreenToWorldPoint(Vector3, Camera.MonoOrStereoscopicEye)

Declaration
public Vector3 ScreenToWorldPoint(Vector3 position, Camera.MonoOrStereoscopicEye eye)
Parameters
Type Name Description
Vector3 position
Camera.MonoOrStereoscopicEye eye
Returns
Type Description
Vector3

SetReplacementShader(Shader, String)

Declaration
public void SetReplacementShader(Shader shader, string replacementTag)
Parameters
Type Name Description
Shader shader
String replacementTag

SetStereoProjectionMatrix(Camera.StereoscopicEye, Matrix4x4)

Declaration
public void SetStereoProjectionMatrix(Camera.StereoscopicEye eye, Matrix4x4 matrix)
Parameters
Type Name Description
Camera.StereoscopicEye eye
Matrix4x4 matrix

SetStereoViewMatrix(Camera.StereoscopicEye, Matrix4x4)

Declaration
public void SetStereoViewMatrix(Camera.StereoscopicEye eye, Matrix4x4 matrix)
Parameters
Type Name Description
Camera.StereoscopicEye eye
Matrix4x4 matrix
| Improve this Doc View Source

SetTargetBuffers(RenderBuffer, RenderBuffer)

Declaration
public void SetTargetBuffers(RenderBuffer colorBuffer, RenderBuffer depthBuffer)
Parameters
Type Name Description
RenderBuffer colorBuffer
RenderBuffer depthBuffer
| Improve this Doc View Source

SetTargetBuffers(RenderBuffer[], RenderBuffer)

Declaration
public void SetTargetBuffers(RenderBuffer[] colorBuffer, RenderBuffer depthBuffer)
Parameters
Type Name Description
RenderBuffer[] colorBuffer
RenderBuffer depthBuffer

SetupCurrent(Camera)

Declaration
public static void SetupCurrent(Camera cur)
Parameters
Type Name Description
Camera cur
| Improve this Doc View Source

ViewportPointToRay(Vector3)

Declaration
public Ray ViewportPointToRay(Vector3 pos)
Parameters
Type Name Description
Vector3 pos
Returns
Type Description
Ray
| Improve this Doc View Source

ViewportPointToRay(Vector3, Camera.MonoOrStereoscopicEye)

Declaration
public Ray ViewportPointToRay(Vector3 pos, Camera.MonoOrStereoscopicEye eye)
Parameters
Type Name Description
Vector3 pos
Camera.MonoOrStereoscopicEye eye
Returns
Type Description
Ray

ViewportToScreenPoint(Vector3)

Declaration
public Vector3 ViewportToScreenPoint(Vector3 position)
Parameters
Type Name Description
Vector3 position
Returns
Type Description
Vector3
| Improve this Doc View Source

ViewportToWorldPoint(Vector3)

Declaration
public Vector3 ViewportToWorldPoint(Vector3 position)
Parameters
Type Name Description
Vector3 position
Returns
Type Description
Vector3

ViewportToWorldPoint(Vector3, Camera.MonoOrStereoscopicEye)

Declaration
public Vector3 ViewportToWorldPoint(Vector3 position, Camera.MonoOrStereoscopicEye eye)
Parameters
Type Name Description
Vector3 position
Camera.MonoOrStereoscopicEye eye
Returns
Type Description
Vector3
| Improve this Doc View Source

WorldToScreenPoint(Vector3)

Declaration
public Vector3 WorldToScreenPoint(Vector3 position)
Parameters
Type Name Description
Vector3 position
Returns
Type Description
Vector3

WorldToScreenPoint(Vector3, Camera.MonoOrStereoscopicEye)

Declaration
public Vector3 WorldToScreenPoint(Vector3 position, Camera.MonoOrStereoscopicEye eye)
Parameters
Type Name Description
Vector3 position
Camera.MonoOrStereoscopicEye eye
Returns
Type Description
Vector3
| Improve this Doc View Source

WorldToViewportPoint(Vector3)

Declaration
public Vector3 WorldToViewportPoint(Vector3 position)
Parameters
Type Name Description
Vector3 position
Returns
Type Description
Vector3

WorldToViewportPoint(Vector3, Camera.MonoOrStereoscopicEye)

Declaration
public Vector3 WorldToViewportPoint(Vector3 position, Camera.MonoOrStereoscopicEye eye)
Parameters
Type Name Description
Vector3 position
Camera.MonoOrStereoscopicEye eye
Returns
Type Description
Vector3

Extension Methods

MustExtensions.MustBeEqual<T>(T, T)
MustExtensions.MustBeEqual<T>(T, T, String)
MustExtensions.MustNotBeEqual<T>(T, T)
MustExtensions.MustNotBeEqual<T>(T, T, String)
MustExtensions.MustBeNull<T>(T)
MustExtensions.MustBeNull<T>(T, String)
MustExtensions.MustNotBeNull<T>(T)
MustExtensions.MustNotBeNull<T>(T, String)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX