Unity3D圣典3.3版本-中文版
文集大纲加载中……
本文档使用 MrDoc 发布
-
+
首页
Camera 摄像机
# Camera 摄像机 Inherits from [Behaviour](../Behaviour/Behaviour.html) 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](Camera.pixelWidth.html),[pixelHeight](Camera.pixelHeight.html)). 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/Transform.position.html)). 世界空间点是以全局坐标定义的(例如:[Transform.position](../Transform/Transform.position.html)) ### Variables**变量** * [fieldOfView](Camera.fieldOfView.html) The field of view of the camera in degrees. 相机的视野,以度为单位。 * [nearClipPlane](Camera.nearClipPlane.html) The near clipping plane distance. 近裁剪面的距离。 * [farClipPlane](Camera.farClipPlane.html) The far clipping plane distance. 远裁剪面的距离。 * [renderingPath](Camera.renderingPath.html) Rendering path. 渲染路径。 * [actualRenderingPath](Camera.actualRenderingPath.html) Actually used rendering path (Read Only). 实际使用的渲染路径(只读)。 * [orthographicSize](Camera.orthographicSize.html) Camera's half-size when in orthographic mode. 在正交模式下相机的一半尺寸。 * [orthographic](Camera.orthographic.html) Is the camera orthographic (true) or perspective (false)? 相机是正交的(true),是透视的(false)? * [depth](Camera.depth.html) Camera's depth in the camera rendering order. 相机在渲染顺序上的深度。 * [aspect](Camera.aspect.html) The aspect ratio (width divided by height). 长宽比(宽度除以高度)。 * [cullingMask](Camera.cullingMask.html) This is used to render parts of the scene selectively. 这个用来选择性的渲染部分场景。 * [backgroundColor](Camera.backgroundColor.html) The color with which the screen will be cleared. 屏幕将被清理为这个颜色。 * [rect](Camera.rect.html) Where on the screen is the camera rendered in normalized coordinates. 相继被渲染到屏幕规范化坐标中的位置。 * [pixelRect](Camera.pixelRect.html) Where on the screen is the camera rendered in pixel coordinates. 相机被渲染到屏幕像素中的位置。 * [targetTexture](Camera.targetTexture.html) Destination render texture (Unity Pro only). 渲染纹理的目标(仅 Unity 专业版)。 * [pixelWidth](Camera.pixelWidth.html) How wide is the camera in pixels (Read Only). 相机有多宽,以像素单位(只读)。 * [pixelHeight](Camera.pixelHeight.html) How tall is the camera in pixels (Read Only). 相机有多高,以像素单位(只读)。 * [cameraToWorldMatrix](Camera.cameraToWorldMatrix.html) Matrix that transforms from camera space to world space (Read Only). 从相机空间到世界空间的变换矩阵(只读)。 * [worldToCameraMatrix](Camera.worldToCameraMatrix.html) Matrix that transforms from world to camera space. 从世界到相机空间的变换矩阵。 * [projectionMatrix](Camera.projectionMatrix.html) Set a custom projection matrix. 设置自定义的投影矩阵。 * [velocity](Camera.velocity.html) Get the world-space speed of the camera (Read Only). 获取世界空间中相机的速度(只读)。 * [clearFlags](Camera.clearFlags.html) How the camera clears the background. 相机如何清除背景。 * [layerCullDistances](Camera.layerCullDistances.html) Per-layer culling distances. 每层的消隐距离。 * [depthTextureMode](Camera.depthTextureMode.html) How and if camera generates a depth texture. 相机生成怎样的一个深度纹理。 ### Functions**函数** * [ResetWorldToCameraMatrix](Camera.ResetWorldToCameraMatrix.html) Make the rendering position reflect the camera's position in the scene. 在场景中让渲染位置反映相机的位置。 * [ResetProjectionMatrix](Camera.ResetProjectionMatrix.html) Make the projection reflect normal camera's parameters. 让投影反映正常的相机参数。 * [ResetAspect](Camera.ResetAspect.html) Revert the aspect ratio to the screen's aspect ratio. 恢复长宽比为屏幕的长宽比。 * [WorldToScreenPoint](Camera.WorldToScreenPoint.html) Transforms position from world space into screen space. 从世界空间到屏幕空间变换位置。 * [WorldToViewportPoint](Camera.WorldToViewportPoint.html) Transforms position from world space into viewport space. 从世界空间到视窗空间的变换位置。 * [ViewportToWorldPoint](Camera.ViewportToWorldPoint.html) Transforms position from viewport space into world space. 从视窗空间到世界空间的变换位置。 * [ScreenToWorldPoint](Camera.ScreenToWorldPoint.html) Transforms position from screen space into world space. 从屏幕空间到世界空间的变化位置。 * [ScreenToViewportPoint](Camera.ScreenToViewportPoint.html) Transforms position from screen space into viewport space. 从屏幕空间到视窗空间的变换位置。 * [ViewportToScreenPoint](Camera.ViewportToScreenPoint.html) Transforms position from viewport space into screen space. 从视口空间到屏幕空间的变换位置。 * [ViewportPointToRay](Camera.ViewportPointToRay.html) Returns a ray going from camera through a viewport point. 返回从相机出发穿过视点的一个射线。 * [ScreenPointToRay](Camera.ScreenPointToRay.html) Returns a ray going from camera through a screen point. 返回一条射线从摄像机通过一个屏幕点。 * [Render](Camera.Render.html) Render the camera manually. 手动渲染相机。 * [RenderWithShader](Camera.RenderWithShader.html) Render the camera with shader replacement. 用 shader 替代渲染相机。 * [SetReplacementShader](Camera.SetReplacementShader.html) Make the camera render with shader replacement. 使相机渲染用 shader 替换。 * [ResetReplacementShader](Camera.ResetReplacementShader.html) Remove shader replacement from camera. 从相机上移除 shader 替换。 * [RenderToCubemap](Camera.RenderToCubemap.html) Render into a cubemap from this camera. 从这个相机渲染到一个立方贴图。 * [CopyFrom](Camera.CopyFrom.html) Makes this camera's settings match other camera. 使这个相机的设置与其他相机相同。 ### Messages Sent**发送消息** * [OnPreCull](Camera.OnPreCull.html) OnPreCull is called before a camera culls the scene. OnPreCull 在相机开始裁剪场景之前调用。 * [OnPreRender](Camera.OnPreRender.html) OnPreRender is called before a camera starts rendering the scene. OnPreRender 在相机开始渲染场景之前调用。 * [OnPostRender](Camera.OnPostRender.html) OnPostRender is called after a camera has finished rendering the scene. OnPostRender 在相机渲染场景之后调用。 * [OnRenderImage](Camera.OnRenderImage.html) OnRenderImage is called after all rendering is complete to render image OnRenderImage 在所有渲染完成后被调用,来渲染图片的后期处理效果(仅限 UnityPro)。 * [OnRenderObject](Camera.OnRenderObject.html) OnRenderObject is called after camera has rendered the scene. OnRenderObject 被用来渲染你自己的物体,使用或者其他函数。 * [OnWillRenderObject](Camera.OnWillRenderObject.html) OnWillRenderObject is called once for each camera if the object is visible. 如果物体可见,每个相机都会调用 OnWillRenderObject。 ### Class Functions**类函数** * [main](Camera.main.html) The first enabled camera tagged "MainCamera" (Read Only). 第一个启用的被标记为“MainCanmera”的相机(只读)。 * [current](Camera.current.html) The camera we are currently rendering with, for low-level render control only (Read Only). 当前用于渲染的相机,只用于低级的渲染控制(只读) * [allCameras](Camera.allCameras.html) Returns all enabled cameras in the scene. allCameras 所有相机 ## Inherited members**继承成员** ### Inherited Variables**继承变量** * [enabled](../Behaviour/Behaviour.enabled.html) Enabled Behaviours are Updated, disabled Behaviours are not. 启用行为被更新,禁用行为不更新。 * [transform](../Component/Component.transform.html) The [Transform](../Transform/Transform.html) attached to this [GameObject](../GameObject/GameObject.html) (null if there is none attached). [Transform](../Transform/Transform.html) 附加到 [GameObject](../GameObject/GameObject.html)(游戏物体)(如无附加则为空)。 * [rigidbody](../Component/Component.rigidbody.html) The [Rigidbody](../Rigidbod/Rigidbody.html) attached to this [GameObject](../GameObject/GameObject.html) (null if there is none attached). [Rigidbody](../Rigidbod/Rigidbody.html)[](../Transform/Transform.html)附加到 [GameObject](../GameObject/GameObject.html)(游戏物体)(如无附加则为空)。 * [camera](../Component/Component.camera.html) The [Camera](Camera.html) attached to this [GameObject](../GameObject/GameObject.html) (null if there is none attached). [Camera](Camera.html)[](../Rigidbod/Rigidbody.html)[](../Transform/Transform.html)附加到 [GameObject](../GameObject/GameObject.html)(游戏物体)(如无附加则为空)。 * [light](../Component/Component.light.html) The [Light](../Light/Light.html) attached to this [GameObject](../GameObject/GameObject.html) (null if there is none attached). [Light](../Light/Light.html)[](Camera.html)[](../Rigidbod/Rigidbody.html)[](../Transform/Transform.html)附加到 [GameObject](../GameObject/GameObject.html)(游戏物体)(如无附加则为空)。 * [animation](../Component/Component.animation.html) The [Animation](../Animation/Animation.html) attached to this [GameObject](../GameObject/GameObject.html) (null if there is none attached). [Animation](../Animation/Animation.html)[](../Light/Light.html)[](Camera.html)[](../Rigidbod/Rigidbody.html)[](../Transform/Transform.html)附加到 [GameObject](../GameObject/GameObject.html)(游戏物体)(如无附加则为空)。 * [constantForce](../Component/Component.constantForce.html) The [ConstantForce](../ConstantForce/ConstantForce.html) attached to this [GameObject](../GameObject/GameObject.html) (null if there is none attached). [ConstantForce](../ConstantForce/ConstantForce.html)[](../Animation/Animation.html)[](../Light/Light.html)[](Camera.html)[](../Rigidbod/Rigidbody.html)[](../Transform/Transform.html)附加到 [GameObject](../GameObject/GameObject.html)(游戏物体)(如无附加则为空)。 * [renderer](../Component/Component.renderer.html) The [Renderer](../Renderer/Renderer.html) attached to this [GameObject](../GameObject/GameObject.html) (null if there is none attached). [Renderer](../Renderer/Renderer.html)[](../ConstantForce/ConstantForce.html)[](../Animation/Animation.html)[](../Light/Light.html)[](Camera.html)[](../Rigidbod/Rigidbody.html)[](../Transform/Transform.html)附加到 [GameObject](../GameObject/GameObject.html)(游戏物体)(如无附加则为空)。 * [audio](../Component/Component.audio.html) The [AudioSource](../AudioSource/AudioSource.html) attached to this [GameObject](../GameObject/GameObject.html) (null if there is none attached). [AudioSource](../AudioSource/AudioSource.html)[](../Renderer/Renderer.html)[](../ConstantForce/ConstantForce.html)[](../Animation/Animation.html)[](../Light/Light.html)[](Camera.html)[](../Rigidbod/Rigidbody.html)[](../Transform/Transform.html)附加到 [GameObject](../GameObject/GameObject.html)(游戏物体)(如无附加则为空)。 * [guiText](../Component/Component.guiText.html) The [GUIText](../GUIText/GUIText.html) attached to this [GameObject](../GameObject/GameObject.html) (null if there is none attached). [GUIText](../GUIText/GUIText.html)[](../AudioSource/AudioSource.html)[](../Renderer/Renderer.html)[](../ConstantForce/ConstantForce.html)[](../Animation/Animation.html)[](../Light/Light.html)[](Camera.html)[](../Rigidbod/Rigidbody.html)[](../Transform/Transform.html)附加到 [GameObject](../GameObject/GameObject.html)(游戏物体)(如无附加则为空)。 * [networkView](../Component/Component.networkView.html) The [NetworkView](../NetworkView/NetworkView.html) attached to this [GameObject](../GameObject/GameObject.html) (Read Only). (null if there is none attached) [NetworkView](../NetworkView/NetworkView.html)[](../GUIText/GUIText.html)[](../AudioSource/AudioSource.html)[](../Renderer/Renderer.html)[](../ConstantForce/ConstantForce.html)[](../Animation/Animation.html)[](../Light/Light.html)[](Camera.html)[](../Rigidbod/Rigidbody.html)[](../Transform/Transform.html)附加到 [GameObject](../GameObject/GameObject.html)(游戏物体)(只读)(如无附加则为空)。 * [guiTexture](../Component/Component.guiTexture.html) The [GUITexture](../GUITexture/GUITexture.html) attached to this [GameObject](../GameObject/GameObject.html) (Read Only). (null if there is none attached) [GUITexture](../GUITexture/GUITexture.html) 附加到 [GameObject](../GameObject/GameObject.html)(游戏物体)(只读)(如无附加则为空)。 * [collider](../Component/Component.collider.html) The [Collider](../Collider/Collider.html) attached to this [GameObject](../GameObject/GameObject.html) (null if there is none attached). [Collider](../Collider/Collider.html) 附加到 [GameObject](../GameObject/GameObject.html)(游戏物体)(如无附加则为空)。 * [hingeJoint](../Component/Component.hingeJoint.html) The [HingeJoint](../HingeJoint/HingeJoint.html) attached to this [GameObject](../GameObject/GameObject.html) (null if there is none attached). [HingeJoint](../HingeJoint/HingeJoint.html) 附加到 [GameObject](../GameObject/GameObject.html)(游戏物体)(如无附加则为空)。 * [particleEmitter](../Component/Component.particleEmitter.html) The [ParticleEmitter](../ParticleEmitter/ParticleEmitter.html) attached to this [GameObject](../GameObject/GameObject.html) (null if there is none attached). [ParticleEmitter](../ParticleEmitter/ParticleEmitter.html) 附加到 [GameObject](../GameObject/GameObject.html)(游戏物体)(如无附加则为空)。 * [gameObject](../Component/Component.gameObject.html) The game object this component is attached to. A component is always attached to a game object. 组件附加的游戏物体。一个组件总是被附加到一个游戏物体。 * [tag](../Component/Component.tag.html) The tag of this game object. 游戏物体的标签。 * [name](../Object/Object.name.html) The name of the object. //物体的名字 * [hideFlags](../Object/Object.hideFlags.html) Should the object be hidden, saved with the scene or modifiable by the user? 物体是否被隐藏、保存在场景中或被用户修改? ### Inherited Functions**继承函数** * [GetComponent](../Component/Component.GetComponent.html) Returns the component of Type type if the game object has one attached, null if it doesn't. 如果游戏物体有一个附加,则返回 Type 类型的组件,如果没有则为 null。 * [GetComponent.<T>](../Component/Component.GetComponent.ltTgt.html) * [GetComponent](../Component/Component.GetComponent.html) Returns the component with name type if the game object has one attached, null if it doesn't. 如果游戏物体有一个附加,则返回名字类型组件,如果没有则为 null。 * [GetComponentInChildren](../Component/Component.GetComponentInChildren.html) Returns the component of Type type in the [GameObject](../GameObject/GameObject.html) or any of its children using depth first search. 返回 Type 类型组件,在 [GameObject](../GameObject/GameObject.html) 或它的任何子物体使用深度优先搜索,仅返回激活的组件。 * [GetComponentInChildren.<T>](../Component/Component.GetComponentInChildren.ltTgt.html) * [GetComponentsInChildren](../Component/Component.GetComponentsInChildren.html) Returns all components of Type type in the [GameObject](../GameObject/GameObject.html) or any of its children. 在 [GameObject](../GameObject/GameObject.html) 或任何它的子物体,返回全部 Type 类型组件 * [GetComponentsInChildren.<T> ](../Component/Component.GetComponentsInChildren.ltTgt.html) * [GetComponents](../Component/Component.GetComponents.html) Returns all components of Type type in the [GameObject](../GameObject/GameObject.html). 在游戏物体返回全部 Type 类型组件。 * [GetComponents.<T> ](../Component/Component.GetComponents.ltTgt.html) * [CompareTag](../Component/Component.CompareTag.html) Is this game object tagged tag? 游戏物体有被标记标签么? * [SendMessageUpwards](../Component/Component.SendMessageUpwards.html) Calls the method named methodName on every [MonoBehaviour](../MonoBehaviour/MonoBehaviour.html) in this game object and on every ancestor of the behaviour 在游戏物体每一个 [MonoBehaviour](../MonoBehaviour/MonoBehaviour.html) 和每一个 behaviour 的祖先上调用名为 methodName 的方法。 * [SendMessage](../Component/Component.SendMessage.html) Calls the method named methodName on every [MonoBehaviour](../MonoBehaviour/MonoBehaviour.html) in this game object. 在游戏物体每一个 [MonoBehaviour](../MonoBehaviour/MonoBehaviour.html) 上调用名为 methodName 的方法。 * [BroadcastMessage](../Component/Component.BroadcastMessage.html) Calls the method named methodName on every [MonoBehaviour](../MonoBehaviour/MonoBehaviour.html) in this game object or any of its children. 在游戏物体每一个 [MonoBehaviour](../MonoBehaviour/MonoBehaviour.html) 和它的全部子物体上调用名为 methodName 的方法。 * [GetInstanceID](../Object/Object.GetInstanceID.html) Returns the instance id of the object. 返回物体的实例 ID * [ToString](../Object/Object.ToString.html) Returns the name of the game object. 返回游戏物体的名称。 ### Inherited Class Functions**继承类函数** * [operator bool](../Object/Object.operator_bool.html) Does the object exist? 物体是否存在? * [Instantiate](../Object/Object.Instantiate.html) Clones the object original and returns the clone. 克隆原始物体,并返回克隆的物体 * [Instantiate.<T>](../Object/Object.Instantiate.ltTgt.html) * [Destroy](../Object/Object.Destroy.html) Removes a gameobject, component or asset. 删除一个游戏物体、组件或资源 * [DestroyImmediate](../Object/Object.DestroyImmediate.html) Destroys the object obj immediately. It is strongly recommended to use Destroy instead. 立即销毁物体 obj,强烈建议使用 Destroy 代替。 * [FindObjectsOfType](../Object/Object.FindObjectsOfType.html) Returns a list of all active loaded objects of Type type. 返回 Type 类型的所有激活的加载的物体列表 * [FindObjectOfType](../Object/Object.FindObjectOfType.html) Returns the first active loaded object of Type type. 返回 Type 类型第一个激活的加载的物体。 * [operator ==](../Object/Object.operator_eq.html) Compares if two objects refer to the same 比较如果两个物体相同 * [operator !=](../Object/Object.operator_ne.html) Compares if two objects refer to a different object 比较如果两个物体不同 * [DontDestroyOnLoad](../Object/Object.DontDestroyOnLoad.html) Makes the object target not be destroyed automatically when loading a new scene. 加载新场景的时候使目标物体不被自动销毁。
da
2022年5月17日 13:22
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码