C# Класс UnityEngine.Camera

Наследование: Behaviour
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
onPostRender CameraCallback
onPreCull CameraCallback
onPreRender CameraCallback

Private Properties

Свойство Тип Описание
AddCommandBuffer void
CalculateFrustumCornersInternal void
CopyFrom void
DoClear void
FireOnPostRender void
FireOnPreCull void
FireOnPreRender void
GetAllCameras int
GetCommandBuffers UnityEngine.Rendering.CommandBuffer[]
GetHDRWarnings string[]
GetScreenHeight float
GetScreenWidth float
GetStereoProjectionMatrices UnityEngine.Matrix4x4[]
GetStereoViewMatrices UnityEngine.Matrix4x4[]
INTERNAL_CALL_CalculateFrustumCornersInternal void
INTERNAL_CALL_CalculateObliqueMatrix void
INTERNAL_CALL_GetStereoProjectionMatrix void
INTERNAL_CALL_GetStereoViewMatrix void
INTERNAL_CALL_RaycastTry GameObject
INTERNAL_CALL_RaycastTry2D GameObject
INTERNAL_CALL_ResetAspect void
INTERNAL_CALL_ResetCullingMatrix void
INTERNAL_CALL_ResetFieldOfView void
INTERNAL_CALL_ResetProjectionMatrix void
INTERNAL_CALL_ResetReplacementShader void
INTERNAL_CALL_ResetWorldToCameraMatrix void
INTERNAL_CALL_ScreenPointToRay void
INTERNAL_CALL_ScreenToViewportPoint void
INTERNAL_CALL_ScreenToWorldPoint void
INTERNAL_CALL_SetStereoProjectionMatrices void
INTERNAL_CALL_SetStereoProjectionMatrix void
INTERNAL_CALL_SetStereoViewMatrices void
INTERNAL_CALL_SetStereoViewMatrix void
INTERNAL_CALL_ViewportPointToRay void
INTERNAL_CALL_ViewportToScreenPoint void
INTERNAL_CALL_ViewportToWorldPoint void
INTERNAL_CALL_WorldToScreenPoint void
INTERNAL_CALL_WorldToViewportPoint void
INTERNAL_get_backgroundColor void
INTERNAL_get_cameraToWorldMatrix void
INTERNAL_get_cullingMatrix void
INTERNAL_get_nonJitteredProjectionMatrix void
INTERNAL_get_pixelRect void
INTERNAL_get_projectionMatrix void
INTERNAL_get_rect void
INTERNAL_get_velocity void
INTERNAL_get_worldToCameraMatrix void
INTERNAL_set_backgroundColor void
INTERNAL_set_cullingMatrix void
INTERNAL_set_nonJitteredProjectionMatrix void
INTERNAL_set_pixelRect void
INTERNAL_set_projectionMatrix void
INTERNAL_set_rect void
INTERNAL_set_worldToCameraMatrix void
Internal_RenderToCubemapRT bool
Internal_RenderToCubemapTexture bool
IsFiltered bool
OnlyUsedForTesting1 void
OnlyUsedForTesting2 void
RaycastTry GameObject
RaycastTry GameObject
RaycastTry2D GameObject
RemoveAllCommandBuffers void
RemoveCommandBuffer void
RemoveCommandBuffers void
Render void
RenderDontRestore void
RenderToCubemap bool
RenderToCubemap bool
RenderWithShader void
ResetStereoProjectionMatrices void
ResetStereoViewMatrices void
SetReplacementShader void
SetStereoProjectionMatrices void
SetStereoViewMatrices void
SetTargetBuffersImpl void
SetTargetBuffersMRTImpl void
SetupCurrent void

Открытые методы

Метод Описание
CalculateFrustumCorners ( Rect viewport, float z, MonoOrStereoscopicEye eye, Vector3 outCorners ) : void
CalculateObliqueMatrix ( Vector4 clipPlane ) : Matrix4x4

Calculates and returns oblique near-plane projection matrix.

