Unity3D圣典3.3版本-中文版
文集大纲加载中……
本文档使用 MrDoc 发布
-
+
首页
Vector3 三维向量
# Vector3 三维向量 Struct Representation of 3D vectors and points. 表示 3D 的向量和点。 This structure is used throughout Unity to pass 3D positions and directions around. It also contains functions for doing common vector operations. 这个结构用于在 Unity 传递 3D 位置和方向。它也包含做些普通向量运算的函数。 Besides the functions listed below, other classes can be used to manipulate vectors and points as well. For example the [Quaternion](../Quaternion/Quaternion.html) and the [Matrix4x4](../Matrix4x4/Matrix4x4.html) classes are useful for rotating or transforming vectors and points. 除了下面列出的函数,其他类用于处理向量和点。例如 [Quaternion](../Quaternion/Quaternion.html) 和 [Matrix4x4](../Matrix4x4/Matrix4x4.html) 类用于旋转或变换向量和点。 ### Variables**变量** * [x](Vector3.x.html) X component of the vector. 向量的 X 组件。 * [y](Vector3.y.html) Y component of the vector. 向量的 Y 组件。 * [z](Vector3.z.html) Z component of the vector. 向量的 Z 组件。 * [this [int index]](Vector3.Index_operator.html) Access the x, y, z components using [0], [1], [2] respectively. 使用[0], [1], [2]分别访问组件 x, y, z 组件。简单来说就是用索引号代替 x, y, z 组件。 * [normalized](Vector3.normalized.html) Returns this vector with a magnitude of 1 (Read Only). 返回向量的长度为 1(只读)。 * [magnitude](Vector3.magnitude.html) Returns the length of this vector (Read Only). 返回向量的长度(只读)。 * [sqrMagnitude](Vector3.sqrMagnitude.html) Returns the squared length of this vector (Read Only). 返回这个向量的长度的平方(只读)。 ### Constructors**构造器** * [Vector3](Vector3.Vector3.html) Creates a new vector with given x, y, z components. 创建一个新的具有给定 x, y, z 组件的向量。 ### Functions**函数** * [Scale](Vector3.Scale.html) Multiplies every component of this vector by the same component of scale. 由缩放的相同的组件对应乘以这个矢量的每个组件。 * [Normalize](Vector3.Normalize.html) Makes this vector have a magnitude of 1. 使向量的长度为 1。 * [ToString](Vector3.ToString.html) Returns a nicely formatted string for this vector. 返回此向量格式化的字符串。 ### Class Variables**类变量** * [zero](Vector3.zero.html) Shorthand for writing [Vector3](Vector3.html)(0, 0, 0) 写 [Vector3](Vector3.html)(0, 0, 0)的简码。 * [one](Vector3.one.html) Shorthand for writing [Vector3](Vector3.html)(1, 1, 1) 写 [Vector3](Vector3.html)(1, 1, 1)的简码。 * [forward](Vector3.forward.html) Shorthand for writing [Vector3](Vector3.html)(0, 0, 1) 写 [Vector3](Vector3.html)(0, 0, 1)的简码,也就是向 z 轴。 * [up](Vector3.up.html) Shorthand for writing [Vector3](Vector3.html)(0, 1, 0) 写 [Vector3](Vector3.html)(0, 1, 0)的简码,也就是向 y 轴。 * [right](Vector3.right.html) Shorthand for writing [Vector3](Vector3.html)(1, 0, 0) 写 [Vector3](Vector3.html)(1, 0, 0)的简码,也就是向 x 轴。 ### Class Functions**类函数** * [Lerp](Vector3.Lerp.html) Linearly interpolates between two vectors. 两个向量之间的线性插值。 * [Slerp](Vector3.Slerp.html) Spherically interpolates between two vectors. 球形插值在两个向量之间。 * [OrthoNormalize](Vector3.OrthoNormalize.html) Makes vectors normalized and orthogonal to each other. 使向量规范化并且彼此相互垂直。 * [MoveTowards](Vector3.MoveTowards.html) Moves a point current towards target. 当前的地点移向目标。 * [RotateTowards](Vector3.RotateTowards.html) Rotates a vector current towards target. 当前的向量转向目标。 * [SmoothDamp](Vector3.SmoothDamp.html) Gradually changes a vector towards a desired goal over time. 随着时间的推移,逐渐改变一个向量朝向预期的目标。 * [Scale](Vector3.Scale.html) Multiplies two vectors component-wise. 两个矢量组件对应相乘。 * [Cross](Vector3.Cross.html) Cross Product of two vectors. 两个向量的交叉乘积。返回 lhs x rhs * [Reflect](Vector3.Reflect.html) Reflects the vector along the normal. 沿着法线反射向量。 * [Dot](Vector3.Dot.html) Dot Product of two vectors. 两个向量的点乘积。 * [Project](Vector3.Project.html) Projects a vector onto another vector. 投影一个向量到另一个向量。 * [Angle](Vector3.Angle.html) Returns the angle in degrees between from and to. 由 from 和 to 两者返回一个角度。 * [Distance](Vector3.Distance.html) Returns the distance between a and b. 返回 a 和 b 之间的距离。 * [ClampMagnitude](Vector3.ClampMagnitude.html) Returns a copy of vector with its magnitude clamped to maxLength. 返回向量的长度,最大不超过 maxLength 所指示的长度。 * [Min](Vector3.Min.html) Returns a vector that is made from the smallest components of two vectors. 返回一个由两个向量的最小组件组成的向量。 * [Max](Vector3.Max.html) Returns a vector that is made from the largest components of two vectors. 返回一个由两个向量的最大组件组成的向量。 * [operator +](Vector3.operator_add.html) Adds two vectors. 两个向量相加。 * [operator -](Vector3.operator_subtract.html) Subtracts one vector from another. 一个向量减另一个向量。 * [operator *](Vector3.operator_multiply.html) Multiplies a vector by a number. 由一个数乘以一个向量。 * [operator /](Vector3.operator_divide.html) Divides a vector by a number. 由一个数除一个向量。也就是 a/b。 * [operator ==](Vector3.operator_eq.html) Returns true if the vectors are equal. 如果两个向量相等,返回真。 * [operator !=](Vector3.operator_ne.html) Returns true if vectors different. 如果向量不同返回真。
da
2022年5月23日 21:47
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码