用户工具

站点工具


侧边栏



Unity3D中文文档

script:unityengine:classes:camera:camera

Camera 摄像机

Namespace: UnityEngine
Inherits from: Behaviour

Description 描述

A Camera is a device through which the player views the world.

Camera是一个设备,玩家通过它看世界。

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.

屏幕空间点用像素定义,屏幕的左下为(0,0);右上是(PixelWidth,pixelHeight).Z的位置是以世界单位衡量的到相机的距离。

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.

视口空间点是规范的并相对于相机的。相机的左下为(0,0);右上是(1,1);Z的位置是以世界为单位衡量的到相机的距离。

A world space point is defined in global coordinates (eg. Transform.position).

世界空间点是以全局坐标定义的(例如:Transform.position)。

Static Variables 静态变量

allCamerasReturns all enabled cameras in the scene.
返回场景中所有相机
allCamerasCountThe number of cameras in the current scene.
当前场景中相机的数量
currentThe camera we are currently rendering with, for low-level render control only (Read Only).
当前用于渲染的相机,只用于低级的渲染控制(只读)
mainThe first enabled camera tagged “MainCamera” (Read Only).
第一个启用的被标记为“MainCamera”的相机(只读)。

Variables 变量

actualRenderingPathActually used rendering path(Read Only).
实际使用的渲染路径(只读)。
aspectThe aspect ratio (width divided by height).
长宽比(宽度除以高度)。
backgroundColorThe color with which the screen will be cleared.
屏幕将被清理为这个颜色。
cameraToWorldMatrixMatrix that transforms from camera space to world space (Read Only).
从相机空间到世界空间的变换矩阵(只读)。
clearFlagsHow the camera clears the background.
相机如何清除背景。
cullingMaskThis is used to render parts of the scene selectively.
这个用来选择性的渲染部分场景。
depthCamera's depth in the camera rendering order.
相机在渲染顺序上的深度。
depthTextureModeHow and if camera generates a depth texture.
相机生成怎样的一个深度纹理。
eventMaskMask to select which layers can trigger events on the camera.
遮挡相机的触发事件图层
farClipPlaneThe far clipping plane distance.
远裁剪面的距离。
fieldOfViewThe field of view of the camera in degrees.
相机的视野,以度为单位。
hdrHigh dynamic range rendering.
高动态范围渲染。
layerCullDistancesPer-layer culling distances.
每层的消隐距离。
layerCullSphericalHow to perform per-layer culling for a Camera.
相机如何执行每层的消隐。
nearClipPlaneThe near clipping plane distance.
近裁剪面的距离。
orthographicIs the camera orthographic (true) or perspective (false)?
相机是正交的(true),是透视的(false)?
orthographicSizeCamera's half-size when in orthographic mode.
在正交模式下相机的一半尺寸
pixelHeightHow tall is the camera in pixels (Read Only).
相机有多高,以像素单位(只读)。
pixelRectWhere on the screen is the camera rendered in pixel coordinates.
相机被渲染到屏幕像素中的位置。
pixelWidthHow wide is the camera in pixels (Read Only).
相机有多宽,以像素单位(只读)。
projectionMatrixSet a custom projection matrix.
设置自定义的投影矩阵。
rectWhere on the screen is the camera rendered in normalized coordinates.
相机被渲染到屏幕规范化坐标中的位置。
renderingPathRendering path.
渲染路径。
stereoConvergenceDistance to a point where virtual eyes converge.
虚拟眼相交点间距
stereoEnabledStereoscopic rendering.
立体渲染。
stereoSeparationDistance between the virtual eyes.
虚拟眼间距离
targetTextureDestination render texture (Unity Pro only).
描述渲染纹理(仅Unity专业版)。
transparencySortModeTransparent object sorting mode.
透明物体的排序模式。
useOcclusionCullingWhether or not the Camera will use occlusion culling during rendering.
无论是否在渲染过程中相机都会使用遮挡剔除。
velocityGet the world-space speed of the camera (Read Only).
获取世界空间中相机的速度(只读)。
worldToCameraMatrixMatrix that transforms from world to camera space.
从世界到相机空间的变换矩阵。

Functions 函数

CalculateObliqueMatrixCalculates and returns oblique near-plane projection matrix.
计算并返回倾斜接近水平的投影矩阵。
CopyFromMakes this camera's settings match other camera.
使这个相机的设置与其他相机相同。
RenderRender the camera manually.
手动渲染相机。
RenderToCubemapRender into a static cubemap from this camera.
从这个相机渲染到一个立方贴图。
RenderWithShaderRender the camera with shader replacement.
用shader替代渲染相机。
ResetAspectRevert the aspect ratio to the screen's aspect ratio.
恢复长宽比为屏幕的长宽比。
ResetProjectionMatrixMake the projection reflect normal camera's parameters.
让投影反映正常的相机参数。
ResetReplacementShaderRemove shader replacement from camera.
从相机上移除shader替换。
ResetWorldToCameraMatrixMake the rendering position reflect the camera's position in the scene.
在场景中让渲染位置反映相机的位置
ScreenPointToRayReturns a ray going from camera through a screen point.
返回一条射线从摄像机通过一个屏幕点。
ScreenToViewportPointTransforms position from screen space into viewport space.
从屏幕空间到视窗空间的变换位置。
ScreenToWorldPointTransforms position from screen space into world space.
从屏幕空间到世界空间的变化位置。
SetReplacementShaderMake the camera render with shader replacement.
使相机渲染用shader替换。
SetTargetBuffersSets the Camera to render to the chosen buffers of one or more RenderTextures.
设置相机渲染到一个或多个RenderTextures所选择的缓冲区。
ViewportPointToRayReturns a ray going from camera through a viewport point.
返回从相机出发穿过视点的一个射线。
ViewportToScreenPointTransforms position from viewport space into screen space.
从视口空间到屏幕空间的变换位置。
ViewportToWorldPointTransforms position from viewport space into world space.
从视窗空间到世界空间的变换位置。
WorldToScreenPointTransforms position from world space into screen space.
从世界空间到屏幕空间变换位置。
WorldToViewportPointTransforms position from world space into viewport space.
从世界空间到视窗空间的变换位置。

Static Functions 静态函数

GetAllCamerasFills an array of Camera with the current cameras in the scene, without allocating a new array.
用当前场景中的摄像机填补相机的数组,而不需要分配一个新的数组。

Messages 消息

OnPostRenderOnPostRender is called after a camera has finished rendering the scene.
OnPostRender在相机渲染场景之后调用。
OnPreCullOnPreCull is called before a camera culls the scene.
OnPreCull在相机开始裁剪场景之前调用。
OnRenderImageOnRenderImage is called after all rendering is complete to render image.
OnRenderImage在所有渲染完成后被调用,来渲染图片的后期处理效果(仅限UnityPro)。
OnRenderObjectOnRenderObject is called after camera has rendered the scene.
OnRenderObject 在相机渲染完场景以后被调用
OnWillRenderObjectOnWillRenderObject is called once for each camera if the object is visible.
如果物体可见,每个相机都会调用OnWillRenderObject。
script/unityengine/classes/camera/camera.txt · 最后更改: 2016/08/02 05:29 (外部编辑)