Camera

class in UnityEngine

/

Inherits from:Behaviour

Switch to Manual

Description

Камера представляет собой устройство, с помощью которого игрок видит мир.

A screen space point is defined in pixels. The bottom-left of the screen is (0,0); the right-top is (pixelWidth,pixelHeight). The z position is in world units from the Camera.

A viewport space point is normalized and relative to the Camera. The bottom-left of the Camera is (0,0); the top-right is (1,1). The z position is in world units from the Camera.

Точка в мировом пространстве определяется в глобальных координатах (например, Transform.position).

See Also: camera component.

Static Variables

allCamerasВозвращает все включенные камеры на сцене.
allCamerasCountКоличество камер в текущей сцене.
currentThe camera we are currently rendering with, for low-level render control only (Read Only).
mainПервая включеннная камера с тегом "MainCamera" (Read Only).
onPostRenderOnPostRender вызывается после того, как камера закончит рендер сцены.
onPreCullOnPreRender вызывается перед тем, как камера начнёт рендерить сцену.
onPreRenderOnPreRender вызывается перед тем, как камера начнёт рендерить сцену.

Variables

activeTextureGets the temporary RenderTexture target for this Camera.
actualRenderingPathThe rendering path that is currently being used (Read Only).
allowDynamicResolutionDynamic Resolution Scaling.
allowHDRHigh dynamic range рендеринг.
allowMSAAMSAA rendering.
areVRStereoViewMatricesWithinSingleCullToleranceDetermines whether the stereo view matrices are suitable to allow for a single pass cull.
aspectСоотношение сторон (ширина разделенная на высоту).
backgroundColorЦвет, c которым экран будет очищен.
cameraToWorldMatrixМатрица, которая преобразует из пространства камеры в мировое пространстве (Read Only).
cameraTypeIdentifies what kind of camera this is.
clearFlagsКак камера очищает фон.
clearStencilAfterLightingPassShould the camera clear the stencil buffer after the deferred light pass?
commandBufferCountNumber of command buffers set up on this camera (Read Only).
cullingMaskЭто применяется для того, чтобы выборочно визуализировать различные части сцены.
cullingMatrixSets a custom matrix for the camera to use for all culling queries.
depthГлубина камеры в порядке отрисовки камеры.
depthTextureModeHow and if camera generates a depth texture.
eventMaskМаска для выбора того, какие слои могут вызвать события на камере.
farClipPlaneРасстояние дальней плоскости отсечения.
fieldOfViewПоле зрения камеры в градусах.
forceIntoRenderTextureShould camera rendering be forced into a RenderTexture.
layerCullDistancesДистанция обрезки для камеры по слоям.
layerCullSphericalКак выполнить отсечение по слоям для камеры.
nearClipPlaneДистанция ближней плоскости отсечения.
nonJitteredProjectionMatrixGet or set the raw projection matrix with no camera offset (no jittering).
opaqueSortModeПрозрачный объект в режим сортировки.
orthographicЭта камера ортогональная (true) или перспектива (false)?
orthographicSizeВ ортогональном режиме только половина размера камеры.
pixelHeightHow tall is the camera in pixels (not accounting for dynamic resolution scaling) (Read Only).
pixelRectГде на экране камера рендерится в пиксельных координатах.
pixelWidthHow wide is the camera in pixels (not accounting for dynamic resolution scaling) (Read Only).
previousViewProjectionMatrixGet the view projection matrix used on the last frame.
projectionMatrixУстановка пользовательской матрицы проекции.
rectГде на экране расположена камера, отрендеренная в нормализированных координатах.
renderingPathThe rendering path that should be used, if possible.
scaledPixelHeightHow tall is the camera in pixels (accounting for dynamic resolution scaling) (Read Only).
scaledPixelWidthHow wide is the camera in pixels (accounting for dynamic resolution scaling) (Read Only).
sceneIf not null, the camera will only render the contents of the specified scene.
stereoActiveEyeReturns the eye that is currently rendering. If called when stereo is not enabled it will return Camera.MonoOrStereoscopicEye.Mono. If called during a camera rendering callback such as OnRenderImage it will return the currently rendering eye. If called outside of a rendering callback and stereo is enabled, it will return the default eye which is Camera.MonoOrStereoscopicEye.Left.
stereoConvergenceРасстояние до точки, на которой сходятся виртуальные глаза.
stereoEnabledСтереоскопический рендеринг.
stereoSeparationThe distance between the virtual eyes. Use this to query or set the current eye separation. Note that most VR devices provide this value, in which case setting the value will have no effect.
stereoTargetEyeDefines which eye of a VR display the Camera renders into.
targetDisplayУстанавливает целевой дисплей для этой камеры.
targetTextureТекстура, предназначенная для рендеринга (только в Unity Pro).
transparencySortAxisAn axis that describes the direction along which the distances of objects are measured for the purpose of sorting.
transparencySortModeПрозрачный объект в режим сортировки.
useJitteredProjectionMatrixForTransparentRenderingShould the jittered matrix be used for transparency rendering?
useOcclusionCullingТак или иначе камера будет использовать окклюзивное отсечение (occlusion culling) во время рендеринга.
velocityПолучает скорость камеры в мировом пространстве (Read Only).
worldToCameraMatrixМатрица, которая преобразует из мирового пространства в пространство камеры.

Public Functions

