Representation of 3D vectors and points.
This structure is used throughout Unity to pass 3D positions and directions around. It also contains functions for doing common vector operations.
Besides the functions listed below, other classes can be used to manipulate vectors and points as well. For example the Quaternion and the Matrix4x4 classes are useful for rotating or transforming vectors and points.
-
Linearly interpolates between two vectors.
两个向量之间的线性插值。
-
Spherically interpolates between two vectors.
球形插值在两个向量之间。
-
Makes vectors normalized and orthogonal to each other.
使向量规范化并且彼此相互垂直。
-
Moves a point current towards target.
当前的地点移向目标。
-
Rotates a vector current towards target.
当前的向量转向目标。
-
Gradually changes a vector towards a desired goal over time.
随着时间的推移,逐渐改变一个向量朝向预期的目标。
-
Multiplies two vectors component-wise.
两个矢量组件对应相乘。
-
Cross Product of two vectors.
两个向量的交叉乘积。返回lhs x rhs
-
Reflects the vector along the normal.
沿着法线反射向量。
-
Dot Product of two vectors.
两个向量的点乘积。
-
Projects a vector onto another vector.
投影一个向量到另一个向量。
-
Returns the angle in degrees between from and to.
由from和to两者返回一个角度。
-
Returns the distance between a and b.
返回a和b之间的距离。
-
Returns a copy of vector with its magnitude clamped to maxLength.
返回向量的长度,最大不超过maxLength所指示的长度。
-
Returns a vector that is made from the smallest components of two vectors.
返回一个由两个向量的最小组件组成的向量。
-
Returns a vector that is made from the largest components of two vectors.
返回一个由两个向量的最大组件组成的向量。
-
Adds two vectors.
两个向量相加。
-
Subtracts one vector from another.
一个向量减另一个向量。
-
Multiplies a vector by a number.
由一个数乘以一个向量。
-
Divides a vector by a number.
由一个数除一个向量。也就是a/b。
-
Returns true if the vectors are equal.
如果两个向量相等,返回真。
-
Returns true if vectors different.
如果向量不同返回真。