GetStereoProjectionMatrix ( StereoscopicEye eye ) : Matrix4x4
GetStereoViewMatrix ( StereoscopicEye eye ) : Matrix4x4
RenderToCubemap ( Cubemap cubemap, [ faceMask ) : bool

Render into a static cubemap from this camera.

RenderToCubemap ( RenderTexture cubemap, [ faceMask ) : bool

Render into a cubemap from this camera.

ResetAspect ( ) : void

Revert the aspect ratio to the screen's aspect ratio.

ResetCullingMatrix ( ) : void

Make culling queries reflect the camera's built in parameters.

ResetFieldOfView ( ) : void

Reset to the default field of view.

ResetProjectionMatrix ( ) : void

Make the projection reflect normal camera's parameters.

ResetReplacementShader ( ) : void

Remove shader replacement from camera.

ResetWorldToCameraMatrix ( ) : void

Make the rendering position reflect the camera's position in the scene.

ScreenPointToRay ( Vector3 position ) : Ray

Returns a ray going from camera through a screen point.

ScreenToViewportPoint ( Vector3 position ) : Vector3

Transforms position from screen space into viewport space.

ScreenToWorldPoint ( Vector3 position ) : Vector3

Transforms position from screen space into world space.

SetStereoProjectionMatrix ( StereoscopicEye eye, Matrix4x4 matrix ) : void
SetStereoViewMatrix ( StereoscopicEye eye, Matrix4x4 matrix ) : void
SetTargetBuffers ( RenderBuffer colorBuffer, RenderBuffer depthBuffer ) : void

Sets the Camera to render to the chosen buffers of one or more RenderTextures.

ViewportPointToRay ( Vector3 position ) : Ray

Returns a ray going from camera through a viewport point.

ViewportToScreenPoint ( Vector3 position ) : Vector3

Transforms position from viewport space into screen space.

ViewportToWorldPoint ( Vector3 position ) : Vector3

Transforms position from viewport space into world space.

WorldToScreenPoint ( Vector3 position ) : Vector3

Transforms position from world space into screen space.

WorldToViewportPoint ( Vector3 position ) : Vector3

Transforms position from world space into viewport space.

Приватные методы

Метод Описание
AddCommandBuffer ( CameraEvent evt, CommandBuffer buffer ) : void
CalculateFrustumCornersInternal ( Rect viewport, float z, MonoOrStereoscopicEye eye, Vector3 outCorners ) : void
CopyFrom ( Camera other ) : void
DoClear ( ) : void
FireOnPostRender ( Camera cam ) : void
FireOnPreCull ( Camera cam ) : void
FireOnPreRender ( Camera cam ) : void
GetAllCameras ( Camera cameras ) : int
GetCommandBuffers ( CameraEvent evt ) : UnityEngine.Rendering.CommandBuffer[]
GetHDRWarnings ( ) : string[]
GetScreenHeight ( ) : float
GetScreenWidth ( ) : float
GetStereoProjectionMatrices ( ) : UnityEngine.Matrix4x4[]
GetStereoViewMatrices ( ) : UnityEngine.Matrix4x4[]
INTERNAL_CALL_CalculateFrustumCornersInternal ( Camera self, Rect &viewport, float z, MonoOrStereoscopicEye eye, Vector3 outCorners ) : void
INTERNAL_CALL_CalculateObliqueMatrix ( Camera self, Vector4 &clipPlane, Matrix4x4 &value ) : void
INTERNAL_CALL_GetStereoProjectionMatrix ( Camera self, StereoscopicEye eye, Matrix4x4 &value ) : void
INTERNAL_CALL_GetStereoViewMatrix ( Camera self, StereoscopicEye eye, Matrix4x4 &value ) : void
INTERNAL_CALL_RaycastTry ( Camera self, Ray &ray, float distance, int layerMask, QueryTriggerInteraction queryTriggerInteraction ) : GameObject
INTERNAL_CALL_RaycastTry2D ( Camera self, Ray &ray, float distance, int layerMask ) : GameObject
INTERNAL_CALL_ResetAspect ( Camera self ) : void
INTERNAL_CALL_ResetCullingMatrix ( Camera self ) : void
INTERNAL_CALL_ResetFieldOfView ( Camera self ) : void
INTERNAL_CALL_ResetProjectionMatrix ( Camera self ) : void
INTERNAL_CALL_ResetReplacementShader ( Camera self ) : void
INTERNAL_CALL_ResetWorldToCameraMatrix ( Camera self ) : void
INTERNAL_CALL_ScreenPointToRay ( Camera self, Vector3 &position, Ray &value ) : void
INTERNAL_CALL_ScreenToViewportPoint ( Camera self, Vector3 &position, Vector3 &value ) : void
INTERNAL_CALL_ScreenToWorldPoint ( Camera self, Vector3 &position, Vector3 &value ) : void
INTERNAL_CALL_SetStereoProjectionMatrices ( Camera self, Matrix4x4 &leftMatrix, Matrix4x4 &rightMatrix ) : void
INTERNAL_CALL_SetStereoProjectionMatrix ( Camera self, StereoscopicEye eye, Matrix4x4 &matrix ) : void
INTERNAL_CALL_SetStereoViewMatrices ( Camera self, Matrix4x4 &leftMatrix, Matrix4x4 &rightMatrix ) : void
INTERNAL_CALL_SetStereoViewMatrix ( Camera self, StereoscopicEye eye, Matrix4x4 &matrix ) : void
INTERNAL_CALL_ViewportPointToRay ( Camera self, Vector3 &position, Ray &value ) : void
INTERNAL_CALL_ViewportToScreenPoint ( Camera self, Vector3 &position, Vector3 &value ) : void
INTERNAL_CALL_ViewportToWorldPoint ( Camera self, Vector3 &position, Vector3 &value ) : void
INTERNAL_CALL_WorldToScreenPoint ( Camera self, Vector3 &position, Vector3 &value ) : void
INTERNAL_CALL_WorldToViewportPoint ( Camera self, Vector3 &position, Vector3 &value ) : void
INTERNAL_get_backgroundColor ( Color &value ) : void
INTERNAL_get_cameraToWorldMatrix ( Matrix4x4 &value ) : void
INTERNAL_get_cullingMatrix ( Matrix4x4 &value ) : void
INTERNAL_get_nonJitteredProjectionMatrix ( Matrix4x4 &value ) : void
INTERNAL_get_pixelRect ( Rect &value ) : void
INTERNAL_get_projectionMatrix ( Matrix4x4 &value ) : void
INTERNAL_get_rect ( Rect &value ) : void
INTERNAL_get_velocity ( Vector3 &value ) : void
INTERNAL_get_worldToCameraMatrix ( Matrix4x4 &value ) : void
INTERNAL_set_backgroundColor ( Color &value ) : void
INTERNAL_set_cullingMatrix ( Matrix4x4 &value ) : void
INTERNAL_set_nonJitteredProjectionMatrix ( Matrix4x4 &value ) : void
INTERNAL_set_pixelRect ( Rect &value ) : void
INTERNAL_set_projectionMatrix ( Matrix4x4 &value ) : void
INTERNAL_set_rect ( Rect &value ) : void
INTERNAL_set_worldToCameraMatrix ( Matrix4x4 &value ) : void
Internal_RenderToCubemapRT ( RenderTexture cubemap, int faceMask ) : bool
Internal_RenderToCubemapTexture ( Cubemap cubemap, int faceMask ) : bool
IsFiltered ( GameObject go ) : bool
OnlyUsedForTesting1 ( ) : void
OnlyUsedForTesting2 ( ) : void
RaycastTry ( Ray ray, float distance, int layerMask ) : GameObject
RaycastTry ( Ray ray, float distance, int layerMask, [ queryTriggerInteraction ) : GameObject
RaycastTry2D ( Ray ray, float distance, int layerMask ) : GameObject
RemoveAllCommandBuffers ( ) : void
RemoveCommandBuffer ( CameraEvent evt, CommandBuffer buffer ) : void
RemoveCommandBuffers ( CameraEvent evt ) : void
Render ( ) : void
RenderDontRestore ( ) : void
RenderToCubemap ( Cubemap cubemap ) : bool
RenderToCubemap ( RenderTexture cubemap ) : bool
RenderWithShader ( Shader shader, string replacementTag ) : void
ResetStereoProjectionMatrices ( ) : void
ResetStereoViewMatrices ( ) : void
SetReplacementShader ( Shader shader, string replacementTag ) : void
SetStereoProjectionMatrices ( Matrix4x4 leftMatrix, Matrix4x4 rightMatrix ) : void
SetStereoViewMatrices ( Matrix4x4 leftMatrix, Matrix4x4 rightMatrix ) : void
SetTargetBuffersImpl ( RenderBuffer &color, RenderBuffer &depth ) : void
SetTargetBuffersMRTImpl ( RenderBuffer color, RenderBuffer &depth ) : void
SetupCurrent ( Camera cur ) : void

Описание методов

CalculateFrustumCorners() публичный Метод

public CalculateFrustumCorners ( Rect viewport, float z, MonoOrStereoscopicEye eye, Vector3 outCorners ) : void
viewport Rect
z float
eye MonoOrStereoscopicEye
outCorners Vector3
Результат void

CalculateObliqueMatrix() публичный Метод

Calculates and returns oblique near-plane projection matrix.

public CalculateObliqueMatrix ( Vector4 clipPlane ) : Matrix4x4
clipPlane Vector4 Vector4 that describes a clip plane.
Результат Matrix4x4

GetStereoProjectionMatrix() публичный Метод

public GetStereoProjectionMatrix ( StereoscopicEye eye ) : Matrix4x4
eye StereoscopicEye
Результат Matrix4x4

GetStereoViewMatrix() публичный Метод

public GetStereoViewMatrix ( StereoscopicEye eye ) : Matrix4x4
eye StereoscopicEye
Результат Matrix4x4

RenderToCubemap() публичный Метод

Render into a static cubemap from this camera.

public RenderToCubemap ( Cubemap cubemap, [ faceMask ) : bool
cubemap Cubemap The cube map to render to.
faceMask [ A bitmask which determines which of the six faces are rendered to.
Результат bool

RenderToCubemap() публичный Метод

Render into a cubemap from this camera.

public RenderToCubemap ( RenderTexture cubemap, [ faceMask ) : bool
cubemap RenderTexture The texture to render to.
faceMask [ A bitfield indicating which cubemap faces should be rendered into.
Результат bool

ResetAspect() публичный Метод

Revert the aspect ratio to the screen's aspect ratio.

public ResetAspect ( ) : void
Результат void

ResetCullingMatrix() публичный Метод

Make culling queries reflect the camera's built in parameters.

public ResetCullingMatrix ( ) : void
Результат void

ResetFieldOfView() публичный Метод

Reset to the default field of view.

public ResetFieldOfView ( ) : void
Результат void

ResetProjectionMatrix() публичный Метод

Make the projection reflect normal camera's parameters.

public ResetProjectionMatrix ( ) : void
Результат void

ResetReplacementShader() публичный Метод

Remove shader replacement from camera.

public ResetReplacementShader ( ) : void
Результат void

ResetWorldToCameraMatrix() публичный Метод

Make the rendering position reflect the camera's position in the scene.

public ResetWorldToCameraMatrix ( ) : void
Результат void

ScreenPointToRay() публичный Метод

Returns a ray going from camera through a screen point.

public ScreenPointToRay ( Vector3 position ) : Ray
position Vector3
Результат Ray

ScreenToViewportPoint() публичный Метод

Transforms position from screen space into viewport space.

public ScreenToViewportPoint ( Vector3 position ) : Vector3
position Vector3
Результат Vector3

ScreenToWorldPoint() публичный Метод

Transforms position from screen space into world space.

public ScreenToWorldPoint ( Vector3 position ) : Vector3
position Vector3
Результат Vector3

SetStereoProjectionMatrix() публичный Метод

public SetStereoProjectionMatrix ( StereoscopicEye eye, Matrix4x4 matrix ) : void
eye StereoscopicEye
matrix Matrix4x4
Результат void

SetStereoViewMatrix() публичный Метод

public SetStereoViewMatrix ( StereoscopicEye eye, Matrix4x4 matrix ) : void
eye StereoscopicEye
matrix Matrix4x4
Результат void

SetTargetBuffers() публичный Метод

Sets the Camera to render to the chosen buffers of one or more RenderTextures.

public SetTargetBuffers ( RenderBuffer colorBuffer, RenderBuffer depthBuffer ) : void
colorBuffer RenderBuffer The RenderBuffer(s) to which color information will be rendered.
depthBuffer RenderBuffer The RenderBuffer to which depth information will be rendered.
Результат void

ViewportPointToRay() публичный Метод

Returns a ray going from camera through a viewport point.

public ViewportPointToRay ( Vector3 position ) : Ray
position Vector3
Результат Ray

ViewportToScreenPoint() публичный Метод

Transforms position from viewport space into screen space.

public ViewportToScreenPoint ( Vector3 position ) : Vector3
position Vector3
Результат Vector3

ViewportToWorldPoint() публичный Метод

Transforms position from viewport space into world space.

public ViewportToWorldPoint ( Vector3 position ) : Vector3
position Vector3 The 3d vector in Viewport space.
Результат Vector3

WorldToScreenPoint() публичный Метод

Transforms position from world space into screen space.

public WorldToScreenPoint ( Vector3 position ) : Vector3
position Vector3
Результат Vector3

WorldToViewportPoint() публичный Метод

Transforms position from world space into viewport space.

public WorldToViewportPoint ( Vector3 position ) : Vector3
position Vector3
Результат Vector3

Описание свойств

onPostRender публичное статическое свойство

Event that is fired after any camera finishes rendering.

public static CameraCallback onPostRender
Результат CameraCallback

onPreCull публичное статическое свойство

Event that is fired before any camera starts culling.

public static CameraCallback onPreCull
Результат CameraCallback

onPreRender публичное статическое свойство

Event that is fired before any camera starts rendering.

public static CameraCallback onPreRender
Результат CameraCallback