AddCommandBufferAdd a command buffer to be executed at a specified place.
CalculateFrustumCornersGiven viewport coordinates, calculates the view space vectors pointing to the four frustum corners at the specified camera depth.
CalculateObliqueMatrixВычисляет и возвращает наклонную матрицу проекции передней плоскости.
CopyFromКопирует настройки с другой камеру на эту.
CopyStereoDeviceProjectionMatrixToNonJitteredSets the non-jittered projection matrix, sourced from the VR SDK.
GetCommandBuffersGet command buffers to be executed at a specified place.
GetStereoNonJitteredProjectionMatrixGets the non-jittered projection matrix of a specific left or right stereoscopic eye.
GetStereoProjectionMatrixGets the projection matrix of a specific left or right stereoscopic eye.
GetStereoViewMatrixGets the left or right view matrix of a specific stereoscopic eye.
RemoveAllCommandBuffersРендер в cubemap с этой камеры.
RemoveCommandBufferRemove command buffer from execution at a specified place.
RemoveCommandBuffersRemove command buffers from execution at a specified place.
RenderРендер камеры вручную.
RenderToCubemapРендер в статическую кубическую текстуру (cubemap) с камеры.
RenderWithShaderРендер камеры с заменой шейдера.
ResetAspectВосстанавливает соотношение сторон к соотношению сторон экрана.
ResetCullingMatrixДелает так, что позиция отрисовки отражает позицию камеры в сцене.
ResetProjectionMatrixMake the projection reflect normal camera's parameters.
ResetReplacementShaderУдаляет замену шейдеров (shader replacement) с камеры.
ResetStereoProjectionMatricesReset the camera to using the Unity computed projection matrices for all stereoscopic eyes.
ResetStereoViewMatricesReset the camera to using the Unity computed view matrices for all stereoscopic eyes.
ResetTransparencySortSettingsResets this Camera's transparency sort settings to the default. Default transparency settings are taken from GraphicsSettings instead of directly from this Camera.
ResetWorldToCameraMatrixДелает так, что позиция отрисовки отражает позицию камеры в сцене.
ScreenPointToRayВозвращает луч, идущий от камеры через точку на экране.
ScreenToViewportPointПреобразует position (позицию) из экранного пространства в пространство окна просмотра.
ScreenToWorldPointПреобразует position (позицию) из экранного пространства в мировое пространство.
SetReplacementShaderСоздает визуализацию камеры с заменой шейдеров.
SetStereoProjectionMatrixSets a custom projection matrix for a specific stereoscopic eye.
SetStereoViewMatrixSets a custom view matrix for a specific stereoscopic eye.
SetTargetBuffersУстанавливает Камеру так, что визуализировать с выбранными буферами одного или нескольких RenderTextures.
ViewportPointToRayВозвращает луч, идущий от камеры через точку окна просмотра.
ViewportToScreenPointПреобразует position (позицию) из пространства окна просмотра в пространство экрана.
ViewportToWorldPointПреобразует position (позицию) из пространства окна просмотра в мировое пространство.
WorldToScreenPointПреобразует position (позицию) из мирового пространства в пространство экрана.
WorldToViewportPointПреобразует position (позицию) из мирового пространства в пространство окна просмотра.

Static Functions

GetAllCamerasЗаполняет массив Камеры с текущих камер на сцене, без выделения нового массива.

Messages

OnPostRenderOnPostRender вызывается после того, как камера закончит рендер сцены.
OnPreCullOnPreCull вызывается до того, как камера отсечёт сцену.
OnPreRenderOnPreRender вызывается перед тем, как камера начнёт рендерить сцену.
OnRenderImageOnRenderImage вызывается после того как весь рендеринг для отрисовки изображения завершиться.
OnRenderObjectOnRenderObject вызывается после того, как камера отрендерила сцену.
OnWillRenderObjectOnWillRenderObject вызвается один раз для каждой камеры, если объект в зоне видимости.

Delegates

CameraCallbackDelegate type for camera callbacks.

Inherited members

Variables

enabledВключенное Поведение обновляется, выключенное Поведение не обновляется.
isActiveAndEnabledHas the Behaviour had enabled called.
gameObjectИгровой объект к которому прикреплён данный компонент. Компонент всегда прикреплён к игровому объекту.
tagТег данного игрового объекта.
transformThe Transform attached to this GameObject.
hideFlagsShould the object be hidden, saved with the scene or modifiable by the user?
nameThe name of the object.

Public Functions

BroadcastMessageВызывает метод названный methodName на каждом MonoBehaviour этого game object-а или любого из его потомков.
CompareTagПомечен ли данный игровой объект тегом tag?
GetComponentВозвращает компонент типа type, если он прикреплен к игровому объекту и null, если не прикреплен.
GetComponentInChildrenВозвращает компонент типа type в GameObject или некоторого его потомка через поиск в глубину.
GetComponentInParentВозвращает все компоненты типа type из GameObject'а или из любого его родителя.
GetComponentsВозвращает все компоненты типа type в GameObject.
GetComponentsInChildrenВозвращает все компоненты типа type в GameObject или любому из его потомков.
GetComponentsInParentВозвращает все компоненты типа type в GameObject или любому из его родителей.
SendMessageВызывает метод с названием methodName в каждом MonoBehaviour в этом игровом объекте.
SendMessageUpwardsВызывает метод с именем methodName в каждом MonoBehaviour в этом игровом объекте и в каждом предке поведения.
GetInstanceIDReturns the instance id of the object.
ToStringReturns the name of the GameObject.

Static Functions

DestroyУдаляет GameObject, Component или Asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadMakes the object target not be destroyed automatically when loading a new scene.
FindObjectOfTypeReturns the first active loaded object of Type type.
FindObjectsOfTypeReturns a list of all active loaded objects of Type type.
InstantiateClones the object original and returns the clone.

Operators

boolDoes the object exist?
operator !=Compares if two objects refer to a different object.
operator ==Compares two object references to see if they refer to the same object.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961